Sylvester's criterion (source code)

= Sylvester's criterion
{c}
{title2=$\Delta_1,\ldots,\Delta_n>0$}
{wiki}

A <Hermitian matrix> $A$ is a <positive-definite matrix> exactly when its <leading principal minors>
$$
\Delta_k=\det A_{1:k,1:k},\qquad k=1,\ldots,n,
$$
are all positive. The <leading principal minor> uses the first $k$ rows and the first $k$ columns in the same ordering. For the two-by-two <Cholesky decomposition> example, $\Delta_1=4$ and $\Delta_2=4\cdot5-2^2=16$, so the criterion proves <positive definiteness> without calculating <eigenvalues>.

The successive <pivot elements> before taking <square roots> are $\Delta_k/\Delta_{k-1}$, with $\Delta_0=1$. Here they are $4$ and $16/4=4$. In general, a leading <triangular matrix> factor has <determinant> equal to the product of its diagonal entries, so
$$
\Delta_k=\prod_{j=1}^k\ell_{jj}^{\,2}.
$$
Conversely, positive <leading principal minors> make each successive <Schur complement> <pivot element> positive, allowing the <Cholesky decomposition> to be constructed. The identity $u^TAu=\|L^Tu\|_2^2$ then proves <positive definiteness>; for complex <matrices>, replace the <transposes> by <conjugate transposes>. This gives a short inductive proof of the criterion.

For $B=\begin{pmatrix}1&2\\2&1\end{pmatrix}$, the first minor is positive but $\det B=-3$. The second Cholesky radicand would be $1-2^2=-3$, and $v=(1,-1)^T$ directly gives $v^TBv=-2<0$. Thus positive diagonal entries are insufficient. Replacing “positive” by “nonnegative” in just the leading-minor test is also insufficient for <positive semidefiniteness>: $\operatorname{diag}(0,-1)$ has leading minors $0,0$, but its <quadratic form> is negative on $(0,1)^T$.