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 error in code handling subgroups of finitely presented groups with generators of order 2 which could lead to wrong results #5747

Merged
merged 1 commit into from
Jun 17, 2024
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
8 changes: 8 additions & 0 deletions lib/sgpres.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2978,6 +2978,10 @@ local m,offset,rels,ri,ccr,i,r,ct,A,a,w,n,DATA,p,dr,
for i in ri do
r:=i;
while not r in ccr[offset+r[1]] do
# replace order 2 gens
for j in [1..Length(r)] do
if -r[j] in ordertwo then r[j]:=-r[j];fi;
od;
AddSet(ccr[offset+r[1]],Immutable(r));
r:=Concatenation(r{[2..Length(r)]},r{[1]});
od;
Expand Down Expand Up @@ -3191,9 +3195,12 @@ local m,offset,rels,ri,ccr,i,r,ct,A,a,w,n,DATA,p,dr,
i:=i+1;
od;


NEWTC_Compress(DATA,true); # always compress at the end
DATA.index:=DATA.n;

Info(InfoFpGroup,3,"found index ",DATA.index);

if Length(collapse)>0 then
Info(InfoFpGroup,3,DATA.defcount," definitions");
# which collapses gave at least 1%
Expand Down Expand Up @@ -3242,6 +3249,7 @@ local freegens,freerels,subgens,aug,trace,e,ldc,up,bastime,start,bl,bw,first,tim
trace:=arg[5];
fi;
start:=timerFunc();

if aug and trace=false then
e:=NEWTC_DoCosetEnum(freegens,freerels,subgens,aug,trace);
if e=fail then return fail;fi;
Expand Down
5 changes: 5 additions & 0 deletions tst/testbugfix/2024-06-17-MTC.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Fix #5744
gap> f := FreeGroup("a","b");;
gap> g := f / [ f.1*f.1,f.1*f.2*f.1*f.2*f.1*f.2,f.1*f.2*f.2*f.1*f.2^-1 ];;
gap> Size(g);
1
Loading