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

Ensure IsomorphismPermGroup(G) always returns an isomorphism for G (before if G was a finite matrix group it sometimes returned an isomorphism for a general linear group containing G) #5339

Merged
merged 2 commits into from
Feb 1, 2023
Merged
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
7 changes: 3 additions & 4 deletions lib/grpmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -556,19 +556,18 @@ function(G)
local map;
if HasNiceMonomorphism(G) and IsPermGroup(Range(NiceMonomorphism(G))) then
map:=NiceMonomorphism(G);
if IsIdenticalObj(Source(map),G) then
return map;
fi;
return GeneralRestrictedMapping(map,G,NiceObject(G));
else
if not HasIsFinite(G) then
Info(InfoWarning,1,
"IsomorphismPermGroup: The group is not known to be finite");
fi;
map:=NicomorphismOfGeneralMatrixGroup(G,false,false);
SetNiceMonomorphism(G,map);
fi;
if IsIdenticalObj(Source(map),G) then
return map;
fi;
return GeneralRestrictedMapping(map,G,NiceObject(G));
end);

InstallMethod( IsomorphismPermGroup,
Expand Down
7 changes: 4 additions & 3 deletions lib/semitran.gi
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ InstallMethod(IsomorphismPermGroup,
function( h )
local enum, permgroup, i, perm, j, elts;

if not(IsFinite(h)) then
if not IsFinite(h) then
# What is an example where this can happen?
TryNextMethod();
fi;

if not( IsGroupHClass(h) ) then
if not IsGroupHClass(h) then
# What is an example where this can happen?
ErrorNoReturn("can only create isomorphisms of group H-classes");
fi;
Expand All @@ -145,7 +145,8 @@ function( h )
i := i+1;
od;

return MappingByFunction( h, permgroup, a -> elts[Position( enum, a )]);
return MappingByFunction( h, permgroup, a -> elts[Position( enum, a )],
a -> enum[Position( elts, a )]);
end);

# TODO can this be removed? It doesn't seem to work
Expand Down
5 changes: 5 additions & 0 deletions tst/testbugfix/2023-01-24-IsomorphismPermGroup.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# see <https://github.com/gap-system/gap/issues/3601>
gap> G:=SL(2,3);;Order(G);
24
gap> P:=Image(IsomorphismPermGroup(G));;Order(P);
24
7 changes: 4 additions & 3 deletions tst/testinstall/semitran.tst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@local BruteForceAntiIsoCheck,BruteForceInverseCheck,BruteForceIsoCheck
#@local G,H,I,S,T,enum,inv,map
#@local G,H,I,S,T,enum,inv,map,x,y
gap> START_TEST("semitran.tst");

# Test that the inverse of an isomorphism from a partial perm monoid to a
Expand Down Expand Up @@ -145,10 +145,11 @@ gap> S := Semigroup(IdentityTransformation);
# Test IsomorphismPermGroup for an H-class
gap> S := FullTransformationMonoid(4);;
gap> H := GreensHClassOfElement(S, One(S));;
gap> IsomorphismPermGroup(H);;
gap> H := GreensHClassOfElement(S, Transformation([1, 1, 2, 3]));;
gap> map := IsomorphismPermGroup(H);;
gap> for x in H do y:=Image(map, x); Assert(0, PreImagesRepresentative(map, y) = x); od;

# The Semigroups package produces different output so this test is suppressed
#gap> H := GreensHClassOfElement(S, Transformation([1, 1, 2, 3]));;
#gap> IsomorphismPermGroup(H);
#Error, can only create isomorphisms of group H-classes

Expand Down