It can be shown that for real symmetric matrix $A$, there is an orthogonal matrix $Q$ such that $$Q^TAQ=Q^{-1}AQ=\Lambda,$$ where $\Lambda$ is the diagonal matrix whose entries are $A$'s eigenvalues.
My question arises while considering the "converse": if $Q^TAQ=\Lambda$ for real symmetric $A$, and $\Lambda$ again denotes the diagonal matrix of eigenvalues, can one claim that $Q$ is orthogonal?
I think it's not true at the first glance, since there are many choices that we can congruently transform $A$ to a diagonal matrix. But things may get subtle after confining $\Lambda$ to be a special matrix consisting of the eigenvalues of $A$.
I can derive $(QC)^TA(QC)=C^T\Lambda C$ for some matrix $C$, maybe we can choose some $C$ to yield a counterexample? Or we can actually prove it? Thank you!
For instance, $$\begin{pmatrix}0& \sqrt{\frac12}\\ \sqrt2&0\end{pmatrix}\begin{pmatrix}1&0\\0 &2\end{pmatrix}\begin{pmatrix}0& \sqrt2\\ \sqrt{\frac12}&0\end{pmatrix}=\begin{pmatrix}1& 0 \\ 0& 2\end{pmatrix}$$