Groups

Presentations and coset enumeration

The shortest description of a group is often a few generators and the rules they obey: a turn of order 4, a flip of order 2, and a flip then a turn is a flip. Coset enumeration turns such a description back into the group itself.

Generators and relations

A presentation ⟨a,b∣r1,r2,… ⟩\langle a, b \mid r_1, r_2, \dots\rangle lists generators and relators, words that are declared equal to the identity. The group it presents is the largest one generated by a,ba, b in which those words are trivial: every other equation in it follows from the relators. A relation u=vu = v is the relator uv−1uv^{-1}.

  • ⟨a∣an⟩\langle a \mid a^n\rangle is the cyclic group CnC_n.
  • ⟨a,b∣an,b2,(ab)2⟩\langle a, b \mid a^n, b^2, (ab)^2\rangle is the dihedral group DnD_n of order 2n2n.
  • ⟨a,b∣a2,b3,(ab)k⟩\langle a, b \mid a^2, b^3, (ab)^k\rangle has order 6, 12, 24, 60 for k=2,3,4,5k = 2, 3, 4, 5: S3,A4,S4,A5S_3, A_4, S_4, A_5, the rotation groups of the regular solids. For k≥6k \ge 6 it is infinite.
  • ⟨a,b∣ab=ba⟩\langle a, b \mid ab = ba\rangle is Z2\mathbb Z^2, and ⟨a,b∣ ⟩\langle a, b \mid\ \rangle is the free group.

Words are written as on paper: a^2 b^-1 or a²b⁻¹, (ab)^3, the commutator [a, b] =a−1b−1ab= a^{-1}b^{-1}ab, and a capital letter for an inverse, A =a−1= a^{-1}.

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

const P = presentation("a, b | a^2, b^3, (ab)^5");
P.order();                         // 60
P.index(["b"]);                    // 20: the cosets of the subgroup ⟨b⟩ of order 3
String(P.abelianInvariants());     // "1": the group is perfect

const D = presentation("a, b | a^4, b^2, (ab)^2").toGroup();
D.elements.map((x) => D.format(x));   // ["e", "a", "b", "a²", "ab", "a⁻¹b", "a⁻¹", "a²b"]
D.format(D.mul("b", "a"));            // "a⁻¹b"

Todd–Coxeter coset enumeration

Whether a presentation describes a finite group cannot be decided in general (the word problem is unsolvable), but when the group, or the index of a subgroup, is finite, coset enumeration finds it. Given a subgroup HH generated by some words, it builds a table of the right cosets HgHg and how each generator moves them:

  1. Start with one coset, HH itself, numbered 0.
  2. For every coset cc and every relator rr, trace rr from cc both forwards and backwards through the table. The relator is trivial, so the trace must come back to cc. Where the table has a gap, either the two ends meet and the gap is filled (a deduction), or a new coset is defined to continue.
  3. If a trace ends at a coset d≠cd \ne c, then cc and dd are the same coset (a coincidence); merge them, and merge whatever that forces.
  4. When every coset has every generator defined and every relator closes up, the table is complete: the number of cosets is [G:H][G : H].

This library uses the Hasselgrove–Leech–Trotter order of work, which defines cosets freely and cleans up with coincidences. If more than maxCosets cosets (500,000 by default) are alive at once it stops and says so, which is what an infinite group does. With H=1H = 1 the cosets are the elements, and toGroup() gives the group with each element printed as a shortest word.

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

const T = presentation("a, b | a^4, b^2, (ab)^2").enumerate(["b"]);
T.index;                 // 4: ⟨b⟩ has index 4 in D4
T.table;                 // [[1, 0], [3, 2], [0, 1], [2, 3]]: coset c·a and c·b for each c
T.representatives;       // [[], [1], [-1], [1, 1]]: H, Ha, Ha⁻¹, Ha²

// the Fibonacci group F(2, 5): five generators, each the product of the two before
presentation("a, b, c, d, e | ab = c, bc = d, cd = e, de = a, ea = b").order();   // 11

presentation("a, b | a^3, b^3, (ab)^3").order({ maxCosets: 2000 });   // throws: this group is infinite

A presentation of any finite group

Every finite group has a presentation: take its generators, and for each step x→xsx \to xs in its Cayley graph that is not in a chosen spanning tree, the relator that walks the tree to xx, takes the step, and walks back. presentationOf(G) does this (it is Schreier's method). The presentations are long but correct, and coset enumeration on them gives back a group isomorphic to GG; the tests check this for every group of order up to 20.

import { presentationOf, quaternion, symmetric } from "@ratmath/structures";

String(presentationOf(quaternion()));
// "⟨a, b | b²a⁻², abab⁻¹, ba²b⁻¹a⁻², baba⁻¹, a⁴, a³ba⁻¹b⁻¹, a²b²⟩"
presentationOf(symmetric(4)).order();   // 24
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