Algorithm Search⌘K

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. GG is a permutation group on Ω={0,…,n−1}\Omega = \{0, \ldots, n-1\}, given by generators; permutations are applied left to right, so (gh)(d)=h(g(d))(gh)(d) = h(g(d)). For a GG-invariant window Δ⊆Ω\Delta \subseteq \Omega and strings x,y:Ω→x, y : \Omega \to colors, let

IsoGΔ(x,y)={g∈G:x(d)=y(g(d)) for all d∈Δ}.\mathrm{Iso}^\Delta_G(x, y) = \{ g \in G : x(d) = y(g(d)) \text{ for all } d \in \Delta \}.

The routine returns a pair (A,τ)(A, \tau) with IsoGΔ(x,y)=Aτ={aτ:a∈A}\mathrm{Iso}^\Delta_G(x, y) = A\tau = \{a\tau : a \in A\}, or none when the set is empty. Group\mathrm{Group} 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 IsoGΔ(x,y)\mathrm{Iso}^\Delta_G(x, y) contains τ\tau, it equals AutGΔ(x) τ\mathrm{Aut}^\Delta_G(x)\,\tau, where AutGΔ(x)=IsoGΔ(x,x)\mathrm{Aut}^\Delta_G(x) = \mathrm{Iso}^\Delta_G(x, x) is a subgroup of GG.

Proof. AutGΔ(x)\mathrm{Aut}^\Delta_G(x) contains the identity and is closed under products and inverses, since Δ\Delta is GG-invariant. If a∈Auta \in \mathrm{Aut} then y((aτ)(d))=y(τ(a(d)))=x(a(d))=x(d)y((a\tau)(d)) = y(\tau(a(d))) = x(a(d)) = x(d). Conversely, if gg and τ\tau are both in Iso, then for a=gτ−1a = g\tau^{-1} and d∈Δd \in \Delta: x(a(d))=y(τ(a(d)))=y(g(d))=x(d)x(a(d)) = y(\tau(a(d))) = y(g(d)) = x(d), so g=aτg = a\tau with a∈Auta \in \mathrm{Aut}. □\square

Lemma 2 (shift). For t∈Sym(Ω)t \in \mathrm{Sym}(\Omega) and a subgroup HH with Δ\Delta invariant under HH: {ht:h∈H, x(d)=y((ht)(d)) ∀d∈Δ}=IsoHΔ(x,y∘t) t\{ ht : h \in H,\ x(d) = y((ht)(d)) \ \forall d \in \Delta \} = \mathrm{Iso}^\Delta_H(x, y \circ t)\, t.

Proof. y((ht)(d))=y(t(h(d)))=(y∘t)(h(d))y((ht)(d)) = y(t(h(d))) = (y \circ t)(h(d)). □\square

Lemma 3 (chain rule, L2 to L5). Let Δ=O1∪⋯∪Or\Delta = O_1 \cup \cdots \cup O_r be the GG-orbits. After the ii-th pass of L4, Aτ=IsoGO1∪⋯∪Oi(x,y)A\tau = \mathrm{Iso}^{O_1 \cup \cdots \cup O_i}_G(x, y).

Proof. By induction on ii; for i=0i = 0, Aτ=GA\tau = G. The orbit Oi+1O_{i+1} is GG-invariant, hence AA-invariant. The elements of AτA\tau that also satisfy the condition on Oi+1O_{i+1} are, by Lemma 2, IsoAOi+1(x,y∘τ) τ\mathrm{Iso}^{O_{i+1}}_A(x, y \circ \tau)\,\tau. By induction on the size of the window (see termination) the recursive call returns this set as A′gA' g, or none; the new coset is A′(gτ)A'(g\tau), which is what L4 stores. If the call returns none, the whole set is empty. □\square

Lemma 4 (transitive case, L6 to L9). Let GG be transitive on Δ\Delta, ∣Δ∣≥2|\Delta| \ge 2, B\mathcal B a block system with at least two blocks, NN the kernel of the action on B\mathcal B, and TT a transversal of NN in GG. Then IsoGΔ(x,y)=⋃t∈TIsoNΔ(x,y∘t) t\mathrm{Iso}^\Delta_G(x, y) = \bigcup_{t \in T} \mathrm{Iso}^\Delta_N(x, y \circ t)\, t, and if it is not empty it equals ⟨A,τiτ1−1⟩τ1\langle A, \tau_i\tau_1^{-1} \rangle \tau_1, where τi=giti\tau_i = g_i t_i are the elements found in L7 and A=AutNΔ(x)A = \mathrm{Aut}^\Delta_N(x).

Proof. The generators of NN come from Schreier's lemma: for the transversal TT indexed by the image in Sym(B)\mathrm{Sym}(\mathcal B), the elements ts ts‾−1t s \,\overline{ts}^{-1} for t∈Tt \in T and generators ss generate the kernel. Each block is NN-invariant, so Δ\Delta is NN-invariant and the recursive calls are allowed. G=⋃tNtG = \bigcup_t Nt, and Lemma 2 gives the union. Each nonempty term is AgttA g_t t by Lemma 1, with the same AA in every term. Let K=AutGΔ(x)K = \mathrm{Aut}^\Delta_G(x); by Lemma 1 the union is Kτ1K\tau_1. Each τiτ1−1\tau_i\tau_1^{-1} lies in KK (it maps xx to yy and back), and A≤KA \le K, so ⟨A,τiτ1−1⟩≤K\langle A, \tau_i\tau_1^{-1} \rangle \le K. Conversely, for k∈Kk \in K, kτ1k\tau_1 lies in some term AτiA\tau_i, so k∈Aτiτ1−1k \in A\tau_i\tau_1^{-1}. □\square

Base case (L1). If Δ={d}\Delta = \{d\}, every g∈Gg \in G fixes dd, so the set is GG when x(d)=y(d)x(d) = y(d) and empty otherwise.

Theorem. STRING-ISO returns IsoGΔ(x,y)\mathrm{Iso}^\Delta_G(x, y) as a coset AτA\tau with A=AutGΔ(x)A = \mathrm{Aut}^\Delta_G(x), or none when it is empty.

Proof. By induction on the measure μ=(∣Δ∣,s)\mu = (|\Delta|, s) in lexicographic order, where s=1s = 1 if GG is transitive on Δ\Delta and 00 otherwise. Calls in L4 are on orbits of size less than ∣Δ∣|\Delta|, since there are at least two orbits. Calls in L7 have the same Δ\Delta, but NN fixes every one of at least two blocks, so it is intransitive and ss drops from 1 to 0. The cases are covered by the base case and Lemmas 3 and 4. □\square

Graph isomorphism. In COLORED-GRAPH-ISOMORPHISM, GG is the product of the symmetric groups on the color classes, acting on vertices and on unordered pairs of vertices, and x,yx, y mark the edges of the two graphs on the window of pairs. A vertex permutation pp that keeps colors lies in Iso\mathrm{Iso} exactly when {u,v}\{u, v\} is an edge of the first graph iff {p(u),p(v)}\{p(u), p(v)\} is an edge of the second, that is, when it is an isomorphism. The group acts faithfully on vertices, so ∣A∣|A| is the number of color-preserving automorphisms.

Termination. The measure μ\mu 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. ■\blacksquare

Back to Luks's algorithm