A one-generator presentation of a tower together with checked executable coordinate conversions in both directions.
- root : AlgebraicNumber
The canonical primitive element generating the whole tower.
Rewrite tower coordinates in the primitive presentation.
Evaluate primitive coordinates back to a tower element.
Instances For
The finite combined bound for primitive-element and coordinate-recovery
collisions in a field of dimension dimension.
Equations
- Hex.NumberTower.flattenShiftCount dimension = Hex.Nat.choose dimension 2 + 1
Instances For
One exact absolute generator and its mixed-radix coordinate in the final tower.
- degree : Nat
The generator's relative degree at its level.
- root : AlgebraicNumber
The exactified canonical value of the generator.
- value : T.Elem
The generator's mixed-radix coordinate in the final tower.
Instances For
A primitive generator accumulated through the lower part of the tower.
- dimension : Nat
The mixed-radix dimension generated so far.
- root : AlgebraicNumber
The canonical primitive element accumulated so far.
- value : T.Elem
The accumulated primitive element as a tower coordinate.
Each combined generator's coordinate in the accumulated presentation.
Instances For
Standard coordinate vector of length dimension.
Equations
- Hex.NumberTower.Flatten.unitCoords dimension index = (Array.replicate dimension 0).set! index 1
Instances For
Exactify a top-first level suffix from the oldest level upward, returning the accumulated generators and its mixed-radix dimension.
Equations
Instances For
Exactify the stored roots from the oldest level upward and pair them with their canonical mixed-radix generator coordinates in the final tower.
Equations
Instances For
Try one deterministic signed shift for a candidate of the full required degree.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lift an integer polynomial coefficientwise into a fixed primitive presentation.
Equations
- Hex.NumberTower.Flatten.liftZPoly f = Hex.DensePoly.ofCoeffs (Array.map (fun (coefficient : Int) => ↑coefficient • 1) (Hex.DensePoly.toArray f))
Instances For
Evaluate a rational coordinate polynomial in another fixed presentation.
Equations
- Hex.NumberTower.Flatten.evalRatPoly f a = Array.foldr (fun (coefficient : Rat) (value : Hex.PolyQuot p x) => value * a + coefficient • 1) 0 f.toArray
Instances For
Recover both inputs through the proved-total trace-pairing coordinates of a primitive candidate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Validate a recovered primitive coordinate against its canonical algebraic target.
Equations
Instances For
Validate both fast gcd coordinates before exposing them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recover theta and alpha in a candidate presentation
gamma = theta + shift * alpha using the validated linear-gcd path only.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recover theta and alpha in a primitive candidate presentation. The
bounded scan uses only recoverPairFast?; this total fallback adds trace
pairing for the maximum-degree candidate and for a zero shift.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A full-degree primitive candidate together with its recovered old and new generator coordinates.
- shift : Int
The signed shift producing the accepted candidate.
- root : AlgebraicNumber
The accepted full-degree primitive candidate.
The prior generator's coordinate in the candidate presentation.
The new generator's coordinate in the candidate presentation.
Instances For
Search a prescribed shift suffix, rejecting degree collisions and any candidate for which validated linear-gcd recovery fails.
Equations
- One or more equations did not get rendered due to their size.
- Hex.NumberTower.Flatten.searchRecoveredAux theta alpha target start 0 = none
Instances For
Try the direct full-degree search first. If it is exhausted, select a maximum-degree primitive candidate and recover both input coordinates through the generated field.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combine the fixed generators one level at a time, retaining a tower coordinate for each accepted canonical primitive element.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extend lower mixed-radix basis images by powers of one newly recovered generator. The lower basis remains the fastest-varying coordinate block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Images of the full tower mixed-radix basis in the primitive presentation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a rational coordinate vector to precomputed primitive-basis images.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Evaluate a reduced primitive coordinate polynomial at its tower element.
Equations
- Hex.NumberTower.Flatten.fromPrimitiveWith generator a = Array.foldr (fun (coefficient : Rat) (value : T.Elem) => value * generator + T.ofRat coefficient) 0 a.coeffs.toArray
Instances For
Evaluate an integer polynomial at a tower element.
Equations
- Hex.NumberTower.Flatten.evalZPoly f a = Array.foldr (fun (coefficient : Int) (value : T.Elem) => value * a + T.ofRat ↑coefficient) 0 (Hex.DensePoly.toArray f)
Instances For
Verify the coordinate composite on the tower basis and check that the candidate tower element satisfies its claimed primitive minimal polynomial. The first condition makes the rational-linear coordinate maps inverse; the root relation and irreducibility make evaluation through the primitive quotient an injective ring map. The resulting dimension squeeze makes the linear inverse multiplicative as well. The size, dimension, and root checks remain independent executable defenses even where the semantic proof can derive them from the successful construction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace a checked tower by one canonical primitive-element presentation. The result is returned only after exact generator recovery, a tower-basis round trip, and the primitive polynomial relation succeed.
Equations
- One or more equations did not get rendered due to their size.