Let $A\in\mathbb{R}^{n\times n}$ and $B = UDV^T$ where $U\in\mathbb{R}^{n\times r}$, $V\in\mathbb{R}^{n\times r}, D\in\mathbb{R}^{r\times r}$ and $U^TU = V^TV = I_r$. Define two sets: $$S_1=\mathbb{R}^{r\times r}$$ $$S_2 = \{\text{All $r\times r$ diagonal matrices}\}\subset S_1$$ and $$D_1=\arg\min_{M\in S_1}\|UMV^T - A\|_F^2$$ $$D_2=\arg\min_{M\in S_2}\|UMV^T - A\|_F^2$$ where $\|\|_F$ is the Frobenius norm.
My questions are:
Is this identity true? \begin{align*} \|B-A\|_F^2&=\|B - UD_1V^T\|_F^2+\|UD_1V^T-A\|_F^2\\ &=\|B - UD_2V^T\|_F^2+\|UD_2V^T-A\|_F^2 \end{align*}
Can we express $\|UD_1V^T-A\|_F^2$ and $\|UD_2V^T-A\|_F^2$ explicitly as functions of $U,V,A$?