Volume I, Chapter 1 — Part III. Eigendecomposition, the characteristic polynomial, the spectral theorem for symmetric matrices, PCA as spectral optimization, and convergence of gradient descent in the eigenbasis.
Q,Λ — Eigenvector matrix and diagonal eigenvalue matrix
tr(A),det(A) — Trace and determinant
Core Intuition
Every linear transformation A mixes directions in general — rotating, shearing, and scaling simultaneously. Eigenvectors are the privileged directions that A acts on by pure scaling: Av=λv. The scalar λ is the eigenvalue. When we express a vector in the eigenbasis, the action of A becomes diagonal — each coordinate is multiplied by its eigenvalue.
For symmetric matrices — covariance matrices, Hessians, kernel Gram matrices — eigenvectors are orthogonal and eigenvalues are real. This is the spectral theorem, the mathematical engine behind PCA, spectral clustering, and quadratic optimization theory. The ratio λmax/λmin, the condition number, governs how fast gradient descent converges on quadratic losses.
Series context. This is Part III of Chapter 1. The SVD generalizes eigendecomposition to rectangular matrices.
Interactive: Eigenvalues & Eigenvectors
Matrix A:
λ₁ = 3.618
λ₂ = 1.382
det = 5.00, trace = 5.00
Observe: Gray dots show random vectors before/after transformation. Eigenvectors (colored arrows) only stretch or flip — they keep their direction. The dashed line shows the eigenspace. Try setting b=c=0 to make A diagonal — then eigenvectors align with axes.
Definition and the Characteristic Polynomial
Definition 1 (Eigenvalue, Eigenvector). Let A∈Rn×n. A nonzero vector v∈Rn is an eigenvector with eigenvalueλ∈C if
Av=λv.(1)
Derivation of the characteristic equation. Rearranging (1):
(A−λI)v=0.(2)
For nonzero v, the matrix (A−λI) must be singular:
det(A−λI)=0.(3)
Definition 2 (Characteristic Polynomial).
p(λ)=det(A−λI)(4)
is a polynomial of degree n. Its roots (in C) are the eigenvalues.
Example 1. For A=[4213]:
p(λ)=(4−λ)(3−λ)−2=λ2−7λ+10=(λ−5)(λ−2).(5)
Eigenvalues: λ1=5, λ2=2.
For λ1=5: (A−5I)v=0 gives v1∝(1,1)T.
For λ2=2: v2∝(1,−2)T.
Geometric interpretation. Along v1, A stretches by factor 5. Along v2, by factor 2. In general directions, the transformation combines rotation and scaling.
Visual description. Imagine a unit circle in R2. A linear map sends it to an ellipse. The eigenvectors point along the major and minor axes of that ellipse; eigenvalues give the axis lengths (up to sign).
Properties of Eigenvalues and Eigenvectors
Theorem 1 (Trace and Determinant).If A∈Rn×n has eigenvalues λ1,…,λn (with algebraic multiplicity):
tr(A)=i=1∑nλi,det(A)=i=1∏nλi.(6)
Proof. The characteristic polynomial factors as p(λ)=(−1)n∏i=1n(λ−λi). Comparing coefficients: the λn−1 term gives tr(A)=∑λi; setting λ=0 gives det(A)=∏λi. ■
Corollary 1.A is singular iff λ=0 is an eigenvalue.
Theorem 2 (Independence of Eigenvectors).Eigenvectors corresponding to distinct eigenvalues are linearly independent.
Proof (induction on number of distinct eigenvalues). For one eigenvector, independence is trivial. Suppose v1,…,vk are eigenvectors with distinct eigenvalues λ1,…,λk. Assume ∑i=1kαivi=0 with not all αi=0. Apply A:
i=1∑kαiλivi=0.(7)
Multiply the original equation by λk and subtract:
i=1∑k−1αi(λi−λk)vi=0.(8)
By induction, αi(λi−λk)=0 for i<k. Since λi=λk, αi=0 for i<k. Then αkvk=0 gives αk=0. ■
Proposition 1 (Similarity invariance of spectrum).If B=P−1AP, then A and B have the same eigenvalues.
Proof.det(B−λI)=det(P−1(A−λI)P)=det(A−λI). ■
Diagonalization
Definition 3 (Diagonalizable).A is diagonalizable if A=PΛP−1 where Λ=diag(λ1,…,λn) and columns of P are eigenvectors.
Theorem 3.A∈Rn×n is diagonalizable iff Rn has a basis of eigenvectors — equivalently, iff there are n linearly independent eigenvectors.
Proof. If A=PΛP−1, then AP=PΛ, so column j of P satisfies Apj=λjpj. Conversely, if p1,…,pn are independent eigenvectors with eigenvalues λi, then P=[p1∣⋯∣pn] is invertible and AP=PΛ, giving A=PΛP−1. ■
Corollary 2 (Powers of matrices).
Ak=PΛkP−1=Pdiag(λ1k,…,λnk)P−1.(9)
For recurrent networks, if ∣λi∣>1 for some i, repeated application causes exploding activations; if ∣λi∣<1, vanishing activations.
Example 2 (Non-diagonalizable).A=[1011] has eigenvalue 1 with algebraic multiplicity 2 but geometric multiplicity 1 (only one independent eigenvector). Such defective matrices require Jordan form beyond this chapter.
The Spectral Theorem
Theorem 4 (Spectral Theorem for Real Symmetric Matrices).If A∈Rn×n satisfies A=AT, then:
All eigenvalues are real.
Eigenvectors for distinct eigenvalues are orthogonal.
A is orthogonally diagonalizable:
A=QΛQT,QTQ=I,Λ diagonal with real entries.(10)
Proof of (1): Real eigenvalues.
Let Av=λv with v=0, λ∈C. Take complex conjugate: Avˉ=λˉvˉ (since A is real). Then:
Important equation. Equation (10) is the central decomposition for symmetric matrices. For covariance Σ, columns of Q are principal directions and Λ contains variances along those directions.
Rayleigh Quotient and Variational Characterization
Definition 4 (Rayleigh Quotient). For symmetric A and nonzero x:
R(x)=xTxxTAx.(13)
Theorem 5 (Rayleigh's Principle).Let A be symmetric with eigenvalues λ1≤⋯≤λn. Then:
λmin=x=0minR(x),λmax=x=0maxR(x).(14)
The minimum is achieved at an eigenvector of λmin; the maximum at an eigenvector of λmax.
Proof sketch. Write x=∑i=1nciqi in the orthonormal eigenbasis. Then R(x)=∑iλici2/∑ici2, a weighted average of eigenvalues. Extremal values occur when all weight is on one eigenvalue. ■
Corollary 3 (Courant-Fischer). The k-th largest eigenvalue satisfies:
λk=dim(S)=kmax0=x∈SminR(x).(15)
This variational characterization underpins PCA and spectral methods.
Application: Principal Component Analysis
Given centered data matrix X∈RN×d (each row a sample), the sample covariance is:
Important equation. Equation (25) shows that large κ (elongated level sets) causes slow convergence — the motivation for preconditioning and adaptive optimizers in Gradient Descent.
Spectral Properties of Matrices in ML
Covariance C — λi≥0, real — Variance along PC i
Hessian H — Real (symmetric) — Curvature; negative λ at saddles
Graph Laplacian L — λi≥0, λ1=0 — Smoothness on graphs
Attention (pre-softmax) — Not symmetric in general — Affinity structure
Normalized adjacency — —λ—≤1 — Random walk mixing
Power iteration. To find the dominant eigenvector, iterate vt+1=Avt/∥Avt∥. Convergence rate depends on ∣λ2∣/∣λ1∣ — the foundation of PageRank and spectral methods.
Appendix: Completing the Spectral Theorem Proof
Proof of (3) in Theorem 4 (existence of orthonormal eigenbasis).
Proceed by induction on n. For n=1, trivial. Assume true for (n−1)×(n−1) symmetric matrices.
Let λ1 be an eigenvalue of A with unit eigenvector q1. Extend to orthonormal basis {q1,w2,…,wn} and form orthogonal Q1=[q1∣w2∣⋯∣wn].
Then:
Q1TAQ1=[λ100TB],(26)
where B∈R(n−1)×(n−1) is symmetric (since Q1TAQ1 is symmetric). By induction, B=Q2Λ2Q2T. Assembling gives A=QΛQT with Q orthogonal. ■
Common Pitfalls and Misconceptions
Pitfall 1: Assuming all matrices are diagonalizable. Defective matrices exist. Symmetric matrices are always diagonalizable; general matrices may require Jordan form.
Pitfall 2: Confusing algebraic and geometric multiplicity. A repeated eigenvalue may have fewer independent eigenvectors than its multiplicity.
Pitfall 3: Using eigenvalues of nonsymmetric weight matrices for stability. RNN weight matrices are generally nonsymmetric; spectral radius (max ∣λi∣) determines stability, but eigenvectors need not be orthogonal.
Pitfall 4: PCA on uncentered data. Covariance (16) assumes centered data. Without centering, the first PC may capture the mean offset rather than variance structure.
Pitfall 5: Equating small eigenvalues with "unimportant" directions. Small covariance eigenvalues may correspond to noise — or to rare but semantically critical features. Truncation requires domain judgment.
Research Perspective
Eigendecomposition dates to Cauchy and Jacobi. The spectral theorem for symmetric operators was extended to infinite dimensions by Hilbert, enabling quantum mechanics and functional analysis.
In machine learning, PCA (Pearson, 1901; Hotelling, 1933) was among the first spectral learning methods. Spectral clustering (Ng, Jordan, Weiss, 2002) uses eigenvectors of graph Laplacians for nonlinear cluster structure. The Neural Tangent Kernel literature analyzes training dynamics via the spectrum of infinite-width kernel matrices.
Modern research on sharpness-aware minimization and Hessian spectrum analysis uses eigenvalues of the loss Hessian to characterize generalization. The condition number (25) remains the standard language for optimization difficulty in convex settings.
Exercise 1. Compute eigenvalues and eigenvectors of A=[2−1−12]. Verify orthogonality of eigenvectors and diagonalize A.
Exercise 2. Prove that if A is symmetric and idempotent (A2=A), then eigenvalues are 0 or 1. Interpret projection matrices in regression.
Exercise 3. Derive equation (25) explicitly by substituting η∗=2/(λ1+λn) into ∣1−ηλi∣ and maximizing over i.
Exercise 4 (PCA). For data with covariance C=diag(3,1,0.5), compute PVE for each principal component. How many components capture 90% of variance?
Exercise 5 (Rayleigh quotient). Prove Theorem 5 for the maximum eigenvalue using the eigenbasis expansion of x.
Exercise 6 (Conceptual). Explain why the graph Laplacian L=D−A (degree minus adjacency) is positive semidefinite by showing xTLx=∑(i,j)∈E(xi−xj)2/2 for an undirected graph.
Exercise 7 (Power iteration). For A with eigenvalues ∣λ1∣>∣λ2∣≥⋯, show that power iteration converges to v1 with error decreasing as O(∣λ2/λ1∣t).