Existing in Mathlib · Analysis
Taylor's Theorem with Lagrange Remainder
For x₀ < x, if f has the selected finite-order continuity and differentiability properties on the closed interval and its interior, then the error of its degree-n Taylor polynomial at x equals the standard Lagrange remainder evaluated at some interior point x'.
- Taylor polynomials
- Lagrange remainder
- iterated derivatives
- differentiability on intervals
- mean value theorem
- factorial scaling
Exact theorem
Exact Mathlib statement
theorem taylor_mean_remainder_lagrange {f : ℝ → ℝ} {x x₀ : ℝ} {n : ℕ} (hx : x₀ < x) (hf : ContDiffOn ℝ n f (Icc x₀ x)) (hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)) : ∃ x' ∈ Ioo x₀ x, f x - taylorWithinEval f n (Icc x₀ x) x₀ x = iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / (n + 1)!The theorem at a glance
Taylor's theorem with Lagrange remainder at a glance
A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.
Taylor's theorem with Lagrange remainder at a glance

Detailed visual description
The poster states f : ℝ → ℝ, n : ℕ, x₀ < x, ContDiffOn ℝ n f on Icc x₀ x, and differentiability of iteratedDerivWithin n f on Ioo x₀ x. It then gives an interior x' and the exact equality between f x minus taylorWithinEval and iteratedDerivWithin (n + 1) at x', scaled by (x - x₀)^(n + 1)/(n + 1)!. Its route summary introduces g(t) = (x - t)^(n + 1), notes the nonzero interior derivative, applies the general mean-remainder theorem, and simplifies the factorial expression.
Statement structure
Statement and scope
Read the exact Mathlib declaration
This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.
Interior witness for a finite Taylor remainder

Detailed visual description
A charcoal function curve and dashed cobalt finite-jet curve meet at the left and separate at the right, where a vertical dashed gap marks the remainder. A lower interval has solid endpoints, several hollow interior candidates, and one selected emerald witness. A bounded gold derivative fan and a gold guide meet exactly at that interior point.
Why it matters
A mathematical landmark
Taylor's theorem is a central bridge between local derivative data and finite polynomial approximation. Mathlib's selected declaration is especially instructive because its exact interval hypotheses and within-derivative formulation expose the finite mean-value mechanism while keeping the interior witness and the boundary of the result explicit.
ProofAtlas record
What has been checked
Mathlib is the source of the theorem; the local Lean replay and page review are separate.
Claim boundary
No new theorem is claimed
This page indexes Mathlib's selected Lagrange-remainder declaration for a real-valued function on ordered endpoints x₀ < x. Its exact assumptions are ContDiffOn ℝ n f (Icc x₀ x) together with DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x). It concludes that some x' strictly inside Ioo x₀ x realizes the exact finite Taylor remainder through iteratedDerivWithin (n + 1) on the same closed interval. It does not use the nearby corollary's single ContDiffOn ℝ (n + 1) hypothesis, assert uniqueness of x', handle reversed or equal endpoints, or state an analytic-series or convergence theorem.
- The selected declaration assumes ContDiffOn ℝ n f on Icc x₀ x and differentiability of the nth iterated within-derivative on Ioo x₀ x; it does not replace them by the nearby corollary's single ContDiffOn ℝ (n + 1) assumption.
- The theorem concerns the finite polynomial taylorWithinEval and an exact remainder identity; it does not assert analyticity, an infinite Taylor-series identity, or convergence as n tends to infinity.
- The conclusion gives at least one x' strictly inside Ioo x₀ x; it does not make that witness unique, canonical, or equal to an endpoint.
- The selected orientation is x₀ < x and does not state the corresponding result for equal or reversed endpoints.
- ProofAtlas is indexing an existing Mathlib theorem, and generated explanations and visuals are not proof evidence.
Source and local evidence
Where the theorem comes from
- Existing declaration
taylor_mean_remainder_lagrangein mathlib- Relationship
- The checked artifact is the upstream declaration itself
- Local Lean evidence
artifact.library.mathlib.taylor-theorem.v001