Theorem (exists_sub_eval_eq_iteratedDeriv_mul). The Hermite interpolation remainder: let a < \mathbf{b}, m a nonempty multiset of points of [a, \mathbf{b}] with every point of multiplicity at least 2 in (a, \mathbf{b}), f continuous on [a, \mathbf{b}] and C^{\lvert m\rvert} on (a, \mathbf{b}), and \mathbf{H} a real polynomial of degree less than \lvert m\rvert with \mathbf{H}^{(k)}(y) = f^{(k)}(y) for every y \in m and every k below the multiplicity of y. Then for every \mathbf{x} \in [a, \mathbf{b}] there is \xi \in (a, \mathbf{b}) with f(\mathbf{x}) - \mathbf{H}(\mathbf{x}) = \frac{f^{(\lvert m\rvert)}(\xi)}{\lvert m\rvert!}\prod_{y\in m}(\mathbf{x} - y)\,. [Davis1975, Theorem 3.5.1]; [Gautschi2004, §1.4.2] (locators to check); there for distinct nodes of multiplicity at most 2 with \xi in the hull of the nodes and \mathbf{x}; here any multiplicities, simple nodes allowed at the endpoints.
Headline
Lean statement and details
NLAlib.exists_sub_eval_eq_iteratedDeriv_mul {a b : ℝ} (hab : a < b) {m : Multiset ℝ} (hm : m ≠ 0)
(hmem : ∀ y ∈ m, y ∈ Set.Icc a b) (hrep : ∀ y ∈ m, 1 < Multiset.count y m → y ∈ Set.Ioo a b)
{f : ℝ → ℝ} (hf : ContinuousOn f (Set.Icc a b)) (hf' : ContDiffOn ℝ (↑m.card) f (Set.Ioo a b))
{H : Polynomial ℝ} (hH : H.degree < ↑m.card)
(hjet :
∀ y ∈ m,
∀ k < Multiset.count y m,
Polynomial.eval y ((⇑Polynomial.derivative)^[k] H) = iteratedDeriv k f y)
{x : ℝ} (hx : x ∈ Set.Icc a b) :
∃ ξ ∈ Set.Ioo a b,
f x - Polynomial.eval x H =
iteratedDeriv m.card f ξ / ↑m.card.factorial *
Polynomial.eval x (Multiset.map (fun y ↦ Polynomial.X - Polynomial.C y) m).prod