Ruler and compass
For two thousand years nobody could double a cube, trisect an angle or draw a regular heptagon with ruler and compass. Field theory shows why in a few lines: a constructible length lives in a tower of square roots, so its degree is a power of 2. The same theory says exactly which regular polygons can be drawn, and writes the square roots down.
Constructible numbers
Start with two points a unit apart. A ruler draws the line through two known points, a compass the circle about one known point through another, and new points appear where lines and circles cross. A real number is constructible if a segment of that length can be reached. Sums, differences, products and quotients of constructible numbers are constructible (by similar triangles), and so is the square root of one (by a semicircle). Conversely, intersecting lines and circles only ever solves linear and quadratic equations. So:
is constructible exactly when it lies in a field at the top of a tower with every step of degree 2.
By the tower law such a number has degree over . That necessary condition already settles the classical problems. It is not quite sufficient: a root of has degree 4, but there is no field of degree 2 below it. The complete criterion, used by constructible, is that the splitting field has degree a power of 2, that is, the Galois group is a 2-group.
import { constructible } from "@ratmath/structures";
constructible("x^4 - 2").constructible; // true: group D4 of order 8
constructible("x^3 - 2").constructible; // false: degree 3
constructible("x^4 + x + 1").constructible; // false: degree 4, but the group is S4 of order 24
constructible("x^4 + x + 1").reason; // says so in words
When the answer is yes, each root comes with an expression in square roots alone, from solving by radicals.
The three classical problems
- Doubling the cube asks for , a root of the irreducible : degree 3, impossible.
- Trisecting an angle asks for given . The triple-angle formula makes it a root of . For that is , irreducible, so the 60° angle cannot be trisected and there is no general method. Some angles can: for the cubic factors.
- Squaring the circle asks for . Constructible numbers are algebraic and is not (Lindemann, 1882). This one is quoted, not computed.
import { classicalProblems } from "@ratmath/structures";
classicalProblems.doublingTheCube().possible; // false
classicalProblems.trisecting("1/2").reason; // "8x³ − 6x − 1 is irreducible, so cos(θ/3) has degree 3 over Q, …"
classicalProblems.trisecting("0").possible; // true: a right angle can be trisected
classicalProblems.squaringTheCircle().reason;
Regular polygons
Drawing a regular -gon means constructing , which generates a field of degree inside the cyclotomic field. That field is Galois with an abelian group, so the degree test is the whole story. Gauss (sufficiency, 1796) and Wantzel (necessity, 1837):
The regular -gon is constructible exactly when is a power of 2, that is, when is a power of 2 times a product of distinct Fermat primes .
So the 7-gon, 9-gon, 11-gon and 13-gon are impossible, and the 17-gon is possible, which Gauss found at nineteen. For a Fermat prime the Galois group of the -th roots of unity is cyclic of order . Halving the group times splits the roots into sums called Gaussian periods; each period satisfies a quadratic whose coefficients are periods from the level before. regularPolygon follows that chain and then combines prime factors by the addition formula for cosines and powers of 2 by the half-angle formula.
import { regularPolygon } from "@ratmath/structures";
const p = regularPolygon(17);
p.constructible; // true
p.cos.inline(); // "(−1 + √17 + √(34 − 2·√17) + 2·√(17 + 3·√17 − √(170 + 38·√17)))/16"
p.cos.usesOnlySquareRoots; // true
p.cos.check(50); // { agrees: true, digits: 50 }
regularPolygon(7).reason; // "φ(7) = 6 is not a power of 2, so cos(2π/7) has degree 3 over Q …"
regularPolygon(257).cos.size; // 66: the 257-gon takes 66 square roots
The formula for 17 is Gauss's own, up to the order of the terms. The 65537-gon is constructible too, but its formula is left to the patient.
constructiblePolygon(n) is another name for regularPolygon(n). The theorem also reaches constructible: when a factor has degree 8 or more (beyond the Galois groups computed directly) but is, coefficient for coefficient, the minimal polynomial of or of from algebraic's cosMinimal, its splitting field is , abelian of degree , and the answer is decided. Only the finitely many with can match. Any other polynomial of such a degree is still left undecided.
import { cosMinimal } from "@ratmath/algebraic";
constructible(cosMinimal(17)).constructible; // true: it is the minimal polynomial of cos(2π/17)
constructible("x^8 - 2").constructible; // null: degree 8, not a cosine, left undecided
@ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.