Homomorphism Indistinguishability and Game Comonads for Restricted Conjunction and Requantification
Abstract
The notion of homomorphism indistinguishability offers a combinatorial framework for characterizing equivalence relations of graphs, in particular equivalences in counting logics within finite model theory. That is, for certain graph classes, two structures agree on all homomorphism counts from the class if and only if they satisfy the same sentences in a corresponding logic. This perspective often reveals connections between the combinatorial properties of graph classes and the syntactic structure of logical fragments. In this work, we extend this perspective to logics with restricted requantification, refining the stratification of logical resources in finite-variable counting logics. Specifically, we generalize Lovász-type theorems for these logics with either restricted conjunction or bounded quantifier-rank and present new combinatorial proofs of existing results. To this end, we introduce novel path and tree decompositions that incorporate the concept of reusability and develop characterizations based on pursuit-evasion games. Leveraging this framework, we establish that classes of bounded pathwidth and treewidth with reusability constraints are homomorphism distinguishing closed. Finally, we develop a comonadic perspective on requantification by constructing new comonads that encapsulate restricted-reusability pebble games. We show a tight correspondence between their coalgebras and path/tree decompositions, yielding categorical characterizations of reusability in graph decompositions. This unifies logical, combinatorial, and categorical perspectives on the notion of reusability.
Keywords and phrases:
homomorphism indistinguishability, game comonads, finite variable counting logic, restricted conjunction, restricted requantification, tree decomposition, path decomposition2012 ACM Subject Classification:
Theory of computation Finite Model Theory ; Mathematics of computing Graph theoryAcknowledgements:
I would like to thank Irene Heinrich, Gaurav Rattan, and Pascal Schweitzer for valuable discussions.Funding:
The research leading to these results has received funding from the German Research Foundation DFG (SFB-TRR 195 “Symbolic Tools in Mathematics and their Application”).Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
A fundamental result in graph theory due to Lovász [25] states that two graphs and are isomorphic if and only if for every graph it holds , where denotes the number of homomorphisms from to . More generally, and are said to be homomorphism indistinguishable over a graph class , denoted by , if for all . In this formulation, the seminal result of Lovász states that the equivalence relation is the same as graph isomorphism, where is the class of all graphs. Understanding characterizations of the homomorphism indistinguishability relation not only deepens our understanding of various graph invariants but also informs algorithmic approaches to problems like graph isomorphism [32], subgraph counting [9], and counting answers to conjunctive queries [19]. In recent years, the relation was characterized for several graph classes as a natural equivalence relation arising from logic and algebra. Notable examples include graphs of bounded treewidth [12, 13], bounded pathwidth [21, 27], bounded tree-depth [20, 21], and planar graphs [26]. Two central questions have emerged in this line of research and attract ongoing interest:
-
(1)
How do structural properties of the class relate to the semantics of the relation ?
This first question often admits elegant characterizations in terms of mathematical logic, particularly when the graph classes are defined via graph decompositions. In this context, logical equivalence provides a natural way to express homomorphism indistinguishability. For a logic on graphs , two graphs and are said to be -equivalent if they satisfy exactly the same sentences from . In [13] Dvořák shows that two graphs are homomorphism indistinguishable over the class of graphs of treewidth at most if and only if they are equivalent in the -variable fragment of first-order counting logic . The techniques developed in [13] have been refined in [17] to prove that homomorphism indistinguishability over the class of graphs admitting tree-decompositions of width and depth is the same as equivalence in , the fragment of of quantifier-rank at most . The general technique is to directly translate between formulas in and graphs from by induction on the structure of formulas and tree decompositions in both directions.
Beyond the characterization of homomorphism indistinguishability relations, the following natural question is fundamental to understand these relations:
-
(2)
When do different graph classes induce the same indistinguishability relation ?
This second question was approached methodically by Roberson [31] via introducing the notion of homomorphism distinguishing closedness. A graph class is called homomorphism distinguishing closed (also h.d. closed) if for every graph there exist graphs with and , i.e., if no graphs can be added to without changing the relation . The significance of this notion is that any two distinct homomorphism distinguishing closed classes must induce distinct homomorphism indistinguishability relations. In turn, equivalence relations on graphs characterized by homomorphism indistinguishability can be separated by separating the underlying graph classes, given they are homomorphism distinguishing closed. In general, it appears to be a hard task to establish that a given class is homomorphism distinguishing closed, leading to only a short list of known examples. These include the class of graphs of bounded degree [31], bounded tree-depth [17], bounded treewidth [29], bounded depth treewidth [5], and essentially profinite classes [35]. Beyond the investigation of specific graph classes, in [35] the relation between closure properties of and preservation properties of was studied systematically guided by the two aforementioned main questions. In [31] Roberson conjectures that every graph class which is closed under taking disjoint unions and minors is homomorphism distinguishing closed. For certain such graph classes , homomorphism distinguishing closedness has been successfully proven when is characterized by a model-comparison game and membership in is determined by a pursuit-evasion game. A key tool in such proofs is the CFI-construction [8], which has been instrumental in separating the homomorphism indistinguishability relations of -equivalence and -equivalence. For a graph , the construction yields two CFI-graphs and for which their distinguishability by depends on the structural complexity of . Crucial technical challenges arise, particularly in proving the connection between pursuit-evasion and model-comparison games for the CFI-construction (see [29]) and establishing the monotonicity of pursuit-evasion games (see [5]). The monotonicity of a game ensures that when searchers have a winning strategy, the reachable positions for the evading player only decreases as the game progresses.
For many logics of interest in finite model theory, like , their equivalence can be characterized in terms of model-comparison games such as Ehrenfeucht–Fraïssé or pebble games (see [15]). This correspondence was utilized in [2] to give a novel approach to logical resources in terms of game comonads. The central observation is that model-comparison games induce comonads on categories of relational structures. In this framework, several essential constructions from finite model theory can be given a categorical account, see [3] for a survey. In particular, coalgebras for some game comonads encode combinatorial parameters of structures [4] leading to a uniform approach to homomorphism indistinguishability developed in [11]. There, the first characterization of -equivalence by homomorphism counts was shown for graphs admitting pebble forest covers. The comonadic approach was recently used to show a categorical characterization of the graph parameter pathwidth and prove that homomorphism indistinguishability over graphs of pathwidth at most is logical equivalence in the restricted conjunction logic [27] by building on previous work of Dalmau [10].
The concept of requantification, recently introduced in [30], allows for a more refined view on stratification by logical resources in finite variable counting logics. The logic is defined as the fragment of using at most distinct variables of which only may be requantified, i.e. quantified within scopes of their own quantification. To analyze the expressive power of , the bijective -pebble game and the -round -cops-and-robber game were introduced, incorporating reusability into model-comparison and pursuit-evasion games, respectively. In the context of Question (1), it is only natural to ask whether logics with restricted conjunction and requantification admit homomorphism indistinguishability characterizations. Subsequently, Question (2) asks whether the corresponding graph classes are homomorphism distinguishing closed.
Contribution
In this work, we extend the study of homomorphism indistinguishability to graph classes with restricted reusability and thereby provide characterizations by counting logics with restricted requantification. A central contribution of our work is to show that decomposition-based techniques provide flexible tools for characterizing homomorphism indistinguishability relations, giving novel answers to Question (1). Furthermore, we use these techniques for establishing homomorphism distinguishing closedness, giving new answers to Question (2). By embedding these results into the broader framework of game comonads, we provide a unified categorical perspective on requantification in finite variable logics. In the following, we give a more detailed description of our contribution in terms of techniques and results:
Graph decompositions.
We answer an open question from [30] by characterizing the class of graphs where the cops have a winning strategy for by various graph decompositions, which adapt the concept of reusability (Theorem 3.8). Furthermore, we introduce the node-searching game where only of the searchers may be reused and characterize the class of searcher-win graphs by novel path decompositions (Theorem 3.7). We demonstrate a new effect that differentiates pathwidth from treewidth in the context of reusability. Namely, for bounded pathwidth, non-reusable resources can be employed uniformly for the full decomposition while for bounded treewidth their usage highly depends on intermediate parts of the decomposition (Proposition 3.4). Moreover, we prove that both games and are monotone by showing that reusability is compatible with monotonicity of the non-restricted games (Proposition 3.5).
Characterizations by logical equivalence.
The newly defined decompositions for and form the basis of our homomorphism indistinguishability results, providing more fine-grained answers to Question (1). By imposing constraints on requantification in the restricted conjunction logic we obtain the new fragment and show that -equivalence is exactly the same as homomorphism indistinguishability over (Theorem 4.5). This extends the Lovász-type theorem for from [27] to the setting of restricted reusability. Interestingly, this also reproves the previous result in a purely combinatorial manner by adapting the constructive techniques from [13, 17]. We further underline the versatility of this strategy by proving that -equivalence is homomorphism indistinguishability over (Theorem 4.6). Also here we show how the interplay of requantification and restricted conjunction differentiates the two logics: We prove a normal form result for with respect to requantification (Proposition 4.2) which in stark contrast was ruled out for the logic in [30].
Homomorphism distinguishing closedness.
We utilize the established framework for counting homomorphisms from the class to prove our main technical result: For every graph the CFI-graphs are -equivalent (Theorems 4.8 and 4.9). Using a similar argument for the class , we obtain that the classes , the closure of under disjoint unions, and are homomorphism distinguishing closed (Theorems 4.10 and 4.11). This gives new answers to Question (2) and further exemplifies the technique of using games to establish homomorphism distinguishing closedness. In the light of Roberson’s conjecture, Theorem 4.10 is particularly interesting as the class of graphs of pathwidth at most must exclude a fixed forest as a minor [33]. Next, we employ an argument from [29] to give an exact characterization which subgraph counts are recognized by the logics and . For the logic , this characterizes the ability of a reusability-restricted Weisfeiler-Leman variant to detect subgraph counts (Remark 4.14). Note: Recently, Lemma 4.9 and a part of its consequence Theorem 4.10 were independently obtained for the case without constraints on reusability in the PhD thesis [36].
A comonadic perspective.
Finally, we give a comonadic account of requantification as a logical resource. The pebbling comonad [2] and pebble-relation comonad [27] were constructed from organizing the respective pebble games as endofunctors on categories of relational structures. We use reusability-restricted variants of these pebble games from [30] and this work to obtain similar constructions, namely the comonads and . By proving close correspondences between coalgebras of these comonads and our newly defined path and tree decompositions, we obtain categorical characterizations of reusability in graph decompositions (Theorem 5.4). Finally, we show that coKleisli isomorphisms correspond to Duplicator winning strategies in the corresponding pebble games and hence characterize equivalence for the logics and (Theorem 5.5). We also devise restricted pebble games to capture coKleisli morphisms and thereby characterize preservation in counting-free logics with restricted requantification (Theorem 5.8).
2 Preliminaries
We write for the set of natural numbers, for the set of positive integers, and for we define . Unless stated explicitly otherwise, we let throughout the paper. We fix the variable sets (also called pebble sets) , , and . For the following definitions we let be a set. We write for the power set of and set . A partial function assigns to every variable at most one element . If does not assign an element to , we write . Also, we write and for the image and domain of respectively. We write , and for the sets of non-empty finite sequences, sequences of length , and sequences of length at most over respectively. We denote sequences of elements by and for we write if is a prefix of . The concatenation of and is denoted by . For with we define and . Also, we indicate that occurs in by writing . For a variable and we write for the partial function that is obtained from by replacing the image by . Given a sequence and we denote by the with the largest index such that . We call the first entry of each element in a pebble index or variable index. For a proposition , we use the Iverson bracket to indicate whether is satisfied.
Finite model theory.
We fix a finite signature of relation symbols and associate to each an arity . A -structure consists of a universe of elements and interpretations for each . For -structures and we say that is a substructure of if and for each . Every set of elements induces a substructure of with universe and relations for . A homomorphism between -structures and is a function such that for all we have that implies . The function is called an isomorphism if it is a bijective homomorphism and is a homomorphism. Let be a logic over the signature with variable set (for a formal definition see [14]). For a formula we write to indicate that the set of free variables of , which we denote by , is a subset of . Given a -structure and an assignment we write to indicate that satisfies with interpreted according to . For a tuple we write by assigning . For -structures we write if and satisfy exactly the same sentences from . We write if every sentence from satisfied by is also satisfied by . First-order counting logic extends first-order logic by counting quantifiers for . We say that a variable is requantified in a logical formula if it either occurs free and bound or if it is quantified within the scope of a quantification over . The logic is obtained from by fixing the variable set and requiring that only variables from are requantified. Finally, is the fragment of with quantifier-rank at most (see [30] for details).
Graphs.
A finite graph is a pair consisting of a finite set of vertices and a set of edges. For an edge we also write . Given a set we define the induced subgraph . For a graph and we write for the set of edges incident to . We denote the set of vertex sets of connected components (i.e. maximal connected subgraphs) of by . A rooted tree is a pair such that is a tree and is a designated vertex, called the root of . With a rooted tree we associate a partial order on the vertices of by setting exactly if is on the unique path from to . The height of a rooted tree is the maximal number of vertices on a path from the root to a leaf. A rooted forest is a pair such that if are the connected components of we have and is a rooted tree for each . A labeled graph is a graph together with a finite set of labels and a partial labeling function . We write for the set of labels occurring in . A labeled graph is called fully labeled if the labeling function is surjective. We denote the class of all -labeled graphs by . The product of two labeled graphs is the graph obtained by taking the disjoint union of and , identifying vertices with the same label, and suppressing any loops or parallel edges that might be created. Note that for a graph the labeling is a partial variable assignment and hence we may write for if .
Two central concepts in this work are tree decompositions and path decompositions, which we briefly introduce next. For a more detailed exposition, we refer the reader to [7].
Definition 2.1.
Let be a graph. A tree decomposition of is a tuple such that is a tree and is a function such that
-
,
-
for all there exists a with , and
-
for all the set of vertices is connected in .
The width of is and the treewidth of is the minimal width of a tree decomposition of . If is a rooted tree with root we call a rooted tree decomposition. A path decomposition of is a tree decomposition such that the underlying tree is a path. If the decomposition is rooted, then we define the root to be an endpoint of . The width of is again and the pathwidth of is the minimal width of a path decomposition of .
The CFI-construction.
We use the CFI-construction introduced in [8] in the variant presented in [31]. Let be a connected graph and . For each we set . The CFI-graph is defined by
The connected graph is called the base graph of . We also define . For we also denote for the vertices in associated with . These vertices are also referred to as gadget vertices of and as the corresponding gadget.
Lemma 2.2 ([8, Lemma 6.2], [31, Lemma 3.2]).
For all sets of base vertices , the graphs and are isomorphic if and only if .
Thus, we set and for some as the isomorphism type only depends on the parity of . Note that the vertex sets of the graphs and only differ in and .
Lemma 2.3 ([29, Lemma 11]).
Let be a connected graph, , and be a path from to in . Then there exists an isomorphism such that for all it holds that
-
1.
, and
-
2.
if then .
Homomorphism indistinguishability.
We denote the number of homomorphisms from a possibly labeled graph to a graph by . For a class of labeled graphs we write for the class of all formal finite linear combinations with real coefficients of graphs in . For a linear combination and a labeled graph we define and to be the set of labels occurring in .
For a class of graphs we say that two graphs and are homomorphism indistinguishable over if for all it holds that . In this case we write . The homomorphism distinguishing closure of is defined as the class
The class is called homomorphism distinguishing closed if .
Lemma 2.4 ([16, Proposition 47]).
Let be a graph class that is closed under taking disjoint unions and summands (i.e. exactly if ). If for every connected graph it holds that , then is homomorphism distinguishing closed.
Category theory.
We assume only very basic background in category theory, see [1] for details. For a category we denote its objects by and its morphisms (or arrows) by . We denote the category of -structures with their homomorphisms by .
A comonad (in coKleisli form) on a category is given by:
-
an object map ,
-
a counit morphism for every ,
-
and a coextension operation associating with each morphism another morphism for
such that for all morphisms , we have , , and . From this, a comonad in standard form on the category can be obtained by setting (turning into a functor) and for . For a comonad in standard form, a coalgebra over is a pair where and such that and .
For a comonad in coKleisli form we define the coKleisli category :
-
is the class of objects .
-
are all morphisms for .
-
The composition is defined by setting .
-
The identity morphisms are given by the counit morphisms for .
3 Graph decompositions with restricted reusability
In this section, we introduce several graph decompositions that incorporate constraints on reusability of vertices within the parts of each decomposition. Specifically, we define four distinct types of decompositions, each of which comes in two variants corresponding to two underlying structural models: the path model and the (bounded-depth) tree model. Each decomposition is parameterized by two values: , representing the number of reusable resources, and , representing the number of non-reusable resources. Our goal is to show that, for each of the two models, the corresponding decompositions define the same graph class with aligned parameters. This equivalence allows us to explore the concept of reusability in graph decompositions from multiple, yet consistent, perspectives. The motivation for each decomposition arises from its significance in homomorphism indistinguishability over the associated graph class, establishing a unifying theme for our study. In Table 1 we summarize the significance of the various decompositions introduced in this section for our results on homomorphism indistinguishability.
| graph class |
|
h.d. closedness | game comonads | ||||||||||||
| path |
|
|
|
|
|||||||||||
| tree |
|
|
|
|
We begin by introducing the notion of exception sets for tree decompositions of bounded depth and for path decompositions. The key idea is to generalize the concept of a tree decomposition of width by permitting up to exceptions along each branch of the underlying tree. However, there is an important restriction: if a vertex is designated as an exception at some node in the rooted tree decomposition, then it must remain fixed, i.e., cannot be replaced by a different vertex at any descendant of . In this sense, the exception status is not reusable along the subtree rooted at .
Definition 3.1.
Let be a graph, , , and . A rooted tree decomposition of has
-
width if for each leaf there exists a set of exceptions with such that ,
-
and depth .
We write for the class of all graphs admitting a tree decomposition of width and for the subclass admitting such a cover of depth .
If is a path decomposition, we define that has component width if for each connected component there is an exception set with such that .
We write for the class of graphs admitting a path decomposition of width .
For we recover the class of graphs of treewidth at most but for we allow the technical nuisance of having in order to avoid a case distinction.
Note that for the width of a path decomposition we only require the existence of one single set of exceptions. Thus, for fixed the class of graphs admitting a path decomposition of width can be seen as an approximation of the class of graphs of pathwidth at most up to deleting vertices.
Next, we extend the notion of pebble forest covers to incorporate the concept of reusability. Originally introduced in [2] as -traversals, these structures provide a combinatorial characterization of coalgebras over the pebbling comonad , finally demonstrating how the comonadic structure of can be used to characterize treewidth. Our aim is to follow a similar approach to characterize reusability (specifically, width ) within tree decompositions of bounded depth via comonadic methods. To this end, we use non-reusable pebbles , which mark fixed positions in a forest cover that cannot be reassigned, thereby encoding the non-reusability constraint directly into the structure.
Definition 3.2.
Let be a graph and . A -pebble forest cover of is a tuple where is a rooted forest with and is a pebbling function such that
-
1.
if , then or ,
-
2.
if and , then for all with it holds that , and
-
3.
if and , then for all with it holds that .
The forest cover has depth if has height .
We call a linear forest cover if it additionally holds that
-
1.
every connected component of is a path, and
-
2.
if and , then for every it holds that .
If we relax Item 2 such that for with only for every in the same path of as it must hold , we say that is a linear component forest cover.
The tree-depth of a graph is the minimum such that has a forest cover of depth at most (see [28]). The class of graphs of tree-depth at most is denoted by .
The classes , , and admit characterizations in terms of pursuit-evasion games by [37], [6, 22], and [18] respectively. The characterization of was refined to in [17]. In [30] a cops-and-robber game with constraints on the reusability of cops and the number of rounds was introduced. We recall its definition and also modify it to match the game-theoretic characterization of .
Definition 3.3.
Let be a graph and let . The cops-and-robber game is defined as follows: The game is played between a group of cops denoted by the elements in and one robber. The position of the cops is given by a function and the position of the robber is a vertex . We denote the connected component of in the graph by . In one round of the game, the following steps are performed:
-
1.
The cops choose one cop and declare a new destination .
-
2.
The robber chooses a vertex in .
-
3.
If the cops win. Otherwise, the game continues from the new position .
Initially, neither the cops nor the robber are placed on the graph. The robber wins if the cops do not win after rounds. The game variant is defined in the same way with the modification that the robber wins if the cops never win a round.
The node searching game is defined as the variant of in which the robber is invisible to the cops. That is, the choice of the assignment can only depend on , but not on . Here the cops are called searchers instead and the robber is called fugitive. In this formulation the only difference to is that searchers do not know the position , but the fugitive knows the position .
The strategy of the cops or searchers is called monotone if in each round it holds that . We say that a game variant is monotone if the existence of a winning strategy implies the existence of a monotone winning strategy.
A winning strategy of the searchers in the game can be specified as a sequence of positions while in the game the cop strategy depends on the moves of the robber and therefore each position additionally depends on the robber position in round . The proof of [30, Theorem 15] hinges on this fact and shows that in the game the use of non-reusable cops is restricted to a pattern involving arbitrarily long sequences of reusing all reusable cops before utilizing a new non-reusable cop. We show that the situation is entirely different for due to the invisibility of the fugitive.
Proposition 3.4.
The searchers have a winning strategy in if and only if they have a winning strategy in with initial fixed placements of non-reusable searchers.
To prove the characterization of a graph parameter by a pursuit-evasion game an important step often is to establish that the respective game is monotone. Alongside this, in some cases proving the monotonicity of a game is the crucial step in establishing homomorphism distinguishing closedness of the associated graph class, see [5, 17] for a discussion. Our goal is to show monotonicity of the games introduced here in order to utilize this property to prove game-theoretic characterizations of and towards homomorphism distinguishing closedness. The monotonicity of was proven in [23] and recently [5] established the monotonicity of . We build on top of these results to show that reusability is compatible with monotonicity by replacing parts of winning strategies by monotone strategies. The notion of monotonicity we use here is usually referred to as robber-monotonicity in the literature.
Proposition 3.5.
Let and be a graph. Then both games and are monotone.
To characterize homomorphism indistinguishability over the class , in [17] the notion of construction trees was introduced, building on techniques from [13]. We extend this concept to accommodate the classes and . This generalized definition forms the basis of our framework for analyzing homomorphism indistinguishability over these broader classes.
Definition 3.6.
Let and be a -labeled graph. A -construction tree for is a tuple , where is a rooted tree and is a function assigning -labeled graphs to the nodes of such that
-
,
-
all leaves are assigned fully labeled graphs,
-
all internal nodes with exactly one child are elimination nodes, that is is obtained from by deleting a label,
-
all internal nodes with more than one child are product nodes, that is is the product of its children,
-
if is an elimination node deleting a label , then for all it holds that .
The elimination depth of is the maximum number of elimination nodes on any path from the root to a leaf. If has a -construction tree of elimination depth we say that is -constructible. We write for the class of -constructible labeled graphs. If has a -construction tree such that each product node has at most one child which is not a leaf, we say that is a construction caterpillar and is linearly -constructible. We write for the class of linearly -constructible labeled graphs.
We obtain the following characterizations for the classes and , showing that all previous definitions are equivalent for unlabeled graphs.
Theorem 3.7.
For a graph and the following are equivalent:
-
1.
, i.e., has a path decomposition of width .
-
2.
admits a linear -pebble forest cover.
-
3.
The searchers have a winning strategy for the game .
-
4.
, i.e., is linearly -constructible.
Theorem 3.8.
For a graph and the following are equivalent:
-
1.
, i.e., has a tree decomposition of width and depth .
-
2.
admits a -pebble forest cover of depth .
-
3.
The cops have a winning strategy for the game .
-
4.
, i.e., is -constructible.
Remark 3.9.
Regarding inclusions between classes (or ) for varying parameters and we observe that the proof of [30, Theorem 13] can be used to show a complete classification of all inclusions, which in particular separates from for (and likewise for , except that for all by Proposition 3.4).
We observe that classes the and admit usual closure properties, except that is not closed under taking disjoint unions.
Proposition 3.10.
Let . The class is closed under taking disjoint unions, summands, and minors. The class is closed under taking summands and minors but not under taking disjoint unions for .
The class formalizes the notion of reusability for path decompositions in an appropriate sense as exemplified by the characterization through . However, to overcome the obstacle that this class is not closed under disjoint unions we define the class as the closure of under disjoint unions. This class formalizes the notion of restricted reusability componentwise on a graph. The next proposition, which follows directly from Theorem 3.7, makes this explicit.
Proposition 3.11.
For a graph and the following are equivalent:
-
1.
, i.e., has a path decomposition of component width .
-
2.
admits a linear -pebble component forest cover.
-
3.
For each component the searchers have a winning strategy for .
4 Homomorphism indistinguishability and logical equivalence
In this section, we characterize homomorphism indistinguishability over the classes and by logics with restricted requantification. We start by giving the definition of finite variable counting logic with restricted conjunction and requantification, extending a definition from [27].
Definition 4.1.
We define the set of logical formulas over the variable sets and . The non-counting formulas of the logic are given by
for , , atomic, and countable index sets, a restricted conjunction, and a non-counting formula with , . Here, restricted conjunction means that at most one formula containing a quantifier is not a sentence. Furthermore, the logic contains the formulas
for , , a non-counting formula , and . We additionally require that only variables from are requantified. The fragment is defined by additionally requiring that all conjunctions and disjunctions are finite.
We call a non-counting formula primitive if it contains no disjunction and every restricted conjunction does not contain a sentence. A formula is called primitive if it is of the form for a primitive non-counting formula .
We first prove that there is a normal form for restricted conjunction counting logic with respect to requantification and primitivity, enabling a more direct correspondence between the syntax of formulas and construction caterpillars. The idea is to translate the scheme from Proposition 3.4 into the language of logic: It suffices to first fix all non-requantifiable variables followed by a well-behaved employment of requantifiable variables.
Proposition 4.2.
Every sentence is logically equivalent to disjunction of sentences of the form
for a primitive non-counting formula only containing quantification over variables from .
In [27] it was shown that equivalence in is the same as homomorphism indistinguishability over . This result was proven by evoking a categorical meta-theorem from [11]. We utilize the constructive nature of the proofs in [13, 17] to give a new combinatorial proof of the result that also generalizes to the setting with restricted requantification.
As a first step, we show that homomorphism counts from graphs in are -definable by inductively building up the formula along a construction caterpillar.
Lemma 4.3.
Let and . There exists a formula with such that for each -labeled graph with it holds that
if and only if .
Next, we aim to prove that also every property definable in can be modeled by counting homomorphisms from . In fact, the number of solutions to a non-counting formula in a graph can be expressed by counting homomorphisms from linear combinations:
Lemma 4.4.
Let and be a non-counting formula. Then there exists a linear combination such that for all we have
Combining the two previous results allows us to prove that homomorphism indistinguishability over the class is the same as logical equivalence with restricted conjunction and requantification.
Theorem 4.5.
For and graphs the following are equivalent:
-
and are homomorphism indistinguishable over the class .
-
and are -equivalent.
Following the proof from [17], this strategy can be used to make all constructions for the logic with unrestricted conjunction also preserve requantification.
Theorem 4.6.
For and graphs the following are equivalent:
-
and are -equivalent.
-
and are homomorphism indistinguishable over the class .
4.1 Homomorphism distinguishing closedness
We follow the approach from [29] to combine pursuit-evasion and model-comparison games to prove homomorphism distinguishing closedness for the classes and .
First, we introduce a reusability-restricted variant of the all-in-one bijective pebble game from [27] to characterize -equivalence.
Definition 4.7.
Let be -structures and . The all-in-one bijective -pebble game is defined as follows:
The game is played by the two players Spoiler and Duplicator on the structures and . During the first and only round of the game, the following steps are performed:
-
1.
Spoiler chooses a sequence of pebbles such that each occurs at most once in .
-
2.
Duplicator chooses a bijection .
-
3.
Spoiler chooses and defines the sequence .
-
4.
Duplicator responds with the sequence .
Duplicator wins if for all the function defined by setting for each is a partial isomorphism between and .
We extend the proof of [27, Theorem 5.9.] to the setting with restricted requantification and obtain the following:
Theorem 4.8.
Let be finite -structures and . Then the following assertions are equivalent:
-
1.
and are -equivalent.
-
2.
and are -equivalent.
-
3.
Duplicator has a winning strategy for .
The proof shows that the theorem also holds for infinite structures if we omit Item 2.
The next lemma is the key technical ingredient to establish our first homomorphism distinguishing closedness result. But more generally, it shows that the capability of to be decomposed in a path-like fashion with reusability constraints provides a lower bound for the distinguishability of the CFI graphs by .
Lemma 4.9.
Let and be a connected graph. If the fugitive has a winning strategy for the game , then Duplicator has a winning strategy for .
The proof idea is that the position of the fugitive in corresponds to the position where the difference of the CFI graphs is moved to in by Lemma 2.3. Thus, the invisibility of the fugitive corresponds to the fact that Spoiler has to fix their entire strategy at once. We conjecture that using similar techniques also the reverse implication of this lemma can be shown, which would in particular yield that the pathwidth of a graph is exactly the minimum such that distinguishes and . However, to prove our next theorem the direction form Lemma 4.9 suffices.
Theorem 4.10.
The classes and are homomorphism distinguishing closed.
Proof.
For the class is closed under taking disjoint unions and summands. For every connected graph the fugitive has a winning strategy for by Theorem 3.7. By Theorem 4.5 and Lemma 4.9 this in turn yields . Finally, by Lemma 2.4 it follows that is h.d. closed. Note that the class is not homomorphism distinguishing closed since the relations and are identical, but .
After establishing the monotonicity of in Proposition 3.5, we can use the correspondence to the bijective pebble game [30, Lemma 8] to recast the proof for .
Theorem 4.11.
The class is homomorphism distinguishing closed.
Remark 4.12.
In the language of [31] the proofs of Theorem 4.10 and Theorem 4.11 show that the respective classes are closed under weak oddomorphisms by [31, Theorem 3.13].
4.2 Invariance of subgraph counts
As an application of the previous results of homomorphism distinguishing closedness and its relation to logic, we provide characterizations of the logical invariance of subgraph counts with respect to hereditary graph structure as in [29].
For graphs we denote by the number of subgraphs of which are isomorphic to . We write for the set of homomorphic images of a graph containing exactly one representative from each isomorphism class. For a logic and a graph we say that the function is -invariant if for all graphs and the implication holds.
Theorem 4.13.
Let and be a graph. Then the following assertions hold:
-
The function is -invariant if and only if .
-
The function is -invariant if and only if .
Remark 4.14.
By [30, Theorem 6] the second assertion of this theorem characterizes which subgraph counts are detected after iterations of the -dimensional oblivious Weisfeiler-Leman algorithm.
5 A comonadic account of requantification
In this section, we present variations of the pebble-relation comonad introduced in [27] and the pebbling comonad from [2], with the aim of capturing requantification as a logical resource from a categorical perspective. We emphasize that, in order to achieve this, it suffices to adapt the definitions of the associated universes and . This approach highlights the versatility of the pebble-relation and pebbling comonads, enabling concise proofs building on previous work despite the significant differences among the corresponding graph classes.
For a sequence and define . When no index is given, we set .
Definition 5.1.
For a -structure we define the -structure as follows:
-
The universe of consists of all pairs for , , and for such that every appears at most once as pebble index in .
-
The counit morphism is defined by
-
For it holds exactly if there exists such that
-
–
for all it holds , (equality)
-
–
does not appear in for , and (active pebble)
-
–
. (compatibility)
-
–
For a -structure and a homomorphism we define the coextension of by setting for and
Definition 5.2.
For a -structure we define the -structure as follows:
-
The universe of consists of all sequences such that every pebble appears at most once as pebble index in .
-
The counit morphism is defined by
-
For it holds exactly if
-
–
, (compatibility)
-
–
for we have or , and (comparability)
-
–
for if then
does not occur as a first coordinate in for . (active pebble)
-
–
For a -structure and a homomorphism the coextension is defined by where for . For the structure is defined as the substructure of over the universe .
To show that and are again comonads it suffices to observe that the definitions of , , and the coextensions are invariant under reusability constraints. Thus, from [27, Proposition 3.1] and [2, Theorem 4] we obtain the following:
Proposition 5.3.
The triples and are comonads in coKleisli form on .
Utilizing the characterization of the classes and in terms of pebble forest covers, we now provide a categorical account of reusability in path- and bounded depth tree decompositions. Similar results are called coalgebra characterization theorems in the literature of game comonads [4]. We have defined our decompositions in terms of graphs rather than relational structures. The definition of forest covers can be adapted for structures, which yields the same as considering forest covers of the Gaifman graph of .
Theorem 5.4.
For every finite -structure there is a bijective correspondence between
-
1.
-pebble linear component forest covers of and coalgebras .
-
2.
-pebble forest covers of depth of and coalgebras .
Further employing the theory of game comonads, we give a categorical formulation of equivalence in the counting logics and as isomorphism in the coKleisli category. Accordingly, similar theorems are also called isomorphism power theorems in the literature. As in [27], we use the extended signature to define the functor which extends each -structure by the identity relation and gives rise to a relative comonad on (see [27]).
Theorem 5.5.
For all -structures and the following hold:
-
1.
There exists a coKleisli isomorphism if and only if .
-
2.
There exists a coKleisli isomorphism if and only if .
One of the contributions of game comonads is to provide a unified language for various relations from finite model theory. Specifically, in the remainder of this section we show that morphisms in the coKleisli category characterize preservation and winning strategies for logics and games without counting. We first introduce the notion of reusability to the all-in-one pebble game from [27] and the well-known existential -pebble game from [24], allowing for a more fine grained analysis.
Definition 5.6.
Let be -structures and . The all-in-one -pebble game and -pebble game are defined as follows: Both games are played by the two players Spoiler and Duplicator on the structures and and start from a (possibly empty) position with the same pebble sequence in which each pebble pair occurs at most once.
In each round of the -pebble game, the following steps are performed:
-
1.
Spoiler picks a pebble such that is not yet placed or and places it on an element .
-
2.
Duplicator places the pebble on an element .
This induces sequences and of placements after round .
In the single round of the game , the following steps are performed:
-
1.
Spoiler chooses a sequence such that each occurs at most once in and not in .
-
2.
Duplicator responds with a sequence .
The winning condition for both games is the following: Duplicator wins the game if for all the function defined by setting for each is a partial homomorphism between and .
The logic is defined as the fragment of existential positive first-order logic (i.e. no universal quantification and negation) over the variable set such that only variables from are requantified. We obtain by additionally requiring that every conjunction is restricted and by bounding the quantifier-rank by .
Proposition 5.7.
For all -structures and the following hold:
-
1.
Duplicator wins if and only if .
-
2.
Duplicator wins rounds of the -pebble game if and only if .
Finally, we also obtain what is called a morphism power theorem for game comonads with restricted reusability.
Theorem 5.8.
For all -structures and the following hold:
-
1.
There exists a coKleisli morphism if and only if .
-
2.
There exists a coKleisli morphism if and only if .
6 Conclusion
In this work, we extended the analysis of homomorphism indistinguishability to graph classes characterized by graph decompositions with restricted reusability. We demonstrate how decomposition-based approaches offer robust and adaptable techniques for characterizing indistinguishability relations as well as for establishing homomorphism distinguishing closedness. Moreover, by integrating these results within the broader framework of game comonads, we present a unified categorical perspective on the role of requantification in finite variable counting logics. We list some open questions for future work:
-
The homomorphism indistinguishability relation can be decided by a more space-efficient variant of the -dimensional Weisfeiler-Leman algorithm [30]. It would be interesting to develop a linearized variant to efficiently decide the relation . The logic is closely related to the -consistency algorithm for solving constraint satisfaction problems, so it might be fruitful to explore whether restricting reusability yields improved algorithmic techniques.
-
Motivated by the constructive nature of our results, it is natural to ask for more connections between model-comparison and pursuit-evasion games. Specifically, identifying broader classes of games that align with logical equivalences could yield more results on characterizations and h.d. closedness.
-
While we have established h.d. closedness for specific graph classes, a comonadic treatment of this property could provide a deeper understanding of its categorical structure. In particular, investigating whether h.d. closedness can be characterized via coalgebraic properties of game comonads might reveal fundamental principles governing homomorphism indistinguishability of relational structures as in [11].
References
- [1] S. Abramsky and N. Tzevelekos. Introduction to Categories and Categorical Logic, pages 3–94. Springer Berlin Heidelberg, 2010. doi:10.1007/978-3-642-12821-9_1.
- [2] Samson Abramsky, Anuj Dawar, and Pengming Wang. The pebbling comonad in finite model theory. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017, pages 1–12. IEEE Computer Society, 2017. doi:10.1109/LICS.2017.8005129.
- [3] Samson Abramsky and Luca Reggio. An invitation to game comonads. ACM SIGLOG News, 11(3):5–48, 2024. doi:10.1145/3687256.3687260.
- [4] Samson Abramsky and Nihil Shah. Relating structure and power: Comonadic semantics for computational resources. J. Log. Comput., 31(6):1390–1428, 2021. doi:10.1093/LOGCOM/EXAB048.
- [5] Isolde Adler and Eva Fluck. Monotonicity of the cops and robber game for bounded depth treewidth. In 49th International Symposium on Mathematical Foundations of Computer Science, MFCS 2024, August 26-30, 2024, Bratislava, Slovakia, volume 306 of LIPIcs, pages 6:1–6:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.MFCS.2024.6.
- [6] Daniel Bienstock, Neil Robertson, Paul D. Seymour, and Robin Thomas. Quickly excluding a forest. J. Comb. Theory B, 52(2):274–283, 1991. doi:10.1016/0095-8956(91)90068-U.
- [7] Hans L. Bodlaender. A partial k-arboretum of graphs with bounded treewidth. Theor. Comput. Sci., 209(1-2):1–45, 1998. doi:10.1016/S0304-3975(97)00228-4.
- [8] Jin-Yi Cai, Martin Fürer, and Neil Immerman. An optimal lower bound on the number of variables for graph identification. Combinatorica, 12(4):389–410, 1992. doi:10.1007/bf01305232.
- [9] Radu Curticapean, Holger Dell, and Dániel Marx. Homomorphisms are a good basis for counting small subgraphs. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017, pages 210–223. ACM, 2017. doi:10.1145/3055399.3055502.
- [10] Víctor Dalmau. Linear datalog and bounded path duality of relational structures. Log. Methods Comput. Sci., 1(1), 2005. doi:10.2168/LMCS-1(1:5)2005.
- [11] Anuj Dawar, Tomas Jakl, and Luca Reggio. Lovász-type theorems and game comonads. In 36th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2021, Rome, Italy, June 29 - July 2, 2021, pages 1–13. IEEE, 2021. doi:10.1109/LICS52264.2021.9470609.
- [12] Holger Dell, Martin Grohe, and Gaurav Rattan. Lovász meets Weisfeiler and Leman. In 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018, July 9-13, 2018, Prague, Czech Republic, volume 107 of LIPIcs, pages 40:1–40:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPICS.ICALP.2018.40.
- [13] Zdenek Dvorák. On recognizing graphs by numbers of homomorphisms. Journal of Graph Theory, 64(4):330–342, 2010. doi:10.1002/JGT.20461.
- [14] Heinz-Dieter Ebbinghaus. Extended Logics: The General Framework, pages 25–76. Cambridge University Press, 2017. doi:10.1017/9781316717158.005.
- [15] Heinz-Dieter Ebbinghaus and Jörg Flum. Finite Model Theory. Springer Berlin Heidelberg, second edition edition, 1995. doi:10.1007/3-540-28788-4.
- [16] Eva Fluck, Tim Seppelt, and Gian Luca Spitzer. Going deep and going wide: Counting logic and homomorphism indistinguishability over graphs of bounded treedepth and treewidth, 2023. doi:10.48550/arXiv.2308.06044.
- [17] Eva Fluck, Tim Seppelt, and Gian Luca Spitzer. Going deep and going wide: Counting logic and homomorphism indistinguishability over graphs of bounded treedepth and treewidth. In 32nd EACSL Annual Conference on Computer Science Logic, CSL 2024, February 19-23, 2024, Naples, Italy, volume 288 of LIPIcs, pages 27:1–27:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.CSL.2024.27.
- [18] Archontia C. Giannopoulou, Paul Hunter, and Dimitrios M. Thilikos. Lifo-search: A min–max theorem and a searching game for cycle-rank and tree-depth. Discrete Applied Mathematics, 160(15):2089–2097, October 2012. doi:10.1016/j.dam.2012.03.015.
- [19] Andreas Göbel, Leslie Ann Goldberg, and Marc Roth. The Weisfeiler-Leman dimension of conjunctive queries. Proc. ACM Manag. Data, 2(2):86, 2024. doi:10.1145/3651587.
- [20] Martin Grohe. Counting bounded tree depth homomorphisms. In LICS ’20: 35th Annual ACM/IEEE Symposium on Logic in Computer Science, Saarbrücken, Germany, July 8-11, 2020, pages 507–520. ACM, 2020. doi:10.1145/3373718.3394739.
- [21] Martin Grohe, Gaurav Rattan, and Tim Seppelt. Homomorphism tensors and linear equations. In 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, July 4-8, 2022, Paris, France, volume 229 of LIPIcs, pages 70:1–70:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPICS.ICALP.2022.70.
- [22] Lefteris M. Kirousis and Christos H. Papadimitriou. Interval graphs and searching. Discrete Mathematics, 55(2):181–184, 1985. doi:10.1016/0012-365x(85)90046-9.
- [23] Lefteris M. Kirousis and Christos H. Papadimitriou. Searching and pebbling. Theoretical Computer Science, 47(3):205–218, 1986. doi:10.1016/0304-3975(86)90146-5.
- [24] Phokion G. Kolaitis and Moshe Y. Vardi. On the expressive power of datalog: Tools and a case study. J. Comput. Syst. Sci., 51(1):110–134, 1995. doi:10.1006/JCSS.1995.1055.
- [25] László Lovász. Operations with structures. Acta Mathematica Academiae Scientiarum Hungaricae, 18(3–4):321–328, 1967. doi:10.1007/bf02280291.
- [26] Laura Mancinska and David E. Roberson. Quantum isomorphism is equivalent to equality of homomorphism counts from planar graphs. In 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, Durham, NC, USA, November 16-19, 2020, pages 661–672. IEEE, 2020. doi:10.1109/FOCS46700.2020.00067.
- [27] Yoàv Montacute and Nihil Shah. The pebble-relation comonad in finite model theory. Log. Methods Comput. Sci., 20(2), 2024. doi:10.46298/LMCS-20(2:9)2024.
- [28] Jaroslav Nesetril and Patrice Ossona de Mendez. Tree-depth, subgraph coloring and homomorphism bounds. Eur. J. Comb., 27(6):1022–1041, 2006. doi:10.1016/J.EJC.2005.01.010.
- [29] Daniel Neuen. Homomorphism-distinguishing closedness for graphs of bounded tree-width. In 41st International Symposium on Theoretical Aspects of Computer Science, STACS 2024, March 12-14, 2024, Clermont-Ferrand, France, volume 289 of LIPIcs, pages 53:1–53:12. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.STACS.2024.53.
- [30] Simon Raßmann, Georg Schindling, and Pascal Schweitzer. Finite variable counting logics with restricted requantification. In 33rd EACSL Annual Conference on Computer Science Logic, CSL 2025, February 10-14, 2025, Amsterdam, Netherlands, volume 326 of LIPIcs, pages 14:1–14:23. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPICS.CSL.2025.14.
- [31] David E. Roberson. Oddomorphisms and homomorphism indistinguishability over graphs of bounded degree, 2022. doi:10.48550/arXiv.2206.10321.
- [32] David E. Roberson and Tim Seppelt. Lasserre hierarchy for graph isomorphism and homomorphism indistinguishability. TheoretiCS, 3, 2024. doi:10.46298/THEORETICS.24.20.
- [33] Neil Robertson and Paul D. Seymour. Graph minors. I. excluding a forest. J. Comb. Theory B, 35(1):39–61, 1983. doi:10.1016/0095-8956(83)90079-5.
- [34] Georg Schindling. Homomorphism indistinguishability and game comonads for restricted conjunction and requantification, 2025. arXiv:2506.19746.
- [35] Tim Seppelt. Logical equivalences, homomorphism indistinguishability, and forbidden minors. Inf. Comput., 301:105224, 2024. doi:10.1016/J.IC.2024.105224.
- [36] Tim Seppelt. Homomorphism indistinguishability. PhD thesis, RWTH Aachen University, 2024/2025. doi:10.18154/RWTH-2024-11629.
- [37] Paul D. Seymour and Robin Thomas. Graph searching and a min-max theorem for tree-width. Journal of Combinatorial Theory, Series B, 58(1):22–33, May 1993. doi:10.1006/jctb.1993.1027.
