401 lines
12 KiB
Plaintext

---
title: "Stereography, Algebraic, and Hyperspheres"
description: |
TODO
format:
html:
html-math-method: katex
jupyter: python3
date: "2026-09-11"
categories:
- algebra
---
```{python}
#| echo: false
import sympy
from IPython.display import Markdown
from tabulate import tabulate
x, x1, z = sympy.symbols("x x_1 z")
```
The Algebra Part
----------------
Though I alluded to the ability of the stereoscopic circle to generate the Chebyshev polynomials,
there is an important caveat which differs their use from typical spheres.
To review, the stereoscopic definition of the circle is:
$$
\begin{align*}
o_1(t) &= {1 + it \over 1 - it}
\\
&= c_1 + i s_1
= {1 - t^2 \over 1 + t^2} + i{2t \over 1 + t^2}
\end{align*}
$$
The second line decomposes the first into real and nonreal terms, which are each rational functions.
We can further define terms for the numerator and denominator:
$$
\begin{gather*}
x_1 = 1 - t^2
\qquad
y_1 = 2t
\qquad
d = 1 + t^2 = 2 - x_1
\\
o_1 = {z_1 \over d} = {x_1 \over d} + i{y_1 \over d}
\end{gather*}
$$
We have a recurrence relation for *o*, but it does not obey same relations as *z*:
$$
\begin{align*}
o_{n+2} &= 2c_1 o_{n+1} - o_n
\\
z_{n+2} &\stackrel{✗}{=} 2x_1 z_{n+1} - z_n
\end{align*}
$$
Fortunately, the correction is simple.
The denominator term $d^{n+2}$ can be multiplied through the top equation to produce:
$$
z_{n+2} = 2x_1 z_{n+1} - z_n d^2
$$
The only term that changes is the term lagging two terms behind, so the generating function *Z* is:
$$
\begin{align*}
O(x; o_1)
&= {1 + x(o_1 - 2 c_1) \over 1 - 2 c_1 x + x^2}
\\[10pt]
Z(x; z_1)
&= {1 + x(z_1 - 2 x_1) \over 1 - 2 x_1 x + \textcolor{red}{d^2} x^2}
\end{align*}
$$
We can express *d* in terms of $x_1$, so the terms of the series, like the one for *F*, have
- A real component which is a polynomial in $x_1$ (cf. $c_1$)
- An imaginary component which is the product of $y_1$ (cf. $s_1$) and a polynomial in $x_1$
$$
Z(x; z_1) = X(x; x_1) + i y_1 Y(x; x_1)
$$
Surprisingly, the polynomials in *Y* still factor cleanly,
like the [Chebyshev *U* polynomials](../../chebyshev/1/#tbl-chebyshevu).
```{python}
#| code-fold: true
#| label: tbl-newupolynomials
#| tbl-cap: "Table of numerator polynomials"
#| classes: plain
# cosine series
X = ( 1 - x1*x ) / ( 1 - 2*x1*x + (2 - x1)**2*x**2 )
# sine series
Y = x / ( 1 - 2*x1*x + (2 - x1)**2*x**2 )
def factor_sequence(polys, offset=0, symbol_name="p"):
ret = []
symbols = []
for i, poly in enumerate(polys):
new_poly = poly.copy()
old_factor = 1
for old, symbol in zip(ret, symbols):
q, r = sympy.div(new_poly, old)
if r == 0:
new_poly = q
old_factor *= symbol
if new_poly != 1:
ret.append(new_poly)
symbols.append(sympy.symbols(f"{symbol_name}_{i + offset}"))
yield poly, old_factor*new_poly.factor()
Markdown(tabulate(
[
[ n+1, "$" + sympy.latex(poly) + "$", sympy.Poly(unfactored, z).as_list() ]
for n, (unfactored, poly) in enumerate(
factor_sequence(
sorted(
[
i.subs(x,1).subs(x1, z).expand().factor()
for i in Y.series(x, n=11).args
][:-1],
key=lambda x: sympy.degree(x, z)
),
1
)
)
],
headers=[ "*n*", "$[x^n]Y(x; z) = p_n(z)$", "Coefficients (descending powers)" ],
numalign="left",
stralign="left",
))
```
Unfortunately, the sequence formed by the coefficients of the polynomials
does not appear in the OEIS.
Their factorizations appear to have the following traits:
- Like the Chebyshev *U* polynomials, they have "cyclotomic factoring" --
for the new term of index *n*, the factors can be separated into old factors
at indices of factors of *n* and new factors.
- If the index is even, then there is only one new monic, irreducible factor.
- If the index is odd, then there are two new irreducible factors
- If the index is prime or a prime power, the new factors are a monic and a non-monic
whose leading coefficient is that prime.
- Otherwise, the new factors are both monic.
The characterization of the leading terms of the new factor corresponds to
[OEIS A014963](https://oeis.org/A014963), which is related to cyclotomic polynomials.
### Similar Sequences
In fact, for a polynomial $q(z)$, it seems to be the case that the terms of
$$
Y(x; z) = {x \over 1 - 2 z x + q(z) x^2}
$$
tend to factor similarly.
Naturally, the *U* polynomials are the choice where *q = 1* and the new polynomials
are the choice when $q = (2 - z)^2$.
One can also write down a series for $z^n - 1$, which factor as the cyclotomic polynomials,
and also end up being generated by an order-2 recurrence.
$$
\begin{align*}
N(x; z) &= \sum_n (z^n - 1)x^n = {x(z - 1) \over 1 - (z + 1)x + zx^2}
\\
&= \sum_n \left ( x^n \prod_{d | n} \Phi_d(z) \right )
\end{align*}
$$
Actually, this shouldn't be terribly surprising.
For example, a simple result from generating functions tells us
that a series for the integers is:
$$
\begin{align*}
F(z) &= {1 \over 1 - z}
= \sum_n z^n
&& \text{All coefficients equal 1}
\\
F'(z) &= {1 \over ( 1 - z )^2 }
= \sum_n n z^{n - 1}
&& \text{Integers}
\\
z F'(z) &= {z \over 1 - 2z + z^2}
= \sum_n n z^n
&& \text{Integers matching powers}
\end{align*}
$$
The denominator being a quadratic polynomial means that the series terms *n*,
the integers, obey an order-2 recurrence, and factor in a similar way.
Obviously, the integers factor into primes by the fundamental theorem of arithmetic.
There's still an important distinction to be made about the polynomials, though.
Factoring a composite like 6 into 2 and 3 leaves an empty product behind, but
for polynomials, nonprime indices end up accumulate an "extra" factor.
Additionally (or rather, probably because of this), *all* factors of the index correspond
to a factor in the factorization, rather than pairing off as in integers.
For example, factoring 12 once gives either 3 and 4 or 2 and 6,
but the polynomial at index 12 includes polynomials at indices of all factors: 2, 3, 4, 6, and 12.
### Higher-order Recurrences
The integers also obey an order-3 recurrence:
$$
\begin{align*}
F(x) &= {x \over 1 - 2x + x^2} = {x(1 - x) \over (1 - 2x + x^2)(1 - x)}
\\
&= {x - x^2 \over 1 - 3x + 3x^2 - x^3}
\\[10pt]
&\equiv a_{n+3} = 3a_{n+2} - 3a_{n+1} + a_n
\end{align*}
$$
Another sequence that obeys similar factoring rules rules to the integers is
$$
G(x; z) = {x - x^2 \over 1 - z x + z x^2 - x^3}
$$
```{python}
#| code-fold: true
#| tbl-cap: "Table of G polynomials"
#| classes: plain
G = (x - x**2) / ( 1 - z*x + z*x**2 - x**3 )
Markdown(tabulate(
[
[ n+1, "$" + sympy.latex(poly) + "$", sympy.Poly(unfactored, z).as_list() ]
for n, (unfactored, poly) in enumerate(
factor_sequence(
sorted(
[
i.subs(x,1).subs(x1, z).expand().factor()
for i in G.series(x, n=11).args
][:-1],
key=lambda x: sympy.degree(x, z)
),
1,
"o"
)
)
],
headers=[ "*n*", "$[x^n]G(x; z) = o_n(z)$", "Coefficients (descending powers)" ],
numalign="left",
stralign="left",
))
```
There are a couple of things to note here.
Some of the factor polynomials here are the
[minimal polynomials of cosine](/posts/math/chebyshev/1/#tbl-cosinepolynomials)
The row where *n* = 5 is somewhat interesting.
Namely, $x^2 - x - 1$ has $\varphi$ (the golden ratio) as a root.
The other polynomial, $x^2 - 3x + 1$, has $\varphi^2$ as a root.
This seems to indicate that the other polynomial has roots which are
an algebraic expression of the other's, but I haven't bothered attempting a proof of this.
Unfortunately, peppering polynomials into the denominator and hoping that the same factorization
occurs isn't as easy as in the order-2 recurrence.
In fact, higher-order recurrences become more and more restrictive as $x^\bullet$ terms are added to
the numerator and denominator.
If there is a rule to determine what relation must be obeyed between the coefficients
for factorization to occur, it is not obvious, especially as the order grows.
Higher-dimensional Spheres
--------------------------
We derived an explicit map for the 2-sphere (or rather, the 3-sphere, since the description ended up matching the quaternions)
in [the first post in this series](../1/).
It's quite easy to generalize the argument to higher dimensions.
In *n* dimensions, assume that we have unit vectors $e_0 ... e_{n-1}$.
Placing these vectors within a [geometric algebra](https://en.wikipedia.org/wiki/Geometric_algebra)
gives some promising properties:
- Vectors can be multiplied like ordinary numbers, and even added to ordinary numbers
- The product of a vector with itself can be chosen among -1, 0, or 1
- The product of two vectors anticommutes (e.g., $e_0 e_1 = - e_1 e_0$)
- Consequently, the square of a product is the negative of the product of the squares (e.g., $e_0 e_1 e_0 e_1 = - e_0 e_1 e_1 e_0 = - e_0^2 e_1^2$)
The square of a general vector with components $x_k e_k$ is a scalar, its norm.
$$
\begin{align*}
{\bm v} &= e_0 x_0 + e_1 x_1 + ... e_{n-1} x_{n-1} = \sum_k e_k x_k
\\
{\bm v}^2 &= (\sum_k^{n-1} e_k x_k) (\sum_l^{n-1} e_l x_l)
= \sum_k^{n-1} \sum_l^{n-1} e_k e_l x_k x_l
\\
&= \underset{\diagdown}{\sum_k^{n-1} e_k^2 x_k^2}
+ \underset{◥}{ \sum_k^{n-1} \sum_{l > k} e_k e_l x_k x_l }
+ \underset{◣}{ \sum_k^{n-1} \sum_{l < k} e_k e_l x_k x_l }
\\
&= \diagdown + ◥
+ \sum_k^{n-1} \sum_{l > k} e_l e_k x_k x_l
= \diagdown + ◥
- \sum_k^{n-1} \sum_{l > k} e_k e_l x_k x_l
\\
&= \diagdown + ◥ - ◥
= \diagdown
\end{align*}
$$
For simplicity, assume that $e_k^2 = -1$ so that ${\bm v}^2 = - ||{\bm v}||$,
the sum of squares of the extent in each basis.
Despite multiplication between two vectors being defined, dividing one vector by another is not.
Ignoring this, consider the expression
$$
\begin{align*}
{1 + {\bm v} \over 1 - {\bm v}}
&= \left( {1 + {\bm v} \over 1 - {\bm v}} \right)
\left( {1 + {\bm v} \over 1 + {\bm v}} \right)
= {(1 + {\bm v})^2 \over (1 - {\bm v})(1 + {\bm v})}
\\
&= {1 + 2{\bm v} + {\bm v}^2 \over 1 - {\bm v}^2}
\\
&= {1 - ||{\bm v}|| \over 1 + ||{\bm v}||} + {2{\bm v} \over 1 + ||{\bm v}||}
\end{align*}
$$
Similarly to quaternions, this is the sum of a vector and a scalar.
If the scalar component is considered the extent in a new dimension,
then the norm of the resulting vector is
$$
a^2 + ||u|| = a^2 - u^2 = (a + u)(a - u)
$$
This is actually an inductive hypothesis.
This forces us to choose two things: the norm we use is Euclidean, and each new unit vector squares to -1.
For the sphere, focusing just on the numerator
$$
(1 - ||v||)^2 - u^2 = (1 - ||v||)^2 - (2v)^2 = 1 - 2||v|| + ||v||^2 - 4v^2 = 1 - 2||v|| + ||v||^2 + 4||v|| = 1 + 2||v|| + ||v||^2 = (1 + ||v||)^2
$$
This is the denominator, so the dubious step of dividing by a vector has been backed up with pure algebra.
### Degree Maps
If $\bm u$ is a vector with norm 1.
The first coordinate expresses the condition that if **v** lies on the unit (hyper)sphere
in the dimension below, then the coordinate is zero, and such points lie on an equator.
In the case of the 2-sphere, doubling the map by squaring quaternions produces a more interesting feature:
all **v** lying on the unit (hyper)sphere in the dimension below get mapped to the same point, antipodal to 0.
In other words, the sphere in the next dimension is obtained by considering all points on the boundary of a ball to be the same.
$$
{ D^n / \partial D^n } = S^n
$$
This applies generally.
This can be made more topological by doubling the sphere, but we don't know how to do that generally,
A classical homotopy result informs
$$
\pi_n(S^n) = \Z
$$
Telling us we can wrap an *n* sphere around itself, backwards and forwards any number of times.
It's annoying to do this explicitly without a generic way to describe higher dimensional spheres.
The relation seems to be:
$$
_n o_m = \left( T_m(o_{1,0}), o_{1,[1:n]}U(o_{1,0}) \right)
$$
Just like in the circle. This is extraordinarily convenient.