Boolean zero test on fixed mixed-radix coordinates.
Equations
- Hex.NumberTower.isZero a = (Hex.NumberTower.coeffs a).all fun (q : Rat) => decide (q = 0)
Instances For
Additive identity.
Instances For
Equations
- Hex.NumberTower.instZeroElem = { zero := T.zero }
The coordinate zero is the rational embedding of zero.
Zero exposes the all-zero fixed-width coordinate array.
The Boolean coordinate test recognizes exactly the tower zero.
Multiplicative identity.
Instances For
Equations
- Hex.NumberTower.instOneElem = { one := T.one }
The coordinate one is the rational embedding of one.
Coordinatewise addition.
Equations
Instances For
Equations
Addition exposes its fixed-width coordinate result.
Coordinatewise subtraction.
Equations
Instances For
Equations
Subtraction exposes its fixed-width coordinate result.
Coordinatewise additive inverse.
Equations
Instances For
Equations
Negation exposes its fixed-width coordinate result.
Coordinate subtraction is addition of the coordinatewise negation.
Coordinatewise negation is an additive inverse.
Recursive convolution and monic reduction.
Equations
Instances For
Equations
Multiplication exposes its fixed-width recursively reduced coordinates.
Recursive extended-gcd inversion, totalized by 0⁻¹ = 0.
Equations
Instances For
Equations
Recursive inversion exposes its fixed-width extended-gcd coordinates.
Equations
Rational scalar multiplication acts on every mixed-radix coordinate.
Equations
- Hex.NumberTower.smul q a = T.ofCoeffs (Array.map (fun (c : Rat) => q * c) (Hex.NumberTower.coeffs a))
Instances For
Equations
Natural powers by repeated tower multiplication.
Equations
- Hex.NumberTower.natPow a 0 = 1
- Hex.NumberTower.natPow a n.succ = Hex.NumberTower.natPow a n * a
Instances For
Equations
Integer powers from natural powers and inversion, with 0⁻¹ = 0.
Equations
- Hex.NumberTower.intPow a (Int.ofNat n) = Hex.NumberTower.natPow a n
- Hex.NumberTower.intPow a (Int.negSucc n) = (Hex.NumberTower.natPow a (n + 1))⁻¹
Instances For
Equations
Dense univariate polynomials over a fixed tower.
Equations
- T.Poly = Hex.DensePoly T.Elem