# mathlib3documentation

analysis.calculus.cont_diff_def

# Higher differentiability #

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

A function is `C^1` on a domain if it is differentiable there, and its derivative is continuous. By induction, it is `C^n` if it is `C^{n-1}` and its (n-1)-th derivative is `C^1` there or, equivalently, if it is `C^1` and its derivative is `C^{n-1}`. Finally, it is `C^∞` if it is `C^n` for all n.

We formalize these notions by defining iteratively the `n+1`-th derivative of a function as the derivative of the `n`-th derivative. It is called `iterated_fderiv 𝕜 n f x` where `𝕜` is the field, `n` is the number of iterations, `f` is the function and `x` is the point, and it is given as an `n`-multilinear map. We also define a version `iterated_fderiv_within` relative to a domain, as well as predicates `cont_diff_within_at`, `cont_diff_at`, `cont_diff_on` and `cont_diff` saying that the function is `C^n` within a set at a point, at a point, on a set and on the whole space respectively.

To avoid the issue of choice when choosing a derivative in sets where the derivative is not necessarily unique, `cont_diff_on` is not defined directly in terms of the regularity of the specific choice `iterated_fderiv_within 𝕜 n f s` inside `s`, but in terms of the existence of a nice sequence of derivatives, expressed with a predicate `has_ftaylor_series_up_to_on`.

We prove basic properties of these notions.

## Main definitions and results #

Let `f : E → F` be a map between normed vector spaces over a nontrivially normed field `𝕜`.

• `has_ftaylor_series_up_to n f p`: expresses that the formal multilinear series `p` is a sequence of iterated derivatives of `f`, up to the `n`-th term (where `n` is a natural number or `∞`).
• `has_ftaylor_series_up_to_on n f p s`: same thing, but inside a set `s`. The notion of derivative is now taken inside `s`. In particular, derivatives don't have to be unique.
• `cont_diff 𝕜 n f`: expresses that `f` is `C^n`, i.e., it admits a Taylor series up to rank `n`.
• `cont_diff_on 𝕜 n f s`: expresses that `f` is `C^n` in `s`.
• `cont_diff_at 𝕜 n f x`: expresses that `f` is `C^n` around `x`.
• `cont_diff_within_at 𝕜 n f s x`: expresses that `f` is `C^n` around `x` within the set `s`.
• `iterated_fderiv_within 𝕜 n f s x` is an `n`-th derivative of `f` over the field `𝕜` on the set `s` at the point `x`. It is a continuous multilinear map from `E^n` to `F`, defined as a derivative within `s` of `iterated_fderiv_within 𝕜 (n-1) f s` if one exists, and `0` otherwise.
• `iterated_fderiv 𝕜 n f x` is the `n`-th derivative of `f` over the field `𝕜` at the point `x`. It is a continuous multilinear map from `E^n` to `F`, defined as a derivative of `iterated_fderiv 𝕜 (n-1) f` if one exists, and `0` otherwise.

In sets of unique differentiability, `cont_diff_on 𝕜 n f s` can be expressed in terms of the properties of `iterated_fderiv_within 𝕜 m f s` for `m ≤ n`. In the whole space, `cont_diff 𝕜 n f` can be expressed in terms of the properties of `iterated_fderiv 𝕜 m f` for `m ≤ n`.

## Implementation notes #

The definitions in this file are designed to work on any field `𝕜`. They are sometimes slightly more complicated than the naive definitions one would guess from the intuition over the real or complex numbers, but they are designed to circumvent the lack of gluing properties and partitions of unity in general. In the usual situations, they coincide with the usual definitions.

### Definition of `C^n` functions in domains #

One could define `C^n` functions in a domain `s` by fixing an arbitrary choice of derivatives (this is what we do with `iterated_fderiv_within`) and requiring that all these derivatives up to `n` are continuous. If the derivative is not unique, this could lead to strange behavior like two `C^n` functions `f` and `g` on `s` whose sum is not `C^n`. A better definition is thus to say that a function is `C^n` inside `s` if it admits a sequence of derivatives up to `n` inside `s`.

This definition still has the problem that a function which is locally `C^n` would not need to be `C^n`, as different choices of sequences of derivatives around different points might possibly not be glued together to give a globally defined sequence of derivatives. (Note that this issue can not happen over reals, thanks to partition of unity, but the behavior over a general field is not so clear, and we want a definition for general fields). Also, there are locality problems for the order parameter: one could image a function which, for each `n`, has a nice sequence of derivatives up to order `n`, but they do not coincide for varying `n` and can therefore not be glued to give rise to an infinite sequence of derivatives. This would give a function which is `C^n` for all `n`, but not `C^∞`. We solve this issue by putting locality conditions in space and order in our definition of `cont_diff_within_at` and `cont_diff_on`. The resulting definition is slightly more complicated to work with (in fact not so much), but it gives rise to completely satisfactory theorems.

For instance, with this definition, a real function which is `C^m` (but not better) on `(-1/m, 1/m)` for each natural `m` is by definition `C^∞` at `0`.

There is another issue with the definition of `cont_diff_within_at 𝕜 n f s x`. We can require the existence and good behavior of derivatives up to order `n` on a neighborhood of `x` within `s`. However, this does not imply continuity or differentiability within `s` of the function at `x` when `x` does not belong to `s`. Therefore, we require such existence and good behavior on a neighborhood of `x` within `s ∪ {x}` (which appears as `insert x s` in this file).

### Side of the composition, and universe issues #

With a naïve direct definition, the `n`-th derivative of a function belongs to the space `E →L[𝕜] (E →L[𝕜] (E ... F)...)))` where there are n iterations of `E →L[𝕜]`. This space may also be seen as the space of continuous multilinear functions on `n` copies of `E` with values in `F`, by uncurrying. This is the point of view that is usually adopted in textbooks, and that we also use. This means that the definition and the first proofs are slightly involved, as one has to keep track of the uncurrying operation. The uncurrying can be done from the left or from the right, amounting to defining the `n+1`-th derivative either as the derivative of the `n`-th derivative, or as the `n`-th derivative of the derivative. For proofs, it would be more convenient to use the latter approach (from the right), as it means to prove things at the `n+1`-th step we only need to understand well enough the derivative in `E →L[𝕜] F` (contrary to the approach from the left, where one would need to know enough on the `n`-th derivative to deduce things on the `n+1`-th derivative).

However, the definition from the right leads to a universe polymorphism problem: if we define `iterated_fderiv 𝕜 (n + 1) f x = iterated_fderiv 𝕜 n (fderiv 𝕜 f) x` by induction, we need to generalize over all spaces (as `f` and `fderiv 𝕜 f` don't take values in the same space). It is only possible to generalize over all spaces in some fixed universe in an inductive definition. For `f : E → F`, then `fderiv 𝕜 f` is a map `E → (E →L[𝕜] F)`. Therefore, the definition will only work if `F` and `E →L[𝕜] F` are in the same universe.

This issue does not appear with the definition from the left, where one does not need to generalize over all spaces. Therefore, we use the definition from the left. This means some proofs later on become a little bit more complicated: to prove that a function is `C^n`, the most efficient approach is to exhibit a formula for its `n`-th derivative and prove it is continuous (contrary to the inductive approach where one would prove smoothness statements without giving a formula for the derivative). In the end, this approach is still satisfactory as it is good to have formulas for the iterated derivatives in various constructions.

One point where we depart from this explicit approach is in the proof of smoothness of a composition: there is a formula for the `n`-th derivative of a composition (Faà di Bruno's formula), but it is very complicated and barely usable, while the inductive proof is very simple. Thus, we give the inductive proof. As explained above, it works by generalizing over the target space, hence it only works well if all spaces belong to the same universe. To get the general version, we lift things to a common universe using a trick.

### Variables management #

The textbook definitions and proofs use various identifications and abuse of notations, for instance when saying that the natural space in which the derivative lives, i.e., `E →L[𝕜] (E →L[𝕜] ( ... →L[𝕜] F))`, is the same as a space of multilinear maps. When doing things formally, we need to provide explicit maps for these identifications, and chase some diagrams to see everything is compatible with the identifications. In particular, one needs to check that taking the derivative and then doing the identification, or first doing the identification and then taking the derivative, gives the same result. The key point for this is that taking the derivative commutes with continuous linear equivalences. Therefore, we need to implement all our identifications with continuous linear equivs.

## Notations #

We use the notation `E [×n]→L[𝕜] F` for the space of continuous multilinear maps on `E^n` with values in `F`. This is the space in which the `n`-th derivative of a function from `E` to `F` lives.

In this file, we denote `⊤ : ℕ∞` with `∞`.

## Tags #

derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor series, formal series

### Functions with a Taylor series on a domain #

structure has_ftaylor_series_up_to_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) (p : E ) (s : set E) :
Prop

`has_ftaylor_series_up_to_on n f p s` registers the fact that `p 0 = f` and `p (m+1)` is a derivative of `p m` for `m < n`, and is continuous for `m ≤ n`. This is a predicate analogous to `has_fderiv_within_at` but for higher order derivatives.

theorem has_ftaylor_series_up_to_on.zero_eq' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {p : E } (h : s) {x : E} (hx : x s) :
p x 0 = .symm) (f x)
theorem has_ftaylor_series_up_to_on.congr {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {n : ℕ∞} {p : E } (h : s) (h₁ : (x : E), x s f₁ x = f x) :
s

If two functions coincide on a set `s`, then a Taylor series for the first one is as well a Taylor series for the second one.

theorem has_ftaylor_series_up_to_on.mono {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {p : E } (h : s) {t : set E} (hst : t s) :
t
theorem has_ftaylor_series_up_to_on.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {m n : ℕ∞} {p : E } (h : s) (hmn : m n) :
s
theorem has_ftaylor_series_up_to_on.continuous_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {p : E } (h : s) :
theorem has_ftaylor_series_up_to_on_zero_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {p : E } :
s (x : E), x s (p x 0).uncurry0 = f x
theorem has_ftaylor_series_up_to_on_top_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {p : E } :
(n : ), s
theorem has_ftaylor_series_up_to_on_top_iff' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {p : E } :
( (x : E), x s (p x 0).uncurry0 = f x) (m : ) (x : E), x s has_fderiv_within_at (λ (y : E), p y m) (p x m.succ).curry_left s x

In the case that `n = ∞` we don't need the continuity assumption in `has_ftaylor_series_up_to_on`.

theorem has_ftaylor_series_up_to_on.has_fderiv_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {p : E } (h : s) (hn : 1 n) (hx : x s) :
( (p x 1)) s x

If a function has a Taylor series at order at least `1`, then the term of order `1` of this series is a derivative of `f`.

theorem has_ftaylor_series_up_to_on.differentiable_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {p : E } (h : s) (hn : 1 n) :
s
theorem has_ftaylor_series_up_to_on.has_fderiv_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {p : E } (h : s) (hn : 1 n) (hx : s nhds x) :
( (p x 1)) x

If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then the term of order `1` of this series is a derivative of `f` at `x`.

theorem has_ftaylor_series_up_to_on.eventually_has_fderiv_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {p : E } (h : s) (hn : 1 n) (hx : s nhds x) :
∀ᶠ (y : E) in nhds x, ( (p y 1)) y

If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then in a neighborhood of `x`, the term of order `1` of this series is a derivative of `f`.

theorem has_ftaylor_series_up_to_on.differentiable_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {p : E } (h : s) (hn : 1 n) (hx : s nhds x) :
x

If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then it is differentiable at `x`.

theorem has_ftaylor_series_up_to_on_succ_iff_left {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {p : E } {n : } :
f p s s ( (x : E), x s has_fderiv_within_at (λ (y : E), p y n) (p x n.succ).curry_left s x) continuous_on (λ (x : E), p x (n + 1)) s

`p` is a Taylor series of `f` up to `n+1` if and only if `p` is a Taylor series up to `n`, and `p (n + 1)` is a derivative of `p n`.

theorem has_ftaylor_series_up_to_on_succ_iff_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {p : E } {n : } :
f p s ( (x : E), x s (p x 0).uncurry0 = f x) ( (x : E), x s has_fderiv_within_at (λ (y : E), p y 0) (p x 1).curry_left s x) (λ (x : E), (p x 1)) (λ (x : E), (p x).shift) s

`p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n` for `p 1`, which is a derivative of `f`.

### Smooth functions within a set around a point #

def cont_diff_within_at (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) (s : set E) (x : E) :
Prop

A function is continuously differentiable up to order `n` within a set `s` at a point `x` if it admits continuous derivatives up to order `n` in a neighborhood of `x` in `s ∪ {x}`. For `n = ∞`, we only require that this holds up to any finite order (where the neighborhood may depend on the finite order we consider).

For instance, a real function which is `C^m` on `(-1/m, 1/m)` for each natural `m`, but not better, is `C^∞` at `0` within `univ`.

Equations
theorem cont_diff_within_at_nat {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } :
f s x (u : set E) (H : u s)) (p : E , u
theorem cont_diff_within_at.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {m n : ℕ∞} (h : f s x) (hmn : m n) :
f s x
theorem cont_diff_within_at_iff_forall_nat_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} :
f s x (m : ), m n f s x
theorem cont_diff_within_at_top {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} :
s x (n : ), f s x
theorem cont_diff_within_at.continuous_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) :
x
theorem cont_diff_within_at.congr_of_eventually_eq {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h : f s x) (h₁ : f₁ =ᶠ[ s] f) (hx : f₁ x = f x) :
f₁ s x
theorem cont_diff_within_at.congr_of_eventually_eq_insert {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h : f s x) (h₁ : f₁ =ᶠ[ s)] f) :
f₁ s x
theorem cont_diff_within_at.congr_of_eventually_eq' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h : f s x) (h₁ : f₁ =ᶠ[ s] f) (hx : x s) :
f₁ s x
theorem filter.eventually_eq.cont_diff_within_at_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h₁ : f₁ =ᶠ[ s] f) (hx : f₁ x = f x) :
f₁ s x f s x
theorem cont_diff_within_at.congr {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h : f s x) (h₁ : (y : E), y s f₁ y = f y) (hx : f₁ x = f x) :
f₁ s x
theorem cont_diff_within_at.congr' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} {n : ℕ∞} (h : f s x) (h₁ : (y : E), y s f₁ y = f y) (hx : x s) :
f₁ s x
theorem cont_diff_within_at.mono_of_mem {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) {t : set E} (hst : s t) :
f t x
theorem cont_diff_within_at.mono {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) {t : set E} (hst : t s) :
f t x
theorem cont_diff_within_at.congr_nhds {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) {t : set E} (hst : s = t) :
f t x
theorem cont_diff_within_at_congr_nhds {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {t : set E} (hst : s = t) :
f s x f t x
theorem cont_diff_within_at_inter' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f : E F} {x : E} {n : ℕ∞} (h : t s) :
f (s t) x f s x
theorem cont_diff_within_at_inter {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f : E F} {x : E} {n : ℕ∞} (h : t nhds x) :
f (s t) x f s x
theorem cont_diff_within_at_insert {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {y : E} :
f s) x f s x
theorem cont_diff_within_at.of_insert {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {y : E} :
f s) x f s x

Alias of the forward direction of `cont_diff_within_at_insert`.

theorem cont_diff_within_at.insert' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {y : E} :
f s x f s) x

Alias of the reverse direction of `cont_diff_within_at_insert`.

theorem cont_diff_within_at.insert {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) :
f s) x
theorem cont_diff_within_at.differentiable_within_at' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) (hn : 1 n) :
x

If a function is `C^n` within a set at a point, with `n ≥ 1`, then it is differentiable within this set at this point.

theorem cont_diff_within_at.differentiable_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) (hn : 1 n) :
x
theorem cont_diff_within_at_succ_iff_has_fderiv_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } :
(n + 1) f s x (u : set E) (H : u s)) (f' : E (E →L[𝕜] F)), ( (x : E), x u (f' x) u x) f' u x

A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`.

theorem cont_diff_within_at_succ_iff_has_fderiv_within_at' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } :
(n + 1) f s x (u : set E) (H : u s)), u (f' : E (E →L[𝕜] F)), ( (x : E), x u (f' x) s x) f' s x

A version of `cont_diff_within_at_succ_iff_has_fderiv_within_at` where all derivatives are taken within the same set.

### Smooth functions within a set #

def cont_diff_on (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) (s : set E) :
Prop

A function is continuously differentiable up to `n` on `s` if, for any point `x` in `s`, it admits continuous derivatives up to order `n` on a neighborhood of `x` in `s`.

For `n = ∞`, we only require that this holds up to any finite order (where the neighborhood may depend on the finite order we consider).

Equations
theorem has_ftaylor_series_up_to_on.cont_diff_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {f' : E } (hf : s) :
n f s
theorem cont_diff_on.cont_diff_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : n f s) (hx : x s) :
f s x
theorem cont_diff_within_at.cont_diff_on' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {m : } (hm : m n) (h : f s x) :
(u : set E), x u f u)
theorem cont_diff_within_at.cont_diff_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {m : } (hm : m n) (h : f s x) :
(u : set E) (H : u s)), u f u
@[protected]
theorem cont_diff_within_at.eventually {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } (h : f s x) :
∀ᶠ (y : E) in s), f s y
theorem cont_diff_on.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {m n : ℕ∞} (h : n f s) (hmn : m n) :
m f s
theorem cont_diff_on.of_succ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (h : (n + 1) f s) :
f s
theorem cont_diff_on.one_of_succ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (h : (n + 1) f s) :
1 f s
theorem cont_diff_on_iff_forall_nat_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} :
n f s (m : ), m n f s
theorem cont_diff_on_top {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} :
f s (n : ), f s
theorem cont_diff_on_all_iff_nat {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} :
( (n : ℕ∞), n f s) (n : ), f s
theorem cont_diff_on.continuous_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) :
theorem cont_diff_on.congr {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {n : ℕ∞} (h : n f s) (h₁ : (x : E), x s f₁ x = f x) :
n f₁ s
theorem cont_diff_on_congr {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {n : ℕ∞} (h₁ : (x : E), x s f₁ x = f x) :
n f₁ s n f s
theorem cont_diff_on.mono {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) {t : set E} (hst : t s) :
n f t
theorem cont_diff_on.congr_mono {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s s₁ : set E} {f f₁ : E F} {n : ℕ∞} (hf : n f s) (h₁ : (x : E), x s₁ f₁ x = f x) (hs : s₁ s) :
n f₁ s₁
theorem cont_diff_on.differentiable_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) (hn : 1 n) :
s

If a function is `C^n` on a set with `n ≥ 1`, then it is differentiable there.

theorem cont_diff_on_of_locally_cont_diff_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : (x : E), x s ( (u : set E), x u n f (s u))) :
n f s

If a function is `C^n` around each point in a set, then it is `C^n` on the set.

theorem cont_diff_on_succ_iff_has_fderiv_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } :
(n + 1) f s (x : E), x s ( (u : set E) (H : u s)) (f' : E (E →L[𝕜] F)), ( (x : E), x u (f' x) u x) f' u)

A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`.

### Iterated derivative within a set #

noncomputable def iterated_fderiv_within (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ) (f : E F) (s : set E) :
E (λ (i : fin n), E) F

The `n`-th derivative of a function along a set, defined inductively by saying that the `n+1`-th derivative of `f` is the derivative of the `n`-th derivative of `f` along this set, together with an uncurrying step to see it as a multilinear map in `n+1` variables..

Equations
• s = n.rec_on (λ (x : E), (f x)) (λ (n : ) (rec : E (λ (i : fin n), E) F) (x : E), rec s x).uncurry_left)
noncomputable def ftaylor_series_within (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (f : E F) (s : set E) (x : E) :

Formal Taylor series associated to a function within a set.

Equations
• x = λ (n : ), s x
@[simp]
theorem iterated_fderiv_within_zero_apply {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} (m : fin 0 E) :
f s x) m = f x
theorem iterated_fderiv_within_zero_eq_comp {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} :
s = .symm) f
@[simp]
theorem norm_iterated_fderiv_within_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} :
s x = f x
theorem iterated_fderiv_within_succ_apply_left {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } (m : fin (n + 1) E) :
(n + 1) f s x) m = ( f s) s x) (m 0)) (fin.tail m)
theorem iterated_fderiv_within_succ_eq_comp_left {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } :
(n + 1) f s = (λ (i : fin (n + 1)), E) F) f s) s

Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv, and the derivative of the `n`-th derivative.

theorem norm_fderiv_within_iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } :
f s) s x = (n + 1) f s x
theorem iterated_fderiv_within_succ_apply_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } (hs : s) (hx : x s) (m : fin (n + 1) E) :
(n + 1) f s x) m = ( (λ (y : E), s y) s x) (fin.init m)) (m (fin.last n))
theorem iterated_fderiv_within_succ_eq_comp_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } (hs : s) (hx : x s) :
(n + 1) f s x = ( (λ (y : E), s y) s) x

Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv, and the `n`-th derivative of the derivative.

theorem norm_iterated_fderiv_within_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : } (hs : s) (hx : x s) :
f s) s x = (n + 1) f s x
@[simp]
theorem iterated_fderiv_within_one_apply {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} (h : x) (m : fin 1 E) :
f s x) m = f s x) (m 0)
theorem filter.eventually_eq.iterated_fderiv_within' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f f₁ : E F} {x : E} (h : f₁ =ᶠ[ s] f) (ht : t s) (n : ) :
f₁ t =ᶠ[ s] t
@[protected]
theorem filter.eventually_eq.iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} (h : f₁ =ᶠ[ s] f) (n : ) :
f₁ s =ᶠ[ s] s
theorem filter.eventually_eq.iterated_fderiv_within_eq {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} (h : f₁ =ᶠ[ s] f) (hx : f₁ x = f x) (n : ) :
f₁ s x = s x

If two functions coincide in a neighborhood of `x` within a set `s` and at `x`, then their iterated differentials within this set at `x` coincide.

theorem iterated_fderiv_within_congr {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} {x : E} (hs : f s) (hx : x s) (n : ) :
f₁ s x = s x

If two functions coincide on a set `s`, then their iterated differentials within this set coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and `filter.eventually_eq.iterated_fderiv_within`.

@[protected]
theorem set.eq_on.iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f f₁ : E F} (hs : f s) (n : ) :
set.eq_on f₁ s) f s) s

If two functions coincide on a set `s`, then their iterated differentials within this set coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and `filter.eventually_eq.iterated_fderiv_within`.

theorem iterated_fderiv_within_eventually_congr_set' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f : E F} {x : E} (y : E) (h : s =ᶠ[ {y}] t) (n : ) :
s =ᶠ[nhds x] t
theorem iterated_fderiv_within_eventually_congr_set {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f : E F} {x : E} (h : s =ᶠ[nhds x] t) (n : ) :
s =ᶠ[nhds x] t
theorem iterated_fderiv_within_congr_set {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s t : set E} {f : E F} {x : E} (h : s =ᶠ[nhds x] t) (n : ) :
s x = t x
theorem iterated_fderiv_within_inter' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s u : set E} {f : E F} {x : E} {n : } (hu : u s) :
(s u) x = s x

The iterated differential within a set `s` at a point `x` is not modified if one intersects `s` with a neighborhood of `x` within `s`.

theorem iterated_fderiv_within_inter {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s u : set E} {f : E F} {x : E} {n : } (hu : u nhds x) :
(s u) x = s x

The iterated differential within a set `s` at a point `x` is not modified if one intersects `s` with a neighborhood of `x`.

theorem iterated_fderiv_within_inter_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s u : set E} {f : E F} {x : E} {n : } (hu : is_open u) (hx : x u) :
(s u) x = s x

The iterated differential within a set `s` at a point `x` is not modified if one intersects `s` with an open set containing `x`.

@[simp]
theorem cont_diff_on_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} :
0 f s
theorem cont_diff_within_at_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} (hx : x s) :
f s x (u : set E) (H : u s), (s u)
theorem has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {p : E } (h : s) {m : } (hmn : m n) (hs : s) (hx : x s) :
p x m = s x

On a set with unique differentiability, any choice of iterated differential has to coincide with the one we have chosen in `iterated_fderiv_within 𝕜 m f s`.

theorem cont_diff_on.ftaylor_series_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) (hs : s) :
s) s

When a function is `C^n` in a set `s` of unique differentiability, it admits `ftaylor_series_within 𝕜 f s` as a Taylor series up to order `n` in `s`.

theorem cont_diff_on_of_continuous_on_differentiable_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (Hcont : (m : ), m n continuous_on (λ (x : E), s x) s) (Hdiff : (m : ), m < n (λ (x : E), s x) s) :
n f s
theorem cont_diff_on_of_differentiable_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : (m : ), m n f s) s) :
n f s
theorem cont_diff_on.continuous_on_iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {m : } (h : n f s) (hmn : m n) (hs : s) :
theorem cont_diff_on.differentiable_on_iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} {m : } (h : n f s) (hmn : m < n) (hs : s) :
f s) s
theorem cont_diff_within_at.differentiable_within_at_iterated_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} {m : } (h : f s x) (hmn : m < n) (hs : s)) :
f s) s x
theorem cont_diff_on_iff_continuous_on_differentiable_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (hs : s) :
n f s ( (m : ), m n continuous_on (λ (x : E), s x) s) (m : ), m < n (λ (x : E), s x) s
theorem cont_diff_on_succ_of_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (hf : s) (h : (λ (y : E), s y) s) :
(n + 1) f s
theorem cont_diff_on_succ_iff_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (hs : s) :
(n + 1) f s s (λ (y : E), s y) s

A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is differentiable there, and its derivative (expressed with `fderiv_within`) is `C^n`.

theorem cont_diff_on_succ_iff_has_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (hs : s) :
(n + 1) f s (f' : E (E →L[𝕜] F)), f' s (x : E), x s (f' x) s x
theorem cont_diff_on_succ_iff_fderiv_of_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : } (hs : is_open s) :
(n + 1) f s s (λ (y : E), f y) s

A function is `C^(n + 1)` on an open domain if and only if it is differentiable there, and its derivative (expressed with `fderiv`) is `C^n`.

theorem cont_diff_on_top_iff_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} (hs : s) :
f s s (λ (y : E), s y) s

A function is `C^∞` on a domain with unique derivatives if and only if it is differentiable there, and its derivative (expressed with `fderiv_within`) is `C^∞`.

theorem cont_diff_on_top_iff_fderiv_of_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} (hs : is_open s) :
f s s (λ (y : E), f y) s

A function is `C^∞` on an open domain if and only if it is differentiable there, and its derivative (expressed with `fderiv`) is `C^∞`.

theorem cont_diff_on.fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {m n : ℕ∞} (hf : n f s) (hs : s) (hmn : m + 1 n) :
m (λ (y : E), s y) s
theorem cont_diff_on.fderiv_of_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {m n : ℕ∞} (hf : n f s) (hs : is_open s) (hmn : m + 1 n) :
m (λ (y : E), f y) s
theorem cont_diff_on.continuous_on_fderiv_within {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) (hs : s) (hn : 1 n) :
continuous_on (λ (x : E), s x) s
theorem cont_diff_on.continuous_on_fderiv_of_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f s) (hs : is_open s) (hn : 1 n) :
continuous_on (λ (x : E), f x) s

### Functions with a Taylor series on the whole space #

structure has_ftaylor_series_up_to {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) (p : E ) :
Prop

`has_ftaylor_series_up_to n f p` registers the fact that `p 0 = f` and `p (m+1)` is a derivative of `p m` for `m < n`, and is continuous for `m ≤ n`. This is a predicate analogous to `has_fderiv_at` but for higher order derivatives.

theorem has_ftaylor_series_up_to.zero_eq' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } (h : p) (x : E) :
p x 0 = .symm) (f x)
theorem has_ftaylor_series_up_to_on_univ_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } :
theorem has_ftaylor_series_up_to.has_ftaylor_series_up_to_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } (h : p) (s : set E) :
s
theorem has_ftaylor_series_up_to.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {m n : ℕ∞} {p : E } (h : p) (hmn : m n) :
theorem has_ftaylor_series_up_to.continuous {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } (h : p) :
theorem has_ftaylor_series_up_to_zero_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {p : E } :
(x : E), (p x 0).uncurry0 = f x
theorem has_ftaylor_series_up_to_top_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {p : E } :
(n : ),
theorem has_ftaylor_series_up_to_top_iff' {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {p : E } :
( (x : E), (p x 0).uncurry0 = f x) (m : ) (x : E), has_fderiv_at (λ (y : E), p y m) (p x m.succ).curry_left x

In the case that `n = ∞` we don't need the continuity assumption in `has_ftaylor_series_up_to`.

theorem has_ftaylor_series_up_to.has_fderiv_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } (h : p) (hn : 1 n) (x : E) :
( (p x 1)) x

If a function has a Taylor series at order at least `1`, then the term of order `1` of this series is a derivative of `f`.

theorem has_ftaylor_series_up_to.differentiable {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {p : E } (h : p) (hn : 1 n) :
theorem has_ftaylor_series_up_to_succ_iff_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {p : E } {n : } :
f p ( (x : E), (p x 0).uncurry0 = f x) ( (x : E), has_fderiv_at (λ (y : E), p y 0) (p x 1).curry_left x) (λ (x : E), (p x 1)) (λ (x : E), (p x).shift)

`p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n` for `p 1`, which is a derivative of `f`.

### Smooth functions at a point #

def cont_diff_at (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) (x : E) :
Prop

A function is continuously differentiable up to `n` at a point `x` if, for any integer `k ≤ n`, there is a neighborhood of `x` where `f` admits derivatives up to order `n`, which are continuous.

Equations
• n f x = x
theorem cont_diff_within_at_univ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : ℕ∞} :
x n f x
theorem cont_diff_at_top {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} :
f x (n : ), f x
theorem cont_diff_at.cont_diff_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : n f x) :
f s x
theorem cont_diff_within_at.cont_diff_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : f s x) (hx : s nhds x) :
n f x
theorem cont_diff_at.congr_of_eventually_eq {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f f₁ : E F} {x : E} {n : ℕ∞} (h : n f x) (hg : f₁ =ᶠ[nhds x] f) :
n f₁ x
theorem cont_diff_at.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {m n : ℕ∞} (h : n f x) (hmn : m n) :
m f x
theorem cont_diff_at.continuous_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : ℕ∞} (h : n f x) :
theorem cont_diff_at.differentiable_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : ℕ∞} (h : n f x) (hn : 1 n) :
x

If a function is `C^n` with `n ≥ 1` at a point, then it is differentiable there.

theorem cont_diff_at_succ_iff_has_fderiv_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } :
(n + 1) f x (f' : E (E →L[𝕜] F)), ( (u : set E) (H : u nhds x), (x : E), x u (f' x) x) f' x

A function is `C^(n + 1)` at a point iff locally, it has a derivative which is `C^n`.

@[protected]
theorem cont_diff_at.eventually {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } (h : f x) :
∀ᶠ (y : E) in nhds x, f y

### Smooth functions #

def cont_diff (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ℕ∞) (f : E F) :
Prop

A function is continuously differentiable up to `n` if it admits derivatives up to order `n`, which are continuous. Contrary to the case of definitions in domains (where derivatives might not be unique) we do not need to localize the definition in space or time.

Equations
theorem has_ftaylor_series_up_to.cont_diff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {f' : E } (hf : f') :
n f

If `f` has a Taylor series up to `n`, then it is `C^n`.

theorem cont_diff_on_univ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} :
n f set.univ n f
theorem cont_diff_iff_cont_diff_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} :
n f (x : E), n f x
theorem cont_diff.cont_diff_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : ℕ∞} (h : n f) :
n f x
theorem cont_diff.cont_diff_within_at {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {x : E} {n : ℕ∞} (h : n f) :
f s x
theorem cont_diff_top {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
f (n : ), n f
theorem cont_diff_all_iff_nat {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
( (n : ℕ∞), n f) (n : ), n f
theorem cont_diff.cont_diff_on {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} {n : ℕ∞} (h : n f) :
n f s
@[simp]
theorem cont_diff_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
0 f
theorem cont_diff_at_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} :
0 f x (u : set E) (H : u nhds x),
theorem cont_diff_at_one_iff {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} :
1 f x (f' : E (E →L[𝕜] F)) (u : set E) (H : u nhds x), u (x : E), x u (f' x) x
theorem cont_diff.of_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {m n : ℕ∞} (h : n f) (hmn : m n) :
m f
theorem cont_diff.of_succ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } (h : (n + 1) f) :
n f
theorem cont_diff.one_of_succ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } (h : (n + 1) f) :
1 f
theorem cont_diff.continuous {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} (h : n f) :
theorem cont_diff.differentiable {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} (h : n f) (hn : 1 n) :

If a function is `C^n` with `n ≥ 1`, then it is differentiable.

theorem cont_diff_iff_forall_nat_le {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} :
n f (m : ), m n m f
theorem cont_diff_succ_iff_has_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } :
(n + 1) f (f' : E (E →L[𝕜] F)), n f' (x : E), (f' x) x

A function is `C^(n+1)` iff it has a `C^n` derivative.

### Iterated derivative #

noncomputable def iterated_fderiv (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (n : ) (f : E F) :
E (λ (i : fin n), E) F

The `n`-th derivative of a function, as a multilinear map, defined inductively.

Equations
noncomputable def ftaylor_series (𝕜 : Type u_1) {E : Type u_2} [ E] {F : Type u_3} [ F] (f : E F) (x : E) :

Formal Taylor series associated to a function within a set.

Equations
• x = λ (n : ), f x
@[simp]
theorem iterated_fderiv_zero_apply {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} (m : fin 0 E) :
0 f x) m = f x
theorem iterated_fderiv_zero_eq_comp {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
f = .symm) f
@[simp]
theorem norm_iterated_fderiv_zero {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} :
f x = f x
theorem iterated_fderiv_with_zero_eq {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} :
s = f
theorem iterated_fderiv_succ_apply_left {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } (m : fin (n + 1) E) :
(n + 1) f x) m = ((fderiv 𝕜 n f) x) (m 0)) (fin.tail m)
theorem iterated_fderiv_succ_eq_comp_left {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } :
(n + 1) f = (λ (i : fin (n + 1)), E) F) n f)

Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv, and the derivative of the `n`-th derivative.

theorem fderiv_iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } :
n f) = (λ (i : fin (n + 1)), E) F).symm) (n + 1) f

Writing explicitly the derivative of the `n`-th derivative as the composition of a currying linear equiv, and the `n + 1`-th derivative.

theorem has_compact_support.iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} (hf : has_compact_support f) (n : ) :
theorem norm_fderiv_iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } :
n f) x = (n + 1) f x
theorem iterated_fderiv_within_univ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } :
= f
theorem iterated_fderiv_within_of_is_open {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {s : set E} {f : E F} (n : ) (hs : is_open s) :
set.eq_on f s) n f) s

In an open set, the iterated derivative within this set coincides with the global iterated derivative.

theorem ftaylor_series_within_univ {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
theorem iterated_fderiv_succ_apply_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } (m : fin (n + 1) E) :
(n + 1) f x) m = ( n (λ (y : E), f y) x) (fin.init m)) (m (fin.last n))
theorem iterated_fderiv_succ_eq_comp_right {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } :
(n + 1) f x = ( (λ (y : E), f y)) x

Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv, and the `n`-th derivative of the derivative.

theorem norm_iterated_fderiv_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} {n : } :
(fderiv 𝕜 f) x = (n + 1) f x
@[simp]
theorem iterated_fderiv_one_apply {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {x : E} (m : fin 1 E) :
1 f x) m = (fderiv 𝕜 f x) (m 0)
theorem cont_diff_iff_ftaylor_series {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} :
n f f)

When a function is `C^n` in a set `s` of unique differentiability, it admits `ftaylor_series_within 𝕜 f s` as a Taylor series up to order `n` in `s`.

theorem cont_diff_iff_continuous_differentiable {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} :
n f ( (m : ), m n continuous (λ (x : E), f x)) (m : ), m < n (λ (x : E), f x)
theorem cont_diff.continuous_iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {m : } (hm : m n) (hf : n f) :
continuous (λ (x : E), f x)

If `f` is `C^n` then its `m`-times iterated derivative is continuous for `m ≤ n`.

theorem cont_diff.differentiable_iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} {m : } (hm : m < n) (hf : n f) :
(λ (x : E), f x)

If `f` is `C^n` then its `m`-times iterated derivative is differentiable for `m < n`.

theorem cont_diff_of_differentiable_iterated_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} (h : (m : ), m n m f)) :
n f
theorem cont_diff_succ_iff_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : } :
(n + 1) f n (λ (y : E), f y)

A function is `C^(n + 1)` if and only if it is differentiable, and its derivative (formulated in terms of `fderiv`) is `C^n`.

theorem cont_diff_one_iff_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
1 f continuous (fderiv 𝕜 f)
theorem cont_diff_top_iff_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} :
f (λ (y : E), f y)

A function is `C^∞` if and only if it is differentiable, and its derivative (formulated in terms of `fderiv`) is `C^∞`.

theorem cont_diff.continuous_fderiv {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} (h : n f) (hn : 1 n) :
continuous (λ (x : E), f x)
theorem cont_diff.continuous_fderiv_apply {𝕜 : Type u_1} {E : Type u_2} [ E] {F : Type u_3} [ F] {f : E F} {n : ℕ∞} (h : n f) (hn : 1 n) :
continuous (λ (p : E × E), (fderiv 𝕜 f p.fst) p.snd)

If a function is at least `C^1`, its bundled derivative (mapping `(x, v)` to `Df(x) v`) is continuous.