The setting
The -dimensional Weisfeiler-Leman (-WL) algorithm refines colorings of -tuples of vertices in a finite simple graph by aggregating color information over single-coordinate substitutions. In separate -WL, each refinement step aggregates one coordinate at a time, matching graphs of bag size at most ; in joint -WL, a refinement step aggregates all single-coordinate substitutions simultaneously at a common replacement vertex, matching graphs of bag size at most .
To connect -WL colorings on two finite simple graphs and with homomorphism counts from graphs of bounded treewidth, one considers -rooted homomorphism tests of bag size at most and the rational vector space spanned by their evaluations on pairs of -tuples. Showing that this test span detects edges, sums to total homomorphism counts, and is closed under single-coordinate replacement sums (when ) and joint replacement sums (when ) supplies the algebraic closure properties needed to track -WL refinement steps.
Ranked tree decompositions
A ranked rooted tree on a node set consists of a distinguished root , a parent map , and a rank function such that for every .
The ancestor relation on is the smallest reflexive binary relation on such that whenever and , one has .✦
Let and be sets, let be a binary relation on , and let . A ranked tree decomposition of of bag size at most on is a ranked rooted tree on equipped with a bag map assigning to each node a finite subset and a top-node map satisfying six properties. First, for every . Second, for every and , membership implies . Third, for every and , if and , then . Fourth, whenever satisfy , there exists with . Fifth, for every . Sixth, for every .
Rooted homomorphism tests
Given a binary relation on a set and a simple graph on a vertex set , the set of homomorphisms from to consists of all maps such that implies and are adjacent in .✦
For , let denote the -element index set (empty when ).
Rooted homomorphism counts on bounded-bag-size sources provide the self-contained framework for the preservation direction of the homomorphism characterization of Weisfeiler-Leman equivalence.
For , a -rooted homomorphism test of bag size at most consists of a finite vertex set , a symmetric binary relation on , a root tuple , a finite node set , and a ranked tree decomposition of of bag size at most on with root and bag map whose root bag equals the image of : (1)✦
For a -rooted homomorphism test , a simple graph on a vertex set , and a -tuple , the set of rooted homomorphisms from to at consists of all satisfying for every .✦ When is finite, the rooted homomorphism count of in at is the rational number (2)✦ and the total homomorphism count of in is .
Given a finite set with , a symmetric binary relation on , and a surjective map , the single-bag test on is the -rooted homomorphism test of bag size at most with vertex set , relation , root tuple , and a one-node ranked tree decomposition of rank whose sole bag is and whose top-node map sends every element of to that unique node.✦ When and , the edge indicator test is the single-bag test on vertex set with the identity map on as its root tuple and the symmetric relation holding on precisely when or .✦
Test evaluations and replacement sums
For sets and and , let denote the disjoint union of the sets of -tuples in and , with canonical inclusions and .✦
Now let and be finite simple graphs on vertex sets and , respectively. For a -rooted homomorphism test of bag size at most , the paired test evaluation is defined for and by (3)✦ The test span is the -linear subspace of spanned by as ranges over all -rooted homomorphism tests of bag size at most .✦
For a -tuple , an index , and a vertex , write for the tuple agreeing with on every coordinate other than and taking value at coordinate , and use the same notation for and . Given and a function , the coordinate replacement sum is defined for and by (4)✦ Given a family of functions , the joint replacement sum is defined for and by (5)✦
The claim
Definition 2.1. Let , let be a finite simple graph on a vertex set , and let be a finite simple graph on a vertex set .
For every -rooted homomorphism test of bag size at most , the rooted homomorphism counts of in sum over to the total homomorphism count: (6)✦
If , then for all and every , the edge indicator test evaluates to the adjacency indicator of and in : (7)✦
If , then for every and every , the test span is closed under the coordinate replacement sum: (8)✦
If , then for every family with for all , the test span is closed under the joint replacement sum: (9)✦
What is checked
In the Lean library, Definition 2.1 is stated over arbitrary natural numbers and , finite simple graphs on and on , -rooted homomorphism tests of bag size at most built from ranked tree decompositions, and the rational test span on , covering the total-count identity (6), the edge-indicator evaluation (7) and coordinate replacement sum closure (8) for , and joint replacement sum closure (9) for .