Documentation

Mathlib.Analysis.Matrix.Spectrum

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.finite_real_spectrum {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] :
instance Matrix.instFiniteElemRealSpectrum {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] :
theorem Matrix.spectrum_toLpLin {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (p : ENNReal) :
spectrum 𝕜 ((toLpLin p p) A) = spectrum 𝕜 A

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

@[deprecated Matrix.spectrum_toLpLin (since := "2026-01-21")]
theorem Matrix.spectrum_toEuclideanLin {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] :

The spectrum of a matrix A coincides with the spectrum of toEuclideanLin A.

noncomputable def Matrix.IsHermitian.eigenvalues₀ {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

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

Equations
    Instances For
      noncomputable def Matrix.IsHermitian.eigenvalues {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
      n

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

      Equations
        Instances For
          noncomputable def Matrix.IsHermitian.eigenvectorBasis {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

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

          Equations
            Instances For
              theorem Matrix.IsHermitian.mulVec_eigenvectorBasis {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (j : n) :
              theorem Matrix.IsHermitian.eigenvalues_mem_spectrum_real {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (i : n) :

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

              noncomputable def Matrix.IsHermitian.eigenvectorUnitary {𝕜 : Type u_3} [RCLike 𝕜] {n : Type u_4} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
              (unitaryGroup n 𝕜)

              Unitary matrix whose columns are Matrix.IsHermitian.eigenvectorBasis.

              Equations
                Instances For
                  @[simp]
                  theorem Matrix.IsHermitian.eigenvectorUnitary_transpose_apply {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (j : n) :
                  @[simp]
                  theorem Matrix.IsHermitian.eigenvectorUnitary_col_eq {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (j : n) :
                  @[simp]
                  theorem Matrix.IsHermitian.eigenvectorUnitary_apply {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (i j : n) :
                  theorem Matrix.IsHermitian.eigenvectorUnitary_mulVec {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (j : n) :

                  Unitary diagonalization of a Hermitian matrix.

                  @[deprecated Matrix.IsHermitian.conjStarAlgAut_star_eigenvectorUnitary (since := "2025-11-06")]

                  Alias of Matrix.IsHermitian.conjStarAlgAut_star_eigenvectorUnitary.


                  Unitary diagonalization of a Hermitian matrix.

                  theorem Matrix.IsHermitian.spectral_theorem {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

                  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 {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) (i : n) :
                  theorem Matrix.IsHermitian.charpoly_eq {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
                  A.charpoly = i : n, (Polynomial.X - Polynomial.C (hA.eigenvalues i))
                  theorem Matrix.IsHermitian.splits_charpoly {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
                  theorem Matrix.IsHermitian.det_eq_prod_eigenvalues {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
                  A.det = i : n, (hA.eigenvalues i)

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

                  theorem Matrix.IsHermitian.rank_eq_rank_diagonal {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

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

                  theorem Matrix.IsHermitian.rank_eq_card_non_zero_eigs {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

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

                  theorem Matrix.IsHermitian.spectrum_eq_image_range {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :

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

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

                  theorem Matrix.IsHermitian.eigenvalues_eq_zero_iff {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [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 {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (h_ne : A 0) :
                  ∃ (v : n𝕜) (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 {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : A.IsHermitian) :
                  A.trace = i : n, (hA.eigenvalues i)