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 is a subset that is a group with the same product: it contains 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 all have elements and split into disjoint pieces. So
where the index is the number of cosets. This is Lagrange's theorem: the order of a subgroup divides the order of the group. Since has as many elements as the order of , the order of every element divides too. The converse fails: 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 has subgroups (the number and the sum of the divisors of ), which the tests check for up to 12.
Normal subgroups and quotients
A subgroup is normal, written , when for every ; 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 the cosets multiply: is well defined, and the cosets form the quotient group of order . 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, , gives simple quotients , 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
@ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.