The k-dimensional Weisfeiler–Leman algorithm #
The (folklore) k-dimensional Weisfeiler–Leman algorithm (k-WL) colors k-tuples
u : Fin k → V of a finite simple graph G round by round ([CFI92], Section 5):
- In round
0,ureceives its ordered atomic isomorphism type (SimpleGraph.tupleAtom): the equality relationu i = u jand the adjacency relationG.Adj (u i) (u j)onFin k. - In round
n + 1,uis recolored (SimpleGraph.wlRefine) by its round-ncolor together with the multiset over allv : Vof the step profile (SimpleGraph.wlStepProfile): the atomic isomorphism type of the(k + 1)-tupleFin.snoc u vpaired with thek-tuple of round-ncolorsfun i => χ (Function.update u i v)obtained by substitutingvat each coordinate.
Recording the atomic isomorphism type of Fin.snoc u v in the step profile matches W^r in
[CFI92], Section 5. For k ≥ 2, every coordinate of u already survives in some
Function.update u i v, whereas for k = 1, Function.update u 0 v overwrites the sole coordinate
u 0; including G.tupleAtom (Fin.snoc u v) keeps v = u 0 and G.Adj (u 0) v so that k = 1
agrees with vertex color refinement (SimpleGraph.refinementColoring) and the correspondence with
the (k + 1)-pebble bijective game holds uniformly for every k : ℕ.
The colors of round n live in SimpleGraph.WLColor k n : Type, independent of the vertex type and
its universe, so tuple colors and histograms (SimpleGraph.wlHistogram) of different graphs are
directly comparable without decidable-equality or decidable-adjacency hypotheses.
Partitioning Fin k → V by Setoid.ker (G.wlColoring n) refines the partition each round until it
stabilizes within |V| ^ k - k₀ rounds (SimpleGraph.ker_wlColoring_eq), where k₀ is the number
of atomic k-tuple classes. Applying the same counting argument to the combined coloring
Sum.elim (G.wlColoring n) (H.wlColoring n) on (Fin k → V) ⊕ (Fin k → W) shows that k-WL
distinguishes two tuples or two graphs in some round if and only if it distinguishes them in round
|V| ^ k + |W| ^ k (SimpleGraph.forall_wlColoring_eq_iff,
SimpleGraph.forall_wlHistogram_eq_iff).
Main definitions #
SimpleGraph.TupleAtom,SimpleGraph.tupleAtom: the ordered atomic isomorphism type of a tuple.SimpleGraph.WLColor: the type ofk-WL colors of roundn.SimpleGraph.wlStepProfile: the step profile of(u, v)under ak-tuple coloring.SimpleGraph.wlRefine: one round ofk-WL refinement.SimpleGraph.wlColoring: thek-WL coloring afternrounds.SimpleGraph.stableWLColoring: thek-WL coloring after|V| ^ krounds.SimpleGraph.wlHistogram: the multiset ofk-WL tuple colors of roundn.
Main results #
SimpleGraph.tupleAtom_eq_iff: equal atomic types mean preservation of equality and adjacency.SimpleGraph.wlRefine_eq_of_imp,SimpleGraph.ker_wlRefine_mono: monotonicity of ak-WL step.SimpleGraph.blocks_ker_wlColoring_lt_succ: the number ofk-tuple color classes increases strictly until stabilization.SimpleGraph.ker_wlColoring_eq,SimpleGraph.ker_stableWLColoring: single-graph stabilization within|V| ^ k - k₀(and|V| ^ k) rounds.SimpleGraph.Iso.wlColoring_comp,SimpleGraph.Iso.wlHistogram_eq,SimpleGraph.isEmpty_iso_of_wlHistogram_ne: isomorphism invariance and soundness of thek-WL isomorphism test.SimpleGraph.wlColoring_eq_of_le,SimpleGraph.wlHistogram_eq_of_le: agreement in roundmimplies agreement in every earlier roundn ≤ m.SimpleGraph.forall_wlColoring_eq_iff,SimpleGraph.forall_wlHistogram_eq_iff: tuple colors or histograms agree in every round iff they agree in round|V| ^ k + |W| ^ k.
References #
Atomic isomorphism types of tuples #
The ordered atomic isomorphism type of an m-tuple in a simple graph: the equality relation and
the adjacency relation among its coordinates.
The ordered atomic isomorphism type of t : Fin m → V in G.
Two tuples have the same atomic isomorphism type exactly when equality and adjacency agree on all coordinate pairs.
Reindexing coordinates preserves equality of atomic isomorphism types.
Graph isomorphisms preserve the atomic isomorphism type of every tuple.
Colors, step profiles and k-WL refinement #
The colors of round n of k-dimensional Weisfeiler–Leman: round 0 records the atomic
isomorphism type of a k-tuple, and round n + 1 pairs the round-n color with a multiset of step
profiles.
The step profile of extending u : Fin k → V by v : V under a tuple coloring χ: the atomic
isomorphism type of Fin.snoc u v together with the colors of the k tuples obtained by replacing
each coordinate of u with v.
The k-dimensional Weisfeiler–Leman coloring of G after n rounds.
The k-WL coloring after |V| ^ k rounds, whose partition is stable by
SimpleGraph.ker_stableWLColoring.
The k-WL color histogram of round n: the multiset of colors of all k-tuples in G.
If χ₁ u = ψ₁ w implies χ₂ u = ψ₂ w for all k-tuples, then the same implication holds
after one round of k-WL refinement.
A round of k-WL refinement refines the tuple partition.
A round of k-WL refinement is monotone in the tuple partition.
Refinement and stabilization #
Each round of k-WL refines the tuple partition of the previous round.
Every round of k-WL refines the atomic tuple partition of round 0.
Once a round of k-WL does not change the tuple partition, no later round does.
The number of k-WL color classes does not decrease from one round to the next.
The number of k-WL color classes increases strictly as long as the partition changes.
Stabilization of k-WL: if round 0 has k₀ atomic tuple classes, then the tuple
partition does not change after round |V| ^ k - k₀.
From round |V| ^ k on, the tuple partition is that of stableWLColoring.
Isomorphism invariance and soundness #
A graph isomorphism preserves the k-WL color of every tuple in every round.
Isomorphic finite graphs have the same k-WL histogram in every round.
Soundness of the k-WL isomorphism test: if the k-WL histograms differ in some round,
then the graphs are not isomorphic.
Earlier rounds and completeness of round |V| ^ k + |W| ^ k #
The k-WL color of round n + r determines the color of round n.
k-WL colors that agree in some round agree in every earlier round.
The k-WL histogram of round n + r determines the histogram of round n.
k-WL histograms that agree in some round agree in every earlier round.
k-WL distinguishes two k-tuples of G and H in some round if and only if it
distinguishes them in round |V| ^ k + |W| ^ k.
k-WL distinguishes two graphs G and H in some round if and only if it distinguishes them
in round |V| ^ k + |W| ^ k.