Theorem 5.15 — Taylor's theorem (hypotheses on all orders)
ProvedRudin.ch05_taylor_correctedLet be a real function on , let , and suppose that for every
Let be points of and let
be the Taylor polynomial of at of degree . Then there is a point strictly between and with
For this is the mean value theorem.
This is Theorem 5.15 of Rudin's Principles of Mathematical Analysis. Rudin states the hypotheses only for the top order (" is continuous on and exists for "), the existence and continuity of the lower-order derivatives being implicit in his convention that exists on a set only if exists in a neighbourhood of each of its points. In Lean, iteratedDeriv k f is a total function that takes the junk value wherever the derivative fails to exist, so a hypothesis on the single order carries no information about itself; the hypotheses above are therefore quantified over all orders , which is the faithful reading of Rudin's statement.
import Mathlib open Filter Topology
namespace Rudin
/-- Rudin, Theorem 5.15 (Taylor's theorem), with the differentiability hypotheses stated for
every order `k ≤ n - 1`: if `f, f', …, f^(n-1)` are continuous on `[a, b]` and `f^(k+1)(t)`
exists for every `t ∈ (a, b)` and every `k ≤ n - 1`, and `α ≠ β` are points of `[a, b]`, then
there is a point `x` strictly between `α` and `β` with
`f β = ∑_{k<n} f^(k)(α)/k! (β-α)^k + f^(n)(x)/n! (β-α)^n`. -/
theorem ch05_taylor_corrected (a b : ℝ) (hab : a < b) (f : ℝ → ℝ) (n : ℕ) (hn : 0 < n)
(hcont : ∀ k ≤ n - 1, ContinuousOn (iteratedDeriv k f) (Set.Icc a b))
(hderiv : ∀ k ≤ n - 1, ∀ t ∈ Set.Ioo a b, DifferentiableAt ℝ (iteratedDeriv k f) t)
(α β : ℝ) (hα : α ∈ Set.Icc a b) (hβ : β ∈ Set.Icc a b) (hne : α ≠ β) :
∃ x : ℝ, ((α < x ∧ x < β) ∨ (β < x ∧ x < α)) ∧
f β = (∑ k ∈ Finset.range n, iteratedDeriv k f α / (k.factorial : ℝ) * (β - α) ^ k)
+ iteratedDeriv n f x / (n.factorial : ℝ) * (β - α) ^ n := by sorry
end Rudin