Documentation

CslibFrontier.Foundations.Data.MvPolynomial.DividedDifferences

Polynomial divided differences #

Every polynomial of total degree at most d + 1 has polynomial divided differences of total degree at most d: they express p(x) - p(X) as a sum of coordinate differences, and evaluate to the partial derivatives on the diagonal. This holds over an arbitrary commutative coefficient ring. purePowerDifference supplies the explicit geometric sum for a pure power, including its leading term and diagonal evaluation.

Ported and simplified from the polynomial divided differences and pure-power differences in lean-canny. Finsupp subtraction supplies the monomial step and Mathlib's geometric-sum identity supplies the pure-power quotient.

theorem MvPolynomial.polynomial_divided_differences {A : Type u_1} [CommRing A] {n : ℕ} (x : Fin n → A) (p : MvPolynomial (Fin n) A) (d : ℕ) (hp : p.totalDegree ≤ d + 1) :
∃ (D : Fin n → MvPolynomial (Fin n) A), C ((eval x) p) - p = ∑ i : Fin n, D i * (C (x i) - X i) ∧ (∀ (i : Fin n), (D i).totalDegree ≤ d) ∧ ∀ (i : Fin n), (eval x) (D i) = (eval x) ((pderiv i) p)

Every polynomial of degree at most d + 1 has divided differences of degree at most d, including over rings with zero divisors.

noncomputable def MvPolynomial.purePowerDifference {A : Type u_1} [CommRing A] {n : ℕ} (x : A) (i : Fin n) (d : ℕ) :

The polynomial quotient of x^ell - Y^ell by x - Y, with ell = d + 1.

theorem MvPolynomial.purePowerDifference_mul {A : Type u_1} [CommRing A] {n : ℕ} (x : A) (i : Fin n) (d : ℕ) :
purePowerDifference x i d * (C x - X i) = C (x ^ (d + 1)) - X i ^ (d + 1)
theorem MvPolynomial.purePowerDifference_degree {A : Type u_1} [CommRing A] {n : ℕ} (x : A) (i : Fin n) (d : ℕ) :
theorem MvPolynomial.purePowerDifference_lower_degree {A : Type u_1} [CommRing A] {n : ℕ} (x : A) (i : Fin n) {d : ℕ} (hd : 1 ≤ d) :
theorem MvPolynomial.purePowerDifference_diagonal {A : Type u_1} [CommRing A] {n : ℕ} (x : Fin n → A) (i : Fin n) (d : ℕ) :
(eval x) (purePowerDifference (x i) i d) = ↑(d + 1) * x i ^ d