The setting
The variable-dimension Weisfeiler-Leman equivalence problem asks, given two finite simple graphs and together with an integer dimension , whether and cannot be distinguished by the -dimensional Weisfeiler-Leman refinement algorithm. Corollary 6.2 establishes the correctness of the general-graph compilation of a time-bounded multitape Turing machine on an input binary word : the compiled pair of finite simple graphs and at dimension encodes a yes-instance of if and only if outputs the acceptance bit on .
A binary word is a finite list of Boolean values✦, and a formal language is a set of binary words.✦ A finite simple graph consists of a natural number order together with a simple graph structure on the vertex set .✦ For a natural number , a vertex -tuple of is a function .✦ The -WL color types are defined recursively by round : a round- color assigns to each pair a pair of Booleans, and a round- color pairs a round- color with a multiset of maps from to round- colors.✦
The -WL tuple coloring assigns to each vertex -tuple its round- color recording, for every ordered pair , whether and whether and are adjacent in . At round , it sets (1) where replaces coordinate of with . The -WL color histogram of at round is the multiset of colors over all vertex -tuples of .✦ Two finite simple graphs and are -WL equivalent, written , if their -WL color histograms agree at every round .✦
A fixed binary encoding represents each finite simple graph as a binary word. The prefix-free integer encoding of a natural number consists of as many bits as the length of the binary representation of , followed by a single and then the binary representation of .✦ Concatenating the binary encodings of , , and gives the instance encoding .✦ The decision problem is the formal language (2)✦
Turing machines and one-head simulation
A multitape Turing machine is given by its number of non-initial control states, its number of work symbols, its number of extra tapes, and a partial transition function.✦ Its control states lie in , its tape alphabet is , and its tapes are indexed by . A head motion direction is left, stay, or right, with integer head displacement , , or , respectively. Given a control state and the tuple of scanned symbols on all tapes, the transition function either halts or returns a next control state together with a written symbol and head motion direction for each tape.
A configuration of specifies a control state, an integer head position for each tape, and a tape content map assigning a tape symbol to every integer cell of every tape.✦ The scanned tape symbols of a configuration are the symbols stored at each tape’s head position.✦ A single transition step evaluates the transition function on the current state and scanned symbols and, when defined, updates the control state, shifts each head by its displacement, and overwrites each scanned cell.✦ Starting from the initial configuration of on a binary word , iterating single transition steps (and remaining fixed once halted) gives the configuration after steps.✦ The tape encoding of a binary word places for and for at nonnegative positions , and everywhere else.✦ The machine outputs on input within time bound if there exists such that the configuration after steps has no further transition and tape holds the tape encoding of .✦
To compile into a cellular automaton, the Lean library first simulates by a multi-stack program, where each tape is split into two stacks and over the tape alphabet . The program uses registers holding the scanned symbols, optional transition output data (defaulting to state , symbol , and stay on all tapes), and a Boolean answer bit. At each simulation label for a state, the program peeks all stacks over the list of all tapes, evaluates the transition function, and either updates all tapes and jumps to the next simulation label or, upon halting, clears the answer bit and drains both stacks of tape , setting the answer bit to if symbol appears. The stack operation count of a statement counts pushes, peeks, and pops along the longest branch✦, and the maximum stack operations is the maximum over all multi-stack labels.✦
Translating the multi-stack program to an intermediate single-tape program gives a finite intermediate label support and a maximum instruction count , where the instruction count of a statement counts moves and writes along the longest branch plus for a jump or halt. A second translation produces a base Turing program supported on its translated base label support. Adapting that base program over its supported control states and single-tape alphabet yields an equivalent one-head machine program: moves keep the scanned symbol while shifting the head, writes overwrite the symbol with stay, and a state-symbol pair is accepting when the answer bit is . Each bit of an input word is encoded as for and for and mapped to the encoded one-head input on stack slot .
For natural numbers and and an input length , the linear simulation constant is ✦, the quadratic simulation constant is (3)✦ the input time exponent is ✦, and the simulation time exponent is .✦ For a binary word , the reduction address bit length is ✦, the reduction dimension is ✦, the subdivision parameter is ✦, and the marked reduction coordinate is .✦
Cellular automata and succinct circuit descriptions
For a natural number , binary strings of length are maps .✦ The binary value of is , which is strictly less than and defines the binary encoding bijection between binary strings of length and . Given a Boolean , a carry index , and a bit position , the carry domain is when , when , and when ✦; the cyclic carry domain with an optional carry index equals when the index is absent and the carry domain when it is present.✦ The increment bit map flips a bit when and leaves unchanged when ✦, while the cyclic increment bit map negates when the optional carry index is absent and applies the increment bit map otherwise.✦ Given a threshold string and an optional index with , the threshold bit domain at position is when is absent or , when , and when .✦
For a one-head machine program over states and alphabet , a one-head tape cell is a pair in .✦ The total transition action defaults on halt to keeping the current state and symbol with motion stay.✦ For a motion direction and a cell, the incoming head state returns the next state when the cell carries a head moving in that direction and is absent otherwise.✦ The one-head local transition rule maps a local neighborhood triple of cells to the cell whose symbol is written at (or unchanged if has no head) and whose head state is the first incoming state moving right from , staying at , or moving left from .✦ A cell is accepting when it carries a head state satisfying the program’s accepting predicate.✦ Marking index of the encoded one-head input with the start state, taking the default blank symbol with no head as the blank cell, and using the length bound below yields the reduction cellular automaton instance over one-head tape cells.
A succinct circuit description at address length specifies a scalar gate set , a conjunction gate set , an edge template set , and a request set . Circuit gates lie in , with gate input dimension on and on . Circuit ports lie in , each mapping to its port target gate in . Let be the field of bits and the space of length- binary vectors. The port input linear form on a port projects to coordinate for a scalar port or first conjunction port and to coordinate for a second conjunction port✦; the gate output linear map projects to coordinate on a scalar gate and sums both coordinates on a conjunction gate.✦ Each edge template specifies a source gate, a destination port, nonempty coordinate domains , and coordinate bit maps injective on . Each request specifies a scalar gate, a Boolean test flag, and nonempty coordinate domains.
For the reduction cellular automaton at parameter , the automaton circuit description has address length , scalar gates given by one-head tape cells, and conjunction gates given by pairs of local neighborhood triples and Booleans. Automaton circuit edges pair a local neighborhood triple with one of four edge kinds: left-, center-, and right-neighbor wires (indexed by a time carry index and, for left and right wires, an optional position carry index) and internal gate wires (indexed by a Boolean). Neighbor wires start at the corresponding cell of the triple and advance time via carry domains and increment bit maps, shifting position cyclically via cyclic carry domains and maps on left and right wires and acting as the identity on center wires; internal wires start at the auxiliary conjunction gates and use full domains and identity maps, wiring each triple into the scalar gate given by the local transition rule. Time and position domains and maps are concatenated on the first and last coordinates. Automaton request indices cover input-position seeds (at time and the input index bits), blank-cell seeds (at time and threshold domains for the input length bits), and accepting-state tests (at time and all positions).
A product scalar-image instance at address length over primary vertices and edges assigns each a dimension , each endpoints , nonempty coordinate domains , coordinate-wise injective bit maps on , linear forms and , and constants .✦ From a succinct circuit description, the circuit consistency instance takes primary vertices (of dimension on and and on and ) and comparisons . The first two copies of an edge connect its source gate to the edge vertex using the gate output linear map on the left, projections to coordinates and on the right, and identity bit maps on ; the third copy connects the edge vertex to the destination port’s target gate using the sum of coordinates on the left, the port input linear form on the right, and the edge’s bit map on . Each request connects its scalar gate to using coordinate on the left, on the right, and identity bit maps on its request domain. Every comparison has left constant . Applying this construction to the automaton circuit description produces the machine product image instance .
Affine blocks and the general realization
For a product scalar-image instance at address length and subdivision parameter , a subdivision vertex is either a primary vertex in or an interior vertex in ✦, and a subdivision link is a pair with and .✦ The left endpoint of is when and otherwise✦; its right endpoint is when and otherwise.✦ The vertex vector dimension is at a primary vertex and at every interior vertex, giving vertex value space at each subdivision vertex . The allowed vertex labels at coordinate are at primary vertices and at interior vertices of .✦
A horizontal block specifies a row , a subdivision vertex , and first and last Boolean labels✦; it is valid if its first label is allowed at and its last at .✦ A vertical readout specifies a row , a link , and a Boolean label.✦ A square block specifies a row , a link , and first and last Boolean labels✦; it is valid if its first label lies in and its last in .✦ A raw block is a horizontal or square block✦, and a valid block is a valid raw block.✦ A block readout is a horizontal block or a vertical readout, with single readout value space for a horizontal readout at and for a vertical readout. The raw block value space is on a horizontal block at , and the square value space on a square block over .
The matched link output bit of at coordinate applies when and the identity otherwise.✦ A horizontal block contains only itself as a readout. A square block on row and link contains four readouts: its left horizontal readout at the left endpoint of with its first and last bits, its right horizontal readout at the right endpoint of with the matched outputs of those bits, its bottom vertical readout at row with its first bit, and its top vertical readout at row with its last bit. Each raw block value carries its corresponding component at each readout contained in the block, defining the block readout value.
For a link , the left link constant is when and otherwise✦, the right link constant is when and otherwise✦, and the total link constant is their sum in .✦ Relative to a marked row , the marked row indicator is if and otherwise.✦ The block inhomogeneity bit is on horizontal blocks and the product of the marked row indicator and total link constant on square blocks.✦ Each link carries left and right link linear forms and from its endpoint value spaces to , and the affine boundary map sends a square value tuple to .✦ Each raw block has an additive block boundary map from its raw block value space to , equal to on horizontal blocks and to the affine boundary map of and on square blocks.✦ For a parity bit , a raw block value is legal if equals times the block inhomogeneity bit of .✦ The affine fiber is the set of legal valuations of a valid block at parity .✦
Two valid blocks share a readout if some block readout is contained in both.✦ A base vertex of parity is a pair with a valid block and .✦ Two base vertices agree if they have equal block readout values on every shared readout✦, and they are base-adjacent if their blocks are distinct, share a readout, and agree on all shared readouts.✦ Given a leaf count for each valid block , the block vertex fiber is ✦, and the general graph vertex set is the disjoint union of these fibers over all valid blocks.✦ Each vertex has an owning base vertex and is a base vertex when its leaf index is absent. Two vertices are adjacent in the general realization graph if both are base vertices that are base-adjacent, or one is a base vertex and the other is a leaf with the same owner.✦ When and are finite, numbering the valid blocks from to and letting be the number of parity- base vertices, assigning leaf count to the -th block and indexing the resulting vertices by gives the finite realization graphs and .
Applying the finite realization to at dimension , subdivision parameter , and marked coordinate produces the general reduction graphs and , and their binary encoding is the general reduction word for .✦
The claim
Corollary 6.2. Let be a multitape Turing machine, let and be natural numbers, let be a binary word, and let be a Boolean. If outputs the single-bit word on input within steps, then (4)✦
In the paper, the result reads: for every product scalar-image instance at address length , its general realization satisfies that the instance is consistent if and only if . The Lean library states the composed machine-level equivalence directly, pairing the general realization with the compiled cellular-automaton consistency instance of on so that consistency corresponds to .
What is checked
Corollary 6.2 is stated over an arbitrary multitape Turing machine , natural numbers and , a binary word , and a Boolean output produced within steps, evaluated on the binary encoding of the general realization graphs and at dimension . For the supporting constructions, the Lean library also proves that every length- binary string has binary value strictly below ✦, that the encoded one-head input has length strictly below ✦, that the base Turing program is supported on its base label support✦, and that every raw block value carries a readout value at each readout contained in its block.✦