Reverse the first k coefficients of a represented series back into a
normalized polynomial. The explicit bound is independent of any trailing
zeros removed by polynomial normalization.
Equations
- Hex.DensePoly.reversePrefix k a = Hex.DensePoly.ofList (List.map (fun (i : Nat) => a.coeff (k - 1 - i)) (List.range k))
Instances For
Coefficient law for fixed-bound reverse conversion.
Reversing a k-coefficient series prefix converts its product's high
coefficients into the corresponding low series convolution.
Number of quotient coefficients required for division of p by q.
It is zero for the zero divisor and for a divisor larger than the dividend.
Equations
Instances For
A reusable divisor with a reciprocal cached to a fixed capacity.
- mul : MulPlan R
Multiplication plan used by Newton division.
- divisor : DensePoly R
Nonzero divisor represented by this plan.
- capacity : Nat
Maximum quotient precision supported by the cached reciprocal.
- unitInv : R
Inverse of the reversed divisor's constant coefficient.
Cached reciprocal of the reversed divisor.
The divisor is nonzero.
- unitInv_spec : 0 < self.capacity → (self.divisor.reverseSeries self.capacity).coeff 0 * self.unitInv = 1
At positive precision, the supplied inverse is a unit witness.
- reciprocal_spec : self.reciprocal = (self.divisor.reverseSeries self.capacity).invOfUnit self.unitInv
The cached reciprocal agrees with series inversion.
Instances For
Build a cached plan for a nonzero monic divisor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A monic division plan retains its supplied divisor.
A monic division plan retains its supplied multiplication plan.
A monic division plan retains its supplied capacity.
Build a cached plan for an arbitrary nonzero divisor over a field.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A field division plan retains its supplied divisor.
A field division plan retains its supplied multiplication plan.
A field division plan retains its supplied capacity.
Quotient obtained from a cached reversed reciprocal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reciprocal quotient cancels every coefficient in the high window of
the dividend. The index t counts down from the leading coefficient.
The normalized reciprocal quotient has no more than the requested number of coefficients.
Subtracting the reciprocal quotient product leaves fewer coefficients than the divisor. This is the executable division algorithm's termination law.
The cached division remainder has degree strictly below every positive-degree divisor.
Divide using a cached reciprocal. The proof ensures the cached precision covers the requested quotient; it is erased from executable code.
Equations
Instances For
Cached reciprocal division agrees with the established long-division result whenever coefficient division satisfies the laws needed by that result. The size-one divisor case is handled as an exact product rather than being hidden by the default-zero degree convention.
Remainder-only cached division.
Instances For
Reconstruction form of the cached remainder.
A cached remainder has fewer coefficients than its divisor.
Taking a cached remainder preserves evaluation at every zero of the divisor.
One-shot reciprocal division by a monic polynomial.
Equations
- Hex.DensePoly.divModMonicWith mul p q hq = if hqne : q = 0 then (0, p) else let k := p.quotientLength q; let plan := Hex.DensePoly.DivPlan.ofMonic mul q hq hqne k; plan.divMod p ⋯
Instances For
One-shot monic reciprocal division agrees with the existing specialized monic long-division operation.
One-shot reciprocal division over a field.
Equations
- Hex.DensePoly.divModNewton mul p q = if hqne : q = 0 then (0, p) else let k := p.quotientLength q; let plan := Hex.DensePoly.DivPlan.ofNonzero mul q hqne k; plan.divMod p ⋯
Instances For
One-shot field reciprocal division is extensionally the existing verified long-division operation.
Fast field division leaves fewer stored coefficients than its nonzero divisor.
Kernel-visible reference division. Compiled code uses the proved short-operand/Newton dispatch with the supplied multiplication plan.
Equations
- Hex.DensePoly.divModWith mul p q = p.divMod q
Instances For
Planned division has the exact reference quotient and remainder.
Planned division retains the strict reference remainder bound.
Maximum short operand length for direct one-shot polynomial division.
Equations
Instances For
Short divisors and short quotients use array long division. Its work is linear in the long operand when either length is bounded; building a full Newton reciprocal in that regime would introduce unnecessary dense products.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The short-operand division dispatch preserves both quotient and remainder.