Higher differentiability #
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 iteratedFDeriv π 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 iteratedFDerivWithin
relative to a domain,
as well as predicates ContDiffWithinAt
, ContDiffAt
, ContDiffOn
and
ContDiff
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, ContDiffOn
is not defined directly in terms of the
regularity of the specific choice iteratedFDerivWithin π n f s
inside s
, but in terms of the
existence of a nice sequence of derivatives, expressed with a predicate
HasFTaylorSeriesUpToOn
.
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 π
.
HasFTaylorSeriesUpTo n f p
: expresses that the formal multilinear seriesp
is a sequence of iterated derivatives off
, up to then
-th term (wheren
is a natural number orβ
).HasFTaylorSeriesUpToOn n f p s
: same thing, but inside a sets
. The notion of derivative is now taken insides
. In particular, derivatives don't have to be unique.ContDiff π n f
: expresses thatf
isC^n
, i.e., it admits a Taylor series up to rankn
.ContDiffOn π n f s
: expresses thatf
isC^n
ins
.ContDiffAt π n f x
: expresses thatf
isC^n
aroundx
.ContDiffWithinAt π n f s x
: expresses thatf
isC^n
aroundx
within the sets
.iteratedFDerivWithin π n f s x
is ann
-th derivative off
over the fieldπ
on the sets
at the pointx
. It is a continuous multilinear map fromE^n
toF
, defined as a derivative withins
ofiteratedFDerivWithin π (n-1) f s
if one exists, and0
otherwise.iteratedFDeriv π n f x
is then
-th derivative off
over the fieldπ
at the pointx
. It is a continuous multilinear map fromE^n
toF
, defined as a derivative ofiteratedFDeriv π (n-1) f
if one exists, and0
otherwise.
In sets of unique differentiability, ContDiffOn π n f s
can be expressed in terms of the
properties of iteratedFDerivWithin π m f s
for m β€ n
. In the whole space,
ContDiff π n f
can be expressed in terms of the properties of iteratedFDeriv π 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 iteratedFDerivWithin
) 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 ContDiffWithinAt
and ContDiffOn
.
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 ContDiffWithinAt π 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
iteratedFDeriv π (n + 1) f x = iteratedFDeriv π 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 #
HasFTaylorSeriesUpToOn 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
HasFDerivWithinAt
but for higher order derivatives.
Notice that p
does not sum up to f
on the diagonal (FormalMultilinearSeries.sum
), even if
f
is analytic and n = β
: an additional 1/m!
factor on the m
th term is necessary for that.
- zero_eq : β x β s, ContinuousMultilinearMap.uncurry0 (p x 0) = f x
- fderivWithin : β (m : β), βm < n β β x β s, HasFDerivWithinAt (fun (x : E) => p x m) (ContinuousMultilinearMap.curryLeft (p x (Nat.succ m))) s x
- cont : β (m : β), βm β€ n β ContinuousOn (fun (x : E) => p x m) s
Instances For
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.
In the case that n = β
we don't need the continuity assumption in
HasFTaylorSeriesUpToOn
.
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
.
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
.
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
.
If a function has a Taylor series at order at least 1
on a neighborhood of x
, then
it is differentiable at x
.
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
.
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 #
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
- ContDiffWithinAt π n f s x = β (m : β), βm β€ n β β u β nhdsWithin x (insert x s), β (p : E β FormalMultilinearSeries π E F), HasFTaylorSeriesUpToOn (βm) f p u
Instances For
Alias of the reverse direction of contDiffWithinAt_insert
.
Alias of the forward direction of contDiffWithinAt_insert
.
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.
A function is C^(n + 1)
on a domain iff locally, it has a derivative which is C^n
.
A version of contDiffWithinAt_succ_iff_hasFDerivWithinAt
where all derivatives
are taken within the same set.
Smooth functions within a set #
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
- ContDiffOn π n f s = β x β s, ContDiffWithinAt π n f s x
Instances For
If a function is C^n
on a set with n β₯ 1
, then it is differentiable there.
If a function is C^n
around each point in a set, then it is C^n
on the set.
A function is C^(n + 1)
on a domain iff locally, it has a derivative which is C^n
.
Iterated derivative within a set #
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
- One or more equations did not get rendered due to their size.
Instances For
Formal Taylor series associated to a function within a set.
Equations
- ftaylorSeriesWithin π f s x n = iteratedFDerivWithin π n f s x
Instances For
Writing explicitly the n+1
-th derivative as the composition of a currying linear equiv,
and the derivative of the n
-th derivative.
Writing explicitly the n+1
-th derivative as the composition of a currying linear equiv,
and the n
-th derivative of the derivative.
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.
If two functions coincide on a set s
, then their iterated differentials within this set
coincide. See also Filter.EventuallyEq.iteratedFDerivWithin_eq
and
Filter.EventuallyEq.iteratedFDerivWithin
.
If two functions coincide on a set s
, then their iterated differentials within this set
coincide. See also Filter.EventuallyEq.iteratedFDerivWithin_eq
and
Filter.EventuallyEq.iteratedFDerivWithin
.
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
.
The iterated differential within a set s
at a point x
is not modified if one intersects
s
with a neighborhood of 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
.
On a set with unique differentiability, any choice of iterated differential has to coincide
with the one we have chosen in iteratedFDerivWithin π m f s
.
When a function is C^n
in a set s
of unique differentiability, it admits
ftaylorSeriesWithin π f s
as a Taylor series up to order n
in 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 fderivWithin
) is C^n
.
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
.
A function is C^β
on a domain with unique derivatives if and only if it is differentiable
there, and its derivative (expressed with fderivWithin
) is C^β
.
A function is C^β
on an open domain if and only if it is differentiable there, and its
derivative (expressed with fderiv
) is C^β
.
Functions with a Taylor series on the whole space #
HasFTaylorSeriesUpTo 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
HasFDerivAt
but for higher order derivatives.
Notice that p
does not sum up to f
on the diagonal (FormalMultilinearSeries.sum
), even if
f
is analytic and n = β
: an addition 1/m!
factor on the m
th term is necessary for that.
- zero_eq : β (x : E), ContinuousMultilinearMap.uncurry0 (p x 0) = f x
- fderiv : β (m : β), βm < n β β (x : E), HasFDerivAt (fun (y : E) => p y m) (ContinuousMultilinearMap.curryLeft (p x (Nat.succ m))) x
- cont : β (m : β), βm β€ n β Continuous fun (x : E) => p x m
Instances For
In the case that n = β
we don't need the continuity assumption in
HasFTaylorSeriesUpTo
.
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
.
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 #
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
- ContDiffAt π n f x = ContDiffWithinAt π n f Set.univ x
Instances For
If a function is C^n
with n β₯ 1
at a point, then it is differentiable there.
A function is C^(n + 1)
at a point iff locally, it has a derivative which is C^n
.
Smooth functions #
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
- ContDiff π n f = β (p : E β FormalMultilinearSeries π E F), HasFTaylorSeriesUpTo n f p
Instances For
If f
has a Taylor series up to n
, then it is C^n
.
If a function is C^n
with n β₯ 1
, then it is differentiable.
A function is C^(n+1)
iff it has a C^n
derivative.
Iterated derivative #
The n
-th derivative of a function, as a multilinear map, defined inductively.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Formal Taylor series associated to a function.
Equations
- ftaylorSeries π f x n = iteratedFDeriv π n f x
Instances For
Writing explicitly the n+1
-th derivative as the composition of a currying linear equiv,
and the derivative of the n
-th derivative.
Writing explicitly the derivative of the n
-th derivative as the composition of a currying
linear equiv, and the n + 1
-th derivative.
In an open set, the iterated derivative within this set coincides with the global iterated derivative.
Writing explicitly the n+1
-th derivative as the composition of a currying linear equiv,
and the n
-th derivative of the derivative.
When a function is C^n
in a set s
of unique differentiability, it admits
ftaylorSeriesWithin π f s
as a Taylor series up to order n
in s
.
If f
is C^n
then its m
-times iterated derivative is continuous for m β€ n
.
If f
is C^n
then its m
-times iterated derivative is differentiable for m < n
.
A function is C^(n + 1)
if and only if it is differentiable,
and its derivative (formulated in terms of fderiv
) is C^n
.
A function is C^β
if and only if it is differentiable,
and its derivative (formulated in terms of fderiv
) is C^β
.
If a function is at least C^1
, its bundled derivative (mapping (x, v)
to Df(x) v
) is
continuous.