Solution (source code)

= Solution

For a real <symmetric positive-definite matrix>, the <Cholesky decomposition> is $B=R^TR$, where $R$ is upper triangular with positive diagonal; equivalently $B=LL^T$ with $L=R^T$ lower triangular.

Existence can be proved by induction. Write $B=\begin{pmatrix}b&v^T\\v&C\end{pmatrix}$, where $b>0$. For a nonzero vector $z$, evaluate the quadratic form at $(-v^Tz/b,z)^T$ to obtain $z^T(C-vv^T/b)z>0$. The <Schur complement> is therefore positive definite. By induction it has factor $R_0^TR_0$, and
$$
R=\begin{pmatrix}\sqrt b&v^T/\sqrt b\\0&R_0\end{pmatrix}
$$
has $R^TR=B$. The one-dimensional starting case is the positive square root.

For uniqueness, if $R_1^TR_1=R_2^TR_2=B$, then $U=R_2R_1^{-1}$ is upper triangular and satisfies $U^TU=I$. Since $U^{-1}$ is upper triangular and equals $U^T$, which is lower triangular, $U$ is diagonal. Orthogonality makes its diagonal entries $\pm1$, and positivity of the diagonals of $R_1,R_2$ forces $+1$. Hence $U=I$ and \b[$\boxed{R_1=R_2}$].