Skip to content

feat(math): add Galois theory operations (#1862) - #2047

Open
morluto wants to merge 1 commit into
mainfrom
agent/galois-theory-1862
Open

feat(math): add Galois theory operations (#1862)#2047
morluto wants to merge 1 commit into
mainfrom
agent/galois-theory-1862

Conversation

@morluto

@morluto morluto commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the domain with 4 atomic operations for polynomial Galois theory.

Closes #1862

Operations

Operation Description
polynomial.galois.factor_mod_p.compute Factor polynomial over GF(p) using SymPy
polynomial.galois.frobenius_cycle.compute Compute Frobenius cycle type from factorization
polynomial.galois_group.compute Compute Galois group over Q using SymPy
polynomial.solvable_by_radicals.decide Check solvability by radicals

Design

  • SymPy factorization: Uses SymPy's over GF(p) for exact finite-field polynomial factorization.
  • Frobenius cycle: Derived from the factorization degree pattern, sorted in descending order.
  • Galois group: Uses SymPy's function for exact computation over Q.
  • Solvability: A polynomial of degree ≤ 4 is solvable by radicals (Galois group solvable); degree ≥ 5 is not.

Continue this on Linzumi

Add galois_theory domain with 4 operations: factorization over GF(p),
Frobenius cycle type, Galois group computation, and solvability by
radicals. Uses SymPy for exact polynomial factorization over finite
fields and Galois group computation over Q.

Closes #1862
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

morluto commented Aug 18, 2026

Copy link
Copy Markdown
Owner Author

Deep review summary

Verdict: REQUEST CHANGES — every high-level Galois/solvability result is currently incorrect or outside the backend's supported domain.

1. solvable_by_radicals is false for all degrees ≥5

Degree is not a solvability criterion. A polynomial is solvable by radicals iff its Galois group is solvable. For example, x^5-2 is irreducible and solvable by radicals; its roots are fifth roots of 2 multiplied by fifth roots of unity, and its Galois group is solvable. The current operation returns False solely because the degree is 5.

Delete the degree-only operation or compute the actual Galois group and test group solvability.

2. compute_galois_group() reads the SymPy return value incorrectly

SymPy returns (G, alt), where alt is a boolean indicating containment in the alternating group—not the group order. int(group[1]) therefore returns 0 or 1; 0 can fail result validation and 1 is a fabricated order. The order is G.order(), and solvability must be obtained from the permutation group, not from degree <= 4 or order <= 24.

The request accepts degree up to 12, but SymPy's documented galois_group domain is irreducible polynomials over QQ/ZZ of degree at most 6. Reducibility and unsupported degree must be encoded at the boundary/result rather than leaking backend exceptions. The coefficient list must also be converted using the repository's declared constant-first convention instead of passed directly to Poly's descending-coefficient constructor.

3. Modular irreducibility ignores multiplicity

factor_list() returns (factor, multiplicity) pairs, but multiplicity is discarded. Over GF(3), (x+1)^2 yields one distinct factor, so the operation reports factor_count=1 and is_irreducible=True. Irreducibility requires one factor of full degree with multiplicity exactly one. Return multiplicities and normalize every coefficient modulo p.

Reject the zero polynomial and noncanonical leading-zero representations.

4. The “Frobenius cycle” operation only sorts caller-supplied integers

A factor-degree pattern corresponds to a Frobenius cycle only at a squarefree/unramified reduction. The request carries no polynomial or proof of good reduction, and field_order is mathematically unused after primality checking. Either consume an exact squarefree modular-factorization result and state the good-prime condition, or rename this as a partition canonicalization helper; as written it overclaims a Galois-theoretic invariant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Galois theory] Add exact bounded polynomial Galois-group, Frobenius-cycle, resolvent, and solvability operations

1 participant