TITLE: An elegant proof for a claim about orthogonal and positive-definite matrices
QUESTION [6 upvotes]: Let $P$ be a real $n \times n$ symmetric positive-semidefinite matrix.
Suppose that $\langle O,P \rangle = \langle I,P \rangle$ for some orthogonal matrix $O$. Here $\langle , \rangle$ is the Euclidean (Frobenius) inner product. The assumption is equivalent to $\text{tr}(O^TP)=\text{tr}(P)$.
Then $OP=P$ holds. Since we can replace $O$ with $O^T$ the claim is equivalent to the seemingly surprising assertion $\text{tr}(OP)=\text{tr}(P) \implies OP=P$.

I have a proof, and I wonder whether there are other shorter proofs.
  Is there a proof which does not require diagonalizing $P$?


Here is my proof: By orthogonally diagonalizing $P$, we can reduce to the case where $P=\Sigma$ is diagonal, with non-negative entries $\sigma_i$.
The assumption implies $\sum_i \sigma_i O_{ii}=\sum_i \sigma_i$ where the sums run over all the indices $i$ where $\sigma_i \neq 0$. Since $|O_{ii}| \le 1$ this forces $O_{ii}=1$ for all these $i$. A direct check then implies that $O\Sigma=\Sigma$:
Indeed, $O\Sigma=\Sigma$ is equivalent to $O_{ij}\sigma_j=\Sigma_{ij}$.
If  $\sigma_j=0$, then $\Sigma_{ij}=0$ so equality holds. If $\sigma_j \neq 0$, then $O_{jj}=1$ so equality holds for $i=j$. For $i \neq j$,  $\Sigma_{ij}=0$ (since $\Sigma$ is diagonal) and , and $O_{ij}=0$, since whenever $O_{jj}=1$, all the rest of the entries in the $j$-th column of $O$ are zero. (Since $O$ is orthogonal).

REPLY [2 votes]: Trace is invariant under cyclic permutations, so $$\mathrm{tr}(O^TP)=\mathrm{tr}(P^{1/2}O^TP^{1/2})=\langle OP^{1/2},P^{1/2}\rangle.$$
Letting $\|\cdot\|$ denote the Frobenius norm, one form of the Cauchy-Schwarz inequality says that
$$\langle O,P\rangle=\langle OP^{1/2},P^{1/2}\rangle\leq \|OP^{1/2}\|\cdot\|P^{1/2}\|=\mathrm{tr}(P)^{1/2}\mathrm{tr}(P)^{1/2}=\langle I,P\rangle$$
with equality only when
$$OP^{1/2}=P^{1/2}\frac{\|OP^{1/2}\|}{\|P^{1/2}\|}=P^{1/2}.$$
Multiplying on the right by $P^{1/2},$ this condition implies
$$OP=P.$$