Lecture 5 — Definite Matrices (Positive Definite & Semidefinite)

Lecture 5 — Definite Matrices

Positive definite, positive semidefinite, properties, tests, examples & ML applications

1. Definitions

Let \(A\) be a real symmetric \(n \times n\) matrix (symmetry is important for the usual definiteness notions).

2. Key properties (symmetric matrices)

3. Quick tests you can use

  1. Eigenvalue test: compute eigenvalues and check signs. This is the most direct and reliable test.
  2. Sylvester's criterion: check leading principal minors (fast for small matrices).
  3. Cholesky factorization: try to compute it; if it succeeds (no negative square root), matrix is PD.

4. Worked examples

Example A (2×2 positive definite)

\[ A = \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}, \quad x = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \] \[ x^\top A x = \begin{bmatrix} x_1 & x_2 \end{bmatrix} \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = 2x_1^2 - 2x_1x_2 + 2x_2^2 = 2(x_1^2 - x_1x_2 + x_2^2) > 0 \quad (x \neq 0) \] Eigenvalues: \(\lambda_1 = 1,\; \lambda_2 = 3\) → \(A\) is PD.

Example B (PSD but not PD)

\[ A = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \] Eigenvalues: \(\lambda_1 = 0,\; \lambda_2 = 2\) → PSD (but not PD, since one eigenvalue is 0).

Example C (Indefinite)

\[ A = \begin{bmatrix} 1 & 2 \\ 2 & -1 \end{bmatrix} \] Eigenvalues: \(\lambda_1 \approx 2.236,\; \lambda_2 \approx -2.236\) → Indefinite.

5. Applications in Machine Learning


6. Interactive checker

Enter a square matrix (rows with semicolons, entries with spaces). Example: 2 -1; -1 2