Documentation

CslibFrontier.Foundations.Data.Polynomial.HermiteInterpolation

Confluent Hermite interpolation #

A polynomial of degree less than ∑ i, J i is determined by its first J i Taylor coefficients at each node t i, provided the nodes differ by units. This file proves this with node-varying multiplicities J : ι → ℕ over a finite set of nodes s, in two forms, over any commutative ring whose nodes have unit differences:

For a uniform multiplicity J at Q nodes t : Fin Q → R, the order-J Taylor jet is the family of coefficients (Polynomial.taylor (t i) p).coeff j = [z ^ j] p (t i + z), for i < Q and j < J (Polynomial.taylorJet), and uniqueness specializes to Polynomial.eq_zero_of_taylorJet_eq_zero. For integer nodes, the integer confluent Vandermonde matrix Polynomial.hermiteMatrix maps the coefficient vector to the jet, it is nonsingular when the nodes are distinct, and Cramer's rule expresses each coefficient through two determinants (Polynomial.det_hermiteMatrix_mul_coeff). Over a ℚ-algebra this recovers every coefficient, and in particular the value at 0, as a rational combination of the jet (Polynomial.eval_zero_eq_of_taylorJet).

The coefficient of X ^ u is indexed by c : Fin Q × Fin J with u = finProdFinEquiv c, so the Hermite matrix is square over Fin Q × Fin J. Its entry in row (i, j) and column c is (u choose j) * t i ^ (u - j), the coefficient of z ^ j in (t i + z) ^ u; it vanishes for u < j because the binomial does.

This is the interpolation step of the subexponential counting algorithms of [OAI26k]. In §3.4 and Appendix B.3 the count is the value at 0 of a polynomial H of degree less than Q * J, and only Taylor coefficients of H at the nodes 1, …, Q are computed. The tapered recovery of Lemma D.5 (§D.4.4, pp. 60–61) uses node-varying multiplicities and the Chinese-remainder form, equation (D.9), with α = 2 ^ (a + 1). Ordinary Lagrange interpolation (Lagrange.interpolate) is the case of multiplicity 1.

Main definitions #

Main results #

References #

Node-varying multiplicities #

theorem Polynomial.X_sub_C_pow_dvd_iff_taylor_coeff {R : Type u_1} [CommRing R] {r : R} {n : ℕ} {p : Polynomial R} :
(X - C r) ^ n ∣ p ↔ ∀ j < n, ((taylor r) p).coeff j = 0

(X - r) ^ n divides p exactly when the first n Taylor coefficients of p at r vanish.

theorem Polynomial.X_sub_C_pow_dvd_iff_X_pow_dvd_comp {R : Type u_1} [CommRing R] (α : Rˣ) {r : R} {n : ℕ} {p : Polynomial R} :
(X - C r) ^ n ∣ p ↔ X ^ n ∣ p.comp (C r + C ↑α * X)

(X - r) ^ n divides p exactly when z ^ n divides p (r + α z), for a unit α.

theorem Polynomial.eq_zero_of_forall_X_sub_C_pow_dvd {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) {p : Polynomial R} (hp : p.degree < ↑(∑ i ∈ s, J i)) (h : ∀ i ∈ s, (X - C (t i)) ^ J i ∣ p) :
p = 0

Uniqueness of Hermite interpolation. A polynomial of degree less than ∑ i ∈ s, J i that vanishes to order J i at each node t i, for nodes with unit differences, is zero.

noncomputable def Polynomial.hermiteBasis {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (i : ι) :

The Hermite basis polynomial of node i, E_i = ∏_{j ∈ s, j ≠ i} ((X - t j) / (t i - t j)) ^ J j, dividing by Ring.inverse. At nodes with unit differences it is 1 at t i (eval_hermiteBasis_self) and vanishes to order J k at every other node t k (X_sub_C_pow_dvd_hermiteBasis). With every J j = 1 it is the Lagrange basis polynomial.

theorem Polynomial.eval_hermiteBasis {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (i : ι) (x : R) :
eval x (hermiteBasis s t J i) = ∏ j ∈ s.erase i, (Ring.inverse (t i - t j) * (x - t j)) ^ J j
theorem Polynomial.eval_hermiteBasis_self {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) {i : ι} (hi : i ∈ s) :
eval (t i) (hermiteBasis s t J i) = 1

The Hermite basis polynomial of a node is 1 at that node.

theorem Polynomial.X_sub_C_pow_dvd_hermiteBasis {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] {i k : ι} (hk : k ∈ s) (hki : k ≠ i) :
(X - C (t k)) ^ J k ∣ hermiteBasis s t J i

The Hermite basis polynomial of i vanishes to order J k at every other node t k.

theorem Polynomial.natDegree_hermiteBasis_le {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (i : ι) :
(hermiteBasis s t J i).natDegree ≤ ∑ j ∈ s.erase i, J j
theorem Polynomial.map_hermiteBasis {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] {S : Type u_3} [CommRing S] (f : R →+* S) (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) {i : ι} (hi : i ∈ s) :
map f (hermiteBasis s t J i) = hermiteBasis s (fun (j : ι) => f (t j)) J i

The Hermite basis commutes with ring homomorphisms, at nodes with unit differences.

theorem Polynomial.eq_sum_hermiteBasis_mul_of_dvd {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) {p : Polynomial R} (hp : p.degree < ↑(∑ i ∈ s, J i)) (r : ι → Polynomial R) (hr : ∀ i ∈ s, (r i).degree < ↑(J i)) (hdvd : ∀ i ∈ s, (X - C (t i)) ^ J i ∣ p - hermiteBasis s t J i * r i) :
p = ∑ i ∈ s, hermiteBasis s t J i * r i

The Chinese-remainder form of Hermite interpolation. Let p have degree less than ∑ i ∈ s, J i, at nodes with unit differences. If at every node r i has degree less than J i and E_i * r i agrees with p to order J i at t i, then p = ∑ i ∈ s, E_i * r i.

noncomputable def Polynomial.hermiteQuotient {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (α : R) (i : ι) (P : PowerSeries R) :

The Hermite quotient at node i with scale α of a power series P: the truncation below z ^ J i of P(z) / E_i(t i + α z), using the power-series inverse of E_i(t i + α z), whose constant term E_i(t i) is 1 at nodes with unit differences. For P(z) = p(t i + α z) it is the local factor of p at t i in the Chinese-remainder form of Hermite interpolation (eq_sum_hermiteBasis_mul_hermiteQuotient).

@[simp]
theorem Polynomial.hermiteQuotient_trunc {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (α : R) (i : ι) (P : PowerSeries R) :
hermiteQuotient s t J α i ↑((PowerSeries.trunc (J i)) P) = hermiteQuotient s t J α i P

The Hermite quotient at node i depends only on the first J i coefficients.

theorem Polynomial.degree_hermiteQuotient_lt {R : Type u_1} [CommRing R] {ι : Type u_2} [DecidableEq ι] (s : Finset ι) (t : ι → R) (J : ι → ℕ) (α : R) (i : ι) (P : PowerSeries R) :
(hermiteQuotient s t J α i P).degree < ↑(J i)
theorem Polynomial.X_pow_dvd_sub_mul_hermiteQuotient {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) (α : R) {i : ι} (hi : i ∈ s) (P : Polynomial R) :
X ^ J i ∣ P - (hermiteBasis s t J i).comp (C (t i) + C α * X) * hermiteQuotient s t J α i ↑P

The defining congruence of the Hermite quotient. For a polynomial P, the product E_i(t i + α z) times the Hermite quotient of P agrees with P below z ^ J i.

theorem Polynomial.hermiteQuotient_eq_of_X_pow_dvd {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) (α : R) {i : ι} (hi : i ∈ s) {P q : Polynomial R} (hq : q.degree < ↑(J i)) (h : X ^ J i ∣ P - (hermiteBasis s t J i).comp (C (t i) + C α * X) * q) :
hermiteQuotient s t J α i ↑P = q

The Hermite quotient is characterized by its congruence: a polynomial of degree less than J i whose product with E_i(t i + α z) agrees with P below z ^ J i is the Hermite quotient of P.

theorem Polynomial.eq_sum_hermiteBasis_mul_hermiteQuotient {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) (α : Rˣ) {p : Polynomial R} (hp : p.degree < ↑(∑ i ∈ s, J i)) :
p = ∑ i ∈ s, hermiteBasis s t J i * (hermiteQuotient s t J (↑α) i ↑(p.comp (C (t i) + C ↑α * X))).comp (C ↑α⁻¹ * (X - C (t i)))

The Chinese-remainder form of Hermite interpolation, in scaled local coordinates. Let p have degree less than ∑ i ∈ s, J i, at nodes with unit differences, and let α be a unit. Then p(T) is the sum over the nodes of E_i(T) times the Hermite quotient of p(t i + α z) at z = (T - t i) / α. Each summand uses only the first J i coefficients of p(t i + α z) (hermiteQuotient_trunc). With α = 1 the local coordinate is z = T - t i.

theorem Polynomial.eval_eq_sum_hermiteBasis_mul_hermiteQuotient {R : Type u_1} [CommRing R] {ι : Type u_2} {s : Finset ι} {t : ι → R} {J : ι → ℕ} [DecidableEq ι] (ht : (↑s).Pairwise fun (i j : ι) => IsUnit (t i - t j)) (α : Rˣ) {p : Polynomial R} (hp : p.degree < ↑(∑ i ∈ s, J i)) (x : R) :
eval x p = ∑ i ∈ s, eval x (hermiteBasis s t J i) * eval (↑α⁻¹ * (x - t i)) (hermiteQuotient s t J (↑α) i ↑(p.comp (C (t i) + C ↑α * X)))

Hermite reconstruction of a value (D.9). Under the hypotheses of eq_sum_hermiteBasis_mul_hermiteQuotient, p(x) = ∑ i ∈ s, E_i(x) * Q_i((x - t i) / α), where Q_i is the Hermite quotient of p(t i + α z). At x = 0 this is equation (D.9) of [OpenAI2026ETH, §D.4.4, p. 60].

Uniform multiplicity: Taylor jets #

noncomputable def Polynomial.taylorJet {R : Type u_1} [CommRing R] {Q : ℕ} (t : Fin Q → R) (J : ℕ) :

The order-J Taylor jet of a polynomial at the nodes t: the coefficient of z ^ j in p (t i + z), for i < Q and j < J.

@[simp]
theorem Polynomial.taylorJet_apply {R : Type u_1} [CommRing R] {Q : ℕ} (t : Fin Q → R) (J : ℕ) (p : Polynomial R) (r : Fin Q × Fin J) :
(taylorJet t J) p r = ((taylor (t r.1)) p).coeff ↑r.2
theorem Polynomial.eq_zero_of_taylorJet_eq_zero {R : Type u_1} [CommRing R] {Q J : ℕ} {t : Fin Q → R} (ht : Pairwise fun (i j : Fin Q) => IsUnit (t i - t j)) {p : Polynomial R} (hp : p.degree < ↑(Q * J)) (h : (taylorJet t J) p = 0) :
p = 0

Uniqueness of confluent Hermite interpolation. A polynomial of degree less than Q * J whose order-J Taylor jet vanishes at Q nodes with unit differences is zero.

theorem Polynomial.eq_of_taylorJet_eq {R : Type u_1} [CommRing R] {Q J : ℕ} {t : Fin Q → R} (ht : Pairwise fun (i j : Fin Q) => IsUnit (t i - t j)) {p q : Polynomial R} (hp : p.degree < ↑(Q * J)) (hq : q.degree < ↑(Q * J)) (h : (taylorJet t J) p = (taylorJet t J) q) :
p = q

Two polynomials of degree less than Q * J with the same order-J Taylor jet at Q nodes with unit differences are equal.

The Hermite matrix and reconstruction #

def Polynomial.hermiteMatrix {Q : ℕ} (t : Fin Q → ℤ) (J : ℕ) :
Matrix (Fin Q × Fin J) (Fin Q × Fin J) ℤ

The integer confluent Vandermonde (Hermite) matrix of the nodes t: the entry in row (i, j) and column c is (u choose j) * t i ^ (u - j) with u = finProdFinEquiv c, the coefficient of z ^ j in (t i + z) ^ u.

theorem Polynomial.hermiteMatrix_apply {Q J : ℕ} (t : Fin Q → ℤ) (r c : Fin Q × Fin J) :
hermiteMatrix t J r c = ↑((↑(finProdFinEquiv c)).choose ↑r.2) * t r.1 ^ (↑(finProdFinEquiv c) - ↑r.2)
theorem Polynomial.hermiteMatrix_mulVec {R : Type u_1} [CommRing R] {Q J : ℕ} (t : Fin Q → ℤ) {p : Polynomial R} (hp : p.degree < ↑(Q * J)) :
(((hermiteMatrix t J).map Int.cast).mulVec fun (c : Fin Q × Fin J) => p.coeff ↑(finProdFinEquiv c)) = (taylorJet (fun (i : Fin Q) => ↑(t i)) J) p

The Hermite matrix maps coefficients to the jet. For p of degree less than Q * J, the Hermite matrix applied to the vector of coefficients of X ^ (finProdFinEquiv c) is the order-J Taylor jet of p at the nodes, over any commutative ring.

The Hermite matrix is nonsingular at distinct integer nodes.

theorem Polynomial.det_hermiteMatrix_mul_coeff {R : Type u_1} [CommRing R] {Q J : ℕ} (t : Fin Q → ℤ) {p : Polynomial R} (hp : p.degree < ↑(Q * J)) (c : Fin Q × Fin J) :
↑(hermiteMatrix t J).det * p.coeff ↑(finProdFinEquiv c) = (((hermiteMatrix t J).map Int.cast).updateCol c ((taylorJet (fun (i : Fin Q) => ↑(t i)) J) p)).det

Cramer's rule for confluent Hermite interpolation, over any commutative ring: for p of degree less than Q * J, the determinant of the Hermite matrix times the coefficient of X ^ (finProdFinEquiv c) is the determinant of the Hermite matrix with column c replaced by the order-J Taylor jet of p.

theorem Polynomial.coeff_eq_of_taylorJet {Q J : ℕ} (A : Type u_2) [CommRing A] [Algebra ℚ A] {t : Fin Q → ℤ} (ht : Function.Injective t) {p : Polynomial A} (hp : p.degree < ↑(Q * J)) (c : Fin Q × Fin J) :
p.coeff ↑(finProdFinEquiv c) = (↑(hermiteMatrix t J).det)⁻¹ • (((hermiteMatrix t J).map Int.cast).updateCol c ((taylorJet (fun (i : Fin Q) => ↑(t i)) J) p)).det

Reconstruction over a ℚ-algebra. At distinct integer nodes, each coefficient of a polynomial of degree less than Q * J is a rational multiple of a determinant formed from the Hermite matrix and the order-J Taylor jet.

theorem Polynomial.eval_zero_eq_of_taylorJet {Q J : ℕ} (A : Type u_2) [CommRing A] [Algebra ℚ A] {t : Fin Q → ℤ} (ht : Function.Injective t) (hQ : 0 < Q) (hJ : 0 < J) {p : Polynomial A} (hp : p.degree < ↑(Q * J)) :
eval 0 p = (↑(hermiteMatrix t J).det)⁻¹ • (((hermiteMatrix t J).map Int.cast).updateCol (⟨0, hQ⟩, ⟨0, hJ⟩) ((taylorJet (fun (i : Fin Q) => ↑(t i)) J) p)).det

The value at 0 from the jet (B.1). At distinct integer nodes, the value at 0 of a polynomial of degree less than Q * J, over a ℚ-algebra, is the determinant of the Hermite matrix with its column for X ^ 0 replaced by the order-J Taylor jet, divided by the determinant of the Hermite matrix.