Documentation

CompPoly.Univariate.DivisionCorrectness

Univariate Division Correctness #

Correctness theorems for division-style univariate polynomial algorithms.

CompPoly's divByMonic is correct w.r.t. Mathlib's divByMonic

CompPoly's modByMonic is correct w.r.t. Mathlib's modByMonic

Euclidean division identity for a monic divisor, stated directly on CPolynomial: p.modByMonic q + q * p.divByMonic q = p whenever q is monic.

This holds over an arbitrary commutative ring, so it instantiates at nested coefficient rings, e.g. CBivariate R = CPolynomial (CPolynomial R), giving Euclidean division by any monic divisor in the outer variable.

Any nonzero polynomial scaled by the inverse of its leading coefficient is monic.

Equality between CompPoly's div and Mathlib's divByMonic

Equality between CompPoly's mod and Mathlib's modByMonic

theorem CompPoly.CPolynomial.div_toPoly_eq_div {R : Type u_1} [Field R] [BEq R] [LawfulBEq R] (p q : CPolynomial R) :

CompPoly's div is correct w.r.t. Mathlib's div.

CompPoly's mod is Mathlib's % scaled by q.leadingCoeff⁻¹.

theorem CompPoly.CPolynomial.exactDiv_toPoly_iff {R : Type u_1} [Field R] [BEq R] [LawfulBEq R] (G V f : CPolynomial R) (hV : V.toPoly 0) :
G.toPoly = f.toPoly * V.toPoly G.mod V = 0 (G / V).toPoly = f.toPoly

Exact-division bridge: G.toPoly factors as f.toPoly * V.toPoly iff the computable mod vanishes and the computable division recovers f.

The reversal monic remainder agrees with the canonical monic remainder.