Skip to content

Commit

Permalink
Reject invalid arguments for SolvableQuotient (#5682)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Mar 27, 2024
1 parent 50ceb5b commit 816c79a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/grppcfp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,9 @@ local G, epi, tup, lift, i, found, fac, j, p, iso;
fi;
Info(InfoSQ,1,"found quotient of size ", Size(G));
od;
fi;

# if <primes> is a list of primes, we have to use try and error
if IsList( primes ) and IsInt( primes[1] ) then
elif IsList( primes ) and IsInt( primes[1] ) then
found := true;
i := 1;
while found and i <= Length( primes ) do
Expand All @@ -832,10 +831,9 @@ local G, epi, tup, lift, i, found, fac, j, p, iso;
fi;
Info(InfoSQ,1,"found quotient of size ", Size(G));
od;
fi;

# if <primes> is an integer it is size we want
if IsInt(primes) then
elif IsInt(primes) then
if not IsInt(primes/Size(G)) then
i:=Lcm(primes,Size(G));
Info(InfoWarning,1,"Added extra factor ",i/primes,
Expand Down Expand Up @@ -866,6 +864,8 @@ local G, epi, tup, lift, i, found, fac, j, p, iso;
Info(InfoSQ,1,"found quotient of size ", Size(G));
od;
od;
else
Error("<primes> must be either an integer, a list of integers, or a list of integer lists");
fi;

# this is the result - should be G only with set epimorphism
Expand Down
33 changes: 33 additions & 0 deletions tst/testinstall/opers/SolvableQuotient.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
gap> START_TEST("SolvableQuotient.tst");

#
gap> f := FreeGroup( "a", "b", "c", "d" );;
gap> fp := f / [ f.1^2, f.2^2, f.3^2, f.4^2, f.1*f.2*f.1*f.2*f.1*f.2,
> f.2*f.3*f.2*f.3*f.2*f.3*f.2*f.3, f.3*f.4*f.3*f.4*f.3*f.4,
> f.1^-1*f.3^-1*f.1*f.3, f.1^-1*f.4^-1*f.1*f.4,
> f.2^-1*f.4^-1*f.2*f.4 ];;
gap> hom:=EpimorphismSolvableQuotient(fp,300);Size(Image(hom));
[ a, b, c, d ] -> [ f1*f2, f1*f2, f2*f3, f2 ]
12
gap> hom:=EpimorphismSolvableQuotient(fp,[2,3]);Size(Image(hom));
[ a, b, c, d ] -> [ f1*f2*f4, f1*f2*f6*f8, f2*f3, f2 ]
1152
gap> EpimorphismSolvableQuotient(fp,fail);
Error, <primes> must be either an integer, a list of integers, or a list of in\
teger lists

#
gap> SolvableQuotient(fp,300);
rec( image := <pc group of size 12 with 3 generators>,
imgs := [ f1*f2, f1*f2, f2*f3, f2 ], source := <fp group on the generators
[ a, b, c, d ]> )
gap> SolvableQuotient(fp,[2,3]);
rec( image := <pc group of size 1152 with 9 generators>,
imgs := [ f1*f2*f4, f1*f2*f6*f8, f2*f3, f2 ],
source := <fp group on the generators [ a, b, c, d ]> )
gap> SolvableQuotient(fp,fail);
Error, <primes> must be either an integer, a list of integers, or a list of in\
teger lists

#
gap> STOP_TEST("SolvableQuotient.tst", 10000);

0 comments on commit 816c79a

Please sign in to comment.