Manuscript Offprint
arXiv:2611.01501Order-Invariant CFO Contains Local-Order-Invariant FO
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Order-invariant cluster first-order logic (CFO) and local-order-invariant first-order logic are two fragments of order-invariant first-order logic, both motivated by the study of invariant logics on classes of bounded degree. Our main result is that order-invariant CFO contains local-order-invariant FO on arbitrary classes of finite structures, settling the conjecture of Ghasemi and Grange that order-invariant CFO contains plain FO. By combining this with a collapse result of Ghasemi and Grange, we obtain the equivalence of FO, local-order-invariant FO, and order-invariant CFO on classes of finite colored graphs of bounded degree. The proof makes use of Gaifman normal form, which allows our translation from local-order-invariant FO to order-invariant CFO to be effective. Combined with the fixed-parameter tractability of model-checking for order-invariant CFO on bounded-degree colored graph classes, this shows that model-checking for local-order-invariant FO on bounded-degree colored graph classes is fixed-parameter tractable. To generalize our collapse and model-checking results beyond colored graphs, we use a method based on first-order interpretations which also yields a collapse of order-invariant FO to FO when restricted to graph classes of bounded shrub-depth. Finally, we give an application to the database-motivated frozen-witness logic of Abiteboul, Simon, and Vianu by showing that local-order-invariant FO contains deterministic frozen-witness FO, and thus that deterministic frozen-witness FO collapses to FO on classes of finite structures of bounded degree.
2012 ACM Subject Classification Theory of computation → Finite Model Theory
Keywords and phrases Local order invariance, order invariance, cluster first-order logic
Acknowledgements I would like to thank Noah Schweber for helpful conversations during the writing of this article.
1 Introduction
Finite model theory is the study of the queries on databases that can be expressed in formal languages. In particular, one tends to be interested in which queries are expressible in a given logic, and how difficult it is to compute whether a database satisfies a query defined in a given logic. In standard logics like first-order logic, fixed-point logics, or second-order logic, one can only refer to the relations of the structure itself. However, it is natural to want to make use of information like the order the data in the database is stored in, so long as the query evaluates in the same way on a database regardless of the particular order chosen. We call such a query, that is, one that uses an order but does not depend on the particular choice of order, order-invariant.
In the case of structures of arbitrary (including infinite) size, it is known that order-invariant first-order logic is equivalent in expressiveness to plain FO, via the Craig Interpolation Theorem [8]. However, there exist properties of finite structures definable in order-invariant FO which are not definable in FO, the first of which was discovered by Gurevich and published in [9]. In fact, it has been shown that the weaker fragment successor-invariant FO, in which formulae can only access the successor relation induced by the order in which the data is stored, can express properties of finite structures that cannot be expressed in FO [21]. Further non-collapse results include those for epsilon-invariant FO and deterministic frozen-witness FO [20], as well as for local-order-invariant FO [4].
Order-Invariant CFO Contains Local-Order-Invariant FO
2
Based on this, it is natural to ask whether invariant logics collapse on finite structures or on particular classes of finite structures. For instance, it has been proved that successor-invariant FO and FO express the same queries on classes of bounded degree [15], and that order-invariant FO collapses on trees, strings, and hollow trees [5, 16]. The question of whether full order-invariant FO collapses on classes of bounded degree is significant and open. However, a substantial fragment of order-invariant FO, known as order-invariant cluster first-order logic (CFO), has recently been introduced and shown to be contained in FO on classes of colored graphs of bounded degree [14]. A second question concerns the complexity of model-checking for these invariant logics, and it has been shown for instance that model-checking for order-invariant CFO is FPT [14].
An invariant logic of particular interest to us is local-order-invariant logic. A local order on a graph is a ternary relation such that when is fixed, linearly orders the neighbors of . On structures over arbitrary vocabularies, a local order is a local order on the Gaifman graph of the structure. Such local orders have been considered in the context of finite model theory prior to being considered in the context of invariant logics [5, 7]. Local-order-invariant FO was first considered in [18], and a number of questions related to this work were asked by Weinstein in [22]. Generalizations of these questions were answered in [4].
-
To generalize our main result, its corollaries, and the collapse result of [14] from classes of colored graphs of bounded degree to classes of bounded degree over arbitrary vocabularies, we use a certain class of first-order interpretations. We believe that this method of investigating invariant logics via interpretations has been under-explored, as it allows us, among several other things, to straightforwardly combine several results from [6, 10, 19] to obtain the collapse of order-invariant FO to FO when restricted to graph classes of bounded shrub-depth.
-
It is proved in [4] that epsilon-invariant FO is contained in local-order-invariant FO on classes of bounded degree, but the proof is flawed in that it accounts for neither the extensionality nor the nesting of epsilon terms. However, the basic idea of the proof is usable. Deterministic frozen-witness FO, introduced and studied in [1, 2, 3], is a weaker logic than epsilon-invariant FO. It is of interest in the study of non-determinism in databases. Abiteboul, Simon, and Vianu originally conjectured in [2] that it should collapse to FO, and this conjecture was refuted in [20]. We use Gaifman normal form again to show the containment of deterministic frozen-witness FO in local-order-invariant FO on finite structures, the collapse of deterministic frozen-witness FO on classes of finite structures of bounded degree, and the fixed-parameter tractability of the model-checking problem for deterministic frozen-witness FO on classes of finite structures of bounded degree. This recovers the collapse conjectured by Abiteboul, Simon, and Vianu on classes of bounded degree.
In Section 2, we give the necessary background. In Section 3, we prove our titular containment theorem and its corollaries in the setting of colored graphs. In Section 4, we extend the main containment and related results to arbitrary vocabularies, and prove the collapse for bounded shrub-depth. In Section 5, we prove the deterministic frozen-witness containment and its corollaries.
2 Preliminaries
From here, will be a finite relational vocabulary. We denote by the class of finite structures over , and the class of arbitrary structures over .
2.1 Locality
For any , we write for the restriction of to ; i.e., the substructure of with domain such that for any tuple of elements of and any relation of arity , we have in if and only if .
► Definition 2.1. Let be in . We define the Gaifman graph of , denoted by , such that the vertices of are the elements of , and such that there are edges between two vertices if and only if there exist a tuple of elements of and a relation of arity such that and in . We now recall several topological graph notions as they relate to Gaifman graphs.
-
For , we define the distance as the least number of edges in a path in from to , if such a path exists, and otherwise.
-
For , we denote by the ball of radius around , . We denote by the sphere of radius around , .
-
For , we denote by the structure over which is identical to the structure except that it has the additional constant symbol which is equal to . We call this the neighborhood of radius around . We say that the -neighborhood type of , denoted , is the class .
We can generalize the above definitions of balls, spheres, and neighborhoods to arbitrary tuples of elements of by taking .
► Definition 2.2. We define as the structures of degree at most over , i.e. the elements of such that every vertex in has degree at most . Similarly, we define as the locally finite structures over , i.e. elements of such that every vertex in has finitely many neighbors.
2.2 Invariant Logics
► Definition 2.3. Let be a sentence in the vocabulary . We say that is order-invariant on if, for any and any linear orders on , we have if and only if . If is order-invariant, we say that if for any linear order .
► Definition 2.4. We say that a ternary relation on a graph is a local order if, when is fixed, is a linear order on . This definition generalizes to general structures by instead considering the Gaifman graph . We define local-order-invariance of a sentence in in the natural way.
Order-Invariant CFO Contains Local-Order-Invariant FO
The following is the main result of [4]. A generalization is claimed for arbitrary classes of bounded degree and used to prove the claimed collapse of epsilon-invariant FO to FO on classes of bounded degree, but this generalization does not follow from the proof techniques of the paper because the result of [18] used does not apply in general (in particular, it has the additional hypothesis that the query must be invariant on an ambient substructure-closed class).
► Theorem 2.5 (Aoki). Let , and let be a local-order-invariant sentence over . Then there is a first-order sentence such that for any , if and only if .
2.3 Cluster First-Order Logic
Before describing cluster first-order logic on ordered graphs rigorously, we give a brief informal description. Note that, for the following discussion and definition, the graphs in question will be simple (i.e., undirected and without self-edges). First, we fix an infinite alphabet . The variables of CFO are indexed as , with and , and these variables are grouped into clusters based on whether they share the index . Introducing a variable with via a quantifier is guarded by adjacency with the previous elements of the cluster, in the sense that there must exist some such that . Also, the relations and can only be used to compare variables of the same cluster, with the exception that and may be used to compare with for any . Now for the rigorous definition.
► Definition 2.6. Fix an infinite alphabet , and let be a finite set of indices. We say that is valid if it is downward closed, in the sense that for any , , and ,
-
for every , implies , and
-
implies .
If is a valid set of indices, we write for the set . Letting be a vocabulary , where is binary and each is unary, we define by induction on .
-
For every , , , such that , and in , then contains the atomic formulae , , , and . Also, is closed under Boolean combinations.
-
contains the formulae
a. , where (assuming that );
b. , where , , , and ;
c. , where , , and . Also, is closed under Boolean combinations.
We write , and we write CFO for . Because is a fragment of first-order logic, its semantics are very natural. That is, for , , a linear order on , and a valuation , we have (or if ) if this holds when is treated as a first-order formula with free variables in . Order-invariance of a CFO sentence is defined in the obvious way.
Though CFO was defined originally in [14] only for (ordered) colored graphs, there is a natural extension to (ordered) structures over any vocabulary. To do this, we first note the following straightforward lemma.
► Lemma 2.7. For every vocabulary , there exists a formula such that for any , we have in if and only if and are adjacent in .
► Definition 2.8. Define CFO over an arbitrary vocabulary identically to CFO over colored graphs, except
-
CFO contains where the elements of are all of the form for some with , and
-
we guard cluster quantification by , where is defined as above.
► Theorem 2.9 (Ghasemi–Grange). Let be a colored graph vocabulary as above, and let be a class of finite colored graphs over of degree at most . Let be an order-invariant CFO sentence on . Then is equivalent over to some first-order sentence in the vocabulary . In other words, order-invariant CFO is contained in FO on colored graph classes of bounded degree.
The following was explicitly conjectured in [14].
► Conjecture 2.10 (Ghasemi–Grange). Let be a class of finite colored graphs over , and let be a first-order sentence. Then is equivalent on to some order-invariant CFO sentence . In other words, FO is contained in order-invariant CFO on arbitrary classes of finite colored graphs.
3 Main Containment Theorem
In this section, we will only work with colored simple graphs over a vocabulary .
We will now introduce Gaifman normal form and several relevant definitions. While it is true that in this subsection we are only working with colored simple graphs, the following applies to an arbitrary relational vocabulary.
For and a first-order formula , we write for the formula which is identical to except the quantifiers are bounded to . We call an -local formula. As a consequence of Lemma 2.7, there exist formulae which express and for every . So we can instead phrase as the formula that results when is replaced by , and similarly for universal quantifiers. We define basic local sentences as sentences of the form
In other words, there is an -independent set of size , with each element satisfying .
► Theorem 3.1 (Gaifman). Every first-order formula is equivalent over to a Boolean combination of basic local formulae and basic local sentences. Further, the translation is effective, and if is a sentence then only basic local sentences appear in the Boolean combination.
We now proceed to the proof that order-invariant CFO contains FO on arbitrary classes of finite colored graphs. First, we show that local formulae with one free variable are expressible in CFO. Second, we show that basic local sentences are equivalent to asserting the existence of independent sets in locally defined graphs, and that the existence of independent sets can be expressed in order-invariant CFO.
To show that local formulae with one free variable are expressible in CFO, we effectively show that we can quantify over paths of length . The proof is very similar to that of [14, Remark 2.1], so we only very briefly describe it.
Order-Invariant CFO Contains Local-Order-Invariant FO
▶ Lemma 3.2. For every -local with one free variable, any valid , and any , there exists in such that for any interpretation , if and only if .
Proof. Fix a valuation , and let . Each quantifier in is bounded to . Following [14, Remark 2.1], each such bounded quantifier can be simulated in cluster by quantifying over paths in starting at of length , with the end of the path being the quantified variable (and the set of possible endpoints is exactly ). Because all of the variables introduced in this translation are in the cluster , arbitrary edge and equality comparisons are allowed between them. Also, note that this translation is effective.
The following lemma is the heart of the proof of our main containment theorem. Because we can express every -local , the only remaining thing to prove to show that we can express basic local formulae is to show that we can express the existence of -independent sets of size with each element satisfying . The proof in general ends up being very similar to showing that there exists an independent set of size , so the following lemma is the key step of the proof, and the lemma following it generalizes it suitably.
▶ Lemma 3.3. For every , there exists a sentence in order-invariant CFO which says that there exists an independent set of size in a finite graph .
Proof. First, consider a finite connected graph . The existence of an independent set of size in is equivalent to the existence of some such that the ball contains an independent set of size . Clearly the latter condition implies the former.
Now assume that contains an independent set of size . If the diameter of is at most , then for every , so any and our assumed independent set of size witness the latter condition. If the diameter of is greater than , we can find a path which is the shortest possible between and . Therefore, there are no edges between vertices in this path other than between successive vertices, so the set is independent and contained in . In particular, note that this second chain of reasoning does not rely on our assumed independent set of size .
There is a -local first-order which says that contains an independent set of size . Similarly, for , we can write an FO formula , which references a linear order < on but is -local with respect to the edge relation on , which says that
-
there is no such that ,
-
is the minimal element of with respect to <, and
-
the maximum size of an independent set in is .
In an ordered finite graph , holds exactly when is the minimal element with respect to < of a connected component such that the maximum size of an independent set in is exactly . The correspondence between the minimality condition and (2) is clear, the existence of a as described in (1) would imply the existence of an independent set of size , and the non-existence of such a implies that is equal to the connected component , which when combined with (3) completes our explanation.
Via the same logic as Lemma 3.2 adapted to allow for the order comparisons in (2), we can write for valid and a formula which says that satisfies . In particular, the order comparisons are possible because all variables in the local formula are in the same cluster.
We now describe our construction of . First, what we have established so far implies that is equivalent to the existence of a connected component in that contains an independent set of size , and we can write a CFO sentence which is equivalent to . We construct as
where is constructed as in Lemma 3.2. If each connected component of has no satisfying , then for each connected component there is some and some such that holds. Take and such that . We can write an order-invariant CFO sentence which says that there exist such that for every . The construction is
Finally, we have
where ranges over and ranges over the tuples such that for every and .
▶ Lemma 3.4. Take some -local and some -local . Then there exists an order-invariant CFO sentence which says for every finite colored graph there is an independent set of size in the graph with domain and edge relation
Proof. If lies in , then . Also, whether is a vertex of is determined by , so whether is an edge in is determined by . Therefore, the value of any -local formula in is equivalent to an -local formula in . Therefore the lemma follows from similar reasoning to Lemma 3.3, in which the reasoning inside of each component is almost identical and the use of the ordering between the minima of components is more or less unchanged.
We can now complete the proof that order-invariant CFO contains FO on colored graphs.
► Theorem 3.5. Let be a first-order sentence in the vocabulary . Then is equivalent over the colored graphs over to an order-invariant CFO sentence . In other words, on finite colored graphs, FO is contained in order-invariant CFO.
Proof. Consider a basic local sentence
Applying Lemma 3.4 with , a tautology, and , we can write the above basic local sentence as an equivalent order-invariant CFO sentence. Thus, we can write any Boolean combination of basic local sentences as an equivalent order-invariant CFO sentence. The theorem then follows from Theorem 3.1.
Order-Invariant CFO Contains Local-Order-Invariant FO
The generalization to local-order-invariant FO is straightforward, which completes the proof of our main containment.
► Corollary 3.6. Let be a local-order-invariant sentence over a class of finite colored graphs in the vocabulary . Then is equivalent over to an order-invariant CFO sentence . In other words, on finite colored graphs, local-order-invariant FO is contained in order-invariant CFO.
Proof. Applying Theorem 3.1 to , we have that is a Boolean combination of basic local sentences of the form
where and the localization of are with respect to the Gaifman graph of . Because , then is equivalent to and is equivalent to a formula in the vocabulary such that the domain of the quantified variables is bounded to . Given a linear order on , then for each , we can replace each atom with a formula that says that is adjacent to , is adjacent to , and , via similar logic to Lemma 3.2. Thus, via similar logic to Lemma 3.4, we have the corollary.
We now conclude with several corollaries of our main containment theorem. As noted in the introduction, our first corollary generalizes Theorem 2.5.
► Corollary 3.7. Let be a local-order-invariant sentence over a class of colored graphs in the vocabulary . Then is equivalent over to an FO sentence .
► Definition 3.8. Let be a class of finite structures and a logic. The model checking problem for on is the problem of determining, with input and a sentence in , whether . We say that this model checking problem is fixed-parameter tractable if there is some computable function and some constant such that the model-checking problem can be solved in time .
► Theorem 3.9 (Ghasemi–Grange). The model checking problem for order-invariant CFO on a class is fixed-parameter tractable.
► Corollary 3.10. The model checking problem for local-order-invariant FO on a class of colored graphs is fixed-parameter tractable.
Proof. Our construction of a CFO sentence expressing a basic local sentence in the vocabulary is effective. Also, as is noted in Theorem 3.1, the translation from an arbitrary local-order-invariant FO sentence to Gaifman normal form is effective. Combining these, we have an effective translation from local-order-invariant FO sentences to order-invariant CFO sentences, so Theorem 3.9 extends to local-order-invariant FO.
4 Generalizations via Interpretations
Our main containment result was proved for colored graphs, because this is the setting in which CFO was originally defined and in which Theorem 2.9 applies. We now generalize Theorem 2.9, Corollary 3.6, and Corollary 3.10 to general vocabularies, affirming Conjecture 2.10.
We begin by defining interpretations themselves.
► Definition 4.1. A -dimensional interpretation between and is a domain formula with of length , an equivalence formula with of length , and a relation formula for each with each of length . Each of these formulae is in the vocabulary . For a given , we write for the set , and we require to define an equivalence relation on for every , and further we require that if we have and such that for every , then if and only if . We define as the structure over with underlying set , with relations such that in if and only if .
► Theorem 4.2. 1. Let be an arbitrary vocabulary, and let . Every sentence which is local-order-invariant over is equivalent on to an order-invariant CFO sentence .
- Conversely, let . Every CFO sentence which is order-invariant over is equivalent over to a first-order sentence .
In particular, order-invariant CFO, local-order-invariant FO, and plain FO are equivalent over any class of finite structures of bounded degree.
Proof. The containment of local-order-invariant FO in order-invariant CFO on classes of finite structures over arbitrary vocabularies is an almost verbatim generalization of the proof of Corollary 3.6.
We now describe the generalization of the collapse result on classes of bounded degree. For structures with one element the translation is trivial, so we assume from here that our structures have at least two elements. Take a structure over . Define the colored simple graph as follows.
-
There is a color for the domain of , a relation color for each , and a position color for each where is the arity of .
-
For each element of , there is a vertex of colored .
-
For each relation and tuple of elements of such that , there is a vertex of colored .
-
For each vertex , and each , there is a vertex of colored .
-
For every vertex and , we have and in . There is a uniform first-order interpretation such that . This construction preserves boundedness of degree, in the sense that for all , the class is of bounded degree. To see why, take . Then for all and any , there are at most tuples of elements of such that for some . Therefore each has degree at most
each has degree exactly , and each has degree exactly 2, so has degree at most
Every which is an order-invariant CFO sentence on can be translated to an order-invariant CFO sentence on . Such a translation can proceed inductively, by encoding each atom via similar logic to Lemma 3.2, translating guarded quantification to quantification over element vertices of distance exactly 4 again by similar logic to Lemma 3.2, and preserving order comparisons and unguarded quantification. By Theorem 2.9, this
Order-Invariant CFO Contains Local-Order-Invariant FO
translated sentence is equivalent on to a first-order sentence . Finally, we claim that is a uniform first-order interpretation, so can be translated to a first-order sentence which is equivalent on to . We now describe this interpretation explicitly.
Let
The equality type of a tuple of elements of is the set . Choose to be large enough so that there are at least equality types for elements of . For each , choose the equality type of some element of , and construct a formula which says that has equality type . We define an -dimensional interpretation between and such that for every of size at least two. Informally, the first coordinates will represent the elements themselves, and the latter coordinates will represent the sort from . More precisely, we have the following.
-
If holds with , then is true, and holds if and only if and holds.
-
If holds with , then holds if and only if holds, and holds if and only if for and holds.
-
If holds with , then holds if and only if holds, and holds if and only if for and holds.
-
If does not hold for any , then does not hold.
-
For , the formula holds if and only if holds.
-
The formula holds if and only if either
a. (or ), and hold with and (or vice versa); or
b. for , and and hold with and (or vice versa).
That is clear, so we are done.
▶ Corollary 4.3. For any vocabulary , the model checking problem for local-order-invariant FO on a class is fixed-parameter tractable.
Proof. The translation from a local-order-invariant FO sentence to an order-invariant CFO sentence is effective, and the translation from to in Theorem 4.2 is effective, so the corollary follows from Theorem 3.9.
A question of interest is whether local-order-invariant FO is as expressive as order-invariant FO, which is nontrivial because they have the same expressiveness on classes with Gaifman graphs of bounded diameter by a result of [4]. In particular, an answer to this question would answer the important question of whether order-invariant FO collapses to FO on classes of bounded degree. We give an equivalent formulation for this question in terms of interpretations.
▶ Definition 4.4. We say that a logic is closed under first-order interpretations if, for every interpretation from to and every -definable , the preimage is -definable in .
We defer the proof of the following proposition to Section A.
▶ Proposition 4.5. Local-order-invariant FO is closed under first-order interpretations on all classes of finite structures if and only if it has the same expressive power as order-invariant FO on all classes of finite structures
The following corollary follows from similar techniques. We defer the definition of tree-width and path-width to Section A, as well as the proof of the corollary.
► Corollary 4.6. If local-order-invariant FO has the same expressiveness as FO on every class of bounded tree-width (resp. bounded path-width), then order-invariant FO has the same expressiveness as FO on every class of bounded tree-width (resp. path-width).
One of the primary reasons that we believe this analysis of invariant logics via interpretations has been under-developed is that it yields straightforwardly a collapse of order-invariant FO to FO when restricted to classes of bounded shrub-depth. The proof is simply a combination of results of [10], [6], and [19].
► Definition 4.7. A graph has tree-depth at most if there is a rooted forest of height such that every edge of joins an ancestor and a descendant in . A class of graphs has bounded tree-depth if there is some such that each element has tree-depth at most . A class of structures over an arbitrary vocabulary has bounded tree-depth if the class of graphs is of bounded tree-depth.
► Definition 4.8. A tree-model of colors and depth for a graph is a pair of a rooted tree of height and a set such that
-
the length of each root to leaf path in is exactly ,
-
the set of leaves of is exactly the set of vertices of ,
-
each leaf of is assigned one of the colors, and
-
for all , we have if and only if , and
-
for any two vertices of with colors respectively such that the distance between and in is , there is an edge between and in if and only if .
A class of graphs is of bounded shrub-depth if and only if there exist such that every graph in the class has a tree-model of colors and depth .
The following results are from [19, 10, 6], though it is worth noting that Theorem 4.12 was originally claimed in [12].
► Definition 4.9. A simple interpretation is a 1-dimensional interpretation with . A transduction consists of an integer , a binary relation , unary relations , and a simple interpretation from to . Given , write for the set , and write for the structure over such that as structures over each is isomorphic to , and is the equivalence relation on such that if and only if . We define the output to be the set of structures of the form where each is some unary relation on .
► Theorem 4.10 (Ohlmann–Pilipczuk–Przybyszewski–Toruńczyk). Let be a class of finite graphs of bounded shrub-depth. There exist
-
a finite relational vocabulary of arity at most 2,
-
an integer ,
-
a transduction from to ,
-
a unary in , and
-
a first-order interpretation from to the class of finite graphs,
such that, for every , some output has tree-depth at most , the elements in are the original vertices of , and is .
Order-Invariant CFO Contains Local-Order-Invariant FO
► Theorem 4.11 (Eickmeyer–Elberfeld–Harwath). Let be an order-invariant sentence on , and let be the class of finite structures of tree-depth at most . Then there exists a first-order sentence which is equivalent to on .
► Theorem 4.12 (Chen–Flum). Let be a class of finite graphs of bounded shrub-depth, and let be an MSO sentence. Then is equivalent on to some first-order sentence .
► Theorem 4.13. Let be a class of finite graphs of bounded shrub-depth, and let be order-invariant over the class of finite graphs. Then is equivalent on to a first-order sentence .
Proof. The proof is a relatively straightforward combination of Theorem 4.11, Theorem 4.10, Theorem 4.12, the closure of MSO under interpretations, and the definability of tree-depth in MSO. The full proof can be found in Section A.
To attempt to generalize Theorem 4.13 past graphs, one might attempt to apply similar methods to Theorem 4.2. A first step might be to generalize Theorem 4.13 to colored graphs.
Indeed, let be a class of finite colored graphs of bounded shrub-depth, and let be order-invariant over the class of finite colored graphs. Then is equivalent on to a first-order sentence . The proof of the above result generalizes to colored graphs straightforwardly. In slightly more detail, we can add finitely many unary color relations as unary predicates, track them through the transduction and interpretation from Theorem 4.10, apply Theorem 4.11 identically while taking these unary relations into account, and apply Theorem 4.12 identically while taking these unary relations into account.
► Remark 4.14. However, the proof of Theorem 4.2 cannot generalize to classes of bounded shrub-depth. That is, there is no uniform encoding of finite relational structures into finitely colored graphs such that
-
is first-order interpretable in its encoding, and
-
if is a class of bounded shrub-depth then the encoding takes to a class of colored graphs of bounded shrub-depth.
In particular, there is an obstruction even for finite linear orders.
5 Deterministic Frozen-Witness Logic
We conclude with an application of our collapse of local-order-invariant FO to FO on classes of bounded degree. This recovers, on classes of bounded degree, the collapse of deterministic frozen-witness FO to FO conjectured by Abiteboul, Simon, and Vianu [2] (which was disproved on arbitrary finite structures by Otto [20]). The proof takes inspiration from the erroneous proof of [4] that epsilon-invariant FO is contained in local-order-invariant FO on classes of bounded degree. However, we apply the theorem to a weaker logic (deterministic frozen-witness logic), make substantial repairs to the proof, and remove the bounded degree hypothesis. Further, the erroneously claimed collapse of epsilon-invariant FO to FO on classes of bounded degree in [4] inherits the necessity of invariance on an ambient substructure-closed class from Theorem 2.5, whereas because we have removed that hypothesis in Theorem 4.2, our collapse inherits the lack of the hypothesis.
We begin by introducing deterministic frozen-witness logic. Our presentation is slightly non-standard, but it is clearly equivalent to the standard definition, is close to the presentation of [20], and is much more convenient for the purposes of the following proofs.
► Definition 5.1. Let be a first-order formula in the vocabulary , and let . We say that a relation on is a witness predicate for if it satisfies the following conditions.
-
For every tuple of elements of and , then implies .
-
If there exists such that , then there is a unique such that .
-
If there does not exist such that , then there is no such that .
► Definition 5.2. A frozen witness program over a vocabulary is a finite sequence of relations with each not in , a sequence of first-order formulae with a formula in the vocabulary , and a first-order sentence in the vocabulary . A run of the program on a structure consists of interpreting in order, such that the interpretation of is a witness predicate for on . Finally, the program evaluates once it has fixed all of these interpretations.
We say that a frozen witness program is deterministic on if, for every , all runs of the program evaluate with the same truth value. If every run evaluates to be true, then we write .
The following lemma is from [4].
► Lemma 5.3 (Aoki). For every , there exists a formula in the vocabulary which linearly orders when is fixed and when is a local order.
► Definition 5.4. We write for the set of first-order sentences of quantifier rank at most such that . Given a tuple of elements of and , we write for the set of first-order -local formulae of quantifier rank at most such that .
The following is a well-known folklore result [17, Theorem 3.15].
► Theorem 5.5. For every , the sets and
are both finite.
The following two lemmas form the core of the proof of our containment of deterministic frozen-witness FO in local-order-invariant FO. The basic idea is that, given a formula for which we wish to define a witness predicate, we can choose a collection of witnesses of bounded size, where the size depends on only the formula, such that for any there is a witness which is distance at most from some point in either or . Then, we use a local order to linearly order the elements distance at most from some point in or , and choose the minimum valid witness using this linear order. We establish the existence of in the following lemma, and we establish this choice via local order in the lemma after.
► Lemma 5.6. Let be a first-order formula in some vocabulary . Then there are integers , and a first-order formula with of length such that the following hold for every .
- For every tuple of elements of of the same length as , there is some tuple such that .
Order-Invariant CFO Contains Local-Order-Invariant FO
- If , is a tuple of elements of , and there exists such that , then for some or for some .
Proof. Put in Gaifman normal form, let the radius be , let , and let the maximal quantifier rank of the -local formulae in the Gaifman normal form be . By Theorem 5.5, we can enumerate the quantifier rank -local types . Let be the length of , let be the length of . Let .
Denote by the set . Then says that for each , either
-
contains a -independent subset of size such that for every in this subset, or
-
contains a -independent set of size at most , and this subset is maximal among the -independent subsets of .
Note that this is first-order expressible because is of bounded size.
Now suppose that for tuples of elements of and , and suppose that we have constructed such that . If is in , then we are done. If is not in , then if (1) from our earlier dichotomy for (where is ) holds for , there is some which is distance greater than from every element of and . Therefore, , so if and only if , and thus with because it is an element of . If instead (2) from the dichotomy holds, then every such that is in by maximality of the relevant -independent subset of .
► Lemma 5.7. Let be a first-order formula in the vocabulary , and construct , and as in Lemma 5.6. Then there is a formula such that for any , any local order on , and any such that , the relation is a witness predicate for .
Proof. Construct as follows.
-
If there are no such that , then set to be false for every .
-
If some in satisfies , then let be the least such that , and set to be true if and only if
-
If there is some such that , but no satisfies , then there exists some in such that .
We construct a linear order on as follows. Define the tuple as the concatenation
For each , let be the least such that . For , let precede if and only if or and holds, with as in Lemma 5.3. This works because , for any , any tuple of elements of , any local order on , and any , is equal to .
Now, using this linear order, which is definable in the vocabulary , simply take the least element of such that .
These cases are exhaustive, and so we are done.
We now complete the proof of our main containment theorem for this section and give several corollaries.
► Theorem 5.8. Take some deterministic frozen witness program on consisting of , , and . Then there exists some local-order-invariant FO sentence on such that for every , if and only if .
Proof. We construct, by induction on , formulae in the vocabulary , where , such that for any suitable (in a sense which we will define), the relations are suitable interpretations for the in the program.
For , we simply apply Lemma 5.7 to . This gives us a formula and a formula defining a witness predicate for .
Now assume that have been constructed. In the formula , replace each with . Call this new formula . Then using Lemma 5.7 again, we can construct and which define a witness predicate for .
Now construct a formula by replacing each in with . Finally, construct the sentence
For every and every local order on , there exists a tuple satisfying the conditions for each , and for any such tuple, the define witness predicates, so for any local order on , says that on a certain run of the program. Therefore, because evaluates on in the same way regardless of the chosen witness predicates, if and only if for any local order , so is equivalent to and is local-order-invariant on .
► Corollary 5.9. Take some deterministic frozen witness program on consisting of , , and . Then there exists some first-order sentence on such that for every , if and only if .
Proof. This is simply a combination of Theorem 4.2 and Theorem 5.8.
► Corollary 5.10. For any , the model-checking problem for deterministic frozen-witness programs is fixed-parameter tractable on .
Proof. Our translation in Theorem 5.8 is effective, in particular because the translation to Gaifman normal form is effective by Theorem 3.1, so this is simply an application of Corollary 4.3.
6 Conclusion
We have shown that order-invariant CFO contains local-order-invariant FO, affirming Conjecture 2.10. We have also shown that local-order-invariant FO contains deterministic frozen-witness FO, salvaging the proof strategy of a claimed result of [4]. Together, these prove the equality of FO, deterministic frozen-witness FO, local-order-invariant FO, and order-invariant CFO on classes of bounded degree. We also used our method of interpretations to extend the results beyond colored graphs and prove the collapse of order-invariant FO when restricted to classes of bounded shrub-depth. There are several natural remaining questions, such as whether local-order-invariant FO and order-invariant FO have the same expressiveness, or whether interpretations can be used in other ways to study invariant logics.
Order-Invariant CFO Contains Local-Order-Invariant FO
References
1 Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases. Addison-Wesley, Reading, MA, 1995.
2 Serge Abiteboul, Eric Simon, and Victor Vianu. Non-deterministic languages to express deterministic transformations. In Proceedings of the Ninth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS 1990), pages 218–229. ACM, 1990. doi:10.1145/298514.298575.
3 Serge Abiteboul and Victor Vianu. Non-determinism in logic-based languages. Annals of Mathematics and Artificial Intelligence, 3(2-4):151–186, 1991. doi:10.1007/BF01530924.
4 Derek Aoki. Local-order-invariant logic on classes of bounded degree, 2025. arXiv:2512.02039.
5 Michael Benedikt and Luc Segoufin. Towards a characterization of order-invariant queries over tame graphs. Journal of Symbolic Logic, 74(1):168–186, 2009. doi:10.2178/js1/1231082307.
6 Yijia Chen and Jörg Flum. FO-definability of shrub-depth. In 28th EACSL Annual Conference on Computer Science Logic (CSL 2020), volume 152 of Leibniz International Proceedings in Informatics (LIPIcs), pages 15:1–15:16. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.CSL.2020.15.
7 Bruno Courcelle. The monadic second-order logic of graphs X: Linear orders. Theoretical Computer Science, 160(1-2):87–143, 1996. doi:10.1016/0304-3975(95)00083-6.
8 William Craig. Three uses of the Herbrand–Gentzen theorem in relating model theory and proof theory. Journal of Symbolic Logic, 22(3):269–285, 1957. doi:10.2307/2963594.
9 Heinz-Dieter Ebbinghaus and Jörg Flum. Finite Model Theory. Springer Monographs in Mathematics. Springer, Berlin, second edition, 2005. doi:10.1007/3-540-28788-4.
10 Kord Eickmeyer, Michael Elberfeld, and Frederik Harwath. Succinctness of order-invariant logics on depth-bounded structures. ACM Transactions on Computational Logic, 18(4):33:1–33:25, 2017. doi:10.1145/3152770.
11 Haim Gaifman. On local and non-local properties. In J. Stern, editor, Proceedings of the Herbrand Symposium: Logic Colloquium '81, volume 107 of Studies in Logic and the Foundations of Mathematics, pages 105–135. North-Holland, Amsterdam, 1982. doi:10.1016/S0049-237X(08)71879-2.
12 Jakub Gajarský and Petr Hliněný. Kernelizing MSO properties of trees of fixed height, and some consequences. Logical Methods in Computer Science, 11(1:19):1–26, 2015. doi:10.2168/LMCS-11(1:19)2015.
13 Robert Ganian, Petr Hliněný, Jaroslav Nešetril, Jan Obdržálek, Patrice Ossona de Mendez, and Reshma Ramadurai. When trees grow low: Shrubs and fast MSO₁. In Mathematical Foundations of Computer Science 2012, volume 7464 of Lecture Notes in Computer Science, pages 419–430. Springer, 2012. doi:10.1007/978-3-642-32589-2_38.
14 Fatemeh Ghasemi and Julien Grange. Order-invariant cluster first-order logic on graph classes of bounded degree, 2026. arXiv:2604.27693.
15 Julien Grange. Successor-invariant first-order logic on classes of bounded degree. Logical Methods in Computer Science, 17(3):20:1–20:25, 2021. doi:10.46298/lmcs-17(3:20)2021.
16 Julien Grange and Luc Segoufin. Order-invariant first-order logic over hollow trees. In 28th EACSL Annual Conference on Computer Science Logic (CSL 2020), volume 152 of Leibniz International Proceedings in Informatics (LIPIcs), pages 23:1–23:16. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.CSL.2020.23.
17 Leonid Libkin. Elements of Finite Model Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer, Berlin, 2004. doi:10.1007/978-3-662-07003-1.
18 Steven Lindell, Henry Towsner, and Scott Weinstein. Hanf locality and invariant elementary definability, 2025. arXiv:2507.12450.
19 Pierre Ohlmann, Michal Pilipczuk, Wojciech Przybyszewski, and Szymon Toruńczyk. Canonical decompositions in monadically stable and bounded shrubdepth graph classes. In 50th International Colloquium on Automata, Languages, and Programming (ICALP 2023), volume
261 of Leibniz International Proceedings in Informatics (LIPIcs), pages 135:1–135:17. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.ICALP.2023.135.
20 Martin Otto. Epsilon-logic is more expressive than first-order logic over finite structures. Journal of Symbolic Logic, 65(4):1749–1757, 2000. doi:10.2307/2695073.
21 Benjamin Rossman. Successor-invariant first-order logic on finite structures. Journal of Symbolic Logic, 72(2):601–618, 2007. doi:10.2178/js1/1185803625.
22 Scott Weinstein. Some questions about invariant definability. In Anuj Dawar, Erich Grädel, Phokion G. Kolaitis, and Thomas Schwentick, editors, Finite and Algorithmic Model Theory (Dagstuhl Seminar 17361), volume 7 of Dagstuhl Reports, pages 24–25. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 2018. doi:10.4230/DagRep.7.9.1.
A Proofs for Section 4
Proof of Proposition 4.5. First, we note that order-invariant FO is closed under interpretations. Take a -dimensional interpretation between and defined by , and for each . Given and a linear order on , we can define a linear order on by first taking the lexicographic order on induced by and then ordering equivalence classes of by their minimal elements. That is, we will have if precedes in the lexicographic order where is the minimal element of and is the minimal element of . This order is definable from , so we can translate any order-invariant FO sentence on back to an order-invariant sentence on . For this backwards translation, the equality of interpreted elements is translated by , relation atoms are translated by , and quantifiers in the translation are relativized to .
Now, if local-order-invariant FO is not closed under interpretations, then certainly it does not have the same expressive power as order-invariant FO by the above. Assume instead that it is closed under interpretations. Take any . Define the 2-dimensional interpretation between and with unary and binary in which
-
is a tautology,
-
says
-
the relation holds if and only if each is of the form and .
-
holds if and only if , and
-
holds if and only if holds or holds. Effectively, we have added a hub node to which is colored and is adjacent via the symmetric graph relation to every element of . Via this -adjacency, any order-invariant FO sentence on can be translated to a local-order-invariant FO sentence on which uses the linear order on the substructure of isomorphic to given by the local order on . Because we have assumed closure under interpretations, then this local-order-invariant FO sentence on can be translated to a local-order-invariant FO sentence on .
The above techniques also allow us to give a sufficient condition for the collapse of order-invariant FO to FO on classes of bounded tree-width and bounded path-width.
► Definition A.1. A tree decomposition of a graph is a tree and a collection indexed by the vertices of of sets of vertices of such that
- the union is all of ;
Order-Invariant CFO Contains Local-Order-Invariant FO
-
for each , the set of vertices such that forms a connected subtree of ; and
-
for every pair which are adjacent in , there is some containing both and .
The width of a tree decomposition is one less than the size of the largest set , and the tree-width of a graph is the minimum possible width of a tree decomposition of . We say that a class is of bounded tree-width if there is some such that is of tree-width at most for every . Replacing the tree with a path in the above definition yields the definition of a path decomposition of , and this naturally gives definitions of path-width and classes of bounded path-width.
Proof of Corollary 4.6. If has tree-width at most , then has tree-width at most , with our hub interpretation. An order-invariant FO sentence on a class of tree-width at most can be translated to a local-order-invariant FO sentence on the class of tree-width at most , which is equivalent on to some FO sentence via the hypothesis of the corollary, which can be pulled back to via . For path-width, the same argument applies.
Proof of Theorem 4.13. Let the interpretation from Theorem 4.10 consist of formulae and . We can translate to a sentence in the vocabulary such that if and only if . The order-invariance of on finite graphs transfers to the order-invariance of on . By Theorem 4.11, there is some in the vocabulary which is equivalent to on . Let be the parameters of the transduction from Theorem 4.10, and let be the image of under the interpretation from the transduction . We can define an MSO formula which says that
-
has tree-depth at most ,
-
the interpreted domain is exactly the elements marked by corresponding to , and
-
for all in , the interpreted edge formula holds in exactly when holds in .
The definitions of (2) and (3) are straightforward. For (1), we define the MSO formulae inductively for each , which will say that the induced subgraph with domain has tree-depth at most . First, will simply say that is empty. Next, there is a MSO formula which says that is a connected component of the induced subgraph , an MSO formula which says that as sets , and we define
Translate through backwards through to an MSO sentence , and define
If , we can choose such that . On the other hand, given such that , then . Thus is equivalent on to , and is equivalent on to some first-order by Theorem 4.12.
Proof of Remark 4.14. We say that a formula is stable on a class if there is an integer such that for every , there do not exist tuples of elements of of the same length as and of elements of of the same length as such that for all , we have if and only if . We say that is stable if every formula is stable on . Roughly, this says that we cannot interpret linear orders of arbitrary length in elements of .
Clearly, then, the class of finite linear orders is not stable. On the other hand, every graph class of bounded shrub-depth is stable (this is a consequence of the results in [13] that was first observed in [12]). Stability is preserved under first-order interpretations, in the sense that if is stable then is stable. The Gaifman graph of every finite linear order is complete, and so the class of finite linear orders has bounded shrub-depth. If an encoding as described in the remark existed, the class of the colored graphs encoding linear orders would be of bounded shrub-depth. However, this violates the preservation of stability under interpretations.