Linear Algebra
8.137 min read

Rank from the Spectral Decomposition

The rank of a symmetric matrix AA equals the number of nonzero eigenvalues. This follows from the outer product form A=i=1nλiuiuiA = \sum_{i=1}^n \lambda_i \mathbf{u}_i \mathbf{u}_i^\top: each nonzero term contributes 1 to the rank, and the terms are "orthogonal" (in a precise sense), so the total rank is exactly the count of nonzero λi\lambda_i.

Equivalently, the null space of AA is spanned by the eigenvectors corresponding to zero eigenvalues. If λi=0\lambda_i = 0, then Aui=0A\mathbf{u}_i = 0, so uiker(A)\mathbf{u}_i \in \ker(A). And since the eigenvectors span Rn\mathbb{R}^n, the nullity equals the number of zero eigenvalues. By the rank-nullity theorem, rank = nn - nullity = number of nonzero eigenvalues.

Formal View

Theorem 8.4 — Rank from Spectral Decomposition
Let AA be a real symmetric n×nn \times n matrix with eigenvalues λ1,,λn\lambda_1, \ldots, \lambda_n. Then rank(A)=#{i:λi0}\operatorname{rank}(A) = \#\{i : \lambda_i \neq 0\}, the number of nonzero eigenvalues.

The null space ker(A)=span{ui:λi=0}\ker(A) = \operatorname{span}\{\mathbf{u}_i : \lambda_i = 0\}, and the column space col(A)=span{ui:λi0}\operatorname{col}(A) = \operatorname{span}\{\mathbf{u}_i : \lambda_i \neq 0\}.

Interactive Visualization

Rank-Nullity Theorem

Why This Matters

Rank tells you the "effective dimension" of a matrix — how many independent directions it can act along.

  • A covariance matrix with a zero eigenvalue indicates a redundant feature — a linear combination of features is constant.
  • Rank deficiency in AAA^\top A signals that the regression problem has infinitely many solutions.
  • Low-rank approximation: keeping only the top-kk eigenvalues gives the best rank-kk approximation of the matrix.

Quiz

Question 1

A symmetric 4×44 \times 4 matrix has eigenvalues {3,1,0,0}\{3, -1, 0, 0\}. What is its rank?

Question 2

If a symmetric matrix has rank kk, exactly kk of its eigenvalues are nonzero.

Common Mistakes

  • Counting the number of distinct eigenvalues instead of the number of nonzero eigenvalues — a repeated nonzero eigenvalue still contributes its full multiplicity to the rank.
  • Forgetting that nullity = number of zero eigenvalues (counting multiplicity), not the count of distinct zero eigenvalues.