/-
Copyright (c) 2019 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Sébastien Gouëzel, Yury Kudryashov
-/
module
public import Mathlib.Analysis.Calculus.FDeriv.Defs
public import Mathlib.Analysis.Calculus.TangentCone.Defs
public import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps
import Mathlib.Analysis.Calculus.FDeriv.Basic
/-!
# The derivative of bounded linear maps
For detailed documentation of the Fréchet derivative,
see the module docstring of `Mathlib/Analysis/Calculus/FDeriv/Basic.lean`.
This file contains the usual formulas (and existence assertions)
for the derivative of continuous linear maps, both bundled and unbundled.
We also prove versions of the chain rule when one of the maps is a continuous linear map.
-/
public section
open Asymptotics
namespace ContinuousLinearMap
variable { : Type*} [NontriviallyNormedField ]
variable {E : Type*} [AddCommGroup E] [Module E] [TopologicalSpace E]
variable {F : Type*} [AddCommGroup F] [Module F] [TopologicalSpace F]
/-!
### Bundled continuous linear maps
There are currently two variants of these in mathlib, the bundled version
(named `ContinuousLinearMap`, and denoted `E →L[] F`, works for topological vector spaces),
and the unbundled version (with a predicate `IsBoundedLinearMap`, requires normed spaces).
This section deals with the first form, see below for the unbundled version
-/
section Basic
variable (f : E →L[] F) {x : E} {s : Set E} {L : Filter (E × E)}
protected theorem hasFDerivAtFilter : HasFDerivAtFilter f f L :=
.of_isLittleOTVS <| (IsLittleOTVS.zero _ _).congr_left fun x => by
simp only [f.map_sub, sub_self, Pi.zero_apply]
@[fun_prop]
protected theorem hasStrictFDerivAt : HasStrictFDerivAt f f x :=
f.hasFDerivAtFilter
@[fun_prop]
protected theorem hasFDerivWithinAt : HasFDerivWithinAt f f s x :=
f.hasFDerivAtFilter
@[fun_prop]
protected theorem hasFDerivAt : HasFDerivAt f f x :=
f.hasFDerivAtFilter
@[simp, fun_prop]
protected theorem differentiableAt : DifferentiableAt f x :=
f.hasFDerivAt.differentiableAt
@[fun_prop]
protected theorem differentiableWithinAt : DifferentiableWithinAt f s x :=
f.differentiableAt.differentiableWithinAt
@[simp, fun_prop]
protected theorem differentiable : Differentiable f := fun _ =>
f.differentiableAt
@[fun_prop]
protected theorem differentiableOn : DifferentiableOn f s :=
f.differentiable.differentiableOn
variable [ContinuousAdd E] [ContinuousSMul E] [ContinuousAdd F] [ContinuousSMul F] [T2Space F]
@[simp]
protected theorem fderiv : fderiv f x = f :=
f.hasFDerivAt.fderiv
protected theorem fderivWithin (hxs : UniqueDiffWithinAt s x) :
fderivWithin f s x = f := by
rw [DifferentiableAt.fderivWithin f.differentiableAt hxs]
exact f.fderiv
end Basic
end ContinuousLinearMap
/-!
### Chain rule for a composition with a continuous linear map
The chain rule says that given two differentiable functions `g` and `f`,
the function `g ∘ f` is differentiable too, with derivative `g' ∘L f'`.
The theorems below deal with the special cases
when one of the two functions is a continuous linear map.
These are explicitly not tagged `@[fun_prop]` because
`fun_prop` can already prove them with more general lemmas,
and this would only slow it down in failing situations.
-/
section CompLeft
variable { : Type*} [NontriviallyNormedField ]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace G]
variable (g : F →L[] G) {f : E → F} {f' : E →L[] F} {s : Set E} {x : E} {L : Filter (E × E)}
namespace ContinuousLinearMap
theorem comp_hasFDerivAtFilter (hf : HasFDerivAtFilter f f' L) :
HasFDerivAtFilter (g ∘ f) (g ∘L f') L :=
.of_isLittleOTVS <| by
simpa [Function.comp_def] using g.isBigOTVS_comp.trans_isLittleOTVS hf.isLittleOTVS
theorem comp_hasStrictFDerivAt (hf : HasStrictFDerivAt f f' x) :
HasStrictFDerivAt (g ∘ f) (g ∘L f') x :=
g.comp_hasFDerivAtFilter hf
theorem comp_hasFDerivAt (hf : HasFDerivAt f f' x) : HasFDerivAt (g ∘ f) (g ∘L f') x :=
g.comp_hasFDerivAtFilter hf
theorem comp_hasFDerivWithinAt (hf : HasFDerivWithinAt f f' s x) :
HasFDerivWithinAt (g ∘ f) (g ∘L f') s x :=
g.comp_hasFDerivAtFilter hf
theorem comp_differentiableWithinAt (hf : DifferentiableWithinAt f s x) :
DifferentiableWithinAt (g ∘ f) s x :=
g.comp_hasFDerivWithinAt hf.hasFDerivWithinAt |>.differentiableWithinAt
theorem comp_differentiableOn (hf : DifferentiableOn f s) : DifferentiableOn (g ∘ f) s :=
fun x hx ↦ g.comp_differentiableWithinAt (hf x hx)
theorem comp_differentiableAt (hf : DifferentiableAt f x) : DifferentiableAt (g ∘ f) x :=
g.comp_hasFDerivAt hf.hasFDerivAt |>.differentiableAt
theorem comp_differentiable (hf : Differentiable f) : Differentiable (g ∘ f) :=
fun x ↦ g.comp_differentiableAt (hf x)
theorem fderiv_comp_left (hf : DifferentiableAt f x) : fderiv (g ∘ f) x = g ∘L fderiv f x :=
g.comp_hasFDerivAt hf.hasFDerivAt |>.fderiv
theorem fderivWithin_comp_left (hf : DifferentiableWithinAt f s x)
(hs : UniqueDiffWithinAt s x) :
fderivWithin (g ∘ f) s x = g ∘L fderivWithin f s x :=
g.comp_hasFDerivWithinAt hf.hasFDerivWithinAt |>.fderivWithin hs
end ContinuousLinearMap
end CompLeft
section CompRight
variable { : Type*} [NontriviallyNormedField ]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace F]
variable {G : Type*} [NormedAddCommGroup G] [NormedSpace G]
variable {g : F → G} {g' : F →L[] G} {x : E} {y : F} {s : Set E} {t : Set F}
variable (f : E →L[] F)
theorem HasFDerivAtFilter.comp_continuousLinearMap {L : Filter (F × F)} {L' : Filter (E × E)}
(h : HasFDerivAtFilter g g' L) (hf : Filter.Tendsto (Prod.map f f) L' L) :
HasFDerivAtFilter (g ∘ f) (g' ∘L f) L' :=
.of_isLittleOTVS <| calc
(fun x ↦ g (f x.1) - g (f x.2) - g' (f (x.1 - x.2))) =o[; L'] (fun x ↦ f x.1 - f x.2) := by
simpa [Function.comp_def] using h.isLittleOTVS.comp_tendsto hf
_ =O[; L'] fun x ↦ x.1 - x.2 := by
simpa [Function.comp_def] using f.isBigOTVS_comp (f := fun x : E × E ↦ x.1 - x.2)
theorem HasStrictFDerivAt.comp_continuousLinearMap_of_eq (h : HasStrictFDerivAt g g' y)
(hxy : f x = y) : HasStrictFDerivAt (g ∘ f) (g' ∘L f) x :=
HasFDerivAtFilter.comp_continuousLinearMap f h <|
(f.continuous.tendsto' x y hxy).prodMap_nhds (f.continuous.tendsto' x y hxy)
theorem HasStrictFDerivAt.comp_continuousLinearMap (x : E) (h : HasStrictFDerivAt g g' (f x)) :
HasStrictFDerivAt (g ∘ f) (g' ∘L f) x :=
h.comp_continuousLinearMap_of_eq f rfl
theorem HasFDerivAt.comp_continuousLinearMap_of_eq (h : HasFDerivAt g g' y) (hxy : f x = y) :
HasFDerivAt (g ∘ f) (g' ∘L f) x :=
HasFDerivAtFilter.comp_continuousLinearMap f h <|
(f.continuous.tendsto' x y hxy).prodMap <| by simpa
theorem HasFDerivAt.comp_continuousLinearMap (x : E) (h : HasFDerivAt g g' (f x)) :
HasFDerivAt (g ∘ f) (g' ∘L f) x :=
h.comp_continuousLinearMap_of_eq f rfl
theorem HasFDerivWithinAt.comp_continuousLinearMap_of_eq (h : HasFDerivWithinAt g g' t y)
(hxy : f x = y) (hst : Set.MapsTo f s t) :
HasFDerivWithinAt (g ∘ f) (g' ∘L f) s x := by
subst y
refine HasFDerivAtFilter.comp_continuousLinearMap f h ?_
refine f.continuous.continuousWithinAt.tendsto_nhdsWithin hst |>.prodMap ?_
simp
theorem HasFDerivWithinAt.comp_continuousLinearMap (x : E) (h : HasFDerivWithinAt g g' t (f x))
(hst : Set.MapsTo f s t) : HasFDerivWithinAt (g ∘ f) (g' ∘L f) s x :=
h.comp_continuousLinearMap_of_eq f rfl hst
theorem DifferentiableWithinAt.comp_continuousLinearMap (x : E)
(h : DifferentiableWithinAt g t (f x)) (hst : Set.MapsTo f s t) :
DifferentiableWithinAt (g ∘ f) s x :=
(h.hasFDerivWithinAt.comp_continuousLinearMap f x hst).differentiableWithinAt
theorem DifferentiableAt.comp_continuousLinearMap (x : E) (h : DifferentiableAt g (f x)) :
DifferentiableAt (g ∘ f) x :=
(h.hasFDerivAt.comp_continuousLinearMap f x).differentiableAt
theorem DifferentiableOn.comp_continuousLinearMap (h : DifferentiableOn g t)
(hst : Set.MapsTo f s t) : DifferentiableOn (g ∘ f) s :=
fun x hx ↦ (h _ (hst hx)).comp_continuousLinearMap f x hst
theorem Differentiable.comp_continuousLinearMap (h : Differentiable g) :
Differentiable (g ∘ f) :=
fun x ↦ (h _).comp_continuousLinearMap f x
end CompRight
/-! ### Unbundled continuous linear maps -/
namespace IsBoundedLinearMap
variable { : Type*} [NontriviallyNormedField ]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace E]
variable {F : Type*} [NormedAddCommGroup F] [NormedSpace F]
variable {f : E → F}
variable {x : E}
variable {s : Set E}
variable {L : Filter (E × E)}
theorem hasFDerivAtFilter (h : IsBoundedLinearMap f) :
HasFDerivAtFilter f h.toContinuousLinearMap L :=
h.toContinuousLinearMap.hasFDerivAtFilter
@[fun_prop]
theorem hasFDerivWithinAt (h : IsBoundedLinearMap f) :
HasFDerivWithinAt f h.toContinuousLinearMap s x :=
h.hasFDerivAtFilter
@[fun_prop]
theorem hasFDerivAt (h : IsBoundedLinearMap f) :
HasFDerivAt f h.toContinuousLinearMap x :=
h.hasFDerivAtFilter
@[fun_prop]
theorem differentiableAt (h : IsBoundedLinearMap f) : DifferentiableAt f x :=
h.hasFDerivAt.differentiableAt
@[fun_prop]
theorem differentiableWithinAt (h : IsBoundedLinearMap f) :
DifferentiableWithinAt f s x :=
h.differentiableAt.differentiableWithinAt
protected theorem fderiv (h : IsBoundedLinearMap f) :
fderiv f x = h.toContinuousLinearMap :=
HasFDerivAt.fderiv h.hasFDerivAt
protected theorem fderivWithin (h : IsBoundedLinearMap f)
(hxs : UniqueDiffWithinAt s x) : fderivWithin f s x = h.toContinuousLinearMap := by
rw [DifferentiableAt.fderivWithin h.differentiableAt hxs]
exact h.fderiv
@[fun_prop]
theorem differentiable (h : IsBoundedLinearMap f) : Differentiable f :=
fun _ => h.differentiableAt
@[fun_prop]
theorem differentiableOn (h : IsBoundedLinearMap f) : DifferentiableOn f s :=
h.differentiable.differentiableOn
end IsBoundedLinearMap
¤ Dauer der Verarbeitung: 0.12 Sekunden
¤
*© Formatika GbR, Deutschland