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 · 7 min read ·Core ·Foundation
Reading depth

Summary

A real symmetric matrix acts by independent signed scaling along an orthonormal eigenbasis. An eigenvector is a nonzero vector satisfying ; the scalar is its eigenvalue. The spectral theorem supplies a complete orthonormal basis, not merely one unchanged direction. Use this decomposition when a symmetric linear map must be applied, inverted, or understood through its principal directions.

Eigenvalues, eigenvectors, characteristic polynomial

For square , has a nonzero solution exactly when its determinant vanishes. The characteristic polynomial has complex roots counting multiplicity. Their sum is the trace; their product is the determinant. Symmetry guarantees real eigenvalues and an orthonormal eigenbasis, including when eigenvalues repeat.

The spectral theorem (symmetric case)

If :

where is orthogonal () and .

First express the input as ; then scale with and return with . Negative eigenvalues reverse their axis; zero eigenvalues erase its component.

Take and . The diagram uses , , and eigenvalues . Thus , , and .

Why does an entire basis exist? The continuous Rayleigh quotient reaches a maximum on the unit sphere. Its constrained stationary condition gives . Symmetry makes the orthogonal complement invariant: whenever . Repeat on that smaller symmetric subspace to construct the basis.

Learning objective

Change coordinates, scale eigenvector components, then change coordinates back

Separate coordinate changes from eigenvalue scalingFor this diagonal example, (3,1) becomes (6,3) under eigenvalues 2 and 3. A general symmetric matrix first uses its orthonormal eigenbasis.In the eigenbasis, each axis scalesaloneFirst coordinate: 3 x 2 = 6Second coordinate: 1 x 3 = 3This diagonal example already usesthat basis.
Derivation
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 changes coordinates without changing length. Λ triples the first coordinate and preserves the second. Q returns the result to the original axes: Av = (5, 4).
Check: Which step changes only coordinates? Which step actually scales the eigenvector components?
Read it this way: For this diagonal example, (3,1) becomes (6,3) under eigenvalues 2 and 3. A general symmetric matrix first uses its orthonormal eigenbasis.
Does scaling the first eigen-coordinate require mixing it with the second?

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-semidefinite , one SVD uses and . For symmetric indefinite , singular values are , not the signed eigenvalues. General rectangular matrices have an SVD but no square-matrix eigendecomposition of the same form.

Change the Requirement

Apply the Map Repeatedly

New task: Compute without two dense applications after the eigenbasis is available.

Picture and change: Replace each by , preserving the coordinate basis.

Check: , matching .

Use when: Many powers or repeated queries reuse the same decomposition. Dense decomposition costs ; one dense basis transform costs .

Solve Instead of Apply

New task: Recover satisfying .

Picture and change: Divide each eigen-coordinate by its nonzero eigenvalue.

Check: .

Use when: Every eigenvalue is nonzero. A zero eigenvalue makes some right-hand sides impossible and others nonunique. Adding a ridge changes the system; it is not an exact inverse of the original map.

Where eigenvalues show up in ML

ObjectWhat its eigenvalues tell you
Covariance matrixVariances along principal axes (PCA)
Positive-definite HessianLocal curvature; spectral condition number
Graph LaplacianConnectivity, spectral clustering, GNN smoothness
Reversible Markov chainMixing depends on nontrivial eigenvalue magnitudes and the chain’s assumptions
General attention score matrixMay be asymmetric; singular values describe rank and norm structure
Recurrent weight matrixLong-run dynamics; finite-step gradient norms also depend on singular values and nonnormality

Common pitfalls

  • Dropping symmetry. The matrix has only one independent eigenvector. Its repeated eigenvalue does not provide a basis.
  • Dropping positivity. has eigenvalues but singular values .
  • Ignoring scale. Dense decompositions need cubic arithmetic and quadratic storage. Lanczos targets symmetric eigenproblems; Arnoldi handles more general operators. Approximate methods require residual and convergence checks.

Reconstruct

Why may repeated eigenvalues still have orthogonal eigenvectors for a symmetric matrix?

Reasoned answer

Inside a repeated-eigenvalue eigenspace, every linear combination remains an eigenvector with that eigenvalue. Choose an orthonormal basis inside that subspace. Symmetry, not distinctness of all eigenvalues, guarantees a complete orthonormal collection.