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 lists generators and relators, words that are declared equal to the identity. The group it presents is the largest one generated by in which those words are trivial: every other equation in it follows from the relators. A relation is the relator .
- is the cyclic group .
- is the dihedral group of order .
- has order 6, 12, 24, 60 for : , the rotation groups of the regular solids. For it is infinite.
- is , and is the free group.
Words are written as on paper: a^2 b^-1 or a²b⁻¹, (ab)^3, the commutator [a, b] , and a capital letter for an inverse, A .
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 generated by some words, it builds a table of the right cosets and how each generator moves them:
- Start with one coset, itself, numbered 0.
- For every coset and every relator , trace from both forwards and backwards through the table. The relator is trivial, so the trace must come back to . 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.
- If a trace ends at a coset , then and are the same coset (a coincidence); merge them, and merge whatever that forces.
- When every coset has every generator defined and every relator closes up, the table is complete: the number of cosets is .
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 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 in its Cayley graph that is not in a chosen spanning tree, the relator that walks the tree to , 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 ; 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
@ratmath/structures and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.