Spectral Theorem

lean4-prooflinear-algebravisualization
A=QΛQT  (real symmetric case)A = Q \Lambda Q^T \;\text{(real symmetric case)}

Statement

Let AA be a real symmetric n×nn \times n matrix (i.e., A=ATA = A^T). Then:

  1. All eigenvalues of AA are real.
  2. Eigenvectors corresponding to distinct eigenvalues are orthogonal.
  3. There exists an orthogonal matrix QQ (so QT=Q1Q^T = Q^{-1}) and a diagonal matrix Λ\Lambda such that:
A=QΛQTA = Q \Lambda Q^T

Equivalently, AA is orthogonally similar to a diagonal matrix of its eigenvalues. In the complex Hermitian setting (A=AA = A^*), the same holds with a unitary matrix UU replacing QQ.

Visualization

Take the symmetric matrix:

A=(4221)A = \begin{pmatrix} 4 & 2 \\ 2 & 1 \end{pmatrix}

Step 1 — Find eigenvalues via det(λIA)=0\det(\lambda I - A) = 0:

(λ4)(λ1)4=λ25λ=0    λ1=0,  λ2=5(\lambda - 4)(\lambda - 1) - 4 = \lambda^2 - 5\lambda = 0 \implies \lambda_1 = 0,\; \lambda_2 = 5

Both eigenvalues are real. Λ=(0005)\Lambda = \begin{pmatrix} 0 & 0 \\ 0 & 5 \end{pmatrix}

Step 2 — Find eigenvectors.

For λ1=0\lambda_1 = 0: (A0)v=0(A - 0)\mathbf{v} = 0 gives 4v1+2v2=04v_1 + 2v_2 = 0, so v1=15(12)\mathbf{v}_1 = \frac{1}{\sqrt{5}}\begin{pmatrix} -1 \\ 2 \end{pmatrix}.

For λ2=5\lambda_2 = 5: (A5I)v=0(A - 5I)\mathbf{v} = 0 gives v1+2v2=0-v_1 + 2v_2 = 0, so v2=15(21)\mathbf{v}_2 = \frac{1}{\sqrt{5}}\begin{pmatrix} 2 \\ 1 \end{pmatrix}.

Note v1v2=15(2+2)=0\mathbf{v}_1 \cdot \mathbf{v}_2 = \frac{1}{5}(-2 + 2) = 0: orthogonal, as guaranteed.

Step 3 — Assemble QQ and verify A=QΛQTA = Q\Lambda Q^T.

Q=15(1221),QΛQT=15(1221)(0005)(1221)Q = \frac{1}{\sqrt{5}}\begin{pmatrix} -1 & 2 \\ 2 & 1 \end{pmatrix}, \quad Q\Lambda Q^T = \frac{1}{5}\begin{pmatrix} -1 & 2 \\ 2 & 1 \end{pmatrix}\begin{pmatrix} 0 & 0 \\ 0 & 5 \end{pmatrix}\begin{pmatrix} -1 & 2 \\ 2 & 1 \end{pmatrix}
=15(01005)(1221)=15(2010105)=(4221)=A= \frac{1}{5}\begin{pmatrix} 0 & 10 \\ 0 & 5 \end{pmatrix}\begin{pmatrix} -1 & 2 \\ 2 & 1 \end{pmatrix} = \frac{1}{5}\begin{pmatrix} 20 & 10 \\ 10 & 5 \end{pmatrix} = \begin{pmatrix} 4 & 2 \\ 2 & 1 \end{pmatrix} = A \checkmark

Proof Sketch

The key steps for real symmetric matrices are: (1) every symmetric operator on a real finite-dimensional inner product space has at least one real eigenvalue (proved via the characteristic polynomial having a real root, using the fundamental theorem of algebra over C\mathbb{C} then checking reality). (2) By induction on dimension — restrict to the orthogonal complement of one eigenvector; the restricted operator is still symmetric. (3) Orthogonality of eigenvectors for distinct eigenvalues follows from λ1u,v=Au,v=u,Av=λ2u,v\lambda_1 \langle u, v \rangle = \langle Au, v \rangle = \langle u, Av \rangle = \lambda_2 \langle u, v \rangle.

Connections

  • Cayley–Hamilton TheoremCayley–Hamilton TheorempA(A)=0  where  pA(λ)=det(λIA)p_A(A) = 0 \;\text{where}\; p_A(\lambda) = \det(\lambda I - A)Every square matrix satisfies its own characteristic polynomialRead more → — the characteristic polynomial whose roots are these eigenvalues is also annihilated by AA.
  • Determinant MultiplicativityDeterminant Multiplicativitydet(AB)=det(A)det(B)\det(AB) = \det(A)\,\det(B)The determinant of a product equals the product of determinantsRead more →det(A)=iλi\det(A) = \prod_i \lambda_i; the product of diagonal entries of Λ\Lambda.
  • Rank–Nullity TheoremRank–Nullity Theoremrank(f)+nullity(f)=dimV\operatorname{rank}(f) + \operatorname{nullity}(f) = \dim VThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more → — the number of zero eigenvalues equals the nullity of AA.
  • Fundamental Theorem of Galois TheoryFundamental Theorem of Galois Theory{intermediate fields}{subgroups of Gal(K/F)}\{\text{intermediate fields}\} \longleftrightarrow \{\text{subgroups of } \text{Gal}(K/F)\}Bijection between intermediate fields and subgroups of the Galois groupRead more → — the eigenvalue decomposition is the linear algebra analogue of a splitting field decomposition.
  • Spectral Radius FormulaSpectral Radius Formular(a)=limnan1/nr(a) = \lim_{n\to\infty} \|a^n\|^{1/n}The spectral radius equals the limit of the nth root of the operator norm of the nth power (Gelfand's formula)Read more → — for bounded operators on a Banach space, the spectral radius r(T)=limnTn1/nr(T) = \lim_{n\to\infty}\|T^n\|^{1/n} equals the supremum of λ|\lambda| over all λ\lambda in the spectrum; for Hermitian matrices this reduces to r(A)=Aop=maxiλir(A) = \|A\|_\text{op} = \max_i |\lambda_i|.

Lean4 Proof

/-- The spectral theorem for Hermitian matrices: a Hermitian matrix A is
    unitarily conjugate to a diagonal matrix of its (real) eigenvalues.
    Mathlib packages this as `Matrix.IsHermitian.spectral_theorem` in
    Mathlib.Analysis.Matrix.Spectrum. -/
noncomputable example
    {n 𝕜 : Type*} [RCLike 𝕜] [Fintype n] [DecidableEq n]
    {A : Matrix n n 𝕜} (hA : A.IsHermitian) :
    A = hA.eigenvectorUnitary.val *
        Matrix.diagonal (RCLike.ofReal ∘ hA.eigenvalues) *
        (star hA.eigenvectorUnitary.val) :=
  hA.spectral_theorem