OctoInform Beta

OpenAI preprint, September 2026 · §2. Joint refinement and its bijective game

Proposition 2.3: Stack-machine decision expressions, refinement table correctness, and exponential array-size bounds for WL\mathrm{WL} and SubWL\mathrm{SubWL}

Exponential-time stack-machine recipes for Weisfeiler-Leman equivalence.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The setting

The decision problem WL\mathrm{WL} asks, given two finite simple graphs GG and HH and an integer k≥2k \ge 2, whether GG and HH are indistinguishable by kk-dimensional joint-update Weisfeiler-Leman refinement, written G≡kHG \equiv_k H. The promise problem SubWL\mathrm{SubWL} restricts WL\mathrm{WL} to pairs of connected graphs of equal positive order and maximum degree at most 33. Proposition 2.3 establishes exponential-time computability for both problems by constructing explicit stack-machine decision expressions, proving that the underlying refinement program decides kk-WL equivalence whenever its capacity parameter accommodates all vertex kk-tuples, and bounding the bit length of the packed refinement table exponentially in the input length.

A finite simple graph GG consists of an order |V(G)|∈ℕ|V(G)| \in \mathbb{N} and a symmetric, irreflexive adjacency relation on the vertex set V(G)={0,…,|V(G)|−1}V(G) = \{0, \dots, |V(G)| - 1\}.✦ For k∈ℕk \in \mathbb{N}, a vertex kk-tuple is a map v:{0,…,k−1}→V(G)v : \{0, \dots, k - 1\} \to V(G), and v[i←z]v[i \leftarrow z] denotes the tuple obtained from vv by replacing its ii-th coordinate with z∈V(G)z \in V(G).✦ The kk-WL color type is defined recursively by round s∈ℕs \in \mathbb{N}: round-00 colors are maps from {0,…,k−1}2\{0, \dots, k - 1\}^2 to pairs of Booleans, and round-(s+1)(s + 1) colors pair a round-ss color with a multiset of kk-tuples of round-ss colors.✦ The kk-WL tuple coloring χsG(v)\chi_s^G(v) records at round 00, for every ordered pair of coordinates (i,j)(i, j), whether vi=vjv_i = v_j and whether viv_i is adjacent to vjv_j in GG. For s≥0s \ge 0, it is updated jointly by χs+1G(v)=(χsG(v),{{(χsG(v[0←z]),…,χsG(v[k−1←z])):z∈V(G)}}).\begin{aligned} \chi_{s+1}^G(v) = \Bigl(\chi_s^G(v),\; \bigl\{\!\bigl\{ \bigl(\chi_s^G(v[0 \leftarrow z]), \dots, \chi_s^G(v[k - 1 \leftarrow z])\bigr) \\ : z \in V(G) \bigr\}\!\bigr\}\Bigr). \end{aligned}(1) The round-ss color histogram of GG is the multiset {{χsG(v):v∈V(G)k}}\{\!\{\chi_s^G(v) : v \in V(G)^k\}\!\}.✦ Two finite simple graphs GG and HH satisfy G≡kHG \equiv_k H if their round-ss color histograms coincide for every s∈ℕs \in \mathbb{N}.✦ For a graph GG and dimension k∈ℕk \in \mathbb{N}, the capped dimension is κ(G,k)=min⁡(k,max⁡(2,|V(G)|)).\kappa(G, k) = \min\bigl(k,\, \max(2, |V(G)|)\bigr).(2)✦

Binary encodings

A binary word is a finite sequence w∈{0,1}*w \in \{0, 1\}^* of bits, with empty word ε\varepsilon and length |w||w|.✦ Write [0][0] and [1][1] for the one-bit words, and 1a1^a for the aa-bit all-ones word representing a∈ℕa \in \mathbb{N} in unary. The binary numeric value of a word w=b0b1⋯bm−1w = b_0 b_1 \cdots b_{m-1} is val(w)=∑i=0m−1bi2i\mathrm{val}(w) = \sum_{i=0}^{m-1} b_i 2^i, with val(ε)=0\mathrm{val}(\varepsilon) = 0.✦

A unary length header at the start of a word has the form 1m01^m 0; decoding the header extracts the natural number mm together with the remaining suffix, and fails if the word contains no 00 bit.✦ Decoding an integer from ww reads a unary header (m,u)(m, u), checks that m≤|u|m \le |u|, takes the next mm bits bb, evaluates a=val(b)a = \mathrm{val}(b), verifies that bb equals the canonical least-significant-bit-first binary representation of aa, and returns aa with the suffix after those mm bits.✦

For n∈ℕn \in \mathbb{N}, a word v∈{0,1}*v \in \{0, 1\}^* is a valid adjacency matrix word of order nn if |v|=n2|v| = n^2, entry (i,j)(i, j) at index in+jin + j equals entry (j,i)(j, i) for all i,j∈{0,…,n−1}i, j \in \{0, \dots, n - 1\}, and every diagonal entry (i,i)(i, i) is 00.✦ Each valid word defines a finite simple graph on {0,…,n−1}\{0, \dots, n - 1\}, and mat(G)\mathrm{mat}(G) denotes the adjacency matrix word of a graph GG. Decoding a graph from ww decodes an order nn, reads the next n2n^2 bits as a valid adjacency matrix word to recover a graph GG, and returns GG with the remaining suffix.✦ Decoding a graph pair instance pair(w)\mathrm{pair}(w) decodes a graph GG, then a graph HH from the suffix, then an integer k∈ℕk \in \mathbb{N}, and succeeds with (G,H,k)(G, H, k) precisely when no trailing bits remain.✦

Stack machines and polynomial-time expressions

For m∈ℕm \in \mathbb{N}, a store of a (m+1)(m + 1)-stack machine assigns a binary word to each of m+1m + 1 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 b∈{0,1}b \in \{0, 1\}, chosen as a function of the current head vector. Structured stack-machine programs are built from a no-op (00 steps), an atomic head-conditioned action (11 step), sequential composition (11 step of overhead plus the steps of both parts), head-conditioned branching (11 step of overhead), and head-conditioned while-loops (00 steps when the guard is false, and 22 steps of overhead per true iteration). A store transformation ff is realized in time TT if there exist e∈ℕe \in \mathbb{N} initially empty auxiliary stacks and a program on m+1+em + 1 + e stacks that transforms every extended store to the extended image f(s)f(s) in at most T(s)T(s) steps, leaving all auxiliary stacks empty.✦

An nn-word environment is a tuple v=(v0,…,vn−1)v = (v_0, \dots, v_{n-1}) of binary words; it is bounded by C∈ℕC \in \mathbb{N} if |vi|≤C|v_i| \le C for every ii. A certified stack recipe of arity nn specifies a word function PP, a time bound TPT_P, and the guarantee that for any stack machine, register assignment ρ\rho, and output stack oo, updating stack oo to P(s∘ρ)P(s \circ \rho) is realized in time TP(s∘ρ)+3|s(o)|T_P(s \circ \rho) + 3|s(o)|.✦ A function f:ℕ→ℕf : \mathbb{N} \to \mathbb{N} has polynomial growth if there exist c,d∈ℕc, d \in \mathbb{N} such that f(N)≤c(N+1)df(N) \le c(N + 1)^d for all N∈ℕN \in \mathbb{N}.✦ A certified recipe is polynomial-time if there exists a polynomial-growth function ff such that TP(v)+|P(v)|≤f(C)T_P(v) + |P(v)| \le f(C) whenever vv is bounded by CC.✦ Write ℰn\mathcal{E}_n for the collection of polynomial-time expressions of arity nn, where E∈ℰnE \in \mathcal{E}_n has word value E(v)∈{0,1}*E(v) \in \{0, 1\}^* and numeric value |E(v)|∈ℕ|E(v)| \in \mathbb{N}.

The class ℰn\mathcal{E}_n contains input variables x0,…,xn−1x_0, \dots, x_{n-1} and constant words (including unary numerals 1a1^a), and is closed under word length, word reversal rev\mathrm{rev}, prefix and suffix slicing, bit lookup, Boolean connectives and conditionals, unary addition, truncated subtraction, multiplication, integer division and remainder, minimum, maximum, capped exponentiation min⁡(ab,c)\min(a^b, c), 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 WW and a capacity expression CC: 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 33, and full reachability in the NN-step reachability matrix obtained by iterating one-hop extension NN times from the N×NN \times N identity matrix.

Refinement programs and packed arrays

For finite simple graphs GG and HH and k∈ℕk \in \mathbb{N}, the concrete numeric refinement data is the five-tuple data(G,H,k)=(|V(G)|,|V(H)|,k,mat(G),mat(H))\mathrm{data}(G, H, k) = (|V(G)|, |V(H)|, k, \mathrm{mat}(G), \mathrm{mat}(H)).✦ Symbolic refinement program data DD of arity nn is a six-tuple (NL,NR,K,AL,AR,C)(N_L, N_R, K, A_L, A_R, C) of expressions in ℰn\mathcal{E}_n, whose evaluation at an environment vv is evalD(v)=(|NL(v)|,|NR(v)|,|K(v)|,AL(v),AR(v))\mathrm{eval}_D(v) = (|N_L(v)|, |N_R(v)|, |K(v)|, A_L(v), A_R(v)). The environment vv satisfies the capacity condition for DD if 1≤|C(v)|,|NL(v)||K(v)|≤|C(v)|,|NR(v)||K(v)|≤|C(v)|.\begin{aligned} 1 &\le |C(v)|, \\ |N_L(v)|^{|K(v)|} &\le |C(v)|, \\ |N_R(v)|^{|K(v)|} &\le |C(v)|. \end{aligned}(3)✦

Given symbolic data DD, let mLm_L and mRm_R be the capped tuple counts obtained from NL,NR,K,CN_L, N_R, K, C by capped exponentiation, and set M=mL+mRM = m_L + m_R. Indexing tuples in the disjoint union by {0,…,M−1}\{0, \dots, M - 1\} with coordinates extracted in base order via capped powers, the initial M×MM \times M 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 M2M^2 times yields a polynomial-time final refinement array expression. The acceptance expression AD∈ℰnA_D \in \mathcal{E}_n tests whether every equivalence class in the final array has equal multiplicity among the mLm_L left tuples and the mRm_R right tuples.✦

Given expressions W,C∈ℰnW, C \in \mathcal{E}_n, let Dparsed(W,C)D_{\mathrm{parsed}}(W, C) be the symbolic refinement data formed from the decoded orders and adjacency matrices of the two graphs in WW, the capped dimension min⁡(k,max⁡(2,nL))\min(k, \max(2, n_L)) computed from the decoded dimension kk and first graph order nLn_L, and the capacity CC.✦ The general decision expression Gen(W,C)∈ℰn\mathrm{Gen}(W, C) \in \mathcal{E}_n is the conjunction of pair validity for WW, the bound k≥2k \ge 2 on the decoded dimension, and ADparsed(W,C)A_{D_{\mathrm{parsed}}(W, C)}.✦ The subcubic decision expression Sub(W,C)∈ℰn\mathrm{Sub}(W, C) \in \mathcal{E}_n is the conjunction of Gen(W,C)\mathrm{Gen}(W, C) with the connected subcubic promise applied to the two decoded graphs.✦

For finite simple graphs GG and HH, a dimension k′∈ℕk' \in \mathbb{N}, and a round s∈ℕs \in \mathbb{N}, the packed refinement array RG,H,k′(s)∈{0,1}*R_{G, H, k'}(s) \in \{0, 1\}^* packs the initial refinement table of (G,H,k′)(G, H, k') at s=0s = 0, and at s+1s + 1 unpacks RG,H,k′(s)R_{G, H, k'}(s), applies one refinement update, and packs the resulting table.✦

The claim

Proposition 2.3. Let x0x_0 and x1x_1 denote the two input variables of arity-22 polynomial-time stack-machine expressions.

  1. The general and subcubic decision expressions EWL,ESubWL∈ℰ2E_{\mathrm{WL}}, E_{\mathrm{SubWL}} \in \mathcal{E}_2 are defined by EWL=Gen(rev(x1),x0)E_{\mathrm{WL}} = \mathrm{Gen}(\mathrm{rev}(x_1), x_0)(4)✦ and ESubWL=Sub(rev(x1),x0).E_{\mathrm{SubWL}} = \mathrm{Sub}(\mathrm{rev}(x_1), x_0).(5)✦

  2. Let DD be symbolic refinement program data of arity nn, let vv be an nn-word environment satisfying the capacity condition (3) for DD, let GG and HH be finite simple graphs, and let k∈ℕk \in \mathbb{N}. If evalD(v)=data(G,H,k)\mathrm{eval}_D(v) = \mathrm{data}(G, H, k), then AD(v)=[1]⇔G≡kH.A_D(v) = [1] \iff G \equiv_k H.(6)✦

  3. Let w∈{0,1}*w \in \{0, 1\}^*, let GG and HH be finite simple graphs, and let k∈ℕk \in \mathbb{N}. If pair(w)=(G,H,k)\mathrm{pair}(w) = (G, H, k), then for every s∈ℕs \in \mathbb{N}, the packed refinement array at the capped dimension (2) satisfies |RG,H,κ(G,k)(s)|≤22((|w|+2)2+1).\bigl|R_{G, H, \kappa(G, k)}(s)\bigr| \le 2^{2((|w| + 2)^2 + 1)}.(7)✦

In the paper, the result reads: both WL\mathrm{WL} and SubWL\mathrm{SubWL} belong to EXPTIME\mathrm{EXPTIME}; more precisely, after checking their respective input conditions, an input of common graph order n≥2n \ge 2 and total bit length LL can be decided in time 2O(nlog⁡n)LO(1)2^{O(n \log n)} L^{O(1)}, 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.