Let $O(n)$ denote the group of orthogonal matrices under multiplication. We want to show that this is set is compact.
To show $O(n)$ is compact, we can use Heine-Borel and show that it is closed and bounded. I think I proved the boundedness of $O(n)$, so that's not a problem for now. To prove that it is closed, I saw a proof in where writing (for an orthogonal matrix denoted as $U=(u_{ij})_{i,j=1}^{n}$):
$\displaystyle\sum_{i=1}^{n}u_{ij}u_{ik}=\begin{cases} 1 &\mbox{if } j = k\\ 0 &\mbox{if } j \neq k \end{cases}$
Which can be done as $U^{T}U=I$, so it follows that $O(n)$ is a closed subset of $M(n,n,\mathbb{R})$ (set of $n \times n$ matrices in $\mathbb{R}$). However, how would the result above (rewriting $U^{T}U=I$) imply that the set is closed? I'm not sure if I get the main idea.
Thanks for the help.
The map $X \mapsto X^tX$ is a continuous function from the space of all $n \times n$ matrices to itself. Therefore the inverse image of the closed set $\{I\}$ is closed.