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

Bug in Centre for PcGroups #3940

Closed
hulpke opened this issue Apr 2, 2020 · 5 comments · Fixed by #5036
Closed

Bug in Centre for PcGroups #3940

hulpke opened this issue Apr 2, 2020 · 5 comments · Fixed by #5036
Labels
kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them priority: high

Comments

@hulpke
Copy link
Contributor

hulpke commented Apr 2, 2020

The following calculation

G:=SmallGroup(2^9,261648);;
Size(Center(G));

returns a center of order 4, which is wrong (One can easily check that the center has order 8).
The error persists when converting ->FP->PC, but does not arise when converting ->Perm->Fp->PC, which indicates that it is related to the particular PC presentation.

This was reported by Benjamin Sambale

@wucas wucas added the kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them label Apr 2, 2020
@fingolfin fingolfin added the kind: bug Issues describing general bugs, and PRs fixing them label Apr 4, 2020
@fingolfin
Copy link
Member

The issue is already present in GAP 4.4.12. Eamonn O'Brien helped to verify that the group presentation etc. matches perfectly with what's in Magma. Magma produces three centre generators, [ G.5 * G.7, G.8, G.9 ]; while in GAP we get [G.8, id, G.9]. Computing the centre in an equivalent Pcp group also works:

gap> SmallGeneratingSet(Centre(PcGroupToPcpGroup(G)));
[ g5*g7*g9, g8, g9 ]

So next should be to check CentrePcGroup which is invoked here to compute the centre.

@fingolfin
Copy link
Member

The problem is in the internal function NextStepCentralizer( <gens>, <cent>, <pcgsF>, <field> ) (or possibly in how it is used): That function would be correct if cent modulo pcgsF was elementary abelian. But in general it is just abelian. And in this concrete example it goes wrong when cent contains an element of order 4. Then we get to a point in the iteration of NextStepCentralizer where the auxiliary variable newgens contains an element of order 4 and its inverse; both act non-trivially, but their squares acts trivial (and is in the center). Alas, instead we compute their product, which of course is the one element.

So here is one possible fix (confirmed to work in experiments)

diff --git a/lib/grppcatr.gi b/lib/grppcatr.gi
index 044c73782..abb17b908 100644
--- a/lib/grppcatr.gi
+++ b/lib/grppcatr.gi
@@ -724,8 +724,9 @@ end);
 #F  NextStepCentralizer( <gens>, <cent>, <pcgsF>, <field> )
 ##
 NextStepCentralizer := function( gens, cent, pcgsF, field )
-    local   g,  newgens,  matlist,  notcentral,  h,  comm,  null,  j,  elm;
+    local   g,  newgens,  matlist,  notcentral,  h,  comm,  null,  j,  elm,  p;
   
+    p := Characteristic( field );
     for g in gens do
         if Length( cent ) = 0 then return []; fi;
 
@@ -750,7 +751,10 @@ NextStepCentralizer := function( gens, cent, pcgsF, field )
             # calculate elements corresponding to null
             for j  in [1..Length(null)]  do
                 elm := PcElementByExponentsNC( pcgsF, notcentral, null[j] );
-                Add( newgens, elm );
+                while not elm in GroupOfPcgs( pcgsF ) do
+                    Add( newgens, elm );
+                    elm := elm ^ p;
+                od;
             od;
         fi;
         cent := newgens;

An alternate way to think about this is that cent should always form (resp. contain) a pcgs for the subgroup it generates (modulo pcgsF), but the current code does not ensure that all powers of elements are in there.

Perhaps there is a better, more clever solution, but at 2 AM at night I can't think of one. Perhaps @hulpke or @beick have better / alternative suggestions.

For the record, the corresponding code in the polycyclic package (see function PcpNextStepCentralizer) is almost identical. It does produce the right result here, but my impression is that this is more by chance than by design, and slightly rearranging the input example might give wrong results there, too. However, I might be missing something there...

@hulpke
Copy link
Contributor Author

hulpke commented Apr 6, 2020

Thank you, @fingolfin, for investigating. What you propose certainly will not introduce other problems. The question is whether this ommission is just an oversight, or if there is an implicit assumption on the generators that is not always satisfied:

Is the function using the familyPcgs, or a specialPcgs?

Is the result of this ruotine used as generators for a group, or is the assumption that it returns a pcgs?

@beick
Copy link

beick commented Apr 6, 2020 via email

@fingolfin
Copy link
Member

I've made PR #5036 with a patch bei @beick suggested via email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them priority: high
Projects
None yet
4 participants