Volume I, Chapter 1 — Part V. Equivalent characterizations of positive definite and semidefinite matrices, Cholesky decomposition, convexity via the Hessian, covariance geometry, Schur complements, and regularization theory.
A symmetric matrix A defines a quadratic formq(x)=xTAx — a generalization of the squared norm ∥x∥2=xTIx. When A≻0 (positive definite), this form behaves like a true "squared length" in a curved geometry: it is always positive except at the origin, defines ellipsoidal level sets, and supports taking square roots (Cholesky).
PSD matrices appear wherever we need valid geometries for uncertainty (covariance), convex optimization landscapes (Hessians), or valid similarity measures (kernels). Adding λI to a PSD matrix makes it PD — the mathematical basis for Ridge regularization.
Series context. This completes Chapter 1 (Linear Algebra) of Volume I. Next: Gradient Descent in Chapter 2 (Calculus & Optimization).
Interactive: Positive Definite Matrices
✓ Positive Definite (all eigenvalues > 0)
λ₁
2.309
λ₂
1.191
det
2.750
Symmetric matrix [a, b; b, d]:
Observe: PD matrices have elliptical level sets of x^TAx = c. The ellipse axes align with eigenvectors (dashed yellow). Make b large to see the ellipse tilt. If a eigenvalue goes negative, level sets become hyperbolas — the matrix is indefinite.
Definitions and Quadratic Forms
Definition 1 (Quadratic Form). For symmetric A∈Rn×n, the function q:Rn→R given by
q(x)=xTAx=i,j∑Aijxixj(1)
is a quadratic form.
Definition 2 (Positive Definite).A is positive definite, written A≻0, if
xTAx>0∀x=0.(2)
Definition 3 (Positive Semidefinite).A is positive semidefinite, written A⪰0, if
xTAx≥0∀x.(3)
Definition 4 (Negative Definite / Indefinite).A≺0 if −A≻0. A is indefinite if it is neither PSD nor NSD — i.e., it has both positive and negative eigenvalues.
Example 1.In≻0 since xTIx=∥x∥2>0 for x=0.
Example 2.A=[1111] is PSD but not PD: xTAx=(x1+x2)2≥0, with equality for x=(1,−1)T.
Equivalent Characterizations
Theorem 1.For symmetric A∈Rn×n, the following are equivalent:
A≻0
All eigenvalues satisfy λi>0
All leading principal minors are positive (Sylvester's criterion)
There exists invertible lower triangular L with A=LLT (Cholesky)
A is invertible and A−1≻0
Proof of (1) ⇔ (2). By the spectral theorem, A=QΛQT with Q orthogonal. Let y=QTx:
xTAx=yTΛy=i=1∑nλiyi2.(4)
This is positive for all y=0 iff all λi>0. ■
Proof of (2) ⇒ (4). Constructive Cholesky (Section below) produces L with positive diagonal when all leading minors are positive. ■
Proof of (4) ⇒ (1). If A=LLT with L invertible, then for x=0: xTAx=∥LTx∥2>0. ■
Proof of (1) ⇔ (5). If A≻0, eigenvalues of A−1 are 1/λi>0, so A−1≻0. Conversely, if A−1≻0, then A=(A−1)−1≻0. ■
Important equation. Equation (4) diagonalizes the quadratic form in the eigenbasis. Level sets {x:xTAx=c} are ellipsoids with axis lengths 1/λi.
Theorem 2 (PSD characterizations).For symmetric A, the following are equivalent:
A⪰0
All eigenvalues satisfy λi≥0
A=BTB for some B (existence of square root)
The Cholesky Decomposition
Theorem 3 (Cholesky).Every PD matrix A∈Rn×n admits a unique factorization A=LLT where L is lower triangular with positive diagonal entries.
Constructive algorithm (2×2 case). Let A=[abbc] with a>0 and ac−b2>0. Seek L=[l11l210l22]:
LLT=[l112l11l21l11l21l212+l222].(5)
Matching entries:
l11=a,l21=ab,l22=c−ab2=aac−b2>0.(6)
Positivity of l22 requires ac>b2 — the PD condition via Sylvester.
Complexity.O(n3/3) — half the cost of general LU or inversion.
Application: Gaussian sampling. If ϵ∼N(0,I), then x=μ+Lϵ∼N(μ,LLT). This reparameterization enables gradient-based learning of covariance structure in variational inference.
The PSD Cone and Partial Order
Definition 5. The set S+n={A∈Rn×n:A=AT,A⪰0} is a convex cone.
Proposition 1.If A⪰0 and B⪰0, then for any α,β≥0:
αA+βB⪰0.(8)
Proof.xT(αA+βB)x=αxTAx+βxTBx≥0. ■
We write A⪰B iff A−B⪰0. This defines a partial order on symmetric matrices (Loewner order).
Proposition 2.If A⪰0 and λ>0, then A+λI≻0.
This is the mathematical basis for regularization: perturbing a PSD matrix by a positive multiple of the identity makes it PD.
Connection to Convexity
Theorem 4 (Second-order convexity condition).A twice-differentiable function f:Rn→R is convex if and only if
∇2f(x)⪰0∀x.(9)
Proof (⇒). Convexity implies f(y)≥f(x)+∇f(x)T(y−x). Applying to y=x+tv and taking the second derivative at t=0 gives vT∇2f(x)v≥0.
Proof (⇐). Taylor's theorem: for some z on the segment between x and y,
f(y)=f(x)+∇f(x)T(y−x)+21(y−x)T∇2f(z)(y−x).(10)
If ∇2f⪰0, the quadratic term is nonnegative, giving first-order convexity. ■
Corollary 4.At a local minimum x∗, ∇2f(x∗)⪰0. If ∇2f(x∗)≻0, the minimum is strict.
ML interpretation. Hessian eigenvalues are curvatures. Negative eigenvalues indicate saddle points. The condition number of the Hessian at a minimum governs local optimization difficulty — connecting to Eigenvalues & Eigenvectors and Gradient Descent.
Covariance Matrices and Uncertainty
Definition 6 (Covariance). For random vector x with mean μ:
Σ=E[(x−μ)(x−μ)T].(11)
Theorem 5.Every covariance matrix is PSD.
Proof. For any v∈Rn:
vTΣv=E[(vT(x−μ))2]≥0.■(12)
Interpretation.Σ is PSD but may be singular. rank(Σ)=r<n means the random vector lies in an r-dimensional affine subspace — there are n−r directions of zero variance.
Sample covariance. For data x1,…,xN:
Σ^=N−11i=1∑N(xi−xˉ)(xi−xˉ)T=N−11XTX(13)
(centered X). This is PSD by construction (Σ^=BTB with B=X/N−1).
Multivariate Gaussian.x∼N(μ,Σ) requires Σ≻0 for a valid density:
p(x)=(2π)n/2∣Σ∣1/21exp(−21(x−μ)TΣ−1(x−μ)).(14)
The quadratic form in the exponent uses Σ−1≻0 when Σ≻0.
Kernel Matrices and Mercer's Theorem
Definition 7 (Kernel). A function K:X×X→R is a valid kernel if for any finite set {x1,…,xN}, the Gram matrix Kij=K(xi,xj) is PSD.
Theorem 6 (Mercer's Theorem — statement).A continuous symmetric kernel on a compact domain is valid if and only if it admits an expansion
K(x,x′)=i=1∑∞λiϕi(x)ϕi(x′),λi≥0,(15)
where {ϕi} are orthonormal eigenfunctions.
Consequence. Valid kernels define inner products in feature spaces (possibly infinite-dimensional). Kernel ridge regression, SVMs, and Gaussian processes all require PSD Gram matrices.
Example 3 (RBF kernel).K(x,x′)=exp(−γ∥x−x′∥2) is PSD for all γ>0.
Regularization and Ridge Regression
Problem. Least squares with XTX singular or ill-conditioned.
Ridge solution:
w^Ridge=(XTX+λI)−1XTy.(16)
Theorem 7.If XTX⪰0 and λ>0, then XTX+λI≻0.
Proof. For v=0: vT(XTX+λI)v=vTXTXv+λ∥v∥2≥λ∥v∥2>0. ■
Bayesian interpretation. Ridge regression corresponds to MAP estimation with Gaussian prior w∼N(0,σp2I), developed in Bayesian Linear Regression.
Effect on spectrum. If XTX has eigenvalues μi, then the regularized matrix has eigenvalues μi+λ, improving condition number from μmax/μmin to (μmax+λ)/(μmin+λ).
The Schur Complement
Definition 8. For block matrix
M=[ABTBC],(17)
the Schur complement of block C is
M/C=A−BC−1BT.(18)
Theorem 8.If C≻0, then M≻0 if and only if M/C≻0.
Application: Conditional covariance. For joint Gaussian [xaxb]∼N(μ,Σ) with
Σ=[ΣaaΣbaΣabΣbb],(19)
the conditional distribution xa∣xb has covariance
Σa∣b=Σaa−ΣabΣbb−1Σba=Σ/Σbb.(20)
Theorem 9.Σa∣b⪯Σaa (conditioning reduces or preserves uncertainty).
Proof. By Theorem 8 applied to PSD Σ, the Schur complement is PSD. ■
The Schur complement also appears in the Woodbury matrix identity and Gaussian process predictive variance.
Common Pitfalls and Misconceptions
Pitfall 1: Checking only diagonal entries for PD. All diagonal entries positive is necessary but not sufficient (except for diagonal matrices). Use eigenvalues or Cholesky.
Pitfall 2: Confusing PSD with PD. Covariance matrices are often singular (PSD but not PD) when data lies in a lower-dimensional subspace.
Pitfall 3: Assuming Hessian PD at all critical points. Saddle points have indefinite Hessians (both positive and negative eigenvalues).
Pitfall 4: Using Cholesky on near-singular matrices. When A is nearly PSD, Cholesky may fail numerically. Add jitter: A+ϵI.
Pitfall 5: Treating kernel PD as optional. An invalid (non-PSD) Gram matrix breaks the interpretation as an inner product and can cause negative "variances" in GP predictions.
Research Perspective
The study of quadratic forms and definiteness connects to Hilbert's work on invariant theory and the development of convex analysis in the twentieth century. Loewner (1934) introduced the matrix partial order ⪰.
In machine learning, PD matrices underpin:
Gaussian processes (Rasmussen & Williams, 2006): kernel matrices must be PSD
Natural gradient (Amari, 1998): uses the Fisher information matrix (PSD)
Second-order optimization (Newton, L-BFGS): requires or approximates PD curvature
Diffusion models (Volume III): noise covariances and score matching Hessians
Recent work on sharpness and flat minima analyzes the Hessian spectrum at solutions, connecting PD geometry to generalization.
Next article:Gradient Descent → — Chapter 2: optimization from first-order Taylor expansions.
Exercises
Exercise 1. Determine whether A=[2335] is PD using (a) eigenvalues, (b) Sylvester's criterion, (c) Cholesky.
Exercise 2. Prove that if A≻0, then logdet(A)>−∞ and det(A)>0.
Exercise 3. Show that the function f(x)=21xTAx−bTx with A≻0 is strictly convex and find its unique minimizer.
Exercise 4 (Covariance). For x=(X1,X2)T with X2=X1+ϵ, ϵ⊥X1, compute Σ and show det(Σ)=0.
Exercise 5 (Ridge). If XTX has eigenvalues (100,10,0.1), compute eigenvalues of XTX+λI for λ=1 and compare condition numbers.
Exercise 6 (Schur complement). For Σ as in (19) with invertible Σbb, derive (20) by completing the square in the joint Gaussian density.
Exercise 7 (Conceptual). Explain why the reparameterization x=μ+Lϵ with ϵ∼N(0,I) requires LLT=Σ to be PD, not merely PSD, for a proper density over all of Rn.
Appendix: The Matrix Square Root
Definition 9 (Matrix Square Root). For PSD A⪰0, the unique PSD matrix A1/2 satisfying (A1/2)2=A is given by the spectral theorem:
A1/2=Qdiag(λ1,…,λn)QT.(A.1)
Theorem 10.If A=BTB, then A1/2 exists and can be computed via SVD of B.
Proof. From B=UΣVT, we have A=VΣ2VT, so A1/2=VΣVT. ■
Application: Whitening. Given data with covariance Σ, the transformation z=Σ−1/2(x−μ) produces unit-variance, uncorrelated coordinates. Whitening is a standard preprocessing step before algorithms sensitive to scale (e.g., k-means, some clustering methods).
Application: Distance in Mahalanobis metric. The quadratic form (x−μ)TΣ−1(x−μ) defines a distance that accounts for correlation structure — equivalent to Euclidean distance after whitening.