Skip to content
mlmentorship

Eigenvalues and the spectral theorem

Eigenvectors are directions a matrix only stretches. The spectral theorem says symmetric matrices have a full orthogonal eigenbasis with real eigenvalues.

Published · 5 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

Read a real symmetric matrix multiplication as three operations: change to orthonormal eigenvector coordinates, scale each coordinate by its eigenvalue, and change back.

Preparing the visual…

Summary

An eigenvector of is a non-zero vector such that for some scalar (the eigenvalue). acts on purely by scaling. The spectral theorem states that every real symmetric matrix is orthogonally diagonalizable: with orthogonal and diagonal real.

Eigendecompositions explain stability of dynamical systems, convergence of optimization, structure of covariance matrices, and properties of attention / graph operators. The spectral theorem is the mathematical reason PCA works on covariance matrices, why Laplacian eigenmaps make sense for graphs, and why second-order optimizers reason about Hessian eigenvalues.

Eigenvalues, eigenvectors, characteristic polynomial

For a square matrix :

  • is equivalent to , so eigenvalues are roots of (the characteristic polynomial).
  • An matrix has eigenvalues (counted with multiplicity), possibly complex, possibly repeated.
  • Trace . Determinant .

For symmetric matrices, all eigenvalues are real and there exists an orthonormal eigenbasis.

The spectral theorem (symmetric case)

If :

where is orthogonal () and .

Geometric meaning: in the eigenbasis , the action of is independent scaling along each axis. Symmetric matrices have no rotational component. They are pure stretches in some orthogonal frame.

Learning objective

Read the spectral theorem as rotate into the eigenbasis, scale each coordinate, then rotate back.

Three-stage action of a symmetric matrix in its eigenbasis For the symmetric matrix A with rows two comma one and one comma two, the orthonormal eigenvectors q one and q two have eigenvalues three and one. First, Q transpose expresses v equals two comma one as eigen-coordinates z equals three over square root two comma negative one over square root two. Second, Lambda triples the q one coordinate while leaving the q two coordinate unchanged, producing nine over square root two comma negative one over square root two. Third, Q returns to the original axes and gives A v equals five comma four. Numbered panels, direct labels, solid arrows, and dashed guides convey every step without relying on color. 1 · Change coordinates with Qᵀ A = [[2, 1], [1, 2]] · v = (2, 1) q₁ = (1, 1)/√2 q₂ = (−1, 1)/√2 v z = Qᵀv = (3/√2, −1/√2) 2 · Scale independently with Λ = diag(3, 1) q₁ q₂ before: z after: Λz q₁ coordinate ×3 · q₂ coordinate ×1 3 · Return to the original axes with Q v = (2, 1) Av = (5, 4) Q(Λz) = QΛQᵀv = (5, 4)
Read it this way: QT does not stretch v; it only reports v along the orthogonal eigenvector axes. Λ then triples the q₁ coordinate and leaves the q₂ coordinate unchanged. Q returns those scaled coordinates to the original axes, giving Av = (5, 4).

Original coordinate construction checked against MIT OpenCourseWare 18.06 and Sheldon Axler's open-access Linear Algebra Done Right.

Connection to SVD

For symmetric positive semi-definite : SVD and eigendecomposition coincide (, ). For general matrices they differ. SVD is the more general tool; eigendecomposition is the specialized one for symmetric / square matrices.

Where eigenvalues show up in ML

ObjectWhat its eigenvalues tell you
Covariance matrixVariances along principal axes (PCA)
Hessian of lossLocal curvature; condition number = \lambda_\max / \lambda_\min
Graph LaplacianConnectivity, spectral clustering, GNN smoothness
Markov transition matrixMixing rate (second-largest eigenvalue)
Attention Effective rank; low-rank structure
Recurrent weight matrixWhether RNN gradients explode/vanish

Common pitfalls

  • Treating asymmetric matrices like symmetric ones. Asymmetric matrices may have complex eigenvalues and may not be diagonalizable at all (Jordan form).
  • Computing eigendecomposition for huge matrices. Use Lanczos / Arnoldi or randomized SVD for large-scale; full eigendecomposition is .
  • Confusing eigenvalues with singular values. Equal only for symmetric PSD matrices; otherwise singular values are .