Field extensions and towers
Adjoin 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 is irreducible over a field , the quotient is a field containing in which the class of is a root of . It is written with . As a vector space over it has basis where ; this dimension is the degree . Repeating the step gives a tower:
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 then : products of a basis of over with a basis of over form a basis of over . 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 divides , so a field reached by square roots alone, of degree , cannot contain a root of an irreducible cubic.
Minimal polynomials
Every element of satisfies a unique monic irreducible polynomial over , its minimal polynomial; its degree is . It is found by linear algebra: write 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 .
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 is always generated by one element: for a suitable , usually or . primitiveElement() finds one, with its minimal polynomial and each generator written in terms of it. Internally the whole tower is carried on such a , 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 may factor over a bigger field. factor factors over (by Trager's method: take a norm down to , factor there, and take gcds back up), and roots lists the roots that lie in .
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.
@ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.