Hyoungseo Son
Linear Algebra
Contents · Linear Algebra

Part 1 · Vectors & Spaces

Part 4 · Orthogonality

Part 5 · Eigenvalues

Part 6 · Singular Value Decomposition

Part 7 · Spectral & Positive Definite

  • Symmetric Matrices, the Spectral Theorem, and Positive Definiteness

Part 7 · Spectral & Positive Definite

Symmetric Matrices, the Spectral Theorem, and Positive Definiteness

7 min read

Among all square matrices, the symmetric ones, A=AA = A^\top, have the cleanest structure of all. Their eigenvalues are real, their eigenvectors can be chosen orthonormal, and the whole matrix factors into a rotation times a diagonal stretch times the inverse rotation. This is not a curiosity: mass matrices, covariance matrices, graph Laplacians, and every product AAA^\top A are symmetric, so the theory below is the theory of most matrices that arise from real problems.

The spectral theorem

If A=AA = A^\top is real and n×nn \times n, then it has an orthonormal basis of eigenvectors with real eigenvalues. Equivalently, there is an orthogonal QQ (so QQ=IQ^\top Q = I) and a diagonal Λ\Lambda with

A=QΛQ=i=1nλiqiqi,Λ=diag(λ1,,λn),λiR.A = Q\,\Lambda\,Q^\top = \sum_{i=1}^{n} \lambda_i\, q_i q_i^\top , \qquad \Lambda = \operatorname{diag}(\lambda_1,\dots,\lambda_n), \quad \lambda_i \in \mathbb{R}.

The eigenvalues are real because for an eigenpair (λ,x)(\lambda, x) with x0x \ne 0,

λxˉx=xˉAx=(Axˉ)x=λˉxˉx    λ=λˉ.\lambda\,\bar x^\top x = \bar x^\top A x = \overline{(A\bar x)}^{\top} x = \bar\lambda\,\bar x^\top x \;\Longrightarrow\; \lambda = \bar\lambda .

Eigenvectors of distinct eigenvalues are orthogonal, since

λiqiqj=(Aqi)qj=qiAqj=λjqiqj    (λiλj)qiqj=0.\lambda_i\, q_i^\top q_j = (A q_i)^\top q_j = q_i^\top A q_j = \lambda_j\, q_i^\top q_j \;\Longrightarrow\; (\lambda_i - \lambda_j)\, q_i^\top q_j = 0 .

So AA acts by resolving any xx into the orthonormal directions qiq_i and scaling each by λi\lambda_i. Nothing rotates into anything else.

Quadratic forms measure curvature

Attach to AA the scalar function

f(x)=xAx=i,jaijxixj,f(x) = x^\top A x = \sum_{i,j} a_{ij}\, x_i x_j ,

its quadratic form. Substituting the spectral factorization and setting y=Qxy = Q^\top x (an orthonormal change of coordinates, so y=x\lVert y\rVert = \lVert x\rVert) diagonalizes it completely:

f(x)=xQΛQx=yΛy=i=1nλiyi2.f(x) = x^\top Q\Lambda Q^\top x = y^\top \Lambda y = \sum_{i=1}^{n} \lambda_i\, y_i^2 .

In the eigenbasis the form is just a weighted sum of squares. Its sign is therefore dictated entirely by the signs of the eigenvalues: ff curves upward along a qiq_i with λi>0\lambda_i > 0 and downward where λi<0\lambda_i < 0.

Positive definiteness, four ways

AA is positive definite when f(x)=xAx>0f(x) = x^\top A x > 0 for every x0x \ne 0. For a symmetric AA the following are equivalent, and each is a usable test.1

xAx>0  x0    all λi>0    all pivots>0    all leading principal minors dk>0.x^\top A x > 0 \ \ \forall x \ne 0 \iff \text{all } \lambda_i > 0 \iff \text{all pivots} > 0 \iff \text{all leading principal minors } d_k > 0 .

The eigenvalue test is immediate from f=λiyi2f = \sum \lambda_i y_i^2. The pivot test reads the diagonal of elimination (A=LDLA = LDL^\top has Dii>0D_{ii} > 0). The minor test is Sylvester's criterion: the determinants dk=detA1:k,1:kd_k = \det A_{1:k,\,1:k} of the top-left k×kk \times k blocks are all positive. Geometrically, positive definite means the level sets f(x)=constf(x) = \text{const} are ellipsoids around a single minimum: the graph is a bowl. If the eigenvalues have mixed signs the matrix is indefinite and the graph is a saddle; if some vanish it is only semidefinite, with flat directions.

A clean consequence: AA is positive definite exactly when it has a Cholesky factorization A=LLA = L L^\top with LL lower triangular and positive diagonal, which is elimination specialized to the symmetric positive definite case and the workhorse for solving Ax=bA x = b in practice.2

Quadratic form: bowl vs saddleinteractive
λ=3.0λ=1.0
A
[2.0 1.0 ; 1.0 2.0]
λ₁ (larger)
3.00
λ₂ (smaller)
1.00
minor d₁ = a
2.00
minor d₂ = det
4.00 − 1.00 = 3.00

classification: positive definite

Set the symmetric A = [[a, b], [b, c]] with the three sliders. Accent curves are f = +1, +4, +9; red curves are f = -1, -4, -9; the tint marks where the form is positive vs negative. The two lines are the eigenvector axes, colored by the sign of their eigenvalue. Positive definite gives nested ellipses (a bowl); flip a sign to get hyperbolas crossing at a saddle.

A worked example

Take

A=[2112],A=A.A = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}, \qquad A = A^\top .

The eigenvalues of a symmetric [abbc]\begin{bmatrix} a & b \\ b & c \end{bmatrix} are

λ=(a+c)±(ac)2+4b22=4±0+42={3, 1},\lambda = \frac{(a + c) \pm \sqrt{(a - c)^2 + 4 b^2}}{2} = \frac{4 \pm \sqrt{0 + 4}}{2} = \{\, 3,\ 1 \,\},

both positive, so AA is positive definite. The other three tests agree. The leading principal minors are

d1=2>0,d2=detA=(2)(2)(1)(1)=3>0,d_1 = 2 > 0, \qquad d_2 = \det A = (2)(2) - (1)(1) = 3 > 0 ,

and elimination gives pivots 22 and 32\tfrac{3}{2}, both positive. The eigenvectors are q1=12(1,1)q_1 = \tfrac{1}{\sqrt2}(1,1) for λ=3\lambda = 3 and q2=12(1,1)q_2 = \tfrac{1}{\sqrt2}(1,-1) for λ=1\lambda = 1, orthogonal as promised, so

A=3q1q1+1q2q2,f(x)=3y12+y22,A = 3\, q_1 q_1^\top + 1\, q_2 q_2^\top , \qquad f(x) = 3 y_1^2 + y_2^2 ,

a bowl steeper along (1,1)(1,1) than along (1,1)(1,-1). Contrast this with

B=[0110],λ=0±0+42={+1, 1},B = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, \qquad \lambda = \frac{0 \pm \sqrt{0 + 4}}{2} = \{\, +1,\ -1 \,\} ,

whose eigenvalues have opposite signs. Here d2=detB=1<0d_2 = \det B = -1 < 0 already fails Sylvester's test, and f(x)=2x1x2f(x) = 2 x_1 x_2 is a saddle: positive on the diagonal x1=x2x_1 = x_2, negative on the anti-diagonal.

Why this matters

The forms that show up in simulation and estimation are symmetric by construction, so definiteness is the property that decides whether they behave. The joint-space mass matrix M(q)M(q) is symmetric positive definite because kinetic energy T=12q˙M(q)q˙T = \tfrac12\,\dot q^\top M(q)\,\dot q is positive for any nonzero motion, which is exactly what lets forward dynamics solve Mq¨=τM \ddot q = \tau by Cholesky. Any Gram matrix AAA^\top A is symmetric positive semidefinite, and positive definite precisely when AA has full column rank, which is what makes the normal equations of least squares solvable. And a critical point of a smooth function is a strict minimum exactly when its Hessian is positive definite: the same curvature test, one dimension at a time.

Footnotes

  1. Strang, Introduction to Linear Algebra (5th ed., 2016).

  2. Golub & Van Loan, Matrix Computations (4th ed., 2013).