Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: wreath product with trivial group contains trivial generators #5826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions lib/gprdmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@
local f,n,m,Agens,Bgens,emb,i,j,a,g,dim,rans,range,orbs;
f:=DefaultFieldOfMatrixGroup(A);
n:=DimensionOfMatrixGroup(A);
m:=LargestMovedPoint(B);
# force trivial top group to act on one point
m:=Maximum(1, LargestMovedPoint(B));
dim:=n*m;
emb:=[];
rans:=[];
Expand All @@ -272,11 +273,26 @@
emb[j]:=Agens;
od;
orbs := OrbitsDomain(B);
Agens := Concatenation(List(orbs, orb -> emb[orb[1]]));

Bgens:=List(GeneratorsOfGroup(B),
x->KroneckerProduct(PermutationMat(x,m,f),One(A)));
g:=Group(Concatenation(Agens,Bgens));
# force trivial top group to act on one point
if IsEmpty(orbs) then
orbs := [[1]];

Check warning on line 278 in lib/gprdmat.gi

View check run for this annotation

Codecov / codecov/patch

lib/gprdmat.gi#L278

Added line #L278 was not covered by tests
fi;
# generators for the cases where one component is trivial
if IsTrivial(A) and IsTrivial(B) then
g := Group( One(A) );

Check warning on line 282 in lib/gprdmat.gi

View check run for this annotation

Codecov / codecov/patch

lib/gprdmat.gi#L282

Added line #L282 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just

Suggested change
g := Group( One(A) );
g := A:

or if one really wants a new group:

Suggested change
g := Group( One(A) );
g := TrivialSubgroup( A );

elif IsTrivial(A) then
Bgens:=List(GeneratorsOfGroup(B),
x->PermutationMat(x,m,f));
g := Group(Bgens);

Check warning on line 286 in lib/gprdmat.gi

View check run for this annotation

Codecov / codecov/patch

lib/gprdmat.gi#L284-L286

Added lines #L284 - L286 were not covered by tests
elif IsTrivial(B) then
Agens := Concatenation(List(orbs, orb -> emb[orb[1]]));
g := Group(Agens);
else

Check warning on line 290 in lib/gprdmat.gi

View check run for this annotation

Codecov / codecov/patch

lib/gprdmat.gi#L288-L290

Added lines #L288 - L290 were not covered by tests
Agens := Concatenation(List(orbs, orb -> emb[orb[1]]));
Bgens:=List(GeneratorsOfGroup(B),
x->KroneckerProduct(PermutationMat(x,m,f),One(A)));
g:=Group(Concatenation(Agens,Bgens));
fi;
if HasSize(A) then
SetSize(g,Size(A)^m*Size(B));
fi;
Expand Down
37 changes: 24 additions & 13 deletions lib/gprdperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -621,16 +621,21 @@ local G,H, # factors
# force trivial group to act on 1 point
if degG = 0 then domG := [1]; degG := 1; fi;

for i in [1..degI] do
components[i]:=[(i-1)*degG+1..i*degG];
shift := MappingPermListList( domG, components[i] );
Add(perms,shift);
for gen in Ggens do
Add( gens, gen ^ shift );
od;
if i=1 then gens1:=ShallowCopy(gens);fi;
od;
basegens:=ShallowCopy(gens);
if IsTrivial(G) then
gens1 := [ One(G) ];
basegens := ShallowCopy(gens1);
Comment on lines +625 to +626
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does taking an empty list here not work?

else
for i in [1..degI] do
components[i]:=[(i-1)*degG+1..i*degG];
shift := MappingPermListList( domG, components[i] );
Add(perms,shift);
for gen in Ggens do
Add( gens, gen ^ shift );
od;
if i=1 then gens1:=ShallowCopy(gens);fi;
od;
basegens:=ShallowCopy(gens);
fi;

# reduce generator number if it becomes too large -- only first base
# part
Expand All @@ -649,7 +654,9 @@ local G,H, # factors
od;
od;
shift:=PermList(shift);
Add( gens, shift );
if not IsOne(shift) then
Add( gens, shift );
fi;
Add(hgens, shift );
od;

Expand Down Expand Up @@ -1039,7 +1046,9 @@ InstallGlobalFunction( WreathProductProductAction, function( G, H )
( Position( domG, domG[ q ] ^ gen ) - q ) * val );
od;
q:=PermList( list + 1 );
Add(gens,q);
if not IsOne(q) then
Add(gens,q);
fi;
Add(basegens[i],q);
val := Val;
od;
Expand All @@ -1060,7 +1069,9 @@ InstallGlobalFunction( WreathProductProductAction, function( G, H )
Add( list, q );
od;
q:=PermList( list + 1 );
Add(gens,q);
if not IsOne(q) then
Add(gens,q);
fi;
Add(hgens,q);
od;
W := GroupByGenerators( gens, () ); # `gens' arose from `PermList'
Expand Down
53 changes: 53 additions & 0 deletions tst/testbugfix/2024_10_24_WreathProductWIthTrivialGroups.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
gap> START_TEST("WreathProductWithTrivialGroups.tst");
gap> P := SymmetricGroup(3);;
gap> IP := Group( One(P) );;
gap> M := GL(6, 5);;
gap> IM := Group( One(M) );;

# Generators should not contain the identity element,
# unless the group is trivial.
gap> checkGens := function(G)
> local gens;
> gens := GeneratorsOfGroup(G);
> return gens = [One(G)] or ForAll(gens, g -> g <> One(G));
> end;;

# imprimitive perm, trivial top
gap> checkGens( WreathProduct(P, IP) );
true

# imprimitive perm, trivial base
gap> checkGens( WreathProduct(IP, P) );
true

# imprimitive perm, trivial base and top
gap> checkGens( WreathProduct(IP, IP) );
true

# imprimitive mat, trivial top
gap> checkGens( WreathProduct(M, IP) );
true

# imprimitive mat, trivial base
gap> checkGens( WreathProduct(IM, P) );
true

# imprimitive mat, trivial base and top
gap> checkGens( WreathProduct(IM, IP) );
true

# product action perm, trivial top
gap> checkGens( WreathProductProductAction(P, IP) );
true

# product action perm, trivial base
gap> checkGens( WreathProductProductAction(IP, P) );
true

# product action perm, trivial base and top
gap> checkGens( WreathProductProductAction(IP, IP) );
true

#
gap> STOP_TEST("WreathProductWithTrivialGroups.tst");
Loading