Fixed-width rational coordinates, padding with zero and truncating excess entries.
Equations
- Hex.NumberTower.Arithmetic.fixedCoeffs n coefficients = (Vector.ofFn fun (i : Fin n) => coefficients.getD (↑i) 0).toArray
Instances For
Fixed-width coordinate addition.
Equations
- Hex.NumberTower.Arithmetic.addCoords n a b = (Vector.ofFn fun (i : Fin n) => a.getD (↑i) 0 + b.getD (↑i) 0).toArray
Instances For
Fixed-width coordinate subtraction.
Equations
- Hex.NumberTower.Arithmetic.subCoords n a b = (Vector.ofFn fun (i : Fin n) => a.getD (↑i) 0 - b.getD (↑i) 0).toArray
Instances For
Fixed-width coordinate negation.
Equations
- Hex.NumberTower.Arithmetic.negCoords n a = (Vector.ofFn fun (i : Fin n) => -a.getD (↑i) 0).toArray
Instances For
Adding back the subtrahend recovers the fixed-width minuend.
One mixed-radix block.
Equations
- Hex.NumberTower.Arithmetic.block a index width = (Vector.ofFn fun (i : Fin width) => a.getD (index * width + ↑i) 0).toArray
Instances For
A block of fixed-width coordinates is the fixed-width source block.
The only nonzero block of the fixed-width coordinate one is its constant block.
A block of fixed-width coordinate addition is the sum of the blocks.
Flatten a fixed number of equally wide coordinate blocks.
Equations
Instances For
Flattening fixed-width blocks always produces the requested total width.
Add one row of schoolbook block products to a convolution workspace.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply all lower-coefficient corrections for eliminating the coefficient
at k with a monic relation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Eliminate the coefficient at k, then discard it.
Equations
- Hex.NumberTower.Arithmetic.reduceAt degree width k defining multiply work = (Hex.NumberTower.Arithmetic.reduceCoeffs degree width k defining multiply work).take k
Instances For
Descending monic reduction of all coefficients at or above degree.
Equations
- One or more equations did not get rendered due to their size.
- Hex.NumberTower.Arithmetic.reduce degree width defining multiply 0 x✝ = x✝.take degree
Instances For
Recursive mixed-radix multiplication on top-first raw level data.
Equations
Instances For
Dynamically indexed tower coefficient used internally when an algorithm
recurses through runtime level data rather than a dependent NumberTower.
The raw helper normalizes to the represented mixed-radix dimension.
The flattened mixed-radix rational coordinates.
Instances For
Wrap coordinate data as a RawElem, zero-padding or truncating to the
represented mixed-radix dimension.
Equations
- Hex.NumberTower.Arithmetic.raw levels data = { data := Hex.NumberTower.Arithmetic.fixedCoeffs (Hex.NumberTower.levelsDim levels) data }
Instances For
Equations
- Hex.NumberTower.Arithmetic.instZeroRawElem levels = { zero := Hex.NumberTower.Arithmetic.raw levels #[] }
Equations
- Hex.NumberTower.Arithmetic.instOneRawElem levels = { one := Hex.NumberTower.Arithmetic.raw levels #[1] }
Canonical lower-tower coefficient used by recursive inversion. Unlike the
general-purpose RawElem, this type carries the fixed-width invariant needed
by the semantic field bridge for polynomial xgcd.
The flattened mixed-radix rational coordinates.
The coordinate array has exactly the represented dimension.
Instances For
Normalize arbitrary data into a canonical lower-tower coefficient.
Equations
- Hex.NumberTower.Arithmetic.Coeff.ofData levels data = { data := Hex.NumberTower.Arithmetic.fixedCoeffs (Hex.NumberTower.levelsDim levels) data, size_eq := ⋯ }
Instances For
Equations
- Hex.NumberTower.Arithmetic.instZeroCoeff levels = { zero := Hex.NumberTower.Arithmetic.Coeff.ofData levels #[] }
Equations
- Hex.NumberTower.Arithmetic.instOneCoeff levels = { one := Hex.NumberTower.Arithmetic.Coeff.ofData levels #[1] }
Recursive inverse coordinates. The zero convention is inherited at every
level; defensive nonconstant/zero gcd branches are unreachable for certified
level lists. The extended gcd makes every remainder monic before dividing by
it, so each lower-field inversion acts on a normalized operand and the
quotient coefficients stay bounded in height; the unnormalized
DensePoly.xgcdLeft chain amplified the heights of every later
lower-field inversion.
Equations
Instances For
Equations
- Hex.NumberTower.Arithmetic.instDivRawElem levels = { div := fun (a b : Hex.NumberTower.Arithmetic.RawElem levels) => a * b⁻¹ }
Equations
- Hex.NumberTower.Arithmetic.instDivCoeff levels = { div := fun (a b : Hex.NumberTower.Arithmetic.Coeff levels) => a * b⁻¹ }