Fields

Field extensions and towers

Adjoin 2\sqrt 2 to the rationals, then a cube root of that. The result is a field of degree 6 in which every element is an exact combination of six basis elements, and every question about it (inverses, minimal polynomials, which polynomials split) has an exact answer.

Adjoining a root

If ff is irreducible over a field kk, the quotient k[x]/(f)k[x]/(f) is a field containing kk in which the class of xx is a root of ff. It is written k(a)k(a) with f(a)=0f(a) = 0. As a vector space over kk it has basis 1,a,…,an−11, a, \dots, a^{n-1} where n=deg⁡fn = \deg f; this dimension is the degree [k(a):k][k(a) : k]. Repeating the step gives a tower:

Q⊂Q(a)⊂Q(a,b)⊂⋯ \mathbb{Q} \subset \mathbb{Q}(a) \subset \mathbb{Q}(a, b) \subset \cdots

extension takes the defining polynomials in order. Each may use the generators before it, and each is checked to be irreducible over the field built so far (a step that fails says so and shows the factors).

import { extension } from "@ratmath/structures";

const K = extension({ a: "a^2 - 2", b: "b^3 - a" });
K.degree;                       // 6
K.towerLaw();                   // "[Q(a, b) : Q] = [Q(a, b) : Q(a)]·[Q(a) : Q] = 3·2 = 6"
K.basis.map(String);            // ["1", "b", "b²", "a", "ab", "ab²"]

const x = K.a.add(K.b);         // generators are K.a and K.b; K.of("a b + 1/2") reads text
x.mul(x.inverse()).toString();  // "1"
K.b.pow(3).equals(K.a);         // true

The tower law

If k⊂F⊂Kk \subset F \subset K then [K:k]=[K:F] [F:k][K : k] = [K : F]\,[F : k]: products of a basis of FF over kk with a basis of KK over FF form a basis of KK over kk. That is exactly the basis K.basis lists. One consequence does a great deal of work on the ruler and compass page: the degree of any element of KK divides [K:Q][K : \mathbb{Q}], so a field reached by square roots alone, of degree 2m2^m, cannot contain a root of an irreducible cubic.

Minimal polynomials

Every element xx of KK satisfies a unique monic irreducible polynomial over Q\mathbb{Q}, its minimal polynomial; its degree is [Q(x):Q][\mathbb{Q}(x) : \mathbb{Q}]. It is found by linear algebra: write 1,x,x2,…1, x, x^2, \dots in the basis and stop at the first power that depends on the earlier ones. The same works over any level of the tower. The norm and trace are the determinant and trace of multiplication by xx.

x.minimalPolynomialText();      // "x⁶ − 6x⁴ − 18": degree 6, so Q(a + b) is all of K
K.a.degree;                     // 2
K.b.minimalPolynomialText();    // "x⁶ − 2": b is a sixth root of 2
K.b.minimalPolynomialOver(1).map(String);   // ["−a", "0", "0", "1"]: x³ − a over Q(a)
K.b.norm().toString();          // "-2"
x.approx();                     // 2.5366…, under the embedding with the largest real roots

Primitive elements

The primitive element theorem says a finite extension of Q\mathbb{Q} is always generated by one element: Q(a,b)=Q(θ)\mathbb{Q}(a, b) = \mathbb{Q}(\theta) for a suitable θ\theta, usually a+ba + b or a+2ba + 2b. primitiveElement() finds one, with its minimal polynomial and each generator written in terms of it. Internally the whole tower is carried on such a θ\theta, by the number fields of @ratmath/algebraic, with exact changes of basis between the two descriptions.

const L = extension({ a: "a^2 - 2", b: "b^2 - 3" });
const p = L.primitiveElement();
String(p.element);              // "a + b"
p.text;                         // "x⁴ − 10x² + 1"
p.expressions;                  // { a: "(1/2)θ³ − (9/2)θ", b: "−(1/2)θ³ + (11/2)θ" }

Roots and factors over the field

A polynomial irreducible over Q\mathbb{Q} may factor over a bigger field. factor factors over KK (by Trager's method: take a norm down to Q\mathbb{Q}, factor there, and take gcds back up), and roots lists the roots that lie in KK.

L.roots("x^2 - 6").map((r) => String(r.value));     // ["ab", "−ab"]: √6 = √2·√3
L.factor("x^4 - 10x^2 + 1").map((f) => f.text);     // four linear factors: L is the splitting field
L.factor("x^4 - 2").map((f) => f.text);             // ["x² + a", "x² − a"]
L.subfield(L.a.mul(L.b));                            // { degree: 2, text: "x² − 6", isWhole: false }

Automorphisms, fixed fields and the Galois correspondence are on the next page. Towers work comfortably up to degree 8 or so; degree 16 is slow.

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