Projection of a Symmetric Matrix onto the space of Positive Semi-Definite Matrices

Consider the symmetric matrix $A\in\mathbb{R}^{n\times n}$ and the set C of all positive semi-definite matrices in $\mathbb{R}^{n\times n}$. Compute the projection of A onto C under the trace inner product $\left<A,B\right>:=Tr(A^TB)$.

My attempt: It is known that the set C is a convex set, so upon applying the projection theorem for convex sets, we know $$\left<(A-X^*),(X-X^*)\right>\geq0$$ where X$\in C$, and $X^*$ is such that $||A-X ||$ is minimum $\forall X\in C.$ Using the definition of the inner product, trace and the fact that $A=A^T$, $$Tr(AX)-Tr(AX^*)-Tr(X^{*T}X)+Tr(X^{*T}X^*)\geq0.$$ I could use a spectral decomposition of $A$ at this stage, but I don't know where to go next.

• Find an eigenvalue decomposition of $A$, nuke negative eigenvalues and reassamble. This is your $X^*$. – max_zorn Feb 28 '18 at 22:30