Proofs: nauty
These are the human proofs of nauty, at full length.
The individualization-refinement search returns a canonical form and the automorphism group order full
This proof shows: correctness, termination.
Setting. is a simple undirected graph on with a vertex coloring . A permutation of acts on graphs, colorings and ordered partitions by renaming vertices; is the renamed graph. An automorphism is a with and . For a discrete ordered partition , the labeling maps to , and the leaf value is the pair (colors of , adjacency rows of relabeled by ). The full tree has the root , where is REFINE and the color partition, and a node that is not discrete has the children for in the target cell, where is individualization.
Lemma 1 (invariance). For every permutation : , , the target cell index of equals that of , and for discrete .
Proof. REFINE splits cells by the number of neighbors in a splitter cell and orders the pieces by that number; renaming changes neither the numbers nor the order of cells, so every step commutes with . Individualization places at the index of its cell, which is also invariant. TARGET-CELL uses only cell sizes and indices. For the leaf value, lists , and in exactly when in , with the same colors.
Hence maps onto , node by node, and leaves with equal values.
Lemma 2 (equal leaf values give automorphisms). If leaves of have , then is an automorphism, and .
Proof. maps the vertex at position of to the vertex at position of . Equal colors and equal relabeled rows mean that iff and . This is the map recorded in L6.
Lemma 3 (pruning is safe). Let be a node with prefix and children , and let be an automorphism fixing every vertex of with . Then the subtrees under and have the same sets of leaf values. The same holds when is a product of such automorphisms.
Proof. The node is obtained from the root by refining and individualizing the vertices of in order; since fixes and , Lemma 1 gives . Then maps the child to , and by Lemma 1 it maps the subtree of the first onto the subtree of the second with equal leaf values. Products of automorphisms fixing fix .
Theorem. The search terminates. It returns , so exactly when as colored graphs; and the returned order equals .
Proof. Termination. Each child has strictly more cells than its parent, since splits a cell of size at least 2 and REFINE never merges cells, so the depth is at most ; each node has at most children and each frame scans its target cell once. REFINE stops because each repetition increases the number of cells.
Maximum. L9 skips a child only if it lies in the orbit of an explored sibling under automorphisms that fix the prefix, so by Lemma 3 the skipped subtree has the same leaf values as an explored one. By induction on the height, the explored leaves have the same set of values as all leaves of , and L5 to L7 keep the maximum.
Canonical form. If , Lemma 1 maps onto with the same leaf values, so . Conversely, is the value of a leaf of , which is the colored graph relabeled by a bijection; if , both graphs are isomorphic to the same relabeled graph.
Group order. Let be the first path, where is the first leaf, the prefix of , its target cell, and its first child. Let be the automorphisms fixing pointwise, so . By Lemma 1, fixes , so it maps to itself; is the stabilizer of in ; and is trivial because it fixes the discrete partition . By the orbit-stabilizer theorem, . It remains to show that the generators found that fix have the orbit . One inclusion is clear. For the other, let with . The child of is either explored or skipped. If it is skipped, it is in the orbit of an explored child under found automorphisms fixing , so it suffices to show that each explored child in the -orbit of is joined to . The subtree of is the image under some with of the subtree of , so it contains leaves with value ; by the argument of the maximum part applied inside that subtree, the search reaches at least one leaf with . At that leaf L6 records with (Lemma 2); REFINE and individualization replace a cell by its pieces in place, so in every leaf below a vertex that is a singleton of sits at position equal to the number of vertices in the earlier cells of , and the vertex individualized from sits at the first position of . So , which maps the vertex at each position of to the vertex at the same position of , fixes every vertex of and maps to . So , , and . (If the value at equals both stored values, L6 compares with the first leaf first, which is the case used here.) Hence the orbits agree, and L11 computes .