Skip to content

Commit

Permalink
grpfp: fix enumerator for fp groups with a known cyclic subgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Mar 16, 2024
1 parent 9404db1 commit e222f46
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/grpfp.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1364,3 +1364,5 @@ DeclareGlobalFunction("MakeFpGroupToMonoidHomType1");

# used in homomorphisms
DeclareGlobalName("TRIVIAL_FP_GROUP");

DeclareAttribute("CyclicSubgroupFpGroup", IsFpGroup);
13 changes: 13 additions & 0 deletions lib/grpfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3930,6 +3930,7 @@ local fgens, # generators of the free group
RelatorsOfFpGroup(G),GeneratorsOfGroup(H),true,false:
cyclic:=true,limit:=1+max );
e:=NEWTC_CyclicSubgroupOrder(T);
SetCyclicSubgroupFpGroup(G, H);
if e=0 then
return infinity;
else
Expand Down Expand Up @@ -5518,6 +5519,18 @@ end );
InstallMethod( Enumerator,"fp gp.", true,[IsSubgroupFpGroup and IsFinite],0,
G->RightTransversal(G,TrivialSubgroup(G)));

InstallMethod(Enumerator,
"for a finite subgroup of a finitely presented group with known cyclic subgroup",
[IsSubgroupFpGroup and IsFinite and HasCyclicSubgroupFpGroup],
function(G)
local H;
H := CyclicSubgroupFpGroup(G);
if Size(H) = 1 then # Checking IsTrivial is slow
TryNextMethod();
fi;
return Concatenation(List(RightTransversal(G, H), x -> AsList(H) * x));
end);

InstallGlobalFunction(NewmanInfinityCriterion,function(G,p)
local GO,q,d,e,b,r,val,agemo,ngens;
if not IsPrimeInt(p) then
Expand Down
53 changes: 53 additions & 0 deletions tst/testbugfix/2024-03-16-FpGroups.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
gap> F:=FreeGroup(2);; f1:=F.1;; f2:=F.2;;
gap> G := F / [ f2^100, f1^2, f2*f1*f2^-99*f1^-1 ];;
gap> Size(G);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45>,
<[ [ 1, -45 ] ]|f2^-45>, <[ [ 1, 46 ] ]|f2^46>, <[ [ 1, -46 ] ]|f2^-46>,
<[ [ 1, 47 ] ]|f2^47>, <[ [ 1, -47 ] ]|f2^-47>, <[ [ 1, 48 ] ]|f2^48>,
<[ [ 1, -48 ] ]|f2^-48>, <[ [ 1, 49 ] ]|f2^49>, <[ [ 1, -49 ] ]|f2^-49>,
<[ [ 1, 50 ] ]|f2^50>, f1, f2*f1, f2^-1*f1, f2^2*f1, f2^-2*f1, f2^3*f1,
f2^-3*f1, f2^4*f1, f2^-4*f1, f2^5*f1, f2^-5*f1, f2^6*f1, f2^-6*f1, f2^7*f1,
f2^-7*f1, f2^8*f1, f2^-8*f1, f2^9*f1, f2^-9*f1, f2^10*f1, f2^-10*f1,
f2^11*f1, f2^-11*f1, f2^12*f1, f2^-12*f1, f2^13*f1, f2^-13*f1, f2^14*f1,
f2^-14*f1, f2^15*f1, f2^-15*f1, f2^16*f1, f2^-16*f1, f2^17*f1, f2^-17*f1,
f2^18*f1, f2^-18*f1, f2^19*f1, f2^-19*f1, f2^20*f1, f2^-20*f1, f2^21*f1,
f2^-21*f1, f2^22*f1, f2^-22*f1, f2^23*f1, f2^-23*f1, f2^24*f1, f2^-24*f1,
f2^25*f1, f2^-25*f1, f2^26*f1, f2^-26*f1, f2^27*f1, f2^-27*f1, f2^28*f1,
f2^-28*f1, f2^29*f1, f2^-29*f1, f2^30*f1, f2^-30*f1, f2^31*f1, f2^-31*f1,
f2^32*f1, f2^-32*f1, f2^33*f1, f2^-33*f1, f2^34*f1, f2^-34*f1, f2^35*f1,
f2^-35*f1, f2^36*f1, f2^-36*f1, f2^37*f1, f2^-37*f1, f2^38*f1, f2^-38*f1,
f2^39*f1, f2^-39*f1, f2^40*f1, f2^-40*f1, f2^41*f1, f2^-41*f1, f2^42*f1,
f2^-42*f1, f2^43*f1, f2^-43*f1, f2^44*f1, f2^-44*f1, f2^45*f1, f2^-45*f1,
f2^46*f1, f2^-46*f1, f2^47*f1, f2^-47*f1, f2^48*f1, f2^-48*f1, f2^49*f1,
f2^-49*f1, f2^50*f1 ]

0 comments on commit e222f46

Please sign in to comment.