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 IsomorphismPartialPermSemigroup and Monoid for perm groups with 0 generators #1784

Merged
merged 1 commit into from
Oct 26, 2017
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
14 changes: 11 additions & 3 deletions lib/semipperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,11 @@ function(G)
local dom, S;

dom := MovedPoints(G);
S := InverseMonoid(List(GeneratorsOfGroup(G), p -> AsPartialPerm(p, dom)));
if IsEmpty(GeneratorsOfGroup(G)) then
S := InverseMonoid(EmptyPartialPerm());
else
S := InverseMonoid(List(GeneratorsOfGroup(G), p -> AsPartialPerm(p, dom)));
fi;
UseIsomorphismRelation(G, S);
SetIsGroupAsSemigroup(S, true);

Expand All @@ -373,8 +377,12 @@ function(G)
local dom, S;

dom := MovedPoints(G);
S := InverseSemigroup(List(GeneratorsOfGroup(G),
p -> AsPartialPerm(p, dom)));
if IsEmpty(GeneratorsOfGroup(G)) then
S := InverseSemigroup(EmptyPartialPerm());
else
S := InverseSemigroup(List(GeneratorsOfGroup(G),
p -> AsPartialPerm(p, dom)));
fi;
UseIsomorphismRelation(G, S);
SetIsGroupAsSemigroup(S, true);

Expand Down
27 changes: 27 additions & 0 deletions tst/testbugfix/2017-10-19-IsomorphismPartialPermSemigroup.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Issue related to IsomorphismPartialPermSemigroup and
# IsomorphismPartialPermMonoid for a trivial perm group with 0 generators
# Examples reported on issue #1783 on github.com/gap-system/gap
gap> iso := [];;
gap> iso[1] := IsomorphismPartialPermSemigroup(SymmetricGroup(1));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> iso[2] := IsomorphismPartialPermSemigroup(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> iso[3] := IsomorphismPartialPermSemigroup(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> iso[4] := IsomorphismPartialPermMonoid(SymmetricGroup(1));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> iso[5] := IsomorphismPartialPermMonoid(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> iso[6] := IsomorphismPartialPermMonoid(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> ForAll(iso, map -> () ^ map = EmptyPartialPerm());
true
gap> inv := List(iso, InverseGeneralMapping);;
gap> ForAll(inv, map -> EmptyPartialPerm() ^ map = ());
true
28 changes: 28 additions & 0 deletions tst/testinstall/semipperm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,41 @@ gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermSemigroup(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermSemigroup(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group((1,2,3)));
MappingByFunction( Group([ (1,2,3) ]), <partial perm group of rank 3 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group([()]));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true
gap> IsomorphismPartialPermMonoid(Group([], ()));
MappingByFunction( Group(()), <trivial partial perm group of rank 0 with
1 generator>, function( p ) ... end, <Attribute "AsPermutation"> )
gap> BruteForceIsoCheck(last);
true
gap> BruteForceInverseCheck(last2);
true

# Test SymmetricInverseMonoid
gap> SymmetricInverseMonoid(-1);
Expand Down