Maximal compact subgroups of $GL_n(\mathbb{R})$. The subgroup $O_n=\{M\in GL_n(\mathbb{R}) | ^tM M = I_n\}$ is closed in $GL_n(\mathbb{R})$ because it's the inverse image of the closed set $\{I_n\}$ by the continuous map $X\mapsto ^tX X$. $O_n$ is also bounded in $GL_n(\mathbb{R})$, for example this is clear by considering the norm $||X|| = \sqrt{tr(^tX X)}$ (elements of $O_n$ are bounded by $\sqrt{n}$), so $O_n$ should be a compact subgroup of $GL_n(\mathbb{R})$. 
I see it claimed without proof in many places that $O_n$ is a maximal compact subgroup. How can we see this?

Let $G \subset GL_n(\mathbb{R})$ be a compact group containing $O(n)$ and let $M \in G$. Using polar decomposition, $$M=OS \ \text{for some} \ O \in O(n), \ S \in S_n^{++}(\mathbb{R}).$$
Since $O(n) \subset G$, we deduce that $S \in G$. 
Because $G$ is compact, $(S^n)$ has a convergent subsequence; $S$ being diagonalizable, it is possible if and only if the eigenvalues of $S$ are $\leq 1$. The same thing works for $S^{-1}$, so $1$ is the only eigenvalue of $S$, ie. $S=I_n$ hence $M=O \in O(n)$.
Consequently, $G= O(n)$.
