OctoInform Beta

OpenAI preprint, September 2026 · §2. Weisfeiler-Leman refinement and the bijective game

Lemma 2.3: kk-WL equivalence for k≥2k \ge 2 matches tuple degrees and degree-stratified neighbor counts, and tag-stable tuples preserve leaf-encoded vertex colors

Degree preservation and color recovery in Weisfeiler-Leman refinement.

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

In finite model theory and graph isomorphism, the kk-dimensional Weisfeiler-Leman (kk-WL) algorithm refines colorings of kk-tuples of vertices by iteratively recording how each coordinate can be replaced by a new vertex. When k≥2k \ge 2, this refinement is strong enough to detect vertex degrees and the distribution of degrees among a vertex’s neighbors. Encoding vertex colors as prescribed numbers of pendant leaves attached to each vertex turns degree preservation into a mechanism for recovering those colors across graphs whose tuples remain indistinguishable under kk-WL refinement.

Weisfeiler-Leman refinement

A finite simple graph GG consists of a natural number nn, called its order, giving the vertex set V(G)={1,…,n}V(G) = \{1, \dots, n\}, together with a symmetric, irreflexive adjacency relation E(G)E(G) on V(G)V(G).✦ For a vertex v∈V(G)v \in V(G) and a natural number dd, the vertex degree deg⁡G(v)\deg_G(v) and the degree-dd neighbor count nG(v,d)n_G(v, d) are defined by deg⁡G(v)=|{w∈V(G):vw∈E(G)}|,nG(v,d)=|{w∈V(G):vw∈E(G) and deg⁡G(w)=d}|.\begin{aligned} \deg_G(v) &= \bigl|\{w \in V(G) : vw \in E(G)\}\bigr|, \\ n_G(v, d) &= \bigl|\{w \in V(G) : vw \in E(G) \text{ and } \deg_G(w) = d\}\bigr|. \end{aligned}(1) The counts in (1) record both the size of the neighborhood of vv and how many of its neighbors have each prescribed degree.

For one-dimensional refinement, the 1-WL color space 𝒞1(s)\mathcal{C}_1^{(s)} at a natural number round ss is defined recursively: 𝒞1(0)\mathcal{C}_1^{(0)} is a singleton, and 𝒞1(s+1)\mathcal{C}_1^{(s+1)} is the product of 𝒞1(s)\mathcal{C}_1^{(s)} with the space of finite multisets of elements of 𝒞1(s)\mathcal{C}_1^{(s)}.✦ The 1-WL vertex coloring χsG(v)∈𝒞1(s)\chi_s^G(v) \in \mathcal{C}_1^{(s)} assigns the unique initial color to every vertex v∈V(G)v \in V(G) at round 00, and updates by χs+1G(v)=(χsG(v),{{χsG(w):w∈V(G),vw∈E(G)}}).\chi_{s+1}^G(v) = \Bigl(\chi_s^G(v),\, \bigl\{\!\bigl\{\chi_s^G(w) : w \in V(G),\, vw \in E(G)\bigr\}\!\bigr\}\Bigr).(2) The 1-WL color histogram of GG at round ss is the multiset {{χsG(v):v∈V(G)}}\{\!\{\chi_s^G(v) : v \in V(G)\}\!\} induced by (2).✦

For a natural number dimension kk, the kk-WL color space 𝒞k(s)\mathcal{C}_k^{(s)} at round ss is defined recursively: 𝒞k(0)\mathcal{C}_k^{(0)} is the product of two copies of the space of k×kk \times k Boolean matrices, and 𝒞k(s+1)\mathcal{C}_k^{(s+1)} is the product of 𝒞k(s)\mathcal{C}_k^{(s)} with the space of finite multisets of kk-tuples of elements of 𝒞k(s)\mathcal{C}_k^{(s)}.✦ For a kk-tuple v‾=(v1,…,vk)∈V(G)k\bar v = (v_1, \dots, v_k) \in V(G)^k and z∈V(G)z \in V(G), let v‾[i←z]\bar v[i \leftarrow z] denote the kk-tuple obtained by replacing the iith entry of v‾\bar v with zz. The kk-WL tuple coloring χk,sG(v‾)∈𝒞k(s)\chi_{k,s}^G(\bar v) \in \mathcal{C}_k^{(s)} records at round 00 the k×kk \times k Boolean matrices of equalities vi=vjv_i = v_j and adjacencies vivj∈E(G)v_i v_j \in E(G), and updates at round s+1s + 1 by χk,s+1G(v‾)=(χk,sG(v‾),{{(χk,sG(v‾[1←z]),…,χk,sG(v‾[k←z])):z∈V(G)}}).\begin{aligned} \chi_{k,s+1}^G(\bar v) = \Bigl(&\chi_{k,s}^G(\bar v),\, \\ &\bigl\{\!\bigl\{\bigl(\chi_{k,s}^G(\bar v[1 \leftarrow z]), \dots, \chi_{k,s}^G(\bar v[k \leftarrow z])\bigr) : z \in V(G)\bigr\}\!\bigr\}\Bigr). \end{aligned}(3) The kk-WL color histogram of GG at round ss is the multiset {{χk,sG(v‾):v‾∈V(G)k}}\{\!\{\chi_{k,s}^G(\bar v) : \bar v \in V(G)^k\}\!\} obtained from (3).✦

Two finite simple graphs GG and HH are kk-WL equivalent, written G≡kHG \equiv_k H, if for every round s≥0s \ge 0 their 1-WL color histograms agree when k=1k = 1, and their kk-WL color histograms agree when k≠1k \neq 1.✦ A pair of kk-tuples v‾∈V(G)k\bar v \in V(G)^k and w‾∈V(H)k\bar w \in V(H)^k is a stable kk-WL tuple pair if χk,sG(v‾)=χk,sH(w‾)\chi_{k,s}^G(\bar v) = \chi_{k,s}^H(\bar w) for every round s≥0s \ge 0.

Leaf-encoded vertex colors

For a finite simple graph GG on an arbitrary finite vertex set VV, its indexed graph representation is the finite simple graph on {1,…,|V|}\{1, \dots, |V|\} obtained by transporting the adjacency relation of GG along a fixed enumeration of VV.✦ Given finite simple graphs GG on VV and HH on WW and a natural number kk, a pair of kk-tuples v‾∈Vk\bar v \in V^k and w‾∈Wk\bar w \in W^k is a simple-graph stable kk-tuple if their images under the fixed enumerations of VV and WW form a stable kk-WL tuple pair in the indexed graph representations of GG and HH.✦

Given a finite vertex set VV and a leaf-count function ℓ:V→ℕ\ell : V \to \mathbb{N}, the leaf-augmented vertex set VℓV_\ell is the disjoint union of VV with ℓ(v)\ell(v) distinct indexed pendant leaves attached to each base vertex v∈Vv \in V.✦ For a finite simple graph GG on VV, the graph with pendant leaves GℓG_\ell is the finite simple graph on VℓV_\ell in which two base vertices in VV are adjacent if and only if they are adjacent in GG, each pendant leaf is adjacent only to its own base vertex, and no two pendant leaves are adjacent.✦

For a finite vertex set VV and a natural-number vertex coloring c:V→ℕc : V \to \mathbb{N}, the leaf-tag size of a vertex v∈Vv \in V is ℓc(v)=c(v)(|V|+1).\ell_c(v) = c(v)(|V| + 1).(4)✦ Given finite simple graphs GG on VV and HH on WW with natural-number vertex colorings c:V→ℕc : V \to \mathbb{N} and c′:W→ℕc' : W \to \mathbb{N}, and a natural number kk, a pair of kk-tuples v‾∈Vk\bar v \in V^k and w‾∈Wk\bar w \in W^k is a tag-stable kk-tuple if the inclusions of v‾\bar v and w‾\bar w as base vertices form a simple-graph stable kk-tuple in the graphs with pendant leaves GℓcG_{\ell_c} and Hℓc′H_{\ell_{c'}} defined via (4).✦

The claim

Lemma 2.3. Let GG and HH be finite simple graphs and let k≥2k \ge 2 and 1≤m≤k1 \le m \le k be integers such that G≡kHG \equiv_k H. For every mm-tuple v‾=(v1,…,vm)∈V(G)m\bar v = (v_1, \dots, v_m) \in V(G)^m, there exists an mm-tuple w‾=(w1,…,wm)∈V(H)m\bar w = (w_1, \dots, w_m) \in V(H)^m such that for all i,j∈{1,…,m}i, j \in \{1, \dots, m\} and every natural number dd, vi=vj⇔wi=wj,vivj∈E(G)⇔wiwj∈E(H),deg⁡G(vi)=deg⁡H(wi),nG(vi,d)=nH(wi,d).\begin{aligned} v_i = v_j &\iff w_i = w_j, \\ v_i v_j \in E(G) &\iff w_i w_j \in E(H), \\ \deg_G(v_i) &= \deg_H(w_i), \\ n_G(v_i, d) &= n_H(w_i, d). \end{aligned}(5)✦

Furthermore, let GG and HH be finite simple graphs on finite vertex sets VV and WW with |V|=|W||V| = |W|, let c:V→ℕc : V \to \mathbb{N} and c′:W→ℕc' : W \to \mathbb{N} be vertex colorings, and let k≥2k \ge 2 be an integer. If (v‾,w‾)∈Vk×Wk(\bar v, \bar w) \in V^k \times W^k is a tag-stable kk-tuple, then for every i∈{1,…,k}i \in \{1, \dots, k\}, c(vi)=c′(wi).c(v_i) = c'(w_i).(6)✦

In the paper, the result reads: in every history following a winning strategy with at least two pair slots, matched vertices have equal degrees, and every vertex bijection announced by that strategy therefore preserves degrees for all its possible choices.

The Lean library formulates this preservation directly in terms of kk-WL refinement, recording the matching of degrees and degree-stratified neighbor counts for mm-tuples in (5) and the resulting recovery of leaf-encoded vertex colors on tag-stable kk-tuples in (6).

What is checked

In the Lean library, Lemma 2.3 consists of the local neighborhood match (5), stated over kk-WL equivalent finite simple graphs GG and HH with k≥2k \ge 2 and 1≤m≤k1 \le m \le k in terms of vertex degrees and degree-dd neighbor counts, and the color-matching identity (6), stated over equal-order finite simple graphs with natural-number vertex colorings and tag-stable kk-tuples built from pendant leaves of leaf-tag size.