Groups

Subgroups and quotients

A subgroup is a group living inside a bigger one. Its size always divides the size of the whole, and when it is normal the group can be folded up along it into a smaller group, the quotient.

Subgroups and Lagrange's theorem

A subgroup H≤GH \le G is a subset that is a group with the same product: it contains ee and is closed under products and inverses. In a finite group, closure under products is enough. G.subgroup(list) gives the subgroup generated by some elements, the smallest one containing them.

The left cosets gH={gh:h∈H}gH = \{gh : h \in H\} all have ∣H∣|H| elements and split GG into disjoint pieces. So

∣G∣=[G:H] ∣H∣, |G| = [G : H]\,|H|,

where the index [G:H][G:H] is the number of cosets. This is Lagrange's theorem: the order of a subgroup divides the order of the group. Since ⟨a⟩\langle a \rangle has as many elements as the order of aa, the order of every element divides ∣G∣|G| too. The converse fails: A4A_4 has order 12 but no subgroup of order 6.

import { symmetric, alternating, dihedral } from "@ratmath/structures";

const S = symmetric(4);
const H = S.subgroup(["(1 2 3 4)"]);
H.order;                                 // 4
S.index(H);                              // 6
S.cosets(H).length;                      // 6

S.subgroups().length;                    // 30
S.subgroupClasses().length;              // 11 up to conjugacy
alternating(4).subgroups().map((K) => K.order);   // [1, 2, 2, 2, 3, 3, 3, 3, 4, 12]: no 6
dihedral(6).subgroups().length;          // 16 = τ(6) + σ(6)

Listing every subgroup is done by joining cyclic subgroups layer by layer. It is fine for groups of a few hundred elements; subgroups() refuses groups larger than 1000 unless told otherwise. The dihedral group DnD_n has τ(n)+σ(n)\tau(n) + \sigma(n) subgroups (the number and the sum of the divisors of nn), which the tests check for nn up to 12.

Normal subgroups and quotients

A subgroup NN is normal, written N⊴GN \trianglelefteq G, when gNg−1=NgNg^{-1} = N for every gg; equivalently its left and right cosets agree. A normal subgroup is a union of conjugacy classes, which is how normalSubgroups() finds them all without listing every subgroup.

For a normal NN the cosets multiply: (aN)(bN)=abN(aN)(bN) = abN is well defined, and the cosets form the quotient group G/NG/N of order [G:N][G : N]. For a subgroup that is not normal this product depends on the representatives chosen, and quotient refuses.

import { symmetric, dihedral, quaternion, isIsomorphic, kleinFour, cyclic } from "@ratmath/structures";

const S = symmetric(4);
S.normalSubgroups().map((N) => N.order);      // [1, 4, 12, 24]
const V = S.subgroup(["(1 2)(3 4)", "(1 3)(2 4)"]);
isIsomorphic(S.quotient(V), symmetric(3));    // true: S4/V4 ≅ S3

const D = dihedral(4);
const Q = D.quotient(D.centre());
Q.order;                                      // 4
isIsomorphic(Q, kleinFour());                 // true
String(Q.cosetOf("r"));                       // "rZ"

S.quotient(S.subgroup(["(1 2)"]));            // throws: not a normal subgroup

Composition series

A group is simple when its only normal subgroups are 1 and itself. Cutting a group down by maximal normal subgroups, G=G0⊵G1⊵⋯⊵1G = G_0 \trianglerighteq G_1 \trianglerighteq \cdots \trianglerighteq 1, gives simple quotients Gi/Gi+1G_i/G_{i+1}, the composition factors. By the Jordan–Hölder theorem they are the same for every such series, up to order: they are the group's building blocks, the way primes are for whole numbers. A finite group is solvable exactly when all its composition factors are cyclic of prime order.

import { symmetric, alternating, PSL } from "@ratmath/structures";

symmetric(4).compositionSeries().factors;   // [2, 3, 2, 2]
String(symmetric(4).compositionSeries());   // "24 ⊳ 12 ⊳ 4 ⊳ 2 ⊳ 1"
symmetric(5).compositionSeries().factors;   // [2, 60]: A5 is a factor
alternating(5).isSimple;                     // true
PSL(2, 7).isSimple;                          // true, order 168
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