Corollary (spectral theorem for real symmetric and Hermitian matrices)

Let $A\in M_{n\times n}(\R)$ be symmetric (resp. $A\in M_{n\times n}(\C)$ be Hermitian). Then there exists $P\in O(n)$ (resp. $P\in U(n)$) such that $PAP\inv\in M_{n\times n}(\R)$ is diagonal.

Proof