Suppose that $A$ is an $n \times n$ real symmetric indefinite matrix, ${\rm rank}(A) = k$ and $k \leq n$.
If the $LDL^{T}$ decomposition of $A$ exists, we denote it as $A=LDL^{T}$, where $L$ is a lower unit triangular matrix and $D$ is a diagonal matrix.
I have two questions about it:
(1) What is the necessity and sufficiency of "the $LDL^{T}$ decomposition of $A$ exists"?
(2) What is the necessity and sufficiency of "the $LDL^{T}$ decomposition of $A$ is unique"?
I read the wiki and some books but I can't find the answer. I have an example as follows:
\begin{align}
A_1 &=
\begin{bmatrix}
1 & 0 & 3 \\
0 & 0 & 3 \\
3 & 3 & 3 \\
\end{bmatrix} {\rm\ is\ invertible\ and\ has\ no\ } LDL^{T} {\rm\ decomposition},\\
A_2 &=
\begin{bmatrix}
1 & 1 & 3 \\
1 & 1 & 3 \\
3 & 3 & 3 \\
\end{bmatrix} =
\begin{bmatrix}
1 & 0 & 0 \\
1 & 1 & 0 \\
3 & 3 & 1 \\
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & -6 \\
\end{bmatrix}
\begin{bmatrix}
1 & 1 & 3 \\
0 & 1 & 3 \\
0 & 0 & 1 \\
\end{bmatrix}{\rm\ is\ singular}, \\
A_3 &=
\begin{bmatrix}
0 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1 \\
\end{bmatrix} {\rm\ is\ singular\ and\ has\ no\ } LDL^{T} {\rm\ decomposition}.\\
\end{align}