Writing

Visualizing Movement in Higher Dimensions

How does one visualize rotations in higher dimensions? Evolution in our natural environments made it only necessary for us to navigate in a 3-D world. We don’t have the visual systems to necessarily visualize these spaces unless we can somehow reduce the problem into a more readily accessible form. Though a lot of what is said here might seem trivial at first, it’s useful being able to map between isomorphic representations to build good intuitions.

While fiddling around with some graphs a few days ago, it occurred to me that both the number of edges in a fully connected undirected graph and the number of possible rotation directions in \(N\)-dimensional space follow the same sequence (the triangle numbers).

Part I

First, it’s useful to introduce the triangle numbers. We can give both a recursive and an explicit form for this sequence. Here is a classic story that you probably already know.

In the 19th century, a young Gauss was able to produce the same explicit form in a Prussian schoolhouse, when the teacher had all the kids add from 1 to 100. This was one of the things that probably sucked about being in Prussia and being educated in the 19th century with lazy teachers. Take a look here:

\[ 1 + 2 + \dots + 100 \]

This wraps around. Pair the ends:

1+100= 101
2+99= 101
3+98= 101
50+51= 101

Since we have a pair of terms, we divide by two. The numerator naturally represents \(n\) of \((n+1)\) terms — the “101” in this case of Gauss. By adding the previous sequence to the current term we yield the next term. It is immediately obvious why this is the recursive formula for adding to an \(n\)th term.

\(n\) 012345678910
\(T_n\) 013610152128364555

A proof by induction reveals how this maps onto fully connected graphs.

Recursive form

\[ T_0 = 0, \qquad T_n = T_{n-1} + n \quad (n \ge 1) \]

Explicit form

\[ T_n = \frac{n(n+1)}{2} \]

Proof by induction

Claim: \(T_n = \frac{n(n+1)}{2}\). Base case, \(n = 0\): \(T_0 = 0 = \frac{0 \cdot 1}{2}\). Inductive hypothesis: \(T_k = \frac{k(k+1)}{2}\). Then

\[ \begin{aligned} T_{k+1} &= T_k + (k+1) \\ &= \frac{k(k+1)}{2} + (k+1) \\ &= \frac{k(k+1) + 2(k+1)}{2} \\ &= \frac{(k+1)(k+2)}{2} \\ &= \frac{(k+1)\bigl((k+1)+1\bigr)}{2}. \end{aligned} \]

Therefore \(T_n = \dfrac{n(n+1)}{2}\) for all \(n \ge 0\).

Complete undirected graphs

Let \(e_n = \lvert E(K_n)\rvert\).

\(K_1\)\(K_2\)\(K_3\)\(K_4\)\(K_5\)\(K_6\)
Vertices123456
Edges01361015
New012345

\(K_n \longrightarrow K_{n+1}\): the new vertex meets all \(n\) old ones, so \(e_{n+1} = e_n + n\). That is the same recurrence. Hence \(\lvert E(K_n)\rvert = \binom{n}{2} = \frac{n(n-1)}{2} = T_{n-1}\).

\(K_5\), ten edges. Each new vertex hangs one more edge than the last.

Visual correspondence: \(K_1 \xrightarrow{+1} K_2 \xrightarrow{+2} K_3 \xrightarrow{+3} K_4 \xrightarrow{+4} K_5\) gives edge counts \(0,1,3,6,10\), which are \(T_0\) through \(T_4\). Each added vertex contributes one more edge than the previous vertex. Hence the edge counts form the triangular-number sequence.

Part II

There was a video about Marvin Minsky from a while ago, where he brings up the Society of Mind idea. In two dimensions, we have two intersecting orthogonal lines which form axes. In three, we have three orthogonal intersections. For 4, 5, 6, … \(n\), we can hold the concept (not necessarily visualize with our primary visual cortex, unless drugs are involved) that there are \(n\) orthogonal intersections.

Marvin Minsky

We can even make sense of this space by dividing the \(n\)-dimensional axis of orthogonal intersections into subspaces of 3 dimensions, if that helps you at all.

When my friend Justin posed the problem — “how many possible rotations are in 6 dimensions?” — which requires us to make sense of a general formula for the number of rotations for each dimension, I immediately jumped to trying to think about this in terms of Minsky’s orthogonal lines.

Spoiler: this ends up following the triangle numbers.

If in one dimension we have zero degrees of rotation, since there are no pairs of axes to swing between, it follows that in two we have one degree of rotation. In three, we have three degrees of rotation: \(xy\), \(xz\), and \(yz\).

x y
2-D: one plane, \(xy\)
x y z
3-D: \(xy\), \(xz\), \(yz\)
x y z w
4-D: \(w\) meets \(x,y,z\)

For the fourth dimension, imagine there is another axis orthogonally penetrating through the center from another direction. That axis can swing unto each of the existing three dimensions (also corresponding to the current \(n-1\)). Do you see how this takes the form of

\[ \binom{n}{2} = \frac{n(n-1)}{2} = T_{n-1} \]

In 6 dimensions we have \(\binom{6}{2} = 15\) different possible rotations — one for each pair of axes, the edges of \(K_6\).

\(y\)\(z\)\(w\)\(v\)\(u\)
\(x\)\(xy\)\(xz\)\(xw\)\(xv\)\(xu\)
\(y\)\(yz\)\(yw\)\(yv\)\(yu\)
\(z\)\(zw\)\(zv\)\(zu\)
\(w\)\(wv\)\(wu\)
\(v\)\(vu\)

Part III

Now for the real mental trick: draw a fully connected graph. Here are some examples for 2, 3, 4, 5, 6 dimensions. Label each vertex with its corresponding direction.

Edges are colored by the vertex that introduced them. The second slider isolates one generation: the \(k\) new edges that appear when the \(k\)-th axis arrives. That is the recurrence \(T_{n} = T_{n-1} + n\), drawn.

\[ T_0 = 0, \qquad T_n = T_{n-1} + n \quad (n \ge 1) \]

We can express a rotation between two particular dimensions by tracing between two vertices. If we simultaneously trace between several vertices (more than two), then we express rotation in the direction of those.

Vectors and matrices make this intuitive.

\([x,\, y]\) allows us to express the vector location \((x, y)\) in space from the origin. Rotation matrices then perform the matrix operation that transforms these values. A rotation in the plane of two axes \(i,j\) is the identity except in that \(2\times 2\) block:

\[ R_{ij}(\theta)\;=\; \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \quad\text{in the }(i,j)\text{ plane, }1\text{ elsewhere.} \]

At a right angle, \(\theta = \pi/2\), the sines and cosines collapse to \(0\) and \(1\). Those are the matrices below — one generator for each rotation plane, across a few dimensions.

2-D, \(xy\)
\[ \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \]
3-D, \(xy\)
\[ \begin{pmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix} \]
3-D, \(xz\)
\[ \begin{pmatrix} 0 & 0 & -1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{pmatrix} \]
3-D, \(yz\)
\[ \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{pmatrix} \]
4-D, \(xy\)
\[ \begin{pmatrix} 0 & -1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \]
4-D, \(xw\)
\[ \begin{pmatrix} 0 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \end{pmatrix} \]
4-D, \(zw\)
\[ \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0 \end{pmatrix} \]
6-D, \(xu\)
\[ \begin{pmatrix} 0 & 0 & 0 & 0 & 0 & -1 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 \end{pmatrix} \]

Each such matrix is a \(90^\circ\) turn in one of the planes listed above. The rest of the space sits still. That is the whole correspondence: an edge of \(K_n\), a pair of axes, a Givens rotation, a triangle number.