Given $Y \in \mathbb S^n$, consider the following problem:
$$\begin{array}{ll} \text{minimize} & \|X - Y\|_F\\ \text{subject to} & X \succeq 0\end{array}$$
I already know the solution is $$X = \sum_i \max\{\lambda_i,0\} u_i u_i^T$$ where $Y = \sum_i \lambda_i u_i u_i^T$ is the eigenvalue decomposition. But I have no idea to prove it. I am already familiar with the SVD decomposition. Can anyone give a simple proof?
Let $Y=ULU^T$ be the eigendecomposition of $Y$. Since the Frobenius norm is unitarily invariant,
$$ \|Y-X\|_F = \|U^T(Y-X)U\|_F = \|U^TYU-U^TXU\|_F = \|L-X'\|_F. $$
The result should follow easily.