Positive Definite Matrix Checker
Test whether a real matrix is positive definite using Sylvester's Criterion (symmetry check and leading principal minors \(\Delta_k > 0\)).
What is a Positive Definite Matrix?
A real symmetric matrix \(A\) is positive definite if its corresponding quadratic form is strictly positive for any non-zero vector \(x\):
\(x^T A x > 0 \quad \forall x \neq \mathbf{0}\)
\(\Delta_k = \det(A_{1:k, 1:k}) > 0 \quad \text{for } k = 1, 2, \dots, n\)
All leading principal minors (top-left submatrices) must have strictly positive determinants.Why Positive Definite Matrices are Crucial
- Convex Optimization: In machine learning, a quadratic loss function \(f(x) = \frac{1}{2} x^T A x - b^T x\) has a unique global minimum if and only if the Hessian matrix \(A\) is positive definite.
- Covariance in Statistics: Valid covariance matrices for random variables with non-zero variance are strictly positive definite.
- Cholesky Decomposition: Only positive definite matrices allow efficient \(A = L L^T\) factorization, speeding up linear solvers and Gaussian processes.
Solved Examples: Positive Definite vs. Indefinite
Test if \(A = \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}\) is positive definite:
Step 1: Check symmetry: \(A = A^T\) ✓
Step 2: Check leading principal minors:
- \(\Delta_1 = \det\begin{bmatrix} 2 \end{bmatrix} = 2 > 0\) ✓
- \(\Delta_2 = \det\begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix} = (2)(2) - (-1)(-1) = 4 - 1 = 3 > 0\) ✓
Both minors are strictly positive.
Verdict: YES — Matrix is positive definite.
Test if \(B = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix}\) is positive definite:
Step 1: Check symmetry: \(B = B^T\) ✓
Step 2: Check leading principal minors:
- \(\Delta_1 = 1 > 0\) ✓
- \(\Delta_2 = (1)(1) - (2)(2) = 1 - 4 = -3 \le 0\) ✗
The second principal minor is negative. The quadratic form creates a saddle surface rather than an energy bowl.
Verdict: NO — Matrix is indefinite and not positive definite.
Machine Learning & AI Applications
Discover why positive definite covariance and Hessian matrices form the backbone of modern machine learning algorithms.
Read our student tutorial: Why Positive Definite Matrices Matter in ML →