Skip to content

Commit

Permalink
gprd: fix PrimePGroup for trivial direct products
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson authored and fingolfin committed Oct 2, 2017
1 parent 221df9d commit 4a25b3c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/gprd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,15 @@ end );
InstallMethod( PrimePGroup, "for direct products",
[IsPGroup and HasDirectProductInfo],
function( D )
local groups, p;
local groups, p, H;
groups := DirectProductInfo(D).groups;
Assert(1, ForAll(groups, IsPGroup));
p := PrimePGroup(First(groups, G -> PrimePGroup(G) <> fail));
H := First(groups, G -> PrimePGroup(G) <> fail);
if H = fail then
SetIsTrivial(D, true);
return fail;
fi;
p := PrimePGroup(H);
Assert(1, ForAll(groups, G -> PrimePGroup(G) in [fail, p]));
return p;
end );
Expand Down
14 changes: 14 additions & 0 deletions tst/testbugfix/2017-09-29-PrimePGroup.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Issue related to PrimePGroup for a direct product of trivial groups
#
gap> G := DirectProduct(TrivialGroup(IsPcGroup), TrivialGroup(IsPcGroup));
<pc group of size 1 with 0 generators>
gap> PrimePGroup(G);
fail
gap> A := Group(Transformation([1, 2, 3]));;
gap> B := DirectProduct(A, A);;
gap> IsPGroup(B);
true
gap> HasDirectProductInfo(B);
true
gap> PrimePGroup(B);
fail

0 comments on commit 4a25b3c

Please sign in to comment.