If $A$ is a symmetric matrix in $\mathbb{R}$, why is $PAP^t$ diagonal? In Linear Algebra Why is following correct:
Given a symmetric matrix $A$ on the field of the real numbers, why is that true that there exists an unitary matrix $P$ such that $PAP^t$ is a diagonal matrix?
I know that from the Spectral Theorem there exists a unitary matrix $P$ such that $PAP^{-1}$ is diagonal. However how can I conclude that $PAP^t$ is diagonal as well?
Thank you 

This is a straightforward consequence of the spectral theorem. Let $u_1=p_1+iq_1,\ \ldots,\ u_n=p_n+iq_n$ be an orthonormal eigenbasis of $A$, where $u_1,\ldots,u_{k_1}$ correspond to the eigenvalues $\lambda_1$. Since $\lambda_1$ is real, we have $Ap_\ell=\lambda_1p_\ell$ and $Aq_\ell=\lambda_1q_\ell$ for $\ell=1,2,\ldots,k_1$. Hence every vector in $\mathcal{B}=\{p_1,\ldots,p_{k_1},q_1,\ldots,q_{k_1}\}$ is either zero or an eigenvector of $A$ corresponding to the eigenvalue $\lambda_1$. Hence the span of $\mathcal{B}$ is precisely the eigenspace of $A$ corresponding to the eigenvalue $\lambda_1$. However, as all vectors in the set $\mathcal{B}$ are real, we can choose from its real span $k_1$ orthonormal eigenvectors. The similar holds for other eigenvalues. Put these orthonormal eigenvectors together, we obtain a real orthogonal matrix $S$ such that $AS=SD$, i.e. $S^TAS=D$.
