The setting
Weisfeiler-Leman (WL) color refinement iteratively partitions the vertices or -tuples of vertices of a finite simple undirected uncolored graph according to their local isomorphism types and neighborhood multisets. Two graphs are -WL equivalent when their color histograms match at every refinement round, and -WL identifies a graph when no non-isomorphic graph is -WL equivalent to . The Weisfeiler-Leman dimension is the least positive integer that identifies , measuring the refinement dimension required to distinguish up to isomorphism. To formulate the decision problem asking whether as a formal language, nonempty graphs and positive integers are encoded as binary words, and deterministic single-tape Turing machines provide the computational model.
Graphs and Weisfeiler-Leman refinement
A finite simple graph consists of a natural number order (possibly zero), with vertex set , and an adjacency indicator that is symmetric ( for all ) and loopless ( for all ).✦ Two graphs and are isomorphic, written , if there exists a bijection such that for all .✦
For -WL refinement, the round- color space is defined recursively for by , a singleton set, and , where denotes the set of finite multisets over .✦ The -WL vertex coloring of a graph is defined by (1)✦ and the round- -WL color histogram is the multiset .✦
For any , the round- -WL color space is defined recursively by and .✦ Given a -tuple , let denote the tuple obtained by replacing coordinate of with . The joint-update -WL tuple coloring is defined by (2)✦ where indicates whether . The round- -WL color histogram is .✦
Two graphs and are -WL equivalent, written , if for every when , and for every when .✦ A dimension identifies if every graph with satisfies .✦ The Weisfeiler-Leman dimension of is the infimum in given by (3)✦ taking the value if the set is empty and the least such positive integer otherwise.
Binary encoding and the dimension language
A binary word is a finite bit string ✦, and a binary language is a subset .✦ The binary value of a word is its unsigned big-endian value (with for the empty word ).✦ For each , the canonical binary representation is the big-endian bit string of with no leading zeros ().✦
For a graph of order , its adjacency matrix encoding is the row-major concatenation of the rows for .✦ Given also a binary word , the input encoding of the pair is (4)✦ The WL dimension language consists of all validly encoded positive instances: (5)✦
Deterministic Turing machines
A head move is an element ✦ with integer displacement , , and .✦ A deterministic Turing machine is specified by natural numbers , which determine its tape alphabet and state set , together with a transition function .✦
A configuration of is a triple consisting of a state , a head position , and a two-way infinite tape .✦ The input tape symbol map sends to and to , reserving for the blank symbol.✦ On a binary word , the initial configuration starts in state at head position with tape contents for and for all or .✦
The one-step transition function maps a configuration to itself whenever (the halting states). For , writing , it sets (6)✦ where agrees with on and takes the value at .
The claim
Definition. For every deterministic Turing machine , every binary word , and every step count , the configuration of on input after steps is the -fold iterate of applied to the initial configuration: (7)✦ For every nonempty graph () and every positive integer , the encoded input belongs to the WL dimension language if and only if : (8)✦ For any two isomorphic graphs and (), their Weisfeiler-Leman dimensions coincide: (9)✦
In the paper, the result reads: all graphs are finite, simple, undirected, and uncolored; for refinement uses the joint-update convention and for ordinary neighbor color refinement; means their tuple-color histograms agree at every round; -WL identifies if implies for every graph ; and is the least positive integer identifying .
What is checked
The Lean library states the -step run (7) over deterministic single-tape Turing machines with integer-indexed tapes, halting states and , and binary input words; it states the membership equivalence (8) over nonempty finite simple graphs and positive integers encoded via unary vertex count, row-major adjacency matrix, and canonical big-endian binary words; and it states isomorphism invariance (9) over all finite simple graphs under the -WL neighbor refinement and -WL joint-update refinement rules.