Closest matrix with respect to the matrix norm As we know, any square matrix $A$ on a real vector space has a polar decomposition $A=UP$ where $U$ is orthogonal and $P$ is a symmetric and positive-semidefinite. I am trying to show that the closest orthogonal matrix to $A$ with respect to the matrix norm is in fact the orthogonal matrix $U$ from the polar decomposition. The matrix norm of a real matrix $C$ is defined as $$||C||:=\sqrt{\text{tr}(C^TC) }.$$
Let $S$ be an orthogonal matrix, then $$||A-S||=\sqrt{\text{tr}((A-S)^T(A-S)) }=\sqrt{\text{tr}((UP-S)^T(UP-S)) }=\sqrt{\text{tr}((P^TU^T-S^T)(UP-S)) }=\sqrt{\text{tr}((P^TU^TUP-S^TUP-P^TU^TS+S^TS) }$$ 
Since $U$ and $S$ are orthogonal, $U^TU=S^TS_I$ and since $P$ is symmetric, $P^T=P$ so $$||A-S||=\sqrt{\text{tr}(P^2)+\text{tr}(I)-\text{tr}(S^TUP)-\text{tr}(S^TUP)^T}$$Then using that $\text{tr}(M^T)=\text{tr}(M)$ for any matrix $M$, I simplify this down to $$||A-S||=\sqrt{\text{tr}(P^2)+\text{tr}(I)-2\text{tr}(S^TUP)}$$ This is where I get stuck. Of course picking $S=U$ will given me a nice expression for the norm: $$||A-S||=\sqrt{\text{tr}((P-I)^2)}$$ but how is this this minimum and how is this the unique minimum?
 A: You have reduced it to showing that $\mathrm{tr}(S^TUP)\leq \mathrm{tr}(P)$, with equality if and only if $S=U$.  The "only if" part isn't true if $A$ is not invertible.   
Because $P$ is symmetric and positive semidefinite, it has an orthonormal basis $\{v_i\}_{i=1}^n$ of eigenvectors with respective nonnegative eigenalues $\lambda_i$.  The trace of a matrix can be calculated as $\mathrm{tr}(B) =\sum\limits_{i=1}^n \langle Bv_i,v_i\rangle$, so 
$$\mathrm{tr}(S^TUP)=\sum_{i=1}^n\langle S^TUPv_i,v_i\rangle=\sum_{i=1}^n\langle S^TU\lambda_i v_i,v_i\rangle=\sum_{i=1}^n\lambda_i\langle S^TUv_i,v_i\rangle\leq \sum_{i=1}^n\lambda_i=\mathrm{tr}(P).$$
The inequality follows from the Cauchy Schwarz inequality.  The only way equality can hold for a particular $i$ is if $\lambda_i=0$ or $\langle S^TUv_i,v_i\rangle=1$.  So if $\lambda_i\neq 0$ you would have the equality case in Cauchy-Schwarz, and it would imply $S^TUv_i$ is a norm one multiple of $v_i$, and because the inner product is positive this leaves $S^TUv_i=v_i$. Hence $S^T$ agrees with $U^T$ on the image under $U$ of the span of the eigenvectors for the nonzero eigenvalues of $P$.  If $A$ (hence $P$) is not invertible, then $S^T$ can do other things off of this image.
If $A$ is invertible, then the equality case implies $S^T=U^T$, so $S=U$. If $A$ is not invertible, the equality case implies that $A=SP$, i.e., that $S$ could be the orthogonal matrix in "the" polar decomposition.  (To get uniqueness for the polar representation, you can instead take $U$ to be a partial isometry with image equal to that of $A$.)
