From 0c82d97b4dac808b389d738d8dba10e16add7097 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Nov 2026 09:54:42 +0100 Subject: [PATCH] Fix two C6 failures behind the MatC6 long orbit On the 27-dimensional projective node of MatC6.tst, 3^(1+6):Sp(6,3), the first C6 call returned TemporaryFailure in 3 of 100 seeds. Method selection then ran StabilizerChainProj on PG(26,25) before retrying C6: over 10^7 points in seed 6. There were two causes. RECOG.basis2 advanced k before unbinding a scalar gens[k], so the generator after each scalar was dropped unseen. With 13 scalars among 19 conjugates (seed 48) it found 2 of 3 hyperbolic pairs. C6 takes the conjugates of an element of the r-core R from TestAbelian as generators of R. The conjugators are the node's pseudo-random elements, which can be badly mixed: 6 of 8 generators lie in R, and in seeds 6 and 90, 27 and 32 of the first 40 random elements map to elements of order at most 2 in Sp(6,3). The conjugates then span a subspace of R/Z(R) that the group does not normalise, and some generator fails to rewrite. Now C6 adds a conjugate of a random subproduct under each failing generator and retries, up to 4 rounds per dimension of R/Z(R). The successful path is unchanged. With both fixes the first C6 call succeeds for seeds 1-100. Assisted-by: Generative AI --- gap/projective/c6.gi | 71 ++++++++++++++++++-------------- tst/working/quick/ProjC6Core.tst | 31 ++++++++++++++ 2 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 tst/working/quick/ProjC6Core.tst diff --git a/gap/projective/c6.gi b/gap/projective/c6.gi index f5c930e3..5c07eb34 100644 --- a/gap/projective/c6.gi +++ b/gap/projective/c6.gi @@ -233,20 +233,14 @@ RECOG.basis2:=function(r,n,q,g) k:=1; repeat - if IsBound(gens[k]) then - if not RECOG.IsScalarMat(gens[k]) then - a:=gens[k]; - posa:=k; - else - k:=k+1; - fi; - Unbind(gens[k]); - else - k:=k+1; + if IsBound(gens[k]) and not RECOG.IsScalarMat(gens[k]) then + a:=gens[k]; + posa:=k; fi; + Unbind(gens[k]); + k:=k+1; until posa > 0 or k > len; if posa > 0 then - k:=k+1; repeat if IsBound(gens[k]) then if RECOG.IsScalarMat(gens[k]) then @@ -474,6 +468,10 @@ RECOG.BlindDescent := function(r,n,grp,limit) end; +# Bound on the rounds that enlarge the span of the -core conjugates in +# New2RecogniseC6, per dimension of R/Z(R). +RECOG.C6ClosureRoundsPerDim := 4; + ############################################################################# ## #F RecogniseC6() . . . . . . . . . . . . . . . . @@ -491,7 +489,7 @@ end; RECOG.New2RecogniseC6 := function(grp) local type, blocks, spaces, xxx, d, b, ppi, - r, n, q, u, rgrp, grpbasis, igens, list, i, grp1; + r, n, q, u, rlist, round, grpbasis, igens, list, i, grp1; d := DimensionOfMatrixGroup(grp); q := Size(FieldOfMatrixGroup(grp)); @@ -515,27 +513,36 @@ RECOG.New2RecogniseC6 := function(grp) u := b[1]; ## take enough conjugates to generate the -core - rgrp := Group(b[2]); - ## try to find a set of standard gens for - grpbasis := RECOG.basis2(r,n,q,rgrp); - # BlindDescent is randomized and only tests for an abelian witness. If the - # stronger basis construction fails, reject this C6 attempt and let method - # selection retry later instead of aborting recognition. - if grpbasis = fail then - return TemporaryFailure; - fi; + rlist := b[2]; + for round in [0 .. RECOG.C6ClosureRoundsPerDim * 2 * n] do + ## try to find a set of standard gens for + grpbasis := RECOG.basis2(r,n,q,Group(rlist)); + # BlindDescent is randomized and only tests for an abelian witness. If + # the stronger basis construction fails, reject this C6 attempt and let + # method selection retry later instead of aborting recognition. + if grpbasis = fail then + return TemporaryFailure; + fi; - ## construct image of in classical group - Info(InfoRecog,3,"enter image computation"); - igens := List(GeneratorsOfGroup(grp), - x->RECOG.rewriteones(r,n,q,grpbasis.basis,grpbasis.blocks,x)); - Info(InfoRecog,3,"exit image computation"); - if Position(igens,fail) = fail then - return rec( igens := igens, basis := grpbasis, - r := r, n := n, q := q ); - else - return TemporaryFailure; - fi; + ## construct image of in classical group + Info(InfoRecog,3,"enter image computation"); + igens := List(GeneratorsOfGroup(grp), + x->RECOG.rewriteones(r,n,q,grpbasis.basis,grpbasis.blocks,x)); + Info(InfoRecog,3,"exit image computation"); + if not fail in igens then + return rec( igens := igens, basis := grpbasis, + r := r, n := n, q := q ); + fi; + + # spans a subspace of R/Z(R) that the generators which failed + # to rewrite do not normalise, for example because the pseudo-random + # conjugators in TestAbelian were badly mixed. Add conjugates under + # those generators; each enlarges the span with probability >= 1/2. + for i in Positions(igens, fail) do + Add(rlist, RandomSubproduct(rlist)^GeneratorsOfGroup(grp)[i]); + od; + od; + return TemporaryFailure; end; diff --git a/tst/working/quick/ProjC6Core.tst b/tst/working/quick/ProjC6Core.tst new file mode 100644 index 00000000..856268f4 --- /dev/null +++ b/tst/working/quick/ProjC6Core.tst @@ -0,0 +1,31 @@ +gap> START_TEST("ProjC6Core.tst"); + +# A scalar in the generator list must not hide the generator after it. +# Here T and D form a hyperbolic pair of 3^(1+2). +gap> T := PermutationMat((1,2,3), 3, GF(7));; +gap> D := DiagonalMat([1, Z(7)^2, Z(7)^4] * Z(7)^0);; +gap> res := RECOG.basis2(3, 1, 7, GroupWithGenerators([One(T), T, D]));; +gap> res.blocks; +[ ] +gap> Length(res.basis.sympl); +2 + +# If the conjugates found by BlindDescent span a subspace of R/Z(R) that the +# group does not normalise, C6 must enlarge it rather than give up. A single +# element of R spans such a subspace. +gap> h := RECOG.MakeC6Group(Sp(4,3), Sp(4,3), 7);; +gap> G := h[1];; +gap> a := GeneratorsOfGroup(G)[1];; +gap> BlindDescent := RECOG.BlindDescent;; +gap> RECOG.BlindDescent := function(r, n, grp, limit) +> return [a, [a]]; +> end;; +gap> re := RECOG.New2RecogniseC6(G);; +gap> RECOG.BlindDescent := BlindDescent;; +gap> re.basis.blocks; +[ ] +gap> Size(Group(re.igens)) = Size(Sp(4,3)); +true + +# +gap> STOP_TEST("ProjC6Core.tst");