One-dimensional derivatives #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the derivative of a function f : π β F
where π
is a
normed field and F
is a normed space over this field. The derivative of
such a function f
at a point x
is given by an element f' : F
.
The theory is developed analogously to the FrΓ©chet derivatives. We first introduce predicates defined in terms of the corresponding predicates for FrΓ©chet derivatives:
-
has_deriv_at_filter f f' x L
states that the functionf
has the derivativef'
at the pointx
asx
goes along the filterL
. -
has_deriv_within_at f f' s x
states that the functionf
has the derivativef'
at the pointx
within the subsets
. -
has_deriv_at f f' x
states that the functionf
has the derivativef'
at the pointx
. -
has_strict_deriv_at f f' x
states that the functionf
has the derivativef'
at the pointx
in the sense of strict differentiability, i.e.,f y - f z = (y - z) β’ f' + o (y - z)
asy, z β x
.
For the last two notions we also define a functional version:
-
deriv_within f s x
is a derivative off
atx
withins
. If the derivative does not exist, thenderiv_within f s x
equals zero. -
deriv f x
is a derivative off
atx
. If the derivative does not exist, thenderiv f x
equals zero.
The theorems fderiv_within_deriv_within
and fderiv_deriv
show that the
one-dimensional derivatives coincide with the general FrΓ©chet derivatives.
We also show the existence and compute the derivatives of:
- constants
- the identity function
- linear maps (in
linear.lean
) - addition (in
add.lean
) - sum of finitely many functions (in
add.lean
) - negation (in
add.lean
) - subtraction (in
add.lean
) - star (in
star.lean
) - multiplication of two functions in
π β π
(inmul.lean
) - multiplication of a function in
π β π
and of a function inπ β E
(inmul.lean
) - powers of a function (in
pow.lean
andzpow.lean
) - inverse
x β xβ»ΒΉ
(ininv.lean
) - division (in
inv.lean
) - composition of a function in
π β F
with a function inπ β π
(incomp.lean
) - composition of a function in
F β E
with a function inπ β F
(incomp.lean
) - inverse function (assuming that it exists; the inverse function theorem is in
inverse.lean
) - polynomials (in
polynomial.lean
)
For most binary operations we also define const_op
and op_const
theorems for the cases when
the first or second argument is a constant. This makes writing chains of has_deriv_at
's easier,
and they more frequently lead to the desired result.
We set up the simplifier so that it can compute the derivative of simple functions. For instance,
example (x : β) : deriv (Ξ» x, cos (sin x) * exp x) x = (cos(sin(x))-sin(sin(x))*cos(x))*exp(x) :=
by { simp, ring }
Implementation notes #
Most of the theorems are direct restatements of the corresponding theorems for FrΓ©chet derivatives.
The strategy to construct simp lemmas that give the simplifier the possibility to compute
derivatives is the same as the one for differentiability statements, as explained in fderiv.lean
.
See the explanations there.
f
has the derivative f'
at the point x
as x
goes along the filter L
.
That is, f x' = f x + (x' - x) β’ f' + o(x' - x)
where x'
converges along the filter L
.
Equations
- has_deriv_at_filter f f' x L = has_fderiv_at_filter f (1.smul_right f') x L
f
has the derivative f'
at the point x
within the subset s
.
That is, f x' = f x + (x' - x) β’ f' + o(x' - x)
where x'
converges to x
inside s
.
Equations
- has_deriv_within_at f f' s x = has_deriv_at_filter f f' x (nhds_within x s)
f
has the derivative f'
at the point x
.
That is, f x' = f x + (x' - x) β’ f' + o(x' - x)
where x'
converges to x
.
Equations
- has_deriv_at f f' x = has_deriv_at_filter f f' x (nhds x)
f
has the derivative f'
at the point x
in the sense of strict differentiability.
That is, f y - f z = (y - z) β’ f' + o(y - z)
as y, z β x
.
Equations
- has_strict_deriv_at f f' x = has_strict_fderiv_at f (1.smul_right f') x
Derivative of f
at the point x
within the set s
, if it exists. Zero otherwise.
If the derivative exists (i.e., β f', has_deriv_within_at f f' s x
), then
f x' = f x + (x' - x) β’ deriv_within f s x + o(x' - x)
where x'
converges to x
inside s
.
Equations
- deriv_within f s x = β(fderiv_within π f s x) 1
Derivative of f
at the point x
, if it exists. Zero otherwise.
If the derivative exists (i.e., β f', has_deriv_at f f' x
), then
f x' = f x + (x' - x) β’ deriv f x + o(x' - x)
where x'
converges to x
.
Expressing has_fderiv_at_filter f f' x L
in terms of has_deriv_at_filter
Expressing has_fderiv_within_at f f' s x
in terms of has_deriv_within_at
Expressing has_deriv_within_at f f' s x
in terms of has_fderiv_within_at
Expressing has_fderiv_at f f' x
in terms of has_deriv_at
Alias of the forward direction of has_strict_deriv_at_iff_has_strict_fderiv_at
.
Expressing has_deriv_at f f' x
in terms of has_fderiv_at
Alias of the forward direction of has_deriv_at_iff_has_fderiv_at
.
Alias of the forward direction of has_deriv_within_at_congr_set
.
Alias of the reverse direction of has_deriv_within_at_Ioi_iff_Ici
.
Alias of the forward direction of has_deriv_within_at_Ioi_iff_Ici
.
Alias of the forward direction of has_deriv_within_at_Iio_iff_Iic
.
Alias of the reverse direction of has_deriv_within_at_Iio_iff_Iic
.
Alias of the reverse direction of has_deriv_within_at.Ioi_iff_Ioo
.
Alias of the forward direction of has_deriv_within_at.Ioi_iff_Ioo
.