Is there a continuous function $f:[0,+\infty) \to \operatorname{SO}(n)$ whose image is dense in $\operatorname{SO}(n)$ and that is well behaved in certain ways?


* For each $\varepsilon>0$ it doesn't take longer than necessary, or not much, to come within distance $\varepsilon$ of every point.
* It is not too hard to compute. One can write software for it without being a genius.



Grand tour of the special orthogonal group
[**EDIT:** Dan Asimov notified me that this construction is similar to a construction in his 1985 paper entitled "The Grand Tour: a Tool for Viewing Multidimensional Data". The construction in the 1985 paper is somewhat more elegant than this one, avoiding the use of the exponential map and the sine function.]


We'll describe such a function $f$ as the composition of three continuous maps:


* $h : [0, +\infty) \rightarrow [-1,1]^{\binom{n}{2}}$;
* $g : [-1,1]^{\binom{n}{2}} \rightarrow \mathcal{A}$;
* $j : \mathcal{A} \rightarrow SO(n)$;


where $\mathcal{A}$ is the space of antisymmetric matrices with entries in $[-1, 1]$.


Each of these three maps, and thus their composition $f$, is not only continuous but is in fact *Lipschitz*-continuous (unlike a spacefilling curve).


In reverse order:


* $j(A) := \exp((\pi \sqrt{n}) A)$, where $\exp$ is the matrix exponential;
* $g^{-1}(A)$ is the vector $v$ obtained by 'flattening' the entries in the upper triangle of $A$ into a vector of $\binom{n}{2}$ elements, and $g$ is the inverse of the function $g^{-1}$ just described;
* $h(t) := (\sin(c\_1 t), \sin(c\_2 t), \dots, \sin(c\_{\binom{n}{2}} t))$, where $c\_1, c\_2, \dots, c\_{\binom{n}{2}}$ are a set of $\binom{n}{2}$ irrationals that are linearly independent over $\mathbb{Q}$.


The image of $h$ is dense in the hypercube as mentioned here:


<https://en.wikipedia.org/wiki/Linear_flow_on_the_torus>


and, because $g$ is a homeomorphism, it follows that $g(h(t))$ is dense in $\mathcal{A}$. As such, it remains to show that $j$ is surjective onto $SO(n)$; that would establish that $f(t) = j(g(h(t)))$ is dense in $SO(n)$.




---


**Claim**: Every matrix $R \in SO(n)$ is expressible as the matrix exponential of an antisymmetric matrix $A$ with Hilbert-Schmidt norm $\operatorname{tr}(A^T A) \leq \pi^2 n$.


**Proof**: By an orthogonal change of basis, we can assume that the matrix $R$ is block-diagonal, consisting of $1 \times 1$ blocks of the form:


$$ \begin{pmatrix} 1 \end{pmatrix} $$


and $2 \times 2$ blocks of the form:


$$ \begin{pmatrix} \cos{\theta} & \sin{\theta} \\ -\sin{\theta} & \cos{\theta} \end{pmatrix} $$


where $\theta \in [-\pi, \pi]$. As such, $R$ is the matrix exponential of a block-diagonal antisymmetric matrix with blocks of the form:


$$ \begin{pmatrix} 0 \end{pmatrix} $$


and:


$$ \begin{pmatrix} 0 & \theta \\ -\theta & 0 \end{pmatrix} $$


The result follows.


**Corollary**: Every orthogonal matrix is the matrix exponential of an antisymmetric matrix with entries in $[-\pi \sqrt{n}, \pi \sqrt{n}]$. As such, $j$ is indeed surjective onto $SO(n)$.


