/-
Copyright (c) 2021 Anatole Dedecker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anatole Dedecker, Eric Wieser
-/
module
public import Mathlib.Analysis.Calculus.FDeriv.Analytic
public import Mathlib.Analysis.Complex.Exponential
public import Mathlib.Analysis.Normed.Algebra.Exponential
public import Mathlib.Topology.MetricSpace.CauSeqFilter
/-!
# Calculus results on exponential in a Banach algebra
In this file, we prove basic properties about the derivative of the exponential map `exp`
in a Banach algebra `` over a field ``. We keep them separate from the main file
`Analysis.Normed.Algebra.Exponential` in order to minimize dependencies.
## Main results
We prove most results for an arbitrary field ``, and then specialize to ` = ℝ` or ` = ℂ`.
### General case
- `hasStrictFDerivAt_exp_zero_of_radius_pos` : `NormedSpace.exp` has strict Fréchet derivative
`1 : →L[] ` at zero, as long as it converges on a neighborhood of zero
(see also `hasStrictDerivAt_exp_zero_of_radius_pos` for the case ` = `)
- `hasStrictFDerivAt_exp_of_lt_radius` : if `` has characteristic zero and `` is commutative,
then given a point `x` in the disk of convergence, `NormedSpace.exp` has strict Fréchet
derivative `NormedSpace.exp x • 1 : →L[] ` at x
(see also `hasStrictDerivAt_exp_of_lt_radius` for the case ` = `)
- `hasStrictFDerivAt_exp_smul_const_of_mem_ball`: even when `` is non-commutative,
if we have an intermediate algebra `` which is commutative, the function
`(u : ) ↦ NormedSpace.exp (u • x)`, still has strict Fréchet derivative
`NormedSpace.exp (t • x) • (1 : →L[] ).smulRight x` at `t` if
`t • x` is in the radius of convergence.
### ` = ℝ` or ` = ℂ`
- `hasStrictFDerivAt_exp_zero` : `NormedSpace.exp` has strict Fréchet derivative `1 : →L[] `
at zero (see also `hasStrictDerivAt_exp_zero` for the case ` = `)
- `hasStrictFDerivAt_exp` : if `` is commutative, then given any point `x`, `NormedSpace.exp`
has strict Fréchet derivative `NormedSpace.exp x • 1 : →L[] ` at x
(see also `hasStrictDerivAt_exp` for the case ` = `)
- `hasStrictFDerivAt_exp_smul_const`: even when `` is non-commutative, if we have
an intermediate algebra `` which is commutative, the function
`(u : ) ↦ NormedSpace.exp (u • x)` still has strict Fréchet derivative
`NormedSpace.exp (t • x) • (1 : →L[] ).smulRight x` at `t`.
### Compatibility with `Real.exp` and `Complex.exp`
- `Complex.exp_eq_exp_ℂ` : `Complex.exp = NormedSpace.exp ℂ ℂ`
- `Real.exp_eq_exp_ℝ` : `Real.exp = NormedSpace.exp ℝ ℝ`
-/
public section
open Filter RCLike ContinuousMultilinearMap NormedField NormedSpace Asymptotics
open scoped Nat Topology ENNReal
section AnyFieldAnyAlgebra
variable { : Type*} [NontriviallyNormedField ] [NormedRing ] [CharZero ] [NormedAlgebra ]
[CompleteSpace ]
/-- The exponential in a Banach algebra `` over a normed field `` has strict Fréchet derivative
`1 : →L[] ` at zero, as long as it converges on a neighborhood of zero. -/
theorem hasStrictFDerivAt_exp_zero_of_radius_pos (h :
0 < (expSeries ).radius) :
HasStrictFDerivAt exp (
1 : →L[] )
0 :=
by
convert! (hasFPowerSeriesAt_exp_zero_of_radius_pos h).hasStrictFDerivAt
ext x
change x = expSeries
1 fun _ => x
simp [expSeries_apply_eq, Nat.factorial]
/-- The exponential in a Banach algebra `` over a normed field `` has Fréchet derivative
`1 : →L[] ` at zero, as long as it converges on a neighborhood of zero. -/
theorem hasFDerivAt_exp_zero_of_radius_pos (h :
0 < (expSeries ).radius) :
HasFDerivAt exp (
1 : →L[] )
0 :=
(hasStrictFDerivAt_exp_zero_of_radius_pos h).hasFDerivAt
end AnyFieldAnyAlgebra
section AnyFieldCommAlgebra
variable { : Type*} [NontriviallyNormedField ] [NormedCommRing ] [NormedAlgebra ]
[CompleteSpace ] [CharZero ]
/-- The exponential map in a commutative Banach algebra `` over a normed field `` of
characteristic zero has Fréchet derivative `NormedSpace.exp x • 1 : →L[] `
at any point `x` in the disk of convergence. -/
theorem hasFDerivAt_exp_of_mem_ball {x : }
(hx : x ∈ Metric.eball (
0 : ) (expSeries ).radius) :
HasFDerivAt exp (exp x • (
1 : →L[] )) x :=
by
rw [hasFDerivAt_iff_isLittleO_nhds_zero]
suffices
(
fun h => exp x * (exp (
0 + h) - exp
0 - ContinuousLinearMap.id h)) =ᶠ[
0]
fun h =>
exp (x + h) - exp x - exp x • ContinuousLinearMap.id h
by
refine (IsLittleO.const_mul_left ?_ _).congr' this (EventuallyEq.refl _ _)
rw [← hasFDerivAt_iff_isLittleO_nhds_zero]
exact hasFDerivAt_exp_zero_of_radius_pos hx.pos
have : ∀ᶠ h in (
0 : ), h ∈ Metric.eball (
0 : ) (expSeries ).radius :=
Metric.eball_mem_nhds _ hx.pos
filter_upwards [this] with _ hh
rw [exp_add_of_mem_ball hx hh, exp_zero, zero_add, ContinuousLinearMap.id_apply, smul_e
q_mul]
ring
/-- The exponential map in a commutative Banach algebra `` over a normed field `` of
characteristic zero has strict Fréchet derivative `NormedSpace.exp x • 1 : →L[] `
at any point `x` in the disk of convergence. -/
theorem hasStrictFDerivAt_exp_of_mem_ball {x : }
(hx : x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictFDerivAt exp (exp x • (1 : →L[] )) x :=
let ⟨_, hp⟩ := analyticAt_exp_of_mem_ball x hx
hp.hasFDerivAt.unique (hasFDerivAt_exp_of_mem_ball hx) ▸ hp.hasStrictFDerivAt
end AnyFieldCommAlgebra
section deriv
variable { : Type*} [NontriviallyNormedField ] [CompleteSpace ] [CharZero ]
/-- The exponential map in a complete normed field `` of characteristic zero has strict derivative
`NormedSpace.exp x` at any point `x` in the disk of convergence. -/
theorem hasStrictDerivAt_exp_of_mem_ball {x : }
(hx : x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictDerivAt exp (exp x) x := by
simpa using (hasStrictFDerivAt_exp_of_mem_ball hx).hasStrictDerivAt
/-- The exponential map in a complete normed field `` of characteristic zero has derivative
`NormedSpace.exp x` at any point `x` in the disk of convergence. -/
theorem hasDerivAt_exp_of_mem_ball {x : }
(hx : x ∈ Metric.eball (0 : ) (expSeries ).radius) : HasDerivAt exp (exp x) x :=
(hasStrictDerivAt_exp_of_mem_ball hx).hasDerivAt
/-- The exponential map in a complete normed field `` of characteristic zero has strict derivative
`1` at zero, as long as it converges on a neighborhood of zero. -/
theorem hasStrictDerivAt_exp_zero_of_radius_pos (h : 0 < (expSeries ).radius) :
HasStrictDerivAt exp (1 : ) 0 :=
(hasStrictFDerivAt_exp_zero_of_radius_pos h).hasStrictDerivAt
/-- The exponential map in a complete normed field `` of characteristic zero has derivative
`1` at zero, as long as it converges on a neighborhood of zero. -/
theorem hasDerivAt_exp_zero_of_radius_pos (h : 0 < (expSeries ).radius) :
HasDerivAt exp (1 : ) 0 :=
(hasStrictDerivAt_exp_zero_of_radius_pos h).hasDerivAt
end deriv
section RCLikeAnyAlgebra
variable { : Type*} [RCLike ] [NormedRing ] [NormedAlgebra ] [CompleteSpace ]
/-- The exponential in a Banach algebra `` over ` = ℝ` or ` = ℂ` has strict Fréchet derivative
`1 : →L[] ` at zero. -/
theorem hasStrictFDerivAt_exp_zero : HasStrictFDerivAt exp (1 : →L[] ) 0 :=
hasStrictFDerivAt_exp_zero_of_radius_pos (expSeries_radius_pos )
/-- The exponential in a Banach algebra `` over ` = ℝ` or ` = ℂ` has Fréchet derivative
`1 : →L[] ` at zero. -/
theorem hasFDerivAt_exp_zero : HasFDerivAt exp (1 : →L[] ) 0 :=
hasStrictFDerivAt_exp_zero.hasFDerivAt
end RCLikeAnyAlgebra
section RCLikeCommAlgebra
variable { : Type*} [RCLike ] [NormedCommRing ] [NormedAlgebra ] [CompleteSpace ]
/-- The exponential map in a commutative Banach algebra `` over ` = ℝ` or ` = ℂ` has strict
Fréchet derivative `NormedSpace.exp x • 1 : →L[] ` at any point `x`. -/
theorem hasStrictFDerivAt_exp {x : } : HasStrictFDerivAt exp (exp x • (1 : →L[] )) x :=
hasStrictFDerivAt_exp_of_mem_ball ((expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _)
/-- The exponential map in a commutative Banach algebra `` over ` = ℝ` or ` = ℂ` has
Fréchet derivative `NormedSpace.exp x • 1 : →L[] ` at any point `x`. -/
theorem hasFDerivAt_exp {x : } : HasFDerivAt exp (exp x • (1 : →L[] )) x :=
hasStrictFDerivAt_exp.hasFDerivAt
end RCLikeCommAlgebra
section DerivRCLike
variable { : Type*} [RCLike ]
/-- The exponential map in ` = ℝ` or ` = ℂ` has strict derivative `NormedSpace.exp x`
at any point `x`. -/
theorem hasStrictDerivAt_exp {x : } : HasStrictDerivAt exp (exp x) x :=
hasStrictDerivAt_exp_of_mem_ball ((expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _)
/-- The exponential map in ` = ℝ` or ` = ℂ` has derivative `NormedSpace.exp x`
at any point `x`. -/
theorem hasDerivAt_exp {x : } : HasDerivAt exp (exp x) x :=
hasStrictDerivAt_exp.hasDerivAt
/-- The exponential map in ` = ℝ` or ` = ℂ` has strict derivative `1` at zero. -/
theorem hasStrictDerivAt_exp_zero : HasStrictDerivAt exp (1 : ) 0 :=
hasStrictDerivAt_exp_zero_of_radius_pos (expSeries_radius_pos )
/-- The exponential map in ` = ℝ` or ` = ℂ` has derivative `1` at zero. -/
theorem hasDerivAt_exp_zero : HasDerivAt exp (1 : ) 0 :=
hasStrictDerivAt_exp_zero.hasDerivAt
end DerivRCLike
theorem Complex.exp_eq_exp_ℂ : Complex.exp = NormedSpace.exp := by
refine funext fun x => ?_
rw [Complex.exp_def, exp_eq_tsum_div]
exact tendsto_nhds_unique x.exp'.tendsto_limit (expSeries_div_summable x).hasSum.tendsto_sum_nat
theorem Real.exp_eq_exp_ℝ : Real.exp = NormedSpace.exp := by
ext x; exact mod_cast congr_fun Complex.exp_eq_exp_ℂ x
/-! ### Derivative of $\exp (ux)$ by $u$
Note that since for `x : ` we have `NormedRing ` not `NormedCommRing `, we cannot deduce
these results from `hasFDerivAt_exp_of_mem_ball` applied to the algebra ``.
One possible solution for that would be to apply `hasFDerivAt_exp_of_mem_ball` to the
commutative algebra `Algebra.elementalAlgebra x`. Unfortunately we don't have all the required
API, so we leave that to a future refactor (see https://github.com/leanprover-community/mathlib3/pull/19062 for discussion).
We could also go the other way around and deduce `hasFDerivAt_exp_of_mem_ball` from
`hasFDerivAt_exp_smul_const_of_mem_ball` applied to ` := `, `x := (1 : )`, and `t := x`.
However, doing so would make the aforementioned `elementalAlgebra` refactor harder, so for now we
just prove these two lemmas independently.
A last strategy would be to deduce everything from the more general non-commutative case,
$$\frac{d}{dt}e^{x(t)} = \int_0^1 e^{sx(t)} \left(\frac{d}{dt}e^{x(t)}\right) e^{(1-s)x(t)} ds$$
but this is harder to prove, and typically is shown by going via these results first.
TODO: prove this result too!
-/
section exp_smul
variable { : Type*}
variable ()
open scoped Topology
open Asymptotics Filter
section MemBall
variable [NontriviallyNormedField ] [CharZero ]
variable [NormedCommRing ] [NormedRing ]
variable [NormedSpace ] [NormedAlgebra ] [Algebra ] [ContinuousSMul ]
variable [IsScalarTower ]
variable [CompleteSpace ]
theorem hasFDerivAt_exp_smul_const_of_mem_ball (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasFDerivAt (fun u : => exp (u • x)) (exp (t • x) • (1 : →L[] ).smulRight x) t := by
-- TODO: prove this via `hasFDerivAt_exp_of_mem_ball` using the commutative ring
-- `Algebra.elementalAlgebra x`. See https://github.com/leanprover-community/mathlib3/pull/19062 for discussion.
rw [hasFDerivAt_iff_isLittleO_nhds_zero]
suffices (fun (h : ) => exp (t • x) *
(exp ((0 + h) • x) - exp ((0 : ) • x) - ((1 : →L[] ).smulRight x) h)) =ᶠ[ 0]
fun h =>
exp ((t + h) • x) - exp (t • x) - (exp (t • x) • (1 : →L[] ).smulRight x) h by
apply (IsLittleO.const_mul_left _ _).congr' this (EventuallyEq.refl _ _)
rw [← hasFDerivAt_iff_isLittleO_nhds_zero (f := fun u => exp (u • x))
(f' := (1 : →L[] ).smulRight x) (x := 0)]
have : HasFDerivAt exp (1 : →L[] ) ((1 : →L[] ).smulRight x 0) := by
rw [ContinuousLinearMap.smulRight_apply, one_apply_eq_self, zero_smul]
exact hasFDerivAt_exp_zero_of_radius_pos htx.pos
exact this.comp 0 ((1 : →L[] ).smulRight x).hasFDerivAt
have : Tendsto (fun h : => h • x) ( 0) ( 0) := by
rw [← zero_smul x]
exact tendsto_id.smul_const x
have : ∀ᶠ h in (0 : ), h • x ∈ Metric.eball (0 : ) (expSeries ).radius :=
this.eventually (Metric.eball_mem_nhds _ htx.pos)
filter_upwards [this] with h hh
have : Commute (t • x) (h • x) := ((Commute.refl x).smul_left t).smul_right h
rw [add_smul t h, exp_add_of_commute_of_mem_ball this htx hh, zero_add, zero_smul, exp_zero,
ContinuousLinearMap.smulRight_apply, one_apply_eq_self,
smul_apply, ContinuousLinearMap.smulRight_apply, one_apply_eq_self, smul_eq_mul,
mul_sub_left_distrib, mul_sub_left_distrib, mul_one]
theorem hasFDerivAt_exp_smul_const_of_mem_ball' (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasFDerivAt (fun u : => exp (u • x))
(((1 : →L[] ).smulRight x).smulRight (exp (t • x))) t := by
convert hasFDerivAt_exp_smul_const_of_mem_ball _ _ htx using 1
ext t'
change Commute (t' • x) (exp (t • x))
exact (((Commute.refl x).smul_left t').smul_right t).exp_right
theorem hasStrictFDerivAt_exp_smul_const_of_mem_ball (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictFDerivAt (fun u : => exp (u • x))
(exp (t • x) • (1 : →L[] ).smulRight x) t :=
let ⟨_, hp⟩ := analyticAt_exp_of_mem_ball (t • x) htx
have deriv₁ : HasStrictFDerivAt (fun u : => exp (u • x)) _ t :=
hp.hasStrictFDerivAt.comp t ((ContinuousLinearMap.id ).smulRight x).hasStrictFDerivAt
have deriv₂ : HasFDerivAt (fun u : => exp (u • x)) _ t :=
hasFDerivAt_exp_smul_const_of_mem_ball x t htx
deriv₁.hasFDerivAt.unique deriv₂ ▸ deriv₁
theorem hasStrictFDerivAt_exp_smul_const_of_mem_ball' (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictFDerivAt (fun u : => exp (u • x))
(((1 : →L[] ).smulRight x).smulRight (exp (t • x))) t := by
let ⟨_, _⟩ := analyticAt_exp_of_mem_ball (t • x) htx
convert hasStrictFDerivAt_exp_smul_const_of_mem_ball _ _ htx using 1
ext t'
change Commute (t' • x) (exp (t • x))
exact (((Commute.refl x).smul_left t').smul_right t).exp_right
variable {}
theorem hasStrictDerivAt_exp_smul_const_of_mem_ball (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictDerivAt (fun u : => exp (u • x)) (exp (t • x) * x) t := by
simpa using (hasStrictFDerivAt_exp_smul_const_of_mem_ball x t htx).hasStrictDerivAt
theorem hasStrictDerivAt_exp_smul_const_of_mem_ball' (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasStrictDerivAt (fun u : => exp (u • x)) (x * exp (t • x)) t := by
simpa using (hasStrictFDerivAt_exp_smul_const_of_mem_ball' x t htx).hasStrictDerivAt
theorem hasDerivAt_exp_smul_const_of_mem_ball (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasDerivAt (fun u : => exp (u • x)) (exp (t • x) * x) t :=
(hasStrictDerivAt_exp_smul_const_of_mem_ball x t htx).hasDerivAt
theorem hasDerivAt_exp_smul_const_of_mem_ball' (x : ) (t : )
(htx : t • x ∈ Metric.eball (0 : ) (expSeries ).radius) :
HasDerivAt (fun u : => exp (u • x)) (x * exp (t • x)) t :=
(hasStrictDerivAt_exp_smul_const_of_mem_ball' x t htx).hasDerivAt
end MemBall
section RCLike
variable [RCLike ]
variable [NormedCommRing ] [NormedRing ]
variable [NormedAlgebra ] [NormedAlgebra ] [Algebra ] [ContinuousSMul ]
variable [IsScalarTower ]
variable [CompleteSpace ]
theorem hasFDerivAt_exp_smul_const (x : ) (t : ) :
HasFDerivAt (fun u : => exp (u • x)) (exp (t • x) • (1 : →L[] ).smulRight x) t :=
hasFDerivAt_exp_smul_const_of_mem_ball _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasFDerivAt_exp_smul_const' (x : ) (t : ) :
HasFDerivAt (fun u : => exp (u • x))
(((1 : →L[] ).smulRight x).smulRight (exp (t • x))) t :=
hasFDerivAt_exp_smul_const_of_mem_ball' _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasStrictFDerivAt_exp_smul_const (x : ) (t : ) :
HasStrictFDerivAt (fun u : => exp (u • x))
(exp (t • x) • (1 : →L[] ).smulRight x) t :=
hasStrictFDerivAt_exp_smul_const_of_mem_ball _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasStrictFDerivAt_exp_smul_const' (x : ) (t : ) :
HasStrictFDerivAt (fun u : => exp (u • x))
(((1 : →L[] ).smulRight x).smulRight (exp (t • x))) t :=
hasStrictFDerivAt_exp_smul_const_of_mem_ball' _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
variable {}
theorem hasStrictDerivAt_exp_smul_const (x : ) (t : ) :
HasStrictDerivAt (fun u : => exp (u • x)) (exp (t • x) * x) t :=
hasStrictDerivAt_exp_smul_const_of_mem_ball _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasStrictDerivAt_exp_smul_const' (x : ) (t : ) :
HasStrictDerivAt (fun u : => exp (u • x)) (x * exp (t • x)) t :=
hasStrictDerivAt_exp_smul_const_of_mem_ball' _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasDerivAt_exp_smul_const (x : ) (t : ) :
HasDerivAt (fun u : => exp (u • x)) (exp (t • x) * x) t :=
hasDerivAt_exp_smul_const_of_mem_ball _ _ <| (expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
theorem hasDerivAt_exp_smul_const' (x : ) (t : ) :
HasDerivAt (fun u : => exp (u • x)) (x * exp (t • x)) t :=
hasDerivAt_exp_smul_const_of_mem_ball' _ _ <|
(expSeries_radius_eq_top ).symm ▸ edist_lt_top _ _
variable () in
@[fun_prop]
lemma differentiable_exp_smul_const (x : ) :
Differentiable (fun t : ↦ exp (t • x)) :=
(⟨_, hasDerivAt_exp_smul_const x ·⟩)
@[fun_prop]
lemma differentiableAt_exp_smul_const (x : ) (r : ) :
DifferentiableAt (fun t : ↦ exp (t • x)) r :=
differentiable_exp_smul_const x |>.differentiableAt
end RCLike
end exp_smul
section tsum_tprod
variable { : Type*} [NormedCommRing ] [NormedAlgebra ℚ ] [CompleteSpace ]
/-- If `f` has sum `a`, then `NormedSpace.exp ∘ f` has product `NormedSpace.exp a`. -/
lemma HasSum.exp {ι : Type*} {f : ι → } {a : } (h : HasSum f a) :
HasProd (exp ∘ f) (exp a) :=
Tendsto.congr (fun s ↦ exp_sum s f) <| Tendsto.exp h
end tsum_tprod