The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V16. Normed spaces and functional analysis

Mathlib.Analysis.Matrix.Spectrum

39 declarations. Mathlib docs · Source

Spectral theory of Hermitian matrices

This file proves the spectral theorem for matrices. The proof of the spectral theorem is based on the spectral theorem for linear maps (LinearMap.IsSymmetric.eigenvectorBasis_apply_self_apply).

Tags

spectral theorem, diagonalization theorem

theorem Matrix.IsHermitian.eigenvalues₀.congr_simp E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A A_1 : Matrix n n 𝕜} (e_A : A = A_1)
  {inst_2 : DecidableEq n} [inst_3 : DecidableEq n] (hA : A.IsHermitian) (a a_1 : Fin (Fintype.card n)),
  a = a_1 → hA.eigenvalues₀ a = ⋯.eigenvalues₀ a_1

theorem Matrix.IsHermitian.eigenvectorBasis.congr_simp E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A A_1 : Matrix n n 𝕜} (e_A : A = A_1)
  [inst_2 : DecidableEq n] (hA : A.IsHermitian), hA.eigenvectorBasis = ⋯.eigenvectorBasis

theorem Fintype.equivOfCardEq.congr_simp E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst_1 : Fintype β] (h : Fintype.card α = Fintype.card β),
  Fintype.equivOfCardEq h = Fintype.equivOfCardEq h

theorem Matrix.IsHermitian.eigenvectorUnitary.congr_simp E1 #

∀ {𝕜 : Type u_3} [inst : RCLike 𝕜] {n : Type u_4} [inst_1 : Fintype n] {A A_1 : Matrix n n 𝕜} (e_A : A = A_1)
  [inst_2 : DecidableEq n] (hA : A.IsHermitian), hA.eigenvectorUnitary = ⋯.eigenvectorUnitary

theorem Matrix.IsHermitian.eigenvalues.congr_simp E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A A_1 : Matrix n n 𝕜} (e_A : A = A_1)
  {inst_2 : DecidableEq n} [inst_3 : DecidableEq n] (hA : A.IsHermitian) (a a_1 : n),
  a = a_1 → hA.eigenvalues a = ⋯.eigenvalues a_1

theorem Matrix.finite_real_spectrum E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n],
  (spectrum ℝ A).Finite

instance Matrix.instFiniteElemRealSpectrum E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n],
  Finite ↑(spectrum ℝ A)

theorem Matrix.spectrum_toLpLin E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (p : ENNReal), spectrum 𝕜 ((Matrix.toLpLin p p) A) = spectrum 𝕜 A

The spectrum of a matrix A coincides with the spectrum of toLpLin p p A.

theorem Matrix.spectralRadius_transpose E0 #

∀ {n : Type u_2} [inst : Fintype n] {K : Type u_3} [inst_1 : NormedField K] (A : Matrix n n K),
  spectralRadius K A.transpose = spectralRadius K A

The spectral radii of a matrix and its transpose are equal. See Matrix.spectrum_transpose.

def Matrix.IsHermitian.eigenvalues₀ E1 #

{𝕜 : Type u_1} →
  [inst : RCLike 𝕜] →
    {n : Type u_2} →
      [inst_1 : Fintype n] → {A : Matrix n n 𝕜} → [DecidableEq n] → A.IsHermitian → Fin (Fintype.card n) → ℝ

The eigenvalues of a Hermitian matrix, indexed by Fin (Fintype.card n) where n is the index type of the matrix.

theorem Matrix.IsHermitian.eigenvalues₀_antitone E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), Antitone hA.eigenvalues₀

def Matrix.IsHermitian.eigenvalues E1 #

{𝕜 : Type u_1} →
  [inst : RCLike 𝕜] → {n : Type u_2} → [Fintype n] → {A : Matrix n n 𝕜} → [DecidableEq n] → A.IsHermitian → n → ℝ

The eigenvalues of a Hermitian matrix, reusing the index n of the matrix entries.

def Matrix.IsHermitian.eigenvectorBasis E1 #

{𝕜 : Type u_1} →
  [inst : RCLike 𝕜] →
    {n : Type u_2} →
      [inst_1 : Fintype n] →
        {A : Matrix n n 𝕜} → [DecidableEq n] → A.IsHermitian → OrthonormalBasis n 𝕜 (EuclideanSpace 𝕜 n)

A choice of an orthonormal basis of eigenvectors of a Hermitian matrix.

theorem Matrix.IsHermitian.mulVec_eigenvectorBasis E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (j : n), A.mulVec (hA.eigenvectorBasis j).ofLp = hA.eigenvalues j • (hA.eigenvectorBasis j).ofLp

theorem Matrix.IsHermitian.eigenvalues_mem_spectrum_real E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (i : n), hA.eigenvalues i ∈ spectrum ℝ A

Eigenvalues of a Hermitian matrix A are in the ℝ spectrum of A.

def Matrix.IsHermitian.eigenvectorUnitary E1 #

{𝕜 : Type u_3} →
  [inst : RCLike 𝕜] →
    {n : Type u_4} →
      [inst_1 : Fintype n] → {A : Matrix n n 𝕜} → [inst_2 : DecidableEq n] → A.IsHermitian → ↥(Matrix.unitaryGroup n 𝕜)

Unitary matrix whose columns are Matrix.IsHermitian.eigenvectorBasis.

theorem Matrix.IsHermitian.eigenvectorUnitary_coe E0 #

∀ {𝕜 : Type u_3} [inst : RCLike 𝕜] {n : Type u_4} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian),
  ↑hA.eigenvectorUnitary = (EuclideanSpace.basisFun n 𝕜).toBasis.toMatrix ⇑hA.eigenvectorBasis.toBasis

theorem Matrix.IsHermitian.eigenvectorUnitary_transpose_apply E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (j : n), (↑hA.eigenvectorUnitary).transpose j = (hA.eigenvectorBasis j).ofLp

theorem Matrix.IsHermitian.eigenvectorUnitary_col_eq E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (j : n), (↑hA.eigenvectorUnitary).col j = (hA.eigenvectorBasis j).ofLp

theorem Matrix.IsHermitian.eigenvectorUnitary_apply E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (i j : n), ↑hA.eigenvectorUnitary i j = (hA.eigenvectorBasis j).ofLp i

theorem Matrix.IsHermitian.eigenvectorUnitary_mulVec E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (j : n), (↑hA.eigenvectorUnitary).mulVec (Pi.single j 1) = (hA.eigenvectorBasis j).ofLp

theorem Matrix.IsHermitian.star_eigenvectorUnitary_mulVec E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (j : n), (star ↑hA.eigenvectorUnitary).mulVec (hA.eigenvectorBasis j).ofLp = Pi.single j 1

theorem Matrix.IsHermitian.conjStarAlgAut_star_eigenvectorUnitary E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian),
  ((Unitary.conjStarAlgAut 𝕜 (Matrix n n 𝕜)) (star hA.eigenvectorUnitary)) A =
    Matrix.diagonal (RCLike.ofReal ∘ hA.eigenvalues)

Unitary diagonalization of a Hermitian matrix.

theorem Matrix.IsHermitian.spectral_theorem E2 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian),
  A =
    ((Unitary.conjStarAlgAut 𝕜 (Matrix n n 𝕜)) hA.eigenvectorUnitary) (Matrix.diagonal (RCLike.ofReal ∘ hA.eigenvalues))

Diagonalization theorem, spectral theorem for matrices; A Hermitian matrix can be diagonalized by a change of basis. For the spectral theorem on linear maps, see LinearMap.IsSymmetric.eigenvectorBasis_apply_self_apply.

theorem Matrix.IsHermitian.eigenvalues_eq E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (i : n),
  hA.eigenvalues i = RCLike.re (star (hA.eigenvectorBasis i).ofLp ⬝ᵥ A.mulVec (hA.eigenvectorBasis i).ofLp)

theorem Matrix.IsHermitian.charpoly_eq E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.charpoly = ∏ i, (Polynomial.X - Polynomial.C ↑(hA.eigenvalues i))

theorem Matrix.IsHermitian.roots_charpoly_eq_eigenvalues E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.charpoly.roots = Multiset.map (RCLike.ofReal ∘ hA.eigenvalues) Finset.univ.val

theorem Matrix.IsHermitian.roots_charpoly_eq_eigenvalues₀ E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.charpoly.roots = Multiset.map (RCLike.ofReal ∘ hA.eigenvalues₀) Finset.univ.val

theorem Matrix.IsHermitian.sort_roots_charpoly_eq_eigenvalues₀ E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian),
  ((Multiset.map (⇑RCLike.re) A.charpoly.roots).sort fun x1 x2 ↦ x1 ≥ x2) = List.ofFn hA.eigenvalues₀

theorem Matrix.IsHermitian.eigenvalues_eq_eigenvalues_iff E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A B : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian) (hB : B.IsHermitian), hA.eigenvalues = hB.eigenvalues ↔ A.charpoly = B.charpoly

theorem Matrix.IsHermitian.splits_charpoly E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n],
  A.IsHermitian → A.charpoly.Splits

theorem Matrix.IsHermitian.det_eq_prod_eigenvalues E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.det = ∏ i, ↑(hA.eigenvalues i)

The determinant of a Hermitian matrix is the product of its eigenvalues.

theorem Matrix.IsHermitian.rank_eq_rank_diagonal E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.rank = (Matrix.diagonal hA.eigenvalues).rank

rank of a Hermitian matrix is the rank of after diagonalization by the eigenvector unitary

theorem Matrix.IsHermitian.rank_eq_card_non_zero_eigs E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.rank = Fintype.card { i // hA.eigenvalues i ≠ 0 }

rank of a Hermitian matrix is the number of nonzero eigenvalues of the Hermitian matrix

theorem Matrix.IsHermitian.spectrum_eq_image_range E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), spectrum 𝕜 A = RCLike.ofReal '' Set.range hA.eigenvalues

The spectrum of a Hermitian matrix is the range of its eigenvalues under RCLike.ofReal.

theorem Matrix.IsHermitian.spectrum_real_eq_range_eigenvalues E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), spectrum ℝ A = Set.range hA.eigenvalues

The ℝ-spectrum of a Hermitian matrix over RCLike field is the range of the eigenvalue function.

theorem Matrix.IsHermitian.eigenvalues_eq_zero_iff E0 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), hA.eigenvalues = 0 ↔ A = 0

The eigenvalues of a Hermitian matrix A are all zero iff A = 0.

theorem Matrix.IsHermitian.exists_eigenvector_of_ne_zero E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜},
  A.IsHermitian → A ≠ 0 → ∃ v t, t ≠ 0 ∧ v ≠ 0 ∧ A.mulVec v = t • v

A nonzero Hermitian matrix has an eigenvector with nonzero eigenvalue.

theorem Matrix.IsHermitian.trace_eq_sum_eigenvalues E1 #

∀ {𝕜 : Type u_1} [inst : RCLike 𝕜] {n : Type u_2} [inst_1 : Fintype n] {A : Matrix n n 𝕜} [inst_2 : DecidableEq n]
  (hA : A.IsHermitian), A.trace = ∑ i, ↑(hA.eigenvalues i)