Proofs: Luks's algorithm
These are the human proofs of Luks's algorithm, at full length.
Luks's divide and conquer computes the set of string isomorphisms full
This proof shows: correctness, termination.
Setting. is a permutation group on , given by generators; permutations are applied left to right, so . For a -invariant window and strings colors, let
The routine returns a pair with , or none when the set is empty. is the Schreier-Sims algorithm; we use only that its strong generators generate the same group as its input, which holds because every input generator either becomes a strong generator or sifts to the identity, that is, is a product of transversal elements, which are products of strong generators.
Lemma 1 (cosets). If contains , it equals , where is a subgroup of .
Proof. contains the identity and is closed under products and inverses, since is -invariant. If then . Conversely, if and are both in Iso, then for and : , so with .
Lemma 2 (shift). For and a subgroup with invariant under : .
Proof. .
Lemma 3 (chain rule, L2 to L5). Let be the -orbits. After the -th pass of L4, .
Proof. By induction on ; for , . The orbit is -invariant, hence -invariant. The elements of that also satisfy the condition on are, by Lemma 2, . By induction on the size of the window (see termination) the recursive call returns this set as , or none; the new coset is , which is what L4 stores. If the call returns none, the whole set is empty.
Lemma 4 (transitive case, L6 to L9). Let be transitive on , , a block system with at least two blocks, the kernel of the action on , and a transversal of in . Then , and if it is not empty it equals , where are the elements found in L7 and .
Proof. The generators of come from Schreier's lemma: for the transversal indexed by the image in , the elements for and generators generate the kernel. Each block is -invariant, so is -invariant and the recursive calls are allowed. , and Lemma 2 gives the union. Each nonempty term is by Lemma 1, with the same in every term. Let ; by Lemma 1 the union is . Each lies in (it maps to and back), and , so . Conversely, for , lies in some term , so .
Base case (L1). If , every fixes , so the set is when and empty otherwise.
Theorem. STRING-ISO returns as a coset with , or none when it is empty.
Proof. By induction on the measure in lexicographic order, where if is transitive on and otherwise. Calls in L4 are on orbits of size less than , since there are at least two orbits. Calls in L7 have the same , but fixes every one of at least two blocks, so it is intransitive and drops from 1 to 0. The cases are covered by the base case and Lemmas 3 and 4.
Graph isomorphism. In COLORED-GRAPH-ISOMORPHISM, is the product of the symmetric groups on the color classes, acting on vertices and on unordered pairs of vertices, and mark the edges of the two graphs on the window of pairs. A vertex permutation that keeps colors lies in exactly when is an edge of the first graph iff is an edge of the second, that is, when it is an isomorphism. The group acts faithfully on vertices, so is the number of color-preserving automorphisms.
Termination. The measure decreases at every recursive call and takes finitely many values. Each loop is over a finite list: orbits, a finite transversal built by breadth-first search over a finite group, and Schreier-Sims, which adds strong generators only when they enlarge a basic orbit or the base, at most finitely often.