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 an error in the Modified Todd-Coxeter (subgroup presentations on specified generators) that could lead to wrong results when using IsomorphismFpGroupByGenerators #5469

Merged
merged 1 commit into from
Jun 29, 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
16 changes: 9 additions & 7 deletions lib/sgpres.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3351,7 +3351,7 @@ local DATA,start,w,offset,c,i,j;
end );

DeclareGlobalName("NEWTC_ReplacedStringCyclic");
BindGlobal( "NEWTC_ReplacedStringCyclic", function(s,r)
BindGlobal( "NEWTC_ReplacedStringCyclic", function(s,r,cyc)
local p,new,start,half;
if Length(s)<Length(r) or Length(r)=0 then
return s;
Expand Down Expand Up @@ -3379,7 +3379,7 @@ local p,new,start,half;
new:=s;
fi;

if Length(r)=1 then
if Length(r)=1 or cyc=false then
return new; # no overlap or so possible
fi;

Expand All @@ -3399,7 +3399,8 @@ local p,new,start,half;
# second half arises later. Does also first half arise -- if so we need
# to go through once more
if new{[p-half+1..p-1]}=r{[1..half-1]} then
return NEWTC_ReplacedStringCyclic(new,r);
new:=NEWTC_ReplacedStringCyclic(new,r,cyc);
return new;
fi;
fi;

Expand Down Expand Up @@ -3540,8 +3541,8 @@ local DATA,rels,i,j,w,f,r,s,fam,ri,a,offset,rset,re,stack,pres,
ri:=Length(r);
# reduce with others
for j in rels do
r:=NEWTC_ReplacedStringCyclic(r,j);
r:=NEWTC_ReplacedStringCyclic(r,-Reversed(j));
r:=NEWTC_ReplacedStringCyclic(r,j,true);
r:=NEWTC_ReplacedStringCyclic(r,-Reversed(j),true);
od;
Info(InfoFpGroup,3,"Relatorlen ",ri,"->",Length(r));

Expand All @@ -3557,7 +3558,7 @@ local DATA,rels,i,j,w,f,r,s,fam,ri,a,offset,rset,re,stack,pres,
while j<=Length(rels) do
s:=rels[j];
for re in rset do;
s:=NEWTC_ReplacedStringCyclic(s,re);
s:=NEWTC_ReplacedStringCyclic(s,re,true);
od;
if not IsIdenticalObj(s,rels[j]) then
if Length(s)>0 then
Expand All @@ -3578,7 +3579,8 @@ local DATA,rels,i,j,w,f,r,s,fam,ri,a,offset,rset,re,stack,pres,
s:=DATA.aug[a+offset][j];
if Length(s)>=Length(r) then
for re in rset do
s:=NEWTC_ReplacedStringCyclic(s,re);
# NOT cyclic replace!
s:=NEWTC_ReplacedStringCyclic(s,re,false);
od;
DATA.aug[a+offset][j]:=s;
fi;
Expand Down
11 changes: 11 additions & 0 deletions tst/testbugfix/2023-06-28-MTC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overly eager cyclic replace in MTC, #5467

gap> f := FreeGroup(4);;
gap> g := f / [f.1^2, f.2^2, f.3^2, f.4^2, (f.1*f.4)^2, (f.2*f.4)^2,
> (f.3*f.4)^4, (f.1*f.2)^4, (f.1*f.3)^2, (f.2*f.3)^4, (f.1*f.2*f.3*f.2)^3,
> (f.2*f.3*f.4*f.3)^3];;
gap> h := Subgroup(g, [g.1,g.2,g.3]);;
gap> iso2 := IsomorphismFpGroupByGenerators(h, GeneratorsOfGroup(h));;
gap> h2 := Image(iso2);;
gap> Size(h2);
72