Higher differentiability of usual operations #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We prove that the usual operations (addition, multiplication, difference, composition, and
so on) preserve C^n
functions. We also expand the API around C^n
functions.
Main results #
cont_diff.comp
states that the composition of twoC^n
functions isC^n
.norm_iterated_fderiv_comp_le
gives the boundn! * C * D ^ n
for then
-th derivative ofg ∘ f
assuming that the derivatives ofg
are bounded byC
and thei
-th derivative off
is bounded byD ^ i
.
Similar results are given for C^n
functions on domains.
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
Constants #
Constants are C^∞
.
Smoothness of linear functions #
Unbundled bounded linear functions are C^∞
.
The identity is C^∞
.
Bilinear functions are C^∞
.
If f
admits a Taylor series p
in a set s
, and g
is linear, then g ∘ f
admits a Taylor
series whose k
-th term is given by g ∘ (p k)
.
Composition by continuous linear maps on the left preserves C^n
functions in a domain
at a point.
Composition by continuous linear maps on the left preserves C^n
functions in a domain
at a point.
Composition by continuous linear maps on the left preserves C^n
functions on domains.
Composition by continuous linear maps on the left preserves C^n
functions.
The iterated derivative within a set of the composition with a linear map on the left is obtained by applying the linear map to the iterated derivative.
The iterated derivative of the composition with a linear map on the left is obtained by applying the linear map to the iterated derivative.
The iterated derivative within a set of the composition with a linear equiv on the left is obtained by applying the linear equiv to the iterated derivative. This is true without differentiability assumptions.
Composition with a linear isometry on the left preserves the norm of the iterated derivative within a set.
Composition with a linear isometry on the left preserves the norm of the iterated derivative.
Composition with a linear isometry equiv on the left preserves the norm of the iterated derivative within a set.
Composition with a linear isometry equiv on the left preserves the norm of the iterated derivative.
Composition by continuous linear equivs on the left respects higher differentiability at a point in a domain.
Composition by continuous linear equivs on the left respects higher differentiability at a point.
Composition by continuous linear equivs on the left respects higher differentiability on domains.
Composition by continuous linear equivs on the left respects higher differentiability.
If f
admits a Taylor series p
in a set s
, and g
is linear, then f ∘ g
admits a Taylor
series in g ⁻¹' s
, whose k
-th term is given by p k (g v₁, ..., g vₖ)
.
Composition by continuous linear maps on the right preserves C^n
functions at a point on
a domain.
Composition by continuous linear maps on the right preserves C^n
functions on domains.
Composition by continuous linear maps on the right preserves C^n
functions.
The iterated derivative within a set of the composition with a linear map on the right is obtained by composing the iterated derivative with the linear map.
The iterated derivative within a set of the composition with a linear equiv on the right is obtained by composing the iterated derivative with the linear equiv.
The iterated derivative of the composition with a linear map on the right is obtained by composing the iterated derivative with the linear map.
Composition with a linear isometry on the right preserves the norm of the iterated derivative within a set.
Composition with a linear isometry on the right preserves the norm of the iterated derivative within a set.
Composition by continuous linear equivs on the right respects higher differentiability at a point in a domain.
Composition by continuous linear equivs on the right respects higher differentiability at a point.
Composition by continuous linear equivs on the right respects higher differentiability on domains.
Composition by continuous linear equivs on the right respects higher differentiability.
If two functions f
and g
admit Taylor series p
and q
in a set s
, then the cartesian
product of f
and g
admits the cartesian product of p
and q
as a Taylor series.
The cartesian product of C^n
functions at a point in a domain is C^n
.
The cartesian product of C^n
functions on domains is C^n
.
The cartesian product of C^n
functions at a point is C^n
.
The cartesian product of C^n
functions is C^n
.
Composition of C^n
functions #
We show that the composition of C^n
functions is C^n
. One way to prove it would be to write
the n
-th derivative of the composition (this is Faà di Bruno's formula) and check its continuity,
but this is very painful. Instead, we go for a simple inductive proof. Assume it is done for n
.
Then, to check it for n+1
, one needs to check that the derivative of g ∘ f
is C^n
, i.e.,
that Dg(f x) ⬝ Df(x)
is C^n
. The term Dg (f x)
is the composition of two C^n
functions, so
it is C^n
by the inductive assumption. The term Df(x)
is also C^n
. Then, the matrix
multiplication is the application of a bilinear map (which is C^∞
, and therefore C^n
) to
x ↦ (Dg(f x), Df x)
. As the composition of two C^n
maps, it is again C^n
, and we are done.
There is a subtlety in this argument: we apply the inductive assumption to functions on other Banach
spaces. In maths, one would say: prove by induction over n
that, for all C^n
maps between all
pairs of Banach spaces, their composition is C^n
. In Lean, this is fine as long as the spaces
stay in the same universe. This is not the case in the above argument: if E
lives in universe u
and F
lives in universe v
, then linear maps from E
to F
(to which the derivative of f
belongs) is in universe max u v
. If one could quantify over finitely many universes, the above
proof would work fine, but this is not the case. One could still write the proof considering spaces
in any universe in u, v, w, max u v, max v w, max u v w
, but it would be extremely tedious and
lead to a lot of duplication. Instead, we formulate the above proof when all spaces live in the same
universe (where everything is fine), and then we deduce the general result by lifting all our spaces
to a common universe. We use the trick that any space H
is isomorphic through a continuous linear
equiv to continuous_multilinear_map (λ (i : fin 0), E × F × G) H
to change the universe level,
and then argue that composing with such a linear equiv does not change the fact of being C^n
,
which we have already proved previously.
The composition of C^n
functions on domains is C^n
.
The composition of C^n
functions on domains is C^n
.
The composition of a C^n
function on a domain with a C^n
function is C^n
.
The composition of C^n
functions is C^n
.
The composition of C^n
functions at points in domains is C^n
.
The composition of C^n
functions at points in domains is C^n
,
with a weaker condition on s
and t
.
The composition of C^n
functions at points in domains is C^n
.
The composition of C^n
functions at points is C^n
.
Smoothness of projections #
The first projection in a product is C^∞
.
Postcomposing f
with prod.fst
is C^n
Precomposing f
with prod.fst
is C^n
The first projection on a domain in a product is C^∞
.
The first projection at a point in a product is C^∞
.
Postcomposing f
with prod.fst
is C^n
at (x, y)
Precomposing f
with prod.fst
is C^n
at (x, y)
Precomposing f
with prod.fst
is C^n
at x : E × F
The first projection within a domain at a point in a product is C^∞
.
The second projection in a product is C^∞
.
Postcomposing f
with prod.snd
is C^n
Precomposing f
with prod.snd
is C^n
The second projection on a domain in a product is C^∞
.
The second projection at a point in a product is C^∞
.
Postcomposing f
with prod.snd
is C^n
at x
Precomposing f
with prod.snd
is C^n
at (x, y)
Precomposing f
with prod.snd
is C^n
at x : E × F
The second projection within a domain at a point in a product is C^∞
.
The natural equivalence (E × F) × G ≃ E × (F × G)
is smooth.
Warning: if you think you need this lemma, it is likely that you can simplify your proof by reformulating the lemma that you're applying next using the tips in Note [continuity lemma statement]
The natural equivalence E × (F × G) ≃ (E × F) × G
is smooth.
Warning: see remarks attached to cont_diff_prod_assoc
Bundled derivatives are smooth #
One direction of cont_diff_within_at_succ_iff_has_fderiv_within_at
, but where all derivatives
are taken within the same set. Version for partial derivatives / functions with parameters.
If f x
is a C^n+1
family of functions and g x
is a C^n
family of points, then the
derivative of f x
at g x
depends in a C^n
way on x
. We give a general version of this fact
relative to sets which may not have unique derivatives, in the following form.
If f : E × F → G
is C^n+1
at (x₀, g(x₀))
in (s ∪ {x₀}) × t ⊆ E × F
and g : E → F
is
C^n
at x₀
within some set s ⊆ E
, then there is a function f' : E → F →L[𝕜] G
that is C^n
at x₀
within s
such that for all x
sufficiently close to x₀
within
s ∪ {x₀}
the function y ↦ f x y
has derivative f' x
at g x
within t ⊆ F
.
For convenience, we return an explicit set of x
's where this holds that is a subset of
s ∪ {x₀}
.
We need one additional condition, namely that t
is a neighborhood of g(x₀)
within g '' s
.
The most general lemma stating that x ↦ fderiv_within 𝕜 (f x) t (g x)
is C^n
at a point within a set.
To show that x ↦ D_yf(x,y)g(x)
(taken within t
) is C^m
at x₀
within s
, we require that
f
isC^n
at(x₀, g(x₀))
within(s ∪ {x₀}) × t
forn ≥ m+1
.g
isC^m
atx₀
withins
;- Derivatives are unique at
g(x)
withint
forx
sufficiently close tox₀
withins ∪ {x₀}
; t
is a neighborhood ofg(x₀)
withing '' s
;
A special case of cont_diff_within_at.fderiv_within''
where we require that s ⊆ g⁻¹(t)
.
A special case of cont_diff_within_at.fderiv_within'
where we require that x₀ ∈ s
and there
are unique derivatives everywhere within t
.
x ↦ fderiv_within 𝕜 (f x) t (g x) (k x)
is smooth at a point within a set.
fderiv_within 𝕜 f s
is smooth at x₀
within s
.
x ↦ fderiv 𝕜 (f x) (g x)
is smooth at x₀
.
fderiv 𝕜 f
is smooth at x₀
.
x ↦ fderiv 𝕜 (f x) (g x)
is smooth.
fderiv 𝕜 f
is smooth.
x ↦ fderiv 𝕜 (f x) (g x)
is continuous.
x ↦ fderiv 𝕜 (f x) (g x) (k x)
is smooth.
The bundled derivative of a C^{n+1}
function is C^n
.
If a function is at least C^1
, its bundled derivative (mapping (x, v)
to Df(x) v
) is
continuous.
The bundled derivative of a C^{n+1}
function is C^n
.
Smoothness of functions f : E → Π i, F' i
#
Sum of two functions #
The sum of two C^n
functions within a set at a point is C^n
within this set
at this point.
The sum of two C^n
functions at a point is C^n
at this point.
The sum of two C^n
functions is C^n
.
The sum of two C^n
functions on a domain is C^n
.
The iterated derivative of the sum of two functions is the sum of the iterated derivatives.
See also iterated_fderiv_within_add_apply'
, which uses the spelling (λ x, f x + g x)
instead of f + g
.
The iterated derivative of the sum of two functions is the sum of the iterated derivatives.
This is the same as iterated_fderiv_within_add_apply
, but using the spelling (λ x, f x + g x)
instead of f + g
, which can be handy for some rewrites.
TODO: use one form consistently.
Negative #
The negative of a C^n
function within a domain at a point is C^n
within this domain at
this point.
The negative of a C^n
function at a point is C^n
at this point.
The negative of a C^n
function is C^n
.
The negative of a C^n
function on a domain is C^n
.
Subtraction #
The difference of two C^n
functions within a set at a point is C^n
within this set
at this point.
The difference of two C^n
functions at a point is C^n
at this point.
The difference of two C^n
functions on a domain is C^n
.
The difference of two C^n
functions is C^n
.
Sum of finitely many functions #
Product of two functions #
The product of two C^n
functions within a set at a point is C^n
within this set
at this point.
The product of two C^n
functions at a point is C^n
at this point.
The product of two C^n
functions on a domain is C^n
.
The product of two C^n
functions is C^n
.
Scalar multiplication #
The scalar multiplication of two C^n
functions within a set at a point is C^n
within this
set at this point.
The scalar multiplication of two C^n
functions at a point is C^n
at this point.
The scalar multiplication of two C^n
functions is C^n
.
The scalar multiplication of two C^n
functions on a domain is C^n
.
Constant scalar multiplication #
The scalar multiplication of a constant and a C^n
function within a set at a point is C^n
within this set at this point.
The scalar multiplication of a constant and a C^n
function at a point is C^n
at this
point.
The scalar multiplication of a constant and a C^n
function is C^n
.
The scalar multiplication of a constant and a C^n
on a domain is C^n
.
Cartesian product of two functions #
The product map of two C^n
functions within a set at a point is C^n
within the product set at the product point.
The product map of two C^n
functions on a set is C^n
on the product set.
The product map of two C^n
functions within a set at a point is C^n
within the product set at the product point.
The product map of two C^n
functions within a set at a point is C^n
within the product set at the product point.
The product map of two C^n
functions is C^n
.
Inversion in a complete normed algebra #
In a complete normed algebra, the operation of inversion is C^n
, for all n
, at each
invertible element. The proof is by induction, bootstrapping using an identity expressing the
derivative of inversion as a bilinear map of inversion itself.
Inversion of continuous linear maps between Banach spaces #
At a continuous linear equivalence e : E ≃L[𝕜] F
between Banach spaces, the operation of
inversion is C^n
, for all n
.
If f
is a local homeomorphism and the point a
is in its target,
and if f
is n
times continuously differentiable at f.symm a
,
and if the derivative at f.symm a
is a continuous linear equivalence,
then f.symm
is n
times continuously differentiable at the point a
.
This is one of the easy parts of the inverse function theorem: it assumes that we already have an inverse function.
If f
is an n
times continuously differentiable homeomorphism,
and if the derivative of f
at each point is a continuous linear equivalence,
then f.symm
is n
times continuously differentiable.
This is one of the easy parts of the inverse function theorem: it assumes that we already have an inverse function.
Let f
be a local homeomorphism of a nontrivially normed field, let a
be a point in its
target. if f
is n
times continuously differentiable at f.symm a
, and if the derivative at
f.symm a
is nonzero, then f.symm
is n
times continuously differentiable at the point a
.
This is one of the easy parts of the inverse function theorem: it assumes that we already have an inverse function.
Let f
be an n
times continuously differentiable homeomorphism of a nontrivially normed
field. Suppose that the derivative of f
is never equal to zero. Then f.symm
is n
times
continuously differentiable.
This is one of the easy parts of the inverse function theorem: it assumes that we already have an inverse function.
Finite dimensional results #
A family of continuous linear maps is C^n
on s
if all its applications are.
This is a useful lemma to prove that a certain operation preserves functions being C^n
.
When you do induction on n
, this gives a useful characterization of a function being C^(n+1)
,
assuming you have already computed the derivative. The advantage of this version over
cont_diff_succ_iff_fderiv
is that both occurences of cont_diff
are for functions with the same
domain and codomain (E
and F
). This is not the case for cont_diff_succ_iff_fderiv
, which
often requires an inconvenient need to generalize F
, which results in universe issues
(see the discussion in the section of cont_diff.comp
).
This lemma avoids these universe issues, but only applies for finite dimensional E
.
Results over ℝ
or ℂ
#
The results in this section rely on the Mean Value Theorem, and therefore hold only over ℝ
(and
its extension fields such as ℂ
).
If a function has a Taylor series at order at least 1, then at points in the interior of the
domain of definition, the term of order 1 of this series is a strict derivative of f
.
If a function is C^n
with 1 ≤ n
around a point, and its derivative at that point is given to
us as f'
, then f'
is also a strict derivative.
If a function is C^n
with 1 ≤ n
around a point, and its derivative at that point is given to
us as f'
, then f'
is also a strict derivative.
If a function is C^n
with 1 ≤ n
around a point, then the derivative of f
at this point
is also a strict derivative.
If a function is C^n
with 1 ≤ n
around a point, then the derivative of f
at this point
is also a strict derivative.
If a function is C^n
with 1 ≤ n
, then the derivative of f
is also a strict derivative.
If a function is C^n
with 1 ≤ n
, then the derivative of f
is also a strict derivative.
If f
has a formal Taylor series p
up to order 1
on {x} ∪ s
, where s
is a convex set,
and ‖p x 1‖₊ < K
, then f
is K
-Lipschitz in a neighborhood of x
within s
.
If f
has a formal Taylor series p
up to order 1
on {x} ∪ s
, where s
is a convex set,
then f
is Lipschitz in a neighborhood of x
within s
.
If f
is C^1
within a conves set s
at x
, then it is Lipschitz on a neighborhood of x
within s
.
If f
is C^1
at x
and K > ‖fderiv 𝕂 f x‖
, then f
is K
-Lipschitz in a neighborhood of
x
.
If f
is C^1
at x
, then f
is Lipschitz in a neighborhood of x
.
One dimension #
All results up to now have been expressed in terms of the general Fréchet derivative fderiv
. For
maps defined on the field, the one-dimensional derivative deriv
is often easier to use. In this
paragraph, we reformulate some higher smoothness results in terms of deriv
.
A function is C^(n + 1)
on a domain with unique derivatives if and only if it is
differentiable there, and its derivative (formulated with deriv_within
) is C^n
.
A function is C^(n + 1)
on an open domain if and only if it is
differentiable there, and its derivative (formulated with deriv
) is C^n
.
A function is C^∞
on a domain with unique derivatives if and only if it is differentiable
there, and its derivative (formulated with deriv_within
) is C^∞
.
A function is C^∞
on an open domain if and only if it is differentiable
there, and its derivative (formulated with deriv
) is C^∞
.
A function is C^(n + 1)
if and only if it is differentiable,
and its derivative (formulated in terms of deriv
) is C^n
.
A function is C^∞
if and only if it is differentiable,
and its derivative (formulated in terms of deriv
) is C^∞
.
Restricting from ℂ
to ℝ
, or generally from 𝕜'
to 𝕜
#
If a function is n
times continuously differentiable over ℂ
, then it is n
times continuously
differentiable over ℝ
. In this paragraph, we give variants of this statement, in the general
situation where ℂ
and ℝ
are replaced respectively by 𝕜'
and 𝕜
where 𝕜'
is a normed algebra
over 𝕜
.
Quantitative bounds #
Bounding the norm of the iterated derivative of B (f x) (g x)
within a set in terms of the
iterated derivatives of f
and g
when B
is bilinear. This lemma is an auxiliary version
assuming all spaces live in the same universe, to enable an induction. Use instead
continuous_linear_map.norm_iterated_fderiv_within_le_of_bilinear
that removes this assumption.
Bounding the norm of the iterated derivative of B (f x) (g x)
within a set in terms of the
iterated derivatives of f
and g
when B
is bilinear:
‖D^n (x ↦ B (f x) (g x))‖ ≤ ‖B‖ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖
Bounding the norm of the iterated derivative of B (f x) (g x)
in terms of the
iterated derivatives of f
and g
when B
is bilinear:
‖D^n (x ↦ B (f x) (g x))‖ ≤ ‖B‖ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖
Bounding the norm of the iterated derivative of B (f x) (g x)
within a set in terms of the
iterated derivatives of f
and g
when B
is bilinear of norm at most 1
:
‖D^n (x ↦ B (f x) (g x))‖ ≤ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖
Bounding the norm of the iterated derivative of B (f x) (g x)
in terms of the
iterated derivatives of f
and g
when B
is bilinear of norm at most 1
:
‖D^n (x ↦ B (f x) (g x))‖ ≤ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖
If the derivatives within a set of g
at f x
are bounded by C
, and the i
-th derivative
within a set of f
at x
is bounded by D^i
for all 1 ≤ i ≤ n
, then the n
-th derivative
of g ∘ f
is bounded by n! * C * D^n
.
This lemma proves this estimate assuming additionally that two of the spaces live in the same
universe, to make an induction possible. Use instead norm_iterated_fderiv_within_comp_le
that
removes this assumption.
If the derivatives within a set of g
at f x
are bounded by C
, and the i
-th derivative
within a set of f
at x
is bounded by D^i
for all 1 ≤ i ≤ n
, then the n
-th derivative
of g ∘ f
is bounded by n! * C * D^n
.
If the derivatives of g
at f x
are bounded by C
, and the i
-th derivative
of f
at x
is bounded by D^i
for all 1 ≤ i ≤ n
, then the n
-th derivative
of g ∘ f
is bounded by n! * C * D^n
.