I am wondering if the orthogonal group $O\_n({\bf Q})$ is dense in $O\_n({\bf R})$?


It is easily checked for $n = 2$ but I think that there is a general principle concerning compact algebraic groups underneath.



Is $O_n({\bf Q})$ dense in $O_n({\bf R})$?
There's an easy argument based on the Cayley transform: If $a$ is a skew-symmetric $n$-by-$n$ real matrix, then $I\_n+a$ is invertible (since $(I\_n-a)(I\_n+a)=I\_n-a^2$ is a positive definite symmetric matrix and hence invertible), and
$$
A = (I\_n-a)(I\_n+a)^{-1}
$$
is orthgonal (i.e., $AA^T = I\_n$). Note that $(I\_n+A)(I\_n+a) = 2I\_n$, so $I\_n+A$ is invertible. Conversely, if $A$ is an orthogonal $n$-by-$n$ matrix such that $I\_n+A$ is invertible, one can solve the above equation uniquely in the form
$$
a = (I\_n+A)^{-1}(I\_n-A) = -a^T.
$$
This establishes a rational 'parametrization' (known as the Cayley transform) of $\mathrm{SO}\_n(\mathbb{R})$. Plainly, $a$ has rational entries if and only if $A$ has rational entries.


The density of $\mathrm{O}\_n(\mathbb{Q})$ in $\mathrm{O}\_n(\mathbb{R})$ follows immediately.


