Introduction
Instead of solving a single algorithmic problem, algorithmic meta-theorems establish the tractability of whole classes of problems, in a uniform way. The targeted problem class is commonly defined using logic, and hence many algorithmic meta-theorems fit the following template.
Every problem expressible in ⟨ logic ⟩ \langle\text{logic}\rangle ⟨ logic ⟩ can be solved in time ⟨ runtime ⟩ \langle\text{runtime}\rangle ⟨ runtime ⟩ on every input satisfying ⟨ tameness condition ⟩ \langle\text{tameness condition}\rangle ⟨ tameness condition ⟩ .
A prototypical example is Courcelle’s Theorem, which states that every problem definable in monadic second-order logic is solvable in linear time on graphs with constant tree-width [13 ] . Similarly, a result of Frick and Grohe implies that every graph problem definable in first-order logic (FO) can be decided in linear time on all planar graphs [34 ] . In particular, the (first-order) model checking problem – does a given graph G G G satisfy a given FO sentence φ \varphi φ ? – is fixed-parameter tractable (fpt) on planar graphs. That is, it is solvable2 in time f ( ∣ φ ∣ ) ⋅ ∣ V ( G ) ∣ c f(|\varphi|) \cdot|V(G)|^{c} f ( ∣ φ ∣ ) ⋅ ∣ V ( G ) ∣ c , for some function f f f and constant c c c (with c = 1 c = 1 c = 1 in this specific case). Many natural graph problems are expressible in FO. For example, the sentence
∃ x 1 … ∃ x k ∀ y ⋁ i ( E ( y , x i ) ∨ ( y = x i ) ) \exists x_1 \ldots\exists x_k \forall y \bigvee_i \left(E(y,x_i) \lor(y=x_i)\right) ∃ x 1 … ∃ x k ∀ y i ⋁ ( E ( y , x i ) ∨ ( y = x i ) )
expresses k k k -Dominating-Set: the existence of k k k vertices such that every vertex is either adjacent or equal to at least one of them. Further expressible problems include k k k -Independent-Set, k k k -Clique, and H H H -Subgraph-Isomorphism. With no further restrictions made on the input graphs, these problems appear to be highly intractable. Indeed, model checking on general graphs is believed not to be fpt; this is equivalent to the FPT≠ \ne = AW[ ⋆ ] [\star] [ ⋆ ] conjecture. This raises the question – first posed by Grohe [45 Section 8.2] – on which graph classes3 the problem becomes fpt. After decades of research, monadic dependence has crystallized as the conjectured tractability limit for hereditary 4 classes (see, e.g., [2 , 36 , 8 , 21 ] ).
Model Checking Conjecture. A hereditary graph class admits fixed-parameter tractable first-order model checking if and only if it is monadically dependent (assuming FPT≠ \ne = AW[ ⋆ ] [\star] [ ⋆ ] ).
Monadic dependence is a model-theoretic tameness notion that originates in Shelah’s classification theory [11 ] . It subsumes many tameness notions from structural graph theory, such as planarity, excluding a minor, bounded degree, bounded expansion, nowhere denseness, and bounded clique-width, twin-width, and merge-width. See Figure 1 for a hierarchy of included graph classes. For hereditary graph classes, monadic dependence is characterized as follows [22 ] . A hereditary graph class C \mathcal{C} C is monadically independent if there is some formula φ ( x , y ) \varphi(x,y) φ ( x , y ) with the following property: for every graph H H H there is some graph G ∈ C G \in\mathcal{C} G ∈ C such that H H H is an induced subgraph of the graph with vertices V ( G ) V(G) V ( G ) and edges { u v : φ ( u , v ) or φ ( v , u ) holds in G } \{uv : \varphi(u,v) \text{ or } \varphi(v,u) \text{ holds in } G\} { uv : φ ( u , v ) or φ ( v , u ) holds in G } . Intuitively, this means that every graph can be encoded by φ \varphi φ in C \mathcal{C} C . Then C \mathcal{C} C is monadically dependent if it is not monadically independent.
Figure 1. A hierarchy of graph class properties that admit fpt first-order model checking. Arrows represent implications between properties. In particular, bounded tree-width is the most restricted class property in this hierarchy and monadic dependence is the most general one. In each box where applicable, MC cites the fpt model checking result which assumes a suitable decomposition is given, while DEC cites the result providing such decompositions efficiently; DEC: open means that no algorithm for computing such a decomposition is known. Example graph classes are listed in italics , each under the most restricted property that subsumes it, together with a citation to an fpt model checking algorithm for that class.
In a previous paper [22 ] we resolved the hardness direction of the Model Checking Conjecture, by showing that model checking is AW[ ⋆ ] [\star] [ ⋆ ] -hard on every hereditary graph class that is not monadically dependent.
Our results
In this paper, we confirm the Model Checking Conjecture by proving its tractability direction.
Theorem 1.1. There is an algorithm which solves the model checking problem for first-order logic on graphs – does a given graph G G G satisfy a given first-order sentence φ \varphi φ ? – with the following guarantee. For every monadically dependent graph class C \mathcal{C} C and real ε > 0 \varepsilon> 0 ε > 0 , the algorithm runs in time O C , φ , ε ( n 3 + ε ) O_{\mathcal{C},\varphi,\varepsilon}(n^{3+\varepsilon}) O C , φ , ε ( n 3 + ε ) for n n n -vertex graphs G ∈ C G \in\mathcal{C} G ∈ C .
In particular, this gives fpt first-order model checking on all classes of bounded twin-width and bounded merge-width, without requiring a decomposition as part of the input.
We remark that our algorithm is uniform: it takes both G G G and φ \varphi φ as input, and does not depend on the graph class C \mathcal{C} C , which only appears in the running-time guarantee. Our result lifts from graphs to monadically dependent classes of binary structures – structures over a fixed signature consisting of binary relation symbols – using a standard encoding (see, e.g., Lemma 19.11 in the full version of [22 ] ).
Our algorithm is based on dynamic programming on graph decompositions called construction sequences of almost bounded merge-width . In a companion paper with Michał Pilipczuk [27 ] , we prove that they exist and can be computed efficiently on monadically dependent graph classes.
Existing model checking algorithms for classes of bounded twin- or merge-width have a tower-of-exponentials dependence on the width. This prevents their direct application to decompositions of almost bounded merge-width , where the width is only bounded by a subpolynomial function n o ( 1 ) n^{o(1)} n o ( 1 ) of the input size n n n , rather than a constant. To overcome this obstacle, we make the running time depend on the number of types that are realized in the graph. We control this number using a type-counting result for monadically dependent classes, which we believe to be of independent interest.
This result provides polynomial bounds on the number of quantifier rank q q q types tp q G ( v ˉ / U ) \operatorname{tp}^{G}_{q}(\bar{v}/U) tp q G ( v ˉ / U ) of k k k -tuples v ˉ \bar{v} v ˉ over a set U U U of parameters. The type tp q G ( v ˉ / U ) \operatorname{tp}^{G}_{q}(\bar{v}/U) tp q G ( v ˉ / U ) is the set of formulas of quantifier rank at most q q q , with parameters from U U U , which hold of the tuple v ˉ \bar{v} v ˉ in G G G (see § 4 for the precise definition). For q = 0 q = 0 q = 0 , the type tp 0 G ( v / U ) \operatorname{tp}^{G}_{0}(v/U) tp 0 G ( v / U ) of a vertex v ∉ U v \notin U v ∈ / U represents its neighborhood N ( v ) ∩ U N(v) \cap U N ( v ) ∩ U in U U U . In general graphs, there could be $2^{|U|}$ many such neighborhoods, but the fundamental Sauer–Shelah lemma [56 , 60 ] bounds their number by ( ∣ U ∣ + 1 ) d (|U|+1)^d ( ∣ U ∣ + 1 ) d , where d d d is the VC-dimension of the graph G G G . The VC-dimension d d d is bounded uniformly in every monadically dependent class. For q = 1 q = 1 q = 1 , the type tp 1 G ( v / U ) \operatorname{tp}^{G}_{1}(v/U) tp 1 G ( v / U ) of a vertex v v v determines { N ( w ) ∩ U : w ∈ N ( v ) } \{N(w) \cap U : w \in N(v)\} { N ( w ) ∩ U : w ∈ N ( v )} , the set of neighborhoods in U U U of the neighbors of v v v . In general graphs there could be 2 2 ∣ U ∣ 2^{2^{|U|}} 2 2 ∣ U ∣ many such sets, and so on for higher q q q : the number of q q q -types over a set U U U can reach a tower of height $q+1. The following result, which is the cornerstone of our approach, can thus be seen as an extension of the Sauer–Shelah lemma to higher quantifier ranks, in monadically dependent graph classes.
Theorem 1.2 (Simplified form of Theorem 4.4). Let C \mathcal{C} C be a monadically dependent graph class and k , q ∈ N k,q \in\mathbb{N} k , q ∈ N . There is some d ∈ N d \in\mathbb{N} d ∈ N such that for every (possibly infinite) graph G ∈ C G \in\mathcal{C} G ∈ C , and finite subset U ⊆ V ( G ) U \subseteq V(G) U ⊆ V ( G ) with ∣ U ∣ > 1 |U| > 1 ∣ U ∣ > 1 we have
∣ { tp q G ( v ˉ / U ) : v ˉ ∈ V ( G ) k } ∣ ≤ ∣ U ∣ d . \left|\left\{\operatorname{tp}^{G}_{q}(\bar{v}/U) : \bar{v} \in V(G)^k\right\}\right| \leq|U|^d. { tp q G ( v ˉ / U ) : v ˉ ∈ V ( G ) k } ≤ ∣ U ∣ d .
Theorem 1.2 is a finitary analogue of a fundamental result in stability theory due to Shelah [59 ] , which bounds the number of complete types (of unbounded quantifier rank) over an infinite set U U U , by ∣ U ∣ κ |U|^\kappa ∣ U ∣ κ in every stable class of structures, for some cardinal κ \kappa κ depending on the class. Its proof blends ideas from [53 ] and [Gaj+23].
A technical overview of the proofs of the main results is presented in § 3 . All our results are formalized in Lean. At https://laxarchive.org/lax-185574/ , each definition, lemma, and theorem is annotated with its proven Lean counterpart.
Related work
Theorem 1.1 completes a long line of research on first-order model checking on hereditary graph classes. An overview of previous model checking results is given in Figure 1 . In particular, the Model Checking Conjecture was previously known to hold in the following three settings, which we discuss below:
in edge-stable 6 graph classes, [21 , 26 ] where monadic dependence coincides with monadic stability ; [Neš+21]
in classes of ordered graphs 7 , [8 , 5 ] where monadic dependence coincides with bounded twin-width . [8 ]
Sparsity. The first model checking result in the sparse regime is the seminal Courcelle’s Theorem, which established tractability for more expressive monadic second-order logic on all classes of bounded tree-width [13 ] . Subsequently, Seese initiated the study of first-order model checking by showing tractability on all classes of bounded degree [58 ] . This research direction gained momentum through the work of Grohe and his coauthors [FGo1b; FGo1a; DGK07]; see Grohe’s 2007 survey [45 ] for an account of these early developments. This line of research (see also [DK09a; DKT13; GK11]) culminated in the model checking algorithm of Grohe, Kreutzer, and Siebertz [42 ] for nowhere dense classes. This notion is one of the cornerstones of the sparsity theory by Nešetřil and Ossona de Mendez [50 , 48 ] that shaped the field. For monotone classes, this result is tight: first-order model checking is A W [ ⋆ ] \mathrm{AW}[\star] AW [ ⋆ ] -hard on every monotone class that is not nowhere dense [20 , 19 ] .
With the sparse classes resolved, the research focus has shifted towards possibly dense classes, and two parallel research directions emerged.
Stability. One research direction aims to lift the theory of nowhere dense classes to dense graphs. Here a key notion is that of monadic stability , a restriction of monadic dependence that also originates in model theory [11 ] . The study of the model checking problem has revealed multiple new characterizations of monadic stability, such as flip-flatness [25 ] , flipper games [Gaj+23], and low shrub-depth covers [10 ] . They subsequently led to an fpt algorithm for first-order model checking for monadically stable classes [21 , 26 ] . This result is tight in hereditary classes that are additionally edge-stable [26 Neš+21] . The ideas from this line of research have been further developed into combinatorial characterizations of monadically dependent graph classes such as flip-breakability [22 ] and flip-separability [9 ] . This also includes the characterization by forbidden induced subgraphs, which settled the hardness part of the Model Checking Conjecture for all hereditary graph classes [22 ] .
Clique-width, twin-width, and merge-width. A second, parallel line of research has pushed the tractability frontier of first-order model checking through the development of new graph decompositions, often accompanied by new graph width parameters. Mirroring tree-width in the sparse setting, it was shown early on by Courcelle, Makowsky, and Rotics that also classes of bounded clique-width admit fpt monadic second-order model checking [CMRoo].
Twenty years later, inspired by the work of Guillemot and Marx on the permutation pattern problem [43 ] , Bonnet, Kim, Thomassé, and Watrigant introduced the more general classes of bounded twin-width , and showed that they admit fpt first-order model checking [5 ] . Their algorithm is conditional in the sense that it requires as an additional input a decomposition witnessing the twin-width bound. As of today it is not known how to efficiently compute or approximate these decompositions in general graphs. However, they can be efficiently approximated in many specific cases of interest [6 ] , in particular, in hereditary classes of ordered graphs [8 ] . There, bounded twin-width forms the exact tractability limit for first-order model checking.
Inspired by twin-width and the related flip-width parameters [Tor23], Dreier and Toruńczyk introduced merge-width , a family of graph parameters based on decompositions called construction sequences [29 ] . A class has bounded merge-width if for every radius r r r , every graph in the class has a construction sequence of radius-r r r width bounded by a constant. Again, those classes admit fpt first-order model checking under the condition that a construction sequence is given. Crucial to our paper is the following relaxation of merge-width, called almost bounded merge-width , which replaces the constant bound on the radius-r r r width by n o ( 1 ) n^{o(1)} n o ( 1 ) , where n n n is the vertex count of the graph. Dreier and Toruńczyk proved that hereditary classes of almost bounded merge-width are monadically dependent, and conjectured the converse [29 ] . The converse was first confirmed for radius one [28 ] , and then in full [27 ] . The proof of [27 ] is algorithmic: given a graph from a monadically dependent class, it computes in polynomial time a construction sequence of radius-r r r width n o ( 1 ) n^{o(1)} n o ( 1 ) , for every fixed r r r . Construction sequences of almost bounded merge-width form the basis for our model checking algorithm.
Note that it remains an open question how to approximate decompositions of constant width for classes with constant twin- and merge-width. Thus, up until now and even in the light of [27 ] , the previous model checking results for classes of bounded twin- and merge-width have remained conditional. Therefore, our new algorithm marks the first time that unconditional model checking for all classes of bounded twin- and merge-width is established.
Technical overview
In the related work section, we surveyed two approaches to the model checking problem in previous results. Our algorithm combines ideas from both approaches:
decomposition-based methods, to do dynamic programming along a construction sequence with almost bounded merge-width; and
stability-theoretic bounds on the number of types , allowing us to bound the runtime of the algorithm.
In this section, we give a high-level overview of the algorithm and the interplay between the two components. We start by introducing the relevant definition.
Merge-width. The merge-width parameters are defined through decompositions called construction sequences [29 ] . We can define them as follows.
A partial graph H H H consists of a finite vertex set V = V ( H ) V = V(H) V = V ( H ) , two disjoint sets E ( H ) , N ( H ) ⊆ ( V 2 ) E(H), N(H) \subseteq\binom{V}{2} E ( H ) , N ( H ) ⊆ ( 2 V ) of edges and non-edges , and a partition of V V V whose parts we treat as colors. The pairs in R ( H ) : = E ( H ) ∪ N ( H ) R(H) := E(H) \cup N(H) R ( H ) := E ( H ) ∪ N ( H ) are resolved , and all other pairs are unresolved . We view H H H as a logical structure with binary relations E E E and N N N and a unary predicate for every color. Distances dist H \operatorname{dist}^{H} dist H and balls Ball r H ( v ) \operatorname{Ball}^{H}_{r}(v) Ball r H ( v ) are measured in the Gaifman graph ( V , R ( H ) ) (V, R(H)) ( V , R ( H )) , the graph of resolved pairs.
For two distinct parts P , Q P,Q P , Q of H H H , the merge of P P P and Q Q Q replaces them by the single part P ∪ Q P \cup Q P ∪ Q . For two parts P , Q P,Q P , Q of H H H (possibly P = Q P = Q P = Q ), the positive resolve of P P P and Q Q Q adds all unresolved pairs u v uv uv with u ∈ P u \in P u ∈ P and v ∈ Q v \in Q v ∈ Q to E ( H ) E(H) E ( H ) , while the negative resolve adds them to N ( H ) N(H) N ( H ) .
A construction sequence of a graph G = ( V , E ) G=(V,E) G = ( V , E ) is a sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ of partial graphs with vertex set V V V , such that G 1 G_1 G 1 has no resolved pairs and only singleton parts, every G t + 1 G_{t+1} G t + 1 is obtained from G t G_t G t by one merge or one resolve, and, finally, G λ G_\lambda G λ has a single part, E ( G λ ) = E E(G_\lambda)=E E ( G λ ) = E , and N ( G λ ) = ( V 2 ) − E N(G_\lambda)=\binom{V}{2}-E N ( G λ ) = ( 2 V ) − E .
The radius-r r r width of the sequence is the maximum, over all t ∈ [ λ ] t\in[\lambda] t ∈ [ λ ] and v ∈ V v\in V v ∈ V , of the number of parts of G t G_t G t that intersect Ball G t r ( v ) \operatorname{Ball}_{G_t}^{r}(v) Ball G t r ( v ) . The radius-r r r merge-width of G G G is the minimum radius-r r r width over all construction sequences of G G G .
In a companion paper, together with Michał Pilipczuk, we prove that monadically dependent classes have almost bounded merge-width [27 ] , and that witnessing construction sequences can be computed efficiently. These construction sequences form the backbone of our model checking algorithm.
Theorem 2.1 ([27 ] ). Let C \mathcal{C} C be a monadically dependent graph class and r ∈ N r\in\mathbb{N} r ∈ N . Every n n n -vertex graph G ∈ C G\in\mathcal{C} G ∈ C has radius-r r r merge-width n o ( 1 ) n^{o(1)} n o ( 1 ) , and a witnessing construction sequence can be computed in time O C , r ( n 3 + o ( 1 ) ) O_{\mathcal{C},r}(n^{3+o(1)}) O C , r ( n 3 + o ( 1 ) ) .
Types along decompositions. Many model checking algorithms (including ours) process a decomposition of the input graph step by step, and maintain types : formulas of bounded quantifier rank satisfied by the intermediate graphs processed so far. For example, Courcelle’s theorem [13 ] maintains, for every node t t t of a tree decomposition with bag b ˉ = ( b 1 , … , b k ) \bar{b}=(b_1,\ldots,b_k) b ˉ = ( b 1 , … , b k ) , the type
{ ψ ( x 1 , … , x k ) : ψ is an MSO formula of quantifier rank at most q , such that ψ ( b ˉ ) holds in G t } . \{\psi(x_1,\ldots,x_k):\psi\text{ is an MSO formula of quantifier rank at most }q,\text{ such that }\psi(\bar{b})\text{ holds in }G_t\}. { ψ ( x 1 , … , x k ) : ψ is an MSO formula of quantifier rank at most q , such that ψ ( b ˉ ) holds in G t } .
where G t G_t G t is the subgraph induced by the bags in the subtree of t t t . Here q q q is the quantifier rank of the input formula φ \varphi φ . The type above is computed from the types of the children of t t t . Similarly, the algorithms for bounded twin-width maintain FO types along contraction sequences [5 , 38 ] , and the algorithm for bounded merge-width along construction sequences [30 ] .
We call a first-order formula local if, roughly speaking, every quantifier has the form
∃ y ( dist ( x ˉ , y ) ≤ r ∧ χ ( x ˉ y ) ) or ∀ y ( dist ( x ˉ , y ) ≤ r → χ ( x ˉ y ) ) \exists y\left(\operatorname{dist}(\bar{x},y)\le r\land\chi(\bar{x}y)\right)\quad\text{or}\quad\forall y\left(\operatorname{dist}(\bar{x},y)\le r\rightarrow\chi(\bar{x}y)\right) ∃ y ( dist ( x ˉ , y ) ≤ r ∧ χ ( x ˉ y ) ) or ∀ y ( dist ( x ˉ , y ) ≤ r → χ ( x ˉ y ) )
ranging only over vertices close to some free or previously quantified variables x ˉ \bar{x} x ˉ . The merge-width model checking algorithm [30 ] maintains, at every step H H H of the construction sequence and for every vertex v v v , its local type of quantifier rank q q q , for some constant q q q depending on φ \varphi φ :
{ ψ ( x ) : ψ is a local formula of quantifier rank at most q , such that ψ ( v ) holds in H } . \{\psi(x):\psi\text{ is a local formula of quantifier rank at most }q,\text{ such that }\psi(v)\text{ holds in }H\}. { ψ ( x ) : ψ is a local formula of quantifier rank at most q , such that ψ ( v ) holds in H } .
In the first step of the construction sequence, nothing is resolved, and the local types are trivial. In the last step, all pairs are resolved, and the local types determine whether the input sentence φ \varphi φ holds in G G G . In between, the local types have to be updated after every merge and every resolve. Merges are handled easily, by simply rewriting color names; the main difficulty in [30 ] is to lift the local types through resolves.
Combinatorial explosion. For all these type-based model checking algorithms, the number of possible types grows non-elementarily with the width of the decomposition. In particular, in each step of a construction sequence of radius-r r r width w w w , each vertex locally reaches at most w w w colors, and the number of local formulas over w w w colors is a tower of exponentials in w w w . This is a constant if the width w w w is treated as a constant (the radius r r r here is fixed and depends on the quantifier rank q q q ). However, monadically dependent classes may have unbounded merge-width, and we can only guarantee a merge-width bound of w = n o ( 1 ) w = n^{o(1)} w = n o ( 1 ) . In this case the number of all possible local types explodes.
Our algorithm. The tower above counts the types that are possible with w w w colors. Our starting point is the observation that in monadically dependent classes, only few of them are realized , that is, actually occur as the type of some tuple of vertices of the input graph. We keep the overall structure of the merge-width algorithm, but change it so that its running time depends only on the realized types. This has three parts, which we describe in the rest of this section.
We represent local types by type trees , whose size depends only on the realized types.
We show that only n o ( 1 ) n^{o(1)} n o ( 1 ) types are realized in a ball, which bounds the size of type trees (Lemma 2.3).
We lift type trees through merges and resolves in time polynomial in n n n and the number of realized types (Lemma 2.4 ).
Type trees. Type trees (defined in § 10.2 ) are a variant of Hintikka types [57 ] . Simplifying for the sake of presentation, up to the precise choice of radii r 1 < r 2 < … r_1 < r_2 < \ldots r 1 < r 2 < … , the type tree of a tuple a ˉ \bar{a} a ˉ is
tree q ( a ˉ ) : = { atp ( a ˉ ) if q = 0 , ( atp ( a ˉ ) , { ( i , tree q − 1 ( a ˉ b ) ) : i ∈ [ ∣ a ˉ ∣ ] , b ∈ V , dist ( a i , b ) ≤ r q } ) if q > 0 , \operatorname{tree}_{q}(\bar{a}) :=
\begin{cases}
\operatorname{atp}(\bar{a}) & \text{if } q = 0,\\
\left(\operatorname{atp}(\bar{a}), \left\{ \left(i,\operatorname{tree}_{q-1}(\bar{a}b)\right) : i \in[|\bar{a}|],\ b \in V,\ \operatorname{dist}(a_i,b) \le r_q \right\}\right) & \text{if } q > 0,
\end{cases} tree q ( a ˉ ) := { atp ( a ˉ ) ( atp ( a ˉ ) , { ( i , tree q − 1 ( a ˉ b ) ) : i ∈ [ ∣ a ˉ ∣ ] , b ∈ V , dist ( a i , b ) ≤ r q } ) if q = 0 , if q > 0 ,
where atp ( a ˉ ) \operatorname{atp}(\bar{a}) atp ( a ˉ ) is the set of atomic formulas satisfied by a ˉ \bar{a} a ˉ , including atoms that compare distances between the entries of a ˉ \bar{a} a ˉ and the colors. The index i i i records which entry of a ˉ \bar{a} a ˉ is close to b b b . Two tuples have the same type tree if and only if they have the same local type (Corollary 10.3 ), so type trees are just another representation of local types. Type trees resemble the morphism-trees of [5 ] and serve a similar purpose. Figure 2 shows an example.
Figure 2. Left: A partial graph with 7 vertices and colors X X X , Y Y Y , Z Z Z . Right: tree q ( a ) \operatorname{tree}_q(a) tree q ( a ) for q = 1 q = 1 q = 1 and r 1 = 1 r_1 = 1 r 1 = 1 , drawn as a tree of depth q q q whose nodes are the sets atp ( a ) \operatorname{atp}(a) atp ( a ) and atp ( a v ) \operatorname{atp}(av) atp ( a v ) . The edge label 1 records that v v v is close to the first entry of the tuple ( a ) (a) ( a ) . The lists of vertex labels below the boxes show which vertices of Ball r 1 ( a ) \operatorname{Ball}_{r_1}(a) Ball r 1 ( a ) give each child of the root node. The vertex g g g outside the locality radius r 1 = 1 r_1 = 1 r 1 = 1 does not occur in the tree. Note that the size of the tree adapts to the number of atomic types atp ( a v ) \operatorname{atp}(av) atp ( a v ) realized in the ball.
Type trees carry the same information as local types, but they may have a much smaller representation. The type tree of a tuple a ˉ \bar{a} a ˉ has one subtree for every type tree realized by an extension a ˉ b \bar{a}b a ˉ b with b b b close to some component a i a_i a i of a ˉ \bar{a} a ˉ , so its size is governed by the nearby realized types rather than by the possible ones. Roughly, this is like storing a small subset of a huge universe as the list of its elements, whereas naive type-based algorithms store it as its characteristic vector. Showing that type trees have size n o ( 1 ) n^{o(1)} n o ( 1 ) is a key step of our algorithm. For this, we first leave the algorithm aside for a moment.
Counting types over parameters. We turn to a purely quantitative result about monadically dependent classes, which counts types over a set of parameters and may be of independent interest. Let H H H be a graph or partial graph, U ⊆ V ( H ) U \subseteq V(H) U ⊆ V ( H ) , and k , q ∈ N k,q \in\mathbb{N} k , q ∈ N . The type over U U U of a tuple a ˉ ∈ V ( H ) k \bar{a} \in V(H)^k a ˉ ∈ V ( H ) k is the set of first-order formulas ψ ( x 1 , … , x k ) \psi(x_1,\ldots,x_k) ψ ( x 1 , … , x k ) of quantifier rank at most q q q which are satisfied by a ˉ \bar{a} a ˉ in H H H , where ψ \psi ψ may use any number of vertices of U U U as constants, called parameters . We denote this type by tp q H ( a ˉ / U ) \operatorname{tp}^{H}_{q}(\bar{a}/U) tp q H ( a ˉ / U ) . For X ⊆ V ( H ) X \subseteq V(H) X ⊆ V ( H ) , we write Types k , q H ( X / U ) \operatorname{Types}^{H}_{k,q}(X/U) Types k , q H ( X / U ) for the set of types over U U U of tuples from X k X^k X k ,
Types k , q H ( X / U ) = { tp q H ( a ˉ / U ) : a ˉ ∈ X k } . \operatorname{Types}^{H}_{k,q}(X/U)=\{\operatorname{tp}^{H}_{q}(\bar{a}/U):\bar{a}\in X^k\}. Types k , q H ( X / U ) = { tp q H ( a ˉ / U ) : a ˉ ∈ X k } .
This set has at most ∣ X ∣ k |X|^k ∣ X ∣ k elements, but can be much smaller, as two tuples have the same type if no formula distinguishes them. We write Types k , q H ( X ) \operatorname{Types}^{H}_{k,q}(X) Types k , q H ( X ) if U = ∅ U=\varnothing U = ∅ . One of the main contributions of this paper is the following bound on the number of types over parameters in monadically dependent graph classes.
Theorem 2.2 (Simplified form of Theorem 4.4). Let C \mathcal{C} C be a monadically dependent graph class and k , q ∈ N k,q\in\mathbb{N} k , q ∈ N . There is some d ∈ N d\in\mathbb{N} d ∈ N such that for every G ∈ C G\in\mathcal{C} G ∈ C and every set U ⊆ V ( G ) U\subseteq V(G) U ⊆ V ( G ) with ∣ U ∣ > 1 |U|>1 ∣ U ∣ > 1 ,
∣ Types k , q G ( V ( G ) / U ) ∣ ≤ ∣ U ∣ d . |\operatorname{Types}^{G}_{k,q}(V(G)/U)|\leq|U|^d. ∣ Types k , q G ( V ( G ) / U ) ∣ ≤ ∣ U ∣ d .
The proof of Theorem 2.2 proceeds as follows. We fix some radius r r r depending on the quantifier rank q q q . We then show (in Theorem 5.1) that there is a set U ^ \widehat{U} U of size polynomial in ∣ U ∣ |U| ∣ U ∣ , such that for every vertex v ∈ V ( G ) v\in V(G) v ∈ V ( G ) , there is some separator S ⊆ U ^ S\subseteq\widehat{U} S ⊆ U of size bounded by some constant s s s , such that S S S separates v v v from U U U at a distance r r r . The notion of separation is technical, but it ensures that the following holds for all v ∈ V ( G ) v\in V(G) v ∈ V ( G ) which are r r r -separated from U U U by S S S :
The type tp q G ( v / U ) \operatorname{tp}^{G}_{q}(v/U) tp q G ( v / U ) is determined by the type tp q ′ G ( v / S ) \operatorname{tp}^{G}_{q'}(v/S) tp q ′ G ( v / S ) .
Here q ′ q' q ′ depends only on q q q . Since S S S has size bounded by s s s , and both s s s and q ′ q' q ′ are constants (depending only on C \mathcal{C} C and q q q ), the number of types tp q ′ G ( v / S ) \operatorname{tp}^{G}_{q'}(v/S) tp q ′ G ( v / S ) is bounded by a constant c c c (depending on C \mathcal{C} C and q q q ). Since there are at most ∣ U ^ ∣ s |\widehat{U}|^s ∣ U ∣ s considered separators S S S , it follows that altogether there are at most c ⋅ ∣ U ^ ∣ s c\cdot|\widehat{U}|^s c ⋅ ∣ U ∣ s types over U U U of single vertices v ∈ V ( G ) v\in V(G) v ∈ V ( G ) , of quantifier rank q q q . This gives the required polynomial bound on the number of types of single vertices v v v over a set U U U . The argument for k k k -tuples v ˉ \bar{v} v ˉ proceeds similarly.
The size of type trees. We now return to type trees and bound their sizes using the bound on the number of types. The following lemma makes precise that type trees store only the types realized nearby.
Lemma 2.3 (informal version of Lemma 13.1 ). Let q ∈ N q\in\mathbb{N} q ∈ N . There is d ∈ N d\in\mathbb{N} d ∈ N depending only on q q q such that for every partial graph H H H and vertex v v v , the type tree tree q ( v ) \operatorname{tree}_{q}(v) tree q ( v ) in H H H has size polynomial in K : = ∣ Types d , d H ( Ball d H ( v ) ) ∣ K:=|\operatorname{Types}^{H}_{d,d}(\operatorname{Ball}^{H}_{d}(v))| K := ∣ Types d , d H ( Ball d H ( v )) ∣ .
We bound K K K in Lemma 2.3 using the bound on the number of types (Theorem 2.2). The two count different things. K K K counts types without parameters in a partial graph G t G_t G t , whose colors are not present in G G G , and resolved pairs a priori form an arbitrary subset of vertex pairs. On the other hand, the type bound counts types in G G G itself, over a set of parameters. While G G G comes from a monadically dependent graph class, G t G_t G t a priori does not, making it difficult to enforce structural properties on G t G_t G t .
We bridge this gap by computing construction sequences that are locally definable in G G G : in every local ball, the colors and resolved pairs of G t G_t G t can be expressed by first-order formulas in G G G that mention only n o ( 1 ) n^{o(1)} n o ( 1 ) vertices as parameters. A challenge in encoding G t G_t G t into G G G is that G t G_t G t accumulates many resolves over time, which cannot be modeled nicely by parameters. To overcome this, we turn to merge sequences , which group many merges and resolves into a single step, and can therefore be much shorter than construction sequences. For every ε > 0 \varepsilon> 0 ε > 0 , [27 ] provides a chain of sets V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ V(G) = S_1 \supseteq\cdots\supseteq S_\ell= \varnothing V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ , a closely related decomposition, with only ℓ = O ( 1 / ε ) \ell= O(1/\varepsilon) ℓ = O ( 1/ ε ) steps, which we convert into a merge sequence of width n O ( ε ) n^{O(\varepsilon)} n O ( ε ) with the same number of steps. Each step can be encoded in G G G by O ( 1 ) O(1) O ( 1 ) unary predicates, and when we refine the merge sequence into a construction sequence, every G t G_t G t stays locally definable using these O ( 1 / ε ) O(1/\varepsilon) O ( 1/ ε ) predicates and few parameters. The bound on the number of types (Theorem 2.2) extends to such expansions of G G G by boundedly many unary predicates, so it bounds K K K by n O ( ε ) n^{O(\varepsilon)} n O ( ε ) , and by Lemma 2.3, every type tree has size n O ( ε ) n^{O(\varepsilon)} n O ( ε ) as well.
Lifting type trees through merges and resolves. Now that we know that type trees are small, it remains to compute them efficiently. Our algorithm processes the construction sequence step by step and maintains the type tree of every vertex. So after every merge and every resolve, it has to compute the new type trees from the old ones. Merges are easy. Merging two parts P P P and Q Q Q into P ∪ Q P \cup Q P ∪ Q does not change the resolved pairs, and hence not the distances. Given a type tree from before the merge, we can update it as follows: in every node, remove all atoms that mention P P P or Q Q Q , and add an atom mentioning P ∪ Q P \cup Q P ∪ Q whenever the same atom with P P P or with Q Q Q in its place was present. The difficulty lies in resolves, which create new short paths and thereby bring new vertices close to a vertex v v v (see Figure 3 ).
Figure 3. A resolve of the parts P P P and Q Q Q , positive or negative, resolves all pairs between P P P and Q Q Q (red). This creates short paths from v v v to vertices that were far from v v v before, so the ball of v v v grows from B a l l H r ( v ) \mathrm{Ball}_{H}^{r}(v) Ball H r ( v ) to B a l l H ′ r ( v ) \mathrm{Ball}_{H'}^{r}(v) Ball H ′ r ( v ) . The old type tree of v v v contains no information about the new vertices in the ball. The new type tree of v v v therefore has to be assembled from the old type trees of v v v and of these vertices.
In [30 ] , resolves are handled by a rank-preserving locality theorem [31 ] . Fix a vertex v v v . For every formula that could potentially belong to the local type of v v v after the resolve, the theorem expresses whether v v v satisfies it in terms of the local type of v v v before the resolve (and some global information about the partial graph). So the new local type is assembled backwards, one potential formula at a time. For width n o ( 1 ) n^{o(1)} n o ( 1 ) , there are far too many of them, even if only few types are realized.
We instead work forwards. We use the same ideas as in the proof of the locality theorem [31 ] , but turned around: we construct the new type tree directly from the old type trees, and spend work only on type trees that are actually realized. This is summarized by the following lemma.
Lemma 2.4 (informal version of Lemma 12.2). Let q ∈ N q \in\mathbb{N} q ∈ N . There is d ∈ N d \in\mathbb{N} d ∈ N depending only on q q q such that the following holds. Given a partial graph H H H , a resolve producing H ′ H' H ′ , and the type trees of all vertices of H H H , one can compute the type trees of all vertices of H ′ H' H ′ in time polynomial in n n n and K : = max v ∣ Types d , d H ( Ball d H ′ ( v ) ) ∣ K := \max_{v} \lvert\operatorname{Types}_{d,d}^{H}(\operatorname{Ball}_{d}^{H'}(v)) \rvert K := max v ∣ Types d , d H ( Ball d H ′ ( v ))∣ .
A route not taken: games and covers. The algorithms for nowhere dense and monadically stable classes face the same problem of an unbounded number of local types. They sidestep it by a bounded-depth recursion into local neighborhoods, guided by the splitter game [42 ] or the flipper game [Gaj+23; DMS23; Dre+24], with neighborhood covers keeping the recursion tree small. We tried and failed to adapt the approach to the monadically dependent setting, before settling on our current approach.
Organization. After the preliminaries in § 4 , § 5 states the ingredients formally and derives Theorem 1.1 from them. The remaining parts prove the ingredients: Part I proves the bound on the number of types (Theorem 2.2), Part II computes the locally definable construction sequences, and Part III gives the model checking algorithm based on type trees (Lemmas 2.3 and 2.4 ).
Preliminaries
N \mathbb{N} N denotes the set of non-negative integers and [ n ] : = { 1 , … , n } [n] := \{1, \ldots, n\} [ n ] := { 1 , … , n } for n ∈ N n \in\mathbb{N} n ∈ N . For a set V V V , we write ( V 2 ) \binom{V}{2} ( 2 V ) for the set of unordered pairs u v uv uv of distinct elements of V V V , and for X , Y ⊆ V X,Y \subseteq V X , Y ⊆ V we put X Y : = { x y : x ∈ X , y ∈ Y , x ≠ y } XY := \{xy : x \in X, y \in Y, x \ne y\} X Y := { x y : x ∈ X , y ∈ Y , x = y } . A graph G G G consists of a finite set V V V of vertices and a set E ⊆ ( V 2 ) E \subseteq\binom{V}{2} E ⊆ ( 2 V ) of edges, denoted by V ( G ) V(G) V ( G ) and E ( G ) E(G) E ( G ) . The (open) neighborhood of a vertex v ∈ V ( G ) v \in V(G) v ∈ V ( G ) is the set N G ( v ) : = { w ∈ V ( G ) : v w ∈ E ( G ) } N^{G}(v) := \{w \in V(G) : vw \in E(G)\} N G ( v ) := { w ∈ V ( G ) : v w ∈ E ( G )} . For r ∈ N r \in\mathbb{N} r ∈ N , denote Ball r G ( v ) : = { w ∈ V ( G ) : dist G ( v , w ) ≤ r } \operatorname{Ball}^{G}_{r}(v) := \{w \in V(G) : \operatorname{dist}^{G}(v,w) \le r\} Ball r G ( v ) := { w ∈ V ( G ) : dist G ( v , w ) ≤ r } , where dist G ( ⋅ , ⋅ ) \operatorname{dist}^{G}(\cdot,\cdot) dist G ( ⋅ , ⋅ ) is the shortest-path distance in G G G . These notations extend to sets A , B ⊆ V ( G ) A,B \subseteq V(G) A , B ⊆ V ( G ) with Ball r G ( A ) : = ⋃ a ∈ A Ball r G ( a ) \operatorname{Ball}^{G}_{r}(A) := \bigcup_{a \in A}\operatorname{Ball}^{G}_{r}(a) Ball r G ( A ) := ⋃ a ∈ A Ball r G ( a ) and dist G ( A , B ) : = min a ∈ A , b ∈ B dist G ( a , b ) \operatorname{dist}^{G}(A,B) := \min_{a \in A,b \in B}\operatorname{dist}^{G}(a,b) dist G ( A , B ) := min a ∈ A , b ∈ B dist G ( a , b ) , and to tuples of vertices as expected.
Let G G G be a graph with vertex set V V V and edge set E E E . By G ‾ \overline{G} G we denote the edge-complement of G G G , which has vertex set V V V and edge set ( V 2 ) − E \binom{V}{2} - E ( 2 V ) − E . The subgraph of G G G induced by a set X ⊆ V X \subseteq V X ⊆ V is the graph G [ X ] G[X] G [ X ] with vertex set X X X and edge set E ∩ ( X 2 ) E \cap\binom{X}{2} E ∩ ( 2 X ) . For two disjoint sets X , Y ⊆ V X,Y \subseteq V X , Y ⊆ V , by G [ X , Y ] G[X,Y] G [ X , Y ] we denote the bipartite graph with parts X X X and Y Y Y and edge set X Y ∩ E XY \cap E X Y ∩ E .
A pair of sets X , Y ⊆ V ( G ) X,Y \subseteq V(G) X , Y ⊆ V ( G ) is complete if X Y ⊆ E ( G ) XY \subseteq E(G) X Y ⊆ E ( G ) and anticomplete if X Y ⊆ E ( G ) ‾ XY \subseteq\overline{E(G)} X Y ⊆ E ( G ) . The pair is homogeneous if it is complete or anticomplete.
A graph class is a set C \mathcal{C} C of graphs.
Partitions. For two partitions P , Q \mathcal{P},\mathcal{Q} P , Q of the same set we write P ⪯ Q \mathcal{P} \preceq\mathcal{Q} P ⪯ Q to denote that P \mathcal{P} P refines Q \mathcal{Q} Q , i.e., each part of P \mathcal{P} P is contained in some part of Q \mathcal{Q} Q . If P \mathcal{P} P is a partition of V V V and X ⊆ V X \subseteq V X ⊆ V , denote X / P : = { P ∈ P : P ∩ X ≠ ∅ } X/\mathcal{P} := \{P \in\mathcal{P} : P \cap X \ne\varnothing\} X / P := { P ∈ P : P ∩ X = ∅ } . The part of P \mathcal{P} P containing an element v v v is denoted by P ( v ) \mathcal{P}(v) P ( v ) . Further, ≡ P \equiv_{\mathcal{P}} ≡ P is the equivalence relation on V V V whose classes are the parts of P \mathcal{P} P .
Asymptotic notation. For a possibly empty list of parameters k k k , by O k ( ⋅ ) O_k(\cdot) O k ( ⋅ ) we denote an anonymous function f : R ≥ 0 → R ≥ 0 f : \mathbb{R}_{\geq0} \to\mathbb{R}_{\geq0} f : R ≥ 0 → R ≥ 0 (depending only on the parameters k k k ) which is upper bounded by x ↦ a ⋅ x + b x \mapsto a \cdot x + b x ↦ a ⋅ x + b , for some a , b ∈ N a,b \in\mathbb{N} a , b ∈ N .
Similarly, we write poly k ( ⋅ ) \operatorname{poly}_k(\cdot) poly k ( ⋅ ) for an anonymous function f : R ≥ 0 → R ≥ 0 f : \mathbb{R}_{\geq0} \to\mathbb{R}_{\geq0} f : R ≥ 0 → R ≥ 0 which is upper bounded by some polynomial; in other words, g ( n ) ≤ poly k ( n ) g(n) \leq\operatorname{poly}_k(n) g ( n ) ≤ poly k ( n ) has the same implications as g ( n ) ≤ ( n + 2 ) O k ( 1 ) g(n) \leq(n+2)^{O_k(1)} g ( n ) ≤ ( n + 2 ) O k ( 1 ) . We use O ^ k ( n c ) \widehat{O}_k(n^c) O k ( n c ) for a bound O k , ε ( n c + ε ) O_{k,\varepsilon}(n^{c+\varepsilon}) O k , ε ( n c + ε ) for every ε > 0 \varepsilon> 0 ε > 0 ; thus it hides a subpolynomial factor that may depend on the parameters k k k .
Monadic dependence. We view graphs as relational structures in the signature with one (symmetric, irreflexive) binary relation E E E . For k ∈ N k \in\mathbb{N} k ∈ N , a k k k -colored graph is a graph equipped with k k k unary predicates U 1 , … , U k U_1,\ldots,U_k U 1 , … , U k . A k k k -coloring G + G^+ G + of a graph G G G assigns interpretations of these predicates on V ( G ) V(G) V ( G ) ; the predicates need not be disjoint. A coloring of G G G is a k k k -coloring for some k ∈ N k \in\mathbb{N} k ∈ N .
A graph class C \mathcal{C} C is monadically independent if there are k ∈ N k \in\mathbb{N} k ∈ N and a first-order formula φ ( x , y ) \varphi(x,y) φ ( x , y ) in the signature of k k k -colored graphs such that every finite graph H H H can be obtained from some graph G ∈ C G \in\mathcal{C} G ∈ C as follows: first choose a k k k -coloring G + G^+ G + of G G G , then consider the graph φ ( G + ) \varphi(G^+) φ ( G + ) with vertex set V ( G ) V(G) V ( G ) and edges u v ∈ ( V ( G ) 2 ) uv \in\binom{V(G)}{2} uv ∈ ( 2 V ( G ) ) such that G + ⊨ φ ( u , v ) ∨ φ ( v , u ) G^+ \models\varphi(u,v) \lor\varphi(v,u) G + ⊨ φ ( u , v ) ∨ φ ( v , u ) ; finally take some induced subgraph of φ ( G + ) \varphi(G^+) φ ( G + ) , obtaining a graph isomorphic to H H H . A graph class C \mathcal{C} C is monadically dependent if it is not monadically independent.
Neighborhood complexity. The neighborhood complexity of a graph G G G is the function π G : N → N \pi_G : \mathbb{N} \to\mathbb{N} π G : N → N defined by:
π G ( k ) : = max S ⊆ V ( G ) ∣ S ∣ ≤ k ∣ { N G ( v ) ∩ S : v ∈ V ( G ) } ∣ . \pi_G(k) := \max_{\substack{S \subseteq V(G)\\ |S| \leq k}} \left|\{N^G(v) \cap S : v \in V(G)\}\right|. π G ( k ) := S ⊆ V ( G ) ∣ S ∣ ≤ k max { N G ( v ) ∩ S : v ∈ V ( G )} .
which counts the maximum number of distinct neighborhoods of vertices in G G G restricted to a set of size at most k k k .
The V C VC V C -dimension of a graph G G G is the maximal size of a set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) such that { N ( v ) ∩ A : v ∈ V ( G ) } = 2 A \{N(v) \cap A : v \in V(G)\} = 2^A { N ( v ) ∩ A : v ∈ V ( G )} = 2 A . The Sauer–Shelah lemma [56 , 60 ] implies the following.
Lemma 3.1. If G G G has V C VC V C -dimension d d d then
π G ( k ) ≤ ( k + 1 ) d for all k ∈ N . \pi_G(k) \leq(k+1)^d \qquad\text{for all } k \in\mathbb{N}. π G ( k ) ≤ ( k + 1 ) d for all k ∈ N .
The following is easy to see from the definition of monadic dependence; see [27 Observation 3.2] for a proof.
Observation 3.2. For every monadically dependent graph class C \mathcal{C} C there is some d ∈ N d \in\mathbb{N} d ∈ N such that every graph G ∈ C G \in\mathcal{C} G ∈ C has V C VC V C -dimension at most $d.
Types and parameters. For a structure A A A and a set W W W of its elements, let A W A_W A W denote the structure obtained by expanding A A A with constants representing each element of W W W . A formula φ ( x 1 , … , x k ) \varphi(x_1,\ldots,x_k) φ ( x 1 , … , x k ) with parameters from W W W is a formula in the signature of the structure A W A_W A W . For v ˉ ∈ V ( A ) k \bar{v} \in V(A)^k v ˉ ∈ V ( A ) k we write A ⊨ φ ( v ˉ ) A \models\varphi(\bar{v}) A ⊨ φ ( v ˉ ) to denote A W ⊨ φ ( v ˉ ) A_W \models\varphi(\bar{v}) A W ⊨ φ ( v ˉ ) .
For k , q ∈ N k,q \in\mathbb{N} k , q ∈ N and a tuple v ˉ ∈ V ( A ) k \bar{v} \in V(A)^k v ˉ ∈ V ( A ) k , define the type of v ˉ \bar{v} v ˉ of quantifier rank q q q over W W W , denoted
tp q A ( v ˉ / W ) , \operatorname{tp}^{A}_{q}(\bar{v}/W), tp q A ( v ˉ / W ) ,
as the set of all formulas φ ( x 1 , … , x k ) \varphi(x_1,\ldots,x_k) φ ( x 1 , … , x k ) with parameters from W W W and of quantifier rank at most q q q such that A ⊨ φ ( v ˉ ) A \models\varphi(\bar{v}) A ⊨ φ ( v ˉ ) . For two sets X , Y ⊆ V ( A ) X,Y \subseteq V(A) X , Y ⊆ V ( A ) , denote
Types k , q A ( X / Y ) : = { tp q A ( v ˉ / Y ) : v ˉ ∈ X k } . \operatorname{Types}_{k,q}^{A}(X/Y):=\{\operatorname{tp}_{q}^{A}(\bar{v}/Y):\bar{v}\in X^{k}\}. Types k , q A ( X / Y ) := { tp q A ( v ˉ / Y ) : v ˉ ∈ X k } .
We omit / Y /Y / Y from the notation if Y = ∅ Y=\varnothing Y = ∅ . The atomic type of v ˉ \bar{v} v ˉ over Y Y Y is defined as atp A ( v ˉ / Y ) : = tp 0 A ( v ˉ / Y ) \operatorname{atp}^{A}(\bar{v}/Y):=\operatorname{tp}_{0}^{A}(\bar{v}/Y) atp A ( v ˉ / Y ) := tp 0 A ( v ˉ / Y ) , and we set ATypes A ( X / Y ) : = Types 1 , 0 A ( X / Y ) \operatorname{ATypes}^{A}(X/Y):=\operatorname{Types}_{1,0}^{A}(X/Y) ATypes A ( X / Y ) := Types 1 , 0 A ( X / Y ) .
Note that for a graph G G G and vertex set S ⊆ V ( G ) S\subseteq V(G) S ⊆ V ( G ) , two vertices u , v ∈ V ( G ) u,v\in V(G) u , v ∈ V ( G ) have the same atomic type over S S S if and only if either u = v u=v u = v , or u , v ∉ S u,v\notin S u , v ∈ / S and N ( u ) ∩ S = N ( v ) ∩ S N(u)\cap S=N(v)\cap S N ( u ) ∩ S = N ( v ) ∩ S . The partition into atomic types , denoted P S \mathcal{P}_{S} P S , is the corresponding partition of V ( G ) V(G) V ( G ) , which partitions S S S into singletons, and vertices in V ( G ) − S V(G)-S V ( G ) − S according to their neighborhood in S S S .
Gaifman graph, distances, balls. For a structure A A A with domain V V V equipped with unary and binary relations, the Gaifman graph of A A A is the graph with vertex set V V V and edge set consisting of all pairs u v uv uv such that ( u , v ) (u,v) ( u , v ) or ( v , u ) (v,u) ( v , u ) is in some binary relation of A A A . We write dist A ( u , v ) \operatorname{dist}^{A}(u,v) dist A ( u , v ) to denote the distance between two vertices in the Gaifman graph of A A A , and Ball r A ( v ) \operatorname{Ball}_{r}^{A}(v) Ball r A ( v ) for the set of vertices at distance at most r r r from v v v in the Gaifman graph of A A A .
Flips and flip metrics. For a graph G G G and partition P \mathcal{P} P of V : = V ( G ) V:=V(G) V := V ( G ) , a P \mathcal{P} P -flip of G G G is a graph H H H with V ( H ) = V V(H)=V V ( H ) = V such that for every pair X , Y ∈ P X,Y\in\mathcal{P} X , Y ∈ P (possibly X = Y X=Y X = Y ), either H [ X , Y ] = G [ X , Y ] H[X,Y]=G[X,Y] H [ X , Y ] = G [ X , Y ] or H [ X , Y ] = G [ X , Y ] ‾ H[X,Y]=\overline{G[X,Y]} H [ X , Y ] = G [ X , Y ] . If ∣ P ∣ ≤ s |\mathcal{P}|\leq s ∣ P ∣ ≤ s , then we call H H H an s s s -flip of G G G .
Define the associated flip metric and its balls by:
dist P ( u , v ) : = max { dist H ( u , v ) : H is a P -flip of G } , \operatorname{dist}_{\mathcal{P}}(u,v):=\max\{\operatorname{dist}_{H}(u,v):H\text{ is a }\mathcal{P}\text{-flip of }G\}, dist P ( u , v ) := max { dist H ( u , v ) : H is a P -flip of G } ,
Ball r P ( v ) : = { u : dist P ( u , v ) ≤ r } = ⋂ { Ball r H ( v ) : H is a P -flip of G } . \operatorname{Ball}_{r}^{\mathcal{P}}(v):=\{u:\operatorname{dist}_{\mathcal{P}}(u,v)\leq r\}=\bigcap\{\operatorname{Ball}_{r}^{H}(v):H\text{ is a }\mathcal{P}\text{-flip of }G\}. Ball r P ( v ) := { u : dist P ( u , v ) ≤ r } = ⋂ { Ball r H ( v ) : H is a P -flip of G } .
As a shorthand, for a graph G G G and a set S ⊆ V ( G ) S\subseteq V(G) S ⊆ V ( G ) , a P S \mathcal{P}_{S} P S -flip of G G G is called an S S S -flip, and we set dist S G : = dist P S \operatorname{dist}_{S}^{G}:=\operatorname{dist}_{\mathcal{P}_{S}} dist S G := dist P S and Ball r S : = Ball r P S \operatorname{Ball}_{r}^{S}:=\operatorname{Ball}_{r}^{\mathcal{P}_{S}} Ball r S := Ball r P S .
Partial graphs and merge-width. Partial graphs, construction sequences, their radius-r r r width, and the radius-r r r merge-width of a graph are defined in § 3 (see also [29 ] ). Moreover, for a partial graph H H H with partition P \mathcal{P} P and a set W ⊆ V ( H ) W\subseteq V(H) W ⊆ V ( H ) , the induced partial graph H [ W ] H[W] H [ W ] is the partial graph with vertex set W W W , edges E ( H ) ∩ ( W 2 ) E(H)\cap\binom{W}{2} E ( H ) ∩ ( 2 W ) , non-edges N ( H ) ∩ ( W 2 ) N(H)\cap\binom{W}{2} N ( H ) ∩ ( 2 W ) , and partition { P ∩ W : P ∈ P } − { ∅ } \{P\cap W:P\in\mathcal{P}\}-\{\varnothing\} { P ∩ W : P ∈ P } − { ∅ } .
Proof of the main theorem
The upcoming Parts I, II, and III prove three independent results. This section combines them into the main result, Theorem 1.1. It does so via two theorems that are connected by the following type-based width notion.
Definition 4.1. For r , q ∈ N r,q\in\mathbb{N} r , q ∈ N , the radius-r r r depth-q q q width of a construction sequence G 1 , … , G λ G_{1},\ldots,G_{\lambda} G 1 , … , G λ is defined as:
max t ∈ [ λ − 1 ] max v ∈ V ( G ) ∣ Types q , r G t ( Ball r G t + 1 ( v ) ) ∣ . \max_{t\in[\lambda-1]}\max_{v\in V(G)}\left|\operatorname{Types}_{q,r}^{G_{t}}\left(\operatorname{Ball}_{r}^{G_{t+1}}(v)\right)\right|. t ∈ [ λ − 1 ] max v ∈ V ( G ) max Types q , r G t ( Ball r G t + 1 ( v ) ) .
The offset between G t G_{t} G t and G t + 1 G_{t+1} G t + 1 mirrors the offset between P i − 1 \mathcal{P}_{i-1} P i − 1 and R i R_{i} R i in the width definition of chains and of merge sequences (see Definitions 6.2 and 6.5 ).
Theorem 4.2. Let C \mathcal{C} C be a monadically dependent graph class, r , q ∈ N r,q \in\mathbb{N} r , q ∈ N , and let ε > 0 \varepsilon> 0 ε > 0 be a rational. There is a constant α ≥ 1 \alpha\ge1 α ≥ 1 depending only on C \mathcal{C} C and q q q such that every n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C has a construction sequence of radius-r r r depth-q q q width O C , r , q , ε ( n α ε ) O_{\mathcal{C},r,q,\varepsilon}(n^{\alpha\varepsilon}) O C , r , q , ε ( n α ε ) and length O C , r , q , ε ( n 1 + α ε ) O_{\mathcal{C},r,q,\varepsilon}(n^{1+\alpha\varepsilon}) O C , r , q , ε ( n 1 + α ε ) . Moreover, there is an algorithm (independent of C \mathcal{C} C ) which, given r , q ∈ N r,q \in\mathbb{N} r , q ∈ N , a rational ε > 0 \varepsilon> 0 ε > 0 , and an n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C , computes such a construction sequence in time O ^ C , r , q , ε ( n 3 ) \widehat{O}_{\mathcal{C},r,q,\varepsilon}(n^3) O C , r , q , ε ( n 3 ) .
It is important that α \alpha α does not depend on ε \varepsilon ε , as this allows us to make the exponent α ε \alpha\varepsilon α ε of the width as small as we like. The upcoming § 5.1 assembles Theorem 4.2 from the key results of Parts I and II.
Theorem 4.3. There is an algorithm which, given a sentence φ \varphi φ and an n n n -vertex graph G G G together with its construction sequence of length λ \lambda λ , determines whether G ⊨ φ G \models\varphi G ⊨ φ in time λ ⋅ n 2 ⋅ poly φ ( K ) \lambda\cdot n^2 \cdot\operatorname{poly}_{\varphi}(K) λ ⋅ n 2 ⋅ poly φ ( K ) , where K K K is the radius-r r r depth-q q q width of the construction sequence, for some r r r and q q q which are computable from φ \varphi φ .
Proof. See Part III. ■
From these two theorems, we can derive Theorem 1.1 without much effort. The only subtlety is that the algorithm does not know C \mathcal{C} C , so it cannot choose ε \varepsilon ε itself.
Theorem 1.1. There is an algorithm which solves the model checking problem for first-order logic on graphs – does a given graph G G G satisfy a given first-order sentence φ \varphi φ ? – with the following guarantee. For every monadically dependent graph class C \mathcal{C} C and real ε > 0 \varepsilon> 0 ε > 0 , the algorithm runs in time O C , φ , ε ( n 3 + ε ) O_{\mathcal{C},\varphi,\varepsilon}(n^{3+\varepsilon}) O C , φ , ε ( n 3 + ε ) for n n n -vertex graphs G ∈ C G \in\mathcal{C} G ∈ C .
Proof of Theorem 1.1. Let φ \varphi φ be the input sentence, and let r , q r,q r , q be the numbers from Theorem 4.3. For j ≥ 1 j \ge1 j ≥ 1 , let A j A_j A j be the algorithm that computes a construction sequence of G G G by Theorem 4.2 with r , q r,q r , q , and ε : = 1 / j \varepsilon:= 1/j ε := 1/ j , and then decides whether G ⊨ φ G \models\varphi G ⊨ φ by Theorem 4.3.
Fix a monadically dependent graph class C \mathcal{C} C , and let α ≥ 1 \alpha\ge1 α ≥ 1 be the constant from Theorem 4.2 for C \mathcal{C} C and q q q . Let c ≥ 1 c \ge1 c ≥ 1 be such that the polynomial in Theorem 4.3 is O φ ( K c ) O_{\varphi}(K^c) O φ ( K c ) . On n n n -vertex graphs G ∈ C G \in\mathcal{C} G ∈ C , the sequence computed by A j A_j A j has radius-r r r depth-q q q width K ≤ O C , φ , j ( n α / j ) K \le O_{\mathcal{C},\varphi,j}(n^{\alpha/j}) K ≤ O C , φ , j ( n α / j ) and length λ ≤ O C , φ , j ( n 1 + α / j ) \lambda\le O_{\mathcal{C},\varphi,j}(n^{1+\alpha/j}) λ ≤ O C , φ , j ( n 1 + α / j ) . So A j A_j A j runs in time
O ^ C , φ , j ( n 3 ) + O φ ( λ ⋅ n 2 ⋅ K c ) ≤ O C , φ , j ( n 3 + β / j ) , \widehat{O}_{\mathcal{C},\varphi,j}(n^3) + O_{\varphi}(\lambda\cdot n^2 \cdot K^c) \le O_{\mathcal{C},\varphi,j}(n^{3+\beta/j}), O C , φ , j ( n 3 ) + O φ ( λ ⋅ n 2 ⋅ K c ) ≤ O C , φ , j ( n 3 + β / j ) ,
where β : = ( c + 1 ) α \beta:= (c+1)\alpha β := ( c + 1 ) α . Since β / j > 0 \beta/j > 0 β / j > 0 , the subpolynomial factor hidden by O ^ \widehat{O} O is absorbed by n β / j n^{\beta/j} n β / j . The number β \beta β depends on C \mathcal{C} C and φ \varphi φ , but not on j j j .
The algorithm does not know C \mathcal{C} C , so it cannot choose j j j . Instead, it runs all algorithms A j A_j A j in parallel, giving A j A_j A j a 2 − j 2^{-j} 2 − j share of the computation, and returns the first answer. Its answer is correct, as every A j A_j A j correctly solves the model checking problem on every input graph.
For the running time, let ε > 0 \varepsilon> 0 ε > 0 and j : = ⌈ 2 β / ε ⌉ j := \lceil2\beta/\varepsilon\rceil j := ⌈ 2 β / ε ⌉ . If A j A_j A j halts within time T T T , then it completes within the first 2 j T 2^jT 2 j T simulated steps, so the algorithm halts within time
O ( 2 j T log ( 2 j T + 2 ) ) = O j ( T log ( T + 2 ) ) . O(2^jT\log(2^jT+2)) = O_j(T\log(T+2)). O ( 2 j T log ( 2 j T + 2 )) = O j ( T log ( T + 2 )) .
Hence, on n n n -vertex graphs in C \mathcal{C} C , the algorithm runs in time
O C , φ , ε ( n 3 + β / j log ( n + 2 ) ) ≤ O C , φ , ε ( n 3 + ε ) , O_{\mathcal{C},\varphi,\varepsilon}(n^{3+\beta/j}\log(n+2)) \le O_{\mathcal{C},\varphi,\varepsilon}(n^{3+\varepsilon}), O C , φ , ε ( n 3 + β / j log ( n + 2 )) ≤ O C , φ , ε ( n 3 + ε ) ,
since β / j ≤ ε / 2 \beta/j \le\varepsilon/2 β / j ≤ ε /2 and log ( n + 2 ) = O ε ( n ε / 2 ) \log(n+2) = O_{\varepsilon}(n^{\varepsilon/2}) log ( n + 2 ) = O ε ( n ε /2 ) . ■
Proving Theorem 4.2 from Parts I and II
We first state the key results of the two parts, and derive Theorem 4.2 afterwards.
The key result of Part I
The key ingredient towards proving Theorem 4.2 is the following type bound derived in Part I.
Theorem 4.4. Let C \mathcal{C} C be a monadically dependent graph class and k , q , c ∈ N k,q,c \in\mathbb{N} k , q , c ∈ N . For every graph G ∈ C G \in\mathcal{C} G ∈ C , expansion G + G^{+} G + of G G G by c c c unary predicates, and subset U ⊆ V ( G ) U \subseteq V(G) U ⊆ V ( G ) ,
∣ Types k , q G + ( V ( G ) / U ) ∣ ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) . \left|\operatorname{Types}_{k,q}^{G^{+}}(V(G)/U)\right| \le O_{\mathcal{C},q,k,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,k}(|U|). Types k , q G + ( V ( G ) / U ) ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) . The number c c c of unary predicates affects only the constant factor, not the degree of the polynomial. This matters, as our construction sequences use O ( r / ε ) O(r/\varepsilon) O ( r / ε ) unary predicates, while the constant α \alpha α in Theorem 4.2 must not depend on ε \varepsilon ε .
The key result of Part II
The type bound counts types in G G G , while the width (Definition 4.1) counts types in the partial graphs G t G_t G t . To bridge this gap, Part II produces a construction sequence in which local balls of G t G_t G t are defined by formulas in G G G .
Definition 4.5. Let G G G be a graph with vertex set V V V and let H H H be a partial graph with vertex set W ⊆ V W \subseteq V W ⊆ V . For q , c , w ∈ N q,c,w \in\mathbb{N} q , c , w ∈ N , we say that H H H is definable in G G G by formulas of quantifier rank q q q using c c c unary predicates and w w w parameters, if there is an expansion G + G^{+} G + of G G G by c c c unary predicates and a set S ⊆ V ( G ) S \subseteq V(G) S ⊆ V ( G ) of parameters with ∣ S ∣ ≤ w |S| \le w ∣ S ∣ ≤ w , such that for every relation symbol Q Q Q of H H H (when viewed as a relational structure) of arity k k k there is some formula φ Q ( x 1 , … , x k ) \varphi_Q(x_1,\ldots,x_k) φ Q ( x 1 , … , x k ) of quantifier rank q q q with parameters from S S S such that
G + ⊨ φ Q ( v ˉ ) ⟺ v ˉ ∈ W k and H ⊨ Q ( v ˉ ) G^{+} \models\varphi_Q(\bar{v}) \quad\Longleftrightarrow\quad\bar{v} \in W^k \text{ and } H \models Q(\bar{v}) G + ⊨ φ Q ( v ˉ ) ⟺ v ˉ ∈ W k and H ⊨ Q ( v ˉ ) for all v ˉ ∈ V k \bar{v} \in V^k v ˉ ∈ V k .
The vertex set W W W of H H H is the union of its parts, so it is defined by the disjunction of the formulas defining the parts.
Definition 4.6. Let G G G be a graph and r , c , s , q 0 ∈ N r,c,s,q_0 \in\mathbb{N} r , c , s , q 0 ∈ N . A construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ of G G G is radius-r r r definable with c c c unary predicates, s s s parameters, and quantifier rank q 0 q_0 q 0 if for all t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the induced partial graph
G t [ Ball G t + 1 r ( v ) ] G_t[\operatorname{Ball}_{G_{t+1}}^{r}(v)] G t [ Ball G t + 1 r ( v )] is definable in G G G by formulas of quantifier rank q 0 q_0 q 0 using c c c unary predicates and s s s parameters. Note that the expansion and the parameters may depend on t t t and v v v .
The key result of Part II is the following theorem.
Theorem 4.7. Let r ≥ 1 r \ge1 r ≥ 1 be an integer, ε > 0 \varepsilon> 0 ε > 0 be a rational, and C \mathcal{C} C be a monadically dependent graph class. There is a constant δ ≥ 1 \delta\ge1 δ ≥ 1 depending only on C \mathcal{C} C such that every n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C has a construction sequence of G G G which is radius-r r r definable with O ( r / ε ) O(r/\varepsilon) O ( r / ε ) unary predicates, O C , r , ε ( n δ ε ) O_{\mathcal{C},r,\varepsilon}(n^{\delta\varepsilon}) O C , r , ε ( n δ ε ) parameters, and quantifier rank 7 7 7 , and has length O C , r , ε ( n 1 + δ ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\delta\varepsilon}) O C , r , ε ( n 1 + δ ε ) . Moreover, there is an algorithm (independent of C \mathcal{C} C ) which, given r r r , ε \varepsilon ε , and G G G , computes such a sequence, and runs in time O ~ C , r , ε ( n 3 ) \widetilde{O}_{\mathcal{C},r,\varepsilon}(n^3) O C , r , ε ( n 3 ) whenever G ∈ C G \in\mathcal{C} G ∈ C .
For nowhere dense classes, the following stronger bounds follow easily from known results. The proof is given in Section C.
Theorem 4.8. Let C \mathcal{C} C be a nowhere dense graph class, r ∈ N r \in\mathbb{N} r ∈ N , and ε > 0 \varepsilon> 0 ε > 0 . Every n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C has a radius-r r r definable construction sequence with one unary predicate, O C , r , ε ( n ε ) O_{\mathcal{C},r,\varepsilon}(n^{\varepsilon}) O C , r , ε ( n ε ) parameters, quantifier rank 0 0 0 , and length O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) . Such a sequence can be computed in time O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) .
In particular, Theorem 4.8, together with the results of Parts I and III, gives an alternative proof of the result of Grohe, Kreutzer, and Siebertz [42 ] that first-order model checking is fixed-parameter tractable on nowhere dense classes. (Alternatively, in nowhere dense classes one can replace the type bound from Part I by a stronger bound deducible from [53 ] ).
Assembling the parts
We use the following consequence of Gaifman locality, proved in Section B.
Lemma 4.9 (Corollary of Gaifman locality). For every k , q , α ∈ N k,q,\alpha\in\mathbb{N} k , q , α ∈ N , there are numbers h = h ( q ) h=h(q) h = h ( q ) and q ′ = q ′ ( k , q , α ) q'=q'(k,q,\alpha) q ′ = q ′ ( k , q , α ) computable from k , q , α k,q,\alpha k , q , α , with the following property. Fix a finite relational signature σ \sigma σ of arity at most α \alpha α and a σ \sigma σ -structure A A A . Then, for all a ˉ ∈ V ( A ) k \bar{a} \in V(A)^k a ˉ ∈ V ( A ) k and B ⊇ Ball h A ( a ˉ ) B \supseteq\operatorname{Ball}^{A}_{h}(\bar{a}) B ⊇ Ball h A ( a ˉ ) , tp q A ( a ˉ ) \operatorname{tp}^{A}_{q}(\bar{a}) tp q A ( a ˉ ) depends only on tp q ′ A [ B ] ( a ˉ ) \operatorname{tp}^{A[B]}_{q'}(\bar{a}) tp q ′ A [ B ] ( a ˉ ) .
Lemma 4.10. For every q ∈ N q \in\mathbb{N} q ∈ N , there is h ∈ N h \in\mathbb{N} h ∈ N , computable from q q q , such that the following holds for every monadically dependent graph class C \mathcal{C} C and all r , c , s , q 0 ∈ N r,c,s,q_0 \in\mathbb{N} r , c , s , q 0 ∈ N . If a construction sequence of a graph G ∈ C G \in\mathcal{C} G ∈ C is radius-( r + h ) (r+h) ( r + h ) definable with c c c unary predicates, s s s parameters, and rank q 0 q_0 q 0 , then its radius-r r r depth-q q q width is at most O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) O_{\mathcal{C},q,q_0,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,q_0}(s) O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) .
Proof. We will apply Lemma 4.9 to partial graphs from a construction sequence of G G G . These partial graphs will have a finite signature σ \sigma σ with up to ∣ V ( G ) ∣ |V(G)| ∣ V ( G ) ∣ unary predicates marking the partition, but the arity is fixed to α = 2 \alpha=2 α = 2 . Hence, we can choose h : = h ( q ) h:=h(q) h := h ( q ) and q ′ : = q ′ ( q , q , 2 ) q':=q'(q,q,2) q ′ := q ′ ( q , q , 2 ) from Lemma 4.9. Let G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ be a construction sequence of G ∈ C G \in\mathcal{C} G ∈ C which is radius-( r + h ) (r+h) ( r + h ) definable with c c c unary predicates, s s s parameters, and rank q 0 q_0 q 0 . Fix t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , and let B : = Ball r G t + 1 ( v ) B:=\operatorname{Ball}^{G_{t+1}}_{r}(v) B := Ball r G t + 1 ( v ) and W : = Ball r + h G t + 1 ( v ) W:=\operatorname{Ball}^{G_{t+1}}_{r+h}(v) W := Ball r + h G t + 1 ( v ) . By Definition 4.1, we have to bound
∣ Types q , q ′ G t ( B ) ∣ . \left|\operatorname{Types}^{G_t}_{q,q'}(B)\right|. Types q , q ′ G t ( B ) .
First, we move from G t G_t G t to the partial graph G t [ W ] G_t[W] G t [ W ] . As G t + 1 G_{t+1} G t + 1 has all resolved pairs of G t G_t G t , every tuple u ˉ ∈ B q \bar{u} \in B^q u ˉ ∈ B q satisfies Ball h G t ( u ˉ ) ⊆ W \operatorname{Ball}^{G_t}_{h}(\bar{u}) \subseteq W Ball h G t ( u ˉ ) ⊆ W . So by Lemma 4.9, tp q G t ( u ˉ ) \operatorname{tp}^{G_t}_{q}(\bar{u}) tp q G t ( u ˉ ) is determined by tp q ′ G t [ W ] ( u ˉ ) \operatorname{tp}^{G_t[W]}_{q'}(\bar{u}) tp q ′ G t [ W ] ( u ˉ ) , and hence
∣ Types q , q ′ G t ( B ) ∣ ≤ ∣ Types q , q ′ G t [ W ] ( W ) ∣ . \left|\operatorname{Types}^{G_t}_{q,q'}(B)\right| \leq\left|\operatorname{Types}^{G_t[W]}_{q,q'}(W)\right|. Types q , q ′ G t ( B ) ≤ Types q , q ′ G t [ W ] ( W ) .
Next, we move from G t [ W ] G_t[W] G t [ W ] to G G G . By assumption, G t [ W ] G_t[W] G t [ W ] is definable in an expansion G + G^+ G + of G G G by c c c unary predicates, by formulas of quantifier rank q 0 q_0 q 0 with parameters from a set S S S of at most s s s vertices. Replace every atom of a formula over G t [ W ] G_t[W] G t [ W ] by its defining formula, and restrict every quantifier to the vertex set of G t [ W ] G_t[W] G t [ W ] . This turns a formula of quantifier rank q ′ q' q ′ over G t [ W ] G_t[W] G t [ W ] into a formula of quantifier rank at most q ′ + q 0 q'+q_0 q ′ + q 0 over G + G^+ G + with parameters from S S S , which holds for the same tuples from W W W . So for every u ˉ ∈ W q \bar{u} \in W^q u ˉ ∈ W q , tp q ′ G t [ W ] ( u ˉ ) \operatorname{tp}^{G_t[W]}_{q'}(\bar{u}) tp q ′ G t [ W ] ( u ˉ ) is determined by tp q ′ + q 0 G + ( u ˉ / S ) \operatorname{tp}^{G^+}_{q'+q_0}(\bar{u}/S) tp q ′ + q 0 G + ( u ˉ / S ) .
Together with Theorem 4.4, we obtain
∣ Types q , q ′ G t ( B ) ∣ ≤ ∣ Types q , q ′ G t [ W ] ( W ) ∣ ≤ ∣ Types q , q ′ + q 0 G + ( V ( G ) / S ) ∣ ≤ O C , q , q ′ + q 0 , c ( 1 ) ⋅ poly C , q , q ′ + q 0 ( s ) . \left|\operatorname{Types}^{G_t}_{q,q'}(B)\right| \leq\left|\operatorname{Types}^{G_t[W]}_{q,q'}(W)\right| \leq\left|\operatorname{Types}^{G^+}_{q,q'+q_0}(V(G)/S)\right| \leq O_{\mathcal{C},q,q'+q_0,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,q'+q_0}(s). Types q , q ′ G t ( B ) ≤ Types q , q ′ G t [ W ] ( W ) ≤ Types q , q ′ + q 0 G + ( V ( G ) / S ) ≤ O C , q , q ′ + q 0 , c ( 1 ) ⋅ poly C , q , q ′ + q 0 ( s ) .
As q ′ q' q ′ depends only on q q q , this is the claimed bound O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) O_{\mathcal{C},q,q_0,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,q_0}(s) O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) . ■
Proof of Theorem 4.2 . Let C \mathcal{C} C be a monadically dependent graph class containing G G G . Let h h h be the number given by Lemma 4.10 for depth q q q . We run the algorithm of Theorem 4.7 with radius r + h r+h r + h and ε \varepsilon ε , which takes time O C , r , q , ε ( n 3 ) O_{\mathcal{C},r,q,\varepsilon}(n^3) O C , r , q , ε ( n 3 ) .
By Theorem 4.7, there is a constant δ ≥ 1 \delta\ge1 δ ≥ 1 depending only on C \mathcal{C} C such that the sequence is radius-( r + h ) (r+h) ( r + h ) definable with c ≤ O ( ( r + h ) / ε ) ≤ O r , q , ε ( 1 ) c \le O((r+h)/\varepsilon) \le O_{r,q,\varepsilon}(1) c ≤ O (( r + h ) / ε ) ≤ O r , q , ε ( 1 ) unary predicates, s ≤ O C , r , q , ε ( n δ ε ) s \le O_{\mathcal{C},r,q,\varepsilon}(n^{\delta\varepsilon}) s ≤ O C , r , q , ε ( n δ ε ) parameters, and rank q 0 : = 7 q_0 := 7 q 0 := 7 , and it has length O C , r , q , ε ( n 1 + δ ε ) O_{\mathcal{C},r,q,\varepsilon}(n^{1+\delta\varepsilon}) O C , r , q , ε ( n 1 + δ ε ) . By Lemma 4.10, there is an integer D ≥ 1 D \ge1 D ≥ 1 such that its radius-r r r depth-q q q width is at most
O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) ≤ O C , r , q , ε ( n D δ ε ) , O_{\mathcal{C},q,q_0,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,q_0}(s) \le O_{\mathcal{C},r,q,\varepsilon}(n^{D\delta\varepsilon}), O C , q , q 0 , c ( 1 ) ⋅ poly C , q , q 0 ( s ) ≤ O C , r , q , ε ( n D δ ε ) ,
where we used q 0 = 7 q_0 = 7 q 0 = 7 and c ≤ O r , q , ε ( 1 ) c \le O_{r,q,\varepsilon}(1) c ≤ O r , q , ε ( 1 ) . As D D D depends only on C \mathcal{C} C and q q q , we can choose α : = D δ \alpha:= D\delta α := D δ to satisfy the statement. Since D ≥ 1 D \ge1 D ≥ 1 and δ ≥ 1 \delta\ge1 δ ≥ 1 , we have α ≥ δ ≥ 1 \alpha\ge\delta\ge1 α ≥ δ ≥ 1 , so this choice also bounds the sequence length by O C , r , q , ε ( n 1 + α ε ) O_{\mathcal{C},r,q,\varepsilon}(n^{1+\alpha\varepsilon}) O C , r , q , ε ( n 1 + α ε ) . ■
I Number of types
In this part we prove the following result. As we believe it to be of independent interest also in the context of infinite graphs, all considered graphs may be finite or infinite in Part I, and we track the necessary finiteness assumptions in the arguments below. Everywhere else in the paper, graphs are assumed to be finite.
Theorem 4.4. Let C \mathcal{C} C be a monadically dependent graph class and k , q , c ∈ N k,q,c \in\mathbb{N} k , q , c ∈ N . For every (possibly infinite) graph G ∈ C G \in\mathcal{C} G ∈ C , expansion G + G^{+} G + of G G G by c c c unary predicates, and finite subset U ⊆ V ( G ) U \subseteq V(G) U ⊆ V ( G ) ,
∣ Types k , q G + ( V ( G ) / U ) ∣ ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) . \left|\operatorname{Types}_{k,q}^{G^{+}}(V(G)/U)\right| \le O_{\mathcal{C},q,k,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,k}(|U|). Types k , q G + ( V ( G ) / U ) ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) .
We make two remarks, which are of independent interest in the context of model theory.
Remark 4.11. Conversely, the conclusion of Theorem Theorem 4.4 implies monadic dependence. Indeed, let c ∈ N c \in\mathbb{N} c ∈ N , and let φ ( x , y ) \varphi(x,y) φ ( x , y ) be any formula in the signature of c c c -colored graphs, and let q q q denote its quantifier rank. Let N N N be a number and H H H be the bipartite graph with parts A = { a 1 , … , a N } A=\{a_1,\ldots,a_N\} A = { a 1 , … , a N } and B = { b I : I ⊆ [ N ] } B=\{b_I:I\subseteq[N]\} B = { b I : I ⊆ [ N ]} , where a i a_i a i is adjacent to b I b_I b I if and only if i ∈ I i\in I i ∈ I . Suppose there is some G ∈ C G\in\mathcal{C} G ∈ C and c c c -coloring G + G^{+} G + of G G G , such that H H H is an induced subgraph of φ ( G + ) \varphi(G^{+}) φ ( G + ) , the graph with vertex set V ( G ) V(G) V ( G ) and edge set { u v ∈ ( V ( G ) 2 ) : G + ⊨ φ ( u , v ) ∨ φ ( v , u ) } \{uv\in\binom{V(G)}{2}:G^{+}\models\varphi(u,v)\lor\varphi(v,u)\} { uv ∈ ( 2 V ( G ) ) : G + ⊨ φ ( u , v ) ∨ φ ( v , u )} . Then tp q ( b I / A ) \operatorname{tp}^{q}(b_I/A) tp q ( b I / A ) is different for every I ⊆ [ N ] I\subseteq[N] I ⊆ [ N ] , so the number of types of quantifier rank q q q over A A A is at least 2 N 2^N 2 N . On the other hand, the bound in Theorem Theorem 4.4 is at most polynomial in ∣ A ∣ = N |A|=N ∣ A ∣ = N , which implies that N N N is bounded by a constant depending on C \mathcal{C} C and φ \varphi φ . Hence, not arbitrary graphs can be encoded in C \mathcal{C} C by φ \varphi φ .
Remark 4.12. An inspection of our proof of Theorem Theorem 4.4 shows that it only uses the assumption that C \mathcal{C} C is a dp-minimal class of graphs (see Section A for a definition). Thus, the conclusion of Theorem Theorem 4.4 holds under the assumption of dp-minimality.
Monadic dependence implies dp-minimality, as shown in Lemma A.2 . For general classes of structures, however, dp-minimality is a strictly weaker assumption than monadic dependence8 . With the previous remark, we conclude that for classes C \mathcal{C} C of graphs, the notions of dp-minimality and monadic dependence coincide. This extends to classes of structures over a finite signature consisting of binary relations, via the standard encoding of such structures as graphs (see [22 full version, Section 19] ).
Closures
The goal of this section is to prove the following theorem, which can be seen as a finitary analogue of [Gaj+23, Theorem 7.1 in the full version].
Theorem 5.1 (Closure Theorem). For every monadically dependent graph class C \mathcal{C} C and radius r ∈ N r\in\mathbb{N} r ∈ N there are some c , s ∈ N c,s\in\mathbb{N} c , s ∈ N with the following property.
For every G ∈ C G\in\mathcal{C} G ∈ C and finite set A ⊆ V ( G ) A\subseteq V(G) A ⊆ V ( G ) there is a set A ∗ ⊆ V ( G ) A^{*}\subseteq V(G) A ∗ ⊆ V ( G ) of size O C , r ( ∣ A ∣ c ) O_{\mathcal{C},r}(|A|^{c}) O C , r ( ∣ A ∣ c ) such that for every vertex v ∉ A v\notin A v ∈ / A there is a set S ( v ) ⊆ A ∗ S(v)\subseteq A^{*} S ( v ) ⊆ A ∗ of size at most s s s and an S ( v ) S(v) S ( v ) -flip H H H with
dist H ( v , A ) > r . \operatorname{dist}^{H}(v,A)>r. dist H ( v , A ) > r .
We also extend the statement to tuples. For simplicity, and in contrast to Theorem 5.1, the conclusion uses non-definable flips. Definability can easily be restored using the methods from [7 ] (see also [9 ] ).
Theorem 5.2 (Closure Theorem for Tuples). *For every monadically dependent graph class C \mathcal{C} C , radius r ∈ N r \in\mathbb{N} r ∈ N , and tuple size k ∈ N k \in\mathbb{N} k ∈ N , there are some c , s ∈ N c,s \in\mathbb{N} c , s ∈ N with the following property. For every m a t h i t G ∈ C mathit{G} \in\mathcal{C} ma t hi t G ∈ C and finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) there is a set H \mathcal{H} H of O C , r , k ( ∣ A ∣ c ) O_{\mathcal{C},r,k}(|A|^c) O C , r , k ( ∣ A ∣ c ) many s s s -flips of G G G such that for every tuple v ˉ ∈ ( V ( G ) − A ) k \bar{v} \in(V(G)-A)^k v ˉ ∈ ( V ( G ) − A ) k there is a flip H ∈ H H \in\mathcal{H} H ∈ H with
dist H ( v ˉ , A ) > r . \operatorname{dist}^{H}(\bar{v},A)>r. dist H ( v ˉ , A ) > r .
Preliminaries
Definable flips. For s ∈ N s \in\mathbb{N} s ∈ N , let Π = { ( x = y ) , ( x ≠ y ) ∧ E ( x , y ) , ( x ≠ y ) ∧ ¬ E ( x , y ) } \Pi=\{(x=y),(x\ne y)\land E(x,y),(x\ne y)\land\neg E(x,y)\} Π = {( x = y ) , ( x = y ) ∧ E ( x , y ) , ( x = y ) ∧ ¬ E ( x , y )} denote the set of three possible atomic types of a pair of vertices in a graph. For an s s s -tuple p ˉ = ( p 1 , … , p s ) \bar{p}=(p_1,\ldots,p_s) p ˉ = ( p 1 , … , p s ) of vertices in a graph G G G and a vertex v v v , we identify atp ( v / p ˉ ) \operatorname{atp}(v/\bar{p}) atp ( v / p ˉ ) with an s s s -tuple in Π s \Pi^s Π s , whose i i i th component is the atomic type of the pair ( v , p i ) (v,p_i) ( v , p i ) . For a symmetric relation R ⊆ Π s × Π s R\subseteq\Pi^s\times\Pi^s R ⊆ Π s × Π s , we denote by G ⊕ ( p ˉ , R ) G\oplus(\bar{p},R) G ⊕ ( p ˉ , R ) the { p 1 , … , p s } \{p_1,\ldots,p_s\} { p 1 , … , p s } -flip H H H of G G G obtained by partitioning V ( G ) V(G) V ( G ) into atomic types over p ˉ \bar{p} p ˉ and then flipping according to R R R . More precisely, for u v ∈ ( V 2 ) uv\in\binom{V}{2} uv ∈ ( 2 V ) , we have that u v ∈ E ( H ) △ E ( G ) uv\in E(H)\mathbin{\triangle}E(G) uv ∈ E ( H ) △ E ( G ) (where △ \triangle △ denotes the symmetric difference) if and only if ( atp G ( u / p ˉ ) , atp G ( v / p ˉ ) ) ∈ R (\operatorname{atp}^{G}(u/\bar{p}),\operatorname{atp}^{G}(v/\bar{p}))\in R ( atp G ( u / p ˉ ) , atp G ( v / p ˉ )) ∈ R . We call such a flip s s s -definable. Equivalently, an s s s -definable flip is an S S S -flip for some S ⊆ V ( G ) S\subseteq V(G) S ⊆ V ( G ) of size at most s s s . Note that an s s s -definable flip is also s ′ s' s ′ -definable for every s ′ ≥ s s'\ge s s ′ ≥ s .
Observation 5.3. We can define the edges of a definable flip in the original graph. More precisely, for every s ∈ N s\in\mathbb{N} s ∈ N and symmetric relation R ⊆ Π s × Π s R\subseteq\Pi^s\times\Pi^s R ⊆ Π s × Π s there exists a quantifier-free formula E ⊕ R ( x , y , z ˉ ) E_{\oplus R}(x,y,\bar{z}) E ⊕ R ( x , y , z ˉ ) such that for every graph G G G , tuple p ˉ ∈ V ( G ) s \bar{p}\in V(G)^s p ˉ ∈ V ( G ) s , and vertices u , v ∈ V ( G ) u,v\in V(G) u , v ∈ V ( G ) we have
G ⊕ ( p ˉ , R ) ⊨ E ( u , v ) ⟺ G ⊨ E ⊕ R ( u , v , p ˉ ) . G\oplus(\bar{p},R)\models E(u,v)\Longleftrightarrow G\models E_{\oplus R}(u,v,\bar{p}). G ⊕ ( p ˉ , R ) ⊨ E ( u , v ) ⟺ G ⊨ E ⊕ R ( u , v , p ˉ ) .
The following is an easy consequence of the characterization of monadic dependence through transductions (see, e.g., [22 ] ). It also holds in the greater generality of s s s -flips (rather than s s s -definable flips).
Fact 5.4. Let C \mathcal{C} C be a monadically dependent graph class and s ∈ N s\in\mathbb{N} s ∈ N . The class consisting of all s s s -definable flips of graphs from C \mathcal{C} C is monadically dependent.
The following is well-known, see, e.g., Lemma 2.6 in the full version of [Gaj+23].
Fact 5.5 (Transitivity of definable flips). Let G 1 G_1 G 1 be an s 1 s_1 s 1 -definable flip of G 0 G_0 G 0 and G 2 G_2 G 2 be an s 2 s_2 s 2 -definable flip of G 1 G_1 G 1 . Then G 2 G_2 G 2 is an ( s 1 + s 2 ) (s_1+s_2) ( s 1 + s 2 ) -definable flip of G 0 G_0 G 0 .
The main argument
The argument is a finitary analogue of the reasoning in [Gaj+23, Section 7]. We use two lemmas. The first enlarges a given set A A A to a set A ∗ A^* A ∗ such that balls avoiding A ∗ A^* A ∗ have few types over A A A . The second uses this bound to increase the separation radius by one.
Lemma 5.6. For every monadically dependent graph class C \mathcal{C} C and r , s ∈ N r,s\in\mathbb{N} r , s ∈ N , there are some k , t ∈ N k,t\in\mathbb{N} k , t ∈ N with the following property. For every G ∈ C G\in\mathcal{C} G ∈ C and finite set A ⊆ V ( G ) A\subseteq V(G) A ⊆ V ( G ) , there is A ∗ ⊇ A A^*\supseteq A A ∗ ⊇ A of size O C , r , s ( ∣ A ∣ k ) O_{\mathcal{C},r,s}(|A|^k) O C , r , s ( ∣ A ∣ k ) such that, for every s s s -definable flip H H H of G G G and every vertex v v v ,
Ball r H ( v ) ∩ A ∗ = ∅ ⟹ ∣ ATypes H ( Ball r H ( v ) / A ) ∣ ≤ t . \operatorname{Ball}^{H}_{r}(v)\cap A^*=\varnothing
\quad\Longrightarrow\quad
\left|\operatorname{ATypes}^{H}(\operatorname{Ball}^{H}_{r}(v)/A)\right|\le t. Ball r H ( v ) ∩ A ∗ = ∅ ⟹ ATypes H ( Ball r H ( v ) / A ) ≤ t .
The inequality above can be equivalently stated as follows: Ball r H ( v ) \operatorname{Ball}^{H}_{r}(v) Ball r H ( v ) intersects at most t t t parts of the partition of V ( G ) V(G) V ( G ) into atomic types over A A A in H H H . The proof of Lemma 5.6 is deferred to § 6.4 .
Lemma 5.7. For all d , t ∈ N d,t \in\mathbb{N} d , t ∈ N , there is some z ∈ N z \in\mathbb{N} z ∈ N with the following property.
For every graph G G G of VC-dimension at most d d d , radius r ∈ N r \in\mathbb{N} r ∈ N , finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) , and arbitrary set C ⊆ V ( G ) C \subseteq V(G) C ⊆ V ( G ) satisfying
Ball r G ( C ) ∩ A = ∅ and ∣ ATypes G ( Ball r G ( C ) / A ) ∣ ≤ t , \operatorname{Ball}^{G}_{r}(C) \cap A = \varnothing\qquad\text{and}\qquad\left|\operatorname{ATypes}^{G}\left(\operatorname{Ball}^{G}_{r}(C)/A\right)\right| \le t, Ball r G ( C ) ∩ A = ∅ and ATypes G ( Ball r G ( C ) / A ) ≤ t , there exists a z z z - definable flip H H H of G G G in which Ball r + 1 H ( C ) ∩ A = ∅ \operatorname{Ball}^{H}_{r+1}(C) \cap A = \varnothing Ball r + 1 H ( C ) ∩ A = ∅ .
The proof is deferred to § 6.5 . We now conclude Theorem 5.1 from the two lemmas.
Theorem 5.1 (Closure Theorem). For every monadically dependent graph class C \mathcal C C and radius r ∈ N r \in\mathbb{N} r ∈ N there are some c , s ∈ N c,s \in\mathbb{N} c , s ∈ N with the following property.
For every G ∈ C G \in\mathcal C G ∈ C and finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) there is a set A ∗ ⊆ V ( G ) A^{*} \subseteq V(G) A ∗ ⊆ V ( G ) of size O C , r ( ∣ A ∣ c ) O_{\mathcal C,r}(|A|^{c}) O C , r ( ∣ A ∣ c ) such that for every vertex v ∉ A v \notin A v ∈ / A there is a set S ( v ) ⊆ A ∗ S(v) \subseteq A^{*} S ( v ) ⊆ A ∗ of size at most s s s and an S ( v ) S(v) S ( v ) -flip H H H with
dist H ( v , A ) > r . \operatorname{dist}^{H}(v,A)>r. dist H ( v , A ) > r .
For brevity, we say a flip H H H of G G G r r r -separates two sets A , B ⊆ V ( G ) A,B \subseteq V(G) A , B ⊆ V ( G ) if dist H ( A , B ) > r \operatorname{dist}^{H}(A,B)>r dist H ( A , B ) > r . This terminology extends from sets to vertices as expected.
Proof of Theorem 5.1. We induct on r r r , with A ∗ : = A A^{*}:=A A ∗ := A , S ( v ) : = ∅ S(v):=\varnothing S ( v ) := ∅ , and H : = G H:=G H := G proving the base case r = 0 r=0 r = 0 . Suppose the theorem holds at radius r r r , with parameter bound s s s . By Fact 5.4, and since monadically dependent classes have bounded VC-dimension (Observation 3.2 ), it follows that every s s s -definable flip of a graph in C \mathcal C C has VC-dimension at most some d ≤ O C , r ( 1 ) d \le O_{\mathcal C,r}(1) d ≤ O C , r ( 1 ) .
Fix G ∈ C G \in\mathcal C G ∈ C and a finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) . Assume A A A is nonempty, as otherwise the statement is trivial. Applying Lemma 5.6 to r , s , G , A r,s,G,A r , s , G , A gives a polynomial-size superset A ∗ ⊇ A A^{*} \supseteq A A ∗ ⊇ A and a constant t ≤ O C , r ( 1 ) t \le O_{\mathcal C,r}(1) t ≤ O C , r ( 1 ) such that every r r r -ball in any s s s -definable flip H H H of G G G that avoids A ∗ A^{*} A ∗ realizes at most t t t types over A A A in $H. (Crucially, to avoid cyclic dependencies, note that s s s is an input, not an output, of Lemma 5.6.)
Apply the induction hypothesis to A ∗ A^{*} A ∗ , obtaining a vertex set B B B of size poly C , r ( ∣ A ∗ ∣ ) ≤ poly C , r ( ∣ A ∣ ) \operatorname{poly}_{\mathcal C,r}(|A^{*}|) \le\operatorname{poly}_{\mathcal C,r}(|A|) poly C , r ( ∣ A ∗ ∣ ) ≤ poly C , r ( ∣ A ∣ ) such that every vertex outside A ∗ A^{*} A ∗ is r r r -separated from A ∗ A^{*} A ∗ by a flip defined over a subset of B B B of size at most s s s . We may assume that B B B is nonempty.
For each p ˉ ∈ B s \bar p \in B^{s} p ˉ ∈ B s and each symmetric relation R ⊆ Π s × Π s R \subseteq\Pi^{s} \times\Pi^{s} R ⊆ Π s × Π s , put H : = G ⊕ ( p ˉ , R ) H:=G\oplus(\bar p,R) H := G ⊕ ( p ˉ , R ) . Let V H V_{H} V H be the set of vertices v v v that are r r r -separated from A ∗ A^{*} A ∗ by H H H , that is, Ball r H ( v ) ∩ A ∗ = ∅ \operatorname{Ball}^{H}_{r}(v)\cap A^{*}=\varnothing Ball r H ( v ) ∩ A ∗ = ∅ .
We assign to each v ∈ V H v\in V_{H} v ∈ V H its profile
profile H ( v ) : = ATypes H ( Ball r H ( v ) / A ) . \operatorname{profile}_{H}(v):=\operatorname{ATypes}^{H}\left(\operatorname{Ball}^{H}_{r}(v)/A\right). profile H ( v ) := ATypes H ( Ball r H ( v ) / A ) .
Equivalently, if P A \mathcal P_{A} P A denotes the partition of V ( G ) V(G) V ( G ) into atomic types over A A A in H H H , then profile H ( v ) = Ball r H ( v ) / P A \operatorname{profile}_{H}(v)=\operatorname{Ball}^{H}_{r}(v)/\mathcal P_{A} profile H ( v ) = Ball r H ( v ) / P A is the set of equivalence classes that are intersected by Ball r H ( v ) \operatorname{Ball}^{H}_{r}(v) Ball r H ( v ) .
Then profile H ( v ) \operatorname{profile}_{H}(v) profile H ( v ) is a subset of ATypes H ( V ( G ) / A ) \operatorname{ATypes}^{H}(V(G)/A) ATypes H ( V ( G ) / A ) of size at most t t t , by Lemma 5.6. By the Sauer–Shelah lemma (Lemma 3.1), we have that
∣ ATypes H ( V ( G ) / A ) ∣ ≤ ( ∣ A ∣ + 1 ) d + ∣ A ∣ . \left|\operatorname{ATypes}^{H}(V(G)/A)\right| \le(|A|+1)^{d}+|A|. ATypes H ( V ( G ) / A ) ≤ ( ∣ A ∣ + 1 ) d + ∣ A ∣.
It follows that
∣ { profile H ( v ) : v ∈ V H } ∣ ≤ ∣ ATypes H ( V ( G ) / A ) ∣ t ≤ ( ( ∣ A ∣ + 1 ) d + ∣ A ∣ ) t ≤ poly C , r ( ∣ A ∣ ) . \left|\{\operatorname{profile}_{H}(v):v\in V_{H}\}\right| \le\left|\operatorname{ATypes}^{H}(V(G)/A)\right|^{t} \le\left((|A|+1)^{d}+|A|\right)^{t} \le\operatorname{poly}_{\mathcal C,r}(|A|). ∣ { profile H ( v ) : v ∈ V H } ∣ ≤ ATypes H ( V ( G ) / A ) t ≤ ( ( ∣ A ∣ + 1 ) d + ∣ A ∣ ) t ≤ poly C , r ( ∣ A ∣ ) .
Group the vertices of V H V_{H} V H by their profiles. For each group C C C , the ball $\operatorname{Ball}^{H}_{r}(C):
avoids A A A , because each Ball r H ( v ) \operatorname{Ball}^{H}_{r}(v) Ball r H ( v ) with v ∈ V H v \in V_H v ∈ V H does, and
realizes at most t t t types over A A A in H H H , because all v ∈ C v \in C v ∈ C have the same profile of size ≤ t \leq t ≤ t .
Applying Lemma 5.7 yields a number z ≤ O d , t ( 1 ) ≤ O C , r ( 1 ) z \leq O_{d,t}(1) \leq O_{\mathcal{C},r}(1) z ≤ O d , t ( 1 ) ≤ O C , r ( 1 ) and a further z z z -definable flip H C H_C H C of H H H that ( r + 1 ) (r+1) ( r + 1 ) -separates C C C from A A A . By transitivity of definable flips (Fact 5.5), H C H_C H C is an ( s + z ) (s+z) ( s + z ) -definable flip of G G G . Choose a set U p ˉ , R , C ⊆ V ( G ) U_{\bar{p},R,C} \subseteq V(G) U p ˉ , R , C ⊆ V ( G ) of size at most s + z s+z s + z such that H C H_C H C is a U p ˉ , R , C U_{\bar{p},R,C} U p ˉ , R , C -flip of G G G .
We finish the proof by setting
A ∗ ∗ : = A ∗ ∪ ⋃ p ˉ , R , C U p ˉ , R , C . A^{**} := A^* \cup\bigcup_{\bar{p},R,C} U_{\bar{p},R,C}. A ∗∗ := A ∗ ∪ p ˉ , R , C ⋃ U p ˉ , R , C .
There are at most ∣ B ∣ s |B|^s ∣ B ∣ s choices of p ˉ \bar{p} p ˉ , O s ( 1 ) O_s(1) O s ( 1 ) choices of R R R for each p ˉ \bar{p} p ˉ , and poly C , r ( ∣ A ∣ ) \operatorname{poly}_{\mathcal{C},r}(|A|) poly C , r ( ∣ A ∣ ) groups C C C for each choice of p ˉ , R \bar{p},R p ˉ , R . Since each U p ˉ , R , C U_{\bar{p},R,C} U p ˉ , R , C has size at most s + z s+z s + z , we have ∣ A ∗ ∗ ∣ ≤ poly C , r ( ∣ A ∣ ) |A^{**}| \leq\operatorname{poly}_{\mathcal{C},r}(|A|) ∣ A ∗∗ ∣ ≤ poly C , r ( ∣ A ∣ ) .
For each v ∉ A ∗ v \notin A^* v ∈ / A ∗ , the induction hypothesis gives a tuple p ˉ ∈ B s \bar{p} \in B^s p ˉ ∈ B s and a p ˉ \bar{p} p ˉ -flip H H H that r r r -separates v v v from A ∗ A^* A ∗ . Let R R R be its flip relation, so that H = G ⊕ ( p ˉ , R ) H = G \oplus(\bar{p},R) H = G ⊕ ( p ˉ , R ) , and let C C C be the group of V H V_H V H containing v v v . Then we may take S ( v ) : = U p ˉ , R , C ⊆ A ∗ ∗ S(v) := U_{\bar{p},R,C} \subseteq A^{**} S ( v ) := U p ˉ , R , C ⊆ A ∗∗ , since H C H_C H C ( r + 1 ) (r+1) ( r + 1 ) -separates v v v from A A A . For v ∈ A ∗ − A v \in A^* - A v ∈ A ∗ − A , take S ( v ) : = { v } ⊆ A ∗ ∗ S(v) := \{v\} \subseteq A^{**} S ( v ) := { v } ⊆ A ∗∗ and the flip that isolates v v v . Hence, the theorem holds at radius r + 1 r+1 r + 1 with parameter set A ∗ ∗ A^{**} A ∗∗ and parameter bound s + z s+z s + z . ■
Few types in balls
In this subsection we prove Lemma 5.6. We use the following Ramsey-type result for set systems due to Ding, Oporowski, Oxley, and Vertigan [17 ] .
Definition 5.8. For a graph G G G and tuples a ˉ , b ˉ ∈ V ( G ) t \bar{a},\bar{b} \in V(G)^t a ˉ , b ˉ ∈ V ( G ) t , we say a ˉ = a 1 … a t \bar{a}=a_1\ldots a_t a ˉ = a 1 … a t and b ˉ = b 1 … b t \bar{b}=b_1\ldots b_t b ˉ = b 1 … b t are atomically matched if there is a relation ∼ ∈ { = , ≠ , ≥ } \sim\in\{=,\neq,\geq\} ∼∈ { = , = , ≥ } such that G ⊨ E ( a i , b j ) G \models E(a_i,b_j) G ⊨ E ( a i , b j ) if and only if i ∼ j i \sim j i ∼ j for all i , j ∈ [ t ] i,j \in[t] i , j ∈ [ t ] . In particular, the bipartite graph semi-induced between the tuples a ˉ \bar{a} a ˉ and b ˉ \bar{b} b ˉ is a matching, a co-matching, or a half-graph.
Theorem 5.9 ([17 Corollary 2.4] , see also [44 Theorem 2] ). There exists a computable function Q : N → N Q : \mathbb{N} \to\mathbb{N} Q : N → N such that for every ℓ ∈ N \ell\in\mathbb{N} ℓ ∈ N and for every bipartite graph G = ( L , R , E ) G=(L,R,E) G = ( L , R , E ) with ∣ ATypes ( L / R ) ∣ > Q ( ℓ ) |\operatorname{ATypes}(L/R)| > Q(\ell) ∣ ATypes ( L / R ) ∣ > Q ( ℓ ) , there are two tuples a ˉ ∈ L ℓ \bar{a} \in L^\ell a ˉ ∈ L ℓ and b ˉ ∈ R ℓ \bar{b} \in R^\ell b ˉ ∈ R ℓ that are atomically matched in G G G .
We use the above result to construct the following obstructions to monadic dependence.
Definition 5.10. Fix first-order formulas φ ( x ˉ , z ) \varphi(\bar{x},z) φ ( x ˉ , z ) and ψ ( y ˉ , z ) \psi(\bar{y},z) ψ ( y ˉ , z ) . A ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order s × t s \times t s × t in a graph G G G consists of tuples a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ \bar{a}_1,\ldots,\bar{a}_s \in V(G)^{|\bar{x}|} a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ , b ˉ 1 , … , b ˉ t ∈ V ( G ) ∣ y ˉ ∣ \bar{b}_1,\ldots,\bar{b}_t \in V(G)^{|\bar{y}|} b ˉ 1 , … , b ˉ t ∈ V ( G ) ∣ y ˉ ∣ , and vertices ( c i , j : i ∈ [ s ] , j ∈ [ t ] ) (c_{i,j}: i \in[s],j \in[t]) ( c i , j : i ∈ [ s ] , j ∈ [ t ]) such that the following holds for all i , i ′ ∈ [ s ] i,i' \in[s] i , i ′ ∈ [ s ] and j , j ′ ∈ [ t ] j,j' \in[t] j , j ′ ∈ [ t ] :
G ⊨ φ ( a ˉ i , c i , j ) G \models\varphi(\bar{a}_i,c_{i,j}) G ⊨ φ ( a ˉ i , c i , j ) and G ⊭ φ ( a ˉ i ′ , c i , j ) G \not\models\varphi(\bar{a}_{i'},c_{i,j}) G ⊨ φ ( a ˉ i ′ , c i , j ) if i ′ > i i' > i i ′ > i ,
G ⊨ ψ ( b ˉ j , c i , j ) G \models\psi(\bar{b}_j,c_{i,j}) G ⊨ ψ ( b ˉ j , c i , j ) and G ⊭ ψ ( b ˉ j ′ , c i , j ) G \not\models\psi(\bar{b}_{j'},c_{i,j}) G ⊨ ψ ( b ˉ j ′ , c i , j ) if j ′ > j j' > j j ′ > j .
We call { c i , j : i ∈ [ s ] , j ∈ [ t ] } \{c_{i,j}: i \in[s],j \in[t]\} { c i , j : i ∈ [ s ] , j ∈ [ t ]} the grid-points of the pattern, and s s s its height . See Figure 4 .
The following lemma is a corollary of [62 Lemma C.1] . We include a self-contained proof in Section A for completeness.
Lemma 5.11. For every monadically dependent graph class C \mathcal{C} C and formulas φ ( x ˉ , z ) , ψ ( y ˉ , z ) \varphi(\bar{x},z),\psi(\bar{y},z) φ ( x ˉ , z ) , ψ ( y ˉ , z ) , there is some t ∈ N t \in\mathbb{N} t ∈ N such that no graph G ∈ C G \in\mathcal{C} G ∈ C contains a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order t × t t \times t t × t .
Figure 4. A ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order s × t s \times t s × t for s = t = 5 s=t=5 s = t = 5 . Edges indicate φ ( a ˉ i ′ , c i , j ) \varphi(\bar a_{i'},c_{i,j}) φ ( a ˉ i ′ , c i , j ) or ψ ( b ˉ j ′ , c i , j ) \psi(\bar b_{j'},c_{i,j}) ψ ( b ˉ j ′ , c i , j ) . Each grid-point c i , j c_{i,j} c i , j is related via φ \varphi φ to the tuple a ˉ i \bar a_i a ˉ i in its row and possibly (indicated by dashed edges) to some earlier row tuples, and analogously for ψ \psi ψ and the column tuples. The profiles on the right illustrate these conditions at a grid-point c i , j c_{i,j} c i , j .
Definition 5.12. For a first-order formula φ ( x ˉ , z ) \varphi(\bar x,z) φ ( x ˉ , z ) , a φ \varphi φ -pattern is a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern with ψ ( y , z ) = E ( y , z ) \psi(y,z)=E(y,z) ψ ( y , z ) = E ( y , z ) or ψ ( y , z ) = ¬ E ( y , z ) \psi(y,z)=\neg E(y,z) ψ ( y , z ) = ¬ E ( y , z ) . We call those a ( φ , E ) (\varphi,E) ( φ , E ) -pattern and a ( φ , ¬ E ) (\varphi,\neg E) ( φ , ¬ E ) -pattern, respectively. Such a pattern consists of tuples a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ \bar a_1,\ldots,\bar a_s \in V(G)^{|\bar x|} a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ , vertices b 1 , … , b t ∈ V ( G ) b_1,\ldots,b_t \in V(G) b 1 , … , b t ∈ V ( G ) and ( c i , j : i ∈ [ s ] , j ∈ [ t ] ) (c_{i,j}:i\in[s],j\in[t]) ( c i , j : i ∈ [ s ] , j ∈ [ t ]) . We call b ˉ = ( b 1 , … , b t ) \bar b=(b_1,\ldots,b_t) b ˉ = ( b 1 , … , b t ) the base of the pattern.
Corollary 5.13. For every monadically dependent graph class C \mathcal C C and formula φ ( x ˉ , z ) \varphi(\bar x,z) φ ( x ˉ , z ) , there is some t ∈ N t\in\mathbb N t ∈ N such that no graph G ∈ C G\in\mathcal C G ∈ C contains a φ \varphi φ -pattern of order t × t t\times t t × t .
We now prove Lemma 5.6, which we repeat for convenience.
Lemma 5.6. For every monadically dependent graph class C \mathcal C C and r , s ∈ N r,s\in\mathbb N r , s ∈ N , there are some k , t ∈ N k,t\in\mathbb N k , t ∈ N with the following property. For every G ∈ C G\in\mathcal C G ∈ C and finite set A ⊆ V ( G ) A\subseteq V(G) A ⊆ V ( G ) , there is A ∗ ⊇ A A^*\supseteq A A ∗ ⊇ A of size O C , r , s ( ∣ A ∣ k ) O_{\mathcal C,r,s}(|A|^k) O C , r , s ( ∣ A ∣ k ) such that, for every s s s -definable flip H H H of G G G and every vertex v v v ,
Ball r H ( v ) ∩ A ∗ = ∅ ⟹ ∣ ATypes H ( Ball r H ( v ) / A ) ∣ ≤ t . \operatorname{Ball}^{H}_{r}(v)\cap A^*=\varnothing\quad\Longrightarrow\quad|\operatorname{ATypes}^{H}(\operatorname{Ball}^{H}_{r}(v)/A)|\leq t. Ball r H ( v ) ∩ A ∗ = ∅ ⟹ ∣ ATypes H ( Ball r H ( v ) / A ) ∣ ≤ t .
Proof. For each symmetric relation R ⊆ Π s × Π s R\subseteq\Pi^s\times\Pi^s R ⊆ Π s × Π s , let φ R ( z ˉ x , y ) \varphi_R(\bar z x,y) φ R ( z ˉ x , y ) be a first-order formula expressing that x x x and y y y have distance at most r r r in the flip G ⊕ ( z ˉ , R ) G\oplus(\bar z,R) G ⊕ ( z ˉ , R ) , where z ˉ \bar z z ˉ is an s s s -tuple. Its existence follows from Observation 5.3.
Let k ≥ 1 k\geq1 k ≥ 1 be the bound from Corollary 5.13, such that no G ∈ C G\in\mathcal C G ∈ C contains a φ R \varphi_R φ R -pattern of order k × k k\times k k × k , for any R R R . Let Q : N → N Q:\mathbb N\to\mathbb N Q : N → N be as in Theorem 5.9, and set
t : = Q ( k ⋅ ∣ Π s ∣ 2 ) = Q ( k ⋅ 9 s ) . t:=Q(k\cdot|\Pi^s|^2)=Q(k\cdot9^s). t := Q ( k ⋅ ∣ Π s ∣ 2 ) = Q ( k ⋅ 9 s ) .
Fix G ∈ C G\in\mathcal C G ∈ C and a finite set A ⊆ V ( G ) A\subseteq V(G) A ⊆ V ( G ) . For every R R R as above and N ∈ { E , ¬ E } N\in\{E,\neg E\} N ∈ { E , ¬ E } , and every b ˉ ∈ A k \bar b\in A^k b ˉ ∈ A k , choose a maximum-height ( φ R , N ) (\varphi_R,N) ( φ R , N ) -pattern with base b ˉ \bar b b ˉ in G G G . Each of them is an ℓ × k \ell\times k ℓ × k pattern for some ℓ < k \ell<k ℓ < k (possibly ℓ = 0 \ell=0 ℓ = 0 ).
Let A ∗ A^* A ∗ consist of A A A and all grid-points of the chosen patterns. There are O s ( 1 ) O_s(1) O s ( 1 ) many choices of R R R and ∣ A ∣ k |A|^k ∣ A ∣ k many choices of b ˉ \bar b b ˉ , and each chosen pattern contributes at most k 2 k^2 k 2 vertices, so
∣ A ∗ ∣ ≤ ∣ A ∣ + O s ( 1 ) ⋅ ∣ A ∣ k ⋅ k 2 = O C , r , s ( ∣ A ∣ k ) . |A^*|\leq|A|+O_s(1)\cdot|A|^k\cdot k^2=O_{\mathcal C,r,s}(|A|^k). ∣ A ∗ ∣ ≤ ∣ A ∣ + O s ( 1 ) ⋅ ∣ A ∣ k ⋅ k 2 = O C , r , s ( ∣ A ∣ k ) .
Fix a symmetric relation R ⊆ Π s × Π s R \subseteq\Pi^{s} \times\Pi^{s} R ⊆ Π s × Π s , tuple p ˉ ∈ V ( G ) s \bar{p} \in V(G)^{s} p ˉ ∈ V ( G ) s , and vertex v ∈ V ( G ) v \in V(G) v ∈ V ( G ) . Let H = G ⊕ ( p ˉ , R ) H = G \oplus(\bar{p},R) H = G ⊕ ( p ˉ , R ) and suppose B : = Ball r H ( v ) B := \operatorname{Ball}^{H}_{r}(v) B := Ball r H ( v ) satisfies B ∩ A ∗ = ∅ B \cap A^{*} = \varnothing B ∩ A ∗ = ∅ . We show that B B B realizes at most t t t atomic types over A A A in H H H , thus proving the lemma.
Suppose the contrary. By Theorem 5.9 , there are tuples u ˉ ′ \bar{u}' u ˉ ′ in B B B and w ˉ ′ \bar{w}' w ˉ ′ in A A A , each of length k ⋅ ∣ Π s ∣ 2 k \cdot|\Pi^{s}|^{2} k ⋅ ∣ Π s ∣ 2 , that are atomically matched in H H H .
Let P \mathcal{P} P be the partition of V ( G ) V(G) V ( G ) into atomic types over p ˉ \bar{p} p ˉ ; then H H H is a P \mathcal{P} P -flip of G G G and ∣ P ∣ ≤ ∣ Π s ∣ |\mathcal{P}| \leq|\Pi^{s}| ∣ P ∣ ≤ ∣ Π s ∣ . By the pigeonhole principle, we can pick corresponding subsequences u ˉ \bar{u} u ˉ of u ˉ ′ \bar{u}' u ˉ ′ and w ˉ \bar{w} w ˉ of w ˉ ′ \bar{w}' w ˉ ′ of length k k k , such that u ˉ \bar{u} u ˉ is contained in a single part X ∈ P X \in\mathcal{P} X ∈ P and w ˉ \bar{w} w ˉ is contained in a single part Y ∈ P Y \in\mathcal{P} Y ∈ P . Write u ˉ = ( u 1 , … , u k ) \bar{u} = (u_{1},\ldots,u_{k}) u ˉ = ( u 1 , … , u k ) and w ˉ = ( w 1 , … , w k ) \bar{w} = (w_{1},\ldots,w_{k}) w ˉ = ( w 1 , … , w k ) . Since H H H is a P \mathcal{P} P -flip of G G G , adjacency between X X X and Y Y Y is either preserved or complemented. Together with the matching condition in H H H , this gives a choice of N ∈ { E , ¬ E } N \in\{E,\neg E\} N ∈ { E , ¬ E } such that
G ⊨ N ( w j , u j ) for every j ∈ [ k ] , G \models N(w_{j},u_{j}) \qquad\text{for every } j \in[k], G ⊨ N ( w j , u j ) for every j ∈ [ k ] ,
G ⊭ N ( w j ′ , u j ) for 1 ≤ j < j ′ ≤ k . G \not\models N(w_{j'},u_{j}) \qquad\text{for } 1 \leq j < j' \leq k. G ⊨ N ( w j ′ , u j ) for 1 ≤ j < j ′ ≤ k .
Consider the maximum-height ( φ R , N ) (\varphi_{R},N) ( φ R , N ) -pattern chosen for R R R and N N N and for base b ˉ : = w ˉ = ( b 1 , … , b k ) \bar{b} := \bar{w} = (b_{1},\ldots,b_{k}) b ˉ := w ˉ = ( b 1 , … , b k ) . Write a ˉ 1 , … , a ˉ ℓ \bar{a}_{1},\ldots,\bar{a}_{\ell} a ˉ 1 , … , a ˉ ℓ for its witnessing tuples and c i , j c_{i,j} c i , j for its grid-points, where i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] and j ∈ [ k ] j \in[k] j ∈ [ k ] (possibly ℓ = 0 \ell= 0 ℓ = 0 ). All these grid-points belong to A ∗ A^{*} A ∗ . Append a new row by setting
a ˉ ℓ + 1 : = p ˉ v ˉ , c ℓ + 1 , j : = u j for every j ∈ [ k ] . \bar{a}_{\ell+1} := \bar{p}\bar{v}, \qquad c_{\ell+1,j} := u_{j} \qquad\text{for every } j \in[k]. a ˉ ℓ + 1 := p ˉ v ˉ , c ℓ + 1 , j := u j for every j ∈ [ k ] .
We verify that this yields a ( φ R , N ) (\varphi_{R},N) ( φ R , N ) -pattern with the same base b ˉ \bar{b} b ˉ and height ℓ + 1 \ell+1 ℓ + 1 , contradicting the maximality of ℓ \ell ℓ . The column condition holds by the choice of N N N , b j = w j b_{j}=w_{j} b j = w j and c ℓ + 1 , j = u j c_{\ell+1,j}=u_{j} c ℓ + 1 , j = u j :
G ⊨ N ( b j , c ℓ + 1 , j ) for every j ∈ [ k ] , G \models N(b_{j},c_{\ell+1,j}) \qquad\text{for every } j \in[k], G ⊨ N ( b j , c ℓ + 1 , j ) for every j ∈ [ k ] ,
G ⊭ N ( b j ′ , c ℓ + 1 , j ) for 1 ≤ j < j ′ ≤ k . G \not\models N(b_{j'},c_{\ell+1,j}) \qquad\text{for } 1 \leq j < j' \leq k. G ⊨ N ( b j ′ , c ℓ + 1 , j ) for 1 ≤ j < j ′ ≤ k .
For every j ∈ [ k ] j \in[k] j ∈ [ k ] , we have G ⊨ φ R ( a ˉ ℓ + 1 , c ℓ + 1 , j ) G \models\varphi_{R}(\bar{a}_{\ell+1},c_{\ell+1,j}) G ⊨ φ R ( a ˉ ℓ + 1 , c ℓ + 1 , j ) , since c ℓ + 1 , j ∈ B = Ball r H ( v ) c_{\ell+1,j} \in B = \operatorname{Ball}^{H}_{r}(v) c ℓ + 1 , j ∈ B = Ball r H ( v ) . Moreover, for every i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] , we have G ⊭ φ R ( a ˉ ℓ + 1 , c i , j ) G \not\models\varphi_{R}(\bar{a}_{\ell+1},c_{i,j}) G ⊨ φ R ( a ˉ ℓ + 1 , c i , j ) , since c i , j ∈ A ∗ c_{i,j} \in A^{*} c i , j ∈ A ∗ and B ∩ A ∗ = ∅ B \cap A^{*} = \varnothing B ∩ A ∗ = ∅ . This proves the lemma. ■
Definable flips for balls
The following lemma is a corollary of the ( p , q ) (p,q) ( p , q ) -Theorem for bounded VC-dimension from [Mat04]. See [61 Corollary 6.13] or [Tor23, full version, Theorem E.2] for self-contained proofs.
For a graph G G G and sets S , X ⊆ V ( G ) S,X \subseteq V(G) S , X ⊆ V ( G ) , we say that S S S dominates X X X if every vertex of X − S X-S X − S has a neighbor in S S S , and that S S S antidominates X X X if every vertex of X − S X-S X − S has a nonneighbor in S S S .
Lemma 5.14 (Bounded-VC duality). For every d ∈ N d \in\mathbb{N} d ∈ N there is some k ∈ N k \in\mathbb{N} k ∈ N with the following property. Let G G G be a graph of VC-dimension at most d d d , and let X , Y ⊆ V ( G ) X,Y \subseteq V(G) X , Y ⊆ V ( G ) be two (possibly overlapping) sets with at least one of X , Y X,Y X , Y finite. Then there exists a set s a m p l e ( X , Y ) sample(X,Y) s am pl e ( X , Y ) of size at most k k k such that at least one of the following holds:
s a m p l e ( X , Y ) sample(X,Y) s am pl e ( X , Y ) is contained in Y Y Y and dominates X X X ;
s a m p l e ( X , Y ) sample(X,Y) s am pl e ( X , Y ) is contained in X X X and antidominates Y Y Y .
We remark that in the sources we have given, the above lemma is stated either for finite set systems or finite binary relations. The translation to finite graphs is straightforward, by either viewing the graph as a set system of neighborhoods or working with the adjacency relation. Moreover, the statement lifts to infinite graphs if at least one of the sets X X X and Y Y Y is finite, as the
other one can be replaced by its finite subset representing all neighborhoods in the finite one. (However, the statement may fail if both X X X and Y Y Y are infinite, as witnessed by the bi-infinite half-graph with vertices Z × { 1 , 2 } \mathbb{Z} \times\{1,2\} Z × { 1 , 2 } and edges between ( x , 1 ) (x,1) ( x , 1 ) and ( y , 2 ) (y,2) ( y , 2 ) if x ≤ y x \le y x ≤ y .)
It was observed already in [7 ] that Lemma 5.14 is useful to obtain definable flips. We will use it in a similar way to deduce the remaining result of § 6.3 .
Lemma 5.7. For all d , t ∈ N d,t \in\mathbb{N} d , t ∈ N , there is some z ∈ N z \in\mathbb{N} z ∈ N with the following property. For every graph G G G of VC-dimension at most d d d , radius r ∈ N r \in\mathbb{N} r ∈ N , finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) , and arbitrary set C ⊆ V ( G ) C \subseteq V(G) C ⊆ V ( G ) satisfying
Ball r G ( C ) ∩ A = ∅ and ∣ ATypes G ( Ball r G ( C ) / A ) ∣ ≤ t , \operatorname{Ball}^{G}_{r}(C) \cap A = \varnothing\qquad\text{and} \qquad\lvert\operatorname{ATypes}^{G}(\operatorname{Ball}^{G}_{r}(C)/A) \rvert\le t, Ball r G ( C ) ∩ A = ∅ and ∣ ATypes G ( Ball r G ( C ) / A )∣ ≤ t , there exists a z z z -definable flip H H H of G G G in which Ball r + 1 H ( C ) ∩ A = ∅ \operatorname{Ball}^{H}_{r+1}(C) \cap A = \varnothing Ball r + 1 H ( C ) ∩ A = ∅ .
Note that, given the assumptions of the lemma, it is easy to find a (non-definable) ( 2 t + t + 1 ) (2^{t} + t + 1) ( 2 t + t + 1 ) -flip H ′ H' H ′ of G G G in which Ball r + 1 H ′ ( C ) ∩ A = ∅ \operatorname{Ball}^{H'}_{r+1}(C) \cap A = \varnothing Ball r + 1 H ′ ( C ) ∩ A = ∅ : group the vertices of A A A and of Ball r G ( C ) \operatorname{Ball}^{G}_{r}(C) Ball r G ( C ) by their neighborhoods in the other set, which gives at most 2 t 2^{t} 2 t and t t t groups, respectively, and flip every group of A A A with every group of Ball r G ( C ) \operatorname{Ball}^{G}_{r}(C) Ball r G ( C ) that it is complete to. So the challenge is really to get such a flip in a definable way.
We also remark that Lemma 5.7 can be seen as a finitization of Lemma 7.3 in the full version of [Gaj+23]. That lemma works in a more model-theoretic setting, where A A A is a (possibly infinite) model instead of a set. It uses a version of Lemma 5.14 which also works for infinite X , Y X,Y X , Y , under the stronger assumption that G G G excludes a half-graph of order d d d .
Proof of Lemma 5.7. Put B : = Ball r G ( C ) B := \operatorname{Ball}^{G}_{r}(C) B := Ball r G ( C ) . Let A \mathcal{A} A be the partition of A A A that groups vertices by their neighborhood in B B B , and let B \mathcal{B} B be the partition of B B B that groups vertices by their neighborhood in A A A . By assumption ∣ B ∣ ≤ t \lvert\mathcal{B}\rvert\le t ∣ B ∣ ≤ t . The neighborhood in B B B of a vertex of A A A is a union of parts of B \mathcal{B} B , so ∣ A ∣ ≤ 2 t \lvert\mathcal{A}\rvert\le2^{t} ∣ A ∣ ≤ 2 t . Moreover, every pair P ∈ A , Q ∈ B P \in\mathcal{A}, Q \in\mathcal{B} P ∈ A , Q ∈ B is homogeneously connected: is either complete or anticomplete.
Let k ≤ O d ( 1 ) k \le O_{d}(1) k ≤ O d ( 1 ) be given by Lemma 5.14 . Pick any set S S S which contains
an arbitrary representative rep ( P ) ∈ P \operatorname{rep}(P) \in P rep ( P ) ∈ P for each part P ∈ A ∪ B P \in\mathcal{A} \cup\mathcal{B} P ∈ A ∪ B , and
the set sample ( X , Y ) \operatorname{sample}(X,Y) sample ( X , Y ) supplied by Lemma 5.14 , for every X ∈ A X \in\mathcal{A} X ∈ A and Y ∈ A ∪ { V ( G ) − B } Y \in\mathcal{A} \cup\{V(G)-B\} Y ∈ A ∪ { V ( G ) − B } (the lemma is applicable because X ⊆ A X \subseteq A X ⊆ A is finite).
We can pick such a set with ∣ S ∣ ≤ z \lvert S\rvert\le z ∣ S ∣ ≤ z for some z ≤ O k , t ( 1 ) ≤ O d , t ( 1 ) z \le O_{k,t}(1) \le O_{d,t}(1) z ≤ O k , t ( 1 ) ≤ O d , t ( 1 ) . We will construct H H H as an S S S -flip of G G G ; in particular, H H H is z z z -definable.
Let P S \mathcal{P}_{S} P S be the partition of V ( G ) V(G) V ( G ) into atomic types over S S S . Write x ∼ y x \sim y x ∼ y when x x x and y y y are in the same P S \mathcal{P}_{S} P S -part. Observe the following two properties of P S \mathcal{P}_{S} P S .
Claim 5.1. P S \mathcal{P}_{S} P S refines A \mathcal{A} A on A A A and B \mathcal{B} B on $B.
Proof. If two vertices a a a and a ′ a' a ′ of A A A are in different A \mathcal{A} A -parts, then their adjacencies differ on some vertex b ∈ B b \in B b ∈ B . Let P P P be the B \mathcal{B} B -part containing b b b . The vertex rep ( P ) ∈ S \operatorname{rep}(P) \in S rep ( P ) ∈ S has the same adjacencies to A A A as b b b and hence distinguishes a a a and a ′ a' a ′ in P S \mathcal{P}_{S} P S . Thus, P S \mathcal{P}_{S} P S refines A \mathcal{A} A on A A A and symmetrically also B \mathcal{B} B on $B.
Claim 5.2. Let X ∈ A X \in\mathcal{A} X ∈ A and Y ∈ A ∪ { V ( G ) − B } Y \in\mathcal{A} \cup\{V(G)-B\} Y ∈ A ∪ { V ( G ) − B } . There do not exist vertices x , y , x ′ , y ′ x,y,x',y' x , y , x ′ , y ′ with:
x ∈ X , y ∈ Y , x ∼ x ′ , y ∼ y ′ , Y ⊆ N G ‾ ( x ′ ) , X ⊆ N G ( y ′ ) . x \in X,\qquad y \in Y,\qquad x \sim x',\qquad y \sim y',\qquad Y \subseteq N^{\overline{G}}(x'),\qquad X \subseteq N^{G}(y'). x ∈ X , y ∈ Y , x ∼ x ′ , y ∼ y ′ , Y ⊆ N G ( x ′ ) , X ⊆ N G ( y ′ ) .
{#eq:\dagger}
Proof. Suppose that sample ( X , Y ) \operatorname{sample}(X,Y) sample ( X , Y ) lies in Y ‾ \overline{Y} Y and dominates X X X . Then there is some s ∈ sample ( X , Y ) ∩ Y ‾ s \in\operatorname{sample}(X,Y) \cap\overline{Y} s ∈ sample ( X , Y ) ∩ Y with s x ∈ E ( G ) sx \in E(G) s x ∈ E ( G ) . If Y ⊆ N ‾ G ( x ′ ) Y \subseteq\overline{N}^{G}(x') Y ⊆ N G ( x ′ ) , then s x ′ ∉ E ( G ) sx' \notin E(G) s x ′ ∈ / E ( G ) . Thus, x ≁ x ′ x \not\sim x' x ∼ x ′ .
The case when sample ( X , Y ) \operatorname{sample}(X,Y) sample ( X , Y ) lies in X ‾ \overline{X} X and antidominates Y Y Y , is symmetric, by swapping X X X with Y Y Y and G G G with G ‾ \overline{G} G . Both cases are illustrated in Figure 5 .
Figure 5. Left: the forbidden configuration ( † ) (\dagger) ( † ) . Middle: the case of the proof of Claim 5.2 where sample ( X , Y ) \operatorname{sample}(X,Y) sample ( X , Y ) (marked in blue) lies in Y Y Y . Right: the case where sample ( X , Y ) \operatorname{sample}(X,Y) sample ( X , Y ) lies in X X X .
Define the S S S -flip H H H of G G G where a pair ( P , Q ) (P,Q) ( P , Q ) of parts of P S \mathcal{P}_{S} P S is flipped if and only if there is an edge in G G G with endpoints in P P P and in Q Q Q and also in A A A and in B B B . More formally, H [ P , Q ] = G [ P , Q ] H[P,Q] = G[P,Q] H [ P , Q ] = G [ P , Q ] whenever E ( G ) ∩ P Q ∩ A B = ∅ E(G) \cap PQ \cap AB = \varnothing E ( G ) ∩ P Q ∩ A B = ∅ , and otherwise, H [ P , Q ] = G ‾ [ P , Q ] H[P,Q] = \overline{G}[P,Q] H [ P , Q ] = G [ P , Q ] .
The following three properties will yield the conclusion of the lemma:
(P1) A A A and Ball r G ( C ) \operatorname{Ball}^{G}_{r}(C) Ball r G ( C ) are nonadjacent in H H H . (proven in Claim 5.3)
(P2) Ball r − 1 H ( C ) = Ball r − 1 G ( C ) \operatorname{Ball}^{H}_{r-1}(C) = \operatorname{Ball}^{G}_{r-1}(C) Ball r − 1 H ( C ) = Ball r − 1 G ( C ) . (proven in Claim 5.5 )
(P3) Ball r − 1 G ( C ) \operatorname{Ball}^{G}_{r-1}(C) Ball r − 1 G ( C ) and V ( G ) − Ball r G ( C ) V(G) - \operatorname{Ball}^{G}_{r}(C) V ( G ) − Ball r G ( C ) are nonadjacent in H H H . (proven in Claim 5.6)
If r = 0 r = 0 r = 0 , then already P1 alone yields the conclusion. This justifies the implicit assumption r ≥ 1 r \ge1 r ≥ 1 made in P2 and P3. By combining P2 and P3, we derive:
(P4) Ball r H ( C ) ⊆ Ball r G ( C ) \operatorname{Ball}^{H}_{r}(C) \subseteq\operatorname{Ball}^{G}_{r}(C) Ball r H ( C ) ⊆ Ball r G ( C ) .
The conclusion of the lemma thus follows:
A ∩ Ball r + 1 H ( C ) = A ∩ Ball 1 H ( Ball r H ( C ) ) ⊆ A ∩ Ball 1 H ( Ball r G ( C ) ) = A ∩ Ball r G ( C ) = ∅ . A \cap\operatorname{Ball}^{H}_{r+1}(C) = A \cap\operatorname{Ball}^{H}_{1}\left(\operatorname{Ball}^{H}_{r}(C)\right) \subseteq A \cap\operatorname{Ball}^{H}_{1}\left(\operatorname{Ball}^{G}_{r}(C)\right) = A \cap\operatorname{Ball}^{G}_{r}(C) = \varnothing. A ∩ Ball r + 1 H ( C ) = A ∩ Ball 1 H ( Ball r H ( C ) ) ⊆ A ∩ Ball 1 H ( Ball r G ( C ) ) = A ∩ Ball r G ( C ) = ∅ .
It only remains to establish P1–P3.
Claim 5.3 (P1). A A A and B B B are nonadjacent in H H H .
Proof. By contrapositive, suppose a b ∈ E ( H ) ab \in E(H) ab ∈ E ( H ) for some a ∈ A a \in A a ∈ A and b ∈ B b \in B b ∈ B . By definition of H H H , a b ∈ E ( G ) ab \in E(G) ab ∈ E ( G ) implies a b ∉ E ( H ) ab \notin E(H) ab ∈ / E ( H ) , so a b ∉ E ( G ) ab \notin E(G) ab ∈ / E ( G ) . Since a b ∈ E ( H ) ab \in E(H) ab ∈ E ( H ) , the parts of P S \mathcal{P}_{S} P S containing a a a and b b b are flipped, that is, there is some a ′ b ′ ∈ E ( G ) a'b' \in E(G) a ′ b ′ ∈ E ( G ) with a ′ ∈ A a' \in A a ′ ∈ A and b ′ ∈ B b' \in B b ′ ∈ B , and
( a ∼ a ′ and b ∼ b ′ ) or ( a ∼ b ′ and b ∼ a ′ ) . (a \sim a' \text{ and } b \sim b') \qquad\text{or} \qquad(a \sim b' \text{ and } b \sim a'). ( a ∼ a ′ and b ∼ b ′ ) or ( a ∼ b ′ and b ∼ a ′ ) . The first case cannot happen as P S \mathcal{P}_{S} P S refines A \mathcal{A} A on A A A and B \mathcal{B} B on B B B , but the two sets { a , a ′ } \{a,a'\} { a , a ′ } and { b , b ′ } \{b,b'\} { b , b ′ } are inhomogeneous as a b ∉ E ( G ) ab \notin E(G) ab ∈ / E ( G ) and a ′ b ′ ∈ E ( G ) a'b' \in E(G) a ′ b ′ ∈ E ( G ) .
Thus, assume a ∼ b ′ a \sim b' a ∼ b ′ and b ∼ a ′ b \sim a' b ∼ a ′ . Let X , Y ∈ A X,Y \in\mathcal{A} X , Y ∈ A contain a ′ , a a',a a ′ , a , respectively. Then a ′ b ′ ∈ E ( G ) a'b' \in E(G) a ′ b ′ ∈ E ( G ) implies that b ′ b' b ′ is complete to X X X , whereas a b ∉ E ( G ) ab \notin E(G) ab ∈ / E ( G ) implies that b b b is anticomplete to Y Y Y (both by homogeneity). This contradicts ( † ) (\dagger) ( † ) with ( x , y , x ′ , y ′ ) = ( a ′ , a , b , b ′ ) (x,y,x',y') = (a',a,b,b') ( x , y , x ′ , y ′ ) = ( a ′ , a , b , b ′ ) .
For brevity, we define D : = Ball r − 1 G ( C ) D := \operatorname{Ball}^{G}_{r-1}(C) D := Ball r − 1 G ( C ) . Recall that P S ( v ) \mathcal{P}_{S}(v) P S ( v ) is the part of P S \mathcal{P}_{S} P S containing v v v .
Claim 5.4. If b b b is adjacent to some a ∈ A a \in A a ∈ A in G G G then P S ( b ) ∩ D = ∅ \mathcal{P}_{S}(b) \cap D = \varnothing P S ( b ) ∩ D = ∅ .
Proof. The vertices in B ∩ P S ( b ) B \cap\mathcal{P}_{S}(b) B ∩ P S ( b ) have the same neighborhood on A A A as b b b . In particular, they are all adjacent to a a a , whereas D ⊆ B D \subseteq B D ⊆ B is anticomplete to A A A since Ball 1 G ( D ) = Ball r G ( C ) \operatorname{Ball}^{G}_{1}(D) = \operatorname{Ball}^{G}_{r}(C) Ball 1 G ( D ) = Ball r G ( C ) is disjoint from A A A by assumption. ◀
Claim 5.5 (P2 ). Ball r − 1 H ( C ) = D \operatorname{Ball}^{H}_{r-1}(C) = D Ball r − 1 H ( C ) = D .
Proof. The claim is trivially true for r = 1 r = 1 r = 1 , hence assume r ≥ 2 r \geq2 r ≥ 2 . Consider any a b ∈ E ( G ) ab \in E(G) ab ∈ E ( G ) with a ∈ A a \in A a ∈ A and b ∈ B b \in B b ∈ B witnessing a flipped pair of P S \mathcal{P}_{S} P S -parts P S ( a ) \mathcal{P}_{S}(a) P S ( a ) and P S ( b ) \mathcal{P}_{S}(b) P S ( b ) .
P S ( b ) \mathcal{P}_{S}(b) P S ( b ) is disjoint from Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) :
This is implied by Claim 5.4, because Ball r − 2 G ( C ) ⊆ Ball r − 1 G ( C ) = D \operatorname{Ball}^{G}_{r-2}(C) \subseteq\operatorname{Ball}^{G}_{r-1}(C) = D Ball r − 2 G ( C ) ⊆ Ball r − 1 G ( C ) = D .
P S ( a ) \mathcal{P}_{S}(a) P S ( a ) is disjoint from Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) :
Let Q ∈ B Q \in\mathcal{B} Q ∈ B contain b b b . Every vertex of Q Q Q is adjacent to a a a and hence lies in B − D B - D B − D . Thus, rep ( Q ) ∈ S \operatorname{rep}(Q) \in S rep ( Q ) ∈ S is adjacent to a a a and nonadjacent to every vertex of Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) . Hence, rep ( Q ) \operatorname{rep}(Q) rep ( Q ) witnesses that a a a is in a different P S \mathcal{P}_{S} P S -part than all the vertices in Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) .
This means that whenever two parts P S ( a ) \mathcal{P}_{S}(a) P S ( a ) and P S ( b ) \mathcal{P}_{S}(b) P S ( b ) are flipped, then neither of them intersects Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) . Hence, the vertices in Ball r − 2 G ( C ) \operatorname{Ball}^{G}_{r-2}(C) Ball r − 2 G ( C ) are incident to the same edges in H H H as in G G G , which gives the desired conclusion Ball r − 1 H ( C ) = Ball r − 1 G ( C ) \operatorname{Ball}^{H}_{r-1}(C) = \operatorname{Ball}^{G}_{r-1}(C) Ball r − 1 H ( C ) = Ball r − 1 G ( C ) . ◀
For brevity, we define B ‾ : = V ( G ) − B \overline{B} := V(G) - B B := V ( G ) − B .
Claim 5.6 (P3 ). D D D and B ‾ \overline{B} B are nonadjacent in H H H .
Proof. Otherwise, an edge d z ∈ E ( H ) dz \in E(H) d z ∈ E ( H ) with d ∈ D d \in D d ∈ D and z ∈ B ‾ z \in\overline{B} z ∈ B is witnessed by some a b ∈ E ( G ) ab \in E(G) ab ∈ E ( G ) with a ∈ A a \in A a ∈ A and b ∈ B b \in B b ∈ B (because D D D and B ‾ \overline{B} B are nonadjacent in G G G ). By Claim 5.4, the P S \mathcal{P}_{S} P S -part of b b b is disjoint from D D D , so necessarily d ∼ a d \sim a d ∼ a and z ∼ b z \sim b z ∼ b . Let X ∈ A X \in\mathcal{A} X ∈ A contain a a a . The vertex b b b is complete to X X X , whereas d d d is anticomplete to B ‾ \overline{B} B , contradicting ( † ) (\dagger) ( † ) for ( X , B ‾ ) (X,\overline{B}) ( X , B ) with ( x , y , x ′ , y ′ ) = ( a , z , d , b ) (x,y,x',y') = (a,z,d,b) ( x , y , x ′ , y ′ ) = ( a , z , d , b ) . ◀
As described above, establishing P1–P3 finishes the proof. ■
Extension to tuples
In this subsection we prove Theorem 5.2. Recall that for s ∈ N s \in\mathbb{N} s ∈ N , an s s s -flip of a graph G G G is a P \mathcal{P} P -flip of G G G for some partition P \mathcal{P} P of V ( G ) V(G) V ( G ) into at most s s s parts. For S ⊆ V ( G ) S \subseteq V(G) S ⊆ V ( G ) , the partition P S \mathcal{P}_{S} P S into atomic types over S S S has at most 3 ∣ S ∣ 3^{|S|} 3 ∣ S ∣ parts, so every s s s -definable flip is a 3 s 3^{s} 3 s -flip. The flip metric dist P \operatorname{dist}_{\mathcal{P}} dist P associated with a partition P \mathcal{P} P of V ( G ) V(G) V ( G ) is the maximum of dist H \operatorname{dist}_{H} dist H over all P \mathcal{P} P -flips H H H of G G G , and Ball r P ( v ) : = { u ∈ V ( G ) : dist P ( u , v ) ≤ r } \operatorname{Ball}^{\mathcal{P}}_{r}(v) := \{u \in V(G) : \operatorname{dist}_{\mathcal{P}}(u,v) \leq r\} Ball r P ( v ) := { u ∈ V ( G ) : dist P ( u , v ) ≤ r } denotes its balls. We use the same notation for the minimum distance between two tuples or sets.
Observation 5.15. If Q \mathcal{Q} Q refines P \mathcal{P} P , then every P \mathcal{P} P -flip is also a Q \mathcal{Q} Q -flip, and hence
dist Q ( u , v ) ≥ dist P ( u , v ) . \operatorname{dist}_{\mathcal{Q}}(u,v) \geq\operatorname{dist}_{\mathcal{P}}(u,v). dist Q ( u , v ) ≥ dist P ( u , v ) .
We use the following metric-conversion result.
Lemma 5.16 ([9 Lemma 8] ). Let G G G be a graph and let P \mathcal{P} P be a partition of V ( G ) V(G) V ( G ) . There is a refinement Q \mathcal{Q} Q of P \mathcal{P} P with ∣ Q ∣ ≤ ∣ P ∣ ⋅ 2 ∣ P ∣ |\mathcal{Q}| \leq|\mathcal{P}| \cdot2^{|\mathcal{P}|} ∣ Q ∣ ≤ ∣ P ∣ ⋅ 2 ∣ P ∣ and a Q \mathcal{Q} Q -flip H H H of G G G such that, for every v ∈ V ( G ) v \in V(G) v ∈ V ( G ) and r ∈ N r \in\mathbb{N} r ∈ N ,
Ball r H ( v ) ⊆ Ball 6 r P ( v ) . \operatorname{Ball}^{H}_{r}(v) \subseteq\operatorname{Ball}^{\mathcal{P}}_{6r}(v). Ball r H ( v ) ⊆ Ball 6 r P ( v ) .
We now combine the flips from the Closure Theorem (Theorem 5.1) for the individual entries of a tuple into a single flip.
Theorem 5.2 (Closure Theorem for Tuples). For every monadically dependent graph class C \mathcal{C} C , radius r ∈ N r \in\mathbb{N} r ∈ N , and tuple size k ∈ N k \in\mathbb{N} k ∈ N , there are some c , s ∈ N c,s \in\mathbb{N} c , s ∈ N with the following property. For every G ∈ C G \in\mathcal{C} G ∈ C and finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) there is a set H \mathcal{H} H of O C , r , k ( ∣ A ∣ c ) O_{\mathcal{C},r,k}(|A|^c) O C , r , k ( ∣ A ∣ c ) many s s s -flips of G G G such that for every tuple v ˉ ∈ ( V ( G ) − A ) k \bar{v} \in(V(G) - A)^k v ˉ ∈ ( V ( G ) − A ) k there is a flip H ∈ H H \in\mathcal{H} H ∈ H with
dist H ( v ˉ , A ) > r . \operatorname{dist}^{H}(\bar{v},A) > r. dist H ( v ˉ , A ) > r .
Proof. Let c 0 , s 0 ∈ N c_0,s_0 \in\mathbb{N} c 0 , s 0 ∈ N be given by Theorem 5.1 for C \mathcal{C} C and radius 6 r 6r 6 r . Fix G ∈ C G \in\mathcal{C} G ∈ C and a finite set A ⊆ V ( G ) A \subseteq V(G) A ⊆ V ( G ) , and let S S S and the sets S ( v ) S(v) S ( v ) for v ∉ A v \notin A v ∈ / A be as in Theorem 5.1. For a tuple v ˉ = ( v 1 , … , v k ) ∈ ( V ( G ) − A ) k \bar{v} = (v_1,\ldots,v_k) \in(V(G)-A)^k v ˉ = ( v 1 , … , v k ) ∈ ( V ( G ) − A ) k , put
S ( v ˉ ) : = S ( v 1 ) ∪ ⋯ ∪ S ( v k ) . S(\bar{v}) := S(v_1) \cup\cdots\cup S(v_k). S ( v ˉ ) := S ( v 1 ) ∪ ⋯ ∪ S ( v k ) .
Then S ( v ˉ ) ⊆ S S(\bar{v}) \subseteq S S ( v ˉ ) ⊆ S and ∣ S ( v ˉ ) ∣ ≤ k s 0 |S(\bar{v})| \leq ks_0 ∣ S ( v ˉ ) ∣ ≤ k s 0 . As P S ( v ˉ ) \mathcal{P}_{S(\bar{v})} P S ( v ˉ ) refines every P S ( v i ) \mathcal{P}_{S(v_i)} P S ( v i ) , Observation 5.15 gives
dist S ( v ˉ ) G ( v i , A ) ≥ dist S ( v i ) G ( v i , A ) > 6 r for every i ∈ [ k ] . (1) \operatorname{dist}^{G}_{S(\bar{v})}(v_i,A) \geq\operatorname{dist}^{G}_{S(v_i)}(v_i,A) > 6r \qquad\text{for every } i \in[k]. \tag*{(1)} dist S ( v ˉ ) G ( v i , A ) ≥ dist S ( v i ) G ( v i , A ) > 6 r for every i ∈ [ k ] . (1)
For every T ⊆ S T \subseteq S T ⊆ S with ∣ T ∣ ≤ k s 0 |T| \leq ks_0 ∣ T ∣ ≤ k s 0 , the partition P T \mathcal{P}_T P T has at most 3 k s 0 3^{ks_0} 3 k s 0 parts. So Lemma 5.16 yields an s s s -flip H T H_T H T of G G G , for some s ≤ O C , r , k ( 1 ) s \leq O_{\mathcal{C},r,k}(1) s ≤ O C , r , k ( 1 ) independent of T T T , such that
Ball r H T ( x ) ⊆ Ball 6 r T ( x ) for every x ∈ V ( G ) . \operatorname{Ball}^{H_T}_{r}(x) \subseteq\operatorname{Ball}^{T}_{6r}(x) \qquad\text{for every } x \in V(G). Ball r H T ( x ) ⊆ Ball 6 r T ( x ) for every x ∈ V ( G ) .
Let H : = { H T : T ⊆ S , ∣ T ∣ ≤ k s 0 } \mathcal{H} := \{H_T : T \subseteq S,\ |T| \leq ks_0\} H := { H T : T ⊆ S , ∣ T ∣ ≤ k s 0 } . Then ∣ H ∣ ≤ ( ∣ S ∣ + 1 ) k s 0 ≤ O C , r , k ( ∣ A ∣ c ) |\mathcal{H}| \leq(|S|+1)^{ks_0} \leq O_{\mathcal{C},r,k}(|A|^c) ∣ H ∣ ≤ ( ∣ S ∣ + 1 ) k s 0 ≤ O C , r , k ( ∣ A ∣ c ) for c : = c 0 k s 0 c := c_0ks_0 c := c 0 k s 0 . Finally, let v ˉ = ( v 1 , … , v k ) ∈ ( V ( G ) − A ) k \bar{v} = (v_1,\ldots,v_k) \in(V(G)-A)^k v ˉ = ( v 1 , … , v k ) ∈ ( V ( G ) − A ) k and H : = H S ( v ˉ ) ∈ H H := H_{S(\bar{v})} \in\mathcal{H} H := H S ( v ˉ ) ∈ H . For every i ∈ [ k ] i \in[k] i ∈ [ k ] , the ball Ball r H ( v i ) ⊆ Ball 6 r S ( v ˉ ) ( v i ) \operatorname{Ball}^{H}_{r}(v_i) \subseteq\operatorname{Ball}^{S(\bar{v})}_{6r}(v_i) Ball r H ( v i ) ⊆ Ball 6 r S ( v ˉ ) ( v i ) is disjoint from A A A by (1) . Thus dist H ( v ˉ , A ) > r \operatorname{dist}^{H}(\bar{v},A) > r dist H ( v ˉ , A ) > r . ■
Number of types over a set of parameters
In this section we prove Theorem 4.4, which bounds the number of types of k k k -tuples over a set U U U of parameters polynomially in ∣ U ∣ |U| ∣ U ∣ .
We use a consequence of locality of first-order logic, which bounds the number of types of tuples that are far from U U U . The following result is an adaptation of [53 Corollary 16] . We provide a self-contained proof in Section B.
Lemma 6.1. For every q , k , c ∈ N q,k,c \in\mathbb{N} q , k , c ∈ N there are numbers r = r ( q ) r=r(q) r = r ( q ) and T = T ( q , k , c ) T=T(q,k,c) T = T ( q , k , c ) with the following property. Let H H H be a graph expanded by at most c c c unary predicates, and let U ⊆ V ( H ) U \subseteq V(H) U ⊆ V ( H ) be finite. Fix a tuple u ˉ \bar{u} u ˉ of vertices of U U U of finite length. Let F : = { a ∈ V ( H ) : dist H ( a , U ) > r } F := \{a \in V(H) : \operatorname{dist}^{H}(a,U) > r\} F := { a ∈ V ( H ) : dist H ( a , U ) > r } . Then
∣ { tp q H ( a ˉ u ˉ / U ) : a ˉ ∈ F k } ∣ ≤ T ( q , k , c ) . \left|\left\{\operatorname{tp}^{H}_{q}(\bar{a}\bar{u}/U) : \bar{a} \in F^k\right\}\right| \leq T(q,k,c). { tp q H ( a ˉ u ˉ / U ) : a ˉ ∈ F k } ≤ T ( q , k , c ) .
We now prove Theorem 4.4 by combining Lemma 6.1 with the Closure Theorem for Tuples (Theorem 5.2).
Theorem 4.4. Let C \mathcal{C} C be a monadically dependent graph class and k , q , c ∈ N k,q,c \in\mathbb{N} k , q , c ∈ N . For every (possibly infinite) graph G ∈ C G \in\mathcal{C} G ∈ C , expansion G + G^{+} G + of G G G by c c c unary predicates, and finite subset U ⊆ V ( G ) U \subseteq V(G) U ⊆ V ( G ) ,
∣ Types q , k G + ( V ( G ) / U ) ∣ ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) . \left|\operatorname{Types}_{q,k}^{G^{+}}\left(V(G)/U\right)\right| \le O_{\mathcal{C},q,k,c}(1) \cdot\operatorname{poly}_{\mathcal{C},q,k}(|U|). Types q , k G + ( V ( G ) / U ) ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) . Proof. Fix G ∈ C G \in\mathcal{C} G ∈ C , its expansion G + G^{+} G + by c c c unary predicates, and a finite set U ⊆ V ( G ) U \subseteq V(G) U ⊆ V ( G ) . Let r = r ( q ) r=r(q) r = r ( q ) and T T T be given by Lemma 6.1, and put U ‾ : = V ( G ) − U \overline{U}:=V(G)-U U := V ( G ) − U . By the Closure Theorem for Tuples (Theorem 5.2) for C \mathcal{C} C , radius r r r , and k k k , there is some s ≤ O C , q , k ( 1 ) s \le O_{\mathcal{C},q,k}(1) s ≤ O C , q , k ( 1 ) and some set H \mathcal{H} H of poly C , q , k ( ∣ U ∣ ) \operatorname{poly}_{\mathcal{C},q,k}(|U|) poly C , q , k ( ∣ U ∣ ) many s s s -flips of G G G such that every v ‾ ∈ U ‾ k \overline{v} \in\overline{U}^{k} v ∈ U k has some H ( v ‾ ) ∈ H H(\overline{v}) \in\mathcal{H} H ( v ) ∈ H with dist H ( v ‾ ) ( v ‾ , U ) > r \operatorname{dist}_{H(\overline{v})}(\overline{v},U)>r dist H ( v ) ( v , U ) > r . Note that s s s and H \mathcal{H} H do not depend on the unary predicates of G + G^{+} G + . For each H ∈ H H \in\mathcal{H} H ∈ H , fix a partition Q H Q_{H} Q H of V ( G ) V(G) V ( G ) into at most s s s parts such that H H H is a Q H Q_{H} Q H -flip of G G G , and let H + H^{+} H + be the expansion of H H H by the c c c unary predicates of G + G^{+} G + and by at most s s s unary predicates marking the parts of Q H Q_{H} Q H . The edge relation of G G G is quantifier-free definable in H + H^{+} H + , by flipping back the pairs of parts that are flipped in H H H . Substituting this definition for every edge atom turns each formula over G + G^{+} G + with parameters from U U U into a formula over H + H^{+} H + with the same parameters and quantifier rank that is satisfied by the same tuples. Hence, for every H H H and tuple w ‾ \overline{w} w of vertices,
tp q G + ( w ‾ / U ) depends only on tp q H + ( w ‾ / U ) . \operatorname{tp}_{q}^{G^{+}}(\overline{w}/U) \text{ depends only on } \operatorname{tp}_{q}^{H^{+}}(\overline{w}/U). tp q G + ( w / U ) depends only on tp q H + ( w / U ) .
We want to bound the number of types of tuples v ‾ ∈ V ( G ) k \overline{v} \in V(G)^{k} v ∈ V ( G ) k over U U U . By padding and permuting 2 k 2k 2 k -tuples, up to a multiplicative factor of O k ( 1 ) O_{k}(1) O k ( 1 ) , it suffices to bound the number of types for the slightly longer tuples of the form a ‾ u ‾ \overline{a}\overline{u} a u with a ‾ ∈ U ‾ k \overline{a} \in\overline{U}^{k} a ∈ U k and u ‾ ∈ U k \overline{u} \in U^{k} u ∈ U k .
For H ∈ H H \in\mathcal{H} H ∈ H , let F H : = { w ∈ V ( G ) : dist H ( w , U ) > r } ⊆ U ‾ F_{H}:=\{w \in V(G):\operatorname{dist}_{H}(w,U)>r\}\subseteq\overline{U} F H := { w ∈ V ( G ) : dist H ( w , U ) > r } ⊆ U . As a ‾ ∈ U ‾ k \overline{a}\in\overline{U}^{k} a ∈ U k lies in F H ( a ‾ ) k F_{H(\overline{a})}^{k} F H ( a ) k for some H ( a ‾ ) ∈ H H(\overline{a})\in\mathcal{H} H ( a ) ∈ H , we have
{ tp q G + ( a ‾ u ‾ / U ) : a ‾ ∈ U ‾ k , u ‾ ∈ U k } = ⋃ H ∈ H ⋃ u ‾ ∈ U k { tp q G + ( a ‾ u ‾ / U ) : a ‾ ∈ F H k } . \left\{\operatorname{tp}_{q}^{G^{+}}(\overline{a}\overline{u}/U):\overline{a}\in\overline{U}^{k},\overline{u}\in U^{k}\right\}
=
\bigcup_{H\in\mathcal{H}}\ \bigcup_{\overline{u}\in U^{k}}
\left\{\operatorname{tp}_{q}^{G^{+}}(\overline{a}\overline{u}/U):\overline{a}\in F_{H}^{k}\right\}. { tp q G + ( a u / U ) : a ∈ U k , u ∈ U k } = H ∈ H ⋃ u ∈ U k ⋃ { tp q G + ( a u / U ) : a ∈ F H k } .
It remains to bound each of the ∣ H ∣ ⋅ ∣ U ∣ k |\mathcal{H}|\cdot|U|^{k} ∣ H ∣ ⋅ ∣ U ∣ k terms on the right. So fix H ∈ H H\in\mathcal{H} H ∈ H and u ‾ ∈ U k \overline{u}\in U^{k} u ∈ U k . As H + H^{+} H + has at most c + s c+s c + s unary predicates, Lemma 6.1, applied to H + H^{+} H + , U U U , and u ‾ \overline{u} u , gives
∣ { tp q H + ( a ‾ u ‾ / U ) : a ‾ ∈ F H k } ∣ ≤ T ( q , k , c + s ) . \left|\left\{\operatorname{tp}_{q}^{H^{+}}(\overline{a}\overline{u}/U):\overline{a}\in F_{H}^{k}\right\}\right|\le T(q,k,c+s). { tp q H + ( a u / U ) : a ∈ F H k } ≤ T ( q , k , c + s ) .
Since tp q G + ( a ‾ u ‾ / U ) \operatorname{tp}_{q}^{G^{+}}(\overline{a}\overline{u}/U) tp q G + ( a u / U ) depends only on tp q H + ( a ‾ u ‾ / U ) \operatorname{tp}_{q}^{H^{+}}(\overline{a}\overline{u}/U) tp q H + ( a u / U ) , the same bound holds with G + G^{+} G + in place of H + H^{+} H + . Hence,
∣ { tp q G + ( a ‾ u ‾ / U ) : a ‾ ∈ U ‾ k , u ‾ ∈ U k } ∣ ≤ ∣ H ∣ ⋅ ∣ U ∣ k ⋅ T ( q , k , c + s ) ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) , \left|\left\{\operatorname{tp}_{q}^{G^{+}}(\overline{a}\overline{u}/U):\overline{a}\in\overline{U}^{k},\overline{u}\in U^{k}\right\}\right|
\le|\mathcal{H}|\cdot|U|^{k}\cdot T(q,k,c+s)
\le O_{\mathcal{C},q,k,c}(1)\cdot\operatorname{poly}_{\mathcal{C},q,k}(|U|), { tp q G + ( a u / U ) : a ∈ U k , u ∈ U k } ≤ ∣ H ∣ ⋅ ∣ U ∣ k ⋅ T ( q , k , c + s ) ≤ O C , q , k , c ( 1 ) ⋅ poly C , q , k ( ∣ U ∣ ) ,
where we use T ( q , k , c + s ) ≤ O C , q , k , c ( 1 ) T(q,k,c+s)\le O_{\mathcal{C},q,k,c}(1) T ( q , k , c + s ) ≤ O C , q , k , c ( 1 ) , as s ≤ O C , q , k ( 1 ) s\le O_{\mathcal{C},q,k}(1) s ≤ O C , q , k ( 1 ) , and ∣ H ∣ ≤ poly C , q , k ( ∣ U ∣ ) |\mathcal{H}|\le\operatorname{poly}_{\mathcal{C},q,k}(|U|) ∣ H ∣ ≤ poly C , q , k ( ∣ U ∣ ) . ■
II Definable construction sequences
Recall the following definitions from § 5.1.2 .
Definition 4.5. Let G G G be a graph with vertex set V V V and let H H H be a partial graph with vertex set W ⊆ V W \subseteq V W ⊆ V . For q , c , w ∈ N q,c,w \in\mathbb{N} q , c , w ∈ N , we say that H H H is definable in G G G by formulas of quantifier rank q q q using c c c unary predicates and w w w parameters, if there is an expansion G + G^{+} G + of G G G by c c c unary predicates and a set S ⊆ V ( G ) S \subseteq V(G) S ⊆ V ( G ) of parameters with ∣ S ∣ ≤ w \lvert S\rvert\leq w ∣ S ∣ ≤ w , such that for every relation symbol Q Q Q of H H H (when viewed as a relational structure) of arity k k k there is some formula φ Q ( x 1 , … , x k ) \varphi_Q(x_1,\ldots,x_k) φ Q ( x 1 , … , x k ) of quantifier rank q q q with parameters from S S S such that
G + ⊨ φ Q ( v ˉ ) ⟺ v ˉ ∈ W k and H ⊨ Q ( v ˉ ) G^{+} \models\varphi_Q(\bar{v}) \quad\Longleftrightarrow\quad\bar{v} \in W^k \text{ and } H \models Q(\bar{v}) G + ⊨ φ Q ( v ˉ ) ⟺ v ˉ ∈ W k and H ⊨ Q ( v ˉ ) for all v ˉ ∈ V k \bar{v} \in V^k v ˉ ∈ V k .
Definition 4.6. Let G G G be a graph and r , c , s , q 0 ∈ N r,c,s,q_0 \in\mathbb{N} r , c , s , q 0 ∈ N . A construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ of G G G is radius-r r r definable with c c c unary predicates, s s s parameters, and quantifier rank q 0 q_0 q 0 if for all t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the induced partial graph
G t [ Ball r G t + 1 ( v ) ] G_t[\operatorname{Ball}_{r}^{G_{t+1}}(v)] G t [ Ball r G t + 1 ( v )] is definable in G G G by formulas of quantifier rank q 0 q_0 q 0 using c c c unary predicates and s s s parameters.
In this part, we establish the following main result.
Theorem 4.7. Let r ≥ 1 r \geq1 r ≥ 1 be an integer, ε > 0 \varepsilon> 0 ε > 0 be a rational, and C \mathcal{C} C be a monadically dependent graph class. There is a constant δ ≥ 1 \delta\geq1 δ ≥ 1 depending only on C \mathcal{C} C such that every n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C has a construction sequence of G G G which is radius-r r r definable with O ( r / ε ) O(r/\varepsilon) O ( r / ε ) unary predicates, O C , r , ε ( n δ ε ) O_{\mathcal{C},r,\varepsilon}(n^{\delta\varepsilon}) O C , r , ε ( n δ ε ) parameters, and quantifier rank 7 7 7 , and has length O C , r , ε ( n 1 + δ ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\delta\varepsilon}) O C , r , ε ( n 1 + δ ε ) . Moreover, there is an algorithm (independent of C \mathcal{C} C ) which, given r r r , ε \varepsilon ε , and G G G , computes such a sequence, and runs in time O C , r , ε ( n 3 ) O_{\mathcal{C},r,\varepsilon}(n^3) O C , r , ε ( n 3 ) whenever G ∈ C G \in\mathcal{C} G ∈ C .
We will use the following variation on the definition of merge-width, originating in [23 ] .
Definition 6.2. A chain in a graph G G G is a decreasing sequence V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ V(G)=S_1 \supseteq\cdots\supseteq S_\ell=\varnothing V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ of vertex sets. Its radius-r r r width, for r ∈ N r \in\mathbb{N} r ∈ N , is defined as
max 2 ≤ i ≤ ℓ max v ∈ V ( G ) ∣ ATypes G ( Ball r S i ( v ) / S i − 1 ) ∣ = max 2 ≤ i ≤ ℓ max v ∈ V ( G ) ∣ Ball r S i ( v ) / P S i − 1 ∣ . \max_{2\leq i\leq\ell}\max_{v\in V(G)}\left|\operatorname{ATypes}^{G}\left(\operatorname{Ball}^{S_i}_{r}(v)/S_{i-1}\right)\right|
=
\max_{2\leq i\leq\ell}\max_{v\in V(G)}\left|\operatorname{Ball}^{S_i}_{r}(v)/\mathcal{P}_{S_{i-1}}\right|. 2 ≤ i ≤ ℓ max v ∈ V ( G ) max ATypes G ( Ball r S i ( v ) / S i − 1 ) = 2 ≤ i ≤ ℓ max v ∈ V ( G ) max Ball r S i ( v ) / P S i − 1 . where Ball r S ( v ) \operatorname{Ball}^{S}_{r}(v) Ball r S ( v ) is defined above via S S S -flips and P S \mathcal{P}_{S} P S is the partition into atomic types over S S S .
The offset between S i − 1 S_{i-1} S i − 1 and S i S_i S i in the definition of the radius-r r r width ensures that the definition is robust. For instance, a chain can be completed into one in which two consecutive sets differ by one element, by removing the elements of S i − 1 S_{i-1} S i − 1 one by one in any order, until S i S_i S i is reached; this transformation preserves the width parameters.
Chains can be converted to construction sequences and vice versa, with a loss in the radius-r r r width. Intuitively, a chain gives rise to a sequence of ever coarser partitions P S 1 ⪯ P S 2 ⪯ ⋯ ⪯ P S ℓ \mathcal{P}_{S_1} \preceq\mathcal{P}_{S_2} \preceq\cdots\preceq\mathcal{P}_{S_\ell} P S 1 ⪯ P S 2 ⪯ ⋯ ⪯ P S ℓ , which can then be converted into a sequence of partial graphs (see [23 ] for details).
We use the following key result from [27 ] . It says that in monadically dependent classes, chains of constant length and small width can be computed efficiently.
Theorem 6.3 ([27 ] , Theorem 4.4). There is an algorithm which, given an n n n -vertex graph G G G , radius r ∈ N r \in\mathbb{N} r ∈ N , and rational ε > 0 \varepsilon> 0 ε > 0 , computes a chain of G G G of length O ( r / ε ) O(r/\varepsilon) O ( r / ε ) and radius-r r r width O C , r ( n ε ) O_{\mathcal{C},r}(n^\varepsilon) O C , r ( n ε ) , and runs in time O C , r ( n 3 ) O_{\mathcal{C},r}(n^3) O C , r ( n 3 ) , where C \mathcal{C} C is any monadically dependent graph class containing G G G .
To prove Theorem 4.7, we turn these chains into construction sequences using the following main technical contribution of this part.
Lemma 6.4. For every n n n -vertex graph G G G and its chain of length ℓ \ell ℓ there is a construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ of G G G such that the following properties hold for all r ≥ 1 r \ge1 r ≥ 1 . Let k r k_r k r denote the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the chain and w r : = k r ⋅ π G ( k r ) w_r := k_r \cdot\pi_G(k_r) w r := k r ⋅ π G ( k r ) .
The resulting construction sequence has radius-r r r width at most w r w_r w r and length λ ≤ O ( n w 1 ) \lambda\le O(nw_1) λ ≤ O ( n w 1 ) .
For every t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the induced partial graph
G t [ Ball r G t + 1 ( v ) ] G_t[\operatorname{Ball}_{r}^{G_{t+1}}(v)] G t [ Ball r G t + 1 ( v )] is definable in some expansion of G G G with 2 ℓ + 1 2\ell+1 2 ℓ + 1 unary predicates, using formulas of quantifier rank 7 7 7 with w r w_r w r parameters.
The construction sequence can be computed in time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) , given G G G and its chain.
Proof of Theorem 4.7. Let C \mathcal{C} C be a monadically dependent graph class containing G G G , and let d d d be an upper bound on the VC-dimension of graphs in C \mathcal{C} C , which exists by Observation 3.2 . We apply Theorem 6.3 with radius 5 r + 1 5r+1 5 r + 1 and ε \varepsilon ε . This computes a chain of length ℓ ≤ O ( ( 5 r + 1 ) / ε ) = O ( r / ε ) \ell\le O((5r+1)/\varepsilon)=O(r/\varepsilon) ℓ ≤ O (( 5 r + 1 ) / ε ) = O ( r / ε ) in time O ^ C , r ( n 3 ) \widehat{O}_{\mathcal{C},r}(n^3) O C , r ( n 3 ) . We then apply Lemma 6.4 to G G G and this chain, which takes time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) . So the total running time is
O ^ C , r ( n 3 ) + O ( ℓ n 3 ) = O ^ C , r , ε ( n 3 ) . \widehat{O}_{\mathcal{C},r}(n^3)+O(\ell n^3)=\widehat{O}_{\mathcal{C},r,\varepsilon}(n^3). O C , r ( n 3 ) + O ( ℓ n 3 ) = O C , r , ε ( n 3 ) .
The chain has radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width
k r ≤ O C , r , ε ( n ε ) , k_r \le O_{\mathcal{C},r,\varepsilon}(n^\varepsilon), k r ≤ O C , r , ε ( n ε ) ,
and π G ( k r ) ≤ ( k r + 1 ) d \pi_G(k_r)\le(k_r+1)^d π G ( k r ) ≤ ( k r + 1 ) d by the Sauer–Shelah lemma (Lemma 3.1 ), so
w r = k r ⋅ π G ( k r ) ≤ ( k r + 1 ) d + 1 ≤ O C , r , ε ( n ( d + 1 ) ε ) . w_r=k_r\cdot\pi_G(k_r)\le(k_r+1)^{d+1}\le O_{\mathcal{C},r,\varepsilon}(n^{(d+1)\varepsilon}). w r = k r ⋅ π G ( k r ) ≤ ( k r + 1 ) d + 1 ≤ O C , r , ε ( n ( d + 1 ) ε ) .
We set δ : = d + 1 \delta:=d+1 δ := d + 1 . The sequence is radius-r r r definable with 2 ℓ + 1 ≤ O ( r / ε ) 2\ell+1\le O(r/\varepsilon) 2 ℓ + 1 ≤ O ( r / ε ) unary predicates, w r w_r w r parameters, and rank 7 7 7 . As k 1 ≤ k r k_1\le k_r k 1 ≤ k r , it has length O ( n w 1 ) ≤ O ( n w r ) ≤ O C , r , ε ( n 1 + δ ε ) O(nw_1)\le O(nw_r)\le O_{\mathcal{C},r,\varepsilon}(n^{1+\delta\varepsilon}) O ( n w 1 ) ≤ O ( n w r ) ≤ O C , r , ε ( n 1 + δ ε ) . ■
Proof strategy for Lemma 6.4 The proof of Lemma 6.4 occupies the remainder of Part II. It combines constructions from [23 ] and [29 ] , together with a careful analysis of definability. We revisit several variants of merge-width studied in those papers. In particular, we use the following variation of the definition of merge-width.
Definition 6.5. A merge sequence of a graph G G G is a sequence ( P 1 , R 1 ) , … , ( P ℓ , R ℓ ) (\mathcal{P}_1,\mathcal{R}_1),\ldots,(\mathcal{P}_\ell,\mathcal{R}_\ell) ( P 1 , R 1 ) , … , ( P ℓ , R ℓ ) such that:
P 1 \mathcal{P}_1 P 1 is the partition into singletons and P ℓ = { V ( G ) } \mathcal{P}_\ell=\{V(G)\} P ℓ = { V ( G )} ,
P 1 ⪯ ⋯ ⪯ P ℓ \mathcal{P}_1\preceq\cdots\preceq\mathcal{P}_\ell P 1 ⪯ ⋯ ⪯ P ℓ ,
R 1 ⊆ ⋯ ⊆ R ℓ ⊆ ( V ( G ) 2 ) \mathcal{R}_1\subseteq\cdots\subseteq\mathcal{R}_\ell\subseteq\binom{V(G)}{2} R 1 ⊆ ⋯ ⊆ R ℓ ⊆ ( 2 V ( G ) ) ,
for every i ∈ [ ℓ ] i\in[\ell] i ∈ [ ℓ ] and X , Y ∈ P i X,Y\in\mathcal{P}_i X , Y ∈ P i , the set X Y − R i XY-\mathcal{R}_i X Y − R i is contained in either E ( G ) E(G) E ( G ) or in E ( G ‾ ) E(\overline{G}) E ( G ) , that is, the pair X , Y X,Y X , Y is homogeneous once pairs in R i \mathcal{R}_i R i are ignored.
The radius-r r r width of a merge sequence as above is
max 2 ≤ i ≤ ℓ max v ∈ V ( G ) ∣ Ball r R i ( v ) / P i − 1 ∣ . (2) \max_{2\le i\le\ell}\max_{v\in V(G)}\left|\operatorname{Ball}_{r}^{\mathcal{R}_i}(v)/\mathcal{P}_{i-1}\right|. \tag*{(2)} 2 ≤ i ≤ ℓ max v ∈ V ( G ) max Ball r R i ( v ) / P i − 1 . (2) Here the offset in the indices of R i \mathcal{R}_i R i and P i − 1 \mathcal{P}_{i-1} P i − 1 is intentional. Every construction sequence naturally induces a merge sequence of the same radius-r r r width for all r ∈ N r\in\mathbb{N} r ∈ N , and vice versa (see [30 , 29 ] for details).
Merge-width with definable stages
In this section, we prove the following lemma.
Lemma 7.1. For every graph G G G and chain of length ℓ \ell ℓ there is a merge sequence ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) (Q_1,R_1),\ldots,(Q_\ell,R_\ell) ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) with the following properties.
For all r ≥ 1 r \ge1 r ≥ 1 , the radius-r r r width of the merge sequence is bounded by k ⋅ π G ( k ) k \cdot\pi_G(k) k ⋅ π G ( k ) , where k k k is the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the given chain.
For each i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] , the relations ≡ Q i \equiv_{Q_i} ≡ Q i and R i R_i R i are definable in some expansion G ′ G' G ′ of G G G with two unary predicates, using two fixed first-order formulas φ ≡ ( x , y ) \varphi_{\equiv}(x,y) φ ≡ ( x , y ) and φ R ( x , y ) \varphi_R(x,y) φ R ( x , y ) of quantifier rank at most 5.
The merge sequence can be computed in time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) , given G G G and its chain.
Preliminaries
The proof of Lemma 7.1 uses ideas developed in [23 ] . We first recall the required notions and lemmas from that paper.
Lemma 7.2 (folklore). For every graph G G G , at least one of G G G and G ‾ \overline{G} G has diameter at most 3.
Proof. Suppose G G G has diameter greater than 2. Then there are non-adjacent vertices u , v u,v u , v with no common neighbor in G G G . In G ‾ \overline{G} G , u v uv uv is an edge and all vertices are neighbors of either u u u or v v v . Thus G ‾ \overline{G} G has diameter at most 3. ■
If B B B is a bipartite graph with parts X , Y X,Y X , Y and edge set E E E , its bipartite complement , denoted B ‾ \overline{B} B , is the bipartite graph with parts X , Y X,Y X , Y and edge set X Y − E XY-E X Y − E .
Lemma 7.3 ([23 Lemma A.3] ). Let B = ( X , Y , E ) B=(X,Y,E) B = ( X , Y , E ) be a bipartite graph with bipartite complement B ‾ \overline{B} B , and pick arbitrary vertices x ∈ X x \in X x ∈ X , y ∈ Y y \in Y y ∈ Y . Partition X X X according to adjacency to y y y , i.e. X=X_+ \mathbin{\mathaccent\cdot\cup} X_- with X + = N ( y ) X_+=N(y) X + = N ( y ) and X − = X − N ( y ) X_-=X-N(y) X − = X − N ( y ) , and similarly Y=Y_+ \mathbin{\mathaccent\cdot\cup} Y_- according to x x x . Then there is a bipartite graph B ′ = ( X , Y , E ′ ) B'=(X,Y,E') B ′ = ( X , Y , E ′ ) obtained from B B B by some { X + , X − , Y + , Y − } \{X_+,X_-,Y_+,Y_-\} { X + , X − , Y + , Y − } -flip satisfying:
for all u v ∈ E ′ , dist B ( u , v ) ≤ 5 and dist B ‾ ( u , v ) ≤ 5. \text{for all }uv \in E',\quad\operatorname{dist}^{B}(u,v) \le5 \quad\text{and}\quad\operatorname{dist}^{\overline{B}}(u,v) \le5. for all uv ∈ E ′ , dist B ( u , v ) ≤ 5 and dist B ( u , v ) ≤ 5. Note that [23 Lemma A.3] states the above lemma with 6 instead of 5; however, the two statements are equivalent, since if u v ∈ E ′ uv \in E' uv ∈ E ′ then u u u and v v v lie in opposite parts of the bipartite graphs B ′ B' B ′ , B B B , and B ‾ \overline{B} B , and thus dist ( u , v ) ≤ 6 \operatorname{dist}(u,v) \le6 dist ( u , v ) ≤ 6 is equivalent to dist ( u , v ) ≤ 5 \operatorname{dist}(u,v) \le5 dist ( u , v ) ≤ 5 for parity reasons.
Definition 7.4. Fix a graph G G G and a partition P \mathcal{P} P of V ( G ) V(G) V ( G ) . We define P ∧ T \mathcal{P} \wedge T P ∧ T to be the refinement of P \mathcal{P} P where each part P ∈ P P \in\mathcal{P} P ∈ P is split into atomic types over T − P T-P T − P (i.e. into sets of the form P ∩ Q P \cap Q P ∩ Q , where Q Q Q is the set of all vertices of G G G with a given neighborhood in T − P T-P T − P ).
In this definition, we choose not to divide a part P P P into types over T ∩ P T \cap P T ∩ P . This is for technical convenience only, to ensure that P ∧ T = P \mathcal{P} \wedge T=\mathcal{P} P ∧ T = P whenever P \mathcal{P} P is the partition with only one part.
Lemma 7.5 ([23 Corollary 5.4] ). Let G G G be a graph, P ⪯ Q \mathcal{P} \preceq\mathcal{Q} P ⪯ Q partitions of V ( G ) V(G) V ( G ) , and T T T a transversal of P \mathcal{P} P . Suppose ∣ Ball r + 1 Q ( v ) / P ∣ ≤ k \lvert\operatorname{Ball}^{\mathcal{Q}}_{r+1}(v)/\mathcal{P}\rvert\le k ∣ Ball r + 1 Q ( v ) / P ∣ ≤ k for every v ∈ V ( G ) v \in V(G) v ∈ V ( G ) . Then for every v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , we have
∣ Ball r Q ( v ) / ( P ∧ T ) ∣ ≤ k ⋅ π G ( k ) . \left\lvert\operatorname{Ball}^{\mathcal{Q}}_r(v)/(\mathcal{P}\wedge T)\right\rvert\le k\cdot\pi_G(k). Ball r Q ( v ) / ( P ∧ T ) ≤ k ⋅ π G ( k ) .
Constructing the merge sequence
Recall that for a graph G G G and disjoint vertex sets X , Y ⊆ V ( G ) X,Y \subseteq V(G) X , Y ⊆ V ( G ) , by G [ X , Y ] G[X,Y] G [ X , Y ] we denote the bipartite graph with parts X X X and Y Y Y , and edges connecting pairs of vertices which are adjacent in G G G . Furthermore, G [ X , X ] G[X,X] G [ X , X ] denotes the bipartite graph whose parts are two copies of X X X , and edges connect two vertices in opposite parts if the corresponding vertices in G G G are either adjacent or equal. We call the edges of G [ X , X ] G[X,X] G [ X , X ] connecting the two copies of each vertex in X X X diagonal edges . Thus, G ‾ [ X , X ] \overline{G}[X,X] G [ X , X ] is the bipartite complement G [ X , X ] ‾ \overline{G[X,X]} G [ X , X ] of G [ X , X ] G[X,X] G [ X , X ] extended additionally with the diagonal edges.
Definition 7.6. Let G G G be a graph and P \mathcal{P} P a partition of V = V ( G ) V=V(G) V = V ( G ) . Define R = R ( G , P ) ⊆ ( V 2 ) R=R(G,\mathcal{P})\subseteq\binom{V}{2} R = R ( G , P ) ⊆ ( 2 V ) so that for all parts X , Y ∈ P X,Y\in\mathcal{P} X , Y ∈ P (possibly X = Y X=Y X = Y ) and pairs u v uv uv with u ∈ X u\in X u ∈ X , v ∈ Y v\in Y v ∈ Y , and u ≠ v u\ne v u = v , we have u v ∈ R uv\in R uv ∈ R if and only if
dist G [ X , Y ] ( u , v ) ≤ 5 and dist G ‾ [ X , Y ] ( u , v ) ≤ 5. \operatorname{dist}_{G[X,Y]}(u,v)\le5\quad\text{and}\quad\operatorname{dist}_{\overline{G}[X,Y]}(u,v)\le5. dist G [ X , Y ] ( u , v ) ≤ 5 and dist G [ X , Y ] ( u , v ) ≤ 5.
We first describe the construction of the merge sequence that underlies the proof of Lemma 7.1. Consider a graph G G G and its chain V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ V(G)=S_1\supseteq\cdots\supseteq S_\ell=\varnothing V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ . Let P i \mathcal{P}_i P i be the partition into atomic types over S i S_i S i . Fix an arbitrary linear order < < < on V ( G ) V(G) V ( G ) giving rise to representative sets T i : = { min < P : P ∈ P i } T_i:=\{\min_{<}P:P\in\mathcal{P}_i\} T i := { min < P : P ∈ P i } . Then T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ T_1\supseteq T_2\supseteq\cdots\supseteq T_\ell T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ . For i = 1 , … , ℓ i=1,\ldots,\ell i = 1 , … , ℓ define
R i : = R ( G , P i ) and Q i : = P i ∧ T i . R_i:=R(G,\mathcal{P}_i)\qquad\text{and}\qquad Q_i:=\mathcal{P}_i\wedge T_i. R i := R ( G , P i ) and Q i := P i ∧ T i .
The following lemmas establish that
( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) (Q_1,R_1),\ldots,(Q_\ell,R_\ell) ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ )
is a merge sequence satisfying the conditions stated in Lemma 7.1.
Lemma 7.7. Suppose G G G is a graph and P \mathcal{P} P is the partition of V ( G ) V(G) V ( G ) into atomic types over some set S ⊆ V ( G ) S\subseteq V(G) S ⊆ V ( G ) . Then the relation R : = R ( G , P ) R:=R(G,\mathcal{P}) R := R ( G , P ) is definable in G G G expanded with one unary predicate marking S S S , using a fixed first-order formula φ R ( x , y ) \varphi_R(x,y) φ R ( x , y ) of quantifier rank at most 5.
Proof. The following formula θ S ( x , y ) \theta_S(x,y) θ S ( x , y ) , using a unary predicate marking S S S and with one quantifier, defines the equivalence relation ≡ P \equiv_{\mathcal{P}} ≡ P :
θ S ( x , y ) : = x = y ∨ ( ¬ S ( x ) ∧ ¬ S ( y ) ∧ ∀ z ( S ( z ) → ( E ( x , z ) ↔ E ( y , z ) ) ) ) . (3) \theta_S(x,y):=x=y\vee\left(\neg S(x)\wedge\neg S(y)\wedge\forall z\left(S(z)\to\left(E(x,z)\leftrightarrow E(y,z)\right)\right)\right). \tag*{(3)} θ S ( x , y ) := x = y ∨ ( ¬ S ( x ) ∧ ¬ S ( y ) ∧ ∀ z ( S ( z ) → ( E ( x , z ) ↔ E ( y , z ) ) ) ) . (3)
The following formula η S ( x , y ; a , b ) \eta_S(x,y;a,b) η S ( x , y ; a , b ) says that x x x and y y y are in opposite parts of the bipartite graph G [ X , Y ] G[X,Y] G [ X , Y ] , where X X X and Y Y Y are the parts of P \mathcal{P} P containing a a a and b b b :
η S ( x , y ; a , b ) : = ( θ S ( x , a ) ∧ θ S ( y , b ) ) ∨ ( θ S ( y , a ) ∧ θ S ( x , b ) ) . \eta_S(x,y;a,b):=\left(\theta_S(x,a)\wedge\theta_S(y,b)\right)\vee\left(\theta_S(y,a)\wedge\theta_S(x,b)\right). η S ( x , y ; a , b ) := ( θ S ( x , a ) ∧ θ S ( y , b ) ) ∨ ( θ S ( y , a ) ∧ θ S ( x , b ) ) .
The following formulas e S + ( x , y ; a , b ) e_S^+(x,y;a,b) e S + ( x , y ; a , b ) and e S − ( x , y ; a , b ) e_S^-(x,y;a,b) e S − ( x , y ; a , b ) say that x x x and y y y are adjacent in the bipartite graph G [ X , Y ] G[X,Y] G [ X , Y ] or G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] , respectively, where X X X and Y Y Y are the parts of P \mathcal{P} P containing a a a and b b b :
e S + ( x , y ; a , b ) : = η S ( x , y ; a , b ) ∧ ( x = y ∨ E ( x , y ) ) , e_S^+(x,y;a,b):=\eta_S(x,y;a,b)\wedge\left(x=y\vee E(x,y)\right), e S + ( x , y ; a , b ) := η S ( x , y ; a , b ) ∧ ( x = y ∨ E ( x , y ) ) ,
e S − ( x , y ; a , b ) : = η S ( x , y ; a , b ) ∧ ( x = y ∨ ¬ E ( x , y ) ) . e_S^-(x,y;a,b):=\eta_S(x,y;a,b)\wedge\left(x=y\vee\neg E(x,y)\right). e S − ( x , y ; a , b ) := η S ( x , y ; a , b ) ∧ ( x = y ∨ ¬ E ( x , y ) ) .
For σ ∈ { + , − } \sigma\in\{+,-\} σ ∈ { + , − } , define
ρ S σ ( x , y ) : = ⋁ p ∈ { 1 , 3 , 5 } ∃ z 1 ⋯ ∃ z p − 1 ⋀ i = 0 p − 1 e S σ ( z i , z i + 1 ; x , y ) , \rho_S^\sigma(x,y):=\bigvee_{p\in\{1,3,5\}}\exists z_1\cdots\exists z_{p-1}\bigwedge_{i=0}^{p-1}e_S^\sigma(z_i,z_{i+1};x,y), ρ S σ ( x , y ) := p ∈ { 1 , 3 , 5 } ⋁ ∃ z 1 ⋯ ∃ z p − 1 i = 0 ⋀ p − 1 e S σ ( z i , z i + 1 ; x , y ) ,
@ page 33/65 starts_mid=0 ends_mid=1
Constructing the merge sequence
Recall that for a graph G G G and disjoint vertex sets X , Y ⊆ V ( G ) X,Y \subseteq V(G) X , Y ⊆ V ( G ) , by G [ X , Y ] G[X,Y] G [ X , Y ] we denote the bipartite graph with parts X X X and Y Y Y , and edges connecting pairs of vertices which are adjacent in G G G . Furthermore, G [ X , X ] G[X,X] G [ X , X ] denotes the bipartite graph whose parts are two copies of X X X , and edges connect two vertices in opposite parts if the corresponding vertices in G G G are either adjacent or equal. We call the edges of G [ X , X ] G[X,X] G [ X , X ] connecting the two copies of each vertex in X X X diagonal edges . Thus, G ‾ [ X , X ] \overline{G}[X,X] G [ X , X ] is the bipartite complement G [ X , X ] ‾ \overline{G[X,X]} G [ X , X ] of G [ X , X ] G[X,X] G [ X , X ] extended additionally with the diagonal edges.
Definition 7.6. Let G G G be a graph and P \mathcal{P} P a partition of V = V ( G ) V=V(G) V = V ( G ) . Define R = R ( G , P ) ⊆ ( V 2 ) R=R(G,\mathcal{P})\subseteq\binom{V}{2} R = R ( G , P ) ⊆ ( 2 V ) so that for all parts X , Y ∈ P X,Y\in\mathcal{P} X , Y ∈ P (possibly X = Y X=Y X = Y ) and pairs u v uv uv with u ∈ X u\in X u ∈ X , v ∈ Y v\in Y v ∈ Y , and u ≠ v u\ne v u = v , we have u v ∈ R uv\in R uv ∈ R if and only if
dist G [ X , Y ] ( u , v ) ≤ 5 and dist G ‾ [ X , Y ] ( u , v ) ≤ 5. \operatorname{dist}_{G[X,Y]}(u,v)\le5\quad\text{and}\quad\operatorname{dist}_{\overline{G}[X,Y]}(u,v)\le5. dist G [ X , Y ] ( u , v ) ≤ 5 and dist G [ X , Y ] ( u , v ) ≤ 5.
We first describe the construction of the merge sequence that underlies the proof of Lemma 7.1. Consider a graph G G G and its chain V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ V(G)=S_1\supseteq\cdots\supseteq S_\ell=\varnothing V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ . Let P i \mathcal{P}_i P i be the partition into atomic types over S i S_i S i . Fix an arbitrary linear order < < < on V ( G ) V(G) V ( G ) giving rise to representative sets T i : = { min < P : P ∈ P i } T_i:=\{\min_{<}P:P\in\mathcal{P}_i\} T i := { min < P : P ∈ P i } . Then T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ T_1\supseteq T_2\supseteq\cdots\supseteq T_\ell T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ . For i = 1 , … , ℓ i=1,\ldots,\ell i = 1 , … , ℓ define
R i : = R ( G , P i ) and Q i : = P i ∧ T i . R_i:=R(G,\mathcal{P}_i)\qquad\text{and}\qquad Q_i:=\mathcal{P}_i\wedge T_i. R i := R ( G , P i ) and Q i := P i ∧ T i .
The following lemmas establish that
( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) (Q_1,R_1),\ldots,(Q_\ell,R_\ell) ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ )
is a merge sequence satisfying the conditions stated in Lemma 7.1.
Lemma 7.7. Suppose G G G is a graph and P \mathcal{P} P is the partition of V ( G ) V(G) V ( G ) into atomic types over some set S ⊆ V ( G ) S\subseteq V(G) S ⊆ V ( G ) . Then the relation R : = R ( G , P ) R:=R(G,\mathcal{P}) R := R ( G , P ) is definable in G G G expanded with one unary predicate marking S S S , using a fixed first-order formula φ R ( x , y ) \varphi_R(x,y) φ R ( x , y ) of quantifier rank at most 5.
Proof. The following formula θ S ( x , y ) \theta_S(x,y) θ S ( x , y ) , using a unary predicate marking S S S and with one quantifier, defines the equivalence relation ≡ P \equiv_{\mathcal{P}} ≡ P :
θ S ( x , y ) : = x = y ∨ ( ¬ S ( x ) ∧ ¬ S ( y ) ∧ ∀ z ( S ( z ) → ( E ( x , z ) ↔ E ( y , z ) ) ) ) . (4) \theta_S(x,y):=x=y\vee\left(\neg S(x)\wedge\neg S(y)\wedge\forall z\left(S(z)\to\left(E(x,z)\leftrightarrow E(y,z)\right)\right)\right). \tag*{(4)} θ S ( x , y ) := x = y ∨ ( ¬ S ( x ) ∧ ¬ S ( y ) ∧ ∀ z ( S ( z ) → ( E ( x , z ) ↔ E ( y , z ) ) ) ) . (4)
The following formula η S ( x , y ; a , b ) \eta_S(x,y;a,b) η S ( x , y ; a , b ) says that x x x and y y y are in opposite parts of the bipartite graph G [ X , Y ] G[X,Y] G [ X , Y ] , where X X X and Y Y Y are the parts of P \mathcal{P} P containing a a a and b b b :
η S ( x , y ; a , b ) : = ( θ S ( x , a ) ∧ θ S ( y , b ) ) ∨ ( θ S ( y , a ) ∧ θ S ( x , b ) ) . \eta_S(x,y;a,b):=\left(\theta_S(x,a)\wedge\theta_S(y,b)\right)\vee\left(\theta_S(y,a)\wedge\theta_S(x,b)\right). η S ( x , y ; a , b ) := ( θ S ( x , a ) ∧ θ S ( y , b ) ) ∨ ( θ S ( y , a ) ∧ θ S ( x , b ) ) .
The following formulas e S + ( x , y ; a , b ) e_S^+(x,y;a,b) e S + ( x , y ; a , b ) and e S − ( x , y ; a , b ) e_S^-(x,y;a,b) e S − ( x , y ; a , b ) say that x x x and y y y are adjacent in the bipartite graph G [ X , Y ] G[X,Y] G [ X , Y ] or G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] , respectively, where X X X and Y Y Y are the parts of P \mathcal{P} P containing a a a and b b b :
e S + ( x , y ; a , b ) : = η S ( x , y ; a , b ) ∧ ( x = y ∨ E ( x , y ) ) , e_S^+(x,y;a,b):=\eta_S(x,y;a,b)\wedge\left(x=y\vee E(x,y)\right), e S + ( x , y ; a , b ) := η S ( x , y ; a , b ) ∧ ( x = y ∨ E ( x , y ) ) ,
e S − ( x , y ; a , b ) : = η S ( x , y ; a , b ) ∧ ( x = y ∨ ¬ E ( x , y ) ) . e_S^-(x,y;a,b):=\eta_S(x,y;a,b)\wedge\left(x=y\vee\neg E(x,y)\right). e S − ( x , y ; a , b ) := η S ( x , y ; a , b ) ∧ ( x = y ∨ ¬ E ( x , y ) ) .
For σ ∈ { + , − } \sigma\in\{+,-\} σ ∈ { + , − } , define
ρ S σ ( x , y ) : = ⋁ p ∈ { 1 , 3 , 5 } ∃ z 1 ⋯ ∃ z p − 1 ⋀ i = 0 p − 1 e S σ ( z i , z i + 1 ; x , y ) , \rho_S^\sigma(x,y):=\bigvee_{p\in\{1,3,5\}}\exists z_1\cdots\exists z_{p-1}\bigwedge_{i=0}^{p-1}e_S^\sigma(z_i,z_{i+1};x,y), ρ S σ ( x , y ) := p ∈ { 1 , 3 , 5 } ⋁ ∃ z 1 ⋯ ∃ z p − 1 i = 0 ⋀ p − 1 e S σ ( z i , z i + 1 ; x , y ) ,
where z 0 : = x z_0 := x z 0 := x and z p : = y z_p := y z p := y . This formula expresses the existence of a walk of length 1, 3, or 5 between opposite copies of x x x and y y y in G [ X , Y ] G[X,Y] G [ X , Y ] for σ = + \sigma= + σ = + , and in G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] for σ = − \sigma= - σ = − , where X : = P ( x ) X := \mathcal{P}(x) X := P ( x ) and Y : = P ( y ) Y := \mathcal{P}(y) Y := P ( y ) . Each step switches sides, also when X = Y X = Y X = Y ; an equality step uses a diagonal edge. Since every path between opposite sides of a bipartite graph has odd length, these formulas express precisely the two distance bounds defining R R R . Consequently,
φ R ( x , y ) : = x ≠ y ∧ ρ S + ( x , y ) ∧ ρ S − ( x , y ) \varphi_R(x,y) := x \ne y \land\rho_S^+(x,y) \land\rho_S^-(x,y) φ R ( x , y ) := x = y ∧ ρ S + ( x , y ) ∧ ρ S − ( x , y )
defines R ( G , P ) R(G,\mathcal{P}) R ( G , P ) . Each e S σ e_S^\sigma e S σ has quantifier rank 1, and each disjunct in ρ S σ \rho_S^\sigma ρ S σ quantifies at most four intermediate vertices. Thus φ R \varphi_R φ R is a fixed first-order formula of quantifier rank at most 5. ■
Lemma 7.8. Fix a graph G G G and partitions P \mathcal{P} P and P ′ \mathcal{P}' P ′ of V ( G ) V(G) V ( G ) such that P \mathcal{P} P refines P ′ \mathcal{P}' P ′ . Then
R ( G , P ) ⊆ R ( G , P ′ ) . R(G,\mathcal{P}) \subseteq R(G,\mathcal{P}'). R ( G , P ) ⊆ R ( G , P ′ ) . Proof. Choose any u v ∈ R ( G , P ) uv \in R(G,\mathcal{P}) uv ∈ R ( G , P ) . Let
X : = P ( u ) , X ′ : = P ′ ( u ) , Y : = P ( v ) , Y ′ : = P ′ ( v ) X := \mathcal{P}(u), \quad X' := \mathcal{P}'(u), \quad Y := \mathcal{P}(v), \quad Y' := \mathcal{P}'(v) X := P ( u ) , X ′ := P ′ ( u ) , Y := P ( v ) , Y ′ := P ′ ( v ) be the parts of P \mathcal{P} P and P ′ \mathcal{P}' P ′ that contain u u u and v v v . As P \mathcal{P} P refines P ′ \mathcal{P}' P ′ , we have X ⊆ X ′ X \subseteq X' X ⊆ X ′ and Y ⊆ Y ′ Y \subseteq Y' Y ⊆ Y ′ . Hence G [ X , Y ] G[X,Y] G [ X , Y ] and G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] are induced subgraphs of G [ X ′ , Y ′ ] G[X',Y'] G [ X ′ , Y ′ ] and G ‾ [ X ′ , Y ′ ] \overline{G}[X',Y'] G [ X ′ , Y ′ ] , respectively. Thus, by the definition of R R R ,
dist G [ X ′ , Y ′ ] ( u , v ) ≤ dist G [ X , Y ] ( u , v ) ≤ 5 , \operatorname{dist}_{G[X',Y']}(u,v) \le\operatorname{dist}_{G[X,Y]}(u,v) \le5, dist G [ X ′ , Y ′ ] ( u , v ) ≤ dist G [ X , Y ] ( u , v ) ≤ 5 , dist G ‾ [ X ′ , Y ′ ] ( u , v ) ≤ dist G ‾ [ X , Y ] ( u , v ) ≤ 5. \operatorname{dist}_{\overline{G}[X',Y']}(u,v) \le\operatorname{dist}_{\overline{G}[X,Y]}(u,v) \le5. dist G [ X ′ , Y ′ ] ( u , v ) ≤ dist G [ X , Y ] ( u , v ) ≤ 5. This proves u v ∈ R ( G , P ′ ) uv \in R(G,\mathcal{P}') uv ∈ R ( G , P ′ ) , as required. ■
Lemma 7.9. Fix a graph G G G and a partition P \mathcal{P} P of V ( G ) V(G) V ( G ) and let R : = R ( G , P ) R := R(G,\mathcal{P}) R := R ( G , P ) . For every radius r ∈ N r \in\mathbb{N} r ∈ N and vertex v ∈ V ( G ) v \in V(G) v ∈ V ( G ) we have
Ball 5 r R ( v ) ⊆ Ball r P ( v ) . \operatorname{Ball}^{R}_{5r}(v) \subseteq\operatorname{Ball}^{\mathcal{P}}_{r}(v). Ball 5 r R ( v ) ⊆ Ball r P ( v ) . Proof. It suffices to show that for every u v ∈ R uv \in R uv ∈ R we have dist P ( u , v ) ≤ 5 \operatorname{dist}_{\mathcal{P}}(u,v) \le5 dist P ( u , v ) ≤ 5 . Let X , Y ∈ P X,Y \in\mathcal{P} X , Y ∈ P be the parts containing u u u and v v v , respectively. Fix an arbitrary P \mathcal{P} P -flip H H H of G G G . Then the bipartite graph H [ X , Y ] H[X,Y] H [ X , Y ] is either G [ X , Y ] G[X,Y] G [ X , Y ] or G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] . By the definition of R R R , this graph contains a u u u –v v v path of length at most 5. If X ≠ Y X \ne Y X = Y , then this path is also a path in H H H . If X = Y X = Y X = Y , we can project this path to a length ≤ 5 \le5 ≤ 5 path in H H H by contracting diagonal edges. Hence, in both cases, dist H ( u , v ) ≤ 5 \operatorname{dist}^{H}(u,v) \le5 dist H ( u , v ) ≤ 5 , which finishes the proof. ■
Lemma 7.10. Fix a graph G G G and a partition P \mathcal{P} P of V ( G ) V(G) V ( G ) and let T T T be a transversal of P \mathcal{P} P and R : = R ( G , P ) R := R(G,\mathcal{P}) R := R ( G , P ) . Then Q : = P ∧ T Q := \mathcal{P} \wedge T Q := P ∧ T is homogeneous modulo R R R , i.e., for all X , Y ∈ Q X,Y \in Q X , Y ∈ Q either
X Y − R ⊆ E ( G ) or X Y − R ⊆ E ( G ‾ ) . XY - R \subseteq E(G) \quad\text{or}\quad XY - R \subseteq E(\overline{G}). X Y − R ⊆ E ( G ) or X Y − R ⊆ E ( G ) . Proof. We construct a Q Q Q -flip H H H of G G G with E ( H ) ⊆ R E(H) \subseteq R E ( H ) ⊆ R . This will yield the conclusion. Indeed, let X , Y ∈ Q X,Y \in Q X , Y ∈ Q . Since H H H is a Q Q Q -flip of G G G , either
E ( H ) ∩ X Y = E ( G ) ∩ X Y or E ( H ) ∩ X Y = E ( G ‾ ) ∩ X Y . E(H) \cap XY = E(G) \cap XY \quad\text{or}\quad E(H) \cap XY = E(\overline{G}) \cap XY. E ( H ) ∩ X Y = E ( G ) ∩ X Y or E ( H ) ∩ X Y = E ( G ) ∩ X Y . Since E ( H ) ⊆ R E(H) \subseteq R E ( H ) ⊆ R , no pair in X Y − R XY - R X Y − R is an edge of H H H . Hence X Y − R ⊆ E ( G ‾ ) XY - R \subseteq E(\overline{G}) X Y − R ⊆ E ( G ) in the first case, and X Y − R ⊆ E ( G ) XY - R \subseteq E(G) X Y − R ⊆ E ( G ) in the second. It remains to define H H H . We separately describe how to flip a part X X X with itself, and how to flip two distinct parts X X X and Y Y Y with each other.
For every part X ∈ P X \in\mathcal{P} X ∈ P , by Lemma 7.2 we have that either G [ X ] G[X] G [ X ] or G [ X ] ‾ \overline{G[X]} G [ X ] has diameter at most 3. If G [ X ] G[X] G [ X ] has diameter at most 3, set H [ X ] : = G [ X ] ‾ H[X] := \overline{G[X]} H [ X ] := G [ X ] , otherwise set H [ X ] : = G [ X ] H[X] := G[X] H [ X ] := G [ X ] . Suppose now that u v ∈ E ( H [ X ] ) uv \in E(H[X]) uv ∈ E ( H [ X ]) for some u , v ∈ X u,v \in X u , v ∈ X . We consider the case when G [ X ] G[X] G [ X ] has diameter at most 3 and H [ X ] = G [ X ] ‾ H[X] = \overline{G[X]} H [ X ] = G [ X ] , the other case being symmetric. Then dist G [ X ] ( u , v ) ≤ 3 \operatorname{dist}_{G[X]}(u,v) \le3 dist G [ X ] ( u , v ) ≤ 3 and dist G [ X ] ‾ ( u , v ) = 1 \operatorname{dist}_{\overline{G[X]}}(u,v) = 1 dist G [ X ] ( u , v ) = 1 . The path of length at most 3 in G [ X ] G[X] G [ X ] lifts to a path of length at most 3 between opposite copies in G [ X , X ‾ ] G[X,\overline{X}] G [ X , X ] after adding at most one diagonal step to make its length odd. Similarly, the edge u v uv uv in G [ X ] ‾ \overline{G[X]} G [ X ] lifts to a path of length 1 between opposite copies in G [ X , X ‾ ] G[X,\overline{X}] G [ X , X ] . This shows that u v ∈ R uv \in R uv ∈ R , and thus E ( H [ X ] ) ⊆ R E(H[X]) \subseteq R E ( H [ X ]) ⊆ R .
For every pair of distinct parts X , Y ∈ P X,Y \in\mathcal{P} X , Y ∈ P , let x , y x,y x , y be their representatives in T T T and apply Lemma 7.3 to G [ X , Y ] G[X,Y] G [ X , Y ] . Use the resulting bipartite graph as H [ X , Y ] H[X,Y] H [ X , Y ] . The statement of the lemma implies that E ( H [ X , Y ] ) ⊆ R E(H[X,Y]) \subseteq R E ( H [ X , Y ]) ⊆ R .
The partition Q \mathcal{Q} Q restricted to X ∪ Y X \cup Y X ∪ Y , denote it by Q [ X , Y ] \mathcal{Q}[X,Y] Q [ X , Y ] , refines the neighborhood partitions of X X X over y y y and of Y Y Y over x x x , so H [ X , Y ] H[X,Y] H [ X , Y ] is a Q [ X , Y ] \mathcal{Q}[X,Y] Q [ X , Y ] -flip of G [ X , Y ] G[X,Y] G [ X , Y ] . Altogether, H H H is a Q \mathcal{Q} Q -flip of G G G with E ( H ) ⊆ R E(H) \subseteq R E ( H ) ⊆ R . ■
We now prove Lemma 7.1.
Lemma 7.1. For every graph G G G and chain of length ℓ \ell ℓ there is a merge sequence ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) (\mathcal{Q}_1,R_1),\ldots,(\mathcal{Q}_\ell,R_\ell) ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) with the following properties.
For all r ≥ 1 r \ge1 r ≥ 1 , the radius-r r r width of the merge sequence is bounded by k ⋅ π G ( k ) k \cdot\pi_G(k) k ⋅ π G ( k ) , where k k k is the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the given chain.
For each i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] , the relations ≡ Q i \equiv_{\mathcal{Q}_i} ≡ Q i and R i R_i R i are definable in some expansion G ′ G' G ′ of G G G with two unary predicates, using two fixed first-order formulas φ ≡ ( x , y ) \varphi_{\equiv}(x,y) φ ≡ ( x , y ) and φ R ( x , y ) \varphi_R(x,y) φ R ( x , y ) of quantifier rank at most 5.
The merge sequence can be computed in time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) , given G G G and its chain.
Proof. Let V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ V(G)=S_1 \supseteq\cdots\supseteq S_\ell=\varnothing V ( G ) = S 1 ⊇ ⋯ ⊇ S ℓ = ∅ be the given chain. Let P i \mathcal{P}_i P i be the partition into atomic types over S i S_i S i . Fix an arbitrary linear order < < < on V ( G ) V(G) V ( G ) giving rise to representative sets T i : = { min < P : P ∈ P i } T_i := \{\min_{<} P : P \in\mathcal{P}_i\} T i := { min < P : P ∈ P i } . Then T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ T_1 \supseteq T_2 \supseteq\cdots\supseteq T_\ell T 1 ⊇ T 2 ⊇ ⋯ ⊇ T ℓ . Define
R i : = R ( G , P i ) and Q i : = P i ∧ T i . R_i := R(G,\mathcal{P}_i) \qquad\text{and}\qquad\mathcal{Q}_i := \mathcal{P}_i \wedge T_i. R i := R ( G , P i ) and Q i := P i ∧ T i . We claim that
( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) (\mathcal{Q}_1,R_1),\ldots,(\mathcal{Q}_\ell,R_\ell) ( Q 1 , R 1 ) , … , ( Q ℓ , R ℓ ) is a merge sequence. Indeed:
Since P 1 \mathcal{P}_1 P 1 is the partition into singletons, so is Q 1 \mathcal{Q}_1 Q 1 . It follows from P ℓ = { V ( G ) } \mathcal{P}_\ell=\{V(G)\} P ℓ = { V ( G )} and the definition of P ℓ ∧ T ℓ \mathcal{P}_\ell\wedge T_\ell P ℓ ∧ T ℓ that also Q ℓ = { V ( G ) } \mathcal{Q}_\ell=\{V(G)\} Q ℓ = { V ( G )} .
For i < j i<j i < j we have that T i ⊇ T j T_i \supseteq T_j T i ⊇ T j and P i ⪯ P j \mathcal{P}_i \preceq\mathcal{P}_j P i ⪯ P j , which implies that P i ∧ T i ⪯ P j ∧ T j \mathcal{P}_i \wedge T_i \preceq\mathcal{P}_j \wedge T_j P i ∧ T i ⪯ P j ∧ T j . Hence,
Q 1 ⪯ Q 2 ⪯ ⋯ ⪯ Q ℓ \mathcal{Q}_1 \preceq\mathcal{Q}_2 \preceq\cdots\preceq\mathcal{Q}_\ell Q 1 ⪯ Q 2 ⪯ ⋯ ⪯ Q ℓ is a sequence of ever coarser partitions.
By Lemma 7.8 , we have that
R 1 ⊆ R 2 ⊆ ⋯ ⊆ R ℓ R_1 \subseteq R_2 \subseteq\cdots\subseteq R_\ell R 1 ⊆ R 2 ⊆ ⋯ ⊆ R ℓ
By Lemma 7.10 , we have that for all P , Q ∈ Q i P,Q \in\mathcal{Q}_i P , Q ∈ Q i either
P Q − R i ⊆ E ( G ) or P Q − R i ⊆ E ( G ‾ ) . PQ - R_i \subseteq E(G) \quad\text{or}\quad PQ - R_i \subseteq E(\overline{G}). P Q − R i ⊆ E ( G ) or P Q − R i ⊆ E ( G ) .
Fix r ∈ N r \in\mathbb{N} r ∈ N , and let k k k be the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the given chain. For every i ∈ { 2 , … , ℓ } i \in\{2,\ldots,\ell\} i ∈ { 2 , … , ℓ } and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the definition of chain width gives
∣ Ball 5 r + 1 P i ( v ) / P i − 1 ∣ ≤ k . \left|\operatorname{Ball}^{P_i}_{5r+1}(v)/P_{i-1}\right| \leq k. Ball 5 r + 1 P i ( v ) / P i − 1 ≤ k .
Applying Lemma 7.5 to P i − 1 ≼ P i P_{i-1} \preccurlyeq P_i P i − 1 ≼ P i and its transversal T i − 1 T_{i-1} T i − 1 yields
∣ Ball 5 r P i ( v ) / Q i − 1 ∣ = ∣ Ball 5 r P i ( v ) / ( P i − 1 ∧ T i − 1 ) ∣ ≤ k ⋅ π G ( k ) . (5) \left|\operatorname{Ball}^{P_i}_{5r}(v)/\mathcal{Q}_{i-1}\right|=\left|\operatorname{Ball}^{P_i}_{5r}(v)/(P_{i-1}\wedge T_{i-1})\right|\leq k\cdot\pi_G(k). \tag*{(5)} Ball 5 r P i ( v ) / Q i − 1 = Ball 5 r P i ( v ) / ( P i − 1 ∧ T i − 1 ) ≤ k ⋅ π G ( k ) . (5)
By Lemma 7.9 , we have
Ball r R i ( v ) ⊆ Ball 5 r P i ( v ) . (6) \operatorname{Ball}^{R_i}_r(v)\subseteq\operatorname{Ball}^{P_i}_{5r}(v). \tag*{(6)} Ball r R i ( v ) ⊆ Ball 5 r P i ( v ) . (6)
Combining (5) and (6) yields the desired bound on the radius-r r r width of the merge sequence:
∣ Ball r R i ( v ) / Q i − 1 ∣ ≤ k ⋅ π G ( k ) . \left|\operatorname{Ball}^{R_i}_r(v)/\mathcal{Q}_{i-1}\right|\leq k\cdot\pi_G(k). Ball r R i ( v ) / Q i − 1 ≤ k ⋅ π G ( k ) .
Finally, consider the graph G G G equipped with two unary predicates marking S i S_i S i and T i T_i T i . The relation R i R_i R i is definable in this expansion by Lemma 7.7 by a formula of quantifier rank 5. The relation ≡ Q i \equiv_{\mathcal{Q}_i} ≡ Q i is defined easily using S i S_i S i and T i T_i T i by a formula of quantifier rank 2.
We now analyze the running time of a straightforward algorithm computing the resulting merge sequence. Put n : = ∣ V ( G ) ∣ n := |V(G)| n := ∣ V ( G ) ∣ . For each i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] , keep every vertex of S i S_i S i in a singleton part and group the remaining vertices by their adjacency vectors over S i S_i S i . This computes P i P_i P i in O ( n ( ∣ S i ∣ + 1 ) ) ≤ O ( n 2 ) O(n(|S_i|+1))\leq O(n^2) O ( n ( ∣ S i ∣ + 1 )) ≤ O ( n 2 ) time. Scanning the resulting partition computes T i T_i T i in O ( n ) O(n) O ( n ) time. Similarly, compute the partition Q i Q_i Q i in time O ( n ( ∣ T i ∣ + 1 ) ) ≤ O ( n 2 ) O(n(|T_i|+1))\leq O(n^2) O ( n ( ∣ T i ∣ + 1 )) ≤ O ( n 2 ) . Thus computing and outputting P i P_i P i , Q i Q_i Q i , S i S_i S i , and T i T_i T i takes O ( n 2 ) O(n^2) O ( n 2 ) time for a fixed i i i .
Compute R i R_i R i by running breadth-first searches to depth five from every vertex in each of G [ X , Y ] G[X,Y] G [ X , Y ] and G ‾ [ X , Y ] \overline{G}[X,Y] G [ X , Y ] , for all pairs X , Y ∈ P i X,Y\in P_i X , Y ∈ P i , allowing X = Y X=Y X = Y . The cost per pair is O ( ( ∣ X ∣ + ∣ Y ∣ ) ∣ X ∣ ∣ Y ∣ ) O((|X|+|Y|)|X||Y|) O (( ∣ X ∣ + ∣ Y ∣ ) ∣ X ∣∣ Y ∣ ) . We have:
∑ X , Y ∈ P i ( ∣ X ∣ + ∣ Y ∣ ) ∣ X ∣ ∣ Y ∣ = 2 ∑ X , Y ∈ P i ∣ X ∣ ∣ Y ∣ 2 = 2 ∑ X ∈ P i ∣ X ∣ ⋅ ∑ Y ∈ P i ∣ Y ∣ 2 ≤ 2 n ( ∑ Y ∈ P i ∣ Y ∣ ) 2 = 2 n 3 , \sum_{X,Y\in P_i} (|X|+|Y|)|X||Y|
=2\sum_{X,Y\in P_i}|X||Y|^2
=2\sum_{X\in P_i}|X|\cdot\sum_{Y\in P_i}|Y|^2
\leq2n\left(\sum_{Y\in P_i}|Y|\right)^2
=2n^3, X , Y ∈ P i ∑ ( ∣ X ∣ + ∣ Y ∣ ) ∣ X ∣∣ Y ∣ = 2 X , Y ∈ P i ∑ ∣ X ∣∣ Y ∣ 2 = 2 X ∈ P i ∑ ∣ X ∣ ⋅ Y ∈ P i ∑ ∣ Y ∣ 2 ≤ 2 n ( Y ∈ P i ∑ ∣ Y ∣ ) 2 = 2 n 3 ,
thus R i R_i R i can be computed in time O ( n 3 ) O(n^3) O ( n 3 ) , and the whole merge sequence in time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) .
Construction sequences with locally definable partial graphs
For the purpose of model checking, we need to work with construction sequences rather than merge sequences. The construction of [30 Lemma 3.3] shows how to convert a merge sequence to a construction sequence. However, a single step in a merge sequence is translated into a potentially long sequence of steps in a construction sequence. When aiming at defining each step of the construction sequence in the original graph G G G , we need to remember the result of the entire sequence of all the steps performed so far. We cannot hope to obtain construction sequences in which each part is definable by a formula with fewer than n / 3 n/3 n /3 parameters, even for the edgeless graph on n n n vertices. Therefore, in the following lemma, we only aim at proving that locally—in each ball of radius r r r in the graph formed by the resolved vertex pairs—the current set of resolved edges and each part of the current partition are definable in G G G by formulas of bounded quantifier rank, involving a number of parameters which is bounded by the radius-r r r merge-width of the input merge sequence. Recall the precise definition of definability stated in Definition 4.5, and used in the statement below. It is crucial that when considering merge sequences of bounded length, we can retain the unary predicates describing every stage, and thus obtain formulas using only boundedly many unary predicates.
Lemma 8.1. For every n n n -vertex graph G G G and merge sequence ( P 1 , R 1 ) , … , ( P ℓ , R ℓ ) (\mathcal{P}_1,R_1),\ldots,(\mathcal{P}_{\ell},R_{\ell}) ( P 1 , R 1 ) , … , ( P ℓ , R ℓ ) of G G G , there is a construction sequence G 1 , … , G λ G_1,\ldots,G_{\lambda} G 1 , … , G λ of G G G such that the following properties hold for all r ≥ 1 r \ge1 r ≥ 1 . Let w r w_r w r be the radius-r r r width of the merge sequence.
The obtained construction sequence has radius-r r r width at most w r w_r w r , and has length λ ≤ O ( n w 1 ) \lambda\le O(nw_1) λ ≤ O ( n w 1 ) .
Suppose that for every i ∈ [ ℓ ] i \in[\ell] i ∈ [ ℓ ] , the relations ≡ P i \equiv_{\mathcal{P}_i} ≡ P i and R i R_i R i are definable in some expansion of G G G with 2 2 2 unary predicates, using two fixed first-order formulas of quantifier rank at most 5 5 5 .
Then, for every t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the induced partial graph G t [ Ball r G t + 1 ( v ) ] G_t[\operatorname{Ball}_{r}^{G_{t+1}}(v)] G t [ Ball r G t + 1 ( v )] is definable in some expansion of G G G with 2 ℓ + 1 2\ell+1 2 ℓ + 1 unary predicates, using formulas of quantifier rank 7 7 7 with w r w_r w r parameters.
The construction sequence can be computed in time O ( ℓ n 2 ) O(\ell n^2) O ( ℓ n 2 ) , given an n n n -vertex graph G G G and a merge sequence of length ℓ \ell ℓ .
Proof. We convert the merge sequence to a construction sequence by following the proof of [30 Lemma 3.3] . Set V : = V ( G ) V := V(G) V := V ( G ) , R ℓ + 1 : = ( V 2 ) R_{\ell+1} := \binom{V}{2} R ℓ + 1 := ( 2 V ) , and P ℓ + 1 = { V } \mathcal{P}_{\ell+1} = \{V\} P ℓ + 1 = { V } .
Start with the singleton partition P \mathcal{P} P of V V V and empty set R R R of resolved vertex pairs. The construction proceeds in stages j = 1 , … , ℓ j=1,\ldots,\ell j = 1 , … , ℓ . The invariant that is maintained during stage j j j is that in each step, the current partition P \mathcal{P} P and current set R R R of resolved vertex pairs satisfy:
P j ⪯ P ⪯ P j + 1 (7) \mathcal{P}_j \preceq\mathcal{P} \preceq\mathcal{P}_{j+1} \tag*{(7)} P j ⪯ P ⪯ P j + 1 (7)
R ⊆ R j + 1 (8) R \subseteq R_{j+1} \tag*{(8)} R ⊆ R j + 1 (8)
X Y − R ⊆ E ( G ) or X Y − R ⊆ E ( G ‾ ) for all X , Y ∈ P . (9) XY-R \subseteq E(G) \quad\text{or} \quad XY-R \subseteq E(\overline{G}) \quad\text{for all } X,Y \in\mathcal{P}. \tag*{(9)} X Y − R ⊆ E ( G ) or X Y − R ⊆ E ( G ) for all X , Y ∈ P . (9)
We start the process with P : = P 1 \mathcal{P} := \mathcal{P}_1 P := P 1 being the partition into singletons and R : = ∅ R := \varnothing R := ∅ . Stage j j j proceeds as follows. First consider all unordered pairs of parts X , Y ∈ P j X,Y \in\mathcal{P}_j X , Y ∈ P j , allowing X = Y X=Y X = Y , for which X Y ⊆ R j + 1 XY \subseteq R_{j+1} X Y ⊆ R j + 1 . If there are unresolved vertex pairs in X Y XY X Y (i.e. X Y ⊈ R XY \not\subseteq R X Y ⊆ R ), resolve the pair X , Y X,Y X , Y with the common sign – positively if X Y − R ⊆ E ( G ) XY-R \subseteq E(G) X Y − R ⊆ E ( G ) and negatively if X Y − R ⊆ E ( G ‾ ) XY-R \subseteq E(\overline{G}) X Y − R ⊆ E ( G ) – and update the set of resolved vertex pairs R : = R ∪ X Y R := R \cup XY R := R ∪ X Y . Then repeatedly merge pairs A , B A,B A , B of parts of the current partition for which A ∪ B A \cup B A ∪ B is contained in one part of P j + 1 \mathcal{P}_{j+1} P j + 1 , until the current partition P \mathcal{P} P becomes P j + 1 \mathcal{P}_{j+1} P j + 1 ; if j = ℓ j=\ell j = ℓ , terminate. This results in a construction sequence of G G G .
Fix r ≥ 1 r \ge1 r ≥ 1 . We now upper bound the radius-r r r width of the obtained construction sequence by the radius-r r r width w r w_r w r of the merge sequence. Fix a stage j j j in the merge sequence and a step of the construction above in that phase, with current partition P \mathcal{P} P and current set of resolved pairs R ⊆ ( V 2 ) R \subseteq\binom{V}{2} R ⊆ ( 2 V ) . By (7), for every v ∈ V v \in V v ∈ V we have:
Ball r R ( v ) ⊆ Ball r R j + 1 ( v ) . (10) \operatorname{Ball}_{r}^{R}(v) \subseteq\operatorname{Ball}_{r}^{R_{j+1}}(v). \tag*{(10)} Ball r R ( v ) ⊆ Ball r R j + 1 ( v ) . (10)
As Ball r R j + 1 ( v ) \operatorname{Ball}_{r}^{R_{j+1}}(v) Ball r R j + 1 ( v ) intersects at most w r w_r w r parts of P j \mathcal{P}_j P j and P \mathcal{P} P is coarser than P j \mathcal{P}_j P j by (6), also Ball r R ( v ) \operatorname{Ball}_{r}^{R}(v) Ball r R ( v ) intersects at most w r w_r w r parts of P \mathcal{P} P , proving the required bound.
The obtained construction sequence is effective: each resolve operation introduces at least one new resolved vertex pair. By [30 Lemma 3.4] (and the comment before it), the length λ \lambda λ of the construction sequence is at most n ( 2 w 1 + 1 ) ≤ O ( n w 1 ) n(2w_1+1) \le O(nw_1) n ( 2 w 1 + 1 ) ≤ O ( n w 1 ) .
A straightforward implementation processes each stage in time O ( n 2 ) O(n^2) O ( n 2 ) . Namely, for each pair X , Y X,Y X , Y of parts of P j P_j P j , test whether X Y ⊆ R j + 1 XY \subseteq R_{j+1} X Y ⊆ R j + 1 by scanning all vertex pairs u v ∈ ( V 2 ) uv \in\binom{V}{2} uv ∈ ( 2 V ) , and record the sign with which X , Y X,Y X , Y should be resolved. As this processes each pair u v ∈ ( V 2 ) uv \in\binom{V}{2} uv ∈ ( 2 V ) once, this takes time O ( n 2 ) O(n^2) O ( n 2 ) in total. Similarly, the merge phase can be implemented in time O ( n ) O(n) O ( n ) . Altogether, the construction sequence is computable in time O ( ℓ n 2 ) O(\ell n^2) O ( ℓ n 2 ) . This proves the first and last conditions of the lemma.
We now prove the second condition of the lemma, regarding definability. Fix a step G t → G t + 1 G_t \to G_{t+1} G t → G t + 1 of the obtained construction sequence, and let j j j be the stage in which this step is performed. Let P \mathcal{P} P and R R R denote the partition and the set of resolved vertex pairs in G t G_t G t , and let R + R_+ R + denote the set of resolved vertex pairs in G t + 1 G_{t+1} G t + 1 ; then R ⊆ R + ⊆ R j + 1 R \subseteq R_+ \subseteq R_{j+1} R ⊆ R + ⊆ R j + 1 .
Let φ ≡ i ( x , y ) \varphi^i_{\equiv}(x,y) φ ≡ i ( x , y ) and φ R i ( x , y ) \varphi^i_R(x,y) φ R i ( x , y ) be formulas defining ≡ P i \equiv_{P_i} ≡ P i and R i R_i R i , respectively, as given by the assumption. For 1 ≤ j < ℓ 1 \leq j < \ell 1 ≤ j < ℓ , the set
⋃ { X Y : X , Y ∈ P j , X Y ⊆ R j + 1 } \bigcup\{XY : X,Y \in\mathcal{P}_j, XY \subseteq R_{j+1}\} ⋃ { X Y : X , Y ∈ P j , X Y ⊆ R j + 1 }
is defined by the formula
γ j ( x , y ) : = x ≠ y ∧ ∀ a ∀ b ( ( φ ≡ j ( x , a ) ∧ φ ≡ j ( y , b ) ∧ a ≠ b ) → φ R j + 1 ( a , b ) ) , \gamma_j(x,y) := x \ne y \land\forall a\forall b\left((\varphi^j_{\equiv}(x,a) \land\varphi^j_{\equiv}(y,b) \land a \ne b) \to\varphi^{j+1}_R(a,b)\right), γ j ( x , y ) := x = y ∧ ∀ a ∀ b ( ( φ ≡ j ( x , a ) ∧ φ ≡ j ( y , b ) ∧ a = b ) → φ R j + 1 ( a , b ) ) ,
which has quantifier rank at most 7. Consequently, at the start of stage j j j , the resolved relation, which we denote R j ′ R'_j R j ′ , is defined by
Γ j ( x , y ) : = ⋁ i = 1 j − 1 γ i ( x , y ) . \Gamma_j(x,y) := \bigvee_{i=1}^{j-1}\gamma_i(x,y). Γ j ( x , y ) := i = 1 ⋁ j − 1 γ i ( x , y ) .
This formula uses 2 j 2j 2 j unary predicates and has quantifier rank at most 7.
Choose one parameter p X ∈ X p_X \in X p X ∈ X for every part X ∈ P j X \in\mathcal{P}_j X ∈ P j . The part X X X is then defined by φ ≡ j ( x , p X ) \varphi^j_{\equiv}(x,p_X) φ ≡ j ( x , p X ) , which uses 2 unary predicates, one parameter, and has quantifier rank at most 5.
Fix a vertex v ∈ V v \in V v ∈ V . Denote
B : = Ball R + r ( v ) = Ball G t + 1 r ( v ) ⊆ Ball R j + 1 r ( v ) . B := \operatorname{Ball}_{R_+}^r(v) = \operatorname{Ball}_{G_{t+1}}^r(v) \subseteq\operatorname{Ball}_{R_{j+1}}^r(v). B := Ball R + r ( v ) = Ball G t + 1 r ( v ) ⊆ Ball R j + 1 r ( v ) .
Mark the set B B B with a unary predicate U B U_B U B .
We will show how to define in G G G the relation R ∩ ( B 2 ) R \cap\binom{B}{2} R ∩ ( 2 B ) and the sets X ∩ B X \cap B X ∩ B , for each X ∈ P X \in\mathcal{P} X ∈ P , using Boolean combinations of the formulas defined above, using the 2 j + 1 2j+1 2 j + 1 distinguished unary predicates, and at most w r w_r w r parameters. Once R ∩ ( B 2 ) R \cap\binom{B}{2} R ∩ ( 2 B ) is defined, the set of edges and non-edges of G t G_t G t , restricted to ( B 2 ) \binom{B}{2} ( 2 B ) , can be recovered by further intersecting with E ( G ) E(G) E ( G ) and E ( G ) ‾ \overline{E(G)} E ( G ) , respectively. This will therefore define the induced substructure G t [ B ] G_t[B] G t [ B ] , as required in the second condition of the lemma.
We first focus on defining R ∩ ( B 2 ) R \cap\binom{B}{2} R ∩ ( 2 B ) . Note that R R R is the union of R j ′ R'_j R j ′ and all already processed rectangles X Y XY X Y with X , Y ∈ P j X,Y \in\mathcal{P}_j X , Y ∈ P j , X Y ⊆ R j + 1 XY \subseteq R_{j+1} X Y ⊆ R j + 1 . Therefore, R R R is defined by the disjunction of Γ j ( x , y ) \Gamma_j(x,y) Γ j ( x , y ) and disjuncts of the form
( x ≠ y ) ∧ ( ( φ ≡ j ( x , p X ) ∧ φ ≡ j ( y , p Y ) ) ∨ ( φ ≡ j ( x , p Y ) ∧ φ ≡ j ( y , p X ) ) ) . (x \ne y) \land\left((\varphi^j_{\equiv}(x,p_X) \land\varphi^j_{\equiv}(y,p_Y)) \lor(\varphi^j_{\equiv}(x,p_Y) \land\varphi^j_{\equiv}(y,p_X))\right). ( x = y ) ∧ ( ( φ ≡ j ( x , p X ) ∧ φ ≡ j ( y , p Y )) ∨ ( φ ≡ j ( x , p Y ) ∧ φ ≡ j ( y , p X )) ) .
To define the intersection of R R R with ( B 2 ) \binom{B}{2} ( 2 B ) , add a conjunct U B ( x ) ∧ U B ( y ) U_B(x) \land U_B(y) U B ( x ) ∧ U B ( y ) , and keep only those disjuncts which involve parts X , Y X,Y X , Y that intersect B B B . As there are at most w r w_r w r many such parts, this results in a formula using w r w_r w r parameters.
Each current part X ∈ P X \in\mathcal{P} X ∈ P is a union of parts of P j \mathcal{P}_j P j , so its intersection with B B B is defined by the formula
U B ( x ) ∧ ⋁ γ φ ≡ ( x , p γ ) U_B(x) \land\bigvee_{\gamma} \varphi_{\equiv}(x,p_\gamma) U B ( x ) ∧ γ ⋁ φ ≡ ( x , p γ )
where γ \gamma γ ranges over all parts γ ∈ P j \gamma\in\mathcal{P}_j γ ∈ P j with γ ∩ B ≠ ∅ \gamma\cap B \ne\varnothing γ ∩ B = ∅ and γ ⊆ X \gamma\subseteq X γ ⊆ X , with empty disjunction interpreted as false . The resulting formula uses only w r w_r w r parameters. This completes the proof of the lemma. ■
We now prove Lemma 6.4.
Lemma 6.4. For every n n n -vertex graph G G G and its chain of length ℓ \ell ℓ there is a construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ of G G G such that the following properties hold for all r ≥ 1 r \ge1 r ≥ 1 . Let k r k_r k r denote the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the chain and w r : = k r ⋅ π G ( k r ) w_r := k_r \cdot\pi_G(k_r) w r := k r ⋅ π G ( k r ) .
The resulting construction sequence has radius-r r r width at most w r w_r w r and length λ ≤ O ( n w 1 ) \lambda\le O(nw_1) λ ≤ O ( n w 1 ) .
For every t ∈ [ λ − 1 ] t \in[\lambda-1] t ∈ [ λ − 1 ] and v ∈ V ( G ) v \in V(G) v ∈ V ( G ) , the induced partial graph
G t [ Ball r G t + 1 ( v ) ] G_t[\operatorname{Ball}_{r}^{G_{t+1}}(v)] G t [ Ball r G t + 1 ( v )] is definable in some expansion of G G G with 2 ℓ + 1 2\ell+1 2 ℓ + 1 unary predicates, using formulas of quantifier rank 7 7 7 with w r w_r w r parameters.
The construction sequence can be computed in time O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) , given G G G and its chain.
Proof. The empty graph is immediate, so assume G G G is nonempty. Apply Lemma 7.1 to the given chain to obtain a merge sequence with ℓ \ell ℓ stages, each definable by two unary predicates and fixed formulas of quantifier rank at most 5 5 5 . Fix r ≥ 1 r \ge1 r ≥ 1 and let k r k_r k r be the radius-( 5 r + 1 ) (5r+1) ( 5 r + 1 ) width of the chain. Then the radius-r r r width w r w_r w r of this merge sequence is at most k r ⋅ π G ( k r ) k_r \cdot\pi_G(k_r) k r ⋅ π G ( k r ) . Apply Lemma 8.1 to obtain a construction sequence of length λ ≤ O ( n w 1 ) \lambda\le O(nw_1) λ ≤ O ( n w 1 ) and radius-r r r width at most w r w_r w r , with local definitions using at most w r w_r w r parameters, 2 ℓ + 1 2\ell+1 2 ℓ + 1 unary predicates, and formulas of quantifier rank at most 7 7 7 . Both algorithms take O ( ℓ n 3 ) O(\ell n^3) O ( ℓ n 3 ) time and use only G G G and the given chain. ■
Model checking with type trees
In this part we prove:
Theorem 4.3. There is an algorithm which, given a sentence φ \varphi φ and an n n n -vertex graph G G G together with its construction sequence of length λ \lambda λ , determines whether G ⊨ φ G \models\varphi G ⊨ φ in time λ ⋅ n 2 ⋅ poly φ ( K ) \lambda\cdot n^2 \cdot\operatorname{poly}_{\varphi}(K) λ ⋅ n 2 ⋅ poly φ ( K ) , where K K K is the radius-r r r depth-d d d width of the construction sequence, for some r r r and d d d which are computable from φ \varphi φ .
Preliminaries
In Part III, unless stated otherwise, G G G denotes a partial graph. We slightly extend the notions of partial graphs and of construction sequences.
Partial graphs. To track parts over time, we give them names. Fix a countably infinite set of unary symbols, called colors . We regard a partial graph G G G as a relational structure with the two symmetric binary relations E E E and N N N and a unary relation Y Y Y for every color Y Y Y . The vertices of color Y Y Y form its color class Y G Y^G Y G , and the nonempty color classes are the parts of G G G . We write ∣ G ∣ : = ∣ V ( G ) ∣ |G| := |V(G)| ∣ G ∣ := ∣ V ( G ) ∣ and ∥ G ∥ : = ∣ V ( G ) ∣ + ∣ R ( G ) ∣ \lVert G\rVert:= |V(G)| + |R(G)| ∥ G ∥ := ∣ V ( G ) ∣ + ∣ R ( G ) ∣ for the size of the representation of a partial graph G G G . The distance matrix of G G G is the ∣ G ∣ × ∣ G ∣ |G| \times|G| ∣ G ∣ × ∣ G ∣ matrix D G D_G D G with entries D G ( u , v ) : = dist G ( u , v ) ∈ N ∪ { ∞ } D_G(u,v) := \operatorname{dist}_G(u,v) \in\mathbb{N} \cup\{\infty\} D G ( u , v ) := dist G ( u , v ) ∈ N ∪ { ∞ } . Passing it as an additional input to the algorithms below saves time, as distances need not be recomputed repeatedly.
Construction sequences. For colors P , Q P,Q P , Q and a partial graph G G G , we define three partial graphs merge P , Q ( G ) \operatorname{merge}_{P,Q}(G) merge P , Q ( G ) (for P ≠ Q P \ne Q P = Q ), resolve P , Q + ( G ) \operatorname{resolve}^{+}_{P,Q}(G) resolve P , Q + ( G ) , and resolve P , Q − ( G ) \operatorname{resolve}^{-}_{P,Q}(G) resolve P , Q − ( G ) , as the partial graph H H H obtained from G G G by leaving all relations of G G G unchanged, apart from redefining the following:
merge P , Q ( G ) : P H : = P G ∪ Q G , Q H : = ∅ for P ≠ Q , resolve P , Q + ( G ) : E ( H ) : = E ( G ) ∪ ( P G Q G − N ( G ) ) , resolve P , Q − ( G ) : N ( H ) : = N ( G ) ∪ ( P G Q G − E ( G ) ) . \begin{aligned}
\operatorname{merge}_{P,Q}(G):\quad&P^H := P^G \cup Q^G,\qquad Q^H := \varnothing&& \text{for } P \ne Q,\\
\operatorname{resolve}^{+}_{P,Q}(G):\quad&E(H) := E(G) \cup(P^GQ^G - N(G)),\\
\operatorname{resolve}^{-}_{P,Q}(G):\quad&N(H) := N(G) \cup(P^GQ^G - E(G)).
\end{aligned} merge P , Q ( G ) : resolve P , Q + ( G ) : resolve P , Q − ( G ) : P H := P G ∪ Q G , Q H := ∅ E ( H ) := E ( G ) ∪ ( P G Q G − N ( G )) , N ( H ) := N ( G ) ∪ ( P G Q G − E ( G )) . for P = Q ,
After either resolve, every pair in P G Q G P^GQ^G P G Q G is resolved. In this representation, every step of a construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ (§ 3 ) has the form G t + 1 = merge P , Q ( G t ) G_{t+1} = \operatorname{merge}_{P,Q}(G_t) G t + 1 = merge P , Q ( G t ) , resolve P , Q + ( G t ) \operatorname{resolve}^{+}_{P,Q}(G_t) resolve P , Q + ( G t ) , or resolve P , Q − ( G t ) \operatorname{resolve}^{-}_{P,Q}(G_t) resolve P , Q − ( G t ) for some colors P , Q P,Q P , Q .
Distance logic
Following [30 , 29 ] (and earlier work by [42 ] ), we define a logic called dist-FO, extending first-order logic by distance atoms, and a suitable notion of rank. We then define compact representations of types tailored to this logic.
Distance logic and distance rank
First-order distance logic. The logic dist-FO extends first-order logic by additionally allowing the following two types of atoms:
For each radius r ∈ N r \in\mathbb{N} r ∈ N , dist-FO introduces a binary distance atom dist ( x , y ) ≤ r \operatorname{dist}(x,y) \le r dist ( x , y ) ≤ r expressing that the distance between x x x and y y y is at most r r r .
For each radius r ∈ N r \in\mathbb{N} r ∈ N and color Y Y Y , dist-FO introduces a unary distance atom dist ( x , Y ) < r \operatorname{dist}(x,Y) < r dist ( x , Y ) < r expressing that the distance from x x x to Y Y Y is smaller than r r r , equivalent to ∃ y Y ( y ) ∧ dist ( x , y ) < r \exists y\ Y(y) \land\operatorname{dist}(x,y) < r ∃ y Y ( y ) ∧ dist ( x , y ) < r .
In both cases, we call r r r the radius of the distance atom. Distance atoms are expressible in first-order logic, but only with quantifiers. Treating them as atoms lets us measure distances without increasing the quantifier rank, as in [42 ] .
Horizon functions. We fix sufficiently fast-growing horizon functions as in [31 ] :
ρ − ( k , q ) : = 9 ( k + q + 1 ) q and ρ + ( k , q ) : = 9 ( k + q ) ( q + 1 ) . (11) \rho^{-}(k,q) := 9^{(k+q+1)q}
\qquad\text{and}\qquad
\rho^{+}(k,q) := 9^{(k+q)(q+1)}. \tag*{(11)} ρ − ( k , q ) := 9 ( k + q + 1 ) q and ρ + ( k , q ) := 9 ( k + q ) ( q + 1 ) . (11)
They satisfy the two identities
ρ + ( k , q ) = 9 k ρ − ( k , q ) for all k , q ∈ N , ρ − ( k , q ) = 9 q ρ + ( k + 1 , q − 1 ) for q ≥ 1. (12) \rho^{+}(k,q) = 9^{k}\rho^{-}(k,q) \quad\text{for all } k,q \in\mathbb{N},
\qquad
\rho^{-}(k,q) = 9^{q}\rho^{+}(k+1,q-1) \quad\text{for } q \ge1. \tag*{(12)} ρ + ( k , q ) = 9 k ρ − ( k , q ) for all k , q ∈ N , ρ − ( k , q ) = 9 q ρ + ( k + 1 , q − 1 ) for q ≥ 1. (12)
In particular, as 9 q ≥ 2 9^{q} \ge2 9 q ≥ 2 ,
ρ + ( k , q ) ≥ ρ − ( k , q ) ≥ 2 ρ + ( k + 1 , q − 1 ) for all k ∈ N and q ≥ 1. (13) \rho^{+}(k,q) \ge\rho^{-}(k,q) \ge2\rho^{+}(k+1,q-1)
\quad\text{for all } k \in\mathbb{N}\text{ and }q \ge1. \tag*{(13)} ρ + ( k , q ) ≥ ρ − ( k , q ) ≥ 2 ρ + ( k + 1 , q − 1 ) for all k ∈ N and q ≥ 1. (13)
Distance rank. Let k , q ∈ N k,q \in\mathbb{N} k , q ∈ N . A dist-FO formula has distance rank ( k , q ) (k,q) ( k , q ) if it is a Boolean combination of
first-order atoms: relational symbols in the signature or equality, applied to variables,
binary distance atoms with radius r ≤ ρ − ( k , q ) r \le\rho^{-}(k,q) r ≤ ρ − ( k , q ) ,
unary distance atoms with radius r ≤ ρ + ( k , q ) r \le\rho^{+}(k,q) r ≤ ρ + ( k , q ) ,
formulas
∃ y ( dist ( x i , y ) ≤ ρ + ( k + 1 , q − 1 ) ∧ φ ( x ˉ y ) ) , \exists y\left(\operatorname{dist}(x_i,y) \le\rho^{+}(k+1,q-1) \land\varphi(\bar{x}y)\right), ∃ y ( dist ( x i , y ) ≤ ρ + ( k + 1 , q − 1 ) ∧ φ ( x ˉ y ) ) ,
where q ≥ 1 q \ge1 q ≥ 1 , x i x_i x i is a variable in x ˉ \bar{x} x ˉ , and φ ( x ˉ y ) \varphi(\bar{x}y) φ ( x ˉ y ) has distance rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) .
A formula with distance rank ( k , q ) (k,q) ( k , q ) has quantifier rank at most q q q . Observe by (13) that the distance atoms have progressively shorter radii as one traverses the quantifiers inwards.
Formulas of distance rank ( k , q ) (k,q) ( k , q ) are called local formulas of distance rank ( k , q ) (k,q) ( k , q ) in [30 , 31 ] , as opposed to the more general formulas which also allow the unrestricted quantification ∃ y ψ ( x ˉ y ) \exists y\ \psi(\bar{x}y) ∃ y ψ ( x ˉ y ) . Since we only consider local formulas in this paper, we omit this adjective.
Type trees
In the context of usual first-order logic, the type of quantifier rank q q q of a tuple a ˉ \bar{a} a ˉ in a structure A A A is defined as the set of all formulas of quantifier rank q q q that are satisfied by a ˉ \bar{a} a ˉ in A A A (see § 4 ). It is well known [57 ] that for structures over a finite relational signature, such types can be identified with trees , also called Hintikka types , defined recursively as follows:
tree q A ( a ˉ ) = { atp A ( a ˉ ) if q = 0 , { tree q − 1 A ( a ˉ b ) : b ∈ V ( A ) } if q > 0. \operatorname{tree}^{A}_{q}(\bar{a}) =
\begin{cases}
\operatorname{atp}^{A}(\bar{a}) & \text{if } q=0,\\
\{\operatorname{tree}^{A}_{q-1}(\bar{a}b) : b \in V(A)\} & \text{if } q>0.
\end{cases} tree q A ( a ˉ ) = { atp A ( a ˉ ) { tree q − 1 A ( a ˉ b ) : b ∈ V ( A )} if q = 0 , if q > 0.
In the setting of dist-FO formulas of distance rank ( k , q ) (k,q) ( k , q ) , the (local) type of distance rank ( k , q ) (k,q) ( k , q ) of a tuple a ˉ \bar{a} a ˉ is defined [30 ] as the set of (local) dist-FO formulas of distance rank ( k , q ) (k,q) ( k , q ) satisfied by a ˉ \bar{a} a ˉ . In this section, we adapt the construction of trees to this setting. This is useful in the algorithmic context, as trees are much smaller objects than types.
Type trees. In the two definitions below, let G G G be a partial graph, k , q ∈ N k,q \in\mathbb{N} k , q ∈ N , and a ˉ ∈ V ( G ) ≤ k \bar{a} \in V(G)^{\le k} a ˉ ∈ V ( G ) ≤ k , and put ℓ : = ∣ a ˉ ∣ \ell:= \lvert\bar{a}\rvert ℓ := ∣ a ˉ ∣ . The atomic ( k , q ) (k,q) ( k , q ) -type, denoted atp k , q ( a ˉ ) \operatorname{atp}_{k,q}(\bar{a}) atp k , q ( a ˉ ) , is the set of all atomic formulas φ \varphi φ of distance rank ( k , q ) (k,q) ( k , q ) with free variables among x 1 , … , x ℓ x_1,\ldots,x_\ell x 1 , … , x ℓ , such that G ⊨ φ ( a ˉ ) G \models\varphi(\bar{a}) G ⊨ φ ( a ˉ ) . Note that this set is finite, as an atom mentioning a color that does not occur in G G G is not satisfiable in G G G .
Define the ( k , q ) (k,q) ( k , q ) -type tree of a ˉ \bar{a} a ˉ as
tree k , q ( a ˉ ) : = ( atp k , q ( a ˉ ) , E k , q ( a ˉ ) ) \operatorname{tree}_{k,q}(\bar{a}) := \left(\operatorname{atp}_{k,q}(\bar{a}),\mathcal{E}_{k,q}(\bar{a})\right) tree k , q ( a ˉ ) := ( atp k , q ( a ˉ ) , E k , q ( a ˉ ) )
where E k , q ( a ˉ ) = ∅ \mathcal{E}_{k,q}(\bar{a}) = \varnothing E k , q ( a ˉ ) = ∅ if q = 0 q=0 q = 0 , and otherwise
E k , q ( a ˉ ) : = { ( i , tree k + 1 , q − 1 ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist ( a i , b ) ≤ ρ + ( k + 1 , q − 1 ) } . \mathcal{E}_{k,q}(\bar{a}) := \left\{ \left(i,\operatorname{tree}_{k+1,q-1}(\bar{a}b)\right) : i \in[\ell],\ b \in V(G),\ \operatorname{dist}(a_i,b) \le\rho^{+}(k+1,q-1) \right\}. E k , q ( a ˉ ) := { ( i , tree k + 1 , q − 1 ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist ( a i , b ) ≤ ρ + ( k + 1 , q − 1 ) } .
Note that type trees are “local” in the sense that new vertices are always quantified close to previous ones (see Lemma 10.4 ). The members of E k , q ( a ˉ ) \mathcal{E}_{k,q}(\bar{a}) E k , q ( a ˉ ) are the extensions of tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) . The position i i i of an extension ( i , μ ) (i,\mu) ( i , μ ) is called the guard , and we say that i i i admits b b b if dist ( a i , b ) ≤ ρ + ( k + 1 , q − 1 ) \operatorname{dist}(a_i,b) \le\rho^{+}(k+1,q-1) dist ( a i , b ) ≤ ρ + ( k + 1 , q − 1 ) . We view tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) as a labeled, rooted tree of depth q q q , with the root labeled atp k , q ( a ˉ ) \operatorname{atp}_{k,q}(\bar{a}) atp k , q ( a ˉ ) and the root of each type tree μ \mu μ of an extension ( i , μ ) ∈ E k , q ( a ˉ ) (i,\mu) \in\mathcal{E}_{k,q}(\bar{a}) ( i , μ ) ∈ E k , q ( a ˉ ) attached as a child of the root via an edge labeled i i i . We call ℓ \ell ℓ the arity of the type tree, and ( k , q ) (k,q) ( k , q ) its rank.
Representation. Type trees are represented in the standard RAM model in a canonical (say, sorted, duplicate-free) form, so that equality of two type trees τ 1 , τ 2 \tau_1,\tau_2 τ 1 , τ 2 can be tested in time O ( ∥ τ 1 ∥ + ∥ τ 2 ∥ ) O(\lVert\tau_1\rVert+\lVert\tau_2\rVert) O (∥ τ 1 ∥ + ∥ τ 2 ∥) . By ∥ τ ∥ \lVert\tau\rVert ∥ τ ∥ we denote the size of this representation (which includes k , q k,q k , q , and ℓ \ell ℓ ).
Observation 10.1 (canonical form). A type tree given by a representation whose sets need not be sorted or duplicate-free can be brought into canonical form in polynomial time.
The next lemma states that the type trees indeed represent the types. It is the reason for computing type trees in the first place.
Lemma 10.2 (evaluation). Let φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) be a dist-FO formula of distance rank ( k , q ) (k,q) ( k , q ) , G G G be a partial graph and a ˉ ∈ V ( G ) ℓ \bar{a} \in V(G)^\ell a ˉ ∈ V ( G ) ℓ with ℓ = ∣ x ˉ ∣ ≤ k \ell=\lvert\bar{x}\rvert\le k ℓ = ∣ x ˉ ∣ ≤ k . Then whether G ⊨ φ ( a ˉ ) G \models\varphi(\bar{a}) G ⊨ φ ( a ˉ ) holds is decidable in polynomial time, given tree k , q G ( a ˉ ) \operatorname{tree}^{G}_{k,q}(\bar{a}) tree k , q G ( a ˉ ) and φ \varphi φ .
Notation. For a ( k , q ) (k,q) ( k , q ) -type tree τ = tree k , q G ( a ˉ ) \tau=\operatorname{tree}^{G}_{k,q}(\bar{a}) τ = tree k , q G ( a ˉ ) and a dist-FO formula φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) of distance rank ( k , q ) (k,q) ( k , q ) , we write τ ⊨ φ \tau\models\varphi τ ⊨ φ , if G ⊨ φ ( a ˉ ) G \models\varphi(\bar{a}) G ⊨ φ ( a ˉ ) . The lemma implies that this does not depend on G G G and a ˉ \bar{a} a ˉ , only on the type tree τ \tau τ .
Proof of Lemma 10.2. By induction on q q q . Write τ : = tree k , q ( a ˉ ) \tau:= \operatorname{tree}_{k,q}(\bar{a}) τ := tree k , q ( a ˉ ) . By definition of distance rank, φ \varphi φ is a Boolean combination of atoms and of existential components, and we evaluate these components separately. An atom holds of a ˉ \bar{a} a ˉ if and only if it occurs in the root label atp k , q ( a ˉ ) \operatorname{atp}_{k,q}(\bar{a}) atp k , q ( a ˉ ) of τ \tau τ . Now let q ≥ 1 q \ge1 q ≥ 1 and put H : = ρ + ( k + 1 , q − 1 ) H := \rho^{+}(k+1,q-1) H := ρ + ( k + 1 , q − 1 ) . Every existential component χ \chi χ of φ \varphi φ can be written as
∃ y ( dist ( x i , y ) ≤ H ∧ ψ ( x ˉ y ) ) \exists y\left(\operatorname{dist}(x_i,y)\le H \land\psi(\bar{x}y)\right) ∃ y ( dist ( x i , y ) ≤ H ∧ ψ ( x ˉ y ) )
with i ∈ [ ℓ ] i\in[\ell] i ∈ [ ℓ ] and ψ \psi ψ of distance rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) . By the inductive assumption, whether G ⊨ ψ ( c ˉ ) G \models\psi(\bar{c}) G ⊨ ψ ( c ˉ ) holds is determined by tree k + 1 , q − 1 ( c ˉ ) \operatorname{tree}_{k+1,q-1}(\bar{c}) tree k + 1 , q − 1 ( c ˉ ) and ψ \psi ψ , and by the notation above, this holds if tree k + 1 , q − 1 ( c ˉ ) ⊨ ψ \operatorname{tree}_{k+1,q-1}(\bar{c}) \models\psi tree k + 1 , q − 1 ( c ˉ ) ⊨ ψ . Unfolding the semantics, then applying the inductive assumption, and finally the definition of E k , q ( a ˉ ) \mathcal{E}_{k,q}(\bar{a}) E k , q ( a ˉ ) , we obtain
G ⊨ χ ( a ˉ ) ⟺ ∃ b ∈ V ( G ) : dist ( a i , b ) ≤ H and G ⊨ ψ ( a ˉ b ) ⟺ ∃ b ∈ V ( G ) : dist ( a i , b ) ≤ H and tree k + 1 , q − 1 ( a ˉ b ) ⊨ ψ ⟺ ∃ μ : ( i , μ ) ∈ E k , q ( a ˉ ) and μ ⊨ ψ . \begin{aligned}
G \models\chi(\bar{a}) \iff\exists b\in V(G):\ \operatorname{dist}(a_i,b)\le H\ \text{and}\ G\models\psi(\bar{a}b) \\
&\iff\exists b\in V(G):\ \operatorname{dist}(a_i,b)\le H\ \text{and}\ \operatorname{tree}_{k+1,q-1}(\bar{a}b)\models\psi\\
&\iff\exists\mu:\ (i,\mu)\in\mathcal{E}_{k,q}(\bar{a})\ \text{and}\ \mu\models\psi.
\end{aligned} G ⊨ χ ( a ˉ ) ⟺ ∃ b ∈ V ( G ) : dist ( a i , b ) ≤ H and G ⊨ ψ ( a ˉ b ) ⟺ ∃ b ∈ V ( G ) : dist ( a i , b ) ≤ H and tree k + 1 , q − 1 ( a ˉ b ) ⊨ ψ ⟺ ∃ μ : ( i , μ ) ∈ E k , q ( a ˉ ) and μ ⊨ ψ .
So χ \chi χ is decided by evaluating ψ \psi ψ , via the inductive assumption, on the extensions of τ \tau τ with guard i i i . This proof yields a polynomial-time algorithm. ■
Corollary 10.3. Fix ℓ ≤ k \ell\le k ℓ ≤ k and q q q , a partial graph G G G , and a ˉ , b ˉ ∈ V ( G ) ℓ \bar{a},\bar{b} \in V(G)^\ell a ˉ , b ˉ ∈ V ( G ) ℓ . Then t r e e k , q ( a ˉ ) = t r e e k , q ( b ˉ ) \mathrm{tree}_{k,q}(\bar{a}) = \mathrm{tree}_{k,q}(\bar{b}) tree k , q ( a ˉ ) = tree k , q ( b ˉ ) if and only if G ⊨ φ ( a ˉ ) ⇔ φ ( b ˉ ) G \models\varphi(\bar{a}) \Leftrightarrow\varphi(\bar{b}) G ⊨ φ ( a ˉ ) ⇔ φ ( b ˉ ) for every dist-FO formula φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) of distance rank ( k , q ) (k,q) ( k , q ) with ∣ x ˉ ∣ = ℓ |\bar{x}| = \ell ∣ x ˉ ∣ = ℓ .
Proof. The rightwards implication follows from Lemma 10.2 . The converse is proved by an easy induction on q q q . ■
Lemma 10.4 (locality). Let k ≥ 1 k \ge1 k ≥ 1 , q ∈ N q \in\mathbb{N} q ∈ N , let G G G be a partial graph, and let a ∈ V ( G ) a \in V(G) a ∈ V ( G ) . Every node at depth j j j of t r e e k , q ( a ) \mathrm{tree}_{k,q}(a) tree k , q ( a ) is t r e e k + j , q − j ( v ˉ ) \mathrm{tree}_{k+j,q-j}(\bar{v}) tree k + j , q − j ( v ˉ ) for some tuple v ˉ \bar{v} v ˉ from Ball ρ + ( k , q ) ( a ) \operatorname{Ball}_{\rho^{+}(k,q)}(a) Ball ρ + ( k , q ) ( a ) , and every color mentioned in the root label intersects this ball.
Proof. By the definition of extensions and induction on j j j , a node at depth j j j is t r e e k + j , q − j ( v ˉ ) \mathrm{tree}_{k+j,q-j}(\bar{v}) tree k + j , q − j ( v ˉ ) for a tuple v ˉ = ( v 0 , … , v j ) \bar{v} = (v_0,\ldots,v_j) v ˉ = ( v 0 , … , v j ) with v 0 = a v_0 = a v 0 = a in which every v i v_i v i with i ≥ 1 i \ge1 i ≥ 1 is within distance ρ + ( k + i , q − i ) \rho^{+}(k+i,q-i) ρ + ( k + i , q − i ) of an earlier entry. By induction on i i i and the triangle inequality, dist ( a , v i ) ≤ ∑ i ′ = 1 i ρ + ( k + i ′ , q − i ′ ) \operatorname{dist}(a,v_i) \le\sum_{i'=1}^{i}\rho^{+}(k+i',q-i') dist ( a , v i ) ≤ ∑ i ′ = 1 i ρ + ( k + i ′ , q − i ′ ) . The root label mentions colors only in atoms Y ( x i ) Y(x_i) Y ( x i ) and dist ( x i , Y ) < r \operatorname{dist}(x_i,Y) < r dist ( x i , Y ) < r with r ≤ ρ + ( k + j , q − j ) r \le\rho^{+}(k+j,q-j) r ≤ ρ + ( k + j , q − j ) , and such an atom holds of v ˉ \bar{v} v ˉ only if a vertex of Y Y Y is within distance r r r of v i v_i v i . Hence every entry of v ˉ \bar{v} v ˉ , and some vertex of every color in an atom in the root label, is within distance
∑ i = 1 j ρ + ( k + i , q − i ) + ρ + ( k + j , q − j ) ≤ ρ + ( k , q ) \sum_{i=1}^{j}\rho^{+}(k+i,q-i)+\rho^{+}(k+j,q-j) \le\rho^{+}(k,q) i = 1 ∑ j ρ + ( k + i , q − i ) + ρ + ( k + j , q − j ) ≤ ρ + ( k , q ) of a a a , where the inequality uses ρ + ( k + i , q − i ) ≤ 2 − i ρ + ( k , q ) \rho^{+}(k+i,q-i) \le2^{-i}\rho^{+}(k,q) ρ + ( k + i , q − i ) ≤ 2 − i ρ + ( k , q ) , which follows by applying (13) i i i times. ■
Operations on type trees
Lemma 10.5 (ordered coordinate restriction). There is an operation ↾ \upharpoonright ↾ on type trees such that for all k , q ∈ N k,q \in\mathbb{N} k , q ∈ N , partial graphs G G G , tuples w ˉ ∈ V ( G ) ℓ \bar{w} \in V(G)^\ell w ˉ ∈ V ( G ) ℓ for ℓ ≤ k \ell\le k ℓ ≤ k and ordered lists J J J of distinct positions in [ ℓ ] [\ell] [ ℓ ] ,
t r e e k , q ( w ˉ ) ↾ J = t r e e k , q ( w ˉ ↾ J ) . \mathrm{tree}_{k,q}(\bar{w}) \upharpoonright J = \mathrm{tree}_{k,q}(\bar{w} \upharpoonright J). tree k , q ( w ˉ ) ↾ J = tree k , q ( w ˉ ↾ J ) . Given τ \tau τ and J J J one can compute τ ↾ J \tau\upharpoonright J τ ↾ J in time polynomial in ∥ τ ∥ \lVert\tau\rVert ∥ τ ∥ .
Proof. By induction on q q q . Let J = ( j 1 , … , j p ) J = (j_1,\ldots,j_p) J = ( j 1 , … , j p ) , and H : = ρ + ( k + 1 , q − 1 ) H := \rho^{+}(k+1,q-1) H := ρ + ( k + 1 , q − 1 ) . Renaming variables gives
atp k , q ( w ˉ ↾ J ) = { ψ ( x 1 , … , x p ) : ψ ( x j 1 , … , x j p ) ∈ atp k , q ( w ˉ ) } , \operatorname{atp}_{k,q}(\bar{w} \upharpoonright J) = \{\psi(x_1,\ldots,x_p) : \psi(x_{j_1},\ldots,x_{j_p}) \in\operatorname{atp}_{k,q}(\bar{w})\}, atp k , q ( w ˉ ↾ J ) = { ψ ( x 1 , … , x p ) : ψ ( x j 1 , … , x j p ) ∈ atp k , q ( w ˉ )} , which settles the root label. Let q ≥ 1 q \ge1 q ≥ 1 , and put J + : = ( j 1 , … , j p , ℓ + 1 ) J^{+} := (j_1,\ldots,j_p,\ell+1) J + := ( j 1 , … , j p , ℓ + 1 ) , so that ( w ˉ ↾ J ) b = ( w ˉ b ) ↾ J + (\bar{w} \upharpoonright J)b = (\bar{w}b) \upharpoonright J^{+} ( w ˉ ↾ J ) b = ( w ˉ b ) ↾ J + for every vertex b b b . Unfolding the definition of E k , q ( w ˉ ↾ J ) \mathcal{E}_{k,q}(\bar{w} \upharpoonright J) E k , q ( w ˉ ↾ J ) , then applying the inductive assumption, and finally the definition of E k , q ( w ˉ ) \mathcal{E}_{k,q}(\bar{w}) E k , q ( w ˉ ) , we obtain
E k , q ( w ˉ ↾ J ) = { ( i , t r e e k + 1 , q − 1 ( ( w ˉ b ) ↾ J + ) ) : i ∈ [ p ] , b ∈ V ( G ) , dist ( w j i , b ) ≤ H } = { ( i , t r e e k + 1 , q − 1 ( w ˉ b ) ↾ J + ) : i ∈ [ p ] , b ∈ V ( G ) , dist ( w j i , b ) ≤ H } = { ( i , μ ↾ J + ) : i ∈ [ p ] , ( j i , μ ) ∈ E k , q ( w ˉ ) } . \begin{aligned}
\mathcal{E}_{k,q}(\bar{w} \upharpoonright J)
&= \{(i,\mathrm{tree}_{k+1,q-1}((\bar{w}b) \upharpoonright J^{+})) : i \in[p],\ b \in V(G),\ \operatorname{dist}(w_{j_i},b) \le H\}\\
&= \{(i,\mathrm{tree}_{k+1,q-1}(\bar{w}b) \upharpoonright J^{+}) : i \in[p],\ b \in V(G),\ \operatorname{dist}(w_{j_i},b) \le H\}\\
&= \{(i,\mu\upharpoonright J^{+}) : i \in[p],\ (j_i,\mu) \in\mathcal{E}_{k,q}(\bar{w})\}.
\end{aligned} E k , q ( w ˉ ↾ J ) = {( i , tree k + 1 , q − 1 (( w ˉ b ) ↾ J + )) : i ∈ [ p ] , b ∈ V ( G ) , dist ( w j i , b ) ≤ H } = {( i , tree k + 1 , q − 1 ( w ˉ b ) ↾ J + ) : i ∈ [ p ] , b ∈ V ( G ) , dist ( w j i , b ) ≤ H } = {( i , μ ↾ J + ) : i ∈ [ p ] , ( j i , μ ) ∈ E k , q ( w ˉ )} . So the guard j i j_i j i is renumbered to i i i , as the variable x j i x_{j_i} x j i is renamed to x i x_i x i in the root. The right-hand side depends only on t r e e k , q ( w ˉ ) \mathrm{tree}_{k,q}(\bar{w}) tree k , q ( w ˉ ) and J J J and we define τ ↾ J \tau\upharpoonright J τ ↾ J accordingly. It is computed by one pass over τ \tau τ , followed by restoring canonical form. As no subtree grows, this takes polynomial time by Observation 10.1. ■
Lemma 10.6 (rank shift). There is a polynomial-time algorithm which maps tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) to tree k + 1 , q − 1 ( a ˉ ) \operatorname{tree}_{k+1,q-1}(\bar{a}) tree k + 1 , q − 1 ( a ˉ ) for all k ∈ N k \in\mathbb{N} k ∈ N , q ≥ 1 q \ge1 q ≥ 1 , partial graphs G G G and nonempty a ˉ ∈ V ( G ) ≤ k \bar{a} \in V(G)^{\le k} a ˉ ∈ V ( G ) ≤ k .
Proof. Since dist ( a 1 , a 1 ) = 0 \operatorname{dist}(a_1,a_1)=0 dist ( a 1 , a 1 ) = 0 , the guard 1 admits a 1 a_1 a 1 , so tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) has an extension ( 1 , μ ) (1,\mu) ( 1 , μ ) . Every such μ \mu μ is tree k + 1 , q − 1 ( a ˉ b ) \operatorname{tree}_{k+1,q-1}(\bar{a}b) tree k + 1 , q − 1 ( a ˉ b ) for some vertex b b b , and applying the algorithm of Lemma 10.5 yields μ ↾ ( 1 , … , ∣ a ˉ ∣ ) = tree k + 1 , q − 1 ( a ˉ ) \mu\mathord{\upharpoonright}(1,\ldots,|\bar{a}|)=\operatorname{tree}_{k+1,q-1}(\bar{a}) μ ↾ ( 1 , … , ∣ a ˉ ∣ ) = tree k + 1 , q − 1 ( a ˉ ) . ■
The following is an adaptation of [31 Lemma 3.1] .
Lemma 10.7 (far composition). There is an operation ∗ \ast ∗ on type trees such that for all k , q ∈ N k,q \in\mathbb{N} k , q ∈ N , partial graphs G G G and nonempty tuples a ˉ 1 , a ˉ 2 \bar{a}_1,\bar{a}_2 a ˉ 1 , a ˉ 2 with ∣ a ˉ 1 a ˉ 2 ∣ ≤ k |\bar{a}_1\bar{a}_2| \le k ∣ a ˉ 1 a ˉ 2 ∣ ≤ k and dist ( a ˉ 1 , a ˉ 2 ) > ρ − ( k , q ) \operatorname{dist}(\bar{a}_1,\bar{a}_2)>\rho^{-}(k,q) dist ( a ˉ 1 , a ˉ 2 ) > ρ − ( k , q ) ,
tree k , q ( a ˉ 1 ) ∗ tree k , q ( a ˉ 2 ) = tree k , q ( a ˉ 1 a ˉ 2 ) . \operatorname{tree}_{k,q}(\bar{a}_1)\ast\operatorname{tree}_{k,q}(\bar{a}_2)=\operatorname{tree}_{k,q}(\bar{a}_1\bar{a}_2). tree k , q ( a ˉ 1 ) ∗ tree k , q ( a ˉ 2 ) = tree k , q ( a ˉ 1 a ˉ 2 ) . Given τ 1 , τ 2 \tau_1,\tau_2 τ 1 , τ 2 one can compute τ 1 ∗ τ 2 \tau_1\ast\tau_2 τ 1 ∗ τ 2 in time poly k , q ( ∥ τ 1 ∥ + ∥ τ 2 ∥ ) ) \operatorname{poly}_{k,q}(\|\tau_1\|+\|\tau_2\|)) poly k , q ( ∥ τ 1 ∥ + ∥ τ 2 ∥ )) .
Proof. By induction on q q q . Write ℓ i : = ∣ a ˉ i ∣ \ell_i:=|\bar{a}_i| ℓ i := ∣ a ˉ i ∣ and τ i : = tree k , q ( a ˉ i ) \tau_i:=\operatorname{tree}_{k,q}(\bar{a}_i) τ i := tree k , q ( a ˉ i ) . Note that ℓ i \ell_i ℓ i can be deduced from τ i \tau_i τ i .
Consider an atom of distance rank ( k , q ) (k,q) ( k , q ) that mentions variables of both a ˉ 1 \bar{a}_1 a ˉ 1 and a ˉ 2 \bar{a}_2 a ˉ 2 . If the atom was true, we would have dist ( a ˉ 1 , a ˉ 2 ) ≤ 1 \operatorname{dist}(\bar{a}_1,\bar{a}_2)\le1 dist ( a ˉ 1 , a ˉ 2 ) ≤ 1 for an equality, edge, or non-edge atom, and dist ( a ˉ 1 , a ˉ 2 ) ≤ ρ − ( k , q ) \operatorname{dist}(\bar{a}_1,\bar{a}_2)\le\rho^{-}(k,q) dist ( a ˉ 1 , a ˉ 2 ) ≤ ρ − ( k , q ) for a binary distance atom, each contradicting dist ( a ˉ 1 , a ˉ 2 ) > ρ − ( k , q ) \operatorname{dist}(\bar{a}_1,\bar{a}_2)>\rho^{-}(k,q) dist ( a ˉ 1 , a ˉ 2 ) > ρ − ( k , q ) . Every other atom mentions only variables of a ˉ 1 \bar{a}_1 a ˉ 1 or only variables of a ˉ 2 \bar{a}_2 a ˉ 2 , and whether it holds is recorded in atp k , q ( a ˉ 1 ) \operatorname{atp}_{k,q}(\bar{a}_1) atp k , q ( a ˉ 1 ) or atp k , q ( a ˉ 2 ) \operatorname{atp}_{k,q}(\bar{a}_2) atp k , q ( a ˉ 2 ) . Hence atp k , q ( a ˉ 1 a ˉ 2 ) \operatorname{atp}_{k,q}(\bar{a}_1\bar{a}_2) atp k , q ( a ˉ 1 a ˉ 2 ) is determined by atp k , q ( a ˉ 1 ) \operatorname{atp}_{k,q}(\bar{a}_1) atp k , q ( a ˉ 1 ) and atp k , q ( a ˉ 2 ) \operatorname{atp}_{k,q}(\bar{a}_2) atp k , q ( a ˉ 2 ) . This settles the root label.
Let now q ≥ 1 q\ge1 q ≥ 1 . Put H : = ρ + ( k + 1 , q − 1 ) H:=\rho^{+}(k+1,q-1) H := ρ + ( k + 1 , q − 1 ) , and let ∗ \ast ∗ also denote the operation given by the inductive assumption for rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) . Write a ˉ 1 a ˉ 2 = ( c 1 , … , c ℓ 1 + ℓ 2 ) \bar{a}_1\bar{a}_2=(c_1,\ldots,c_{\ell_1+\ell_2}) a ˉ 1 a ˉ 2 = ( c 1 , … , c ℓ 1 + ℓ 2 ) , and split E k , q ( a ˉ 1 a ˉ 2 ) E_{k,q}(\bar{a}_1\bar{a}_2) E k , q ( a ˉ 1 a ˉ 2 ) by guards into E 1 ∪ E 2 E_1\cup E_2 E 1 ∪ E 2 , where
E 1 : = { ( i , tree k + 1 , q − 1 ( a ˉ 1 a ˉ 2 b ) ) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } , E_1:=\{(i,\operatorname{tree}_{k+1,q-1}(\bar{a}_1\bar{a}_2b)):i\in[\ell_1],\ b\in V(G),\ \operatorname{dist}(c_i,b)\le H\}, E 1 := {( i , tree k + 1 , q − 1 ( a ˉ 1 a ˉ 2 b )) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } ,
E 2 : = { ( i , tree k + 1 , q − 1 ( a ˉ 1 a ˉ 2 b ) ) : ℓ 1 < i ≤ ℓ 1 + ℓ 2 , b ∈ V ( G ) , dist ( c i , b ) ≤ H } . E_2:=\{(i,\operatorname{tree}_{k+1,q-1}(\bar{a}_1\bar{a}_2b)):\ell_1<i\le\ell_1+\ell_2,\ b\in V(G),\ \operatorname{dist}(c_i,b)\le H\}. E 2 := {( i , tree k + 1 , q − 1 ( a ˉ 1 a ˉ 2 b )) : ℓ 1 < i ≤ ℓ 1 + ℓ 2 , b ∈ V ( G ) , dist ( c i , b ) ≤ H } .
Consider E 1 E_1 E 1 , and let i , b i,b i , b satisfy its conditions. Then dist ( a ˉ 1 , b ) ≤ H \operatorname{dist}(\bar{a}_1,b)\le H dist ( a ˉ 1 , b ) ≤ H , and the triangle inequality, the hypothesis, (13) and (12) give
dist ( a ˉ 1 b , a ˉ 2 ) ≥ dist ( a ˉ 1 , a ˉ 2 ) − dist ( a ˉ 1 , b ) > ρ − ( k , q ) − H ≥ H ≥ ρ − ( k + 1 , q − 1 ) . \operatorname{dist}(\bar{a}_1b,\bar{a}_2)\ge\operatorname{dist}(\bar{a}_1,\bar{a}_2)-\operatorname{dist}(\bar{a}_1,b)>\rho^{-}(k,q)-H\ge H\ge\rho^{-}(k+1,q-1). dist ( a ˉ 1 b , a ˉ 2 ) ≥ dist ( a ˉ 1 , a ˉ 2 ) − dist ( a ˉ 1 , b ) > ρ − ( k , q ) − H ≥ H ≥ ρ − ( k + 1 , q − 1 ) .
Hence, we may apply the inductive assumption for rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) to the tuples a ˉ 1 b \bar{a}_1b a ˉ 1 b and a ˉ 2 \bar{a}_2 a ˉ 2 . Moreover, let J J J be the list of positions with a ˉ 1 a ˉ 2 b = ( a ˉ 1 b a ˉ 2 ) ↾ J \bar{a}_1\bar{a}_2b=(\bar{a}_1b\bar{a}_2)\mathord{\upharpoonright}J a ˉ 1 a ˉ 2 b = ( a ˉ 1 b a ˉ 2 ) ↾ J . Applying in this order the property of J J J , Lemma 10.5 and the inductive assumption, and finally the definition of E k , q ( a ˉ 1 ) E_{k,q}(\bar{a}_1) E k , q ( a ˉ 1 ) , we obtain
E 1 = { ( i , tree k + 1 , q − 1 ( a ˉ 1 b a ˉ 2 ) ↾ J ) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } = { ( i , ( tree k + 1 , q − 1 ( a ˉ 1 b ) ∗ tree k + 1 , q − 1 ( a ˉ 2 ) ) ↾ J ) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } = { ( i , ( μ ∗ tree k + 1 , q − 1 ( a ˉ 2 ) ) ↾ J ) : ( i , μ ) ∈ E k , q ( a ˉ 1 ) } , \begin{aligned}
E_1
&=\{(i,\operatorname{tree}_{k+1,q-1}(\bar{a}_1b\bar{a}_2)\mathord{\upharpoonright}J):i\in[\ell_1],\ b\in V(G),\ \operatorname{dist}(c_i,b)\le H\}\\
&=\{(i,(\operatorname{tree}_{k+1,q-1}(\bar{a}_1b)\ast\operatorname{tree}_{k+1,q-1}(\bar{a}_2))\mathord{\upharpoonright}J):i\in[\ell_1],\ b\in V(G),\ \operatorname{dist}(c_i,b)\le H\}\\
&=\{(i,(\mu\ast\operatorname{tree}_{k+1,q-1}(\bar{a}_2))\mathord{\upharpoonright}J):(i,\mu)\in E_{k,q}(\bar{a}_1)\},
\end{aligned} E 1 = {( i , tree k + 1 , q − 1 ( a ˉ 1 b a ˉ 2 ) ↾ J ) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } = {( i , ( tree k + 1 , q − 1 ( a ˉ 1 b ) ∗ tree k + 1 , q − 1 ( a ˉ 2 )) ↾ J ) : i ∈ [ ℓ 1 ] , b ∈ V ( G ) , dist ( c i , b ) ≤ H } = {( i , ( μ ∗ tree k + 1 , q − 1 ( a ˉ 2 )) ↾ J ) : ( i , μ ) ∈ E k , q ( a ˉ 1 )} ,
where tree k + 1 , q − 1 ( a ˉ 2 ) \operatorname{tree}_{k+1,q-1}(\bar{a}_2) tree k + 1 , q − 1 ( a ˉ 2 ) is obtained from τ 2 \tau_2 τ 2 by Lemma 10.6. Symmetrically, with the guard i i i of a ˉ 2 \bar{a}_2 a ˉ 2 renumbered to ℓ 1 + i \ell_1+i ℓ 1 + i as the variables of its root are shifted by ℓ 1 \ell_1 ℓ 1 , and without reordering since a ˉ 1 a ˉ 2 b \bar{a}_1\bar{a}_2b a ˉ 1 a ˉ 2 b already ends with b b b ,
E 2 = { ( ℓ 1 + i , tree k + 1 , q − 1 ( a ˉ 1 ) ∗ μ ) : ( i , μ ) ∈ E k , q ( a ˉ 2 ) } . E_2=\{(\ell_1+i,\operatorname{tree}_{k+1,q-1}(\bar{a}_1)\ast\mu):(i,\mu)\in E_{k,q}(\bar{a}_2)\}. E 2 = {( ℓ 1 + i , tree k + 1 , q − 1 ( a ˉ 1 ) ∗ μ ) : ( i , μ ) ∈ E k , q ( a ˉ 2 )} .
The right-hand sides depend only on τ 1 \tau_1 τ 1 and τ 2 \tau_2 τ 2 and we define τ 1 ∗ τ 2 \tau_1\ast\tau_2 τ 1 ∗ τ 2 accordingly. By Lemmas 10.5 and 10.6 and the inductive assumption, the work per input extension is poly k , q ( ∥ τ 1 ∥ + ∥ τ 2 ∥ ) \operatorname{poly}_{k,q}(\|\tau_1\|+\|\tau_2\|) poly k , q ( ∥ τ 1 ∥ + ∥ τ 2 ∥ ) , and the recursion has fixed depth q q q . Restoring canonical form by Observation 10.1 stays within this bound, which proves the stated running time. ■
Scatter types and far trees
The type tree of a tuple a ˉ \bar{a} a ˉ records extensions only by vertices near a ˉ \bar{a} a ˉ . A resolve, however, can bring vertices far from a ˉ \bar{a} a ˉ within guard range, so lifting type trees through a resolve (§ 10.6 ) also requires the type trees of such far away vertices. For a vertex b b b far from a ˉ \bar{a} a ˉ , the type tree of a ˉ b \bar{a}b a ˉ b is obtained from those of a ˉ \bar{a} a ˉ and b b b by far composition (Lemma 10.7 ). As for quantifiers over far witnesses in the proof of Gaifman’s locality theorem, it therefore suffices to know which type trees are realized far from a ˉ \bar{a} a ˉ . We collect them in the far tree of a ˉ \bar{a} a ˉ .
The far tree is not determined by the type tree of a ˉ \bar{a} a ˉ alone. It also depends on global information about G G G . As in Gaifman’s proof, this global information is captured by an analogue of the basic local sentences, which we call the scatter type of G G G . In this section we show that the far tree of a ˉ \bar{a} a ˉ is computable from the type tree of a ˉ \bar{a} a ˉ and the scatter type of G G G .
Section 11.1 defines scatter types, and Section 11.2 uses them to compute the far tree. The model checking algorithm maintains the type trees of all vertices, and Lemma 11.3 shows that the scatter type can be computed from these.
Scatter types
Let G G G be a partial graph. A set S S S of vertices of G G G is r r r -scattered if all vertices in S S S have pairwise distance larger than r r r in G G G . Fix, once and for all, a linear order on V ( G ) V(G) V ( G ) . The algorithms below use it without further mention. For a set X ⊆ V ( G ) X \subseteq V(G) X ⊆ V ( G ) and r ∈ N r \in\mathbb{N} r ∈ N , let S r ( X ) S_r(X) S r ( X ) denote the inclusion-wise maximal r r r -scattered subset of X X X constructed by the greedy process that repeatedly adds the least available vertex. If ν \nu ν is a type tree of distance rank ( k , q ) (k,q) ( k , q ) and arity one, write
[ ν ] G : = { b ∈ V ( G ) : tree k , q ( b ) = ν } [\nu]^G := \{b \in V(G) : \operatorname{tree}_{k,q}(b) = \nu\} [ ν ] G := { b ∈ V ( G ) : tree k , q ( b ) = ν }
for the set of its realizations.
Definition 11.1 (scatter type). Let G G G be a partial graph and k , q ∈ N k,q \in\mathbb{N} k , q ∈ N . The ( k , q ) (k,q) ( k , q ) -scatter type stp k , q G \operatorname{stp}_{k,q}^{G} stp k , q G is the function with domain
\left\{(r,\operatorname{tree}_{k+i,q-i}(b)) \mathrel{\left|} i \in[q],\ b \in V(G),\ r \in[9^{q+i}\rho^{-(k+i,q-i)}]\right.\right\}
defined by
stp k , q G ( r , ν ) : = min ( ∣ S r ( [ ν ] G ) ∣ , k + q ) . \operatorname{stp}_{k,q}^{G}(r,\nu) := \min\left(|S_r([\nu]^G)|, k+q\right). stp k , q G ( r , ν ) := min ( ∣ S r ([ ν ] G ) ∣ , k + q ) .
For q = 0 q=0 q = 0 the domain is empty and stp k , 0 \operatorname{stp}_{k,0} stp k , 0 is the empty function. We write stp k , q = stp k , q G \operatorname{stp}_{k,q}=\operatorname{stp}_{k,q}^{G} stp k , q = stp k , q G .
We represent a scatter type canonically as a sorted list of its triples ( r , ν , stp k , q ( r , ν ) ) (r,\nu,\operatorname{stp}_{k,q}(r,\nu)) ( r , ν , stp k , q ( r , ν )) , using the canonical representation of ν \nu ν . Its representation size, denoted by ∥ stp k , q ∥ \lVert\operatorname{stp}_{k,q}\rVert ∥ stp k , q ∥ , is the total size of this list, including the encodings of the radii and values.
Lemma 11.2. For every partial graph G G G and q ≥ 1 q \ge1 q ≥ 1 , the function stp k + 1 , q − 1 \operatorname{stp}_{k+1,q-1} stp k + 1 , q − 1 is the restriction of stp k , q \operatorname{stp}_{k,q} stp k , q to domain ( stp k + 1 , q − 1 ) \operatorname{domain}(\operatorname{stp}_{k+1,q-1}) domain ( stp k + 1 , q − 1 ) .
Proof. Level i i i of domain ( stp k + 1 , q − 1 ) \operatorname{domain}(\operatorname{stp}_{k+1,q-1}) domain ( stp k + 1 , q − 1 ) equals level i + 1 i+1 i + 1 of domain ( stp k , q ) \operatorname{domain}(\operatorname{stp}_{k,q}) domain ( stp k , q ) : the ranks ( ( k + 1 ) + i , ( q − 1 ) − i ) = ( k + ( i + 1 ) , q − ( i + 1 ) ) ((k+1)+i,(q-1)-i)=(k+(i+1),q-(i+1)) (( k + 1 ) + i , ( q − 1 ) − i ) = ( k + ( i + 1 ) , q − ( i + 1 )) and the radius bounds coincide, the value caps ( k + 1 ) + ( q − 1 ) = k + q (k+1)+(q-1)=k+q ( k + 1 ) + ( q − 1 ) = k + q coincide, and both functions use the same canonical set S r ( [ ν ] G ) S_r([\nu]^G) S r ([ ν ] G ) .
In the model checking application, the type trees of all vertices are maintained by a dynamic-programming algorithm, and the scatter type is computed from them. Recall that ∣ G ∣ = ∣ V ( G ) ∣ |G|=|V(G)| ∣ G ∣ = ∣ V ( G ) ∣ and ∥ G ∥ = ∣ V ( G ) ∣ + ∣ R ( G ) ∣ \lVert G\rVert=|V(G)|+|R(G)| ∥ G ∥ = ∣ V ( G ) ∣ + ∣ R ( G ) ∣ .
Lemma 11.3. There is an algorithm which, given a nonempty partial graph G G G , numbers k ≥ 1 k \ge1 k ≥ 1 and q ∈ N q \in\mathbb{N} q ∈ N , its distance matrix D G D_G D G , and the family ( tree k , q ( a ) : a ∈ V ( G ) ) (\operatorname{tree}_{k,q}(a) : a \in V(G)) ( tree k , q ( a ) : a ∈ V ( G )) , computes stp k , q \operatorname{stp}_{k,q} stp k , q in time
∣ G ∣ 2 ⋅ poly k , q ( max a ∈ V ( G ) ∥ tree k , q ( a ) ∥ ) . |G|^2 \cdot\operatorname{poly}_{k,q}\left(\max_{a \in V(G)} \lVert\operatorname{tree}_{k,q}(a) \rVert\right). ∣ G ∣ 2 ⋅ poly k , q ( a ∈ V ( G ) max ∥ tree k , q ( a )∥ ) . Proof. Put M : = max a ∈ V ( G ) ∥ tree k , q ( a ) ∥ M := \max_{a \in V(G)} \lVert\operatorname{tree}_{k,q}(a) \rVert M := max a ∈ V ( G ) ∥ tree k , q ( a )∥ . For every a ∈ V ( G ) a \in V(G) a ∈ V ( G ) and i ∈ [ q ] i \in[q] i ∈ [ q ] , applying Lemma 10.6 i i i times to tree k , q ( a ) \operatorname{tree}_{k,q}(a) tree k , q ( a ) yields tree k + i , q − i ( a ) \operatorname{tree}_{k+i,q-i}(a) tree k + i , q − i ( a ) , of size poly k , q ( M ) \operatorname{poly}_{k,q}(M) poly k , q ( M ) . This takes ∣ G ∣ ⋅ poly k , q ( M ) |G| \cdot\operatorname{poly}_{k,q}(M) ∣ G ∣ ⋅ poly k , q ( M ) time and gives domain ( stp k , q ) \operatorname{domain}(\operatorname{stp}_{k,q}) domain ( stp k , q ) , as each radius is O k , q ( 1 ) O_{k,q}(1) O k , q ( 1 ) ; in particular, ∣ domain ( stp k , q ) ∣ = O k , q ( ∣ G ∣ ) |\operatorname{domain}(\operatorname{stp}_{k,q})| = O_{k,q}(|G|) ∣ domain ( stp k , q ) ∣ = O k , q ( ∣ G ∣ ) .
For each ( r , ν ) ∈ domain ( stp k , q ) (r,\nu) \in\operatorname{domain}(\operatorname{stp}_{k,q}) ( r , ν ) ∈ domain ( stp k , q ) , run the greedy process defining S r ( [ ν ] G ) S_r([\nu]^G) S r ([ ν ] G ) , stopping after k + q k+q k + q vertices were discovered. It scans V ( G ) V(G) V ( G ) in order, testing membership in [ ν ] G [\nu]^G [ ν ] G by comparing the trees computed above with ν \nu ν . After adding a vertex v v v , scan the row D G ( v , ⋅ ) D_G(v,\mathord\cdot) D G ( v , ⋅ ) and mark all vertices u u u with D G ( v , u ) ≤ r D_G(v,u) \le r D G ( v , u ) ≤ r as unavailable. At most k + q k+q k + q rows are scanned, so one run takes ∣ G ∣ ⋅ poly k , q ( M ) |G| \cdot\operatorname{poly}_{k,q}(M) ∣ G ∣ ⋅ poly k , q ( M ) time, and the ∣ domain ( stp k , q ) ∣ = O k , q ( ∣ G ∣ ) |\operatorname{domain}(\operatorname{stp}_{k,q})| = O_{k,q}(|G|) ∣ domain ( stp k , q ) ∣ = O k , q ( ∣ G ∣ ) runs together take the stated time.
The far tree
Definition 11.4. For a partial graph G G G , k ∈ N k \in\mathbb{N} k ∈ N , q ≥ 1 q \ge1 q ≥ 1 , and a nonempty tuple a ˉ ∈ V ( G ) ≤ k \bar{a} \in V(G)^{\le k} a ˉ ∈ V ( G ) ≤ k , define
ftree k , q ( a ˉ ) : = { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , dist ( a ˉ , b ) > ρ − ( k + 1 , q − 1 ) } . \operatorname{ftree}_{k,q}(\bar{a}) := \{\operatorname{tree}_{k+1,q-1}(b) : b \in V(G),\ \operatorname{dist}(\bar{a},b) > \rho^-(k+1,q-1)\}. ftree k , q ( a ˉ ) := { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , dist ( a ˉ , b ) > ρ − ( k + 1 , q − 1 )} .
The goal of this subsection is to compute ftree k , q ( a ˉ ) \operatorname{ftree}_{k,q}(\bar{a}) ftree k , q ( a ˉ ) from tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) and stp k , q \operatorname{stp}_{k,q} stp k , q (Lemma 11.6 ). Our main tool is the following clustering lemma [31 Corollary 3.4 and Lemma 3.5] .
Lemma 11.5 ([31 ] ). Let r ∈ N r \in\mathbb{N} r ∈ N , let ℓ ≥ 1 \ell\ge1 ℓ ≥ 1 , let G G G be a graph, and let a ˉ = ( a 1 , … , a ℓ ) ∈ V ( G ) ℓ \bar{a} = (a_1,\ldots,a_\ell) \in V(G)^\ell a ˉ = ( a 1 , … , a ℓ ) ∈ V ( G ) ℓ . There exist a radius R R R with r ≤ R ≤ 9 ℓ − 1 r r \le R \le9^{\ell-1}r r ≤ R ≤ 9 ℓ − 1 r and a partition B \mathcal{B} B of { a 1 , … , a ℓ } \{a_1,\ldots,a_\ell\} { a 1 , … , a ℓ } with the following property. For every X ⊆ V ( G ) X \subseteq V(G) X ⊆ V ( G ) , inclusion-wise maximal 4 R 4R 4 R -scattered subset S ⊆ X S \subseteq X S ⊆ X , and H ≥ 4 R + r H \ge4R+r H ≥ 4 R + r ,
∃ x ∈ X : dist G ( x , a ˉ ) > r ⟺ ∃ x ∈ X : r < dist G ( x , a ˉ ) ≤ H , \exists x \in X : \operatorname{dist}^G(x,\bar{a}) > r \quad\Longleftrightarrow\quad\exists x \in X : r < \operatorname{dist}^G(x,\bar{a}) \le H, ∃ x ∈ X : dist G ( x , a ˉ ) > r ⟺ ∃ x ∈ X : r < dist G ( x , a ˉ ) ≤ H , or
∣ { B ∈ B : ∃ x ∈ X : dist G ( x , B ) ≤ r } ∣ < ∣ S ∣ . \left|\{B \in\mathcal{B} : \exists x \in X : \operatorname{dist}^G(x,B) \le r\}\right| < |S|. { B ∈ B : ∃ x ∈ X : dist G ( x , B ) ≤ r } < ∣ S ∣. Moreover, the radius R R R and the partition B \mathcal{B} B can be determined by tests of the form dist G ( a i , a j ) ≤ s \operatorname{dist}^G(a_i,a_j) \le s dist G ( a i , a j ) ≤ s , where i , j ∈ [ ℓ ] i,j \in[\ell] i , j ∈ [ ℓ ] and s ≤ 8 ⋅ 9 ℓ − 1 r s \le8 \cdot9^{\ell-1}r s ≤ 8 ⋅ 9 ℓ − 1 r .
Lemma 11.6. Fix k ∈ N k \in\mathbb{N} k ∈ N and q ≥ 1 q \ge1 q ≥ 1 , let G G G be a partial graph, and let a ˉ ∈ V ( G ) ≤ k \bar{a} \in V(G)^{\le k} a ˉ ∈ V ( G ) ≤ k be nonempty. Then ftree k , q ( a ˉ ) \operatorname{ftree}_{k,q}(\bar{a}) ftree k , q ( a ˉ ) is computable from tree k , q ( a ˉ ) \operatorname{tree}_{k,q}(\bar{a}) tree k , q ( a ˉ ) and stp k , q \operatorname{stp}_{k,q} stp k , q in time
∥ stp k , q ∥ ⋅ poly k , q ( ∥ tree k , q ( a ˉ ) ∥ ) . \lVert\operatorname{stp}_{k,q} \rVert\cdot\operatorname{poly}_{k,q}\left(\lVert\operatorname{tree}_{k,q}(\bar{a}) \rVert\right). ∥ stp k , q ∥ ⋅ poly k , q ( ∥ tree k , q ( a ˉ )∥ ) . Proof. Let τ : = tree k , q ( a ˉ ) \tau:= \operatorname{tree}_{k,q}(\bar{a}) τ := tree k , q ( a ˉ ) , σ : = stp k , q \sigma:= \operatorname{stp}_{k,q} σ := stp k , q , r : = ρ − ( k + 1 , q − 1 ) r := \rho^-(k+1,q-1) r := ρ − ( k + 1 , q − 1 ) , H : = ρ + ( k + 1 , q − 1 ) H := \rho^+(k+1,q-1) H := ρ + ( k + 1 , q − 1 ) , and ℓ : = ∣ a ˉ ∣ \ell:= |\bar{a}| ℓ := ∣ a ˉ ∣ . The entries with i = 1 i=1 i = 1 in the domain of σ \sigma σ let us compute the set
T : = { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) } . T := \{\operatorname{tree}_{k+1,q-1}(b) : b \in V(G)\}. T := { tree k + 1 , q − 1 ( b ) : b ∈ V ( G )} . Then
ftree k , q ( a ˉ ) = { ν ∈ T : ∃ b ∈ [ ν ] G : dist ( a ˉ , b ) > r } . \operatorname{ftree}_{k,q}(\bar{a}) = \{\nu\in T : \exists b \in[\nu]^G : \operatorname{dist}(\bar{a},b) > r\}. ftree k , q ( a ˉ ) = { ν ∈ T : ∃ b ∈ [ ν ] G : dist ( a ˉ , b ) > r } .
Rewriting the target. The tree τ \tau τ only records vertices within distance H H H of a ˉ \bar{a} a ˉ , while a vertex b ∈ [ ν ] G b \in[\nu]^G b ∈ [ ν ] G with dist ( a ˉ , b ) > r \operatorname{dist}(\bar{a},b) > r dist ( a ˉ , b ) > r may be farther away than H H H . We will now use Lemma 11.5 to replace the existence of such a vertex by two conditions that we can check. Apply the lemma with radius r r r to the Gaifman graph of G G G (with vertex set V ( G ) V(G) V ( G ) and edge set R ( G ) R(G) R ( G ) ) and to a ˉ \bar{a} a ˉ , and obtain a radius R R R and a partition B \mathcal{B} B of { a 1 , … , a ℓ } \{a_1,\ldots,a_\ell\} { a 1 , … , a ℓ } . Since ℓ ≤ k \ell\leq k ℓ ≤ k ,
4 R ≤ 4 ⋅ 9 ℓ − 1 r ≤ 9 k + 1 r , 4 R + r ≤ ( 4 ⋅ 9 ℓ − 1 + 1 ) r ≤ 9 k r ≤ H . 4R \leq4 \cdot9^{\ell-1}r \leq9^{k+1}r,
\qquad
4R+r \leq(4 \cdot9^{\ell-1}+1)r \leq9^k r \leq H. 4 R ≤ 4 ⋅ 9 ℓ − 1 r ≤ 9 k + 1 r , 4 R + r ≤ ( 4 ⋅ 9 ℓ − 1 + 1 ) r ≤ 9 k r ≤ H .
The first chain shows that ( 4 R , ν ) (4R,\nu) ( 4 R , ν ) lies in the domain of σ \sigma σ for every ν ∈ T \nu\in\mathcal{T} ν ∈ T . The second is the hypothesis H ≥ 4 R + r H \geq4R+r H ≥ 4 R + r of Lemma 11.5 , so the lemma applies to every X ⊆ V ( G ) X \subseteq V(G) X ⊆ V ( G ) together with S 4 R ( X ) S_{4R}(X) S 4 R ( X ) . Define
N : = { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , r < dist ( a ˉ , b ) ≤ H } , \mathcal{N} := \{\operatorname{tree}_{k+1,q-1}(b) : b \in V(G),\ r < \operatorname{dist}(\bar{a},b) \leq H\}, N := { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , r < dist ( a ˉ , b ) ≤ H } ,
N B : = { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , dist ( b , B ) ≤ r } for B ∈ B . \mathcal{N}_B := \{\operatorname{tree}_{k+1,q-1}(b) : b \in V(G),\ \operatorname{dist}(b,B) \leq r\}
\qquad\text{for } B \in\mathcal{B}. N B := { tree k + 1 , q − 1 ( b ) : b ∈ V ( G ) , dist ( b , B ) ≤ r } for B ∈ B .
For ν ∈ T \nu\in\mathcal{T} ν ∈ T , Lemma 11.5 applied to X : = [ ν ] G X := [\nu]^G X := [ ν ] G and S : = S 4 R ( [ ν ] G ) S := S_{4R}([\nu]^G) S := S 4 R ([ ν ] G ) states that
∃ b ∈ [ ν ] G : dist ( a ˉ , b ) > r ⟺ ν ∈ N or ∣ { B ∈ B : ν ∈ N B } ∣ < ∣ S 4 R ( [ ν ] G ) ∣ . \exists b \in[\nu]^G : \operatorname{dist}(\bar{a},b) > r
\quad\Longleftrightarrow\quad
\nu\in\mathcal{N}\ \text{ or }\ \left|\{B \in\mathcal{B} : \nu\in\mathcal{N}_B\}\right| < |S_{4R}([\nu]^G)|. ∃ b ∈ [ ν ] G : dist ( a ˉ , b ) > r ⟺ ν ∈ N or ∣ { B ∈ B : ν ∈ N B } ∣ < ∣ S 4 R ([ ν ] G ) ∣.
As σ ( 4 R , ν ) = min ( ∣ S 4 R ( [ ν ] G ) ∣ , k + q ) \sigma(4R,\nu) = \min(|S_{4R}([\nu]^G)|, k+q) σ ( 4 R , ν ) = min ( ∣ S 4 R ([ ν ] G ) ∣ , k + q ) by Definition 11.1, and ∣ { B ∈ B : ν ∈ N B } ∣ ≤ ∣ B ∣ ≤ ℓ ≤ k < k + q \left|\{B \in\mathcal{B} : \nu\in\mathcal{N}_B\}\right| \leq|\mathcal{B}| \leq\ell\leq k < k+q ∣ { B ∈ B : ν ∈ N B } ∣ ≤ ∣ B ∣ ≤ ℓ ≤ k < k + q , we can equivalently replace the bound ∣ S 4 R ( [ ν ] G ) ∣ |S_{4R}([\nu]^G)| ∣ S 4 R ([ ν ] G ) ∣ above by σ ( 4 R , ν ) \sigma(4R,\nu) σ ( 4 R , ν ) . Therefore,
ftree k , q ( a ˉ ) = { ν ∈ T : ν ∈ N or ∣ { B ∈ B : ν ∈ N B } ∣ < σ ( 4 R , ν ) } . \operatorname{ftree}_{k,q}(\bar{a}) = \{\nu\in\mathcal{T} : \nu\in\mathcal{N}\ \text{ or }\ \left|\{B \in\mathcal{B} : \nu\in\mathcal{N}_B\}\right| < \sigma(4R,\nu)\}. ftree k , q ( a ˉ ) = { ν ∈ T : ν ∈ N or ∣ { B ∈ B : ν ∈ N B } ∣ < σ ( 4 R , ν )} .
In this expression, T \mathcal{T} T and the values σ ( 4 R , ν ) \sigma(4R,\nu) σ ( 4 R , ν ) can be read from σ \sigma σ . It remains to compute R R R , B \mathcal{B} B , N \mathcal{N} N , and the sets N B \mathcal{N}_B N B from τ \tau τ .
Reading R R R and B \mathcal{B} B off τ \tau τ . By Lemma 11.5 , R R R and B \mathcal{B} B are determined by tests dist ( a i , a j ) ≤ s \operatorname{dist}(a_i,a_j) \leq s dist ( a i , a j ) ≤ s with i , j ∈ [ ℓ ] i,j \in[\ell] i , j ∈ [ ℓ ] and
s ≤ 8 ⋅ 9 ℓ − 1 r ≤ 9 k r ≤ H ≤ ρ − ( k , q ) . s \leq8 \cdot9^{\ell-1}r \leq9^k r \leq H \leq\rho^-(k,q). s ≤ 8 ⋅ 9 ℓ − 1 r ≤ 9 k r ≤ H ≤ ρ − ( k , q ) .
These are binary distance atoms of radius at most ρ − ( k , q ) \rho^-(k,q) ρ − ( k , q ) and hence determined by the label atp k , q ( a ˉ ) \operatorname{atp}_{k,q}(\bar{a}) atp k , q ( a ˉ ) of the root of τ \tau τ . We represent every set B ∈ B B \in\mathcal{B} B ∈ B by its set of positions I B : = { i ∈ [ ℓ ] : a i ∈ B } I_B := \{i \in[\ell] : a_i \in B\} I B := { i ∈ [ ℓ ] : a i ∈ B } , which is determined by the equality atoms in the root atomic type of τ \tau τ .
Reading N \mathcal{N} N and N B \mathcal{N}_B N B off τ \tau τ . The trees attached to the root of τ \tau τ are exactly the trees tree k + 1 , q − 1 ( a ˉ b ) \operatorname{tree}_{k+1,q-1}(\bar{a}b) tree k + 1 , q − 1 ( a ˉ b ) with b ∈ V ( G ) b \in V(G) b ∈ V ( G ) and dist ( a ˉ , b ) ≤ H \operatorname{dist}(\bar{a},b) \leq H dist ( a ˉ , b ) ≤ H . Such a tree μ \mu μ determines two things about b b b : by Lemma 10.5 , μ ↾ ( ℓ + 1 ) = tree k + 1 , q − 1 ( b ) \mu\mathbin{\upharpoonright}(\ell+1) = \operatorname{tree}_{k+1,q-1}(b) μ ↾ ( ℓ + 1 ) = tree k + 1 , q − 1 ( b ) , and since the root atomic type atp k + 1 , q − 1 ( a ˉ b ) \operatorname{atp}_{k+1,q-1}(\bar{a}b) atp k + 1 , q − 1 ( a ˉ b ) of μ \mu μ contains the binary distance atoms of radius at most ρ − ( k + 1 , q − 1 ) = r \rho^-(k+1,q-1) = r ρ − ( k + 1 , q − 1 ) = r , we have μ ⊨ dist ( x j , x ℓ + 1 ) ≤ r \mu\models\operatorname{dist}(x_j,x_{\ell+1}) \leq r μ ⊨ dist ( x j , x ℓ + 1 ) ≤ r if and only if dist ( a j , b ) ≤ r \operatorname{dist}(a_j,b) \leq r dist ( a j , b ) ≤ r , for every j ∈ [ ℓ ] j \in[\ell] j ∈ [ ℓ ] . Therefore,
N = { μ ↾ ( ℓ + 1 ) : ( i , μ ) ∈ E k , q ( a ˉ ) , μ ⊨ ⋀ j ∈ [ ℓ ] dist ( x j , x ℓ + 1 ) > r } . \mathcal{N} = \{\mu\mathbin{\upharpoonright}(\ell+1) : (i,\mu) \in\mathcal{E}_{k,q}(\bar{a}),\ \mu\models\bigwedge_{j\in[\ell]} \operatorname{dist}(x_j,x_{\ell+1}) > r\}. N = { μ ↾ ( ℓ + 1 ) : ( i , μ ) ∈ E k , q ( a ˉ ) , μ ⊨ j ∈ [ ℓ ] ⋀ dist ( x j , x ℓ + 1 ) > r } .
Likewise, since r ≤ H r \leq H r ≤ H , the condition dist ( b , B ) ≤ r \operatorname{dist}(b,B) \leq r dist ( b , B ) ≤ r implies dist ( a ˉ , b ) ≤ H \operatorname{dist}(\bar{a},b) \leq H dist ( a ˉ , b ) ≤ H , and
N B = { μ ↾ ( ℓ + 1 ) : ( i , μ ) ∈ E k , q ( a ˉ ) , μ ⊨ ⋀ j ∈ I B dist ( x j , x ℓ + 1 ) ≤ r } . \mathcal{N}_B = \{\mu\mathbin{\upharpoonright}(\ell+1) : (i,\mu) \in\mathcal{E}_{k,q}(\bar{a}),\ \mu\models\bigwedge_{j\in I_B} \operatorname{dist}(x_j,x_{\ell+1}) \leq r\}. N B = { μ ↾ ( ℓ + 1 ) : ( i , μ ) ∈ E k , q ( a ˉ ) , μ ⊨ j ∈ I B ⋀ dist ( x j , x ℓ + 1 ) ≤ r } .
The right-hand sides depend only on τ \tau τ . Substituting them into the expression for ftree k , q ( a ˉ ) \operatorname{ftree}_{k,q}(\bar{a}) ftree k , q ( a ˉ ) above gives a description in terms of τ \tau τ and σ \sigma σ only.
Running time. The radius R R R and the sets I B \mathcal{I}_B I B are read off the root label of τ \tau τ . For all extensions ( i , μ ) (i,\mu) ( i , μ ) of τ \tau τ , the trees μ ↾ ( ℓ + 1 ) \mu\mathord{\upharpoonright}(\ell+1) μ ↾ ( ℓ + 1 ) are obtained by Lemma 10.5 and the atoms dist ( x j , x ℓ + 1 ) ≤ r \operatorname{dist}(x_j,x_{\ell+1}) \le r dist ( x j , x ℓ + 1 ) ≤ r are read off the root of μ \mu μ , in time poly k , q ( ∥ τ ∥ ) \operatorname{poly}_{k,q}(\lVert\tau\rVert) poly k , q (∥ τ ∥) in total. Collecting them yields N \mathcal{N} N and the at most k k k sets N B \mathcal{N}_B N B within the same bound. The expression for ftree k , q ( a ˉ ) \operatorname{ftree}_{k,q}(\bar{a}) ftree k , q ( a ˉ ) is then evaluated by one scan of σ \sigma σ : for every entry ( 4 R , ν , σ ( 4 R , ν ) ) (4R,\nu,\sigma(4R,\nu)) ( 4 R , ν , σ ( 4 R , ν )) with ν \nu ν of rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) , membership of ν \nu ν in N \mathcal{N} N and in each N B \mathcal{N}_B N B is tested by comparing ν \nu ν with every element of these at most k + 1 k+1 k + 1 sets, in time O ( k ⋅ ∥ τ ∥ ⋅ ( ∥ ν ∥ + ∥ τ ∥ ) ) O(k\cdot\lVert\tau\rVert\cdot(\lVert\nu\rVert+\lVert\tau\rVert)) O ( k ⋅ ∥ τ ∥ ⋅ (∥ ν ∥ + ∥ τ ∥)) . Summed over all entries of σ \sigma σ this is O ( ∥ σ ∥ ⋅ poly k , q ( ∥ τ ∥ ) ) O(\lVert\sigma\rVert\cdot\operatorname{poly}_{k,q}(\lVert\tau\rVert)) O (∥ σ ∥ ⋅ poly k , q (∥ τ ∥)) , which gives the stated running time. ■
Lifting type trees through merges and resolves
The model checking algorithm will process the construction sequence step by step and maintain the type trees of all vertices. We first show how to lift type trees through a merge, and then through a resolve.
Lemma 12.1 (merge lift). Fix ℓ ≤ k \ell\le k ℓ ≤ k and q ∈ N q \in\mathbb{N} q ∈ N . Let G G G be a partial graph and a ˉ ∈ V ( G ) ℓ \bar{a} \in V(G)^\ell a ˉ ∈ V ( G ) ℓ . Given tree k , q G ( a ˉ ) \operatorname{tree}^{G}_{k,q}(\bar{a}) tree k , q G ( a ˉ ) and two distinct colors P , Q P,Q P , Q , one can compute tree k , q H ( a ˉ ) \operatorname{tree}^{H}_{k,q}(\bar{a}) tree k , q H ( a ˉ ) , where H = merge P , Q ( G ) H=\operatorname{merge}_{P,Q}(G) H = merge P , Q ( G ) , in time poly k , q ( ∥ tree k , q G ( a ˉ ) ∥ ) \operatorname{poly}_{k,q}(\lVert\operatorname{tree}^{G}_{k,q}(\bar{a})\rVert) poly k , q (∥ tree k , q G ( a ˉ )∥) .
Proof. We proceed by induction on q q q .
Root labels. The partial graphs G G G and H H H have the same resolved pairs, so all distances agree, and only the colors P P P and Q Q Q change. Hence, for every vertex u u u and s ∈ N s \in\mathbb{N} s ∈ N ,
H ⊨ P ( u ) ⟺ G ⊨ P ( u ) ∨ Q ( u ) , H ⊨ Q ( u ) ⟺ f a l s e , H ⊨ dist ( u , P ) < s ⟺ G ⊨ ( dist ( u , P ) < s ) ∨ ( dist ( u , Q ) < s ) , H ⊨ dist ( u , Q ) < s ⟺ f a l s e , \begin{aligned}
H \models P(u) &\Longleftrightarrow G \models P(u) \lor Q(u),\\
H \models Q(u) &\Longleftrightarrow\mathit{false},\\
H \models\operatorname{dist}(u,P)<s &\Longleftrightarrow G \models\bigl(\operatorname{dist}(u,P)<s\bigr)\lor\bigl(\operatorname{dist}(u,Q)<s\bigr),\\
H \models\operatorname{dist}(u,Q)<s &\Longleftrightarrow\mathit{false},
\end{aligned} H ⊨ P ( u ) H ⊨ Q ( u ) H ⊨ dist ( u , P ) < s H ⊨ dist ( u , Q ) < s ⟺ G ⊨ P ( u ) ∨ Q ( u ) , ⟺ false , ⟺ G ⊨ ( dist ( u , P ) < s ) ∨ ( dist ( u , Q ) < s ) , ⟺ false ,
and every other atom has the same interpretation in G G G and H H H . This allows us to rewrite every atom φ \varphi φ into a quantifier-free formula φ ′ \varphi' φ ′ of the same distance rank, so that H ⊨ φ ( a ˉ ) H \models\varphi(\bar{a}) H ⊨ φ ( a ˉ ) if and only if G ⊨ φ ′ ( a ˉ ) G \models\varphi'(\bar{a}) G ⊨ φ ′ ( a ˉ ) . Since whether or not G ⊨ φ ′ ( a ˉ ) G \models\varphi'(\bar{a}) G ⊨ φ ′ ( a ˉ ) is determined by atp k , q G ( a ˉ ) \operatorname{atp}^{G}_{k,q}(\bar{a}) atp k , q G ( a ˉ ) , it follows that the new root label atp k , q H ( a ˉ ) \operatorname{atp}^{H}_{k,q}(\bar{a}) atp k , q H ( a ˉ ) can be computed from atp k , q G ( a ˉ ) \operatorname{atp}^{G}_{k,q}(\bar{a}) atp k , q G ( a ˉ ) . Only atoms mentioning P P P or Q Q Q change, so the new root label is obtained by one pass over the old root label and is no larger. This settles the root label.
Extensions. Let q ≥ 1 q \ge1 q ≥ 1 . Since dist H = dist G \operatorname{dist}^{H}=\operatorname{dist}^{G} dist H = dist G , every guard admits the same vertices in G G G and H H H , so the inductive assumption gives E k , q H ( a ˉ ) = { ( i , F ( μ ) ) : ( i , μ ) ∈ E k , q G ( a ˉ ) } \mathcal{E}^{H}_{k,q}(\bar{a})=\{(i,F(\mu)):(i,\mu)\in\mathcal{E}^{G}_{k,q}(\bar{a})\} E k , q H ( a ˉ ) = {( i , F ( μ )) : ( i , μ ) ∈ E k , q G ( a ˉ )} , where F ( μ ) F(\mu) F ( μ ) is obtained inductively. Together with the root label, this gives tree k , q H ( a ˉ ) \operatorname{tree}^{H}_{k,q}(\bar{a}) tree k , q H ( a ˉ ) .
Running time. The transformation replaces atoms in the label of every node and keeps the guards, so it visits each node of the input tree once, and no tree grows. By Observation 10.1 , restoring canonical form takes time polynomial in the size of the tree.
A resolve can bring vertices far from a tuple within guard range. Their type trees are not recorded in the old type tree of the tuple, and we obtain them from the far tree instead.
Lemma 12.2 (resolve lift). Let k ≥ 1 k \ge1 k ≥ 1 and q ∈ N q \in\mathbb{N} q ∈ N . Given a partial graph G G G , its distance matrix D G D_G D G , colors P , Q P,Q P , Q , a sign ± \pm ± , and ( tree k , q G ( a ) : a ∈ V ( G ) ) (\operatorname{tree}^{G}_{k,q}(a):a \in V(G)) ( tree k , q G ( a ) : a ∈ V ( G )) , one can compute H = resolve P , Q ± ( G ) H=\operatorname{resolve}^{\pm}_{P,Q}(G) H = resolve P , Q ± ( G ) , its distance matrix D H D_H D H , and ( tree k , q H ( a ) : a ∈ V ( G ) ) (\operatorname{tree}^{H}_{k,q}(a):a \in V(G)) ( tree k , q H ( a ) : a ∈ V ( G )) in time
∣ G ∣ 2 ⋅ poly k , q ( M + T ) , |G|^{2}\cdot\operatorname{poly}_{k,q}(M+T), ∣ G ∣ 2 ⋅ poly k , q ( M + T ) , where
M : = max a ∈ V ( G ) ∥ tree k , q G ( a ) ∥ , M:=\max_{a\in V(G)}\left\lVert\operatorname{tree}^{G}_{k,q}(a)\right\rVert, M := a ∈ V ( G ) max tree k , q G ( a ) , T : = max a ∈ V ( G ) ∣ { tree k + i , q − i G ( v ˉ ) : 0 ≤ i ≤ q , ℓ ∈ [ k + i ] , v ˉ ∈ ( Ball ρ + ( k , q ) H ( a ) ) ℓ } ∣ . T:=\max_{a\in V(G)}\left\lvert\left\{\operatorname{tree}^{G}_{k+i,q-i}(\bar{v}):0\le i\le q,\ \ell\in[k+i],\ \bar{v}\in\left(\operatorname{Ball}^{H}_{\rho^{+}(k,q)}(a)\right)^{\ell}\right\}\right\rvert. T := a ∈ V ( G ) max { tree k + i , q − i G ( v ˉ ) : 0 ≤ i ≤ q , ℓ ∈ [ k + i ] , v ˉ ∈ ( Ball ρ + ( k , q ) H ( a ) ) ℓ } . Each output tree has size poly k , q ( T ) \operatorname{poly}_{k,q}(T) poly k , q ( T ) .
Proof. Assume the resolve is positive, as the negative case is symmetric. By induction on q q q , we construct an auxiliary map F F F on trees of arbitrary nonempty tuples, so that tree k , q H ( a ˉ ) = F ( tree k , q G ( a ˉ ) ) \operatorname{tree}^{H}_{k,q}(\bar{a})=F(\operatorname{tree}^{G}_{k,q}(\bar{a})) tree k , q H ( a ˉ ) = F ( tree k , q G ( a ˉ )) for all ℓ ≤ k \ell\le k ℓ ≤ k and a ˉ ∈ V ( G ) ℓ \bar{a}\in V(G)^{\ell} a ˉ ∈ V ( G ) ℓ . Fix a ˉ ∈ V ( G ) ℓ \bar{a}\in V(G)^{\ell} a ˉ ∈ V ( G ) ℓ and put τ : = tree k , q G ( a ˉ ) \tau:=\operatorname{tree}^{G}_{k,q}(\bar{a}) τ := tree k , q G ( a ˉ ) and σ : = stp k , q G \sigma:=\operatorname{stp}^{G}_{k,q} σ := stp k , q G
Root labels. We may assume that P G P^{G} P G and Q G Q^{G} Q G are nonempty, as otherwise H = G H=G H = G . We rewrite every atom φ \varphi φ in H H H to an equivalent formula φ ′ \varphi' φ ′ in G G G , so that φ ′ \varphi' φ ′ has the same distance rank as φ \varphi φ , and H ⊨ φ ( a ˉ ) ⟺ G ⊨ φ ′ ( a ˉ ) H\models\varphi(\bar{a})\Longleftrightarrow G\models\varphi'(\bar{a}) H ⊨ φ ( a ˉ ) ⟺ G ⊨ φ ′ ( a ˉ ) . Below, u , v u,v u , v are vertices, Y Y Y is a color, and s ∈ N s\in\mathbb{N} s ∈ N .
First-order atoms. Equality, color, and non-edge atoms N ( x , y ) N(x,y) N ( x , y ) have the same interpretation in G G G and H H H . By definition of the positive resolve,
H ⊨ E ( u , v ) ⟺ G ⊨ E ( u , v ) ∨ ( ( ( P ( u ) ∧ Q ( v ) ) ∨ ( Q ( u ) ∧ P ( v ) ) ) ∧ u ≠ v ∧ ¬ N ( u , v ) ) . H\models E(u,v)\Longleftrightarrow G\models E(u,v)\lor\left(\left((P(u)\land Q(v))\lor(Q(u)\land P(v))\right)\land u\ne v\land\neg N(u,v)\right). H ⊨ E ( u , v ) ⟺ G ⊨ E ( u , v ) ∨ ( ( ( P ( u ) ∧ Q ( v )) ∨ ( Q ( u ) ∧ P ( v )) ) ∧ u = v ∧ ¬ N ( u , v ) ) .
Distances. We have R ( H ) = R ( G ) ∪ P G Q G R(H)=R(G)\cup P^{G}Q^{G} R ( H ) = R ( G ) ∪ P G Q G . A shortest path from u u u to v v v in H H H is a path in G G G , or runs in G G G from u u u to P G P^{G} P G or Q G Q^{G} Q G , then crosses to the other part or returns to the same part through the other one, and then runs in G G G to v v v : otherwise, the segment between its first and last vertex in P G ∪ Q G P^{G}\cup Q^{G} P G ∪ Q G could be replaced by one pair from P G Q G P^{G}Q^{G} P G Q G , or by two through the other part if both ends lie in the same part. Hence
dist H ( u , v ) = min { dist G ( u , v ) , dist G ( u , P ) + 1 + dist G ( Q , v ) , dist G ( u , Q ) + 1 + dist G ( P , v ) , dist G ( u , P ) + 2 + dist G ( P , v ) , dist G ( u , Q ) + 2 + dist G ( Q , v ) } . (14) \operatorname{dist}^{H}(u,v)=\min\left\{\begin{aligned}
&\operatorname{dist}^{G}(u,v),\\
&\operatorname{dist}^{G}(u,P)+1+\operatorname{dist}^{G}(Q,v),\quad\operatorname{dist}^{G}(u,Q)+1+\operatorname{dist}^{G}(P,v),\\
&\operatorname{dist}^{G}(u,P)+2+\operatorname{dist}^{G}(P,v),\quad\operatorname{dist}^{G}(u,Q)+2+\operatorname{dist}^{G}(Q,v)
\end{aligned}\right\}. \tag*{(14)} dist H ( u , v ) = min ⎩ ⎨ ⎧ dist G ( u , v ) , dist G ( u , P ) + 1 + dist G ( Q , v ) , dist G ( u , Q ) + 1 + dist G ( P , v ) , dist G ( u , P ) + 2 + dist G ( P , v ) , dist G ( u , Q ) + 2 + dist G ( Q , v ) ⎭ ⎬ ⎫ . (14)
Unary distance atoms. Taking the minimum of (14) over v ∈ Y G v\in Y^{G} v ∈ Y G gives
H ⊨ dist ( u , Y ) < s ⟺ G ⊨ dist ( u , Y ) < s ∨ dist ( u , P ) < ( s − 1 − dist G ( Q , Y ) ) ∨ dist ( u , Q ) < ( s − 1 − dist G ( P , Y ) ) ∨ dist ( u , P ) < ( s − 2 − dist G ( P , Y ) ) ∨ dist ( u , Q ) < ( s − 2 − dist G ( Q , Y ) ) . \begin{aligned}
H\models\operatorname{dist}(u,Y)<s\Longleftrightarrow{}&G\models\operatorname{dist}(u,Y)<s\\
&{}\lor\operatorname{dist}(u,P)<\left(s-1-\operatorname{dist}^{G}(Q,Y)\right)\lor\operatorname{dist}(u,Q)<\left(s-1-\operatorname{dist}^{G}(P,Y)\right)\\
&{}\lor\operatorname{dist}(u,P)<\left(s-2-\operatorname{dist}^{G}(P,Y)\right)\lor\operatorname{dist}(u,Q)<\left(s-2-\operatorname{dist}^{G}(Q,Y)\right).
\end{aligned} H ⊨ dist ( u , Y ) < s ⟺ G ⊨ dist ( u , Y ) < s ∨ dist ( u , P ) < ( s − 1 − dist G ( Q , Y ) ) ∨ dist ( u , Q ) < ( s − 1 − dist G ( P , Y ) ) ∨ dist ( u , P ) < ( s − 2 − dist G ( P , Y ) ) ∨ dist ( u , Q ) < ( s − 2 − dist G ( Q , Y ) ) .
The values dist G ( P , Y ) \operatorname{dist}^{G}(P,Y) dist G ( P , Y ) and dist G ( Q , Y ) \operatorname{dist}^{G}(Q,Y) dist G ( Q , Y ) do not depend on u u u , and are computed once. A unary-distance comparison whose upper bound is nonpositive, or from which an infinite distance is subtracted, is interpreted as false .
Binary distance atoms. Define
δ P , Q s ( x , y ) : = ⋁ s 1 + 1 + s 2 = s ( ( dist ( x , P ) < s 1 + 1 ∧ dist ( y , Q ) < s 2 + 1 ) ∨ ( dist ( x , Q ) < s 1 + 1 ∧ dist ( y , P ) < s 2 + 1 ) ) \delta_{P,Q}^{s}(x,y) := \bigvee_{s_1+1+s_2=s}\left((\operatorname{dist}(x,P)<s_1+1\land\operatorname{dist}(y,Q)<s_2+1)\lor(\operatorname{dist}(x,Q)<s_1+1\land\operatorname{dist}(y,P)<s_2+1)\right) δ P , Q s ( x , y ) := s 1 + 1 + s 2 = s ⋁ ( ( dist ( x , P ) < s 1 + 1 ∧ dist ( y , Q ) < s 2 + 1 ) ∨ ( dist ( x , Q ) < s 1 + 1 ∧ dist ( y , P ) < s 2 + 1 ) )
∨ ⋁ s 1 + 2 + s 2 = s ( ( dist ( x , P ) < s 1 + 1 ∧ dist ( y , P ) < s 2 + 1 ) ∨ ( dist ( x , Q ) < s 1 + 1 ∧ dist ( y , Q ) < s 2 + 1 ) ) . {}\vee\bigvee_{s_1+2+s_2=s}\left((\operatorname{dist}(x,P)<s_1+1\land\operatorname{dist}(y,P)<s_2+1)\lor(\operatorname{dist}(x,Q)<s_1+1\land\operatorname{dist}(y,Q)<s_2+1)\right). ∨ s 1 + 2 + s 2 = s ⋁ ( ( dist ( x , P ) < s 1 + 1 ∧ dist ( y , P ) < s 2 + 1 ) ∨ ( dist ( x , Q ) < s 1 + 1 ∧ dist ( y , Q ) < s 2 + 1 ) ) .
By (14) ,
H ⊨ dist ( u , v ) ≤ s ⟺ G ⊨ ( dist ( u , v ) ≤ s ) ∨ δ P , Q s ( u , v ) . (15) H\models\operatorname{dist}(u,v)\le s\quad\Longleftrightarrow\quad G\models(\operatorname{dist}(u,v)\le s)\lor\delta_{P,Q}^{s}(u,v). \tag*{(15)} H ⊨ dist ( u , v ) ≤ s ⟺ G ⊨ ( dist ( u , v ) ≤ s ) ∨ δ P , Q s ( u , v ) . (15)
Root label. For an atom φ \varphi φ , let φ ′ \varphi' φ ′ be the corresponding formula as obtained above. Then H ⊨ φ ( a ˉ ) H\models\varphi(\bar{a}) H ⊨ φ ( a ˉ ) if and only if G ⊨ φ ′ ( a ˉ ) G\models\varphi'(\bar{a}) G ⊨ φ ′ ( a ˉ ) and φ ′ \varphi' φ ′ has the same distance rank as φ \varphi φ . Since whether or not G ⊨ φ ′ ( a ˉ ) G\models\varphi'(\bar{a}) G ⊨ φ ′ ( a ˉ ) is determined by atp k , q G ( a ˉ ) \operatorname{atp}_{k,q}^{G}(\bar{a}) atp k , q G ( a ˉ ) , it follows that the new root label atp k , q H ( a ˉ ) \operatorname{atp}_{k,q}^{H}(\bar{a}) atp k , q H ( a ˉ ) can be computed from atp k , q G ( a ˉ ) \operatorname{atp}_{k,q}^{G}(\bar{a}) atp k , q G ( a ˉ ) . Algorithmically, there are O k , q ( 1 ) O_{k,q}(1) O k , q ( 1 ) atoms without colors, and each nonempty color contributes O k , q ( 1 ) O_{k,q}(1) O k , q ( 1 ) further atoms.
Extensions. Let q ≥ 1 q\ge1 q ≥ 1 , and put r : = ρ − ( k + 1 , q − 1 ) r:=\rho^{-}(k+1,q-1) r := ρ − ( k + 1 , q − 1 ) and R : = ρ + ( k + 1 , q − 1 ) R:=\rho^{+}(k+1,q-1) R := ρ + ( k + 1 , q − 1 ) . On trees of rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) , F F F denotes the map given by the inductive assumption, using the restriction of σ \sigma σ to domain ( stp k + 1 , q − 1 ) \operatorname{domain}(\operatorname{stp}_{k+1,q-1}) domain ( stp k + 1 , q − 1 ) from Lemma 11.2 and the same precomputed distances. By the inductive assumption,
E k , q H ( a ˉ ) = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) ) : i ∈ [ ℓ ] , dist H ( a i , b ) ≤ R } . (16) \mathcal{E}_{k,q}^{H}(\bar{a})=\left\{\left(i,F\left(\operatorname{tree}_{k+1,q-1}^{G}(\bar{a}b)\right)\right):i\in[\ell],\operatorname{dist}^{H}(a_i,b)\le R\right\}. \tag*{(16)} E k , q H ( a ˉ ) = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) ) : i ∈ [ ℓ ] , dist H ( a i , b ) ≤ R } . (16)
For i ∈ [ ℓ ] i\in[\ell] i ∈ [ ℓ ] , put
γ i ( x 1 , … , x ℓ + 1 ) : = δ P , Q s ( x i , x ℓ + 1 ) . \gamma_i(x_1,\ldots,x_{\ell+1}):=\delta_{P,Q}^{s}(x_i,x_{\ell+1}). γ i ( x 1 , … , x ℓ + 1 ) := δ P , Q s ( x i , x ℓ + 1 ) .
By (15) ,
H ⊨ dist ( a i , b ) ≤ R ⟺ G ⊨ dist ( a i , b ) ≤ R ∨ γ i ( a ˉ b ) . (17) H\models\operatorname{dist}(a_i,b)\le R\quad\Longleftrightarrow\quad G\models\operatorname{dist}(a_i,b)\le R\lor\gamma_i(\bar{a}b). \tag*{(17)} H ⊨ dist ( a i , b ) ≤ R ⟺ G ⊨ dist ( a i , b ) ≤ R ∨ γ i ( a ˉ b ) . (17)
The right-hand side of (17) is equivalent to the disjunction of three conditions:
dist G ( a i , b ) ≤ R \operatorname{dist}^{G}(a_i,b)\le R dist G ( a i , b ) ≤ R ,
dist G ( a ˉ , b ) ≤ R \operatorname{dist}^{G}(\bar{a},b)\le R dist G ( a ˉ , b ) ≤ R and G ⊨ γ i ( a ˉ b ) G\models\gamma_i(\bar{a}b) G ⊨ γ i ( a ˉ b ) ,
dist G ( a ˉ , b ) > r \operatorname{dist}^{G}(\bar{a},b)>r dist G ( a ˉ , b ) > r and G ⊨ γ i ( a ˉ b ) G\models\gamma_i(\bar{a}b) G ⊨ γ i ( a ˉ b ) .
This holds since r ≤ R r\le R r ≤ R by (12) . Consequently,
E k , q H ( a ˉ ) = E o l d ∪ E n e a r ∪ E f a r , \mathcal{E}_{k,q}^{H}(\bar{a})=\mathcal{E}_{\mathrm{old}}\cup\mathcal{E}_{\mathrm{near}}\cup\mathcal{E}_{\mathrm{far}}, E k , q H ( a ˉ ) = E old ∪ E near ∪ E far ,
where
E o l d : = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a i , b ) ≤ R ) } , \mathcal{E}_{\mathrm{old}}:=\left\{\left(i,F\left(\operatorname{tree}_{k+1,q-1}^{G}(\bar{a}b)\right):i\in[\ell],b\in V(G),\operatorname{dist}^{G}(a_i,b)\le R\right)\right\}, E old := { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a i , b ) ≤ R ) } ,
E n e a r : = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a ˉ , b ) ≤ R , G ⊨ γ i ( a ˉ b ) ) } , \mathcal{E}_{\mathrm{near}}:=\left\{\left(i,F\left(\operatorname{tree}_{k+1,q-1}^{G}(\bar{a}b)\right):i\in[\ell],b\in V(G),\operatorname{dist}^{G}(\bar{a},b)\le R,G\models\gamma_i(\bar{a}b)\right)\right\}, E near := { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a ˉ , b ) ≤ R , G ⊨ γ i ( a ˉ b ) ) } ,
E f a r : = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a ˉ , b ) > r , G ⊨ γ i ( a ˉ b ) ) } . \mathcal{E}_{\mathrm{far}}:=\left\{\left(i,F\left(\operatorname{tree}_{k+1,q-1}^{G}(\bar{a}b)\right):i\in[\ell],b\in V(G),\operatorname{dist}^{G}(\bar{a},b)>r,G\models\gamma_i(\bar{a}b)\right)\right\}. E far := { ( i , F ( tree k + 1 , q − 1 G ( a ˉ b ) ) : i ∈ [ ℓ ] , b ∈ V ( G ) , dist G ( a ˉ , b ) > r , G ⊨ γ i ( a ˉ b ) ) } .
The first set is obtained via
E o l d = { ( i , F ( μ ) ) : ( i , μ ) ∈ E k , q G ( a ˉ ) } . \mathcal{E}_{\mathrm{old}}=\{(i,F(\mu)):(i,\mu)\in\mathcal{E}^{G}_{k,q}(\bar{a})\}. E old = {( i , F ( μ )) : ( i , μ ) ∈ E k , q G ( a ˉ )} .
Every witness b b b for E n e a r \mathcal{E}_{\mathrm{near}} E near is admitted by some guard j j j in G G G , so tree k + 1 , q − 1 G ( a ˉ b ) \operatorname{tree}^{G}_{k+1,q-1}(\bar{a}b) tree k + 1 , q − 1 G ( a ˉ b ) occurs as an extension ( j , μ ) (j,\mu) ( j , μ ) of τ \tau τ with μ ⊨ γ i \mu\models\gamma_i μ ⊨ γ i . Conversely, every such μ \mu μ equals tree k + 1 , q − 1 G ( a ˉ b ) \operatorname{tree}^{G}_{k+1,q-1}(\bar{a}b) tree k + 1 , q − 1 G ( a ˉ b ) for some b b b with dist G ( a j , b ) ≤ R \operatorname{dist}^{G}(a_j,b)\le R dist G ( a j , b ) ≤ R and G ⊨ γ i ( a ˉ b ) G\models\gamma_i(\bar{a}b) G ⊨ γ i ( a ˉ b ) . Hence, using the notation μ ⊨ γ \mu\models\gamma μ ⊨ γ introduced after Lemma 10.2 ,
E n e a r = { ( i , F ( μ ) ) : i ∈ [ ℓ ] , ( j , μ ) ∈ E k , q G ( a ˉ ) , μ ⊨ γ i } . \mathcal{E}_{\mathrm{near}}=\{(i,F(\mu)):i\in[\ell],\ (j,\mu)\in\mathcal{E}^{G}_{k,q}(\bar{a}),\ \mu\models\gamma_i\}. E near = {( i , F ( μ )) : i ∈ [ ℓ ] , ( j , μ ) ∈ E k , q G ( a ˉ ) , μ ⊨ γ i } .
For E f a r \mathcal{E}_{\mathrm{far}} E far , consider b b b with dist G ( a ˉ , b ) > r \operatorname{dist}^{G}(\bar{a},b)>r dist G ( a ˉ , b ) > r . Since r = ρ − ( k + 1 , q − 1 ) r=\rho^{-}(k+1,q-1) r = ρ − ( k + 1 , q − 1 ) is exactly the separation required by Lemma 10.7 at rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) , that lemma gives
tree k + 1 , q − 1 G ( a ˉ b ) = tree k + 1 , q − 1 G ( a ˉ ) ∗ tree k + 1 , q − 1 G ( b ) . \operatorname{tree}^{G}_{k+1,q-1}(\bar{a}b)=\operatorname{tree}^{G}_{k+1,q-1}(\bar{a})\ast\operatorname{tree}^{G}_{k+1,q-1}(b). tree k + 1 , q − 1 G ( a ˉ b ) = tree k + 1 , q − 1 G ( a ˉ ) ∗ tree k + 1 , q − 1 G ( b ) .
where tree k + 1 , q − 1 G ( a ˉ ) \operatorname{tree}^{G}_{k+1,q-1}(\bar{a}) tree k + 1 , q − 1 G ( a ˉ ) is obtained from τ = tree k , q G ( a ˉ ) \tau=\operatorname{tree}^{G}_{k,q}(\bar{a}) τ = tree k , q G ( a ˉ ) by Lemma 10.6 . As b b b ranges over all such vertices, tree k + 1 , q − 1 G ( b ) \operatorname{tree}^{G}_{k+1,q-1}(b) tree k + 1 , q − 1 G ( b ) ranges exactly over ftree k , q G ( a ˉ ) \operatorname{ftree}^{G}_{k,q}(\bar{a}) ftree k , q G ( a ˉ ) , computed from τ \tau τ and σ \sigma σ by Lemma 11.6 . Therefore
E f a r = { ( i , F ( tree k + 1 , q − 1 G ( a ˉ ) ∗ ν ) ) : i ∈ [ ℓ ] , ν ∈ ftree k , q G ( a ˉ ) , tree k + 1 , q − 1 G ( a ˉ ) ∗ ν ⊨ γ i } . \mathcal{E}_{\mathrm{far}}=\{(i,F(\operatorname{tree}^{G}_{k+1,q-1}(\bar{a})\ast\nu)):i\in[\ell],\ \nu\in\operatorname{ftree}^{G}_{k,q}(\bar{a}),\ \operatorname{tree}^{G}_{k+1,q-1}(\bar{a})\ast\nu\models\gamma_i\}. E far = {( i , F ( tree k + 1 , q − 1 G ( a ˉ ) ∗ ν )) : i ∈ [ ℓ ] , ν ∈ ftree k , q G ( a ˉ ) , tree k + 1 , q − 1 G ( a ˉ ) ∗ ν ⊨ γ i } .
So the new root label, E o l d \mathcal{E}_{\mathrm{old}} E old , E n e a r \mathcal{E}_{\mathrm{near}} E near , and E f a r \mathcal{E}_{\mathrm{far}} E far are computed from τ \tau τ together with σ \sigma σ and the values dist G ( P , Y ) \operatorname{dist}^{G}(P,Y) dist G ( P , Y ) and dist G ( Q , Y ) \operatorname{dist}^{G}(Q,Y) dist G ( Q , Y ) , which do not depend on a ˉ \bar{a} a ˉ . This defines F ( τ ) = tree k , q H ( a ˉ ) F(\tau)=\operatorname{tree}^{H}_{k,q}(\bar{a}) F ( τ ) = tree k , q H ( a ˉ ) .
Running time. Computing H H H takes time O ( ∥ H ∥ ) = O ( ∣ G ∣ 2 ) O(\lVert H\rVert)=O(\lvert G\rvert^2) O (∥ H ∥) = O (∣ G ∣ 2 ) . Scanning D G D_G D G gives dist G ( u , P ) \operatorname{dist}^{G}(u,P) dist G ( u , P ) and dist G ( u , Q ) \operatorname{dist}^{G}(u,Q) dist G ( u , Q ) for all vertices u u u , and thus dist G ( P , Y ) \operatorname{dist}^{G}(P,Y) dist G ( P , Y ) and dist G ( Q , Y ) \operatorname{dist}^{G}(Q,Y) dist G ( Q , Y ) for all nonempty colors Y Y Y , in time O ( ∣ G ∣ 2 ) O(\lvert G\rvert^2) O (∣ G ∣ 2 ) . Then (14) gives D H D_H D H in time O ( ∣ G ∣ 2 ) O(\lvert G\rvert^2) O (∣ G ∣ 2 ) , and Lemma 11.3 computes σ : = stp k , q G \sigma:=\operatorname{stp}^{G}_{k,q} σ := stp k , q G from D G D_G D G in time ∣ G ∣ 2 ⋅ poly k , q ( M ) \lvert G\rvert^2\cdot\operatorname{poly}_{k,q}(M) ∣ G ∣ 2 ⋅ poly k , q ( M ) . Every tree tree k + i , q − i G ( b ) \operatorname{tree}^{G}_{k+i,q-i}(b) tree k + i , q − i G ( b ) is obtained from tree k , q G ( b ) \operatorname{tree}^{G}_{k,q}(b) tree k , q G ( b ) by at most q q q applications of Lemma 10.6 , so it has size poly k , q ( M ) \operatorname{poly}_{k,q}(M) poly k , q ( M ) , and ∥ σ ∥ ≤ ∣ G ∣ ⋅ poly k , q ( M ) \lVert\sigma\rVert\le\lvert G\rvert\cdot\operatorname{poly}_{k,q}(M) ∥ σ ∥ ≤ ∣ G ∣ ⋅ poly k , q ( M ) , since the domain of σ \sigma σ has O k , q ( 1 ) O_{k,q}(1) O k , q ( 1 ) entries per vertex.
Number of calls. Fix a ∈ V ( G ) a\in V(G) a ∈ V ( G ) and consider the recursion computing F ( tree k , q G ( a ) ) F(\operatorname{tree}^{G}_{k,q}(a)) F ( tree k , q G ( a )) . We collect the distinct old extension trees admitted by at least one guard in H H H before recursing, retaining the list of guards for each tree. The calls at depth j j j are on trees tree k + j , q − j G ( v ˉ ) \operatorname{tree}^{G}_{k+j,q-j}(\bar{v}) tree k + j , q − j G ( v ˉ ) for tuples v ˉ \bar{v} v ˉ reached by the guards in H H H . By Lemma 10.4 applied to H H H , every such v ˉ \bar{v} v ˉ is a tuple from Ball ρ + ( k , q ) H ( a ) \operatorname{Ball}^{H}_{\rho^{+}(k,q)}(a) Ball ρ + ( k , q ) H ( a ) . So by definition of T T T , a call makes at most T T T recursive calls, and as the depth is q q q , there are poly k , q ( T ) \operatorname{poly}_{k,q}(T) poly k , q ( T ) calls for a a a .
Cost per call and output size. A recursive input is a child of the previous input, or is obtained by rank shift and far composition with a tree of arity one recorded in σ \sigma σ . These trees have size poly k , q ( M ) \operatorname{poly}_{k,q}(M) poly k , q ( M ) , so by Lemmas 10.6 and 10.7 and the depth bound q q q , every recursive input and every candidate extension tree has size poly k , q ( M ) \operatorname{poly}_{k,q}(M) poly k , q ( M ) . For a call with positive remaining depth, restricting σ \sigma σ and applying Lemma 11.6 takes time O ( ∥ σ ∥ ⋅ poly k , q ( M ) ) = O ( ∣ G ∣ ⋅ poly k , q ( M ) ) O(\lVert\sigma\rVert\cdot\operatorname{poly}_{k,q}(M))=O(\lvert G\rvert\cdot\operatorname{poly}_{k,q}(M)) O (∥ σ ∥ ⋅ poly k , q ( M )) = O (∣ G ∣ ⋅ poly k , q ( M )) . The far tree has at most ∣ G ∣ \lvert G\rvert ∣ G ∣ members, so composing them and testing the formulas γ i \gamma_i γ i (which are quantifier-free formulas of distance rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) , so are determined by the root label of a tree of rank ( k + 1 , q − 1 ) (k+1,q-1) ( k + 1 , q − 1 ) ) takes the same time. We scan the candidates, test their guards, and compare each admitted candidate with the list of at most T T T distinct admitted trees collected so far. Including the candidates from the old extensions, this takes O ( ∣ G ∣ ⋅ poly k , q ( M + T ) ) O(\lvert G\rvert\cdot\operatorname{poly}_{k,q}(M+T)) O (∣ G ∣ ⋅ poly k , q ( M + T )) time.
The colors recorded in each new root label meet Ball ρ + ( k , q ) H ( a ) \operatorname{Ball}^{H}_{\rho^{+}(k,q)}(a) Ball ρ + ( k , q ) H ( a ) by Lemma 10.4 applied to H H H , and as vertices of distinct colors have distinct old trees, there are at most T T T of them. So each new root label has size O k , q ( T ) O_{k,q}(T) O k , q ( T ) and is computed in time O ( ∣ G ∣ ⋅ ∥ τ ∥ ) O(|G|\cdot\|\tau\|) O ( ∣ G ∣ ⋅ ∥ τ ∥ ) . Together with the branching and depth bounds, this gives output size poly k , q ( T ) \operatorname{poly}_{k,q}(T) poly k , q ( T ) ; restoring canonical form has the same polynomial bound by Observation 10.1 .
Altogether the recursion for a a a takes time O ( ∣ G ∣ ⋅ poly k , q ( M + T ) ) O(|G|\cdot\operatorname{poly}_{k,q}(M+T)) O ( ∣ G ∣ ⋅ poly k , q ( M + T )) , and for all vertices O ( ∣ G ∣ 2 ⋅ poly k , q ( M + T ) ) O(|G|^{2}\cdot\operatorname{poly}_{k,q}(M+T)) O ( ∣ G ∣ 2 ⋅ poly k , q ( M + T )) . Adding the construction of H H H and D H D_H D H , the distance preprocessing, and the scatter type gives the claimed bound. ■
The model checking algorithm
We now give the model checking algorithm, proving Theorem 4.3. Recall the width notion used in the statement.
Definition 4.1. For r , q ∈ N r,q\in\mathbb{N} r , q ∈ N , the radius-r r r depth-q q q width of a construction sequence G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ is defined as:
max t ∈ [ λ − 1 ] max v ∈ V ( G ) ∣ Types q , q G t ( Ball r G t + 1 ( v ) ) ∣ . \max_{t\in[\lambda-1]}\ \max_{v\in V(G)}\left|\operatorname{Types}^{G_t}_{q,q}\left(\operatorname{Ball}^{G_{t+1}}_r(v)\right)\right|. t ∈ [ λ − 1 ] max v ∈ V ( G ) max Types q , q G t ( Ball r G t + 1 ( v ) ) . The width bounds numbers of ordinary types, and the following lemma converts such bounds into bounds on type trees, as required by Lemma 12.2 .
Lemma 13.1 (type tree sizes). Let k ≥ 1 k\ge1 k ≥ 1 and q ∈ N q\in\mathbb{N} q ∈ N , and put r : = ρ + ( k , q ) r:=\rho^{+}(k,q) r := ρ + ( k , q ) and d : = r + k + q d:=r+k+q d := r + k + q . The following holds for every partial graph G G G .
(i) ∣ { tree k + i , q − i G ( v ˉ ) : v ˉ ∈ X ℓ } ∣ ≤ ∣ Types d , d G ( X ) ∣ \left|\left\{\operatorname{tree}^{G}_{k+i,q-i}(\bar{v}):\bar{v}\in X^\ell\right\}\right|\le\left|\operatorname{Types}^{G}_{d,d}(X)\right| { tree k + i , q − i G ( v ˉ ) : v ˉ ∈ X ℓ } ≤ Types d , d G ( X ) for all i ∈ { 0 , … , q } i\in\{0,\ldots,q\} i ∈ { 0 , … , q } , ℓ ∈ [ k + i ] \ell\in[k+i] ℓ ∈ [ k + i ] , and X ⊆ V ( G ) X\subseteq V(G) X ⊆ V ( G ) .
(ii) ∥ tree k , q G ( a ) ∥ ≤ poly k , q ( ∣ Types d , d G ( Ball r G ( a ) ) ∣ ) \left\|\operatorname{tree}^{G}_{k,q}(a)\right\|\le\operatorname{poly}_{k,q}\left(\left|\operatorname{Types}^{G}_{d,d}\left(\operatorname{Ball}^{G}_r(a)\right)\right|\right) tree k , q G ( a ) ≤ poly k , q ( Types d , d G ( Ball r G ( a ) ) ) for every a ∈ V ( G ) a\in V(G) a ∈ V ( G ) .
Proof. We first show that ordinary types determine type trees: for all k ′ , q ′ ∈ N k',q'\in\mathbb{N} k ′ , q ′ ∈ N , every partial graph G G G , and all nonempty tuples a ˉ , b ˉ ∈ V ( G ) ≤ k ′ \bar{a},\bar{b}\in V(G)^{\le k'} a ˉ , b ˉ ∈ V ( G ) ≤ k ′ of the same length,
tp ρ + ( k ′ , q ′ ) + q ′ G ( a ˉ ) = tp ρ + ( k ′ , q ′ ) + q ′ G ( b ˉ ) ⟹ tree k ′ , q ′ G ( a ˉ ) = tree k ′ , q ′ G ( b ˉ ) . (18) \operatorname{tp}^{G}_{\rho^{+}(k',q')+q'}(\bar{a})=\operatorname{tp}^{G}_{\rho^{+}(k',q')+q'}(\bar{b})\quad\Longrightarrow\quad\operatorname{tree}^{G}_{k',q'}(\bar{a})=\operatorname{tree}^{G}_{k',q'}(\bar{b}). \tag*{(18)} tp ρ + ( k ′ , q ′ ) + q ′ G ( a ˉ ) = tp ρ + ( k ′ , q ′ ) + q ′ G ( b ˉ ) ⟹ tree k ′ , q ′ G ( a ˉ ) = tree k ′ , q ′ G ( b ˉ ) . (18)
By expressing distance atoms by paths along E ∨ N E\lor N E ∨ N , every dist-FO formula of distance rank ( k ′ , q ′ ) (k',q') ( k ′ , q ′ ) is equivalent to a first-order formula of quantifier rank at most ρ + ( k ′ , q ′ ) + q ′ \rho^{+}(k',q')+q' ρ + ( k ′ , q ′ ) + q ′ . Thus, the left-hand side of (18) implies that a ˉ \bar{a} a ˉ and b ˉ \bar{b} b ˉ satisfy the same dist-FO formulas of distance rank ( k ′ , q ′ ) (k',q') ( k ′ , q ′ ) . By Corollary 10.3 , this yields the right-hand side.
For (i), extend every tuple v ˉ ∈ X ℓ \bar{v}\in X^\ell v ˉ ∈ X ℓ to a tuple v ˉ ′ ∈ X d \bar{v}'\in X^d v ˉ ′ ∈ X d by repeating its last coordinate. Then tp d G ( v ˉ ′ ) \operatorname{tp}^{G}_{d}(\bar{v}') tp d G ( v ˉ ′ ) determines tp d G ( v ˉ ) \operatorname{tp}^{G}_{d}(\bar{v}) tp d G ( v ˉ ) , which determines tree k + i , q − i G ( v ˉ ) \operatorname{tree}^{G}_{k+i,q-i}(\bar{v}) tree k + i , q − i G ( v ˉ ) by (18) , as ρ + ( k + i , q − i ) + q − i ≤ ρ + ( k , q ) + q ≤ d \rho^{+}(k+i,q-i)+q-i\le\rho^{+}(k,q)+q\le d ρ + ( k + i , q − i ) + q − i ≤ ρ + ( k , q ) + q ≤ d by (13) . So distinct type trees yield distinct elements of Types d , d G ( X ) \operatorname{Types}^{G}_{d,d}(X) Types d , d G ( X ) .
For (ii), put X : = Ball r ( a ) X:=\operatorname{Ball}_{r}(a) X := Ball r ( a ) and K : = ∣ Types d , d G ( X ) ∣ K:=|\operatorname{Types}^{G}_{d,d}(X)| K := ∣ Types d , d G ( X ) ∣ . As every vertex has exactly one color, vertices of distinct colors have distinct type trees, so at most K K K colors meet X X X by (i). By Lemma 10.4 , every node of tree k , q ( a ) \operatorname{tree}_{k,q}(a) tree k , q ( a ) is tree k + j , q − j ( v ˉ ) \operatorname{tree}_{k+j,q-j}(\bar{v}) tree k + j , q − j ( v ˉ ) for a tuple v ˉ \bar{v} v ˉ from X X X , and every color in a true atom of its root meets X X X . So every root has size O k , q ( K ) O_{k,q}(K) O k , q ( K ) , and by (i), every node has at most K K K children per guard, and thus at most ( k + q ) K (k+q)K ( k + q ) K children. As the depth is q q q , this gives ∥ tree k , q ( a ) ∥ ≤ poly k , q ( K ) \left\|\operatorname{tree}_{k,q}(a)\right\|\le\operatorname{poly}_{k,q}(K) ∥ tree k , q ( a ) ∥ ≤ poly k , q ( K ) . ■
Theorem 4.3. There is an algorithm which, given a sentence φ \varphi φ and an n n n -vertex graph G G G together with its construction sequence of length λ \lambda λ , determines whether G ⊨ φ G\models\varphi G ⊨ φ in time λ ⋅ n 2 ⋅ poly φ ( K ) \lambda\cdot n^{2}\cdot\operatorname{poly}_{\varphi}(K) λ ⋅ n 2 ⋅ poly φ ( K ) , where K K K is the radius-r r r depth-d d d width of the construction sequence, for some r r r and d d d which are computable from φ \varphi φ .
Proof. Let q q q be the quantifier rank of φ \varphi φ , and let r , d r,d r , d be as in Lemma 13.1 for k = 1 k=1 k = 1 and this q q q . We prove the statement with radius r r r and depth d d d . If n ≤ 1 n \le1 n ≤ 1 , evaluate φ \varphi φ directly, so assume n ≥ 2 n \ge2 n ≥ 2 .
Let G 1 , … , G λ G_1,\ldots,G_\lambda G 1 , … , G λ be the given construction sequence of G G G , and let K K K be its radius-r r r depth-d d d width. We iteratively compute ( tree 1 , q G t ( a ) : a ∈ V ( G ) ) (\operatorname{tree}^{G_t}_{1,q}(a):a\in V(G)) ( tree 1 , q G t ( a ) : a ∈ V ( G )) for t = 1 , … , λ t=1,\ldots,\lambda t = 1 , … , λ . To save time we also maintain the distance matrix D G t D_{G_t} D G t . Initially, for t = 1 t=1 t = 1 , there are no resolved pairs and each nonempty part is a singleton. Hence, every guard admits only vertices of the guarded tuple itself, so each tree 1 , q G 1 ( a ) \operatorname{tree}^{G_1}_{1,q}(a) tree 1 , q G 1 ( a ) is determined by the part containing a a a , and can therefore be computed in time O q ( 1 ) O_q(1) O q ( 1 ) . Initialize also D G 1 D_{G_1} D G 1 in O ( n 2 ) O(n^2) O ( n 2 ) time by putting 0 0 0 on its diagonal and ∞ \infty ∞ elsewhere.
Now let t < λ t<\lambda t < λ , and assume the trees in G t G_t G t have been computed. All these trees have size poly q ( K ) \operatorname{poly}_q(K) poly q ( K ) : for every t ′ ∈ [ λ − 1 ] t'\in[\lambda-1] t ′ ∈ [ λ − 1 ] and a ∈ V ( G ) a\in V(G) a ∈ V ( G ) , Lemma 13.1 (ii) bounds ∥ tree 1 , q G t ′ ( a ) ∥ \lVert\operatorname{tree}^{G_{t'}}_{1,q}(a)\rVert ∥ tree 1 , q G t ′ ( a )∥ by a polynomial in ∣ Types d , d G t ′ ( Ball r G t ′ ( a ) ) ∣ \lvert\operatorname{Types}^{G_{t'}}_{d,d}(\operatorname{Ball}^{G_{t'}}_r(a))\rvert ∣ Types d , d G t ′ ( Ball r G t ′ ( a ))∣ . Using R ( G t ′ ) ⊆ R ( G t ′ + 1 ) R(G_{t'})\subseteq R(G_{t'+1}) R ( G t ′ ) ⊆ R ( G t ′ + 1 ) and therefore Ball r G t ′ ( a ) ⊆ Ball r G t ′ + 1 ( a ) \operatorname{Ball}^{G_{t'}}_r(a)\subseteq\operatorname{Ball}^{G_{t'+1}}_r(a) Ball r G t ′ ( a ) ⊆ Ball r G t ′ + 1 ( a ) , this is at most ∣ Types d , d G t ′ ( Ball r G t ′ + 1 ( a ) ) ∣ ≤ K \lvert\operatorname{Types}^{G_{t'}}_{d,d}(\operatorname{Ball}^{G_{t'+1}}_r(a))\rvert\le K ∣ Types d , d G t ′ ( Ball r G t ′ + 1 ( a ))∣ ≤ K by the definition of the width.
For a merge, construct G t + 1 G_{t+1} G t + 1 in time O ( n ) O(n) O ( n ) , keep D G t + 1 = D G t D_{G_{t+1}}=D_{G_t} D G t + 1 = D G t unchanged, and apply Lemma 12.1 to each tree of arity one, taking O ( n ⋅ poly q ( K ) ) O(n\cdot\operatorname{poly}_q(K)) O ( n ⋅ poly q ( K )) time in total. For a resolve, apply Lemma 12.2 to G t G_t G t , the supplied matrix D G t D_{G_t} D G t , and all its trees of arity one. The lemma returns both D G t + 1 D_{G_{t+1}} D G t + 1 and the new trees. Its parameter M M M is poly q ( K ) \operatorname{poly}_q(K) poly q ( K ) by the bound above. Its parameter T T T is
T : = max a ∈ V ( G ) { ∣ tree ℓ 1 + i , q − i ( v ˉ ) : v ˉ ∈ ( Ball ρ + ( 1 , q ) G t + 1 ( a ) ) ℓ , 0 ≤ i ≤ q , ℓ ∈ [ i + 1 ] } ∣ . T:=\max_{a\in V(G)}\left\{\left\lvert\operatorname{tree}^{1+i,q-i}_{\ell}(\bar v):\bar v\in\left(\operatorname{Ball}^{G_{t+1}}_{\rho^+(1,q)}(a)\right)^\ell,\ 0\le i\le q,\ \ell\in[i+1]\right\}\right\rvert. T := a ∈ V ( G ) max { tree ℓ 1 + i , q − i ( v ˉ ) : v ˉ ∈ ( Ball ρ + ( 1 , q ) G t + 1 ( a ) ) ℓ , 0 ≤ i ≤ q , ℓ ∈ [ i + 1 ] } .
The tuples v ˉ \bar v v ˉ above lie in X : = Ball r G t + 1 ( a ) X:=\operatorname{Ball}^{G_{t+1}}_r(a) X := Ball r G t + 1 ( a ) since ρ + ( 1 , q ) ≤ r \rho^+(1,q)\le r ρ + ( 1 , q ) ≤ r . By Lemma 13.1 (i), there are at most ∣ Types d , d G t ( X ) ∣ ≤ K \lvert\operatorname{Types}^{G_t}_{d,d}(X)\rvert\le K ∣ Types d , d G t ( X )∣ ≤ K trees for each i i i and arity ℓ \ell ℓ . There are at most ( q + 1 ) 2 (q+1)^2 ( q + 1 ) 2 choices of i i i and ℓ \ell ℓ , so T ≤ ( q + 1 ) 2 K T\le(q+1)^2K T ≤ ( q + 1 ) 2 K .
As each step takes O ( n 2 ⋅ poly q ( K ) ) O(n^2\cdot\operatorname{poly}_q(K)) O ( n 2 ⋅ poly q ( K )) time, the total time is O ( λ n 2 ⋅ poly φ ( K ) ) O(\lambda n^2\cdot\operatorname{poly}_\varphi(K)) O ( λ n 2 ⋅ poly φ ( K )) . After λ − 1 \lambda-1 λ − 1 steps we have all the type trees in G λ G_\lambda G λ . These final trees also have size poly q ( K ) \operatorname{poly}_q(K) poly q ( K ) : if the last step is a merge, no tree grows; if it is a resolve, use the output-size bound poly q ( T ) \operatorname{poly}_q(T) poly q ( T ) in Lemma 12.2 and T ≤ ( q + 1 ) 2 K T\le(q+1)^2K T ≤ ( q + 1 ) 2 K .
As all pairs of G λ G_\lambda G λ are resolved, we can turn each quantifier of φ \varphi φ into a local one without changing its truth value. Construct φ l o c ( x ) \varphi^{\mathrm{loc}}(x) φ loc ( x ) from φ \varphi φ by introducing a fresh variable x x x , and replacing every subformula ∃ y ψ \exists y\,\psi ∃ y ψ of φ \varphi φ that lies in the scope of quantifiers ∃ z 1 , … , ∃ z j \exists z_1,\ldots,\exists z_j ∃ z 1 , … , ∃ z j by
∃ y ( dist ( x , y ) ≤ ρ + ( j + 2 , q − j − 1 ) ∧ ψ ) . \exists y\left(\operatorname{dist}(x,y)\le\rho^+(j+2,q-j-1)\wedge\psi\right). ∃ y ( dist ( x , y ) ≤ ρ + ( j + 2 , q − j − 1 ) ∧ ψ ) .
where ψ \psi ψ is transformed in the same way. This yields a dist-FO formula φ l o c ( x ) \varphi^{\mathrm{loc}}(x) φ loc ( x ) such that, for every a ∈ V ( G ) a\in V(G) a ∈ V ( G ) ,
G λ ⊨ φ ⟺ G λ ⊨ φ l o c ( a ) . G_\lambda\models\varphi\quad\Longleftrightarrow\quad G_\lambda\models\varphi^{\mathrm{loc}}(a). G λ ⊨ φ ⟺ G λ ⊨ φ loc ( a ) .
Note that φ l o c \varphi^{\mathrm{loc}} φ loc has distance rank ( 1 , q ) (1,q) ( 1 , q ) .
Now choose any a ∈ V ( G ) a\in V(G) a ∈ V ( G ) , and use Lemma 10.2 for k = 1 k=1 k = 1 to compute whether G λ ⊨ φ l o c ( a ) G_\lambda\models\varphi^{\mathrm{loc}}(a) G λ ⊨ φ loc ( a ) , and hence whether G λ ⊨ φ G_\lambda\models\varphi G λ ⊨ φ , from tree 1 , q G λ ( a ) \operatorname{tree}^{G_\lambda}_{1,q}(a) tree 1 , q G λ ( a ) in time poly ( ∣ φ l o c ∣ + ∥ tree 1 , q G λ ( a ) ∥ ) ≤ poly φ ( K ) \operatorname{poly}(\lvert\varphi^{\mathrm{loc}}\rvert+\lVert\operatorname{tree}^{G_\lambda}_{1,q}(a)\rVert)\le\operatorname{poly}_\varphi(K) poly (∣ φ loc ∣ + ∥ tree 1 , q G λ ( a )∥) ≤ poly φ ( K ) . As E ( G λ ) = E E(G_\lambda)=E E ( G λ ) = E and φ \varphi φ is a sentence over graphs, G λ ⊨ φ G_\lambda\models\varphi G λ ⊨ φ if and only if G ⊨ φ G\models\varphi G ⊨ φ . This fits the preceding time bound and completes the proof.
AI methodology
We developed the approach to the main theorem in summer 2025, without AI assistance. By summer 2026, we had a draft of the present paper, and the companion paper [27 ] was nearly complete. The draft already had essentially the current proof structure. It contained a complete proof of the result of Part I, and definitions and lemma statements for the other parts, though some of their proofs were still sketches. Believing that these sketches could be completed, we used GPT-6 to help check the argument.
In Part II, we had proposed a proof of a stronger version of Lemma 8.1 , in which the number of unary predicates is bounded by a constant independent of the length of the input merge sequence. This would have let us apply the results of [27 ] without controlling the sequence length. The model identified a gap in this proof. We expected the gap to be easy to repair with the methods already in the paper, but the model did not find a repair.
We therefore asked a narrower question: are there construction sequences of width n o ( 1 ) n^{o(1)} n o ( 1 ) that are locally definable using a constant number of unary predicates? The model observed that a slightly weaker width bound of n ε n^{\varepsilon} n ε , for any fixed ε > 0 \varepsilon> 0 ε > 0 , can be achieved by tuning the parameter q q q in Theorem 4.3 in [27 ] , so that it produces chains of length O ( r / ε ) O(r/\varepsilon) O ( r / ε ) . Since the number of unary predicates depends only on the length of the input sequence, this gives a bound independent of the size of the graph. We immediately recognized that this was enough to close the gap within our original proof strategy.
The text of Parts I and II was written by the authors. We used LLMs to help write some proofs in Part III that are mechanical adaptations of proofs from [31 ] . GPT-6 also proposed a shorter proof of Lemma 5.6 in Part I, which we verified and adopted. Finally, we used LLMs to streamline the presentation. The models used were GPT-6, Claude Opus 5.5 and Claude Fable 5.1.
The authors verified the correctness and originality of all content, including references.
References
Appendix
Forbidden patterns
In this appendix we give a self-contained proof of Lemma 5.11, which is a corollary of [62 Lemma C.1] . The proofs in this appendix apply to arbitrary classes of relational structures, not just classes of finite graphs. Recall the notion of ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -patterns.
Definition 5.10. Fix first-order formulas φ ( x ˉ , z ) \varphi(\bar{x},z) φ ( x ˉ , z ) and ψ ( y ˉ , z ) \psi(\bar{y},z) ψ ( y ˉ , z ) . A ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order s × t s \times t s × t in a graph G G G consists of tuples a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ \bar{a}_1,\ldots,\bar{a}_s \in V(G)^{|\bar{x}|} a ˉ 1 , … , a ˉ s ∈ V ( G ) ∣ x ˉ ∣ , b ˉ 1 , … , b ˉ t ∈ V ( G ) ∣ y ˉ ∣ \bar{b}_1,\ldots,\bar{b}_t \in V(G)^{|\bar{y}|} b ˉ 1 , … , b ˉ t ∈ V ( G ) ∣ y ˉ ∣ , and vertices ( c i , j : i ∈ [ s ] , j ∈ [ t ] ) (c_{i,j}: i \in[s],j \in[t]) ( c i , j : i ∈ [ s ] , j ∈ [ t ]) such that the following holds for all i , i ′ ∈ [ s ] i,i' \in[s] i , i ′ ∈ [ s ] and j , j ′ ∈ [ t ] j,j' \in[t] j , j ′ ∈ [ t ] :
G ⊨ φ ( a ˉ i , c i , j ) G \models\varphi(\bar{a}_i,c_{i,j}) G ⊨ φ ( a ˉ i , c i , j ) and G ⊭ φ ( a ˉ i ′ , c i , j ) G \not\models\varphi(\bar{a}_{i'},c_{i,j}) G ⊨ φ ( a ˉ i ′ , c i , j ) if i ′ > i i' > i i ′ > i ,
G ⊨ ψ ( b ˉ j , c i , j ) G \models\psi(\bar{b}_j,c_{i,j}) G ⊨ ψ ( b ˉ j , c i , j ) and G ⊭ ψ ( b ˉ j ′ , c i , j ) G \not\models\psi(\bar{b}_{j'},c_{i,j}) G ⊨ ψ ( b ˉ j ′ , c i , j ) if j ′ > j j' > j j ′ > j .
We call a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern clean if the above conditions hold with ≠ \ne = in place of > > > in both conditions.
We define dp-minimal classes [15 ] as follows.
Definition A.1. A class C \mathcal{C} C of structures is dp-minimal if for every first-order formulas φ ( x ˉ , z ) , ψ ( y ˉ , z ) \varphi(\bar{x},z),\psi(\bar{y},z) φ ( x ˉ , z ) , ψ ( y ˉ , z ) in the signature of C \mathcal{C} C there is a constant c ∈ N c \in\mathbb{N} c ∈ N such that no structure G ∈ C G \in\mathcal{C} G ∈ C contains a clean ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order c × c c \times c c × c .
We will prove the following two statements.
Lemma A.2. Every monadically dependent class C \mathcal{C} C of structures is dp-minimal.
Lemma A.3. Let C \mathcal{C} C be a dp-minimal class of structures, and let φ ( x ˉ , z ) \varphi(\bar{x},z) φ ( x ˉ , z ) and ψ ( y ˉ , z ) \psi(\bar{y},z) ψ ( y ˉ , z ) be first-order formulas in the signature of C \mathcal{C} C . Then there is a constant t ∈ N t \in\mathbb{N} t ∈ N such that no structure G ∈ C G \in\mathcal{C} G ∈ C contains a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order t × t t \times t t × t .
Clearly, Lemma A.2 and Lemma A.3 imply Lemma 5.11, repeated below.
Lemma 5.11. For every monadically dependent graph class C \mathcal{C} C and formulas φ ( x ˉ , z ) , ψ ( y ˉ , z ) \varphi(\bar{x},z),\psi(\bar{y},z) φ ( x ˉ , z ) , ψ ( y ˉ , z ) , there is some t ∈ N t \in\mathbb{N} t ∈ N such that no graph G ∈ C G \in\mathcal{C} G ∈ C contains a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order $t \times t.
We first prove Lemma A.2 . This follows easily from the following characterization of monadic dependence in terms of the independence property. A formula φ ( x ˉ , y ˉ ) \varphi(\bar{x},\bar{y}) φ ( x ˉ , y ˉ ) has the independence property on a class C \mathcal{C} C of structures if for every n ∈ N n \in\mathbb{N} n ∈ N there is some G ∈ C G \in\mathcal{C} G ∈ C and tuples a ˉ 1 , … , a ˉ n ∈ V ( G ) ∣ x ˉ ∣ \bar{a}_1,\ldots,\bar{a}_n \in V(G)^{|\bar{x}|} a ˉ 1 , … , a ˉ n ∈ V ( G ) ∣ x ˉ ∣ and ( b ˉ J ) J ⊆ [ n ] (\bar{b}_J)_{J \subseteq[n]} ( b ˉ J ) J ⊆ [ n ] in V ( G ) ∣ y ˉ ∣ V(G)^{|\bar{y}|} V ( G ) ∣ y ˉ ∣ such that for all i ∈ [ n ] i \in[n] i ∈ [ n ] and J ⊆ [ n ] J \subseteq[n] J ⊆ [ n ] ,
G ⊨ φ ( a ˉ i , b ˉ J ) ⟺ i ∈ J . G \models\varphi(\bar{a}_i,\bar{b}_J) \quad\Longleftrightarrow\quad i \in J. G ⊨ φ ( a ˉ i , b ˉ J ) ⟺ i ∈ J .
We use the following result of Baldwin and Shelah [11 Theorem 8.1.8] (see also [Prz26, Theorem 2.58 and Proposition 2.65] for a discussion).
Theorem A.4. A class C \mathcal{C} C is monadically dependent if and only if for all k ∈ N k \in\mathbb{N} k ∈ N , no first-order formula φ ( x ˉ , y ˉ ) \varphi(\bar{x},\bar{y}) φ ( x ˉ , y ˉ ) has the independence property on the class C ( k ) \mathcal{C}^{(k)} C ( k ) of all k k k -colorings of graphs in C \mathcal{C} C .
Proof of Lemma A.2 . Suppose that C \mathcal{C} C is monadically dependent, and let φ ( x ˉ , z ) \varphi(\bar{x},z) φ ( x ˉ , z ) and ψ ( y ˉ , z ) \psi(\bar{y},z) ψ ( y ˉ , z ) be first-order formulas in the signature of C \mathcal{C} C . Let G ∈ C G \in\mathcal{C} G ∈ C and suppose that a ˉ 1 , … , a ˉ m ∈ V ( G ) ∣ x ˉ ∣ \bar{a}_1,\ldots,\bar{a}_m \in V(G)^{|\bar{x}|} a ˉ 1 , … , a ˉ m ∈ V ( G ) ∣ x ˉ ∣ , b ˉ 1 , … , b ˉ m ∈ V ( G ) ∣ y ˉ ∣ \bar{b}_1,\ldots,\bar{b}_m \in V(G)^{|\bar{y}|} b ˉ 1 , … , b ˉ m ∈ V ( G ) ∣ y ˉ ∣ , and c i , j ∈ V ( G ) ∣ z ∣ c_{i,j} \in V(G)^{|z|} c i , j ∈ V ( G ) ∣ z ∣ for i , j ∈ [ m ] i,j \in[m] i , j ∈ [ m ] form a clean ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order m × m m \times m m × m in G G G .
Fix an arbitrary binary relation B ⊆ [ m ] × [ m ] B \subseteq[m] \times[m] B ⊆ [ m ] × [ m ] , and let G + G^+ G + be the expansion of G G G with a unary relation U U U interpreted as { c i , j : ( i , j ) ∈ B } \{c_{i,j} : (i,j) \in B\} { c i , j : ( i , j ) ∈ B } . Consider the following formula:
γ ( x ˉ , y ˉ ) : = ∃ z U ( z ) ∧ φ ( x ˉ , z ) ∧ ψ ( y ˉ , z ) . \gamma(\bar{x},\bar{y}) := \exists z\, U(z) \land\varphi(\bar{x},z) \land\psi(\bar{y},z). γ ( x ˉ , y ˉ ) := ∃ z U ( z ) ∧ φ ( x ˉ , z ) ∧ ψ ( y ˉ , z ) .
By the definition of a clean pattern, the above imply that
G + ⊨ γ ( a ˉ i , b ˉ j ) if and only if ( i , j ) ∈ B . (19) G^+ \models\gamma(\bar{a}_i,\bar{b}_j) \quad\text{if and only if}\quad(i,j) \in B. \tag*{(19)} G + ⊨ γ ( a ˉ i , b ˉ j ) if and only if ( i , j ) ∈ B . (19)
Indeed, if ( i , j ) ∈ B (i,j) \in B ( i , j ) ∈ B then the existential quantifier is witnessed by c i , j c_{i,j} c i , j . Conversely, a witness to the existential quantifier must be of the form c i ′ , j ′ c_{i',j'} c i ′ , j ′ for some ( i ′ , j ′ ) ∈ B (i',j') \in B ( i ′ , j ′ ) ∈ B , and then the definition of a clean pattern implies that i = i ′ i=i' i = i ′ and j = j ′ j=j' j = j ′ , thus ( i , j ) ∈ B (i,j) \in B ( i , j ) ∈ B .
Let k k k be the largest integer such that 2 k ≤ m 2^k \leq m 2 k ≤ m . Fix an arbitrary injection h : P ( [ k ] ) → [ m ] h : \mathcal{P}([k]) \to[m] h : P ([ k ]) → [ m ] from the powerset of [ k ] [k] [ k ] into [ m ] [m] [ m ] . As B ⊆ [ m ] × [ m ] B \subseteq[m] \times[m] B ⊆ [ m ] × [ m ] may be chosen arbitrarily, we may set
B : = { ( i , h ( J ) ) : i ∈ [ k ] , J ⊆ [ k ] , i ∈ J } . B := \{(i,h(J)) : i \in[k], J \subseteq[k], i \in J\}. B := {( i , h ( J )) : i ∈ [ k ] , J ⊆ [ k ] , i ∈ J } .
By (19) , G + ⊨ γ ( a ˉ i , b ˉ h ( J ) ) G^+ \models\gamma(\bar{a}_i,\bar{b}_{h(J)}) G + ⊨ γ ( a ˉ i , b ˉ h ( J ) ) holds if and only if i ∈ J i \in J i ∈ J , for all i ∈ [ k ] i \in[k] i ∈ [ k ] and J ⊆ [ k ] J \subseteq[k] J ⊆ [ k ] . As C \mathcal{C} C is monadically dependent, Theorem A.4 implies that k ≤ O C , γ ( 1 ) k \leq O_{\mathcal{C},\gamma}(1) k ≤ O C , γ ( 1 ) . Since the formula γ \gamma γ depends only on the original formulas φ \varphi φ and ψ \psi ψ , this implies k ≤ O C , φ , ψ ( 1 ) k \leq O_{\mathcal{C},\varphi,\psi}(1) k ≤ O C , φ , ψ ( 1 ) . As m < 2 k + 1 m < 2^{k+1} m < 2 k + 1 , we conclude that m ≤ O C , φ , ψ ( 1 ) m \leq O_{\mathcal{C},\varphi,\psi}(1) m ≤ O C , φ , ψ ( 1 ) , as required. ■
To prove Lemma A.3 , we use the following version of Ramsey’s theorem (see [22 full version, Lemma 4.4] ). For a tuple a ˉ = ( a 1 , … , a ℓ ) ∈ [ n ] ℓ \bar{a}=(a_1,\ldots,a_\ell) \in[n]^\ell a ˉ = ( a 1 , … , a ℓ ) ∈ [ n ] ℓ , the order type otp ( a ˉ ) \operatorname{otp}(\bar{a}) otp ( a ˉ ) of a ˉ \bar{a} a ˉ is the atomic type of a ˉ \bar{a} a ˉ in the ordered set ( [ n ] , ≤ ) ([n],\leq) ([ n ] , ≤ ) . More explicitly, it stores the information, for each i , j ∈ [ ℓ ] i,j \in[\ell] i , j ∈ [ ℓ ] , whether a i < a j a_i<a_j a i < a j , a i = a j a_i=a_j a i = a j , or a i > a j a_i>a_j a i > a j .
Lemma A.5. For every k , ℓ ∈ N k,\ell\in\mathbb{N} k , ℓ ∈ N there is an unbounded, non-decreasing function U k , ℓ : N → N U_{k,\ell}:\mathbb{N}\to\mathbb{N} U k , ℓ : N → N with the following property. For every t ∈ N t \in\mathbb{N} t ∈ N and coloring
c : [ t ] ℓ × [ t ] ℓ → [ k ] c : [t]^\ell\times[t]^\ell\to[k] c : [ t ] ℓ × [ t ] ℓ → [ k ] there are subsets I , J ⊆ [ t ] I,J \subseteq[t] I , J ⊆ [ t ] of size U k , ℓ ( t ) U_{k,\ell}(t) U k , ℓ ( t ) such that c ( a ˉ , b ˉ ) c(\bar{a},\bar{b}) c ( a ˉ , b ˉ ) only depends on otp ( a ˉ ) \operatorname{otp}(\bar{a}) otp ( a ˉ ) and otp ( b ˉ ) \operatorname{otp}(\bar{b}) otp ( b ˉ ) , for all a ˉ ∈ I ℓ \bar{a} \in I^\ell a ˉ ∈ I ℓ and b ˉ ∈ J ℓ \bar{b} \in J^\ell b ˉ ∈ J ℓ .
Proof of Lemma A.3 . Let C \mathcal{C} C be a dp-minimal class of structures, and let φ ( x ˉ , z ) \varphi(\bar{x},z) φ ( x ˉ , z ) and ψ ( y ˉ , z ) \psi(\bar{y},z) ψ ( y ˉ , z ) be first-order formulas in the signature of C \mathcal{C} C . Suppose that ( a ˉ i : i ∈ [ t ] ) (\bar{a}_i : i \in[t]) ( a ˉ i : i ∈ [ t ]) , ( b ˉ j : j ∈ [ t ] ) (\bar{b}_j : j \in[t]) ( b ˉ j : j ∈ [ t ]) and ( c i , j : i , j ∈ [ t ] ) (c_{i,j}: i,j \in[t]) ( c i , j : i , j ∈ [ t ]) form a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern of order t × t t \times t t × t in some G ∈ C G \in\mathcal{C} G ∈ C . We prove that t t t is bounded by some constant depending on C \mathcal{C} C , φ \varphi φ , and ψ \psi ψ .
The proof proceeds in two steps, restricting the considered profiles depicted in the right-hand side part of Figure 4 . In the first step, we arrive at a ( φ , ψ ) (\varphi,\psi) ( φ , ψ ) -pattern where all of the ?’s in those profiles are equal to some fixed boolean value 0 or 1. In the second step, we arrive at an ( α , β ) (\alpha,\beta) ( α , β ) -pattern, for some related formulas α , β \alpha,\beta α , β , for which the ?’s are further restricted to 0.
Step 1. As a first step we show that we can find sets I , J ⊆ [ t ] I,J \subseteq[t] I , J ⊆ [ t ] of large size m m m , to ensure the following property:
There are e 1 , e 2 ∈ { t r u e , f a l s e } e_1,e_2 \in\{true,false\} e 1 , e 2 ∈ { t r u e , f a l se } such that for all i , i ′ ∈ I i,i' \in I i , i ′ ∈ I and j , j ′ ∈ J j,j' \in J j , j ′ ∈ J ,
G ⊨ φ ( a ˉ i ′ , c i , j ) ⇔ e 1 G \models\varphi(\bar{a}_{i'},c_{i,j}) \Leftrightarrow e_1 G ⊨ φ ( a ˉ i ′ , c i , j ) ⇔ e 1 holds if i ′ < i i' < i i ′ < i ,
G ⊨ ψ ( b ˉ j ′ , c i , j ) ⇔ e 2 G \models\psi(\bar{b}_{j'},c_{i,j}) \Leftrightarrow e_2 G ⊨ ψ ( b ˉ j ′ , c i , j ) ⇔ e 2 holds if j ′ < j j' < j j ′ < j .
Indeed, define a coloring
c : [ t ] 2 × [ t ] 2 → { t r u e , f a l s e } 2 c : [t]^2 \times[t]^2 \to\{true,false\}^2 c : [ t ] 2 × [ t ] 2 → { t r u e , f a l se } 2
where c ( ( i , i ′ ) , ( j , j ′ ) ) c((i,i'),(j,j')) c (( i , i ′ ) , ( j , j ′ )) stores the truth values of G ⊨ φ ( a ˉ i ′ , c i , j ) G \models\varphi(\bar{a}_{i'},c_{i,j}) G ⊨ φ ( a ˉ i ′ , c i , j ) and G ⊨ ψ ( b ˉ j ′ , c i , j ) G \models\psi(\bar{b}_{j'},c_{i,j}) G ⊨ ψ ( b ˉ j ′ , c i , j ) . By Lemma A.5, there are subsets I , J ⊆ [ t ] I,J \subseteq[t] I , J ⊆ [ t ] of size U ( t ) U(t) U ( t ) , for some unbounded function U = U 4 , 2 U = U_{4,2} U = U 4 , 2 , such that c ( ( i , i ′ ) , ( j , j ′ ) ) c((i,i'),(j,j')) c (( i , i ′ ) , ( j , j ′ )) only depends on otp ( i , i ′ ) \operatorname{otp}(i,i') otp ( i , i ′ ) and otp ( j , j ′ ) \operatorname{otp}(j,j') otp ( j , j ′ ) for all i , i ′ ∈ I i,i' \in I i , i ′ ∈ I and j , j ′ ∈ J j,j' \in J j , j ′ ∈ J .
Let e 1 e_1 e 1 be the first component of c ( ( i , i ′ ) , ( j , j ′ ) ) c((i,i'),(j,j')) c (( i , i ′ ) , ( j , j ′ )) for i ′ < i ∈ I i' < i \in I i ′ < i ∈ I and j = j ′ ∈ J j=j' \in J j = j ′ ∈ J , and let e 2 e_2 e 2 be the second component of c ( ( i , i ′ ) , ( j , j ′ ) ) c((i,i'),(j,j')) c (( i , i ′ ) , ( j , j ′ )) for i = i ′ ∈ I i=i' \in I i = i ′ ∈ I and j ′ < j ∈ J j' < j \in J j ′ < j ∈ J . This choice satisfies the conditions 3. and 4. above.
Step 2. By reindexing and removing the last element of each of the sequences if necessary, assume that I = J = [ 2 m ] I=J=[2m] I = J = [ 2 m ] for some m ∈ N m \in\mathbb{N} m ∈ N with m ≥ U ( t ) / 2 − 1 m \ge U(t)/2-1 m ≥ U ( t ) /2 − 1 for some unbounded function U U U , and that all conditions 1.–4. above hold. As a next step, we show that we can modify the formulas and sequences for which conditions 1.–4. hold with e 1 = e 2 = f a l s e e_1=e_2=false e 1 = e 2 = f a l se .
Fix i , j ∈ [ 2 m ] i,j \in[2m] i , j ∈ [ 2 m ] and for i ′ ∈ [ 2 m ] i' \in[2m] i ′ ∈ [ 2 m ] let f i ′ ∈ { t r u e , f a l s e } f_{i'} \in\{true,false\} f i ′ ∈ { t r u e , f a l se } denote the truth value of G ⊨ φ ( a ˉ i ′ , c i , j ) G \models\varphi(\bar{a}_{i'},c_{i,j}) G ⊨ φ ( a ˉ i ′ , c i , j ) . Then f 1 , … , f 2 m f_1,\ldots,f_{2m} f 1 , … , f 2 m consists of a sequence of e 1 e_1 e 1 ’s, followed by a single t r u e true t r u e at position i i i , which is followed by a sequence of f a l s e false f a l se ’s. Grouping the sequence into consecutive pairs, and assuming that i i i is odd, we get a sequence of the form:
( e 1 , e 1 ) , … , ( e 1 , e 1 ) , ( t r u e , f a l s e ) , ( f a l s e , f a l s e ) , … , ( f a l s e , f a l s e ) . (e_1,e_1),\ldots,(e_1,e_1),(true,false),(false,false),\ldots,(false,false). ( e 1 , e 1 ) , … , ( e 1 , e 1 ) , ( t r u e , f a l se ) , ( f a l se , f a l se ) , … , ( f a l se , f a l se ) .
There is exactly one pair ( p , q ) (p,q) ( p , q ) in this sequence, namely the i + 1 2 \frac{i+1}{2} 2 i + 1 th one, with distinct truth values, that is, for which p XOR q p \operatorname{XOR} q p XOR q is t r u e true t r u e . A similar reasoning applies to ψ \psi ψ and ( b ˉ j ′ : j ′ ∈ [ 2 m ] ) (\bar{b}_{j'} : j' \in[2m]) ( b ˉ j ′ : j ′ ∈ [ 2 m ]) . This motivates us to consider the following formulas and sequences. Define
α ( x ˉ 1 x ˉ 2 , z ) : = φ ( x ˉ 1 , z ) XOR φ ( x ˉ 2 , z ) , \alpha(\bar{x}_1\bar{x}_2,z) := \varphi(\bar{x}_1,z) \operatorname{XOR} \varphi(\bar{x}_2,z), α ( x ˉ 1 x ˉ 2 , z ) := φ ( x ˉ 1 , z ) XOR φ ( x ˉ 2 , z ) ,
β ( y ˉ 1 y ˉ 2 , z ) : = ψ ( y ˉ 1 , z ) XOR ψ ( y ˉ 2 , z ) . \beta(\bar{y}_1\bar{y}_2,z) := \psi(\bar{y}_1,z) \operatorname{XOR} \psi(\bar{y}_2,z). β ( y ˉ 1 y ˉ 2 , z ) := ψ ( y ˉ 1 , z ) XOR ψ ( y ˉ 2 , z ) .
For i ∈ [ m ] i \in[m] i ∈ [ m ] , let u ˉ i \bar{u}_i u ˉ i be the 2 ∣ x ˉ ∣ 2|\bar{x}| 2∣ x ˉ ∣ -tuple a ˉ 2 i − 1 a ˉ 2 i \bar{a}_{2i-1}\bar{a}_{2i} a ˉ 2 i − 1 a ˉ 2 i , and for j ∈ [ m ] j \in[m] j ∈ [ m ] let w ˉ j \bar{w}_j w ˉ j be the 2 ∣ y ˉ ∣ 2|\bar{y}| 2∣ y ˉ ∣ -tuple b ˉ 2 j − 1 b ˉ 2 j \bar{b}_{2j-1}\bar{b}_{2j} b ˉ 2 j − 1 b ˉ 2 j . Finally, let d i , j = c 2 i − 1 , 2 j − 1 d_{i,j}=c_{2i-1,2j-1} d i , j = c 2 i − 1 , 2 j − 1 . By the observation above, for all i , i ′ , j , j ′ ∈ [ m ] i,i',j,j' \in[m] i , i ′ , j , j ′ ∈ [ m ] we have that
(a) G ⊨ α ( u ˉ i ′ , d i , j ) G \models\alpha(\bar{u}_{i'},d_{i,j}) G ⊨ α ( u ˉ i ′ , d i , j ) if and only if i ′ = i i'=i i ′ = i , (b) G ⊨ β ( w ˉ j ′ , d i , j ) G \models\beta(\bar{w}_{j'},d_{i,j}) G ⊨ β ( w ˉ j ′ , d i , j ) if and only if j ′ = j j'=j j ′ = j .
Thus, ( u ˉ i : i ∈ [ m ] ) (\bar{u}_i:i\in[m]) ( u ˉ i : i ∈ [ m ]) , ( w ˉ j : j ∈ [ m ] ) (\bar{w}_j:j\in[m]) ( w ˉ j : j ∈ [ m ]) , and ( d i , j : i , j ∈ [ m ] ) (d_{i,j}:i,j\in[m]) ( d i , j : i , j ∈ [ m ]) form a clean ( α , β ) (\alpha,\beta) ( α , β ) -pattern of order m × m m\times m m × m . Dp-minimality therefore bounds m m m by a constant depending only on C \mathcal{C} C , α \alpha α , and β \beta β , hence only on C \mathcal{C} C , φ \varphi φ , and ψ \psi ψ . Since m ≥ U ( t ) / 2 − 1 m\ge U(t)/2-1 m ≥ U ( t ) /2 − 1 and U U U is unbounded and non-decreasing, this also bounds t t t by a constant depending only on C \mathcal{C} C , φ \varphi φ , and ψ \psi ψ , as required. ■
Corollary of Gaifman's locality theorem
In this appendix, we prove Lemma 4.9 and Lemma 6.1.
We will use Gaifman's Locality Theorem [35 ] . We recommend [45 Section 4.1] for an introduction. First some definitions.
Fix a finite relational signature σ \sigma σ of arity α \alpha α . Two σ \sigma σ -formulas φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) and ψ ( x ˉ ) \psi(\bar{x}) ψ ( x ˉ ) are equivalent if for every σ \sigma σ -structure A A A and every tuple a ˉ ∈ V ( A ) ∣ x ˉ ∣ \bar{a}\in V(A)^{|\bar{x}|} a ˉ ∈ V ( A ) ∣ x ˉ ∣
A ⊨ φ ( a ˉ ) ⟺ A ⊨ ψ ( a ˉ ) . A\models\varphi(\bar{a})\Longleftrightarrow A\models\psi(\bar{a}). A ⊨ φ ( a ˉ ) ⟺ A ⊨ ψ ( a ˉ ) .
Let adj σ ( x 1 , x 2 ) \operatorname{adj}_{\sigma}(x_1,x_2) adj σ ( x 1 , x 2 ) be the formula that tests whether x 1 x_1 x 1 and x 2 x_2 x 2 are adjacent in the Gaifman graph. More precisely, adj σ \operatorname{adj}_{\sigma} adj σ tests for every relation R ∈ σ R\in\sigma R ∈ σ of arity β \beta β with 2 ≤ β ≤ α 2\le\beta\le\alpha 2 ≤ β ≤ α , whether x 1 ≠ x 2 x_1\ne x_2 x 1 = x 2 and there exist elements x 3 , … , x β x_3,\ldots,x_\beta x 3 , … , x β such that some permutation of x 1 , … , x β x_1,\ldots,x_\beta x 1 , … , x β satisfies R R R . Thus, the quantifier rank of adj σ \operatorname{adj}_{\sigma} adj σ can be bounded by α − 2 \alpha-2 α − 2 . We can naturally derive a formula dist ( x 1 , x 2 ) ≤ r \operatorname{dist}(x_1,x_2)\le r dist ( x 1 , x 2 ) ≤ r checking whether x 1 x_1 x 1 and x 2 x_2 x 2 have distance at most r r r in the Gaifman graph. We can (generously) bound the quantifier rank of ( dist ( x 1 , x 2 ) ≤ r ) (\operatorname{dist}(x_1,x_2)\le r) ( dist ( x 1 , x 2 ) ≤ r ) by r + α r+\alpha r + α (quantifying candidate vertices for the path and then checking the required adjacencies “in parallel”).
A σ \sigma σ -formula φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) is r r r -local if every quantifier appearing in φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) is of the form ∀ y ∈ Balls ( x ˉ ) \forall y\in\operatorname{Balls}(\bar{x}) ∀ y ∈ Balls ( x ˉ ) or ∃ y ∈ Balls ( x ˉ ) \exists y\in\operatorname{Balls}(\bar{x}) ∃ y ∈ Balls ( x ˉ ) for some s ≤ r s\le r s ≤ r , where the ball checks are implemented using the dist formulas (which we exempt from this condition). A sentence ψ \psi ψ is basic r r r -local if there is some r ′ ≤ r r'\le r r ′ ≤ r such that ψ \psi ψ is of the form
∃ x 1 , … , x m ⋀ 1 ≤ i < j ≤ m dist ( x i , x j ) > 2 r ′ ∧ ⋀ 1 ≤ i ≤ m φ ( x i ) \exists x_1,\ldots,x_m\ \bigwedge_{1\le i<j\le m}\operatorname{dist}(x_i,x_j)>2r'\ \land\ \bigwedge_{1\le i\le m}\varphi(x_i) ∃ x 1 , … , x m 1 ≤ i < j ≤ m ⋀ dist ( x i , x j ) > 2 r ′ ∧ 1 ≤ i ≤ m ⋀ φ ( x i )
for an r ′ r' r ′ -local formula φ \varphi φ .
Intuitively: whether an r r r -local formula holds on a tuple depends only on the r r r -ball of that tuple, as made precise in the following lemma.
Lemma B.1. Let φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) be an r r r -local σ \sigma σ -formula, let A A A be a σ \sigma σ -structure, let a ˉ ∈ V ( A ) ∣ x ˉ ∣ \bar{a}\in V(A)^{|\bar{x}|} a ˉ ∈ V ( A ) ∣ x ˉ ∣ , and let Ball r A ( a ˉ ) ⊆ B ⊆ V ( A ) \operatorname{Ball}^{A}_{r}(\bar{a})\subseteq B\subseteq V(A) Ball r A ( a ˉ ) ⊆ B ⊆ V ( A ) . Then A ⊨ φ ( a ˉ ) ⟺ A [ B ] ⊨ φ ( a ˉ ) A\models\varphi(\bar{a})\Longleftrightarrow A[B]\models\varphi(\bar{a}) A ⊨ φ ( a ˉ ) ⟺ A [ B ] ⊨ φ ( a ˉ ) .
Proof. When φ \varphi φ is evaluated in A [ B ] A[B] A [ B ] , its bounded quantifiers range over balls in the Gaifman graph of A [ B ] A[B] A [ B ] , which for arity above two can have fewer edges than the Gaifman graph of A A A restricted to B B B . Still, Ball s A [ B ] ( a ˉ ) = Ball s A ( a ˉ ) \operatorname{Ball}^{A[B]}_{s}(\bar{a})=\operatorname{Ball}^{A}_{s}(\bar{a}) Ball s A [ B ] ( a ˉ ) = Ball s A ( a ˉ ) for all s ≤ r s\le r s ≤ r , since a shortest path from a ˉ \bar{a} a ˉ of length at most r r r survives in A [ B ] A[B] A [ B ] : every tuple witnessing its j j j -th edge has all entries at distance at most j ≤ r j\le r j ≤ r from a ˉ \bar{a} a ˉ , hence in B B B . So the bounded quantifiers of φ \varphi φ range over the same subsets of B B B in A A A and in A [ B ] A[B] A [ B ] , and since A [ B ] A[B] A [ B ] is an induced substructure of A A A , the claim follows. ■
The following theorem is one of the key tools for limiting the expressiveness of first-order logic.
Theorem B.2 (Gaifman’s Locality Theorem [35 ] ). For all α , q , k ∈ N \alpha,q,k \in\mathbb{N} α , q , k ∈ N there is a p = p ( α , q , k ) p=p(\alpha,q,k) p = p ( α , q , k ) computable from α , q , k \alpha,q,k α , q , k with the following property. Let σ \sigma σ be a finite relational signature of arity at most α \alpha α . Every σ \sigma σ -formula φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) of quantifier rank at most q q q and with ∣ x ˉ ∣ ≤ k |\bar{x}| \leq k ∣ x ˉ ∣ ≤ k free variables is equivalent to a σ \sigma σ -formula φ l o c ( x ˉ ) \varphi^{\mathrm{loc}}(\bar{x}) φ loc ( x ˉ ) , computable from φ \varphi φ , that is a Boolean combination of basic 7 q 7^{q} 7 q -local sentences and 7 q 7^{q} 7 q -local formulas, each of quantifier rank at most p p p .
The above theorem was proven in [35 ] , but the paper does not explicitly state the highlighted bound p p p on the quantifier rank. Analyzing the proof in [35 ] shows that, indeed, there exists a bound p p p that only depends on α \alpha α , q q q , and k k k , but not on the specific choice of the signature σ \sigma σ . This observation is made explicit in the recent rank-preserving locality theorems presented in [31 ] and [4 ] . In all three papers [35 , 31 , 4 ] , the dependence of p p p on the arity α \alpha α is subtle. Each of them produces a formula in some extension of first-order logic (FO). While these extensions of FO are equivalent in expressive power to plain FO, they each contain predicates measuring distances in the Gaifman graph of a structure. As discussed above, converting such distance formulas to plain FO introduces an additional nesting of quantifiers depending on the arity α \alpha α .
Lemma 4.9 (Corollary of Gaifman locality). For every k , q , α ∈ N k,q,\alpha\in\mathbb{N} k , q , α ∈ N , there are numbers h = h ( q ) h=h(q) h = h ( q ) and q ′ = q ′ ( k , q , α ) q'=q'(k,q,\alpha) q ′ = q ′ ( k , q , α ) computable from k , q , α k,q,\alpha k , q , α , with the following property. Fix a finite relational signature σ \sigma σ of arity at most α \alpha α and a σ \sigma σ -structure A A A . Then, for all a ˉ ∈ V ( A ) k \bar{a} \in V(A)^k a ˉ ∈ V ( A ) k and B ⊇ Ball h A ( a ˉ ) B \supseteq\operatorname{Ball}^{A}_{h}(\bar{a}) B ⊇ Ball h A ( a ˉ ) , tp q A ( a ˉ ) \operatorname{tp}^{A}_{q}(\bar{a}) tp q A ( a ˉ ) depends only on tp q ′ A [ B ] ( a ˉ ) \operatorname{tp}^{A[B]}_{q'}(\bar{a}) tp q ′ A [ B ] ( a ˉ ) .
Proof. Let h : = 7 q h:=7^{q} h := 7 q , and let q ′ : = p q':=p q ′ := p be given by Theorem B.2 for α , q , k \alpha,q,k α , q , k . Let a ˉ , b ˉ ∈ V ( A ) k \bar{a},\bar{b}\in V(A)^k a ˉ , b ˉ ∈ V ( A ) k , B a ⊇ Ball h A ( a ˉ ) B_a\supseteq\operatorname{Ball}^{A}_{h}(\bar{a}) B a ⊇ Ball h A ( a ˉ ) and B b ⊇ Ball h A ( b ˉ ) B_b\supseteq\operatorname{Ball}^{A}_{h}(\bar{b}) B b ⊇ Ball h A ( b ˉ ) with tp q ′ A [ B a ] ( a ˉ ) = tp q ′ A [ B b ] ( b ˉ ) \operatorname{tp}^{A[B_a]}_{q'}(\bar{a})=\operatorname{tp}^{A[B_b]}_{q'}(\bar{b}) tp q ′ A [ B a ] ( a ˉ ) = tp q ′ A [ B b ] ( b ˉ ) . By Theorem B.2, every formula φ ( x ˉ ) \varphi(\bar{x}) φ ( x ˉ ) of quantifier rank at most q q q is equivalent to a Boolean combination of sentences and h h h -local formulas of quantifier rank at most q ′ q' q ′ . The sentences have a fixed truth value in A A A independent of a ˉ \bar{a} a ˉ and b ˉ \bar{b} b ˉ . For an h h h -local formula ψ ( x ˉ ) \psi(\bar{x}) ψ ( x ˉ ) of quantifier rank at most q ′ q' q ′ ,
A ⊨ ψ ( a ˉ ) ⟺ A [ B a ] ⊨ ψ ( a ˉ ) ⟺ A [ B b ] ⊨ ψ ( b ˉ ) ⟺ A ⊨ ψ ( b ˉ ) , A \models\psi(\bar{a}) \Longleftrightarrow A[B_a] \models\psi(\bar{a}) \Longleftrightarrow A[B_b] \models\psi(\bar{b}) \Longleftrightarrow A \models\psi(\bar{b}), A ⊨ ψ ( a ˉ ) ⟺ A [ B a ] ⊨ ψ ( a ˉ ) ⟺ A [ B b ] ⊨ ψ ( b ˉ ) ⟺ A ⊨ ψ ( b ˉ ) ,
where the middle equivalence follows from the assumed equality of the q ′ q' q ′ -types. The first and third equivalences follow from Lemma B.1. Hence, A ⊨ φ ( a ˉ ) ⟺ A ⊨ φ ( b ˉ ) A \models\varphi(\bar{a}) \Longleftrightarrow A \models\varphi(\bar{b}) A ⊨ φ ( a ˉ ) ⟺ A ⊨ φ ( b ˉ ) for all formulas of quantifier rank at most q q q , so tp q A ( a ˉ ) = tp q A ( b ˉ ) \operatorname{tp}^{A}_{q}(\bar{a})=\operatorname{tp}^{A}_{q}(\bar{b}) tp q A ( a ˉ ) = tp q A ( b ˉ ) . ■
Lemma B.3. For every q , k , c ∈ N q,k,c \in\mathbb{N} q , k , c ∈ N there are numbers r = r ( q ) r=r(q) r = r ( q ) and T = T ( q , k , c ) T=T(q,k,c) T = T ( q , k , c ) with the following property. Let H H H be a graph expanded by at most c c c unary predicates, and let U ⊆ V ( H ) U \subseteq V(H) U ⊆ V ( H ) be finite. Consider the set F : = { a ∈ V ( H ) : dist H ( a , U ) > r } F:=\{a\in V(H):\operatorname{dist}^{H}(a,U)>r\} F := { a ∈ V ( H ) : dist H ( a , U ) > r } of vertices that are far from U U U . We can bound
∣ Types k , q H ( F / U ) ∣ ≤ T ( q , k , c ) . \left|\operatorname{Types}^{H}_{k,q}(F/U)\right| \leq T(q,k,c). Types k , q H ( F / U ) ≤ T ( q , k , c ) . Proof. Let h h h and q ′ q' q ′ be given by Lemma 4.9 for k , q k,q k , q , and α = 2 \alpha=2 α = 2 . Since h = h ( q ) h=h(q) h = h ( q ) , the radius r : = h + 1 r:=h+1 r := h + 1 depends only on q q q .
Let H + H^{+} H + be the expansion of H H H by the unary predicates P u : = { u } P_u:=\{u\} P u := { u } and N u : = N H ( u ) N_u:=N^{H}(u) N u := N H ( u ) for all u ∈ U u\in U u ∈ U . Then H + H^{+} H + has a finite relational signature of arity two, and its Gaifman graph is the underlying graph of H H H . Take a formula with parameters from U U U . Replace every atom x = u x=u x = u or u = x u=x u = x by P u ( x ) P_u(x) P u ( x ) , every atom E ( x , u ) E(x,u) E ( x , u ) or E ( u , x ) E(u,x) E ( u , x ) by N u ( x ) N_u(x) N u ( x ) , and every atom without variables by its truth value in H H H . This gives a parameter-free formula in the signature of H + H^{+} H + that has the same quantifier rank and is satisfied by the same tuples. Hence tp q H + ( a ˉ ) \operatorname{tp}^{H^{+}}_{q}(\bar{a}) tp q H + ( a ˉ ) determines tp q H ( a ˉ / U ) \operatorname{tp}^{H}_{q}(\bar{a}/U) tp q H ( a ˉ / U ) .
Let a ˉ ∈ F k \bar{a} \in F^k a ˉ ∈ F k and B : = Ball h H + ( a ˉ ) B := \operatorname{Ball}^{H^+}_{h}(\bar{a}) B := Ball h H + ( a ˉ ) . Every w ∈ B w \in B w ∈ B satisfies dist H ( w , U ) > r − h = 1 \operatorname{dist}^{H}(w,U) > r-h=1 dist H ( w , U ) > r − h = 1 , so B B B avoids U U U and all neighbors of vertices in U U U . Thus every P u P_u P u and N u N_u N u is empty in H + [ B ] H^+[B] H + [ B ] . So H + [ B ] H^+[B] H + [ B ] is the induced subgraph H [ B ] H[B] H [ B ] expanded by empty predicates. Then tp q ′ H [ B ] ( a ˉ ) \operatorname{tp}^{H[B]}_{q'}(\bar{a}) tp q ′ H [ B ] ( a ˉ ) determines tp q ′ H + [ B ] ( a ˉ ) \operatorname{tp}^{H^+[B]}_{q'}(\bar{a}) tp q ′ H + [ B ] ( a ˉ ) . By Lemma 4.9, tp q ′ H + [ B ] ( a ˉ ) \operatorname{tp}^{H^+[B]}_{q'}(\bar{a}) tp q ′ H + [ B ] ( a ˉ ) determines tp q H + ( a ˉ ) \operatorname{tp}^{H^+}_{q}(\bar{a}) tp q H + ( a ˉ ) , and hence tp q H ( a ˉ / U ) \operatorname{tp}^{H}_{q}(\bar{a}/U) tp q H ( a ˉ / U ) . Here we crucially use that h h h and q ′ q' q ′ do not depend on the signature of H + H^+ H + , which grows with ∣ U ∣ |U| ∣ U ∣ . So ∣ Types k , q H ( F / U ) ∣ |\operatorname{Types}^{H}_{k,q}(F/U)| ∣ Types k , q H ( F / U ) ∣ is at most the number of parameter-free rank-q ′ q' q ′ types of k k k -tuples in graphs with c c c unary predicates. This number is finite and depends only on q ′ q' q ′ , k k k , and c c c , hence only on q q q , k k k , and c c c . Call it T ( q , k , c ) T(q,k,c) T ( q , k , c ) . ■
The following is an adaptation of [53 Corollary 16] .
Lemma 6.1. For every q , k , c ∈ N q,k,c \in\mathbb{N} q , k , c ∈ N there are numbers r = r ( q ) r=r(q) r = r ( q ) and T = T ( q , k , c ) T=T(q,k,c) T = T ( q , k , c ) with the following property. Let H H H be a graph expanded by at most c c c unary predicates, and let U ⊆ V ( H ) U \subseteq V(H) U ⊆ V ( H ) be finite. Fix a tuple u ˉ \bar{u} u ˉ of vertices of U U U of finite length. Let F : = { a ∈ V ( H ) : dist H ( a , U ) > r } F := \{a \in V(H) : \operatorname{dist}^{H}(a,U)>r\} F := { a ∈ V ( H ) : dist H ( a , U ) > r } . Then
∣ { tp q H ( a ˉ u ˉ / U ) : a ˉ ∈ F k } ∣ ≤ T ( q , k , c ) . \left|\left\{\operatorname{tp}^{H}_{q}(\bar{a}\bar{u}/U) : \bar{a} \in F^k\right\}\right| \leq T(q,k,c). { tp q H ( a ˉ u ˉ / U ) : a ˉ ∈ F k } ≤ T ( q , k , c ) .
Proof. Let r = r ( q ) r=r(q) r = r ( q ) and T = T ( q , k , c ) T=T(q,k,c) T = T ( q , k , c ) be given by Lemma B.3, yielding the desired bound
∣ { tp q H ( a ˉ / U ) : a ˉ ∈ F k } ∣ ≤ T ( q , k , c ) \left|\left\{\operatorname{tp}^{H}_{q}(\bar{a}/U) : \bar{a} \in F^k\right\}\right| \leq T(q,k,c) { tp q H ( a ˉ / U ) : a ˉ ∈ F k } ≤ T ( q , k , c )
in case no tuple u ˉ \bar{u} u ˉ is involved. To lift that result, it remains to show that for a fixed tuple u ˉ \bar{u} u ˉ with elements from U U U , the type tp q H ( a ˉ u ˉ / U ) \operatorname{tp}^{H}_{q}(\bar{a}\bar{u}/U) tp q H ( a ˉ u ˉ / U ) depends only on tp q H ( a ˉ / U ) \operatorname{tp}^{H}_{q}(\bar{a}/U) tp q H ( a ˉ / U ) . More precisely, it suffices to show that there exists a map φ ↦ φ u ˉ \varphi\mapsto\varphi_{\bar{u}} φ ↦ φ u ˉ such that every formula φ ( x ˉ y ˉ ) \varphi(\bar{x}\bar{y}) φ ( x ˉ y ˉ ) with quantifier rank ≤ q \leq q ≤ q , ∣ x ˉ ∣ = k |\bar{x}|=k ∣ x ˉ ∣ = k and ∣ y ˉ ∣ = ∣ u ˉ ∣ |\bar{y}|=|\bar{u}| ∣ y ˉ ∣ = ∣ u ˉ ∣ , and parameters from U U U gets mapped to a formula φ u ˉ ( x ˉ ) \varphi_{\bar{u}}(\bar{x}) φ u ˉ ( x ˉ ) of the same quantifier rank and again with parameters from U U U such that for every a ˉ ∈ F k \bar{a} \in F^k a ˉ ∈ F k
φ ∈ tp q H ( a ˉ u ˉ / U ) ⟺ H ⊨ φ ( a ˉ u ˉ ) ⟺ H ⊨ φ u ˉ ( a ˉ ) ⟺ φ u ˉ ∈ tp q H ( a ˉ / U ) . \varphi\in\operatorname{tp}^{H}_{q}(\bar{a}\bar{u}/U)
\Longleftrightarrow H \models\varphi(\bar{a}\bar{u})
\Longleftrightarrow H \models\varphi_{\bar{u}}(\bar{a})
\Longleftrightarrow\varphi_{\bar{u}} \in\operatorname{tp}^{H}_{q}(\bar{a}/U). φ ∈ tp q H ( a ˉ u ˉ / U ) ⟺ H ⊨ φ ( a ˉ u ˉ ) ⟺ H ⊨ φ u ˉ ( a ˉ ) ⟺ φ u ˉ ∈ tp q H ( a ˉ / U ) .
We can obtain a suitable φ u ˉ ( x ˉ ) \varphi_{\bar{u}}(\bar{x}) φ u ˉ ( x ˉ ) from φ ( x ˉ y ˉ ) \varphi(\bar{x}\bar{y}) φ ( x ˉ y ˉ ) by substituting in φ \varphi φ each free variable y i ∈ y ˉ y_i \in\bar{y} y i ∈ y ˉ with the corresponding parameter u i ∈ u ˉ u_i \in\bar{u} u i ∈ u ˉ from U U U . This translation depends only on u ˉ \bar{u} u ˉ and not on a ˉ \bar{a} a ˉ . It does not change the quantifier rank, and still all parameters of φ u ˉ \varphi_{\bar{u}} φ u ˉ are contained in U U U . ■
Remark B.4. In Lemma 6.1, the bound crucially relies on u ˉ \bar{u} u ˉ being fixed, as the translation φ ↦ φ u ˉ \varphi\mapsto\varphi_{\bar{u}} φ ↦ φ u ˉ differs for different u ˉ \bar{u} u ˉ . Without fixing u ˉ \bar{u} u ˉ there is no bound independent of ∣ U ∣ |U| ∣ U ∣ : for k = 1 k=1 k = 1 , a ∈ F a \in F a ∈ F , and u ˉ = ( u ) \bar{u}=(u) u ˉ = ( u ) ranging over U U U , the formulas ψ u ( x y ) : = ( y = u ) \psi_u(xy):=(y=u) ψ u ( x y ) := ( y = u ) (each using a different parameter u u u ) show that the tuples a u au a u realize ∣ U ∣ |U| ∣ U ∣ different types over U U U .
Locally definable construction sequences in nowhere dense classes
We prove Theorem 4.8, that in nowhere dense classes, we can obtain definable construction sequences of length O ( n 1 + ε ) O(n^{1+\varepsilon}) O ( n 1 + ε ) for any ε > 0 \varepsilon>0 ε > 0 , with O ( n ε ) O(n^\varepsilon) O ( n ε ) parameters and quantifier rank 0 0 0 .
Theorem 4.8. Let C \mathcal{C} C be a nowhere dense graph class, r ∈ N r \in\mathbb{N} r ∈ N , and ε > 0 \varepsilon>0 ε > 0 . Every n n n -vertex graph G ∈ C G \in\mathcal{C} G ∈ C has a radius-r r r definable construction sequence with one unary predicate, O C , r , ε ( n ε ) O_{\mathcal{C},r,\varepsilon}(n^\varepsilon) O C , r , ε ( n ε ) parameters, quantifier rank 0 0 0 , and length O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) . Such a sequence can be computed in time O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) .
Proof sketch. Let G ∈ C G \in\mathcal{C} G ∈ C have n n n vertices. We use the almost bounded weak coloring numbers of nowhere dense classes [50 , 42 ] , through the following consequence [24 ] . For v ∉ U v \notin U v ∈ / U , let S s ( v , U ) S_s(v,U) S s ( v , U ) be the set of vertices in U U U reachable from v v v by a path of length at most s s s whose internal vertices avoid U U U . There is a total order on V ( G ) V(G) V ( G ) such that ∣ S r + 1 ( v , U ) ∣ ≤ O C , r , ε ( n ε ) \lvert S_{r+1}(v,U)\rvert\le O_{\mathcal{C},r,\varepsilon}(n^\varepsilon) ∣ S r + 1 ( v , U )∣ ≤ O C , r , ε ( n ε ) for every prefix U U U of this order and every v ∉ U v \notin U v ∈ / U . Such an order can be computed in time O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) by the algorithm of Grohe, Kreutzer, and Siebertz [42 ] for weak coloring orders: every vertex of S r + 1 ( v , U ) S_{r+1}(v,U) S r + 1 ( v , U ) is weakly ( r + 1 ) (r+1) ( r + 1 ) -reachable from v v v , since it is the smallest vertex on the witnessing path.
For each prefix U U U , consider the partial graph H U H_U H U on V ( G ) V(G) V ( G ) whose positive resolved pairs are the edges of G [ V ( G ) − U ] G[V(G)-U] G [ V ( G ) − U ] , whose negative relation is empty, and whose parts are the atomic types in G G G over U U U . Thus the vertices of U U U are singleton parts, and the remaining vertices are grouped by their neighborhoods in U U U . Starting with U = V ( G ) U=V(G) U = V ( G ) , remove the last vertex u u u of U U U one at a time. To pass from H U H_U H U to H U ′ H_{U'} H U ′ , where U ′ = U − { u } U'=U-\{u\} U ′ = U − { u } , first resolve positively between { u } \{u\} { u } and each part outside U U U adjacent to u u u in G G G , and then merge parts with the same atomic type over U ′ U' U ′ . Finally, when U U U is empty, one negative resolve within the unique part completes the sequence. There are at most ∣ E ( G ) ∣ \lvert E(G)\rvert ∣ E ( G )∣ positive resolves and n − 1 n-1 n − 1 merges, giving length O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) by the sparsity of C \mathcal{C} C .
To implement the construction, first compute the atomic-type partitions over the prefixes in forward order by partition refinement: when adding u u u , split off { u } \{u\} { u } and refine the remaining parts by adjacency to u u u . Using adjacency lists, this takes O ( n + ∣ E ( G ) ∣ ) O(n+\lvert E(G)\rvert) O ( n + ∣ E ( G )∣) time in total. Record these splits and the resulting adjacent parts outside the prefix. Processing the prefixes in reverse order, resolve positively against the recorded adjacent parts and undo the recorded splits by merges. Thus the sequence can be computed in time O C , r , ε ( n 1 + ε ) O_{\mathcal{C},r,\varepsilon}(n^{1+\varepsilon}) O C , r , ε ( n 1 + ε ) , including the computation of the order.
To see local definability, consider two consecutive partial graphs H , H ′ H,H' H , H ′ during the transition from H U H_U H U to H U ′ H_{U'} H U ′ , and put B = Ball r H ′ ( v ) B=\operatorname{Ball}_{r}^{H'}(v) B = Ball r H ′ ( v ) . Vertices of U ′ U' U ′ are still isolated, so their balls are singletons and are easy to define. Otherwise B ⊆ V ( G ) − U ′ B\subseteq V(G)-U' B ⊆ V ( G ) − U ′ . Every resolved pair of H ′ H' H ′ is an edge of G G G , so every vertex of U ′ U' U ′ adjacent in G G G to a vertex of B B B belongs to S r + 1 ( v , U ′ ) S_{r+1}(v,U') S r + 1 ( v , U ′ ) . All vertices of U ′ U' U ′ outside this separator are therefore nonadjacent to every vertex of B B B . Thus, on B B B , the atomic types in G G G over U U U are determined by adjacency and equality tests against the parameters
S r + 1 ( v , U ′ ) ∪ { u } . S_{r+1}(v,U') \cup\{u\}. S r + 1 ( v , U ′ ) ∪ { u } .
This set has size O C , r , ε ( n ε ) O_{\mathcal{C},r,\varepsilon}(n^\varepsilon) O C , r , ε ( n ε ) . Each atomic-type part is therefore quantifier-free definable, and merging parts corresponds to taking disjunctions of their definitions. The resolved edges are the original edges between vertices outside U U U , together with edges from u u u to the parts already resolved against it, so they too have quantifier-free definitions using these parameters. One unary predicate naming B B B restricts these definitions to the required domain. The final negative resolve is immediate, since just before it the positive relation is E ( G ) E(G) E ( G ) and there is only one part. Thus the same bounds apply to H [ Ball r H ′ ( v ) ] H[\operatorname{Ball}_{r}^{H'}(v)] H [ Ball r H ′ ( v )] , including the intermediate merges and resolves. ■