Taylor's theorem #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the Taylor polynomial of a real function f : ℝ → E
,
where E
is a normed vector space over ℝ
and proves Taylor's theorem,
which states that if f
is sufficiently smooth, then
f
can be approximated by the Taylor polynomial up to an explicit error term.
Main definitions #
taylor_coeff_within
: the Taylor coefficient usingderiv_within
taylor_within
: the Taylor polynomial usingderiv_within
Main statements #
taylor_mean_remainder
: Taylor's theorem with the general form of the remainder termtaylor_mean_remainder_lagrange
: Taylor's theorem with the Lagrange remaindertaylor_mean_remainder_cauchy
: Taylor's theorem with the Cauchy remainderexists_taylor_mean_remainder_bound
: Taylor's theorem for vector valued functions with a polynomial bound on the remainder
TODO #
- the Peano form of the remainder
- the integral form of the remainder
- Generalization to higher dimensions
Tags #
Taylor polynomial, Taylor's theorem
The k
th coefficient of the Taylor polynomial.
Equations
- taylor_coeff_within f k s x₀ = (↑(k.factorial))⁻¹ • iterated_deriv_within k f s x₀
The Taylor polynomial with derivatives inside of a set s
.
The Taylor polynomial is given by
$$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$
where $f^{(k)}(x₀)$ denotes the iterated derivative in the set s
.
Equations
- taylor_within f n s x₀ = (finset.range (n + 1)).sum (λ (k : ℕ), ⇑(polynomial_module.comp (polynomial.X - ⇑polynomial.C x₀)) (⇑(polynomial_module.single ℝ k) (taylor_coeff_within f k s x₀)))
The Taylor polynomial with derivatives inside of a set s
considered as a function ℝ → E
Equations
- taylor_within_eval f n s x₀ x = ⇑(polynomial_module.eval x) (taylor_within f n s x₀)
The Taylor polynomial of order zero evaluates to f x
.
Evaluating the Taylor polynomial at x = x₀
yields f x
.
If f
is n
times continuous differentiable on a set s
, then the Taylor polynomial
taylor_within_eval f n s x₀ x
is continuous in x₀
.
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for arbitrary sets
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for open intervals
Calculate the derivative of the Taylor polynomial with respect to x₀
.
Version for closed intervals
Taylor's theorem with mean value type remainder estimate #
Taylor's theorem with the general mean value form of the remainder.
We assume that f
is n+1
-times continuously differentiable in the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
, and g
is a differentiable function on
Ioo x₀ x
and continuous on Icc x₀ x
. Then there exists a x' ∈ Ioo x₀ x
such that
$$f(x) - (P_n f)(x₀, x) = \frac{(x - x')^n}{n!} \frac{g(x) - g(x₀)}{g' x'},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$.
Taylor's theorem with the Lagrange form of the remainder.
We assume that f
is n+1
-times continuously differentiable in the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
. Then there exists a x' ∈ Ioo x₀ x
such that
$$f(x) - (P_n f)(x₀, x) = \frac{f^{(n+1)}(x') (x - x₀)^{n+1}}{(n+1)!},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$ and $f^{(n+1)}$ is the $n+1$-th iterated
derivative.
Taylor's theorem with the Cauchy form of the remainder.
We assume that f
is n+1
-times continuously differentiable on the closed set Icc x₀ x
and
n+1
-times differentiable on the open set Ioo x₀ x
. Then there exists a x' ∈ Ioo x₀ x
such that
$$f(x) - (P_n f)(x₀, x) = \frac{f^{(n+1)}(x') (x - x')^n (x-x₀)}{n!},$$
where $P_n f$ denotes the Taylor polynomial of degree $n$ and $f^{(n+1)}$ is the $n+1$-th iterated
derivative.
Taylor's theorem with a polynomial bound on the remainder
We assume that f
is n+1
-times continuously differentiable on the closed set Icc a b
.
The difference of f
and its n
-th Taylor polynomial can be estimated by
C * (x - a)^(n+1) / n!
where C
is a bound for the n+1
-th iterated derivative of f
.
Taylor's theorem with a polynomial bound on the remainder
We assume that f
is n+1
-times continuously differentiable on the closed set Icc a b
.
There exists a constant C
such that for all x ∈ Icc a b
the difference of f
and its n
-th
Taylor polynomial can be estimated by C * (x - a)^(n+1)
.