# mathlib3documentation

analysis.calculus.iterated_deriv

# One-dimensional iterated derivatives #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

We define the n-th derivative of a function f : π β F as a function iterated_deriv n f : π β F, as well as a version on domains iterated_deriv_within n f s : π β F, and prove their basic properties.

## Main definitions and results #

Let π be a nontrivially normed field, and F a normed vector space over π. Let f : π β F.

• iterated_deriv n f is the n-th derivative of f, seen as a function from π to F. It is defined as the n-th FrΓ©chet derivative (which is a multilinear map) applied to the vector (1, ..., 1), to take advantage of all the existing framework, but we show that it coincides with the naive iterative definition.
• iterated_deriv_eq_iterate states that the n-th derivative of f is obtained by starting from f and differentiating it n times.
• iterated_deriv_within n f s is the n-th derivative of f within the domain s. It only behaves well when s has the unique derivative property.
• iterated_deriv_within_eq_iterate states that the n-th derivative of f in the domain s is obtained by starting from f and differentiating it n times within s. This only holds when s has the unique derivative property.

## Implementation details #

The results are deduced from the corresponding results for the more general (multilinear) iterated FrΓ©chet derivative. For this, we write iterated_deriv n f as the composition of iterated_fderiv π n f and a continuous linear equiv. As continuous linear equivs respect differentiability and commute with differentiation, this makes it possible to prove readily that the derivative of the n-th derivative is the n+1-th derivative in iterated_deriv_within_succ, by translating the corresponding result iterated_fderiv_within_succ_apply_left for the iterated FrΓ©chet derivative.

noncomputable def iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] (n : β) (f : π β F) (x : π) :
F

The n-th iterated derivative of a function from π to F, as a function from π to F.

Equations
noncomputable def iterated_deriv_within {π : Type u_1} {F : Type u_2} [normed_space π F] (n : β) (f : π β F) (s : set π) (x : π) :
F

The n-th iterated derivative of a function from π to F within a set s, as a function from π to F.

Equations
theorem iterated_deriv_within_univ {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :

### Properties of the iterated derivative within a set #

theorem iterated_deriv_within_eq_iterated_fderiv_within {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} :
x = β n f s x) (Ξ» (i : fin n), 1)
theorem iterated_deriv_within_eq_equiv_comp {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} :
= β (fin n) F).symm) β n f s

Write the iterated derivative as the composition of a continuous linear equiv and the iterated FrΓ©chet derivative

theorem iterated_fderiv_within_eq_equiv_comp {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} :
n f s = β F) β

Write the iterated FrΓ©chet derivative as the composition of a continuous linear equiv and the iterated derivative.

theorem iterated_fderiv_within_apply_eq_iterated_deriv_within_mul_prod {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} {m : fin n β π} :
β n f s x) m = finset.univ.prod (Ξ» (i : fin n), m i) β’ x

The n-th FrΓ©chet derivative applied to a vector (m 0, ..., m (n-1)) is the derivative multiplied by the product of the m is.

theorem norm_iterated_fderiv_within_eq_norm_iterated_deriv_within {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} :
@[simp]
theorem iterated_deriv_within_zero {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} :
= f
@[simp]
theorem iterated_deriv_within_one {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {x : π} (h : s x) :
x = s x
theorem cont_diff_on_of_continuous_on_differentiable_on_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {n : ββ} (Hcont : β (m : β), βm β€ n β continuous_on (Ξ» (x : π), x) s) (Hdiff : β (m : β), βm < n β (Ξ» (x : π), x) s) :
cont_diff_on π n f s

If the first n derivatives within a set of a function are continuous, and its first n-1 derivatives are differentiable, then the function is C^n. This is not an equivalence in general, but this is an equivalence when the set has unique derivatives, see cont_diff_on_iff_continuous_on_differentiable_on_deriv.

theorem cont_diff_on_of_differentiable_on_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {n : ββ} (h : β (m : β), βm β€ n β s) s) :
cont_diff_on π n f s

To check that a function is n times continuously differentiable, it suffices to check that its first n derivatives are differentiable. This is slightly too strong as the condition we require on the n-th derivative is differentiability instead of continuity, but it has the advantage of avoiding the discussion of continuity in the proof (and for n = β this is optimal).

theorem cont_diff_on.continuous_on_iterated_deriv_within {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {n : ββ} {m : β} (h : cont_diff_on π n f s) (hmn : βm β€ n) (hs : unique_diff_on π s) :
s

On a set with unique derivatives, a C^n function has derivatives up to n which are continuous.

theorem cont_diff_within_at.differentiable_within_at_iterated_deriv_within {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {x : π} {n : ββ} {m : β} (h : n f s x) (hmn : βm < n) (hs : unique_diff_on π s)) :
s) s x
theorem cont_diff_on.differentiable_on_iterated_deriv_within {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {n : ββ} {m : β} (h : cont_diff_on π n f s) (hmn : βm < n) (hs : unique_diff_on π s) :
s) s

On a set with unique derivatives, a C^n function has derivatives less than n which are differentiable.

theorem cont_diff_on_iff_continuous_on_differentiable_on_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {s : set π} {n : ββ} (hs : unique_diff_on π s) :
cont_diff_on π n f s β (β (m : β), βm β€ n β s) β§ β (m : β), βm < n β s) s

The property of being C^n, initially defined in terms of the FrΓ©chet derivative, can be reformulated in terms of the one-dimensional derivative on sets with unique derivatives.

theorem iterated_deriv_within_succ {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} (hxs : s x) :
iterated_deriv_within (n + 1) f s x = s x

The n+1-th iterated derivative within a set with unique derivatives can be obtained by differentiating the n-th iterated derivative.

theorem iterated_deriv_within_eq_iterate {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} (hs : unique_diff_on π s) (hx : x β s) :
x = (Ξ» (g : π β F), s)^[n] f x

The n-th iterated derivative within a set with unique derivatives can be obtained by iterating n times the differentiation operation.

theorem iterated_deriv_within_succ' {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {s : set π} {x : π} (hxs : unique_diff_on π s) (hx : x β s) :
iterated_deriv_within (n + 1) f s x = s x

The n+1-th iterated derivative within a set with unique derivatives can be obtained by taking the n-th derivative of the derivative.

### Properties of the iterated derivative on the whole space #

theorem iterated_deriv_eq_iterated_fderiv {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {x : π} :
x = β(iterated_fderiv π n f x) (Ξ» (i : fin n), 1)
theorem iterated_deriv_eq_equiv_comp {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :
= β (fin n) F).symm) β iterated_fderiv π n f

Write the iterated derivative as the composition of a continuous linear equiv and the iterated FrΓ©chet derivative

theorem iterated_fderiv_eq_equiv_comp {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :
iterated_fderiv π n f = β F) β

Write the iterated FrΓ©chet derivative as the composition of a continuous linear equiv and the iterated derivative.

theorem iterated_fderiv_apply_eq_iterated_deriv_mul_prod {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {x : π} {m : fin n β π} :
β(iterated_fderiv π n f x) m = finset.univ.prod (Ξ» (i : fin n), m i) β’ x

The n-th FrΓ©chet derivative applied to a vector (m 0, ..., m (n-1)) is the derivative multiplied by the product of the m is.

theorem norm_iterated_fderiv_eq_norm_iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} {x : π} :
@[simp]
theorem iterated_deriv_zero {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} :
= f
@[simp]
theorem iterated_deriv_one {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} :
=
theorem cont_diff_iff_iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {n : ββ} :

The property of being C^n, initially defined in terms of the FrΓ©chet derivative, can be reformulated in terms of the one-dimensional derivative.

theorem cont_diff_of_differentiable_iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {n : ββ} (h : β (m : β), βm β€ n β differentiable π f)) :
cont_diff π n f

To check that a function is n times continuously differentiable, it suffices to check that its first n derivatives are differentiable. This is slightly too strong as the condition we require on the n-th derivative is differentiability instead of continuity, but it has the advantage of avoiding the discussion of continuity in the proof (and for n = β this is optimal).

theorem cont_diff.continuous_iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {n : ββ} (m : β) (h : cont_diff π n f) (hmn : βm β€ n) :
theorem cont_diff.differentiable_iterated_deriv {π : Type u_1} {F : Type u_2} [normed_space π F] {f : π β F} {n : ββ} (m : β) (h : cont_diff π n f) (hmn : βm < n) :
differentiable π f)
theorem iterated_deriv_succ {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :
iterated_deriv (n + 1) f = deriv f)

The n+1-th iterated derivative can be obtained by differentiating the n-th iterated derivative.

theorem iterated_deriv_eq_iterate {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :

The n-th iterated derivative can be obtained by iterating n times the differentiation operation.

theorem iterated_deriv_succ' {π : Type u_1} {F : Type u_2} [normed_space π F] {n : β} {f : π β F} :
iterated_deriv (n + 1) f = (deriv f)

The n+1-th iterated derivative can be obtained by taking the n-th derivative of the derivative.