Make public mathematical contracts canonical and composable - #2185
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef738779bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4f4c7478e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a08ec9229a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa982b4a12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57437ac0f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if any( | ||
| not 0 <= value < len(self.algebra.carrier) for value in self.quotient_map | ||
| ): |
There was a problem hiding this comment.
Reject non-surjective quotient maps
A QuotientResult whose quotient algebra has two carrier classes still accepts quotient_map=(0, 0), because this validator checks only that values are in range. Such a map never reaches class 1 and therefore cannot be the canonical projection onto the advertised quotient, so wire validation can admit a false composable quotient certificate. Require the map's image to equal the complete quotient carrier.
AGENTS.md reference: AGENTS.md:L103-L114
Useful? React with 👍 / 👎.
Problem
Public mathematical operations accepted loosely related strings, axes, parents,
and derived structures that did not establish the domains required by their
implementations. Several results also discarded units, multiplicities,
generators, quotient maps, or other data needed for reconstruction and
composition.
Advances #2174.
Closes #2122.
Closes #2125.
Closes #2126.
Closes #2127.
Closes #2128.
Closes #2131.
Closes #2133.
Closes #2134.
Closes #2135.
Closes #2136.
Closes #2137.
Closes #2141.
Closes #2145.
Closes #2146.
Closes #2147.
Closes #2148.
Closes #2149.
Closes #2151.
Closes #2152.
Closes #2153.
Closes #2154.
Closes #2156.
Closes #2157.
Closes #2158.
Closes #2159.
Solution
Replace expression-shaped polynomial and rational inputs with canonical exact
values carrying their ordered domains. Enforce parent, axis, dimension,
degeneracy, and work constraints in operation request models before backend
execution. Return composable certificates for finite-field factorizations,
Galois groups, Newton forms, quotient algebras, projective coordinates, and
authoritative finite-field derivations.
The established mathematical kernels remain delegated to SymPy and FLINT. This
PR changes Jacobian's public contracts and conversions around them.
Testing
make check— 1,986 tests passed; Ruff, formatting, complexity, and mypy passed.Public contract impact
Breaking pre-stable request and result schema changes across affected operations.
Canonical polynomial, rational-function, finite-field, universal-algebra, and
derived certificate values replace expression strings and incomplete result
shapes. Operation versions and invocation examples are updated with their
contracts; no new operation IDs are introduced.
Public operation admission
KEEPdecisions with corrected pre-stable contracts.Closure matrix
polynomial.galois.*finite_field.*universal_algebra.*Checklist
make checkpasses