The i-th summand of the degree-n convolution diagonal of p * q,
p.coeff i * q.coeff (n - i), zeroed once the degree guard n < i fires;
the single-index term that mulCoeffSum is reorganised into.
Instances For
The schoolbook coefficient mulCoeffSum p q n equals the diagonal sum
Σ_{i < p.size} diagonalMulCoeffTerm p q n i; the correspondence from the executable
loop order to the convolution form used in the ring-law proofs.
Pull a zero-based negation out of a product and commute the factors:
p * (0 - q) = 0 - q * p. A Mathlib-free DensePoly ring shim (the type
carries only Lean.Grind.CommRing, so neg_mul/mul_comm are unavailable).
Pull a coefficient scalar through the left polynomial factor.
Commutativity of DensePoly multiplication. Hand-proved because DensePoly
carries only Lean.Grind.CommRing, not Mathlib's CommRing, so mul_comm
is unavailable.
Pull a coefficient scalar through the right polynomial factor.
Cancellation rearrangement (x + y) - (z + x) = y + (0 - z), used to
simplify mixed add/sub combinations arising in the Euclidean update steps.
Cancellation rearrangement (x + y) - (x + z) = y + (0 - z).
Commutativity of DensePoly addition (the Mathlib-free add_comm).
Associativity of DensePoly addition (the Mathlib-free add_assoc).
Right identity for polynomial addition over a commutative ring: p + 0 = p.
A grind normalization lemma so downstream proofs cancel trailing zero summands.
Rewrite a DensePoly subtraction as addition of the zero-based negation:
p - q = p + (0 - q).
Rational-coefficient specialization of mulCoeffSum_derivative_product_rule:
the (n+1) scaling factor is cast into Rat.
Coefficient-level product rule: (n+1) times the order-(n+1) product
coefficient sum equals the sum of the two derivative product coefficient sums.
This is the per-coefficient identity underlying derivative_mul.
Leibniz product rule for the formal DensePoly derivative:
derivative (p * q) = derivative p * q + p * derivative q.
Associativity of DensePoly multiplication (the Mathlib-free mul_assoc).
Left distributivity for DensePoly: p * (q + r) = p * q + p * r.
Right distributivity for DensePoly: (p + q) * r = p * r + q * r.
Right identity for polynomial multiplication over a commutative ring:
p * 1 = p. A grind normalization lemma; the Bézout and division routines
cancel multiplications by the unit polynomial through it.
DensePoly S is a multiplicative monoid: these Std instances let the
shared List.foldl_mul_* algebra (and the standard List.foldl_assoc) apply to
fold-products of polynomials such as FpPoly/ZPoly.
Product of two monomials: xⁱ * cⱼ * xʲ = cᵢcⱼ * xⁱ⁺ʲ.