Documentation

CslibFrontier.Foundations.Data.Polynomial.FiniteDifference

Finite differences of polynomials #

Evaluating a univariate polynomial P : R[X] of degree at most n at x is determined by its values at x + 1, …, x + n + 1 via the (n + 1)-th forward difference vanishing identity: $$\sum_{j=0}^{n+1} (-1)^j \binom{n+1}{j} P(x + j) = 0,$$ and in particular at x = 0: $$P(0) = \sum_{r=0}^{n} (-1)^r \binom{n+1}{r+1} P(r + 1).$$ Unlike Lagrange interpolation over a field, these identities require no division and hold over any commutative ring (including ℤ).

Main results #

theorem Polynomial.sum_neg_one_pow_choose_eval_eq_zero {R : Type u_1} [CommRing R] {n : ℕ} (P : Polynomial R) (hP : P.natDegree ≤ n) (x : R) :
∑ j ∈ Finset.range (n + 2), (-1) ^ j * ↑((n + 1).choose j) * eval (x + ↑j) P = 0

Vanishing of the (n + 1)-th finite difference: for any polynomial P : R[X] of degree at most n, ∑ j = 0 .. n + 1, (-1) ^ j * choose (n + 1) j * P(x + j) = 0.

theorem Polynomial.eval_zero_eq_sum_neg_one_pow_choose_eval_succ {R : Type u_1} [CommRing R] {n : ℕ} {P : Polynomial R} (hP : P.natDegree ≤ n) :
eval 0 P = ∑ r ∈ Finset.range (n + 1), (-1) ^ r * ↑((n + 1).choose (r + 1)) * eval (↑r + 1) P

Zero-evaluation finite-difference identity: over any commutative ring R, a polynomial P : R[X] of degree at most n satisfies P.eval 0 = ∑ r ∈ range (n + 1), (-1) ^ r * ((n + 1).choose (r + 1)) * P.eval (r + 1).