The setting
The decision problem asks, given two finite simple graphs and and an integer , whether and are indistinguishable by -dimensional joint-update Weisfeiler-Leman refinement, written . The promise problem restricts to pairs of connected graphs of equal positive order and maximum degree at most . Proposition 2.3 establishes exponential-time computability for both problems by constructing explicit stack-machine decision expressions, proving that the underlying refinement program decides -WL equivalence whenever its capacity parameter accommodates all vertex -tuples, and bounding the bit length of the packed refinement table exponentially in the input length.
A finite simple graph consists of an order and a symmetric, irreflexive adjacency relation on the vertex set .✦ For , a vertex -tuple is a map , and denotes the tuple obtained from by replacing its -th coordinate with .✦ The -WL color type is defined recursively by round : round- colors are maps from to pairs of Booleans, and round- colors pair a round- color with a multiset of -tuples of round- colors.✦ The -WL tuple coloring records at round , for every ordered pair of coordinates , whether and whether is adjacent to in . For , it is updated jointly by (1) The round- color histogram of is the multiset .✦ Two finite simple graphs and satisfy if their round- color histograms coincide for every .✦ For a graph and dimension , the capped dimension is (2)✦
Binary encodings
A binary word is a finite sequence of bits, with empty word and length .✦ Write and for the one-bit words, and for the -bit all-ones word representing in unary. The binary numeric value of a word is , with .✦
A unary length header at the start of a word has the form ; decoding the header extracts the natural number together with the remaining suffix, and fails if the word contains no bit.✦ Decoding an integer from reads a unary header , checks that , takes the next bits , evaluates , verifies that equals the canonical least-significant-bit-first binary representation of , and returns with the suffix after those bits.✦
For , a word is a valid adjacency matrix word of order if , entry at index equals entry for all , and every diagonal entry is .✦ Each valid word defines a finite simple graph on , and denotes the adjacency matrix word of a graph . Decoding a graph from decodes an order , reads the next bits as a valid adjacency matrix word to recover a graph , and returns with the remaining suffix.✦ Decoding a graph pair instance decodes a graph , then a graph from the suffix, then an integer , and succeeds with precisely when no trailing bits remain.✦
Stack machines and polynomial-time expressions
For , a store of a -stack machine assigns a binary word to each of stacks, and its head vector records the top bit (or emptiness) of each stack. At each atomic step, each stack independently keeps its contents, pops its top bit (leaving an empty stack unchanged), or pushes a bit , chosen as a function of the current head vector. Structured stack-machine programs are built from a no-op ( steps), an atomic head-conditioned action ( step), sequential composition ( step of overhead plus the steps of both parts), head-conditioned branching ( step of overhead), and head-conditioned while-loops ( steps when the guard is false, and steps of overhead per true iteration). A store transformation is realized in time if there exist initially empty auxiliary stacks and a program on stacks that transforms every extended store to the extended image in at most steps, leaving all auxiliary stacks empty.✦
An -word environment is a tuple of binary words; it is bounded by if for every . A certified stack recipe of arity specifies a word function , a time bound , and the guarantee that for any stack machine, register assignment , and output stack , updating stack to is realized in time .✦ A function has polynomial growth if there exist such that for all .✦ A certified recipe is polynomial-time if there exists a polynomial-growth function such that whenever is bounded by .✦ Write for the collection of polynomial-time expressions of arity , where has word value and numeric value .
The class contains input variables and constant words (including unary numerals ), and is closed under word length, word reversal , prefix and suffix slicing, bit lookup, Boolean connectives and conditionals, unary addition, truncated subtraction, multiplication, integer division and remainder, minimum, maximum, capped exponentiation , length comparisons, bounded loop iteration, bounded universal and existential quantification, predicate counting, and bit-array collection. From these combinators, the Lean library builds polynomial-time expressions parameterized by an instance word expression and a capacity expression : unary header length and capped binary decoding (each folding over the reversed word), integer and adjacency matrix validity, graph and pair validity, and the connected subcubic promise. The promise checks that both graphs have equal positive order, maximum degree at most , and full reachability in the -step reachability matrix obtained by iterating one-hop extension times from the identity matrix.
Refinement programs and packed arrays
For finite simple graphs and and , the concrete numeric refinement data is the five-tuple .✦ Symbolic refinement program data of arity is a six-tuple of expressions in , whose evaluation at an environment is . The environment satisfies the capacity condition for if (3)✦
Given symbolic data , let and be the capped tuple counts obtained from by capped exponentiation, and set . Indexing tuples in the disjoint union by with coordinates extracted in base order via capped powers, the initial bit array records whether two tuples have the same coordinate equalities and adjacencies. Each refinement step updates a bit array by requiring prior equivalence together with matching substitution-profile multiplicities across the vertex ranges of the two graphs. Iterating this update times yields a polynomial-time final refinement array expression. The acceptance expression tests whether every equivalence class in the final array has equal multiplicity among the left tuples and the right tuples.✦
Given expressions , let be the symbolic refinement data formed from the decoded orders and adjacency matrices of the two graphs in , the capped dimension computed from the decoded dimension and first graph order , and the capacity .✦ The general decision expression is the conjunction of pair validity for , the bound on the decoded dimension, and .✦ The subcubic decision expression is the conjunction of with the connected subcubic promise applied to the two decoded graphs.✦
For finite simple graphs and , a dimension , and a round , the packed refinement array packs the initial refinement table of at , and at unpacks , applies one refinement update, and packs the resulting table.✦
The claim
Proposition 2.3. Let and denote the two input variables of arity- polynomial-time stack-machine expressions.
The general and subcubic decision expressions are defined by (4)✦ and (5)✦
Let be symbolic refinement program data of arity , let be an -word environment satisfying the capacity condition (3) for , let and be finite simple graphs, and let . If , then (6)✦
Let , let and be finite simple graphs, and let . If , then for every , the packed refinement array at the capped dimension (2) satisfies (7)✦
In the paper, the result reads: both and belong to ; more precisely, after checking their respective input conditions, an input of common graph order and total bit length can be decided in time , with absolute constants in the exponents. The expressions (4) and (5) take an instance word together with an explicit capacity word, while (6) establishes correctness of the refinement acceptance core under the capacity bound and (7) bounds the packed refinement array length exponentially in the input length.
What is checked
Proposition 2.3 is stated over finite simple graphs, binary encodings of graph pairs and dimensions, polynomial-time certified stack-machine expressions on binary word environments, symbolic refinement program data satisfying the capacity condition (3), and packed refinement arrays under the capped dimension (2). Beyond the claims in (4), (5), (6), and (7), the Lean library proves that the input and constant recipes, unary header length, capped binary decoding, graph reachability matrix, and iterated refinement array program are polynomial-time certified stack recipes.