Finite-dimensional spectral theorem (source code)

= Finite-dimensional spectral theorem
{title2=$A=\sum_{j=1}^n\lambda_j e_je_j^*$}

Every <self-adjoint operator> on a finite-dimensional real or complex <inner product space> has an <orthonormal eigenbasis>, and all its <eigenvalues> are real. In orthonormal coordinates, a real <symmetric matrix> has the form $A=Q\Lambda Q^T$, with $Q$ an <orthogonal matrix> and $\Lambda$ a real <diagonal matrix>. A complex <Hermitian matrix> instead has $A=U\Lambda U^*$, with $U$ a <unitary matrix> and $U^*$ its <conjugate transpose>. These are the self-adjoint cases of the <spectral theorem>; Axler gives the real and complex finite-dimensional statements in Section 7B.https://linear.axler.net/LADR4e.pdf[Sheldon Axler, Linear Algebra Done Right, fourth edition, Section 7B, Theorems 7.29 and 7.31; accessed 2026-10-11]{ref}

An <orthonormal eigenbasis> turns a seemingly coupled <linear map> into independent <scalar multiplications> while preserving <lengths> and <angles>. If $x=\sum_j c_je_j$ and $Ae_j=\lambda_je_j$, then
$$
Ax=\sum_j\lambda_jc_je_j,\qquad
\|x\|^2=\sum_j|c_j|^2,\qquad
x^*Ax=\sum_j\lambda_j|c_j|^2.
$$
The last identity removes every cross term from the <quadratic form>. The <eigenvalues> tell us whether it is positive, negative, or mixed in sign, and the <eigenvectors> identify the corresponding directions. This connects <positive-definite matrices>, <quadratic forms>, and the <Hermitian Rayleigh quotient range>.

For a fully computed example, take
$$
A=\begin{pmatrix}2&1\\1&2\end{pmatrix},\qquad
e_+=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix},\qquad
e_-=\frac1{\sqrt2}\begin{pmatrix}-1\\1\end{pmatrix}.
$$
Direct multiplication gives $Ae_+=3e_+$ and $Ae_-=e_-$. Their <dot product> is zero and each has <norm> one. Thus
$$
Q=\frac1{\sqrt2}\begin{pmatrix}1&-1\\1&1\end{pmatrix},\qquad
Q^TAQ=\begin{pmatrix}3&0\\0&1\end{pmatrix}.
$$
Writing $x=ce_++de_-$ changes $x^TAx=2x_1^2+2x_1x_2+2x_2^2$ into $3c^2+d^2$. Its <level set> $x^TAx=1$ is therefore an <ellipse> with semiaxis lengths $1/\sqrt3$ and $1$, along $e_+$ and $e_-$. The coordinates change, but the <ellipse> does not: <orthogonal diagonalization> reveals its existing geometry.

\Image[/spectral-theorem-ellipse-coordinates.png]
{title=An <orthonormal eigenbasis> removes the cross term from a <quadratic form> and reveals the axes of its <ellipse>}

For distinct <eigenvalues>, orthogonality follows at once from self-adjointness: $\lambda\langle u,v\rangle=\langle Au,v\rangle=\langle u,Av\rangle=\mu\langle u,v\rangle$. Within a repeated <eigenspace>, choose an <orthonormal basis>; arbitrarily chosen <eigenvectors> of the same <eigenvalue> need not be orthogonal. One outline of the full argument finds an <eigenvector>, observes that its <orthogonal complement> is invariant, and repeats in that smaller space. Merely having real <eigenvalues> is weaker: $\begin{pmatrix}2&1\\0&1\end{pmatrix}$ has two real <eigenvalues>, but its <eigenvectors> $(1,0)^T$ and $(-1,1)^T$ are not orthogonal.