Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

There is a remarkable divide in the field of logic in Computer Science, between two distinct strands: one focussing on semantics and compositionality (“Structure”), the other on expressiveness and efficiency (“Power”). It is remarkable because these two fundamental aspects of our field are studied using almost disjoint technical languages and methods, by almost disjoint research communiities. We believe that bridging this divide is a major issue in Computer Science, and may hold the key to fundamental advances in the field.

In this paper, we develop a novel approach to relating categorical semantics, which exemplifies the first strand, to finite model theory, which exemplifies the second. It builds on the ideas introduced in [1], but goes much further, showing clearly that there is a strong and robust connection, which can serve as a basis for many further developments.

1.1 The Setting

Relational structures and the homomorphisms between them play a fundamental rôle in finite model theory, constraint satisfaction and database theory. The existence of a homomorphism \(A \rightarrow B\) is an equivalent formulation of constraint satisfaction, and also equivalent to the preservation of existential positive sentences [4]. This setting also generalizes what has become a central perspective in graph theory [5].

1.2 Model Theory and Deception

In a sense, the purpose of model theory is “deception”. It allows us to see structures not “as they really are”, i.e. up to isomorphism, but only up to definable properties, where definability is relative to a logical language \(\mathcal {L}\). The key notion is logical equivalence \(\equiv ^{\mathcal {L}}\). Given structures \(\mathcal {A}\), \(\mathcal {B}\) over the same vocabulary:

$$\begin{aligned} \mathcal {A}\equiv ^{\mathcal {L}}\mathcal {B}\;\; {\mathop {\Longleftrightarrow }\limits ^{\Delta }} \;\;\forall \varphi \in \mathcal {L}. \; \mathcal {A}\models \varphi \; \Longleftrightarrow \; \mathcal {B}\models \varphi . \end{aligned}$$

If a class of structures \(\mathcal {K}\) is definable in \(\mathcal {L}\), then it must be saturated under \(\equiv ^{\mathcal {L}}\). Moreover, for a wide class of cases of interest in finite model theory, the converse holds [6].

The idea of syntax-independent characterizations of logical equivalence is quite a classical one in model theory, exemplified by the Keisler-Shelah theorem [10]. It acquires additional significance in finite model theory, where model comparison games such as Ehrenfeucht-Fraissé games, pebble games and bisimulation games play a central role [7].

We offer a new perspective on these ideas. We shall study these games, not as external artefacts, but as semantic constructions in their own right. Each model-theoretic comparison game encodes “deception” in terms of limited access to the structure. These limitations are indexed by a parameter which quantifies the resources which control this access. For Ehrenfeucht-Fraissé games, this is the number of rounds; for pebble games, the number of pebbles; and for bisimulation games, the modal depth.

2 Main Results

We now give a conceptual overview of our main results. Technical details are provided in [2].

We shall consider three forms of model comparison game: Ehrenfeucht-Fraissé games, pebble games and bisimulation games [7]. For each of these notions of game \(\mathsf {G}\), and value of the resource parameter k, we shall define a corresponding comonad \(\mathbb {C}_{k}\) on the category of relational structures and homomorphisms over some relational vocabulary. For each structure \(\mathcal {A}\), \(\mathbb {C}_{k}\mathcal {A}\) is another structure over the same vocabulary, which encodes the limited access to \(\mathcal {A}\) afforded by playing the game on \(\mathcal {A}\) with k resources. There is always an associated homomorphism \(\varepsilon _{\mathcal {A}}: \mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {A}\) (the counit of the comonad), so that \(\mathbb {C}_{k}\mathcal {A}\) “covers” \(\mathcal {A}\). Moreover, given a homomorphism \(h : \mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\), there is a Kleisli coextension homomorphism \(h^* : \mathbb {C}_{k}\mathcal {A}\rightarrow \mathbb {C}_{k}\mathcal {B}\). This allows us to form the coKleisli category \(\mathsf {Kl}(\mathbb {C}_{k})\) for the comonad. The objects are relational structures, while the morphisms from \(\mathcal {A}\) to \(\mathcal {B}\) in \(\mathsf {Kl}(\mathbb {C}_{k})\) are exactly the homomorphisms of the form \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\). Composition of these morphisms uses the Kleisli coextension. The connection between this construction and the corresponding form of game \(\mathsf {G}\) is expressed by the following result:

Theorem 1

The following are equivalent:

  1. 1.

    There is a coKleisli morphism \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\)

  2. 2.

    Duplicator has a winning strategy for the existential \(\mathsf {G}\)-game with k resources, played from \(\mathcal {A}\) to \(\mathcal {B}\).

The existential form of the game has only a “forth” aspect, without the “back”. This means that Spoiler can only play in \(\mathcal {A}\), while Duplicator only plays in \(\mathcal {B}\). This corresponds to the asymmetric form of the coKleisli morphisms \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\). Intuitively, Spoiler plays in \(\mathbb {C}_{k}\mathcal {A}\), which gives them limited access to \(\mathcal {A}\), while Duplicator plays in \(\mathcal {B}\). The Kleisli coextension guarantees that Duplicator’s strategies can always be lifted to \(\mathbb {C}_{k}\mathcal {B}\); while we can always compose a strategy \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathbb {C}_{k}\mathcal {B}\) with the counit on \(\mathcal {B}\) to obtain a coKleisli morphism.

This asymmetric form may seem to limit the scope of this approach, but in fact this is not the case. For each of these comonads \(\mathbb {C}_{k}\), we have the following three equivalences:

  • \(\mathcal {A}\rightleftarrows _{k}\mathcal {B}\) iff there are coKleisli morphisms \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\) and \(\mathbb {C}_{k}\mathcal {B}\rightarrow \mathcal {A}\). Note that there need be no relationship between these morphisms.

  • \(\mathcal {A}\cong _{\mathsf {Kl}(\mathbb {C}_{k})}\mathcal {B}\) iff \(\mathcal {A}\) and \(\mathcal {B}\) are isomorphic in the coKleisli category \(\mathsf {Kl}(\mathbb {C}_{k})\). This means that there are morphisms \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\) and \(\mathbb {C}_{k}\mathcal {B}\rightarrow \mathcal {A}\) which are inverses of each other in \(\mathsf {Kl}(\mathbb {C}_{k})\).

Clearly, \(\cong _{\mathsf {Kl}(\mathbb {C}_{k})}\) strictly implies \(\rightleftarrows _{k}\). We can also define an intermediate “back-and-forth” equivalence \(\leftrightarrow _{k}\), parameterized by a winning condition \(\mathsf {W}_{\mathcal {A},\mathcal {B}}\subseteq \mathbb {C}_{k}\mathcal {A}\times \mathbb {C}_{k}\mathcal {B}\).

For each of our three types of game, there are corresponding fragments \(\mathcal {L}_{k}\) of first-order logic:

  • For Ehrenfeucht-Fraissé games, \(\mathcal {L}_{k}\) is the fragment of quantifier-rank \(\le k\).

  • For pebble games, \(\mathcal {L}_{k}\) is the k-variable fragment.

  • For bismulation games over relational vocabularies with symbols of arity at most 2, \(\mathcal {L}_{k}\) is the modal fragment [3] with modal depth \(\le k\).

In each case, we write \(\exists \mathcal {L}_{k}\) for the existential positive fragment of \(\mathcal {L}_{k}\), and \(\mathcal {L}_{k}^{\#}\) for the extension of \(\mathcal {L}_{k}\) with counting quantifiers [7].

We can now state our first main result, in a suitably generic form.

Theorem 2

For finite structures \(\mathcal {A}\) and \(\mathcal {B}\):

$$\begin{aligned} \begin{array}{lccc} (1) &{} \mathcal {A}\equiv ^{\exists \mathcal {L}_{k}}\mathcal {B}&{} \; \Longleftrightarrow \; &{} \mathcal {A}\rightleftarrows _{k}\mathcal {B}. \\ (2) &{} \mathcal {A}\equiv ^{\mathcal {L}_{k}}\mathcal {B}&{} \; \Longleftrightarrow \; &{} \mathcal {A}\leftrightarrow _{k}\mathcal {B}. \\ (3) &{} \mathcal {A}\equiv ^{\mathcal {L}_{k}^{\#}}\mathcal {B}&{} \; \Longleftrightarrow \; &{} \mathcal {A}\cong _{\mathsf {Kl}(\mathbb {C}_{k})}\mathcal {B}. \end{array} \end{aligned}$$

Note that this is really a family of three theorems. Thus in each case, we capture the salient logical equivalences in syntax-free, categorical form.

We now turn to the significance of indexing by the resource parameter k. When \(k \le l\), we have a natural inclusion morphism \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathbb {C}_{l}\mathcal {A}\), since playing with k resources is a special case of playing with \(l \ge k\) resources. This tells us that the smaller k is, the easier it is to find a morphism \(\mathbb {C}_{k}\mathcal {A}\rightarrow \mathcal {B}\). Intuitively, the more we restrict Spoiler’s abilities to access the structure of \(\mathcal {A}\), the easier it is for Duplicator to win the game.

The contrary analysis applies to morphisms \(A \rightarrow \mathbb {C}_{k}\mathcal {B}\). The smaller k is, the harder it is find such a morphism. Note, however, that if \(\mathcal {A}\) is a finite structure of cardinality k, then \(\mathcal {A}\rightleftarrows _{k}\mathbb {C}_{k}\mathcal {A}\). In this case, with k resources we can access the whole of \(\mathcal {A}\). What can we say when k is strictly smaller than the cardinality of \(\mathcal {A}\)?

It turns out that there is a beautiful connection between these indexed comonads and combinatorial invariants of structures. This is mediated by the notion of coalgebra, another fundamental (and completely general) aspect of comonads. A coalgebra for a comonad \(\mathbb {C}_{k}\) on a structure \(\mathcal {A}\) is a morphism \(\mathcal {A}\rightarrow \mathbb {C}_{k}\mathcal {A}\) satisfying certain properties. We define the coalgebra number of a structure \(\mathcal {A}\), with respect to the indexed family of comonads \(\mathbb {C}_{k}\), to be the least k such that there is a \(\mathbb {C}_{k}\)-coalgebra on \(\mathcal {A}\).

We now come to our second main result.

Theorem 3

  • For the pebbling comonad, the coalgebra number of \(\mathcal {A}\) corresponds precisely to the treewidth of \(\mathcal {A}\).

  • For the Ehrenfeucht-Fraissé comonad, the coalgebra number of \(\mathcal {A}\) corresponds precisely to the tree-depth of \(\mathcal {A}\) [8].

  • For the modal comonad, the coalgebra number of \(\mathcal {A}\) corresponds precisely to the forest depth of \(\mathcal {A}\).

The main idea behind these results is that coalgebras on \(\mathcal {A}\) are in bijective correspondence with decompositions of \(\mathcal {A}\) of the appropriate form. We thus obtain categorical characterizations of these key combinatorial invariants.