Polynomials

Galois groups

The roots of an irreducible polynomial can be shuffled in some ways that keep every polynomial relation among them true. Those shuffles form the Galois group. It decides whether the roots can be written with radicals: x⁵ − x − 1 has group S₅ and cannot, x⁵ − 2 has group F₂₀ and its roots are ⁵√2 times fifth roots of unity.

Explore a polynomial

Type an irreducible polynomial of degree up to 7. The page finds its group as actual permutations of the numbered roots, lists the subgroups with the field each one fixes, and compares the group with how the polynomial factors modulo primes.

Reading the explorer

The group moving the roots. A permutation of the roots belongs to the group when every polynomial equation with rational coefficients that the roots satisfy stays true after the roots are moved. For x⁴ − 2 the roots are x₁ = −⁴√2, x₂ = ⁴√2 and x₃, x₄ = ±i·⁴√2. Swapping x₁ with x₃ while leaving the other two alone is not allowed: x₁ + x₂ = 0 is true, but x₃ + x₂ = 0 is not. Complex conjugation always is allowed: it is the permutation that swaps each non-real root with its mirror image.

Subgroups and fields (the Galois correspondence). Adjoining all the roots to Q gives the splitting field. Each subgroup H leaves some numbers in that field unmoved, and those numbers form a field between Q and the splitting field. This is a perfect dictionary: every intermediate field arises from exactly one subgroup, a subgroup of size m gives a field of degree |G|/m, and a bigger subgroup gives a smaller field. Normal subgroups correspond to the fields that are themselves splitting fields. The explorer finds, for each subgroup, a sum of products of roots that H leaves in place and whose values under the rest of the group are all different; the minimal polynomial of that number defines the fixed field.

Solvable by radicals. The roots can be written with +, −, ×, ÷ and nested roots exactly when the group can be taken apart in abelian steps: replace the group by its commutator subgroup and repeat. If this reaches the trivial group, each step is a field extension made by adjoining a radical. For S₅ it stops at A₅, which is why x⁵ − x − 1 has no formula.

Modulo primes. Dedekind's theorem connects the group with ordinary arithmetic: if the polynomial factors modulo p into pieces of degrees 2, 2 and 1, then the group contains a permutation with cycles of lengths 2, 2 and 1. Chebotarev's theorem says each shape occurs for a share of the primes equal to its share of the group. So the factorizations alone already hint at the group.

Asking for one answer

Degrees 2 and 3

A quadratic's group swaps its two roots: C₂. For a cubic the group is either all six permutations S₃ or just the three rotations A₃ = C₃. The test is the discriminant Δ = Π(αᵢ − αⱼ)²: its square root Π(αᵢ − αⱼ) changes sign under odd permutations, so it is rational exactly when the group has only even ones. x³ − 3x + 1 has Δ = 81 = 9², group C₃.

Degree 4

The resolvent cubic of x⁴ + bx³ + cx² + dx + e has roots α₁α₂ + α₃α₄, α₁α₃ + α₂α₄, α₁α₄ + α₂α₃; its coefficients are

y³ − c·y² + (bd − 4e)·y − (b²e − 4ce + d²)

Each transitive group of degree 4 leaves a different number of those three values fixed:

Resolvent cubicΔ square?GroupOrder
irreduciblenoS₄24
irreducibleyesA₄12
three rational rootsyesV₄ = C₂ × C₂4
one rational root rnoD₄ or C₄8 or 4

The last case is settled by the Kappe–Warren test: the group is C₄ exactly when x² − rx + e and x² + bx + (c − r) both split over Q(√Δ), that is, each has a discriminant that is 0, a square, or a square times Δ.

Degree 5, through certified resolvents

The transitive groups of degree 5 are C₅ ⊂ D₅ ⊂ F₂₀ ⊂ S₅ and A₅ ⊂ S₅. The first three are exactly the solvable ones. The test for "inside F₂₀" uses a quantity that F₂₀ leaves alone but other permutations move: label the five roots as corners of a pentagon and let

θ = (Σ_(pentagon edges) αᵢαⱼ − Σ_(pentagram edges) αᵢαⱼ)²

There are six ways to draw the pentagon, giving six values θ₁ … θ₆ and the sextic resolvent Π(y − θₖ). The group lies in a copy of F₂₀ exactly when that sextic has a rational root (once it is square-free). Then the discriminant separates F₂₀ from D₅, and a second resolvent of degree 4, built from Σ αᵢ²αᵢ₊₁ around the oriented pentagon, separates D₅ from C₅.

The resolvents have integer coefficients (they are symmetric functions of the roots of a monic integer polynomial), but no formula is needed. The library computes them from certified boxes around the five roots with exact interval arithmetic, refining until each coefficient's interval contains exactly one integer. So the result is proven, not estimated. If a resolvent comes out with a repeated root, the roots are first moved by a Tschirnhaus transformation y = x² + kx, which keeps the group.

Degrees 6 and 7, and the group as permutations

There are 16 transitive groups of degree 6 and 7 of degree 7. One method covers them all, and it also yields the permutations themselves:

  1. Orbits on pairs and triples. The polynomial Π(y − (αᵢ + αⱼ)) over all pairs of roots has integer coefficients. Its irreducible factors are exactly the orbits of the group on pairs, so factoring it over the integers shows which pairs can be moved to which. The same is done for triples.
  2. A group that contains the answer. The permutations that keep every one of those orbits (and are even when the discriminant is a square) form a group H₀ that contains the Galois group.
  3. Candidates. The Galois group is a copy of one of the transitive groups in the table, sits inside H₀ and has exactly the observed orbits. Usually only one subgroup qualifies.
  4. A deciding test. When several qualify, each candidate K is tested with F = Σ over K of α₁α₂²α₃³… with the roots permuted by K. Exactly the permutations in K leave F alone, so the group lies in K exactly when F is a rational number. That is checked exactly, as an integer root of the polynomial whose roots are the values of F on the cosets of K.

All of it runs on certified boxes around the roots, refined until each integer coefficient is pinned down and the values that must differ sit in disjoint boxes. Repeated values are avoided by a Tschirnhaus transformation of the roots, which keeps the action.

In code

import { galoisGroup, galoisAction } from "@ratmath/algebraic";
galoisGroup([-2, 0, 0, 0, 1]);
// { degree: 4, name: "D4", order: 8, label: "4T3", solvable: true,
//   discriminant: Rational(-2048), discriminantIsSquare: false, resolventCubic: [...] }
galoisGroup([-1, -1, 0, 0, 0, 1]).name;   // "S5", not solvable by radicals
galoisGroup([3, -7, 0, 0, 0, 0, 0, 1]).name;   // "PSL(3,2)", order 168
galoisGroup([-1, 0, 0, 0, 0, 1]);         // reducible: { reducible: true, factors: [...] }

const a = galoisAction([-2, 0, 0, 0, 1]);  // x⁴ − 2
a.roots;                // the four roots, numbered as the permutations use them
a.permutations();       // ["()", "(3 4)", "(1 2)", "(1 2)(3 4)", ...]
a.conjugation;          // complex conjugation as a permutation
a.fixedField("(3 4)");  // { degree: 4, polynomial: x⁴ − 2, generator: "x₁", normal: false }
a.correspondence();     // every subgroup class with its fixed field
a.frobenius(200);       // factor patterns modulo 200 primes against the group's cycle types
a.derivedSeries();      // [8, 2, 1]: solvable

Labels follow the transitive-group numbering nTk. Degree 8 and above are not covered.

Try itEdit the code and run it with @ratmath/algebraic and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs