Fix ElementaryAbelianSeries returning an invalid series after AutomorphismGroup - #6492
Conversation
The generic `SpecialPcgs` method may end up with the very pcgs it was handed, in which case it forces a fresh object so that the attributes it subsequently sets actually take effect. That check only looked at `LGWeights`, so a pcgs which already carried `IndicesEANormalSteps` (for example one produced by `PcgsCentralSeries`, where the series is central but not elementary abelian) was reused, and the following `SetIndicesEANormalSteps` was silently ignored. The result was a pcgs marked `IsSpecialPcgs` whose `IndicesEANormalSteps` disagreed with its `LGFirst`; via the implication `IsSpecialPcgs => IsPcgsElementaryAbelianSeries` this made `ElementaryAbelianSeries` return a series with a factor that is not elementary abelian, and `ElementaryAbelianSeriesLargeSteps` then looped forever on it. Widen the check to cover all series indices the method sets, and make `ElementaryAbelianSeriesLargeSteps` raise an error rather than spin when the series it is given is not elementary abelian. AI disclosure: this change was prepared with the help of Claude Code (Claude Opus 5), which reduced the reproducer, diagnosed the cause and drafted the patch and the test; reviewed by me. Fixes #6407 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6492 +/- ##
=======================================
Coverage 79.03% 79.03%
=======================================
Files 685 685
Lines 293790 293801 +11
Branches 8664 8664
=======================================
+ Hits 232203 232215 +12
+ Misses 59786 59785 -1
Partials 1801 1801 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This fixes this issue, but I wonder whether there is a more general problem When an algorithm requests a subnormal series with particular properties, it I wonder whether the interface actually needs to be different: Instead of asking for a series-exposing pcgs (and have the suitable indices It would be an incompatible change, but the use of thes attributes outside Would that make sense? Would this be many functions for different properties, or one function that gets properties specified? |
|
@hulpke that's a good point, and at least my first thought is that your idea is a good one. I'll ponder it a bit more (and let Claude also ponder it a bit more ;-). I'll also ask Claude to look through our packages to see how much these things are used there... But for now, let's merge this quick fix. |
ElementaryAbelianSeriescould return a series with a factor that is not elementary abelian, andElementaryAbelianSeriesLargeStepsthen looped forever on it:All three preparatory calls are needed.
FittingSubgroupleaves a central series pcgs onHwhich carriesIndicesEANormalSteps, although its factors need not have exponent p — here one of them is a cyclic group of order 4.AutomorphismGroupthen computesSpecialPcgs(H), and the generic method turns out to be handed that very pcgs. It has a guard for that case, which forces a fresh object so that the attributes it sets afterwards actually take effect, but the guard only testedLGWeights. So the pcgs was reused, the subsequentSetIndicesEANormalStepswas silently ignored, and the result was a pcgs markedIsSpecialPcgswhoseIndicesEANormalStepsdisagrees with itsLGFirst. Through the implicationIsSpecialPcgs => IsPcgsElementaryAbelianSeriesthe stale indices are then trusted without validation.This PR widens that guard to cover all series indices the method sets, and makes
ElementaryAbelianSeriesLargeStepsraise an error instead of spinning when it is handed a series that is not elementary abelian.It deliberately does not touch the deeper cause, namely that
TryPcgsPermGroupsetsIndicesEANormalStepson central pcgs at all (lib/pcgsperm.gi:423). That attribute is used as a generic "indices of the steps of this pcgs's series" in several places — conjugacy classes of p-groups read it off a central pcgs — so changing it needs a decision about the intended meaning of the attribute; that question is posted on the issue and still open. With this PR the containment that used to keep the situation harmless (IsPcgsElementaryAbelianSeriesvalidating the stored indices before anyone trusts them) is restored.Originally reported against CRISP (bh11/crisp#11), which only appeared in the traceback because
CompositionSeriesUnderActioncallsInvariantElementaryAbelianSeriesright afterAutomorphismGroup; it reproduces withgap -Aand no packages.Fixes #6407
AI disclosure: this change was prepared with the help of Claude Code (Claude Opus 5), which reduced the reproducer, diagnosed the cause and drafted the patch and the test; reviewed by me.