OctoInform Beta

OpenAI preprint, September 2026 · §1. Introduction

Theorem 1.1: Deciding WLdim⁡(G)≤k\operatorname{WLdim}(G) \le k for a nonempty graph GG and positive binary integer kk under polynomial-time many-one reductions

Deciding Weisfeiler-Leman dimension is EXPTIME-complete.

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 kk-dimensional Weisfeiler-Leman refinement algorithm iteratively colors kk-tuples of vertices of a graph to test whether two graphs can be distinguished without computing an isomorphism directly. Increasing the dimension kk reveals finer structural invariants while increasing the tuple space on which refinement operates. For a given graph GG, the least positive dimension kk at which refinement distinguishes GG from every non-isomorphic graph is its Weisfeiler-Leman dimension WLdim⁡(G)\operatorname{WLdim}(G).

The decision problem studied here takes as input a nonempty finite simple undirected uncolored graph GG, given by its binary adjacency matrix, and a positive integer kk, given in binary, and asks whether WLdim⁡(G)≤k\operatorname{WLdim}(G) \le k. All graphs on this page are finite, simple, undirected, and uncolored. Dimension 11 uses ordinary neighbor color refinement, and dimensions k≥2k \ge 2 use the joint-update convention.

Weisfeiler-Leman refinement and dimension

A graph GG of order n∈ℕn \in \mathbb{N} consists of the vertex set V(G)={0,1,…,n−1}V(G) = \{0, 1, \dots, n - 1\} together with a Boolean adjacency function EG:V(G)×V(G)→{0,1}E_G : V(G) \times V(G) \to \{0, 1\} that is symmetric, EG(u,v)=EG(v,u)E_G(u, v) = E_G(v, u), and loopless, EG(u,u)=0E_G(u, u) = 0, for all u,v∈V(G)u, v \in V(G).✦ Two graphs GG and HH are isomorphic, written G≅HG \cong H, if there exists a bijection φ:V(G)→V(H)\varphi : V(G) \to V(H) such that EG(u,v)=EH(φ(u),φ(v))E_G(u, v) = E_H(\varphi(u), \varphi(v)) for all u,v∈V(G)u, v \in V(G).✦

For any set XX, write ℳ(X)\mathcal{M}(X) for the set of finite multisets over XX, and denote multisets by {{⋅}}\{\{ \cdot \}\}. The 11-WL color spaces 𝒞s(1)\mathcal{C}^{(1)}_s for s∈ℕs \in \mathbb{N} are defined recursively by taking 𝒞0(1)={⋆}\mathcal{C}^{(1)}_0 = \{\star\} to be a singleton and setting 𝒞s+1(1)=𝒞s(1)×ℳ(𝒞s(1))\mathcal{C}^{(1)}_{s+1} = \mathcal{C}^{(1)}_s \times \mathcal{M}(\mathcal{C}^{(1)}_s).✦ For a graph GG, the round-ss 11-WL vertex coloring χG,s(1):V(G)→𝒞s(1)\chi^{(1)}_{G, s} : V(G) \to \mathcal{C}^{(1)}_s assigns ⋆\star to every vertex at s=0s = 0, and at round s+1s + 1 updates each v∈V(G)v \in V(G) by χG,s+1(1)(v)=(χG,s(1)(v),{{χG,s(1)(w):w∈V(G),EG(v,w)=1}}).\begin{aligned} \chi^{(1)}_{G, s+1}(v) = \bigl(\chi^{(1)}_{G, s}(v),\, \{\{ \chi^{(1)}_{G, s}(w) : w \in V(G),\, E_G(v, w) = 1 \}\}\bigr). \end{aligned}(1)✦ The round-ss 11-WL color histogram of GG is the multiset HG,s(1)={{χG,s(1)(v):v∈V(G)}}H^{(1)}_{G, s} = \{\{ \chi^{(1)}_{G, s}(v) : v \in V(G) \}\} in ℳ(𝒞s(1))\mathcal{M}(\mathcal{C}^{(1)}_s) formed from the colors in (1).✦

For any k∈ℕk \in \mathbb{N}, the kk-WL color spaces 𝒞s(k)\mathcal{C}^{(k)}_s for s∈ℕs \in \mathbb{N} are defined recursively by 𝒞0(k)={0,1}k×k×{0,1}k×k\mathcal{C}^{(k)}_0 = \{0, 1\}^{k \times k} \times \{0, 1\}^{k \times k} and 𝒞s+1(k)=𝒞s(k)×ℳ((𝒞s(k))k)\mathcal{C}^{(k)}_{s+1} = \mathcal{C}^{(k)}_s \times \mathcal{M}((\mathcal{C}^{(k)}_s)^k).✦ For a tuple 𝒗=(v0,…,vk−1)∈V(G)k\mathbf{v} = (v_0, \dots, v_{k-1}) \in V(G)^k, an index i∈{0,…,k−1}i \in \{0, \dots, k - 1\}, and a vertex z∈V(G)z \in V(G), write 𝒗[i↦z]\mathbf{v}[i \mapsto z] for the tuple obtained from 𝒗\mathbf{v} by replacing coordinate ii with zz. The round-ss kk-WL tuple coloring χG,s(k):V(G)k→𝒞s(k)\chi^{(k)}_{G, s} : V(G)^k \to \mathcal{C}^{(k)}_s assigns to 𝒗\mathbf{v} at s=0s = 0 the pair of k×kk \times k Boolean matrices recording coordinate equalities (i,j)↦𝟏vi=vj(i, j) \mapsto \mathbf{1}_{v_i = v_j} and adjacencies (i,j)↦EG(vi,vj)(i, j) \mapsto E_G(v_i, v_j), and at round s+1s + 1 updates 𝒗\mathbf{v} by the joint-update rule χG,s+1(k)(𝒗)=(χG,s(k)(𝒗),{{(χG,s(k)(𝒗[i↦z]))i=0k−1:z∈V(G)}}).\begin{aligned} \chi^{(k)}_{G, s+1}(\mathbf{v}) = \Bigl(\chi^{(k)}_{G, s}(\mathbf{v}),\, \bigl\{\bigl\{ \bigl(\chi^{(k)}_{G, s}(\mathbf{v}[i \mapsto z])\bigr)_{i=0}^{k-1} : z \in V(G) \bigr\}\bigr\}\Bigr). \end{aligned}(2)✦ The round-ss kk-WL color histogram of GG is the multiset HG,s(k)={{χG,s(k)(𝒗):𝒗∈V(G)k}}H^{(k)}_{G, s} = \{\{ \chi^{(k)}_{G, s}(\mathbf{v}) : \mathbf{v} \in V(G)^k \}\} in ℳ(𝒞s(k))\mathcal{M}(\mathcal{C}^{(k)}_s) formed from the tuple colors in (2).✦

Two graphs GG and HH are kk-WL equivalent, written G≡kHG \equiv_k H, if HG,s(1)=HH,s(1)H^{(1)}_{G, s} = H^{(1)}_{H, s} for all s∈ℕs \in \mathbb{N} when k=1k = 1, and HG,s(k)=HH,s(k)H^{(k)}_{G, s} = H^{(k)}_{H, s} for all s∈ℕs \in \mathbb{N} when k≠1k \ne 1.✦ We say that kk-WL identifies GG if G≡kHG \equiv_k H implies G≅HG \cong H for every graph HH.✦ The Weisfeiler-Leman dimension of GG is the infimum in ℕ\mathbb{N} of the positive integers that identify GG: WLdim⁡(G)=inf⁡{k∈ℕ:k>0 and k-WL identifies G}.\operatorname{WLdim}(G) = \inf \{ k \in \mathbb{N} : k > 0 \text{ and } k\text{-WL identifies } G \}.(3)✦

Encoding the dimension problem

A binary word is a finite string w∈{0,1}*w \in \{0, 1\}^* of length |w||w|✦, and a binary language is a subset L⊆{0,1}*L \subseteq \{0, 1\}^*.✦ The binary value val⁡(b)∈ℕ\operatorname{val}(b) \in \mathbb{N} of a binary word b=b0b1⋯bm−1b = b_0 b_1 \cdots b_{m-1} is its big-endian integer value ∑j=0m−1bj2m−1−j\sum_{j=0}^{m-1} b_j 2^{m - 1 - j}, with val⁡(ε)=0\operatorname{val}(\varepsilon) = 0 for the empty word ε\varepsilon.✦ For a graph GG of order nn, its adjacency matrix encoding mat⁡(G)∈{0,1}n2\operatorname{mat}(G) \in \{0, 1\}^{n^2} is the row-major concatenation of the nn rows (EG(i,0),…,EG(i,n−1))(E_G(i, 0), \dots, E_G(i, n - 1)) for i=0,…,n−1i = 0, \dots, n - 1.✦

Given a graph GG of order nn and a binary word bb, their input encoding is the binary word enc⁡(G,b)=1n0mat⁡(G)b,\operatorname{enc}(G, b) = 1^n \, 0 \, \operatorname{mat}(G) \, b,(4)✦ where 1n1^n denotes nn consecutive ones. Using (3) and (4), the Weisfeiler-Leman dimension language LWL⊆{0,1}*L_{\mathrm{WL}} \subseteq \{0, 1\}^* is defined by LWL={enc⁡(G,b):|V(G)|>0,b∈1{0,1}*,val⁡(b)>0,WLdim⁡(G)≤val⁡(b)}.\begin{aligned} L_{\mathrm{WL}} = \bigl\{\, \operatorname{enc}(G, b) :\; & |V(G)| > 0,\; b \in 1\{0, 1\}^*, \\ & \operatorname{val}(b) > 0,\; \operatorname{WLdim}(G) \le \operatorname{val}(b) \,\bigr\}. \end{aligned}(5)✦ Any binary word not of the form enc⁡(G,b)\operatorname{enc}(G, b) with |V(G)|>0|V(G)| > 0 and bb beginning with 11 lies outside LWLL_{\mathrm{WL}}.

Turing machines and EXPTIME-completeness

A deterministic single-tape Turing machine MM consists of natural numbers eQ,eΣ∈ℕe_Q, e_\Sigma \in \mathbb{N} defining the finite state set QM={0,1,…,eQ+2}Q_M = \{0, 1, \dots, e_Q + 2\} and tape alphabet ΣM={0,1,…,eΣ+2}\Sigma_M = \{0, 1, \dots, e_\Sigma + 2\}, together with a transition function δM:QM×ΣM→QM×ΣM×{left,stay,right}\delta_M : Q_M \times \Sigma_M \to Q_M \times \Sigma_M \times \{\mathrm{left}, \mathrm{stay}, \mathrm{right}\}.✦ The head moves left\mathrm{left}, stay\mathrm{stay}, and right\mathrm{right} have integer displacements disp⁡(left)=−1\operatorname{disp}(\mathrm{left}) = -1, disp⁡(stay)=0\operatorname{disp}(\mathrm{stay}) = 0, and disp⁡(right)=1\operatorname{disp}(\mathrm{right}) = 1.✦

A configuration of MM is a triple c=(q,h,τ)c = (q, h, \tau) where q∈QMq \in Q_M is the current state, h∈ℤh \in \mathbb{Z} is the head position, and τ:ℤ→ΣM\tau : \mathbb{Z} \to \Sigma_M is the two-way infinite tape content.✦ A configuration is halted if q∈{1,2}q \in \{1, 2\}, where state 00 is the start state, 11 is the accept state, and 22 is the reject state.✦ Each input bit x∈{0,1}x \in \{0, 1\} is represented by the input tape symbol σ(x)=x+1\sigma(x) = x + 1, while symbol 00 is blank.✦ On an input word w=w0⋯wm−1∈{0,1}*w = w_0 \cdots w_{m-1} \in \{0, 1\}^*, the initial configuration c0(M,w)c_0(M, w) has state 00, head position 00, and tape τ(z)=σ(wz)\tau(z) = \sigma(w_z) for 0≤z<m0 \le z < m and τ(z)=0\tau(z) = 0 for all other z∈ℤz \in \mathbb{Z}.✦

The one-step transition map step⁡M\operatorname{step}_M fixes every halted configuration; on a non-halted configuration (q,h,τ)(q, h, \tau) with δM(q,τ(h))=(q′,a′,μ)\delta_M(q, \tau(h)) = (q', a', \mu), it produces the configuration (q′,h+disp⁡(μ),τ′)(q', h + \operatorname{disp}(\mu), \tau'), where τ′(h)=a′\tau'(h) = a' and τ′(z)=τ(z)\tau'(z) = \tau(z) for all z≠hz \ne h.✦ For t∈ℕt \in \mathbb{N}, the tt-step run on ww is the tt-fold iterate run⁡M(w,t)=step⁡Mt(c0(M,w))\operatorname{run}_M(w, t) = \operatorname{step}_M^t(c_0(M, w)).✦ A configuration (q,h,τ)(q, h, \tau) has tape output word y=y0⋯yℓ−1∈{0,1}*y = y_0 \cdots y_{\ell-1} \in \{0, 1\}^* if τ(i)=σ(yi)\tau(i) = \sigma(y_i) for every 0≤i<ℓ0 \le i < \ell and τ(ℓ)=0\tau(\ell) = 0.✦

Given a time bound T:ℕ→ℕT : \mathbb{N} \to \mathbb{N}, a machine MM decides a binary language LL within time TT if for every w∈{0,1}*w \in \{0, 1\}^* there exists t≤T(|w|)t \le T(|w|) such that run⁡M(w,t)\operatorname{run}_M(w, t) is halted and its state is 11 if and only if w∈Lw \in L.✦ A machine MM computes a function f:{0,1}*→{0,1}*f : \{0, 1\}^* \to \{0, 1\}^* within time TT if for every w∈{0,1}*w \in \{0, 1\}^* there exists t≤T(|w|)t \le T(|w|) such that run⁡M(w,t)\operatorname{run}_M(w, t) is in state 11 and has tape output word f(w)f(w).✦ A binary language LL belongs to EXPTIME\mathrm{EXPTIME} if there exist a machine MM and C,d∈ℕC, d \in \mathbb{N} such that MM decides LL within time n↦2C(n+1)dn \mapsto 2^{C(n + 1)^d}.✦ A binary language LL reduces to SS by a polynomial-time many-one reduction, written L≤mpSL \le_{\mathrm{m}}^{\mathrm{p}} S, if there exist a function f:{0,1}*→{0,1}*f : \{0, 1\}^* \to \{0, 1\}^*, a machine MM, and C,d∈ℕC, d \in \mathbb{N} such that MM computes ff within time n↦C(n+1)dn \mapsto C(n + 1)^d and w∈Lw \in L if and only if f(w)∈Sf(w) \in S for all w∈{0,1}*w \in \{0, 1\}^*.✦ A binary language SS is EXPTIME\mathrm{EXPTIME}-complete if S∈EXPTIMES \in \mathrm{EXPTIME} and L≤mpSL \le_{\mathrm{m}}^{\mathrm{p}} S for every L∈EXPTIMEL \in \mathrm{EXPTIME}.✦

The claim

Theorem 1.1. The Weisfeiler-Leman dimension language LWLL_{\mathrm{WL}} of (5) is EXPTIME\mathrm{EXPTIME}-complete under deterministic polynomial-time many-one reductions: LWL∈EXPTIME,L≤mpLWLfor every L∈EXPTIME.\begin{aligned} L_{\mathrm{WL}} &\in \mathrm{EXPTIME}, \\ L &\le_{\mathrm{m}}^{\mathrm{p}} L_{\mathrm{WL}} \quad \text{for every } L \in \mathrm{EXPTIME}. \end{aligned}(6)✦

What is checked

In the Lean library, Theorem 1.1 (6) is stated for the binary language LWLL_{\mathrm{WL}} encoding nonempty finite simple undirected uncolored graphs by their row-major adjacency matrices together with positive binary integers without leading zeros, where WLdim⁡(G)\operatorname{WLdim}(G) is defined by ordinary neighbor color refinement at k=1k = 1 and joint-update tuple refinement at k≥2k \ge 2, and EXPTIME\mathrm{EXPTIME}-completeness is defined over deterministic single-tape Turing machines with time bounds 2C(n+1)d2^{C(n + 1)^d} for membership and C(n+1)dC(n + 1)^d for many-one reductions.