From 7a4b171a24a924babe1078e17dd0592e571a635e Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Mon, 17 Dec 2018 17:43:55 +0100 Subject: [PATCH] FIX: GQuotients can hang for certain groups with free quotients --- lib/grpfp.gi | 26 ++++++++++++++++--------- tst/testbugfix/2018-12-17-gquotient.tst | 7 +++++++ 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 tst/testbugfix/2018-12-17-gquotient.tst diff --git a/lib/grpfp.gi b/lib/grpfp.gi index 9d5bdf7720b..7d277aa88f1 100644 --- a/lib/grpfp.gi +++ b/lib/grpfp.gi @@ -5134,7 +5134,7 @@ InstallMethod(StoredExcludedOrders,"fp group",true, InstallGlobalFunction(ExcludedOrders, function(arg) -local f,a,i,j,gens,tstord,excl,p,s; +local f,a,b,i,j,gens,tstord,excl,p,s; f:=arg[1]; s:=StoredExcludedOrders(f); gens:=FreeGeneratorsOfFpGroup(f); @@ -5170,24 +5170,32 @@ local f,a,i,j,gens,tstord,excl,p,s; else p:=PresentationFpGroup(f,0); AddRelator(p,p!.generators[i]^j); + TzInitGeneratorImages(p); TzGoGo(p); if Length(p!.generators)=0 then AddSet(excl[i],j); AddSet(s[i][1],j); else if i=1 then - a:=[gens[2]]; + b:=[gens[2]]; else - a:=[gens[1]]; + b:=[gens[1]]; fi; a:=CosetTableFromGensAndRels(gens, - Concatenation(RelatorsOfFpGroup(f),[gens[i]^j]),a: + Concatenation(RelatorsOfFpGroup(f),[gens[i]^j]),b: max:=15999,silent); - if IsList(a) and Length(a[1])=1 and - # now we can try the size - Size(FpGroupPresentation(p))=1 then - AddSet(excl[i],j); - AddSet(s[i][1],j); + if IsList(a) and Length(a[1])=1 then + a:=FpGroupPresentation(p); + b:=List(b,x->MappedWord(x,FreeGeneratorsOfFpGroup(f),TzImagesOldGens(p))); + b:=List(b,x->MappedWord(x,p!.generators,GeneratorsOfGroup(a))); + # now we can try the size. Ensure we use the generator we know + a:=NEWTC_CosetEnumerator(FreeGeneratorsOfFpGroup(a),RelatorsOfFpGroup(a), + List(b,UnderlyingElement), true, false : cyclic := true, + limit := 50000 ); + if NEWTC_CyclicSubgroupOrder(a)=1 then + AddSet(excl[i],j); + AddSet(s[i][1],j); + fi; fi; fi; fi; diff --git a/tst/testbugfix/2018-12-17-gquotient.tst b/tst/testbugfix/2018-12-17-gquotient.tst new file mode 100644 index 00000000000..d539f8e9107 --- /dev/null +++ b/tst/testbugfix/2018-12-17-gquotient.tst @@ -0,0 +1,7 @@ +# reported by Giles Gardam. The code for eliminating element orders can run astray if +# a quotent by a generator power is cyclic, but also has cyclic subgroups of infinite +# index. +gap> F := FreeGroup("a", "b", "c");; +gap> G := F/ParseRelators(F,"a2b5a2b2C2,a5c3B2");; +gap> Length(GQuotients(G,AlternatingGroup(5))); +1