revisions and images to chebyshev.1

This commit is contained in:
queue-miscreant 2025-06-19 01:48:15 -05:00
parent 9e9bacd069
commit 14fcad9af7
4 changed files with 531 additions and 227 deletions

View File

@ -4,5 +4,6 @@ listing:
contents: contents:
- posts/polycount/index.* - posts/polycount/index.*
- posts/pentagons/index.* - posts/pentagons/index.*
- posts/misc/*/index.*
sort: "date desc" sort: "date desc"
--- ---

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

View File

@ -1,70 +1,88 @@
--- ---
title: "Generating Polynomials, Part 1: Regular Constructibility"
description: |
format: format:
html: html:
html-math-method: katex html-math-method: katex
date: "2021-08-18"
date-modified: "2025-06-17"
categories:
- geometry
- algebra
--- ---
<style> <style>
.red { .figure-img {
color: red; max-width: 512px;
} object-fit: contain;
height: 100%;
.orange {
color: orange;
}
.yellow {
color: yellow;
}
.aqua {
color: aqua;
}
.green {
color: green;
}
.cyan {
color: cyan;
}
.blue {
color: blue;
}
.purple {
color: purple;
} }
</style> </style>
```{python}
#| echo: false
Generating Polynomials, Part 1: Regular Constructibility from math import comb
========================================================
[Recently](), I used coordinate-free geometry to derive the volumes of the Platonic solids, a problem which was very accessible to the ancient Greeks. On the other hand, they found certain problems regarding which figures can be constructed via compass and straightedge to be very difficult. For example, they struggled with problems like [doubling the cube](https://en.wikipedia.org/wiki/Doubling_the_cube) or [squaring the circle](https://en.wikipedia.org/wiki/Squaring_the_circle), which are known (through circa 19th century mathematics) to be impossible . However, before extending geometry with a third dimension or including the areas of circles in geometry, a simpler problem becomes apparent; namely, what kinds of regular polygons are constructible? from IPython.display import Markdown
from tabulate import tabulate
import sympy
from sympy.abc import z
```
[Recently](/posts/misc/platonic-volume), I used coordinate-free geometry to derive
the volumes of the Platonic solids, a problem which was very accessible to the ancient Greeks.
On the other hand, they found certain problems regarding which figures can be constructed via
compass and straightedge to be very difficult. For example, they struggled with problems
like [doubling the cube](https://en.wikipedia.org/wiki/Doubling_the_cube)
or [squaring the circle](https://en.wikipedia.org/wiki/Squaring_the_circle),
which are known (through circa 19th century mathematics) to be impossible.
However, before even extending planar geometry by a third dimension or
calculating the areas of circles, a simpler problem becomes apparent.
Namely, what kinds of regular polygons are constructible?
Regular Geometry and a Complex Series Regular Geometry and a Complex Series
------------------------------------- -------------------------------------
When constructing a regular polygon, one wants ratios relating a side, an inradius, and the circumradius. If one of these measurements is declared to be a unit, then only a single ratio is needed, since the other is available through the Pythagorean theorem. This is best exemplified by the following figure When constructing a regular polygon, one wants a ratio between the length of a edge
and the distance from a vertex to the center of the figure.
![]() ![
Regular triangle, square, and pentagons inscribed in a unit circle.
Note the right triangle formed by the apothem, half of an edge, and circumradius.
](./central_angle_figures.png)
In a convex polygon, the total central angle is always one full turn, or $2\pi$ radians. The central angle of a regular *n*-gon is ${2\pi \over n}$ radians, and the green angle above is half of it. This means that the ratio of half of the side and circumradius is $\sin(\pi / n)$ radians. But how can this quantity be derived? In a convex polygon, the total central angle is always one full turn, or 2π radians.
The central angle of a regular *n*-gon is ${2\pi \over n}$ radians,
and the green angle above (which we'll call *θ*) is half of that.
This means that the ratio we're looking for is $\sin(\theta) = \sin(\pi / n)$.
We can multiply by *n* inside the function on both sides to give
$\sin(n\theta) = \sin(\pi) = 0$.
Therefore, constructing a polygon is actually equivalent to solving this equation,
and we can rephrase the question as how to express $\sin(n\theta)$ (and $\cos(n\theta)$).
Let's turn this question on its head. Let $\theta = \pi / n$, meaning $n\theta = \pi$. Applying sine over this gives $\sin(n\theta) = \sin(\pi) = 0$. Therefore, constructing a polygon is equivalent to solving this equation. It then becomes a question of how to express $\sin(n\theta)$ (and $\cos(n\theta)$).
Thanks to [Euler's formula](https://en.wikipedia.org/wiki/Euler%27s_formula) and [de Moivre's formula](https://en.wikipedia.org/wiki/De_Moivre%27s_formula), this can be phrased in terms of the complex exponential. ### Complex Recursion
Thanks to [Euler's formula](https://en.wikipedia.org/wiki/Euler%27s_formula)
and [de Moivre's formula](https://en.wikipedia.org/wiki/De_Moivre%27s_formula),
the expressions we're looking for can be phrased in terms of the complex exponential.
$$ $$
\begin{align*} \begin{align*}
e^{i\theta} &= \text{cis}(\theta) = \cos(\theta) + i\sin(\theta) e^{i\theta}
& \text{ Euler's formula} \\ &= \text{cis}(\theta) = \cos(\theta) + i\sin(\theta)
\text{cis}(n \theta) = e^{i(n\theta)} &= e^{(i\theta)n} = {(e^{i\theta})}^n = \text{cis}(\theta)^n \\ & \text{ Euler's formula}
\cos(n \theta) + i\sin(n \theta) &= (\cos(\theta) + i\sin(\theta))^n \\
& \text{ de Moivre's formula} \text{cis}(n \theta) = e^{i(n\theta)}
&= e^{(i\theta)n} = {(e^{i\theta})}^n = \text{cis}(\theta)^n
\\
\cos(n \theta) + i\sin(n \theta)
&= (\cos(\theta) + i\sin(\theta))^n
& \text{ de Moivre's formula}
\end{align*} \end{align*}
$$ $$
@ -72,11 +90,16 @@ De Moivre's formula for $n = 2$ gives
$$ $$
\begin{align*} \begin{align*}
\text{cis}(\theta)^2 &= (\text{c} + i\text{s})^2 \\ \text{cis}(\theta)^2
&= \text{c}^2 + 2i\text{cs} - \text{s}^2 + (0 = \text{c}^2 + \text{s}^2 - 1) \\ &= (\text{c} + i\text{s})^2
&= 2\text{c}^2 + 2i\text{cs} - 1 \\ \\
&= 2\text{c}(\text{c} + i\text{s}) - 1 \\ &= \text{c}^2 + 2i\text{cs} - \text{s}^2 + (0 = \text{c}^2 + \text{s}^2 - 1)
&= 2\cos(\theta)\text{cis}(\theta) - 1 \\ \\
&= 2\text{c}^2 + 2i\text{cs} - 1
\\
&= 2\text{c}(\text{c} + i\text{s}) - 1
\\
&= 2\cos(\theta)\text{cis}(\theta) - 1
\end{align*} \end{align*}
$$ $$
@ -84,177 +107,288 @@ This can easily be massaged into a recurrence relation.
$$ $$
\begin{align*} \begin{align*}
\text{cis}(\theta)^2 &= 2\cos(\theta)\text{cis}(\theta) - 1 \\ \text{cis}(\theta)^2
\text{cis}(\theta)^{n+2} &= 2\cos(\theta)\text{cis}(\theta)^{n+1} - \text{cis}(\theta)^n \\ &= 2\cos(\theta)\text{cis}(\theta) - 1
\text{cis}((n+2)\theta) &= 2\cos(\theta)\text{cis}((n+1)\theta) - \text{cis}(n\theta) \\ \\
\text{cis}(\theta)^{n+2}
&= 2\cos(\theta)\text{cis}(\theta)^{n+1} - \text{cis}(\theta)^n
\\
\text{cis}((n+2)\theta)
&= 2\cos(\theta)\text{cis}((n+1)\theta) - \text{cis}(n\theta)
\end{align*} \end{align*}
$$ $$
Through some fairly straightforward summatory manipulations, the sequence can be interpreted as the coefficients in a Taylor series, giving a [generating function](https://en.wikipedia.org/wiki/Generating_function). Recurrence relations like this one are powerful.
Through some fairly straightforward summatory manipulations,
the sequence can be interpreted as the coefficients in a Taylor series,
giving a [generating function](https://en.wikipedia.org/wiki/Generating_function).
Call this function *F*. Then,
$$ $$
\begin{align*} \begin{align*}
\sum_{n=0}^\infty \text{cis}((n+2)\theta)x^n \sum_{n=0}^\infty \text{cis}((n+2)\theta)x^n
&= 2\cos(\theta) \sum_{n=0}^\infty \text{cis}((n+1)\theta) x^n &= 2\cos(\theta) \sum_{n=0}^\infty \text{cis}((n+1)\theta) x^n
- \sum_{n=0}^\infty \text{cis}(n\theta) x^n \\ - \sum_{n=0}^\infty \text{cis}(n\theta) x^n
{F(x; \text{cis}(\theta)) - 1 - x\text{cis}(\theta) \over x^2} \\
&= 2\cos(\theta) {F(x; \text{cis}(\theta)) - 1 \over x} {F(x; \text{cis}(\theta)) - 1 - x\text{cis}(\theta) \over x^2}
- F(x; \text{cis}(\theta)) \\ \\ &= 2\cos(\theta) {F(x; \text{cis}(\theta)) - 1 \over x}
F - 1 - x\text{cis}(\theta) - F(x; \text{cis}(\theta))
&= 2\cos(\theta) x (F - 1) \\[10pt]
- x^2 F \\ F - 1 - x\text{cis}(\theta)
F - 2\cos(\theta) x F + x^2 F &= 2\cos(\theta) x (F - 1)
&= 1 + x(\text{cis}(\theta) - 2\cos(\theta)) \\ \\ - x^2 F
F(x; \text{cis}(\theta)) \\
&= {1 + x(\text{cis}(\theta) - 2\cos(\theta)) \over F - 2\cos(\theta) x F + x^2 F
1 - 2\cos(\theta)x + x^2} &= 1 + x(\text{cis}(\theta) - 2\cos(\theta))
\\[10pt]
F(x; \text{cis}(\theta))
&= {1 + x(\text{cis}(\theta) - 2\cos(\theta)) \over
1 - 2\cos(\theta)x + x^2}
\end{align*} \end{align*}
$$ $$
Even though the generating function *F* is parametrized by the complex exponential of $\theta$, separating the real and imaginary components reveals an expression in terms of $\cos(\theta)$. This is useful because the real and imaginary parts of *F* correspond to $\cos(n\theta)$ and $\sin(n\theta)$, respectively. Since $\text{cis}$ is a complex function, we can separate *F* into real and imaginary parts.
Conveniently, these correspond to $\cos(n\theta)$ and $\sin(n\theta)$, respectively.
$$ $$
\begin{align*} \begin{align*}
\Re[ F(x; \text{cis}(\theta)) ] &= {1 + x(\cos(\theta) - 2\cos(\theta)) \over \Re[ F(x; \text{cis}(\theta)) ]
1 - 2\cos(\theta)x + x^2} \\ &= {1 + x(\cos(\theta) - 2\cos(\theta)) \over 1 - 2\cos(\theta)x + x^2}
&= {1 - x\cos(\theta) \over 1 - 2\cos(\theta)x + x^2} = A(x; \cos(\theta)) \\ \\
\Im[ F(x; \text{cis}(\theta)) ] &= {1 - x\cos(\theta) \over 1 - 2\cos(\theta)x + x^2} = A(x; \cos(\theta))
&= {x \sin(\theta) \over 1 - 2\cos(\theta)x + x^2} = B(x; \cos(\theta))\sin(\theta) \\
\Im[ F(x; \text{cis}(\theta)) ]
&= {x \sin(\theta) \over 1 - 2\cos(\theta)x + x^2} = B(x; \cos(\theta))\sin(\theta)
\end{align*} \end{align*}
$$ $$
Extracting the coefficients of *x* in *A* and *B* yields an expression for $\cos(n\theta)$ and $\sin(n\theta)$ in terms of $\cos(\theta)$ (and in the latter case, a common factor of $\sin(\theta)$). If $\cos(\theta)$ in *A* and *B* is replaced with the parameter *z*, then all of the trigonometric functions are removed from the equation, and it becomes evident that this relationship is polynomial. This can actually be observed as early as the recurrence relation. In this form, it becomes obvious that the even though the generating function *F* was originally
parametrized by $\text{cis}(\theta)$, *A* and *B* are parametrized only by $\cos(\theta)$.
Extracting the coefficients of *x* yields an expression for $\cos(n\theta)$ and $\sin(n\theta)$
in terms of $\cos(\theta)$ (and in the latter case, a common factor of $\sin(\theta)$).
$$ If $\cos(\theta)$ in *A* and *B* is replaced with the parameter *z*, then all trigonometric functions
\begin{align*} are removed from the equation, and we are left with only polynomials[^1].
\text{cis}(\theta)^{n+2} &= 2\cos(\theta)\text{cis}(\theta)^{n+1} - \text{cis}(\theta)^n \\ These polynomials are [*Chebyshev polynomials*](https://en.wikipedia.org/wiki/Chebyshev_polynomial)
a_{n+2} &= 2 z a_{n+1} - a_n \\ *of the first (A) and second (B) kind*.
\Re[ a_0 ] &= 1,~~ \Im[ a_0 ] = 0 \\ In actuality, the polynomials of the second kind are typically offset by 1
\Re[ a_1 ] &= z,~~ \Im[ a_1 ] = 1 \cdot \sin(\theta) (the x in the numerator of *B* is omitted).
\end{align*} However, retaining this term makes indexing consistent between *A* and *B*
$$ (and will make things clearer later).
In other words, *A* starts off with $1, z, ...$, and *B* starts off with $0, 1, ...$. These polynomials are [*Chebyshev polynomials*](https://en.wikipedia.org/wiki/Chebyshev_polynomial) *of the first (A) and second (B) kind*. Actually, the polynomials of the second kind are typically not offset (the x in the numerator of *B* is omitted). However, this form makes explicit which polygon (remember? we were working with those) we are considering, and will be important later. For future reference, the first few polynomials of the second kind (at $z / 2$) are: [^1]:
This can actually be observed as early as the recurrence relation.
| n | $[x^n]B(x; z / 2) = U_{n -\ 1}(z / 2)$ | Factored | $$
|----|-----------------------------------------|---------------------------------------------------| \begin{align*}
| 0 | 0 | 0 | \text{cis}(\theta)^{n+2}
| 1 | 1 | 1 | &= 2\cos(\theta)\text{cis}(\theta)^{n+1} - \text{cis}(\theta)^n
| 2 | $z$ | $z$ | \\
| 3 | $z^2 -\ 1$ | $(z -\ 1)(z + 1)$ | a_{n+2}
| 4 | $z^3 -\ 2z$ | $z(z^2 -\ 2)$ | &= 2 z a_{n+1} - a_n
| 5 | $z^4 -\ 3z^2 + 1$ | $(z^2 -\ z -\ 1)(z^2 + z -\ 1)$ | \\
| 6 | $z^5 -\ 4 z^3 + 3z$ | $z(z^2 -\ 1)(z^2 -\ 3)$ | \Re[ a_0 ]
| 7 | $z^6 -\ 5 z^4 + 6 z^2 -\ 1$ | $(z^3 -\ z^2 -\ 2 z + 1)(z^3 + z^2 -\ 2 z -\ 1)$ | &= 1,~~ \Im[ a_0 ] = 0
| 8 | $z^7 -\ 6 z^5 + 10 z^3 -\ 4 z$ | $z(z^2 -\ 2)(z^4 -\ 4 z^2 + 2)$ | \\
| 9 | $z^8 -\ 7 z^6 + 15 z^4 -\ 10 z^2 + 1$ | $(z^2 -\ 1)(z^3 -\ 3 z -\ 1)(z^3 -\ 3 z + 1)$ | \Re[ a_1 ]
| 10 | $z^9 -\ 8 z^7 + 21 z^5 -\ 20 z^3 + 5 z$ | $z(z^2 -\ z -\ 1)(z^2 + z -\ 1)(z^4 -\ 5z^2 + 5)$ | &= z,~~ \Im[ a_1 ] = 1 \cdot \sin(\theta)
\end{align*}
$$
[OEIS A049310](http://oeis.org/A049310)
Evaluating the polynomials at $z / 2$ cancels the 2 in the denominator (and recurrence), making these expressions much simpler. This evaluation can also be interpreted intuitively by studying the the previous diagram. Since the side length was bisected by the inradius, the side length in terms of a unit circumradius is $2\sin ({\pi / n} )$. To compensate for this doubling, the Chebyshev polynomial must be evaluated at half its normal argument. We were primarily interested in $\sin(n\theta)$, so let's tabulate
the first few polynomials of the second kind (at $z / 2$).
```{python}
#| echo: false
#| label: tbl-chebyshevu
#| tbl-cap: "[OEIS A049310](http://oeis.org/A049310)"
#| classes: plain
Markdown(tabulate(
[
[
n,
"$" + sympy.latex(poly) + "$",
"$" + sympy.latex(sympy.factor(poly)) + "$",
]
for n in range(0, 11)
for poly in [sympy.chebyshevu_poly(n - 1, z / 2) if n > 0 else sympy.sympify(0)]
],
headers=[
"n",
"$[x^n]B(x; z / 2) = U_{n - 1}(z / 2)$",
"Factored",
],
numalign="left",
stralign="left",
))
```
Evaluating the polynomials at $z / 2$ cancels the 2 in the denominator (and recurrence),
making these expressions much simpler.
This evaluation can also be interpreted intuitively by recalling from the previous diagram
we used *half* the length of a side.
For a unit circumradius, the side length itself is then $2\sin( {\pi / n} )$.
To compensate for this doubling, the Chebyshev polynomial must be evaluated at half its normal argument.
### Back on the Plane ### Back on the Plane
The constructibility criterion is deeply connected to the Chebyshev polynomials. In compass and straightedge constructions, one only has access to linear forms (lines) and quadratic forms (circles). This means that a figure is constructible if and only if the root can be achieved through normal arithmetic (which is linear) and square roots (which are quadratic). The constructibility criterion is deeply connected to the Chebyshev polynomials.
In compass and straightedge constructions, one only has access to linear forms (lines)
and quadratic forms (circles).
This means that a figure is constructible if and only if the root can be expressed using
normal arithmetic (which is linear) and square roots (which are quadratic).
Let's look at a regular pentagon. The relevant polynomial is
#### Pentagons
Let's look at a regular pentagon.
The relevant polynomial is
$$ $$
[x^5]B \left( x; {z \over 2} \right) [x^5]B ( x; z / 2 )
= z^4 - 3z^2 + 1 = z^4 - 3z^2 + 1
= (z^2 - z - 1) (z^2 + z - 1) = (z^2 - z - 1) (z^2 + z - 1)
$$ $$
As a reminder, when $z = 2\cos( \pi / 5 )$, the polynomial evaluates to 0. Also, either factor is the other evaluated at -*z*. Thus, one of the factors in terms is the minimal polynomial of $2\cos(\pi / 5 )$. The former is correct, since $2\cos( \pi / 5 ) = \phi$, the golden ratio. According to how we derived this series, when $z = 2\cos(\theta)$, the roots of this polynomial
correspond to when $\sin(5\theta) / \sin(\theta) = 0$.
This relation itself is true when for $\theta = \pi / 5$, since $\sin(5 \pi / 5) = 0$.
One of the factors in terms must therefore be the minimal polynomial of $2\cos(\pi / 5 )$.
The former happens to be correct correct, since $2\cos( \pi / 5 ) = \varphi$, the golden ratio.
Note that the second factor is the first evaluated at -*z*.
#### Heptagons
An example of where constructability fails is for $2\cos( \pi / 7 )$. An example of where constructability fails is for $2\cos( \pi / 7 )$.
$$ $$
\begin{align*} \begin{align*}
[x^7]B \left( x; {z \over 2} \right) [x^7]B ( x; z / 2 )
&= z^6 - 5 z^4 + 6 z^2 - 1 \\ &= z^6 - 5 z^4 + 6 z^2 - 1
&= ( z^3 - z^2 - 2 z + 1 ) (z^3 + z^2 - 2 z - 1 ) \\
&= ( z^3 - z^2 - 2 z + 1 ) ( z^3 + z^2 - 2 z - 1 )
\end{align*} \end{align*}
$$ $$
Whichever is the minimal polynomial (the former), it is a cubic, and constructing a regular heptagon is equivalent to solving it for *z*. But there are no (nondegenerate) cubics that one can produce via compass and straightedge, and the construction fails. Whichever is the minimal polynomial (the former), it is a cubic, and constructing
a regular heptagon is equivalent to solving it for *z*.
But there are no (nondegenerate) cubics that one can produce via compass and straightedge,
and the construction fails.
#### Decagons
One might think the same of $2\cos(\pi /10 )$ One might think the same of $2\cos(\pi /10 )$
$$ $$
\begin{align*} \begin{align*}
[x^{10}]B \left( x; {z \over 2} \right) [x^{10}]B ( x; z / 2 )
&= z^9 - 8 z^7 + 21 z^5 - 20 z^3 + 5 z \\ &= z^9 - 8 z^7 + 21 z^5 - 20 z^3 + 5 z
&= z ( z^2 - z - 1 )( z^2 + z - 1 )( z^4 - 5 z^2 + 5 ) \\
&= z ( z^2 - z - 1 )( z^2 + z - 1 )( z^4 - 5 z^2 + 5 )
\end{align*} \end{align*}
$$ $$
This expression also contains the polynomials for $2\cos( \pi / 5 )$. This is because a regular decagon would contain two disjoint regular pentagons, produced by connecting every other vertex. This expression also contains the polynomials for $2\cos( \pi / 5 )$.
This is because a regular decagon would contain two disjoint regular pentagons,
produced by connecting every other vertex.
![]() ![
&nbsp;
](./decagon_divisible.png)
The polynomial which actually corresponds to $2\cos( \pi / 10 )$ is the quartic, which seems to suggest that it will require a fourth root and somehow decagons will not be constructible. However, it can be solved by completing the square, and we can breathe a sigh of relief. The polynomial which actually corresponds to $2\cos( \pi / 10 )$ is the quartic,
which seems to suggest that it will require a fourth root and somehow decagons are not constructible.
However, it can be solved by completing the square...
$$ $$
\begin{align*} \begin{align*}
z^4 - 5z^2 &= -5 \\ z^4 - 5z^2 &= -5
z^4 - 5z^2 + (5/2)^2 &= -5 + (5/2)^2 \\ \\
( z^2 - 5/2)^2 &= {25 - 20 \over 4} \\ z^4 - 5z^2 + (5/2)^2 &= -5 + (5/2)^2
( z^2 - 5/2) &= {\sqrt 5 \over 2} \\ \\
z^2 &= {5 \over 2} + {\sqrt 5 \over 2} \\ ( z^2 - 5/2)^2 &= {25 - 20 \over 4}
z &= \sqrt{ {5 + \sqrt 5 \over 2} } \\
( z^2 - 5/2) &= {\sqrt 5 \over 2}
\\
z^2 &= {5 \over 2} + {\sqrt 5 \over 2}
\\
z &= \sqrt{ {5 + \sqrt 5 \over 2} }
\end{align*} \end{align*}
$$ $$
...and we can breathe a sigh of relief.
The Triangle behind Regular Polygons The Triangle behind Regular Polygons
------------------------------------ ------------------------------------
Preferring *z* to be halved in $B(x; z/2)$ makes something else more evident. Observe these four rows of the Chebyshev polynomials Preferring *z* to be halved in $B(x; z/2)$ makes something else more evident.
Observe these four rows of the Chebyshev polynomials
| n | $[x^n]B(x; z / 2)$ | k | *m* = 2*k* + 1 | *n* - *m* | $[z^{n -\ m}][x^n]B(x; z / 2)$ |
|----|-----------------------------|---|----------------|-----------|--------------------------------|
| 4 | $z^3 -\ 2z$ | 0 | 1 | 3 | 1 |
| 5 | $z^4 -\ 3z^2 + 1$ | 1 | 3 | 2 | -3 |
| 6 | $z^5 -\ 4 z^3 + 3z$ | 2 | 5 | 1 | 3 |
| 7 | $z^6 -\ 5 z^4 + 6 z^2 -\ 1$ | 3 | 7 | 0 | -1 |
The last column looks like an alternating row of Pascal's triangle, and can be expressed as ${n -\ k -\ 1 \choose k}(-1)^k$. This resemblance can be made more apparent by listing the coefficients of the polynomials in a table.
```{python} ```{python}
#| echo: false #| echo: false
#| classes: plain
from IPython.display import Markdown Markdown(tabulate(
from tabulate import tabulate [
from math import comb [
n,
"$" + sympy.latex(poly) + "$",
k,
int(poly.coeff(z, n - k)), # type: ignore
]
for n, k in zip(range(4, 8), range(3, -1, -1))
for poly in [sympy.chebyshevu_poly(n - 1, z / 2) if n > 0 else sympy.sympify(0)]
],
headers=[
"*n*",
"$[x^n]B(x; z / 2)$",
"*k*",
"$[z^{n - k}][x^n]B(x; z / 2)$",
],
numalign="left",
stralign="left",
))
```
rainbow = [ The last column looks like an alternating row of Pascal's triangle, and can be expressed
as ${n - k \choose k}(-1)^k$.
This resemblance can be made more apparent by listing the coefficients of the polynomials in a table.
```{python}
#| echo: false
#| classes: plain
rainbow_classes = [
"", "",
"red", "red",
"orange", "orange",
"yellow", "yellow",
"aqua",
"green", "green",
"cyan", "cyan",
"aqua",
"blue", "blue",
"purple" "purple"
"", "",
"", "",
] ]
entry = lambda x, color: f"<span class=\"{rainbow[color]}\">{x}</span>" rainbow_class = lambda x, color: f"<span style=\"color: {rainbow_classes[color]}\">{x}</span>"
Markdown(tabulate( Markdown(tabulate(
[ [
[ [
n, n,
*[" " for nm in range(1, 11 - n)], *[" " for _ in range(1, 11 - n)], # offset for terms of the polynomial
*[ *[
0 if k % 2 == 1 0 if k % 2 == 1
else entry( else rainbow_class(
comb(n - (k // 2) - 1, nm - (k // 2)) * (-1)**(k // 2), comb(n - (k // 2) - 1, nm - (k // 2)) * (-1)**(k // 2),
n - (k // 2) - 1, n - (k // 2) - 1,
) )
@ -274,155 +408,324 @@ Markdown(tabulate(
)) ))
``` ```
Though they alternate in sign, the rows of Pascal's triangle appear along diagonals, which I have marked in rainbow. Meanwhile, alternating versions of the naturals (1, 2, 3, 4...), the triangular numbers (1, 3, 6, 10...), the tetrahedral numbers (1, 4, 10, 20...), etc. are present along the columns, albeit spaced out by 0's. Though they alternate in sign, the rows of Pascal's triangle appear along diagonals,
which I have marked in rainbow.
Meanwhile, alternating versions of the naturals (1, 2, 3, 4...),
the triangular numbers (1, 3, 6, 10...),
the tetrahedral numbers (1, 4, 10, 20...), etc.
are present along the columns, albeit spaced out by 0's.
The relationship of the Chebyshev polynomials to the triangle is easier to see if the coefficient extraction of $B(x; z / 2)$ is reversed. The relationship of the Chebyshev polynomials to the triangle is easier to see if
the coefficient extraction of $B(x; z / 2)$ is reversed.
In other words, we extract *z* before extracting *x*.
$$ $$
\begin{align*} \begin{align*}
B(x; z / 2) &= {x \over 1 - zx + x^2} B(x; z / 2) &= {x \over 1 - zx + x^2}
= {x \over 1 + x^2 - zx} = {x \over 1 + x^2 - zx}
= {x \over 1 + x^2} \cdot = {x \over 1 + x^2}
{1 \over {1 + x^2 \over 1 + x^2} - z{x \over 1 + x^2}} \\ \cdot {1 \over {1 + x^2 \over 1 + x^2} - z{x \over 1 + x^2}}
[z^n]B(x; z / 2) &= {x \over 1 + x^2} [z^n] {1 \over 1 - z{x \over 1 + x^2}} \\[10pt]
= {x \over 1 + x^2} \left( {x \over 1 + x^2} \right)^n \\ [z^n]B(x; z / 2) &= {x \over 1 + x^2} [z^n] {1 \over 1 - z{x \over 1 + x^2}}
&= \left( {x \over 1 + x^2} \right)^{n+1} = {x \over 1 + x^2} \left( {x \over 1 + x^2} \right)^n
= x^{n+1} (1 + x^2)^{-n - 1} \\ \\
&= x^{n+1} \sum_{k=0}^\infty {-n - 1 \choose k}(x^2)^k &= \left( {x \over 1 + x^2} \right)^{n+1}
= x^{n+1} (1 + x^2)^{-n - 1}
\\
&= x^{n+1} \sum_{k=0}^\infty {-n - 1 \choose k}(x^2)^k
\end{align*} \end{align*}
$$ $$
While the use of the binomial theorem in $1 + x^2$ is more than enough to justify the appearance of Pascal's triangle (along with explaining the 0's), I will press onward until it becomes excruciatingly obvious. While the use of the binomial theorem in $1 + x^2$ is more than enough to justify
the appearance of Pascal's triangle (along with explaining the 0's),
I will press onward until it becomes excruciatingly obvious.
$$ $$
\begin{align*} \begin{align*}
{(-n - 1)_k} &= (-n - 1)(-n - 2) \cdots (-n - k) \\ {(-n - 1)_k} &= (-n - 1)(-n - 2) \cdots (-n - k)
&= (-1)^k (n + k)(n + k - 1) \cdots (n + 1) \\ \\
&= (-1)^k (n + k)_k \\ &= (-1)^k (n + k)(n + k - 1) \cdots (n + 1)
\implies {-n - 1 \choose k} \\
&= {n + k \choose k}(-1)^k \\ \\ &= (-1)^k (n + k)_k
[z^n]B(x; z / 2) &= x^{n+1} \sum_{k=0}^\infty {n + k \choose k} (-1)^k x^{2k} \\ \\
\implies {-n - 1 \choose k}
&= {n + k \choose k}(-1)^k
\\[10pt]
[z^n]B(x; z / 2)
&= x^{n+1} \sum_{k=0}^\infty {n + k \choose k} (-1)^k x^{2k}
\end{align*} \end{align*}
$$ $$
Squinting hard enough, the binomial coefficient is similar to the earlier which gave the third row of Pascal's triangle. If k is fixed, then this expression actually generates the antidiagonal entries of the coefficient table, which are the columns with uniform sign. The alternation instead occurs between antidiagonals (one is all positive, the next is 0's, the next is all negative, etc.). The initial $x^{n+1}$ lags these sequences so that they reproduce the triangle. Squinting hard enough, the binomial coefficient is similar to the earlier
which gave the third row of Pascal's triangle.
If k is fixed, then this expression actually generates the antidiagonal entries
of the coefficient table, which are the columns with uniform sign.
The alternation instead occurs between antidiagonals (one is all positive,
the next is 0's, the next is all negative, etc.).
The initial $x^{n+1}$ lags these sequences so that they reproduce the triangle.
### Imagined Transmutation ### Imagined Transmutation
The generating function of the Chebyshev polynomials resembles other two term recurrences. This resemblance can be made explicit with a simple algebraic manipulation. The generating function of the Chebyshev polynomials resembles other two term recurrences.
For example, the Fibonacci numbers have generating function
$$
\sum_{n = 0}^\infty \text{Fib}_n x^n = {1 \over 1 - x - x^2}
$$
This resemblance can be made explicit with a simple algebraic manipulation.
$$ $$
\begin{align*} \begin{align*}
B(ix; -iz / 2) &= {1 \over 1 -\ (-i z)(ix) + (ix)^2} B(ix; -iz / 2)
= {1 \over 1 -\ (-i^2) z x + (i^2)(x^2)} \\ &= {1 \over 1 -\ (-i z)(ix) + (ix)^2}
&= {1 \over 1 -\ z x -\ x^2} = {1 \over 1 -\ (-i^2) z x + (i^2)(x^2)}
\\
&= {1 \over 1 -\ z x -\ x^2}
\end{align*} \end{align*}
$$ $$
The poles of this expression are the reciprocals and additive inverses of the metallic means. For example, if $z = 1$, then the denominator is $1 -\ x -\ x^2$, which has $1 / \phi$ as a root. Equally well, it is also a generating function of the Fibonacci numbers. The same can be said for the silver ratio and Pell numbers, and so on for higher $z$. If $z = 1$, these two generating functions are equal.
The same can be said for $z = 2$ with the generating function of the Pell numbers,
and so on for higher recurrences (corresponding to metallic means) for higher integral *z*.
In terms of the Chebyshev polynomials, this removes the alternation in the coefficients of $U_n$, and restores Pascal's triangle to its nonalternating form. Related to the previous point, it is possible to find the Fibonacci numbers (Pell numbers, etc.) in Pascal's triangle, which you can read more about [here](http://users.dimi.uniud.it/~giacomo.dellariccia/Glossary/Pascal/Koshy2011.pdf). In terms of the Chebyshev polynomials, this series manipulation removes the alternation in
the coefficients of $U_n$, restoring Pascal's triangle to its nonalternating form.
Related to the previous point, it is possible to find the Fibonacci numbers (Pell numbers, etc.)
in Pascal's triangle, which you can read more about
[here](http://users.dimi.uniud.it/~giacomo.dellariccia/Glossary/Pascal/Koshy2011.pdf).
Manipulating the Series Manipulating the Series
----------------------- -----------------------
Look back to the table of $U_{n - 1}(z / 2)$ (@tbl-chebyshevu).
When I brought up $U_{10 - 1}(z / 2)$ and decagons, I pointed out their relationship to pentagons
as an explanation for why $U_{5 -\ 1}(z / 2)$ appears as a factor.
Conveniently, $U_{2 -\ 1}(z / 2) = z$ is also a factor, and 2 is likewise a factor of 10.
This pattern is present throughout the table; $n = 6$ contains factors for
$n = 2 \text{ and } 3$ and the prime numbers have no smaller factors.
If this observation is legitimate, call the new term $f_n(z)$
and denote $p_n(z) = U_{n -\ 1}( z / 2 )$.
### Total Degrees ### Total Degrees
Look back to the table of $U_{n -\ 1}(z / 2)$. When I brought up decagons, I pointed out their relationship to pentagons as an explanation for why $U_{5 -\ 1}(z / 2)$ appears as a factor. Conveniently, $U_{2 -\ 1}(z / 2)$ is also a factor, and 10 is an even number. This pattern is present throughout the table; $n = 6$ contains factors for $n = 2 \text{ and } 3$ and the prime numbers have no smaller factors. If this observation is legitimate, call the factor polynomials $f_n(z)$ and denote $p_n(z) = U_{n -\ 1}( z / 2 )$. It can be observed that the new term is symmetric ($f(z) = f(-z)$), and is therefore
either irreducible or the product of another polynomial and its reflection (potentially negated).
For example,
It can also be observed that a factor is either symmetric ($g(z) = g(-z)$), or is the product of another polynomial and its reflection, potentially negated. For example, $p_9(z) = f_3(z) \cdot g_9(z) \cdot -g_9(-z)$, where $g_9(z) = z^3 -\ 3z -\ 1$. These reflections are necessary for $n = 3, 5, 7, 9$, strongly implying that it occurs on the odd terms. $$
\begin{align*}
p_9(z) &= f_3(z) \cdot g_9(z) \cdot -g_9(-z)
\\
& \text{where } g_9(z) = z^3 -\ 3z -\ 1
\end{align*}
$$
In other words, if $f_n$ is the new polynomial introduced by $p_n$ of, then denote its conditional factorization $g_n$. These reflections can be observed in the Chebyshev polynomials for $n = 3, 5, 7, 9$,
strongly implying that it occurs on the odd terms.
In other words, if $f_n$ is the new polynomial introduced by $p_n$, then denote its conditional factorization $g_n$.
$$ $$
f_n(z) = \begin{cases} f_n(z) = \begin{cases}
g_n(z) & n \text{ is even} \\ g_n(z) & \text{$n$ is even}
g_n(z)g_n(-z) & \text{$n$ is odd and ${\deg(f_n) \over 2}$ is even } \\ \\
-g_n(z)g_n(-z) & \text{otherwise} g_n(z)g_n(-z)
& \text{$n$ is odd and ${\deg(f_n) \over 2}$ is even}
\\
-g_n(z)g_n(-z)
& \text{$n$ is odd and ${\deg(f_n) \over 2}$ is odd}
\end{cases} \end{cases}
$$ $$
The final case seems to be tied to [OEIS A004614](http://oeis.org/A004614), which are primes of the form $4k+3$ and products thereof. Without resorting to any advanced techniques, the degrees of $f_n$ are
not too difficult to work out.
The degree of $p_n(z)$ is $n -\ 1$, which is also the degree of $f_n(z)$ if *n* is prime.
If *n* is composite, then the degree of $f_n(z)$ is $n -\ 1$ minus the degrees
of the divisors of $n -\ 1$.
This leaves behind how many numbers less than *n* are coprime to *n*.
Therefore $\deg(f_n) = \phi(n)$, the
[Euler totient function](https://en.wikipedia.org/wiki/Euler_totient_function) of the index.
Without resorting to any advanced techniques, the degrees of $f_n$ are not too difficult to work out. The degree of $p_n(z)$ is $n -\ 1$, which is also the degree of $f_n(z)$ if *n* is prime. If *n* is composite, then the degree of $f_n(z)$ is $n -\ 1$ minus the degrees of the divisors of $n -\ 1$. This leaves behind how many numbers less than *n* are coprime to *n*. Therefore $\deg(f_n) = \varphi(n)$, the Euler totient function. The totient function can be used to examine the parity of *n*.
If *n* is odd, it is coprime to 2 and all even numbers.
The introduced factor of 2 to 2*n* removes the evens from the totient, but this is compensated by
the addition of the odd multiples of old numbers coprime to *n* and new primes.
This means that $\phi(2n) = \phi(n)$ for odd *n* (other than 1).
The totient function can be used to examine the parity of *n*. If *n* is odd, it is coprime to 2 and all even numbers. The introduced factor of 2 to 2*n* removes the evens from the totient, but this is compensated by the addition of the odd multiples of old numbers coprime to *n* and new primes. This means that $\varphi(2n) = \varphi(n)$ for odd *n* ($n \neq 1$). The same argument can be used for even *n*: there are as many odd numbers from 0 to *n* as there are
from *n* to 2*n*, and there are an equal number of numbers coprime to 2*n* in either interval.
Therefore, $\phi(2n) = 2\phi(n)$ for even *n*.
The same argument can be used for even *n*: there are as many odd numbers from 0 to *n* as there are from *n* to 2*n*, and there are an equal number of numbers coprime to 2*n* in either interval. Therefore, $\varphi(2n) = 2\varphi(n)$ for even *n*. This collapses all cases of the conditional factorization of $f_n$ into one,
and the degrees of $g_n$ are
This collapses the cases of the conditional factorization of $f_n$ into one, and the degrees of $g_n$ are
$$
\begin{align*} \deg( g_n(z) ) &= \begin{cases}
\deg( f_n(z) ) = \varphi(n) & n \text{ is even} & \implies \varphi(2n) / 2 \\
\deg( f_n(z) ) / 2= \varphi(n) / 2 & n \text{ is odd} & \implies \varphi(2n) / 2 \\
\end{cases} \\
&= \varphi(2n) / 2
\end{align*}
$$
Though they were present in the earlier Chebyshev table, the $g_n$ themselves are presented again, along with the expression for their degree
| n | $\varphi(2n)/2$ | $g_n(z)$ | Coefficient List, Rising Powers |
|----|-----------------------------------------|------------------------|-----------------------------------------|
| 2 | 1 | $z$ | [0, 1] |
| 3 | 1 | $z -\ 1$ | [-1, 1] |
| 4 | 2 | $z^2 -\ 2$ | [-2, 0, 1] |
| 5 | 2 | $z^2 -\ z -\ 1$ | [-1, -1, 1] |
| 6 | 2 | $z^2 -\ 3$ | [-2, 0, 1] |
| 7 | 3 | $z^3 -\ z^2 -\ 2z + 1$ | [1, -2, -1, 1] |
| 8 | 4 | $z^4 -\ 4z^2 + 2$ | [2, 0, -4, 0, 1] |
| 9 | 3 | $z^3 -\ 3z + 1$ | [1, -3, 0, 1] |
| 10 | 4 | $z^4 -\ 5z^2 + 5$ | [5, 0, -5, 0, 1] |
| | [OEIS A055034](http://oeis.org/A055034) | | [OEIS A187360](http://oeis.org/A187360) |
### Attempts to Factor
The relationship between $p_n$ and the intermediate $f_d$, where *d* is a divisor of *n*, can be made explicit by a [Moebius inversion](https://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula).
$$ $$
\begin{align*} \begin{align*}
p_n(z) &= \prod_{d|n} f_n(z) \\ \deg( g_n(z) )
\log( p_n(z) ) &= \log \left( \prod_{d|n} f_d(z) \right) &= \begin{cases}
= \sum_{d|n} \log( f_d(z) ) \\ \deg( f_n(z) )
\log( f_n(z) ) &= \sum_{d|n} {\mu \left({n \over d}\right)} = \phi(n)
\log( p_d(z) ) \\ & n \text{ is even} & \implies \phi(n) = \phi(2n) / 2
f_n(z) &= \prod_{d|n} p_d(z)^{\mu \left({n \over d}\right)} \\ \\ \\
f_6(z) = g_6(z) &= p_6(z)^{\mu(1)} \deg( f_n(z) ) / 2
p_3(z)^{\mu(2)} = \phi(n) / 2
p_2(z)^{\mu(3)} \\ & n \text{ is odd} & \implies \phi(n) / 2 = \phi(2n) / 2
&= {p_6(z) \over p_3(z) p_2(z)} \\ \end{cases}
\\
&= \varphi(2n) / 2
\end{align*} \end{align*}
$$ $$
Mobius inversion by means of [Dirichlet generating functions](https://en.wikipedia.org/wiki/Dirichlet_series#Formal_Dirichlet_series) is algebraically clear. But moving from $f_n$ to $g_n$ is not easy. $\varphi(n)$ can also be easily expressed by in the Dirichlet world (it is $\zeta(s -\ 1) / \zeta(s)$, where $\zeta$ is the Riemann zeta function), which is useful for knowing when to negate a term. However, the move which doubles the argument of $\varphi$ is difficult to perform in terms of a Dirichlet series, and leaves me stuck. Though they were present in the earlier Chebyshev table,
the $g_n$ themselves are presented again, along with the expression for their degree
Even reformatting as a [Lambert series](https://en.wikipedia.org/wiki/Lambert_series) (another kind amenable to Moebius inversion) doesn't provide any intuition, since the product relationship between the polynomials necessitates a logarithm. If you're in the mood for awful-looking math, it is ```{python}
#| echo: false
#| classes: plain
def poly_to_rising_power_list(poly, var):
"""
Convert a polynomial to a list in rising powers.
E.g., x^2 + x - 1 will be converted to [-1, 1, 1].
"""
ret = []
for term in reversed(poly.as_ordered_terms()):
deg = sympy.degree(term, var)
if deg > len(ret):
ret.extend(0 for _ in range(int(deg) - len(ret)))
if deg == 0:
ret.append(term)
else:
ret.append(term.coeff(z**deg))
return ret
Markdown(tabulate(
[
[
n,
sympy.totient(2*n) / 2,
"$" + sympy.latex(g) + "$",
str(poly_to_rising_power_list(g, z)),
]
for n in range(2, 11)
for g in [
factor # the first factor polynomial with matching degree and negative second term
for factor in sympy.chebyshevu_poly(n - 1, z / 2).factor(z).as_ordered_factors() # type: ignore
for second_term in [
0 if len(factor.as_ordered_terms()) == 1 # if there's only one term, pass it through
else factor.as_ordered_terms()[1].as_ordered_factors()[0] # type: ignore
] if n == 2
or (
sympy.degree(factor) == sympy.totient(2*n) / 2
and isinstance(second_term, sympy.Integer)
and second_term < 0
)
]
] + [[
"",
"[OEIS A055034](http://oeis.org/A055034)",
"",
"[OEIS A187360](http://oeis.org/A187360)",
]],
headers=[
"n",
"$\\varphi(2n)/2$",
"$g_n(z)$",
"Coefficient list, rising powers",
],
numalign="right",
stralign="left",
))
```
### Factorization Attempts
The relationship between $p_n$ and the intermediate $f_d$, where *d* is a divisor of *n*,
can be made explicit by a [Möbius inversion](https://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula).
$$ $$
\begin{align*} \begin{align*}
\log( p_n(z) ) &= \sum_{d|n} \log( f_d(z) ) \\ p_n(z) &= \prod_{d|n} f_n(z)
\sum_{n = 1}^\infty \log( p_n ) x^n \\
&= \sum_{n = 1}^\infty \sum_{d|n} \log( f_d ) x^n \\ \log( p_n(z) )
&= \sum_{k = 1}^\infty \sum_{m = 1}^\infty \log( f_m ) x^{m k} \\ &= \log \left( \prod_{d|n} f_d(z) \right)
&= \sum_{m = 1}^\infty \log( f_m ) \sum_{k = 1}^\infty (x^m)^k \\ = \sum_{d|n} \log( f_d(z) )
&= \sum_{m = 1}^\infty \log( f_m ) {x^m \over 1 - x^m} \\ \\
\prod_{n = 1}^\infty p_n(z)^{(x^n)} &= \prod_{n = 1}^\infty f_n(z)^{\left({x^n \over 1 - x^n}\right)} \log( f_n(z) ) &= \sum_{d|n} { \mu \left({n \over d} \right)}
\log( p_d(z) )
\\
f_n(z) &= \prod_{d|n} p_d(z)^{ \mu (n / d) }
\\[10pt]
f_6(z) = g_6(z)
&= p_6(z)^{\mu(1)}
p_3(z)^{\mu(2)}
p_2(z)^{\mu(3)}
\\
&= {p_6(z) \over p_3(z) p_2(z)}
\end{align*} \end{align*}
$$ $$
Either way, the number-theoretic properties of this sequence are very difficult to ascertain without advanced techniques. If research has been done, it is not easily available in the OEIS. Unfortunately, it's difficult to apply this technique across our whole series.
Möbius inversion over series typically uses more advanced generating functions such as
[Dirichlet series](https://en.wikipedia.org/wiki/Dirichlet_series#Formal_Dirichlet_series)
or [Lambert series](https://en.wikipedia.org/wiki/Lambert_series).
However, naively reaching for these fails for two reasons:
- We built our series of polynomials on a recurrence relation, and these series
are opaque to such manipulations.
- To do a proper Möbius inversion, we need these kinds of series over the *logarithm*
of each polynomial (*B* is a series over the polynomials themselves).
Ignoring these (and if you're in the mood for awful-looking math) you may note
the Lambert equivalence:
$$
\begin{align*}
\log( p_n(z) )
&= \sum_{d|n} \log( f_d(z) )
\\
\sum_{n = 1}^\infty \log( p_n ) x^n
&= \sum_{n = 1}^\infty \sum_{d|n} \log( f_d ) x^n
\\
&= \sum_{k = 1}^\infty \sum_{m = 1}^\infty \log( f_m ) x^{m k}
\\
&= \sum_{m = 1}^\infty \log( f_m ) \sum_{k = 1}^\infty (x^m)^k
\\
&= \sum_{m = 1}^\infty \log( f_m ) {x^m \over 1 - x^m}
\end{align*}
$$
Either way, the number-theoretic properties of this sequence are difficult to ascertain
without advanced techniques.
If research has been done, it is not easily available in the OEIS.
Closing Closing
------- -------
My initial jumping off point for writing this article was completely different. However, in the process of writing, its share of the article shrank and shrank until its introduction was only vaguely related to what preceded it. But alas, the introduction via geometric constructions flows better coming off my [post about the Platonic solids](). As well, it reads better if I rely less on "if you search for this sequence of numbers" and more on how to interpret the definition. Consider reading [the follow-up]() to this post if you're interested in another way one can obtain the Chebyshev polynomials. My initial jumping off point for writing this article was completely different.
However, in the process of writing, its share of the article shrank and shrank until its
introduction was only vaguely related to what preceded it.
But alas, the introduction via geometric constructions flows better coming off my
[post about the Platonic solids](/posts/misc/platonic-volume).
Also, it reads better if I rely less on "if you search for this sequence of numbers"
and more on how to interpret the definition.
Consider reading [the follow-up](../2) to this post if you're interested in another way
one can obtain the Chebyshev polynomials.
Diagrams created with GeoGebra. Diagrams created with GeoGebra.
Update: I have since rederived the Chebyshev polynomials without the complex exponential, which you can read about in [this post](). <!--
Update: I have since rederived the Chebyshev polynomials without the complex exponential,
which you can read about in [this post]().
-->