Skip to content

Commit

Permalink
Catch trivial group LatticeViaRadical and IsomorphismFpGroup
Browse files Browse the repository at this point in the history
Reported-By: Madeleine Whybrow <mlw10@ic.ac.uk>
  • Loading branch information
Markus Pfeiffer committed Jan 18, 2019
1 parent e0ac2e5 commit 485b8e0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/gpprmsya.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,11 @@ local F, # free group
relators,
i, k; # loop variables

if IsTrivial(G) then
return GroupHomomorphismByFunction(G, TRIVIAL_FP_GROUP,
x->One(TRIVIAL_FP_GROUP),
x->One(G):noassert);
fi;
# test for internal rep
if HasGeneratorsOfGroup(G) and
not ForAll(GeneratorsOfGroup(G),IsInternalRep) then
Expand Down
8 changes: 8 additions & 0 deletions lib/grplatt.gi
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,9 @@ InstallGlobalFunction(LatticeViaRadical,function(arg)
end;

G:=arg[1];
if IsTrivial(G) then
return LatticeFromClasses(G,[G^G]);
fi;
H:=fail;
select:=fail;
if Length(arg)>1 then
Expand Down Expand Up @@ -1242,6 +1245,11 @@ InstallMethod(LatticeSubgroups,"via radical",true,[IsGroup and
InstallMethod(LatticeSubgroups,"cyclic extension",true,[IsGroup and
IsFinite],0, LatticeByCyclicExtension );

InstallMethod(LatticeSubgroups, "for the trivial group", true,
[IsGroup and IsTrivial],
0,
G -> LatticeFromClasses(G,[G^G]));

RedispatchOnCondition( LatticeSubgroups, true,
[ IsGroup ], [ IsFinite ], 0 );

Expand Down
8 changes: 8 additions & 0 deletions tst/testbugfix/2019-01-18-grplatt.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
gap> LatticeSubgroups(Group(()));
<subgroup lattice of Group(()), 1 classes, 1 subgroups>
gap> IsomorphismFpGroup(SymmetricGroup(1));
MappingByFunction( Group(()), <fp group on the generators
[ ]>, function( x ) ... end, function( x ) ... end )
gap> IsomorphismFpGroup(SymmetricGroup(1), "F");
MappingByFunction( Group(()), <fp group on the generators
[ ]>, function( x ) ... end, function( x ) ... end )

0 comments on commit 485b8e0

Please sign in to comment.