Part 3. Points of finite order and minimal polynomials#
A point \(P\) of the circle has order \(n\) if \(P^n=(1,0)\) and no smaller positive power gives \((1,0)\). On the real circle, the points of order \(n\) are the vertices of the regular \(n\)-gon inscribed in the circle, \(\bigl(\cos\frac{2\pi k}{n},\sin\frac{2\pi k}{n}\bigr)\) with \(\gcd(k,n)=1\) — in the language of complex numbers, these are the primitive \(n\)th roots of unity. From Part 2 we know that
so the first coordinates of the points of order \(n\) are roots of the polynomial \(T_n(x)-1\). In this part we use this to extract the minimal polynomials of the numbers \(\cos\frac{2\pi}{n}\), build formulas in radicals for \(n=5\) and \(n=15\) (the latter by multiplying points), reconstruct Gauss’s construction of the 17-gon, and check for which \(n\) formulas using only square roots exist.
from functools import cache
import sympy as sp
x, z = sp.symbols("x z")
def m(P, Q):
"""Prawo grupowe okręgu (część 1)."""
a, b = P
c, d = Q
return (a * c - b * d, a * d + b * c)
def T(n):
return sp.chebyshevt(n, x) # te same wielomiany co w części 2
Factoring \(T_n(x)-1\)#
Let us start with an example. We factor \(T_{12}(x)-1\) into irreducible factors over \(\mathbb{Q}\) and see which points of the circle correspond to the individual factors.
stala, czynniki = sp.factor_list(T(12) - 1)
print("T_12(x) - 1 =", stala, "·",
" · ".join(f"({f})^{k}" if k > 1 else f"({f})" for f, k in czynniki))
T_12(x) - 1 = 8 · (x - 1) · (x + 1) · (x)^2 · (2*x - 1)^2 · (2*x + 1)^2 · (4*x**2 - 3)^2
Each factor corresponds to one divisor \(d\) of \(12\), that is, to the points of order exactly \(d\): \(x-1\) is the point \((1,0)\) (\(d=1\)), \(x+1\) is \((-1,0)\) (\(d=2\)), \(2x+1\) gives the vertices of the triangle (\(d=3\)), \(x\) — of the square (\(d=4\)), \(2x-1\) — of the hexagon (\(d=6\)), and \(4x^2-3\) — of the dodecagon (\(d=12\)). The factors other than \(x\pm1\) appear squared, because the points \(P\) and \(P^{-1}=(a,-b)\) have the same first coordinate; the points \((\pm1,0)\) are their own inverses.
The minimal polynomial of \(\cos\frac{2\pi}{n}\)#
Let \(\Psi_n\) denote the monic irreducible factor of \(T_n(x)-1\) that divides no \(T_d(x)-1\) for proper divisors \(d\) of \(n\). It is the factor of the “new” points, of order exactly \(n\), that is, the minimal polynomial of \(\cos\frac{2\pi}{n}\) over \(\mathbb{Q}\).
@cache
def Psi(n):
"""Wielomian minimalny cos(2π/n): nowy czynnik T_n(x) - 1."""
for f, _ in sp.factor_list(T(n) - 1)[1]:
if not any(sp.rem(T(d) - 1, f, x) == 0 for d in sp.divisors(n)[:-1]):
return sp.Poly(f, x).monic()
print(f"{'n':>3} {'stopień Ψ_n':>12} {'φ(n)/2':>7} = minimal_polynomial")
tabela = []
for n in range(3, 21):
mp = sp.Poly(sp.minimal_polynomial(sp.cos(2 * sp.pi / n), x), x).monic()
tabela.append((n, Psi(n).degree(), int(sp.totient(n)) // 2, Psi(n) == mp))
print(f"{n:>3} {tabela[-1][1]:>12} {tabela[-1][2]:>7} {tabela[-1][3]}")
n stopień Ψ_n φ(n)/2 = minimal_polynomial
3 1 1 True
4 1 1 True
5 2 2 True
6 1 1 True
7 3 3 True
8 2 2 True
9 3 3 True
10 2 2 True
11 5 5 True
12 2 2 True
13 6 6 True
14 3 3 True
15 4 4 True
16 4 4 True
17 8 8 True
18 3 3 True
19 9 9 True
20 4 4 True
The degree of \(\Psi_n\) is \(\varphi(n)/2\) (for \(n\ge3\)): there are \(\varphi(n)\) points of order \(n\), and the pairs \(P,P^{-1}\) share the same \(\cos\). That \(\Psi_n\) is irreducible follows from the irreducibility of cyclotomic polynomials — here SymPy factors the polynomial over \(\mathbb{Q}\) and confirms it for every \(n\) in the table.
A consequence for rational points: \(\cos\frac{2\pi}{n}\) is rational only when \(\Psi_n\) has degree \(1\), that is, for \(n\in\{1,2,3,4,6\}\) (Niven’s theorem, 1956). If \(\sin\) is also required to be rational, we are left with \(n\in\{1,2,4\}\):
wymierne_cos = [n for n in range(1, 61) if Psi(n).degree() == 1]
wymierne_oba = [n for n in wymierne_cos
if sp.sin(2 * sp.pi / n).is_rational]
print("cos(2π/n) wymierny dla n ≤ 60:", wymierne_cos)
print("cos i sin wymierne:", wymierne_oba)
cos(2π/n) wymierny dla n ≤ 60: [1, 2, 3, 4, 6]
cos i sin wymierne: [1, 2, 4]
So the group \(S^1(\mathbb{Q})\) has only four points of finite order: \((\pm1,0)\) and \((0,\pm1)\). All other rational points, such as \((3/5,4/5)\) from Part 1, have infinite order. (The computation covers \(n\le60\); for larger \(n\), the fact that \(\varphi(n)>2\) suffices.)
The pentagon: a formula in radicals#
\(\Psi_5\) is quadratic, so we solve it with the quadratic formula and get \(\sin\) from the equation of the circle.
print("Ψ_5 =", Psi(5).as_expr())
c5 = max(sp.solve(Psi(5).as_expr(), x), key=lambda r: r.evalf())
s5 = sp.sqrt(10 + 2 * sp.sqrt(5)) / 4
print("cos(2π/5) =", c5, " sin(2π/5) =", s5)
print("na okręgu:", sp.simplify(c5**2 + s5**2 - 1) == 0)
P5 = (c5, s5)
Q = (sp.Integer(1), sp.Integer(0))
for _ in range(5):
Q = m(Q, P5)
print("P^5 =", tuple(sp.radsimp(sp.expand(q)) for q in Q))
Ψ_5 = x**2 + x/2 - 1/4
cos(2π/5) = -1/4 + sqrt(5)/4 sin(2π/5) = sqrt(2*sqrt(5) + 10)/4
na okręgu: True
P^5 = (1, 0)
The check \(P^5=(1,0)\) is exact: we expand the products involving square roots and simplify them
(radsimp removes irrationalities from denominators). No floating-point number appears anywhere.
The 15-gon: multiplying points instead of solving#
\(\Psi_{15}\) has degree \(4\). We could solve an equation of degree 4, but the group offers a shorter route. Since
a point of order \(15\) is \(P_5^{\,2}\cdot P_3^{-1}\), where \(P_5\) and \(P_3\) are points of order \(5\) and \(3\). We know the coordinates \(P_3=(-\frac12,\frac{\sqrt3}{2})\), and we computed \(P_5\) a moment ago. Two multiplications in the group suffice.
P3_odwr = (sp.Rational(-1, 2), -sp.sqrt(3) / 2)
P15 = tuple(sp.expand(w) for w in m(m(P5, P5), P3_odwr))
print("cos(2π/15) =", P15[0])
print("sin(2π/15) =", P15[1])
mp15 = sp.Poly(sp.minimal_polynomial(P15[0], x), x).monic()
print("wielomian minimalny = Ψ_15:", mp15 == Psi(15))
print("Ψ_15 =", Psi(15).as_expr())
print("|różnica z cos(2π/15)| < 10⁻⁵⁰:",
abs(sp.N(P15[0] - sp.cos(2 * sp.pi / 15), 60)) < sp.Float("1e-50"))
cos(2π/15) = -sqrt(3)*sqrt(2*sqrt(5) + 10)/16 + 1/8 + sqrt(5)/8 + sqrt(15)*sqrt(2*sqrt(5) + 10)/16
sin(2π/15) = -sqrt(5)*sqrt(2*sqrt(5) + 10)/16 + sqrt(3)/8 + sqrt(2*sqrt(5) + 10)/16 + sqrt(15)/8
wielomian minimalny = Ψ_15: True
Ψ_15 = x**4 - x**3/2 - x**2 + x/2 + 1/16
|różnica z cos(2π/15)| < 10⁻⁵⁰: True
This is the same idea that underlies the Chinese remainder theorem: the group of points whose order divides \(15\) is the product of the groups of points whose order divides \(3\) and \(5\). Euclid constructed the 15-gon with compass and straightedge from the triangle and the pentagon in a similar way: he bisected the arc \(\frac13-\frac15=\frac{2}{15}\) of the circle (Elements, Book IV, Proposition 16).
The 17-gon: Gaussian periods#
\(\Psi_{17}\) has degree \(8=2^3\). In 1796 Gauss showed that \(\cos\frac{2\pi}{17}\) can be obtained by solving three quadratic equations in succession, and five years later he described the general method in Disquisitiones arithmeticae (1801). We will reconstruct this construction by symbolic computation.
We work with \(\zeta=\cos\frac{2\pi}{17}+i\sin\frac{2\pi}{17}\), that is, with the point \(P_{17}\) written as a complex number. We compute with polynomials in \(z\) modulo \(\Phi_{17}(z)=1+z+\dots+z^{16}\), since \(\zeta\) satisfies \(\Phi_{17}(\zeta)=0\). The group \((\mathbb{Z}/17)^\times\) is cyclic of order \(16\) with generator \(3\); its subgroups have orders \(8,4,2,1\). A Gaussian period of length \(f\) is the sum of \(\zeta^j\) over the exponents \(j\) in one coset of the subgroup of order \(f\). The periods of length \(2\) are \(\zeta^j+\zeta^{-j}=2\cos\frac{2\pi j}{17}\), and we are looking for \(2\cos\frac{2\pi}{17}\).
p, g = 17, 3
PHI = sp.Poly(sp.cyclotomic_poly(p, z), z)
POTEGI = [pow(g, k, p) for k in range(p - 1)] # 3^k mod 17
def warstwa(f, i):
"""Wykładniki okresu długości f o numerze i (i = 0, ..., 16/f - 1)."""
krok = (p - 1) // f
return sorted(POTEGI[(i + j * krok) % (p - 1)] for j in range(f))
def okres(f, i):
return sp.Poly(sum(z**j for j in warstwa(f, i)), z)
NAZWY = {8: "η", 4: "λ", 2: "μ"}
def w_okresach(w, f):
"""Zapis w (wielomian od z mod Φ_17) przez okresy długości f."""
r = w.rem(PHI)
# 1 = -(z + ... + z^16), więc wyraz wolny przenosimy na z^1, ..., z^16
wsp = [r.coeff_monomial(z**j) - r.coeff_monomial(1) for j in range(p)]
kombinacja = []
for i in range((p - 1) // f):
wart = {wsp[j] for j in warstwa(f, i)}
assert len(wart) == 1, "w nie jest kombinacją okresów"
kombinacja.append(wart.pop())
if len(set(kombinacja)) == 1: # c·(suma wszystkich okresów) = -c
return -kombinacja[0]
return sum(c * sp.Symbol(f"{NAZWY[f]}{i}")
for i, c in enumerate(kombinacja))
for f in (8, 4, 2):
print(f"okresy długości {f}:",
[warstwa(f, i) for i in range((p - 1) // f)])
okresy długości 8: [[1, 2, 4, 8, 9, 13, 15, 16], [3, 5, 6, 7, 10, 11, 12, 14]]
okresy długości 4: [[1, 4, 13, 16], [3, 5, 12, 14], [2, 8, 9, 15], [6, 7, 10, 11]]
okresy długości 2: [[1, 16], [3, 14], [8, 9], [7, 10], [4, 13], [5, 12], [2, 15], [6, 11]]
The two periods of length \(8\), \(\eta_0\) and \(\eta_1\), are the roots of a quadratic equation whose
coefficients are their sum and product. The function w_okresach expresses such numbers in terms of periods
of a given length: when all the coefficients are equal, the result is rational, because
\(\sum_{j=1}^{16}\zeta^j=-1\). We descend one level in the same way: the two periods of length \(4\) contained
in \(\eta_0\) have sum \(\eta_0\) and a product expressed in terms of periods of length \(8\); the two periods of length \(2\)
contained in \(\lambda_0\) have sum \(\lambda_0\) and a product expressed in terms of periods of length \(4\).
eta = [okres(8, i) for i in range(2)]
lam = [okres(4, i) for i in range(4)]
mu = [okres(2, i) for i in range(8)]
print("η0 + η1 =", w_okresach(eta[0] + eta[1], 8))
print("η0 · η1 =", w_okresach(eta[0] * eta[1], 8))
print("λ0 + λ2 =", w_okresach(lam[0] + lam[2], 8))
print("λ0 · λ2 =", w_okresach(lam[0] * lam[2], 8))
print("λ1 + λ3 =", w_okresach(lam[1] + lam[3], 8))
print("λ1 · λ3 =", w_okresach(lam[1] * lam[3], 8))
print("μ0 + μ4 =", w_okresach(mu[0] + mu[4], 4))
print("μ0 · μ4 =", w_okresach(mu[0] * mu[4], 4))
η0 + η1 = -1
η0 · η1 = -4
λ0 + λ2 = η0
λ0 · λ2 = -1
λ1 + λ3 = η1
λ1 · λ3 = -1
μ0 + μ4 = λ0
μ0 · μ4 = λ1
We read off three quadratic equations:
\(\eta_0+\eta_1=-1\), \(\eta_0\eta_1=-4\), so \(\eta_{0,1}\) are the roots of \(X^2+X-4\);
\(\lambda_0+\lambda_2=\eta_0\), \(\lambda_0\lambda_2=-1\), so \(\lambda_{0,2}\) are the roots of \(X^2-\eta_0X-1\), and \(\lambda_{1,3}\) are the roots of \(X^2-\eta_1X-1\);
\(\mu_0+\mu_4=\lambda_0\), \(\mu_0\mu_4=\lambda_1\), so \(\mu_0=2\cos\frac{2\pi}{17}\) is a root of \(X^2-\lambda_0X+\lambda_1\).
Now we solve the three quadratic equations in turn. At each level we have to choose one of the two roots; we choose the one that agrees with the approximate value of the period (this is the only place where we use approximate numbers, and only to choose the sign).
import cmath
zeta = cmath.exp(2j * cmath.pi / p)
def wartosc(okres_poly):
return sum(complex(c) * zeta**k for (k,), c in okres_poly.terms()).real
def pierwiastek(s, q, cel):
"""Pierwiastek X² - sX + q = 0 bliższy liczbie cel."""
r = sp.sqrt(s**2 - 4 * q)
return min(((s + r) / 2, (s - r) / 2), key=lambda t: abs(sp.N(t) - cel))
eta0 = pierwiastek(-1, -4, wartosc(eta[0]))
eta1 = -1 - eta0
lam0 = pierwiastek(eta0, -1, wartosc(lam[0]))
lam1 = pierwiastek(eta1, -1, wartosc(lam[1]))
mu0 = pierwiastek(lam0, lam1, wartosc(mu[0]))
cos17 = sp.expand(mu0 / 2)
print("cos(2π/17) =", cos17)
print("liczba pierwiastków kwadratowych w wyrażeniu:",
sum(1 for w in sp.preorder_traversal(cos17)
if isinstance(w, sp.Pow) and w.exp == sp.Rational(1, 2)))
cos(2π/17) = -1/16 + sqrt(17)/16 + sqrt(17/2 - sqrt(17)/2)/8 + sqrt(-2*sqrt(sqrt(17)/2 + 17/2) - sqrt(17/2 - sqrt(17)/2)/4 + sqrt(17)*sqrt(17/2 - sqrt(17)/2)/4 + 3*sqrt(17)/4 + 17/4)/4
liczba pierwiastków kwadratowych w wyrażeniu: 12
We check the result exactly: the minimal polynomial of the expression must equal \(\Psi_{17}\). For comparison, let us also take the textbook formula,
r17 = sp.sqrt(17)
podrecznik = (-1 + r17 + sp.sqrt(34 - 2 * r17)
+ 2 * sp.sqrt(17 + 3 * r17 - sp.sqrt(34 - 2 * r17)
- 2 * sp.sqrt(34 + 2 * r17))) / 16
for nazwa, w in (("nasza konstrukcja", cos17),
("wzór z podręcznika", podrecznik)):
mp = sp.Poly(sp.minimal_polynomial(w, x), x).monic()
blisko = abs(sp.N(w - sp.cos(2 * sp.pi / 17), 60)) < sp.Float("1e-40")
print(f"{nazwa:20} wielomian minimalny = Ψ_17: {mp == Psi(17)};",
f"|różnica z cos(2π/17)| < 10⁻⁴⁰: {blisko}")
print("Ψ_17 =", Psi(17).as_expr())
nasza konstrukcja wielomian minimalny = Ψ_17: True; |różnica z cos(2π/17)| < 10⁻⁴⁰: True
wzór z podręcznika wielomian minimalny = Ψ_17: True; |różnica z cos(2π/17)| < 10⁻⁴⁰: True
Ψ_17 = x**8 + x**7/2 - 7*x**6/4 - 3*x**5/4 + 15*x**4/16 + 5*x**3/16 - 5*x**2/32 - x/32 + 1/256
The minimal polynomial and agreement to 40 digits are two independent checks: the first says that the expression is one of the eight roots of \(\Psi_{17}\), the second — which one. Square roots of constructible numbers can be constructed with compass and straightedge, so the regular 17-gon is constructible.
When it is impossible: the heptagon#
Not every regular polygon can be built this way. Let us look at the minimal polynomials for \(n=7\) and \(n=9\).
print("Ψ_7 =", Psi(7).as_expr(), " stopień", Psi(7).degree())
print("Ψ_9 =", Psi(9).as_expr(), " stopień", Psi(9).degree())
Ψ_7 = x**3 + x**2/2 - x/2 - 1/8 stopień 3
Ψ_9 = x**3 - 3*x/4 + 1/8 stopień 3
A number obtained from the rationals by arithmetic operations and square roots has a minimal polynomial of degree \(2^k\) (each square root at most doubles the degree of the field extension). \(\Psi_7\) and \(\Psi_9\) have degree \(3\), so the regular heptagon and the regular nonagon cannot be constructed with compass and straightedge (Wantzel, 1837; the nonagon amounts to trisecting the angle \(120^\circ\), see Lecture 6, §6.4). In the other direction, Gauss’s construction works: when \(\varphi(n)\) is a power of two, the group \((\mathbb{Z}/n)^\times\) has a chain of subgroups of index \(2\), and the periods descend through quadratic equations just as for \(17\). The degree of \(\Psi_n\) therefore decides constructibility:
konstruowalne = [n for n in range(3, 101)
if Psi(n).degree() & (Psi(n).degree() - 1) == 0]
print("n-kąt foremny konstruowalny, 3 ≤ n ≤ 100:", konstruowalne)
print("zgodne z warunkiem „φ(n) jest potęgą 2”:",
konstruowalne == [n for n in range(3, 101)
if sp.totient(n) & (sp.totient(n) - 1) == 0])
n-kąt foremny konstruowalny, 3 ≤ n ≤ 100: [3, 4, 5, 6, 8, 10, 12, 15, 16, 17, 20, 24, 30, 32, 34, 40, 48, 51, 60, 64, 68, 80, 85, 96]
zgodne z warunkiem „φ(n) jest potęgą 2”: True
The list consists of exactly the numbers of the form \(2^k\cdot p_1\cdots p_r\), where the \(p_i\) are distinct Fermat primes \(3,5,17,257,65537\) (the Gauss–Wantzel theorem).
Exercises#
Find \(\cos\frac{2\pi}{20}\) as a product of points of order \(4\) and \(5\), and check the minimal polynomial.
Build a formula for \(\cos\frac{2\pi}{51}\) from points of order \(3\) and \(17\). How many square roots does the result contain?
Carry the construction of periods over to \(p=257\) (generator \(3\)). How many quadratic equations do you need to solve? Which computations become expensive?
For \(p=7\), periods of length \(2\) also exist, but the chain of subgroups of \((\mathbb{Z}/7)^\times\) has index \(3\). Compute the sum, the product, and the sum of pairwise products of the three periods, and write down the cubic equation for \(2\cos\frac{2\pi}{7}\).
Literature and further reading#
C. F. Gauss, Disquisitiones arithmeticae, 1801, Section VII — periods and the division of the circle; English translation by A. A. Clarke (Springer, 1986).
P. L. Wantzel, Recherches sur les moyens de reconnaître si un Problème de Géométrie peut se résoudre avec la règle et le compas, Journal de Mathématiques Pures et Appliquées 2 (1837), 366–372 (Numdam).
Euclid, Elements, Book IV, Proposition 16 — the 15-gon from the triangle and the pentagon (D. E. Joyce’s edition).
D. A. Cox, Galois Theory, 2nd ed., Wiley, 2012 (DOI) — Gaussian periods, cyclotomic extensions, and geometric constructions with complete proofs.
I. Niven, Irrational Numbers, Carus Mathematical Monographs 11, MAA, 1956 — the theorem on rational values of trigonometric functions (Niven’s theorem).
Wikipedia entries: Gaussian period, constructible polygon, heptadecagon (with an animation of the construction).