|
7 | 7 |
|
8 | 8 | public import Mathlib.Analysis.InnerProductSpace.PiL2 |
9 | 9 | public import Mathlib.LinearAlgebra.Matrix.Hermitian |
| 10 | +import Mathlib.Analysis.InnerProductSpace.Adjoint |
10 | 11 |
|
11 | 12 | /-! |
12 | 13 | # Hermitian matrices over ℝ and ℂ |
@@ -38,22 +39,39 @@ lemma IsHermitian.coe_re_apply_self (h : A.IsHermitian) (i : n) : (re (A i i) : |
38 | 39 | lemma IsHermitian.coe_re_diag (h : A.IsHermitian) : (fun i => (re (A.diag i) : 𝕜)) = A.diag := |
39 | 40 | funext h.coe_re_apply_self |
40 | 41 |
|
41 | | -/-- A matrix is Hermitian iff the corresponding linear map is self adjoint. -/ |
| 42 | +/-- A matrix is Hermitian iff the corresponding linear map with an orthonormal basis is self |
| 43 | +adjoint. -/ |
| 44 | +@[simp] |
| 45 | +lemma isSymmetric_toLin_iff [Fintype n] [DecidableEq n] {E : Type*} |
| 46 | + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] (b : OrthonormalBasis n 𝕜 E) : |
| 47 | + (A.toLin b.toBasis b.toBasis).IsSymmetric ↔ A.IsHermitian := by |
| 48 | + have : FiniteDimensional 𝕜 E := b.toBasis.finiteDimensional_of_finite |
| 49 | + simp_rw [LinearMap.IsSymmetric, ← LinearMap.adjoint_inner_left, ← toLin_conjTranspose] |
| 50 | + refine ⟨fun h ↦ ?_, fun h _ _ ↦ by rw [h.eq]⟩ |
| 51 | + simpa using (LinearMap.ext fun x ↦ ext_inner_right _ (h x)).symm |
| 52 | + |
| 53 | +/-- A matrix is Hermitian iff the corresponding linear map on the Euclidean space is self adjoint. |
| 54 | +-/ |
| 55 | +@[simp] |
| 56 | +lemma isSymmetric_toEuclideanLin_iff [Fintype n] [DecidableEq n] : |
| 57 | + A.toEuclideanLin.IsSymmetric ↔ A.IsHermitian := |
| 58 | + isSymmetric_toLin_iff (EuclideanSpace.basisFun n 𝕜) |
| 59 | + |
| 60 | +@[deprecated isSymmetric_toEuclideanLin_iff (since := "2026-03-30")] |
42 | 61 | lemma isHermitian_iff_isSymmetric [Fintype n] [DecidableEq n] : |
43 | | - IsHermitian A ↔ A.toEuclideanLin.IsSymmetric := by |
44 | | - rw [LinearMap.IsSymmetric, (WithLp.toLp_surjective _).forall₂] |
45 | | - simp only [toLpLin_toLp, Matrix.toLin'_apply, EuclideanSpace.inner_eq_star_dotProduct, |
46 | | - star_mulVec] |
47 | | - constructor |
48 | | - · rintro (h : Aᴴ = A) x y |
49 | | - rw [dotProduct_comm, ← dotProduct_mulVec, h, dotProduct_comm] |
50 | | - · intro h |
51 | | - ext i j |
52 | | - simpa [(Pi.single_star i 1).symm] using h (Pi.single i 1) (Pi.single j 1) |
| 62 | + IsHermitian A ↔ A.toEuclideanLin.IsSymmetric := isSymmetric_toEuclideanLin_iff.symm |
53 | 63 |
|
54 | 64 | lemma IsHermitian.im_star_dotProduct_mulVec_self [Fintype n] (hA : A.IsHermitian) (x : n → 𝕜) : |
55 | 65 | RCLike.im (star x ⬝ᵥ A *ᵥ x) = 0 := by |
56 | 66 | classical |
57 | | - simpa [dotProduct_comm] using (isHermitian_iff_isSymmetric.mp hA).im_inner_self_apply _ |
| 67 | + simpa [dotProduct_comm] using (isSymmetric_toEuclideanLin_iff.mpr hA).im_inner_self_apply _ |
58 | 68 |
|
59 | 69 | end Matrix |
| 70 | + |
| 71 | +/-- A linear map is self adjoint if the corresponding matrix with an orthonormal basis is Hermitian. |
| 72 | +-/ |
| 73 | +@[simp] |
| 74 | +lemma LinearMap.isHermitian_toMatrix_iff {n 𝕜 E : Type*} [Fintype n] [DecidableEq n] [RCLike 𝕜] |
| 75 | + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] {f : E →ₗ[𝕜] E} (b : OrthonormalBasis n 𝕜 E) : |
| 76 | + (f.toMatrix b.toBasis b.toBasis).IsHermitian ↔ f.IsSymmetric := by |
| 77 | + rw [← Matrix.isSymmetric_toLin_iff b, Matrix.toLin_toMatrix] |
0 commit comments