Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2aabb1c
refactor(Analysis/NormedSpace/Exponential): remove the `𝕂` argument f…
eric-wieser Nov 12, 2023
2ab023d
downstream fixes
eric-wieser Nov 12, 2023
318a6b5
remove porting header
eric-wieser Nov 12, 2023
29371f1
style fixes
eric-wieser Nov 12, 2023
8756b5e
add back dropped lemma
eric-wieser Nov 12, 2023
fdec6d2
Merge remote-tracking branch 'origin/master' into eric-wieser/exp-rat
eric-wieser Nov 12, 2023
51d59c1
fix remaining downstream issues
eric-wieser Nov 12, 2023
667f721
long lines
eric-wieser Nov 12, 2023
85c30e4
Merge branch 'master' into eric-wieser/exp-rat
eric-wieser Nov 13, 2023
712f194
Merge remote-tracking branch 'origin/master' into eric-wieser/exp-rat
eric-wieser Jan 5, 2024
ec14e7e
fix a broken proof
eric-wieser Jan 5, 2024
4c88fd5
fixes
eric-wieser Feb 22, 2024
4352a0d
fix
eric-wieser Feb 22, 2024
b4f1125
fix lint
eric-wieser Feb 23, 2024
b19e1e0
Merge branch 'master' into eric-wieser/exp-rat
eric-wieser Feb 23, 2024
1c99cb3
Update DualNumber.lean
eric-wieser Feb 23, 2024
41597a6
Merge remote-tracking branch 'origin/master' into eric-wieser/exp-rat
eric-wieser Feb 27, 2024
ceffca9
Merge commit 'a8a6713b92e1dc246a2d2a5255bb2d1846e88fe2^' into eric-wi…
eric-wieser Apr 3, 2025
f8ce078
Merge commit 'a8a6713b92e1dc246a2d2a5255bb2d1846e88fe2' into eric-wie…
eric-wieser Apr 3, 2025
88a37c0
Merge tag 'v4.8.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
ddbeb05
Merge tag 'v4.9.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
5862361
Merge commit 'v4.10.0~350' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
20ee617
Merge commit 'v4.10.0~335' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
127517d
Merge commit 'v4.10.0~332' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
a42ae41
remove aligns
eric-wieser Apr 3, 2025
d740ffc
Merge commit 'v4.10.0~331' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
d49cc83
git Merge tag 'v4.10.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
f026156
Merge v4.11.0 into eric-wieser/exp-rat (using imerge)
eric-wieser Apr 3, 2025
cb3c28a
Merge v4.12.0 into eric-wieser/exp-rat (using imerge)
eric-wieser Apr 3, 2025
2cdf694
Merge tag 'v4.13.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
d1f757f
imerge 'v4.11.0': manual merge 1-90
eric-wieser Apr 3, 2025
d80e936
Merge tag 'v4.15.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
df1ede9
Merge tag 'v4.16.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
3855639
Merge tag 'v4.17.0' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
a6a04cf
Merge remote-tracking branch 'origin/master' into eric-wieser/exp-rat
eric-wieser Apr 3, 2025
7e6a65d
fix
eric-wieser Apr 3, 2025
4d5da7d
fix
eric-wieser Apr 3, 2025
58eeba7
another fix
eric-wieser Apr 3, 2025
48c2f09
one final fix
eric-wieser Apr 3, 2025
f31b802
getting close
eric-wieser Apr 3, 2025
765dbdb
lintfix
eric-wieser Apr 3, 2025
d69bbff
Finite regression
eric-wieser Apr 3, 2025
913bc45
fix
eric-wieser Apr 3, 2025
36187df
lost simp
eric-wieser Apr 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Mathlib/Analysis/NormedSpace/DualNumber.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ namespace DualNumber

open TrivSqZeroExt

variable (𝕜 : Type*) {R : Type*}

variable [IsROrC 𝕜] [NormedCommRing R] [NormedAlgebra 𝕜 R]
variable {R : Type*} [NormedCommRing R] [Algebra ℚ R]

variable [TopologicalRing R] [CompleteSpace R] [T2Space R]

@[simp]
theorem exp_eps : exp 𝕜 (eps : DualNumber R) = 1 + eps :=
exp_inr _ _
theorem exp_eps : exp (eps : DualNumber R) = 1 + eps :=
exp_inr _
#align dual_number.exp_eps DualNumber.exp_eps

@[simp]
theorem exp_smul_eps (r : R) : exp 𝕜 (r • eps : DualNumber R) = 1 + r • eps := by
theorem exp_smul_eps (r : R) : exp (r • eps : DualNumber R) = 1 + r • eps := by
rw [eps, ← inr_smul, exp_inr]
#align dual_number.exp_smul_eps DualNumber.exp_smul_eps

Expand Down
406 changes: 216 additions & 190 deletions Mathlib/Analysis/NormedSpace/Exponential.lean

Large diffs are not rendered by default.

72 changes: 36 additions & 36 deletions Mathlib/Analysis/NormedSpace/MatrixExponential.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ results for general rings are instead stated about `Ring.inverse`:

## TODO

* Show that `Matrix.det (exp 𝕂 A) = exp 𝕂 (Matrix.trace A)`
* Show that `Matrix.det (exp A) = exp (Matrix.trace A)`

## References

Expand All @@ -73,46 +73,46 @@ section Topological
section Ring

variable [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] [∀ i, Fintype (n' i)]
[∀ i, DecidableEq (n' i)] [Field 𝕂] [Ring 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸]
[Algebra 𝕂 𝔸] [T2Space 𝔸]
[∀ i, DecidableEq (n' i)] [Ring 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸]
[Algebra 𝔸] [T2Space 𝔸]

theorem exp_diagonal (v : m → 𝔸) : exp 𝕂 (diagonal v) = diagonal (exp 𝕂 v) := by
theorem exp_diagonal (v : m → 𝔸) : exp (diagonal v) = diagonal (exp v) := by
simp_rw [exp_eq_tsum, diagonal_pow, ← diagonal_smul, ← diagonal_tsum]
#align matrix.exp_diagonal Matrix.exp_diagonal

theorem exp_blockDiagonal (v : m → Matrix n n 𝔸) :
exp 𝕂 (blockDiagonal v) = blockDiagonal (exp 𝕂 v) := by
exp (blockDiagonal v) = blockDiagonal (exp v) := by
simp_rw [exp_eq_tsum, ← blockDiagonal_pow, ← blockDiagonal_smul, ← blockDiagonal_tsum]
#align matrix.exp_block_diagonal Matrix.exp_blockDiagonal

theorem exp_blockDiagonal' (v : ∀ i, Matrix (n' i) (n' i) 𝔸) :
exp 𝕂 (blockDiagonal' v) = blockDiagonal' (exp 𝕂 v) := by
exp (blockDiagonal' v) = blockDiagonal' (exp v) := by
simp_rw [exp_eq_tsum, ← blockDiagonal'_pow, ← blockDiagonal'_smul, ← blockDiagonal'_tsum]
#align matrix.exp_block_diagonal' Matrix.exp_blockDiagonal'

theorem exp_conjTranspose [StarRing 𝔸] [ContinuousStar 𝔸] (A : Matrix m m 𝔸) :
exp 𝕂 Aᴴ = (exp 𝕂 A)ᴴ :=
exp Aᴴ = (exp A)ᴴ :=
(star_exp A).symm
#align matrix.exp_conj_transpose Matrix.exp_conjTranspose

theorem IsHermitian.exp [StarRing 𝔸] [ContinuousStar 𝔸] {A : Matrix m m 𝔸} (h : A.IsHermitian) :
(exp 𝕂 A).IsHermitian :=
(exp_conjTranspose _ _).symm.trans <| congr_arg _ h
(exp A).IsHermitian :=
(exp_conjTranspose _).symm.trans <| congr_arg _ h
#align matrix.is_hermitian.exp Matrix.IsHermitian.exp

end Ring

section CommRing

variable [Fintype m] [DecidableEq m] [Field 𝕂] [CommRing 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸]
[Algebra 𝕂 𝔸] [T2Space 𝔸]
variable [Fintype m] [DecidableEq m] [CommRing 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸]
[Algebra 𝔸] [T2Space 𝔸]

theorem exp_transpose (A : Matrix m m 𝔸) : exp 𝕂 Aᵀ = (exp 𝕂 A)ᵀ := by
theorem exp_transpose (A : Matrix m m 𝔸) : exp Aᵀ = (exp A)ᵀ := by
simp_rw [exp_eq_tsum, transpose_tsum, transpose_smul, transpose_pow]
#align matrix.exp_transpose Matrix.exp_transpose

theorem IsSymm.exp {A : Matrix m m 𝔸} (h : A.IsSymm) : (exp 𝕂 A).IsSymm :=
(exp_transpose _ _).symm.trans <| congr_arg _ h
theorem IsSymm.exp {A : Matrix m m 𝔸} (h : A.IsSymm) : (exp A).IsSymm :=
(exp_transpose _).symm.trans <| congr_arg _ h
#align matrix.is_symm.exp Matrix.IsSymm.exp

end CommRing
Expand All @@ -122,52 +122,52 @@ end Topological
section Normed

variable [IsROrC 𝕂] [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] [∀ i, Fintype (n' i)]
[∀ i, DecidableEq (n' i)] [NormedRing 𝔸] [NormedAlgebra 𝕂 𝔸] [CompleteSpace 𝔸]
[∀ i, DecidableEq (n' i)] [NormedRing 𝔸] [Algebra ℚ 𝔸] [NormedAlgebra 𝕂 𝔸] [CompleteSpace 𝔸]

nonrec theorem exp_add_of_commute (A B : Matrix m m 𝔸) (h : Commute A B) :
exp 𝕂 (A + B) = exp 𝕂 A * exp 𝕂 B := by
exp (A + B) = exp A * exp B := by
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact exp_add_of_commute h
exact exp_add_of_commute 𝕂 h
#align matrix.exp_add_of_commute Matrix.exp_add_of_commute

nonrec theorem exp_sum_of_commute {ι} (s : Finset ι) (f : ι → Matrix m m 𝔸)
(h : (s : Set ι).Pairwise fun i j => Commute (f i) (f j)) :
exp 𝕂 (∑ i in s, f i) =
s.noncommProd (fun i => exp 𝕂 (f i)) fun i hi j hj _ => (h.of_refl hi hj).exp 𝕂 := by
exp (∑ i in s, f i) =
s.noncommProd (fun i => exp (f i)) fun i hi j hj _ => (h.of_refl hi hj).exp := by
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact exp_sum_of_commute s f h
exact exp_sum_of_commute 𝕂 s f h
#align matrix.exp_sum_of_commute Matrix.exp_sum_of_commute

nonrec theorem exp_nsmul (n : ℕ) (A : Matrix m m 𝔸) : exp 𝕂 (n • A) = exp 𝕂 A ^ n := by
nonrec theorem exp_nsmul (n : ℕ) (A : Matrix m m 𝔸) : exp (n • A) = exp A ^ n := by
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact exp_nsmul n A
exact exp_nsmul 𝕂 n A
#align matrix.exp_nsmul Matrix.exp_nsmul

nonrec theorem isUnit_exp (A : Matrix m m 𝔸) : IsUnit (exp 𝕂 A) := by
nonrec theorem isUnit_exp (A : Matrix m m 𝔸) : IsUnit (exp A) := by
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact isUnit_exp _ A
exact isUnit_exp 𝕂 A
#align matrix.is_unit_exp Matrix.isUnit_exp

-- TODO(mathlib4#6607): fix elaboration so `val` isn't needed
nonrec theorem exp_units_conj (U : (Matrix m m 𝔸)ˣ) (A : Matrix m m 𝔸) :
exp 𝕂 (U.val * A * (U⁻¹).val) = U.val * exp 𝕂 A * (U⁻¹).val := by
exp (U.val * A * (U⁻¹).val) = U.val * exp A * (U⁻¹).val := by
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact exp_units_conj _ U A
exact exp_units_conj 𝕂 U A
#align matrix.exp_units_conj Matrix.exp_units_conj

-- TODO(mathlib4#6607): fix elaboration so `val` isn't needed
theorem exp_units_conj' (U : (Matrix m m 𝔸)ˣ) (A : Matrix m m 𝔸) :
exp 𝕂 ((U⁻¹).val * A * U.val) = (U⁻¹).val * exp 𝕂 A * U.val :=
exp ((U⁻¹).val * A * U.val) = (U⁻¹).val * exp A * U.val :=
exp_units_conj 𝕂 U⁻¹ A
#align matrix.exp_units_conj' Matrix.exp_units_conj'

Expand All @@ -176,31 +176,31 @@ end Normed
section NormedComm

variable [IsROrC 𝕂] [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] [∀ i, Fintype (n' i)]
[∀ i, DecidableEq (n' i)] [NormedCommRing 𝔸] [NormedAlgebra 𝕂 𝔸] [CompleteSpace 𝔸]
[∀ i, DecidableEq (n' i)] [NormedCommRing 𝔸] [Algebra ℚ 𝔸] [NormedAlgebra 𝕂 𝔸] [CompleteSpace 𝔸]

theorem exp_neg (A : Matrix m m 𝔸) : exp 𝕂 (-A) = (exp 𝕂 A)⁻¹ := by
theorem exp_neg (A : Matrix m m 𝔸) : exp (-A) = (exp A)⁻¹ := by
rw [nonsing_inv_eq_ring_inverse]
letI : SeminormedRing (Matrix m m 𝔸) := Matrix.linftyOpSemiNormedRing
letI : NormedRing (Matrix m m 𝔸) := Matrix.linftyOpNormedRing
letI : NormedAlgebra 𝕂 (Matrix m m 𝔸) := Matrix.linftyOpNormedAlgebra
exact (Ring.inverse_exp _ A).symm
exact (Ring.inverse_exp 𝕂 A).symm
#align matrix.exp_neg Matrix.exp_neg

theorem exp_zsmul (z : ℤ) (A : Matrix m m 𝔸) : exp 𝕂 (z • A) = exp 𝕂 A ^ z := by
theorem exp_zsmul (z : ℤ) (A : Matrix m m 𝔸) : exp (z • A) = exp A ^ z := by
obtain ⟨n, rfl | rfl⟩ := z.eq_nat_or_neg
· rw [zpow_ofNat, coe_nat_zsmul, exp_nsmul]
· have : IsUnit (exp 𝕂 A).det := (Matrix.isUnit_iff_isUnit_det _).mp (isUnit_exp _ _)
rw [Matrix.zpow_neg this, zpow_ofNat, neg_smul, exp_neg, coe_nat_zsmul, exp_nsmul]
· rw [zpow_ofNat, coe_nat_zsmul, exp_nsmul 𝕂]
· have : IsUnit (exp A).det := (Matrix.isUnit_iff_isUnit_det _).mp (isUnit_exp 𝕂 _)
rw [Matrix.zpow_neg this, zpow_ofNat, neg_smul, exp_neg 𝕂, coe_nat_zsmul, exp_nsmul 𝕂]
#align matrix.exp_zsmul Matrix.exp_zsmul

theorem exp_conj (U : Matrix m m 𝔸) (A : Matrix m m 𝔸) (hy : IsUnit U) :
exp 𝕂 (U * A * U⁻¹) = U * exp 𝕂 A * U⁻¹ :=
exp (U * A * U⁻¹) = U * exp A * U⁻¹ :=
let ⟨u, hu⟩ := hy
hu ▸ by simpa only [Matrix.coe_units_inv] using exp_units_conj 𝕂 u A
#align matrix.exp_conj Matrix.exp_conj

theorem exp_conj' (U : Matrix m m 𝔸) (A : Matrix m m 𝔸) (hy : IsUnit U) :
exp 𝕂 (U⁻¹ * A * U) = U⁻¹ * exp 𝕂 A * U :=
exp (U⁻¹ * A * U) = U⁻¹ * exp A * U :=
let ⟨u, hu⟩ := hy
hu ▸ by simpa only [Matrix.coe_units_inv] using exp_units_conj' 𝕂 u A
#align matrix.exp_conj' Matrix.exp_conj'
Expand Down
30 changes: 15 additions & 15 deletions Mathlib/Analysis/NormedSpace/QuaternionExponential.lean
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ open NormedSpace
namespace Quaternion

@[simp, norm_cast]
theorem exp_coe (r : ℝ) : exp (r : ℍ[ℝ]) = ↑(exp r) :=
theorem exp_coe (r : ℝ) : exp (r : ℍ[ℝ]) = ↑(exp r) :=
(map_exp ℝ (algebraMap ℝ ℍ[ℝ]) (continuous_algebraMap _ _) _).symm
#align quaternion.exp_coe Quaternion.exp_coe

Expand Down Expand Up @@ -96,51 +96,51 @@ theorem hasSum_expSeries_of_imaginary {q : Quaternion ℝ} (hq : q.re = 0) {c s

/-- The closed form for the quaternion exponential on imaginary quaternions. -/
theorem exp_of_re_eq_zero (q : Quaternion ℝ) (hq : q.re = 0) :
exp q = ↑(Real.cos ‖q‖) + (Real.sin ‖q‖ / ‖q‖) • q := by
exp q = ↑(Real.cos ‖q‖) + (Real.sin ‖q‖ / ‖q‖) • q := by
rw [exp_eq_tsum]
refine' HasSum.tsum_eq _
simp_rw [← expSeries_apply_eq]
simp_rw [← expSeries_apply_eq, ← expSeries_eq_expSeries_rat ℝ]
exact hasSum_expSeries_of_imaginary hq (Real.hasSum_cos _) (Real.hasSum_sin _)
#align quaternion.exp_of_re_eq_zero Quaternion.exp_of_re_eq_zero

/-- The closed form for the quaternion exponential on arbitrary quaternions. -/
theorem exp_eq (q : Quaternion ℝ) :
exp q = exp q.re • (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im) := by
rw [← exp_of_re_eq_zero q.im q.im_re, ← coe_mul_eq_smul, ← exp_coe, ← exp_add_of_commute,
exp q = exp q.re • (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im) := by
rw [← exp_of_re_eq_zero q.im q.im_re, ← coe_mul_eq_smul, ← exp_coe, ← exp_add_of_commute,
re_add_im]
exact Algebra.commutes q.re (_ : ℍ[ℝ])
#align quaternion.exp_eq Quaternion.exp_eq

theorem re_exp (q : ℍ[ℝ]) : (exp q).re = exp q.re * Real.cos ‖q - q.re‖ := by simp [exp_eq]
theorem re_exp (q : ℍ[ℝ]) : (exp q).re = exp q.re * Real.cos ‖q - q.re‖ := by simp [exp_eq]
#align quaternion.re_exp Quaternion.re_exp

theorem im_exp (q : ℍ[ℝ]) : (exp q).im = (exp q.re * (Real.sin ‖q.im‖ / ‖q.im‖)) • q.im := by
theorem im_exp (q : ℍ[ℝ]) : (exp q).im = (exp q.re * (Real.sin ‖q.im‖ / ‖q.im‖)) • q.im := by
simp [exp_eq, smul_smul]
#align quaternion.im_exp Quaternion.im_exp

theorem normSq_exp (q : ℍ[ℝ]) : normSq (exp q) = exp q.re ^ 2 :=
theorem normSq_exp (q : ℍ[ℝ]) : normSq (exp q) = exp q.re ^ 2 :=
calc
normSq (exp q) =
normSq (exp q.re • (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im)) :=
normSq (exp q) =
normSq (exp q.re • (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im)) :=
by rw [exp_eq]
_ = exp q.re ^ 2 * normSq (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im) := by
_ = exp q.re ^ 2 * normSq (↑(Real.cos ‖q.im‖) + (Real.sin ‖q.im‖ / ‖q.im‖) • q.im) := by
rw [normSq_smul]
_ = exp q.re ^ 2 * (Real.cos ‖q.im‖ ^ 2 + Real.sin ‖q.im‖ ^ 2) := by
_ = exp q.re ^ 2 * (Real.cos ‖q.im‖ ^ 2 + Real.sin ‖q.im‖ ^ 2) := by
congr 1
obtain hv | hv := eq_or_ne ‖q.im‖ 0
· simp [hv]
rw [normSq_add, normSq_smul, star_smul, coe_mul_eq_smul, smul_re, smul_re, star_re, im_re,
smul_zero, smul_zero, mul_zero, add_zero, div_pow, normSq_coe,
normSq_eq_norm_mul_self, ← sq, div_mul_cancel _ (pow_ne_zero _ hv)]
_ = exp q.re ^ 2 := by rw [Real.cos_sq_add_sin_sq, mul_one]
_ = exp q.re ^ 2 := by rw [Real.cos_sq_add_sin_sq, mul_one]

#align quaternion.norm_sq_exp Quaternion.normSq_exp

/-- Note that this implies that exponentials of pure imaginary quaternions are unit quaternions
since in that case the RHS is `1` via `exp_zero` and `norm_one`. -/
@[simp]
theorem norm_exp (q : ℍ[ℝ]) : ‖exp q‖ = ‖exp q.re‖ := by
rw [norm_eq_sqrt_real_inner (exp q), inner_self, normSq_exp, Real.sqrt_sq_eq_abs,
theorem norm_exp (q : ℍ[ℝ]) : ‖exp q‖ = ‖exp q.re‖ := by
rw [norm_eq_sqrt_real_inner (exp q), inner_self, normSq_exp, Real.sqrt_sq_eq_abs,
Real.norm_eq_abs]
#align quaternion.norm_exp Quaternion.norm_exp

Expand Down
20 changes: 11 additions & 9 deletions Mathlib/Analysis/NormedSpace/Spectrum.lean
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ section ExpMapping

local notation "↑ₐ" => algebraMap 𝕜 A

/-- For `𝕜 = ℝ` or `𝕜 = ℂ`, `exp 𝕜` maps the spectrum of `a` into the spectrum of `exp 𝕜 a`. -/
theorem exp_mem_exp [IsROrC 𝕜] [NormedRing A] [NormedAlgebra 𝕜 A] [CompleteSpace A] (a : A) {z : 𝕜}
(hz : z ∈ spectrum 𝕜 a) : exp 𝕜 z ∈ spectrum 𝕜 (exp 𝕜 a) := by
have hexpmul : exp 𝕜 a = exp 𝕜 (a - ↑ₐ z) * ↑ₐ (exp 𝕜 z) := by
rw [algebraMap_exp_comm z, ← exp_add_of_commute (Algebra.commutes z (a - ↑ₐ z)).symm,
/-- For `𝕜 = ℝ` or `𝕜 = ℂ`, `exp` maps the spectrum of `a` into the spectrum of `exp a`. -/
theorem exp_mem_exp [IsROrC 𝕜] [NormedRing A] [Algebra ℚ A] [NormedAlgebra 𝕜 A] [CompleteSpace A]
(a : A) {z : 𝕜} (hz : z ∈ spectrum 𝕜 a) : exp z ∈ spectrum 𝕜 (exp a) := by
have hexpmul : exp a = exp (a - ↑ₐ z) * ↑ₐ (exp z) := by
rw [algebraMap_exp_comm z, ← exp_add_of_commute 𝕜 (Algebra.commutes z (a - ↑ₐ z)).symm,
sub_add_cancel]
let b := ∑' n : ℕ, ((n + 1).factorial⁻¹ : 𝕜) • (a - ↑ₐ z) ^ n
have hb : Summable fun n : ℕ => ((n + 1).factorial⁻¹ : 𝕜) • (a - ↑ₐ z) ^ n := by
Expand All @@ -486,13 +486,15 @@ theorem exp_mem_exp [IsROrC 𝕜] [NormedRing A] [NormedAlgebra 𝕜 A] [Complet
simpa only [mul_smul_comm, pow_succ] using hb.tsum_mul_left (a - ↑ₐ z)
have h₁ : (∑' n : ℕ, ((n + 1).factorial⁻¹ : 𝕜) • (a - ↑ₐ z) ^ (n + 1)) = b * (a - ↑ₐ z) := by
simpa only [pow_succ', Algebra.smul_mul_assoc] using hb.tsum_mul_right (a - ↑ₐ z)
have h₃ : exp 𝕜 (a - ↑ₐ z) = 1 + (a - ↑ₐ z) * b := by
have h₃ : exp (a - ↑ₐ z) = 1 + (a - ↑ₐ z) * b := by
rw [exp_eq_tsum]
convert tsum_eq_zero_add (expSeries_summable' (𝕂 := 𝕜) (a - ↑ₐ z))
simp only [Nat.factorial_zero, Nat.cast_one, inv_one, pow_zero, one_smul]
exact h₀.symm
rw [spectrum.mem_iff, IsUnit.sub_iff, ← one_mul (↑ₐ (exp 𝕜 z)), hexpmul, ← _root_.sub_mul,
Commute.isUnit_mul_iff (Algebra.commutes (exp 𝕜 z) (exp 𝕜 (a - ↑ₐ z) - 1)).symm,
convert h₀.symm
ext a
exact inv_nat_cast_smul_eq ℚ 𝕜 _ a
rw [spectrum.mem_iff, IsUnit.sub_iff, ← one_mul (↑ₐ (exp z)), hexpmul, ← _root_.sub_mul,
Commute.isUnit_mul_iff (Algebra.commutes (exp z) (exp (a - ↑ₐ z) - 1)).symm,
sub_eq_iff_eq_add'.mpr h₃, Commute.isUnit_mul_iff (h₀ ▸ h₁ : (a - ↑ₐ z) * b = b * (a - ↑ₐ z))]
exact not_and_of_not_left _ (not_and_of_not_left _ ((not_iff_not.mpr IsUnit.sub_iff).mp hz))
#align spectrum.exp_mem_exp spectrum.exp_mem_exp
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Analysis/NormedSpace/Star/Exponential.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ open NormedSpace -- For `exp`.
section Star

variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [StarRing A] [ContinuousStar A]
[CompleteSpace A] [StarModule ℂ A]
[CompleteSpace A] [Algebra ℚ A] [StarModule ℂ A]

open Complex

/-- The map from the selfadjoint real subspace to the unitary group. This map only makes sense
over ℂ. -/
@[simps]
noncomputable def selfAdjoint.expUnitary (a : selfAdjoint A) : unitary A :=
⟨exp ((I • a.val) : A),
exp_mem_unitary_of_mem_skewAdjoint _ (a.prop.smul_mem_skewAdjoint conj_I)⟩
⟨exp ((I • a.val) : A),
exp_mem_unitary_of_mem_skewAdjoint (a.prop.smul_mem_skewAdjoint conj_I)⟩
#align self_adjoint.exp_unitary selfAdjoint.expUnitary

open selfAdjoint
Expand All @@ -45,7 +45,7 @@ theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A
have hcomm : Commute (I • (a : A)) (I • (b : A)) := by
unfold Commute SemiconjBy
simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm]
simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm
simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm
#align commute.exp_unitary_add Commute.expUnitary_add

theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Analysis/NormedSpace/Star/Spectrum.lean
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ theorem IsStarNormal.spectralRadius_eq_nnnorm (a : A) [IsStarNormal a] :
/-- Any element of the spectrum of a selfadjoint is real. -/
theorem IsSelfAdjoint.mem_spectrum_eq_re [StarModule ℂ A] {a : A} (ha : IsSelfAdjoint a) {z : ℂ}
(hz : z ∈ spectrum ℂ a) : z = z.re := by
letI : Algebra ℚ A := RestrictScalars.algebra ℚ ℂ A
have hu := exp_mem_unitary_of_mem_skewAdjoint ℂ (ha.smul_mem_skewAdjoint conj_I)
let Iu := Units.mk0 I I_ne_zero
have : NormedSpace.exp (I • z) ∈ spectrum ℂ (NormedSpace.exp (I • a)) := by
have : NormedSpace.exp (I • z) ∈ spectrum ℂ (NormedSpace.exp (I • a)) := by
simpa only [Units.smul_def, Units.val_mk0] using
spectrum.exp_mem_exp (Iu • a) (smul_mem_smul_iff.mpr hz)
exact Complex.ext (ofReal_re _) <| by
Expand Down
Loading