Let [math]\displaystyle{ \textbf{u}_k }[/math] and [math]\displaystyle{ \textbf{v}_k }[/math] denote column k of [math]\displaystyle{ \textbf{U} }[/math] and [math]\displaystyle{ \textbf{V} }[/math] respectively, We prove the theorem by expanding out the squared Frobenius norm and rearranging terms:
[math]\displaystyle{
\begin{align}
\| \textbf{X} - \textbf{U}\textbf{D}\textbf{V}^T \|^2_F & = tr((\textbf{X} - \textbf{U}\textbf{D}\textbf{V}^T)^T(\textbf{X} - \textbf{U}\textbf{D}\textbf{V}^T)) \\
& = -2tr(\textbf{V}\textbf{D}\textbf{U}^T\textbf{X}) + tr(\textbf{V}\textbf{D}\textbf{U}^T\textbf{U}\textbf{D}\textbf{V}^T) + \|\textbf{X}\|^2_F \\
& = \sum_{k=1}^K d_k^2 - 2tr(\textbf{V}\textbf{D}\textbf{U}^T\textbf{X}) + \|\textbf{X}\|^2_F \\
& = \sum_{k=1}^K d_k^2 - \sum_{k=1}^K d_k\textbf{u}_k^T\textbf{X}\textbf{v}_k + \|\textbf{X}\|^2_F
\end{align}
}[/math]
The above proof is the proof of Theorem 2.1 in Witten, Tibshirani and Hastie, 2009 <ref name="WTH2009"> </ref>