CCS Concepts: • Theory of computation → Logic and databases ; Finite Model Theory .
Additional Key Words and Phrases: Quantified Conjunctive Queries, Finite Model Theory, Width.
Introduction
Background. The problem of minimising a query while preserving logical equivalence is a classical and central topic in database theory. Indeed, the notions of equivalence, containment, and minimisation were already identified in the 1970s [14 ] as giving rise to fundamental algorithmic problems underlying conjunctive queries (CQs). Since then, a rich line of work has studied these questions in close connection with constraint satisfaction , homomorphisms , and finite-variable logics [2 , 3 , 5 , 15 , 23 , 24 , 25 , 30 , 31 , 33 , 35 , 36 ] . In this line of research, a central structural measure is the width of a formula φ \varphi φ , denoted by width ( φ ) \operatorname{width}(\varphi) width ( φ ) , which is the maximum number of free variables over all subformulae [1 , 9 , 11 , 22 , 30 , 31 , 41 ] . Using standard variable renaming, in ordinary one-sorted first-order logic, the minimum width of a sentence ϕ \phi ϕ over all formulae logically equivalent to ϕ \phi ϕ , which we call the logical width and denote by logwidth ( ϕ ) \operatorname{logwidth}(\phi) logwidth ( ϕ ) , coincides with the minimum number of variables needed to express ϕ \phi ϕ [32 ] . This coincidence does not hold in general in many-sorted variants, where sorts can restrict variable reuse. Width is therefore a more general structural parameter in such settings, particularly for lower-bound arguments, and we take it as our reference measure throughout this work. The natural bottom-up evaluation algorithm for first-order logic (on finite structures) has an exponential dependence on the width [41 ] and can be performed in polynomial time for sentences of bounded width . Moreover, when the arity of relations is fixed, there are dichotomy theorems showing that bounded width is the exclusive explanation for the tractability of classes of formulae [17 , 23 , 24 , 30 , 31 ] . Thus, width is a fundamental measure in query evaluation.
A strongly related measure associated with CQs, and generalisations thereof, is the treewidth [39 ] of the query hypergraph : each atom induces a hyperedge on its variables. This measure has been used to identify structurally tractable classes of formulae and related evaluation problems [25 , 27 , 36 ] . The interaction between width and treewidth in this context, as well as the study of other measures of the query hypergraph, has proved central to modern approaches to query evaluation , semantic optimisation , and query rewriting [6 , 15 , 22 , 27 , 30 , 31 , 38 ] . However, width minimisation of a first-order query up to logical equivalence is noncomputable in general [1 ] , and already noncomputable in positive logic [9 ] . This motivates the search for exact minimisation results on robust subclasses of queries [12 ] , as well as characterisations of the minimum width obtainable under rewritings [22 ] .
Quantified Conjunctive Queries. The aim of this article is to go beyond the purely existential case by considering width minimisation for quantified conjunctive queries (QCQs). These naturally extend CQs by allowing both existential and universal quantifiers, while keeping conjunction as the only Boolean connective.1 In this sense, QCQs are closely related to the quantified constraint satisfaction problem (QCSP) and, more generally, to positive Horn logic [8 , 16 ] . This connection has been fruitfully exploited in the study of containment problems : for QCSPs, inclusion between templates admits homomorphic and algebraic characterisations [19 , 20 ] ; for QCQs, entailment admits a Chandra–Merlin style characterisation via Skolem homomorphisms, is NP-complete, and coincides with its finite variant [13 ] . The model-checking problem for QCQs has also been studied through parameters that generalise treewidth to account for the interaction between the quantifier prefix and the query hypergraph [18 ] . Thus, QCQs combine the structural discipline of CQs with the additional expressive power brought by the presence of both existential and universal quantification and the resulting quantifier alternation. This makes minimisation questions for QCQs particularly compelling. In the existential-positive setting, when the goal is to optimise a given existential-positive query, optimising within the class of existential-positive queries is equivalent to optimising within the class of all first-order queries [12 ] .2 This raises the question of whether a similar phenomenon holds for QCQs and whether the logical width of QCQs can be analysed.
We take a first step in this direction by considering the width minimisation of self-join-free QCQs , namely QCQs where no relation symbol is repeated. This setting captures the essential interaction between width and quantifier alternation, while providing a clean stepping stone towards understanding general QCQs. Minimisation within the class of CQs is a classical issue [14 ] ; for width minimisation, after passing to the core , the minimal width is controlled by treewidth [12 ] . In contrast, even for self-join-free QCQs, prior to this work, there was no transparent method for minimising width within the class of QCQs itself, let alone over the class of first-order formulae.
Rewriting. To address the problem of width minimisation for QCQs, we consider a rewriting framework developed recently by Chen and Mengel [22 ] . Informally, this framework is based on a set of rewriting rules A \mathcal{A} A that are known to preserve logical equivalence, and in the case of QCQs, contain rules that reorder quantifiers of the same kind, push existential quantifiers towards the atoms, split universal quantification over conjunctions, and remove vacuous quantifiers. These rules organise a QCQ into alternating regions : { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -regions, built from existential quantifiers and conjunctions, and { ∀ } \{\forall\} { ∀ } -regions, built from universal quantifiers only. Each region ψ \psi ψ has an associated hypergraph H ψ H_\psi H ψ . Its hyperedges record how ψ \psi ψ interacts both with its immediate subregions and the context above it: for each (potentially atomic) child region, there is a hyperedge containing the variables of said child, and there is a further hyperedge containing all the free variables of ψ \psi ψ .
This rewriting framework [22 ] provides an algorithm that, upon input of a positive first-order formula φ \varphi φ , outputs a formula φ + \varphi^{+} φ + of minimum width within the class of all formulae obtainable from φ \varphi φ via the rewriting rules; this class is denoted by [ φ ] A [\varphi]_{\mathcal{A}} [ φ ] A . The width of this output can be characterised (in a certain precise sense) as the maximum hypertreewidth over all regions.
The following examples suggest why, in the presence of universal quantifiers, a measure more sophisticated than the treewidth of the query is needed to characterise its logical width, and also anticipate some of the complexity involved in showing width lower bounds. First, consider
φ 1 = ∃ x 1 ⋯ ∃ x l ∃ x ⋀ i = 1 l R i ( x , x i ) ≡ ∃ x ∃ x 1 ⋯ ∃ x l ⋀ i = 1 l R i ( x , x i ) ≡ ∃ x ⋀ i = 1 l ∃ x i R i ( x , x i ) . \varphi_1 = \exists x_1 \cdots\exists x_l \exists x \bigwedge_{i=1}^{l} R_i(x,x_i) \quad\equiv\quad\exists x \exists x_1 \cdots\exists x_l \bigwedge_{i=1}^{l} R_i(x,x_i) \quad\equiv\quad\exists x \bigwedge_{i=1}^{l} \exists x_i R_i(x,x_i). φ 1 = ∃ x 1 ⋯ ∃ x l ∃ x i = 1 ⋀ l R i ( x , x i ) ≡ ∃ x ∃ x 1 ⋯ ∃ x l i = 1 ⋀ l R i ( x , x i ) ≡ ∃ x i = 1 ⋀ l ∃ x i R i ( x , x i ) .
Its query hypergraph is clearly a star, and hence has treewidth 1; as shown above, the query can be rewritten into one of width 2, by reordering the quantifiers and pushing each ∃ x i \exists x_i ∃ x i in front of the unique atom in which x i x_i x i occurs. This is the kind of behaviour captured by the existential-positive theory of variable minimisation [12 ] . Next, consider instead the QCQ
φ 2 = ∀ y 1 ⋯ ∀ y m ψ ∃ , where ψ ∃ = ∃ x ⋀ j = 1 m S j ( x , y j ) . \varphi_2 = \forall y_1 \cdots\forall y_m \psi_{\exists}, \quad\text{where } \psi_{\exists} = \exists x \bigwedge_{j=1}^{m} S_j(x,y_j). φ 2 = ∀ y 1 ⋯ ∀ y m ψ ∃ , where ψ ∃ = ∃ x j = 1 ⋀ m S j ( x , y j ) .
Although the query hypergraph is again a star, the universal variables y j y_j y j , intuitively speaking, must remain simultaneously available when the existential witness x x x is chosen. There is a hypergraph associated with the formula ψ ∃ \psi_{\exists} ψ ∃ ; this hypergraph accounts for the universal variables by including a top-boundary hyperedge that contains all of its free variables, namely, { y 1 , … , y m } \{y_1,\ldots,y_m\} { y 1 , … , y m } . The relevant treewidth is no longer that of the query hypergraph, but of a larger hypergraph that includes this boundary hyperedge. Indeed, this article shows this formula to have logical width m + 1 m+1 m + 1 . Finally, the combination of the above two situations gives formulae, for m > 0 m>0 m > 0 , of the form
φ 3 = ∃ x 1 ⋯ ∃ x l ψ ∀ , where ψ ∀ = ∀ y 1 ⋯ ∀ y m ψ ∃ and ψ ∃ = ∃ x ( ⋀ i = 1 l R i ( x , x i ) ∧ ⋀ j = 1 m S j ( x , y j ) ) . \varphi_3 = \exists x_1 \cdots\exists x_l \psi_{\forall}, \quad\text{where } \psi_{\forall} = \forall y_1 \cdots\forall y_m \psi_{\exists} \text{ and } \psi_{\exists} = \exists x \left(\bigwedge_{i=1}^{l} R_i(x,x_i) \land\bigwedge_{j=1}^{m} S_j(x,y_j)\right). φ 3 = ∃ x 1 ⋯ ∃ x l ψ ∀ , where ψ ∀ = ∀ y 1 ⋯ ∀ y m ψ ∃ and ψ ∃ = ∃ x ( i = 1 ⋀ l R i ( x , x i ) ∧ j = 1 ⋀ m S j ( x , y j ) ) .
Intuitively speaking, here the universal variables y j y_j y j depend on the existential variables x i x_i x i , and so all of these variables must be kept in scope when considering how to assign x x x . This is accounted for in the hypergraph associated to ψ ∃ \psi_{\exists} ψ ∃ , where the top-boundary hyperedge contains all variables but x x x ; as this article shows, for these formulae the logical width is l + m + 1 l+m+1 l + m + 1 . These examples point to why the theory of CQs does not transfer directly.
Contributions. Our main result shows that, for self-join-free QCQs, the minimum width over all formulae in [ φ ] A [\varphi]_{\mathsf{A}} [ φ ] A is in fact the logical width of φ \varphi φ .
Theorem 1.1 (Main Result). Let φ \varphi φ be a self-join-free QCQ and φ + \varphi^+ φ + a self-join-free QCQ of minimum width among all formulae in [ φ ] A [\varphi]_{\mathsf{A}} [ φ ] A . Then, logwidth ( φ ) = width ( φ + ) \operatorname{logwidth}(\varphi)=\operatorname{width}(\varphi^+) logwidth ( φ ) = width ( φ + ) . Moreover, there is an algorithm that, given a self-join-free QCQ φ \varphi φ , computes such a QCQ φ + \varphi^+ φ + in polynomial time, assuming access to an oracle for computing minimum-width tree decompositions.
This result also gives a complexity description of width computation. Given a self-join-free QCQ φ \varphi φ and a number k ∈ N k \in\mathbb{N} k ∈ N , deciding whether logwidth ( φ ) ≤ k \operatorname{logwidth}(\varphi)\leq k logwidth ( φ ) ≤ k is NP-complete. Moreover, computing the logical width of such a query is polynomial-time equivalent to computing graph treewidth. See Corollary 4.3 for details on these results.
To reformulate this main theorem (Theorem 1.1 ), for self-join-free QCQs, logical width admits exact algorithmic optimisation via syntactic rewriting, and thus the width found by rewriting is not merely an artefact, but rather the true logical width of the query. An alternative reading of this theorem is that no width blow-up is incurred when passing from full first-order logic back to self-join-free QCQs: when a first-order formula of width k k k is equivalent to a self-join-free QCQ, it is equivalent to a self-join-free QCQ of width k k k . This extends a tightness phenomenon previously known for existential-positive queries [12 , 40 ] .
Regarding the theorem’s statement, the inequality logwidth ( φ ) ≤ width ( φ + ) \operatorname{logwidth}(\varphi) \leq\operatorname{width}(\varphi^+) logwidth ( φ ) ≤ width ( φ + ) is immediate, since φ + \varphi^+ φ + is logically equivalent to φ \varphi φ . The difficult part is the reverse inequality, since the rewriting algorithm only gives an a priori syntactic upper bound: it constructs an equivalent QCQ whose width is governed by the maximum value of the treewidth (plus one) over its regions; the algorithm does not, by itself, rule out the possibility of a completely different first-order formula of smaller width. To prove semantic optimality, we focus on a region having maximum treewidth, and use it to show a lower bound on finite-variable definability. Here pebble games [32 ] , a variant of Ehrenfeucht–Fraïssé games [26 , 29 ] , enter the picture: by the classical characterisation of finite-variable first-order logic, to show that logwidth ( φ ) > k \operatorname{logwidth}(\varphi) > k logwidth ( φ ) > k , it suffices to construct two finite structures A \mathcal{A} A and B \mathcal{B} B that are separated by φ \varphi φ , but indistinguishable by first-order formulae using only k k k variables; this is the route we take. We first carry out these constructions in variable-sorted logic, where each query variable has its own domain. This lets us choose these domains independently and forces pebble-game responses to remain in the domain associated with the relevant variable. The resulting lower bounds are then transferred back to ordinary one-sorted structures (see Lemma 2.9 ).
On the role of self-join-freeness. One may wonder whether a result like Theorem 1.1 holds without the self-join-free assumption. However, even for conjunctive queries, a result analogous to Theorem 1.1 does not hold. For example, the conjunctive query
φ 1 = ∃ x 1 ∃ x 2 ∃ x 3 ⋀ i , j ∈ { 1 , 2 , 3 } E ( x i , x j ) \varphi_1 = \exists x_1 \exists x_2 \exists x_3 \bigwedge_{i,j \in\{1,2,3\}} E(x_i,x_j) φ 1 = ∃ x 1 ∃ x 2 ∃ x 3 i , j ∈ { 1 , 2 , 3 } ⋀ E ( x i , x j )
is logically equivalent to the conjunctive query
φ 2 = ∃ x E ( x , x ) ; \varphi_2 = \exists x E(x,x); φ 2 = ∃ x E ( x , x ) ;
this latter query φ 2 \varphi_2 φ 2 has width 1, but the minimum width among all formulae in [ φ 1 ] A [\varphi_1]_{\mathcal{A}} [ φ 1 ] A can be verified to be 3.3 Bova and Chen [12 ] establish that the logical width of a CQ φ \varphi φ is equal to the treewidth of the core of φ \varphi φ plus one; equivalently, one can apply the rewriting methods described in the present article to minimise the width of the core. Paralleling this situation for CQs, we conjecture that the logical width of an arbitrary QCQ φ \varphi φ can be obtained similarly: pass to an appropriate notion of core of φ \varphi φ , and then apply the rewriting methods. This would involve introducing a notion of core for QCQs, see § 7 for more details. Moreover, we use the assumption that the query is self-join-free for many proofs along the way to establishing our main result; more details are provided throughout the paper.
Organisation. § 2 provides the requisite preliminaries. In § 3 , we detail the rewriting framework established in [22 ] needed to formalise our main results, which are stated in § 4 . The rest of the article is dedicated to establishing our main result. We handle the case where a { ∀ } \{\forall\} { ∀ } -region is the region with maximum treewidth directly in § 4 , leaving the more complicated case of when a { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region has maximum treewidth. § 5 establishes the logical width lower bound on simple QCQs , a syntactic restriction on QCQs where the lower-bound argument can be carried out explicitly via pebble games. Finally, a sequence of reductions, sketched in Section 6, reduces the general { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } case to the simple QCQ case, in effect lifting the lower bound.
Preliminaries
Let N : = { 0 , 1 , … } \mathbb{N} := \{0,1,\ldots\} N := { 0 , 1 , … } and N + : = N ∖ { 0 } \mathbb{N}_{+} := \mathbb{N} \setminus\{0\} N + := N ∖ { 0 } . We use ⊔ \sqcup ⊔ for disjoint union. For i , j ∈ N i,j \in\mathbb{N} i , j ∈ N , let [ i , j ] : = { i , i + 1 , … , j } [i,j] := \{i,i+1,\ldots,j\} [ i , j ] := { i , i + 1 , … , j } and [ j ] : = [ 1 , j ] [j] := [1,j] [ j ] := [ 1 , j ] , with [ i , j ] : = ∅ [i,j] := \varnothing [ i , j ] := ∅ , if i > j i > j i > j . When f : A → B f:A \to B f : A → B is a (partial) function, we denote by dom ( f ) \operatorname{dom}(f) dom ( f ) the domain and by ran ( f ) \operatorname{ran}(f) ran ( f ) the range of f f f ; in addition, we use f [ x ↦ a ] f[x \mapsto a] f [ x ↦ a ] to denote the (partial) function equal to f f f everywhere except x x x , where it is mapped to a a a . The restriction of f f f to A ′ A' A ′ , for some A ′ ⊆ dom ( f ) A' \subseteq\operatorname{dom}(f) A ′ ⊆ dom ( f ) , is denoted by f ∣ A ′ f|_{A'} f ∣ A ′ . For a tuple t ⃗ = ( t 1 , … , t r ) \vec{t}=(t_1,\ldots,t_r) t = ( t 1 , … , t r ) , let π i ( t ⃗ ) = t i \pi_i(\vec{t})=t_i π i ( t ) = t i , for every i ∈ [ r ] i \in[r] i ∈ [ r ] . When A A A is a set, ( A 2 ) \binom{A}{2} ( 2 A ) denotes the set of 2-element subsets of A A A .
Graphs and Hypergraphs. A graph G : = ( V , E ) G := (V,E) G := ( V , E ) is a pair consisting 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. A walk in G G G is a sequence ( v 1 , … , v m ) ∈ V m (v_1,\ldots,v_m) \in V^m ( v 1 , … , v m ) ∈ V m , with m ≥ 2 m \ge2 m ≥ 2 , such that { v i , v i + 1 } ∈ E \{v_i,v_{i+1}\} \in E { v i , v i + 1 } ∈ E , for all i ∈ [ m − 1 ] i \in[m-1] i ∈ [ m − 1 ] . For a vertex v ∈ V v \in V v ∈ V , we use E v E_v E v for the set of edges incident on v v v .
A tree decomposition of a graph G : = ( V , E ) G := (V,E) G := ( V , E ) is a tree T T T where each node u u u of T T T is associated with a non-empty subset B u B_u B u of V V V called a bag such that:
a) for all edges e ∈ E e \in E e ∈ E , there is some node u u u of T T T such that e ⊆ B u e \subseteq B_u e ⊆ B u ;
b) for all vertices v ∈ V v \in V v ∈ V , the nodes u u u of T T T with v ∈ B u v \in B_u v ∈ B u form a non-empty connected subtree of T T T .
The width of a tree decomposition C : = ( T , { B u } u ∈ V ( T ) ) \mathcal{C} := (T,\{B_u\}_{u \in V(T)}) C := ( T , { B u } u ∈ V ( T ) ) is defined by max u ∈ V ( T ) ∣ B u ∣ − 1 \max_{u \in V(T)} |B_u| - 1 max u ∈ V ( T ) ∣ B u ∣ − 1 and the treewidth tw ( G ) \operatorname{tw}(G) tw ( G ) of a graph G = ( V , E ) G = (V,E) G = ( V , E ) is the minimum width over all tree decompositions of G G G .
For a graph G = ( V , E ) G = (V,E) G = ( V , E ) and two sets U , U ′ ⊆ V U,U' \subseteq V U , U ′ ⊆ V , we say that U U U and U ′ U' U ′ touch if U ∩ U ′ ≠ ∅ U \cap U' \ne\varnothing U ∩ U ′ = ∅ or there exist u ∈ U u \in U u ∈ U and u ′ ∈ U ′ u' \in U' u ′ ∈ U ′ such that { u , u ′ } ∈ E \{u,u'\} \in E { u , u ′ } ∈ E . A set M \mathcal{M} M of pairwise touching connected subsets of V V V is called a bramble of G G G . A subset H H H of V V V is a hitting set of the bramble M \mathcal{M} M if H ∩ M ≠ ∅ H \cap M \ne\varnothing H ∩ M = ∅ , for all M ∈ M M \in\mathcal{M} M ∈ M . The order of a bramble is the smallest size over all hitting sets. We shall use the following known result (see Theorem 10.41 [7 ] for more information).
Theorem 2.1. A graph has treewidth ≥ κ ∈ N + \ge\kappa\in\mathbb{N}_{+} ≥ κ ∈ N + if and only if it has a bramble of order ≥ κ + 1 \ge\kappa+ 1 ≥ κ + 1 .
A hypergraph H : = ( V , E ) H := (V,E) H := ( V , E ) is a pair consisting of a set of vertices V V V and a set of hyperedges E ⊆ 2 V E \subseteq2^V E ⊆ 2 V , i.e., a set of sets of vertices; here, 2 X 2^X 2 X denotes the powerset of X X X . The primal graph of a hypergraph H : = ( V , E ) H := (V,E) H := ( V , E ) is the graph G : = ( V , E ′ ) G := (V,E') G := ( V , E ′ ) , where E ′ E' E ′ contains a pair e ′ ∈ ( V 2 ) e' \in\binom{V}{2} e ′ ∈ ( 2 V ) if and only if there exists a hyperedge e ∈ E e \in E e ∈ E such that e ′ ⊆ e e' \subseteq e e ′ ⊆ e . We say that a hypergraph is connected if its primal graph is connected. The treewidth of a hypergraph is its primal graph’s treewidth.
For a graph G = ( V , E ) G = (V,E) G = ( V , E ) and a set X ⊆ V X \subseteq V X ⊆ V , we define the induced subgraph of G G G on X X X , denoted G ∣ X G|_X G ∣ X , to be the graph with vertices X X X and edge set E ∩ ( X 2 ) E \cap\binom{X}{2} E ∩ ( 2 X ) . Likewise, for a hypergraph H = ( V , E ) H = (V,E) H = ( V , E ) and a set X ⊆ V X \subseteq V X ⊆ V , let H ∣ X : = ( X , { e ∩ X ∣ e ∈ E } ) H|_X := (X,\{e \cap X \mid e \in E\}) H ∣ X := ( X , { e ∩ X ∣ e ∈ E }) be the induced hypergraph of H H H on X X X .
Structures and Logic. A signature τ \tau τ is a set where each element R ∈ τ R \in\tau R ∈ τ is called a relation symbol and has an associated arity ar ( R ) ∈ N \operatorname{ar}(R) \in\mathbb{N} ar ( R ) ∈ N . For a signature τ \tau τ , a τ \tau τ -structure consists of a non-empty set A A A called the universe and a relation R A ⊆ A ar ( R ) R^{\mathcal{A}} \subseteq A^{\operatorname{ar}(R)} R A ⊆ A ar ( R ) , for each R ∈ τ R \in\tau R ∈ τ . We shall tend to use A , B , … \mathcal{A},\mathcal{B},\ldots A , B , … for structures and A , B , … A,B,\ldots A , B , … for their respective universes. In this work, we assume all structures are finite, i.e., have finite signature and universe. A τ \tau τ -structure B \mathcal{B} B is a substructure of the τ \tau τ -structure A \mathcal{A} A if B ⊆ A B \subseteq A B ⊆ A and, for each R ∈ τ R \in\tau R ∈ τ , we have that R B ⊆ R A R^{\mathcal{B}} \subseteq R^{\mathcal{A}} R B ⊆ R A . If A \mathcal{A} A is a τ \tau τ -structure and B ⊆ A B \subseteq A B ⊆ A , then we use A ∣ B \mathcal{A}|_B A ∣ B to denote the structure with universe B B B and R A ∣ B : = R A ∩ B ar ( R ) R^{\mathcal{A}|_B} := R^{\mathcal{A}} \cap B^{\operatorname{ar}(R)} R A ∣ B := R A ∩ B ar ( R ) , for each R ∈ τ R \in\tau R ∈ τ .
An atom (over a signature τ \tau τ ) is either an equality of variables ( x = y ) (x=y) ( x = y ) or has the form R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) , where R R R is a relational symbol, x 1 , … , x r x_1,\ldots,x_r x 1 , … , x r are variables, and ar ( R ) = r \operatorname{ar}(R)=r ar ( R ) = r . Formulae in first-order logic are defined by combining atoms with conjunction (∧ \land ∧ ), disjunction (∨ \lor ∨ ), negation (¬ \lnot ¬ ), universal quantification (∀ \forall ∀ ), and existential quantification (∃ \exists ∃ ). For a structure A \mathcal{A} A , an assignment of variables σ \sigma σ in A \mathcal{A} A , and a formula ϕ \phi ϕ , we write ( A , σ ) ⊨ ϕ (\mathcal{A},\sigma) \models\phi ( A , σ ) ⊨ ϕ to denote that ϕ \phi ϕ is true in A \mathcal{A} A under σ \sigma σ . We assume the reader is familiar with the semantics of first-order logic (we refer to [26 , 29 , 37 ] for more details). We write free ( ϕ ) \operatorname{free}(\phi) free ( ϕ ) to denote the set of free variables of a first-order formula ϕ \phi ϕ . Two formulae ϕ \phi ϕ and ψ \psi ψ are logically equivalent if free ( ϕ ) = free ( ψ ) \operatorname{free}(\phi)=\operatorname{free}(\psi) free ( ϕ ) = free ( ψ ) and for every finite structure A \mathcal{A} A and every assignment σ \sigma σ we have ( A , σ ) ⊨ ϕ ⟺ ( A , σ ) ⊨ ψ (\mathcal{A},\sigma) \models\phi\Longleftrightarrow(\mathcal{A},\sigma) \models\psi ( A , σ ) ⊨ ϕ ⟺ ( A , σ ) ⊨ ψ . The width of a formula ϕ \phi ϕ , denoted by width ( ϕ ) \operatorname{width}(\phi) width ( ϕ ) , is the maximum number of free variables over all subformulae of $\phi. The logical width of a formula ϕ \phi ϕ , denoted by lwidth ( ϕ ) \operatorname{lwidth}(\phi) lwidth ( ϕ ) , is the minimum width over all first-order formulae that are logically equivalent to ϕ \phi ϕ on all finite structures over the same signature.
A quantified conjunctive query (QCQ, for short) is a sentence (i.e., a formula without free variables) that combines non-equality (relation) atoms with conjunction and both universal and existential quantifiers. A QCQ φ \varphi φ is in prenex normal form if φ = Q 1 x 1 Q 2 x 2 ⋯ Q n x n ( ψ ) \varphi= Q_1x_1Q_2x_2 \cdots Q_nx_n(\psi) φ = Q 1 x 1 Q 2 x 2 ⋯ Q n x n ( ψ ) , where Q i ∈ { ∀ , ∃ } Q_i \in\{\forall,\exists\} Q i ∈ { ∀ , ∃ } and ψ \psi ψ is a conjunction of non-equality atoms, and φ \varphi φ is self-join-free if no relation symbol appears more than once in φ \varphi φ . A QCQ φ \varphi φ is standardised if, for each occurrence Q x Qx Q x of a quantifier, x x x is not quantified elsewhere. By simply renaming variables where necessary, we often assume that QCQs are standardised. Throughout this article, we use evaluation games ; see, for example, [28 ] for details. We adapt the notion for our particular purposes, namely QCQs.
Definition 2.2. Let φ = Q 1 x 1 ⋯ Q n x n ( ψ ) \varphi= Q_{1}x_{1}\cdots Q_{n}x_{n}(\psi) φ = Q 1 x 1 ⋯ Q n x n ( ψ ) be a standardised QCQ in prenex normal form, where ψ \psi ψ is a conjunction of atoms. Let C \mathcal{C} C be a structure over the signature of φ \varphi φ , with universe C C C . The evaluation game over C C C and φ \varphi φ is a two-player game played by Universal and Existential . A position of the game is ( i , σ ) (i,\sigma) ( i , σ ) , where i ∈ [ n ] i \in[n] i ∈ [ n ] and σ : { x 1 , … , x i − 1 } → C \sigma: \{x_{1},\ldots,x_{i-1}\} \to C σ : { x 1 , … , x i − 1 } → C is a partial assignment. The initial position is ( 1 , ∅ ) (1,\varnothing) ( 1 , ∅ ) . For a position ( i , σ ) (i,\sigma) ( i , σ ) with 1 ≤ i ≤ n 1 \leq i \leq n 1 ≤ i ≤ n , a round of the game proceeds as follows:
if Q i = ∀ Q_{i} = \forall Q i = ∀ , then Universal picks a value c ∈ C c \in C c ∈ C and the new position is ( i + 1 , σ [ x i ↦ c ] ) (i+1,\sigma[x_{i} \mapsto c]) ( i + 1 , σ [ x i ↦ c ]) ;
if Q i = ∃ Q_{i} = \exists Q i = ∃ , then Existential picks a value c ∈ C c \in C c ∈ C and the new position is ( i + 1 , σ [ x i ↦ c ] ) (i+1,\sigma[x_{i} \mapsto c]) ( i + 1 , σ [ x i ↦ c ]) . When a final position ( n + 1 , σ ) (n+1,\sigma) ( n + 1 , σ ) is reached, Existential wins if and only if ( C , σ ) ⊨ ψ (C,\sigma) \models\psi ( C , σ ) ⊨ ψ . Otherwise Universal wins. Clearly, Existential has a winning strategy if and only if C ⊨ φ C \models\varphi C ⊨ φ .
Pebble Games. An isomorphism between structures A \mathcal{A} A and B \mathcal{B} B over the same signature is a bijective function h : A → B h : A \to B h : A → B such that, for all relation symbols R R R in the signature and tuples a ˉ ∈ A ar ( R ) \bar{a} \in A^{\operatorname{ar}(R)} a ˉ ∈ A ar ( R ) , we have that a ˉ ∈ R A \bar{a} \in R^{\mathcal{A}} a ˉ ∈ R A if and only if h ( a ˉ ) ∈ R B h(\bar{a}) \in R^{\mathcal{B}} h ( a ˉ ) ∈ R B , where h ( a ˉ ) h(\bar{a}) h ( a ˉ ) denotes the tuple obtained by applying h h h coordinate-wise. A partial isomorphism between structures A \mathcal{A} A and B \mathcal{B} B over the same signature is a partial function f : A → B f : A \to B f : A → B where f f f is an isomorphism between A ∣ dom ( f ) \mathcal{A}|_{\operatorname{dom}(f)} A ∣ dom ( f ) and B ∣ ran ( f ) \mathcal{B}|_{\operatorname{ran}(f)} B ∣ ran ( f ) . The k k k -pebble game is played by two players: Spoiler and Duplicator . They play over two structures A \mathcal{A} A and B \mathcal{B} B over the same signature. There is a size-k k k set P P P of pebbles, and a position of the game is a pair of partial functions ( α , β ) (\alpha,\beta) ( α , β ) where α : P → A \alpha: P \to A α : P → A and β : P → B \beta: P \to B β : P → B . Unless stated otherwise, we assume the initial position of any game to have dom ( α ) = dom ( β ) = ∅ \operatorname{dom}(\alpha) = \operatorname{dom}(\beta) = \varnothing dom ( α ) = dom ( β ) = ∅ . Each round of the game, starting in some position ( α , β ) (\alpha,\beta) ( α , β ) , is as follows: Spoiler selects a pebble p ∈ P p \in P p ∈ P and some element a ∈ A a \in A a ∈ A or b ∈ B b \in B b ∈ B ; Duplicator then responds picking some b ∈ B b \in B b ∈ B or a ∈ A a \in A a ∈ A , respectively. The new position is defined as ( α [ p ↦ a ] , β [ p ↦ b ] ) (\alpha[p \mapsto a],\beta[p \mapsto b]) ( α [ p ↦ a ] , β [ p ↦ b ]) . Duplicator wins the game if { ( α ( p ) , β ( p ) ) ∣ p ∈ dom ( α ) } \{(\alpha(p),\beta(p)) \mid p \in\operatorname{dom}(\alpha)\} {( α ( p ) , β ( p )) ∣ p ∈ dom ( α )} is a partial isomorphism, between A \mathcal{A} A and B \mathcal{B} B , for each position ( α , β ) (\alpha,\beta) ( α , β ) that occurs. We assume the game goes on for an indefinite number of rounds. We denote that Duplicator has a winning strategy for the k k k -pebble game over A \mathcal{A} A and B \mathcal{B} B by writing A ≡ k B \mathcal{A} \equiv^{k} \mathcal{B} A ≡ k B . See, for example, [26 , 29 , 37 ] for more details. Two structures A \mathcal{A} A and B \mathcal{B} B are k k k -indistinguishable if for every first-order sentence φ \varphi φ that uses at most k k k distinct variables, we have that A ⊨ φ \mathcal{A} \models\varphi A ⊨ φ if and only if B ⊨ φ \mathcal{B} \models\varphi B ⊨ φ . We now state the k k k -pebble game characterisation of the expressive power of the k k k -variable fragment of first-order logic.
Theorem 2.3 ([32 ] ). Let A \mathcal{A} A and B \mathcal{B} B be relational structures over the same signature and k ∈ N k \in\mathbb{N} k ∈ N . Then, A \mathcal{A} A and B \mathcal{B} B are k k k -indistinguishable if and only if A ≡ k B \mathcal{A} \equiv^{k} \mathcal{B} A ≡ k B .
In ordinary one-sorted first-order logic, if a formula has a width of k k k , then it can be rewritten into an equivalent formula using at most k k k variables by simply renaming variables.4 Moreover, a formula that uses at most k k k variables obviously has a width of at most k k k . Thus, in order to establish that length ( φ ) > k \operatorname{length}(\varphi) > k length ( φ ) > k , it suffices to define two structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ φ \mathcal{A} \models\varphi A ⊨ φ and B ⊭ φ \mathcal{B} \not\models\varphi B ⊨ φ , while at the same time A ≡ k B \mathcal{A} \equiv^{k} \mathcal{B} A ≡ k B .
QCQs Decomposition and Regions. This subsection introduces some requisite notions of formulae adapted from [21 ] to the case of QCQs.
Holey QCQs. A holey QCQ is a formula defined recursively as follows: each natural number i ≥ 1 i \ge1 i ≥ 1 is a holey QCQ, and if φ \varphi φ , ϕ \phi ϕ are holey QCQs then so are φ ∧ ϕ \varphi\land\phi φ ∧ ϕ , ∃ x φ \exists x\varphi ∃ x φ , and ∀ x φ \forall x\varphi ∀ x φ , where x x x is a variable. As a convention, we shall require that no natural number occurs more than once in any holey QCQ. The natural numbers that occur in a holey QCQ are called holes . A { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -holey formula consists entirely of natural numbers, existential quantification, and conjunction. A { ∀ } \{\forall\} { ∀ } -holey formula is of the form ∀ x 1 ∀ x 2 … ∀ x n i \forall x_1\forall x_2\ldots\forall x_n i ∀ x 1 ∀ x 2 … ∀ x n i for a natural number i i i . When ϕ \phi ϕ has holes among 1 , … , k 1,\ldots,k 1 , … , k , and φ 1 , … , φ k \varphi_1,\ldots,\varphi_k φ 1 , … , φ k are QCQs, then ϕ ⟦ φ 1 , … , φ k ⟧ \phi\llbracket\varphi_1,\ldots,\varphi_k\rrbracket ϕ [ [ φ 1 , … , φ k ] ] denotes the QCQ that is obtained by replacing i i i with φ i \varphi_i φ i for each i ∈ [ k ] i \in[k] i ∈ [ k ] . We call such φ i \varphi_i φ i a child region of ϕ \phi ϕ . An association for a holey QCQ ϕ \phi ϕ is a partial mapping a a a that maps at least each number occurring in ϕ \phi ϕ to a set of variables; thus, whenever a ( i ) a(i) a ( i ) is defined, it is a set of variables. Given such an association a a a , we set free a ( i ) = a ( i ) \operatorname{free}_a(i)=a(i) free a ( i ) = a ( i ) and define free a ( ϕ ) \operatorname{free}_a(\phi) free a ( ϕ ) for any holey formula ϕ \phi ϕ using the usual inductive definitions.
Organised QCQs. We define { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised and { ∀ } \{\forall\} { ∀ } -organised formulae by mutual induction:
if ϕ \phi ϕ is a non-atomic holey { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -formula and φ 1 , … , φ k \varphi_1,\ldots,\varphi_k φ 1 , … , φ k are either atomic formulae or a { ∀ } \{\forall\} { ∀ } -organised formulae, then ϕ ⟦ φ 1 , … , φ k ⟧ \phi\llbracket\varphi_1,\ldots,\varphi_k\rrbracket ϕ [ [ φ 1 , … , φ k ] ] is an { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised formula;
if ϕ \phi ϕ is a non-atomic holey { ∀ } \{\forall\} { ∀ } -formula and φ \varphi φ is an atomic formula or an { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised formula, then ϕ ⟦ φ ⟧ \phi\llbracket\varphi\rrbracket ϕ [ [ φ ] ] is a { ∀ } \{\forall\} { ∀ } -organised formula.
A QCQ is organised if it is either an { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised formula or a { ∀ } \{\forall\} { ∀ } -organised formula.
Example 2.4. Consider the QCQ φ : = ∀ x ∀ x ′ ∃ y ∃ y ′ ( R ( x , y ) ∧ ∃ z ( T ( x ′ , y ′ , z ) ) ) \varphi:= \forall x\forall x'\exists y\exists y'(R(x,y) \land\exists z(T(x',y',z))) φ := ∀ x ∀ x ′ ∃ y ∃ y ′ ( R ( x , y ) ∧ ∃ z ( T ( x ′ , y ′ , z ))) . By defining α : = ∀ x ∀ x ′ 1 \alpha:= \forall x\forall x'1 α := ∀ x ∀ x ′ 1 and β : = ∃ y ∃ y ′ ( 1 ∧ ∃ z 2 ) \beta:= \exists y\exists y'(1 \land\exists z2) β := ∃ y ∃ y ′ ( 1 ∧ ∃ z 2 ) , we can view φ \varphi φ as the organised QCQ α ⟦ β ⟦ R ( x , y ) , T ( x ′ , y ′ , z ) ⟧ ⟧ \alpha\llbracket\beta\llbracket R(x,y),T(x',y',z)\rrbracket\rrbracket α [ [ β [ [ R ( x , y ) , T ( x ′ , y ′ , z ) ] ] ] ] .
Via the following result, we may view each QCQ as organised.
Proposition 2.5 [22 follows from Proposition 5.5] . Each non-atomic QCQ is an organised QCQ. In particular, each non-atomic QCQ starting with ∃ \exists ∃ or ∧ \land ∧ is an { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised formula and each non-atomic QCQ starting with ∀ \forall ∀ is an { ∀ } \{\forall\} { ∀ } -organised formula.
Recursively, we define the regions of an organised formula: if φ = ϕ ⟦ ψ 1 , … , ψ k ⟧ \varphi=\phi\llbracket\psi_1,\ldots,\psi_k\rrbracket φ = ϕ [ [ ψ 1 , … , ψ k ] ] is an organised formula, then regions ( φ ) = { ϕ } ∪ ⋃ i is a hole in ϕ regions ( ψ i ) \operatorname{regions}(\varphi)=\{\phi\}\cup\bigcup_{i\text{ is a hole in }\phi}\operatorname{regions}(\psi_i) regions ( φ ) = { ϕ } ∪ ⋃ i is a hole in ϕ regions ( ψ i ) ; we say that ϕ \phi ϕ is the top region of φ \varphi φ , and each other region of φ \varphi φ is a non-top region of φ \varphi φ .
Example 2.6. For the organised QCQ φ = α ⟦ β ⟦ R ( x , y ) , T ( x ′ , y ′ , z ) ⟧ ⟧ \varphi=\alpha\llbracket\beta\llbracket R(x,y),T(x',y',z)\rrbracket\rrbracket φ = α [ [ β [ [ R ( x , y ) , T ( x ′ , y ′ , z ) ] ] ] ] from Example 2.4 we have that regions ( φ ) = { α , β , R ( x , y ) , T ( x ′ , y ′ , z ) } \operatorname{regions}(\varphi)=\{\alpha,\beta,R(x,y),T(x',y',z)\} regions ( φ ) = { α , β , R ( x , y ) , T ( x ′ , y ′ , z )} where α \alpha α is the top region of φ \varphi φ .
When ϕ \phi ϕ is a holey formula and a a a is an association for ϕ \phi ϕ , then the hypergraph for ϕ \phi ϕ , denoted by H ϕ , a H_{\phi,a} H ϕ , a (or H ϕ H_\phi H ϕ , when a a a is clear from context) is the hypergraph with the vertex set ⋃ i a ( i ) \bigcup_i a(i) ⋃ i a ( i ) and with the edge set { a ( i ) ∣ i occurs in ϕ } ∪ { free a ( ϕ ) } \{\!a(i)\mid i\text{ occurs in }\phi\!\}\cup\{\operatorname{free}_a(\phi)\} { a ( i ) ∣ i occurs in ϕ } ∪ { free a ( ϕ )} .
Example 2.7. Consider again the formulas from Example 2.4. Looking at the holey formula β \beta β , the association a a a suggested by the original formula φ \varphi φ would have a ( 1 ) = { x , y } a(1)=\{x,y\} a ( 1 ) = { x , y } and a ( 2 ) = { x ′ , y ′ , z } a(2)=\{x',y',z\} a ( 2 ) = { x ′ , y ′ , z } . We then would have free a ( β ) = { x , x ′ } \operatorname{free}_a(\beta)=\{x,x'\} free a ( β ) = { x , x ′ } , and so the hypergraph H β , a H_{\beta,a} H β , a would have vertex set { x , x ′ , y , y ′ , z } \{x,x',y,y',z\} { x , x ′ , y , y ′ , z } and edge set { { x , y } , { x ′ , y ′ , z } , { x , x ′ } } \{\{x,y\},\{x',y',z\},\{x,x'\}\} {{ x , y } , { x ′ , y ′ , z } , { x , x ′ }} .
Variable-Sorted Logic. Informally, variable-sorted logic is a many-sorted first-order logic, where each variable has its own finite domain (or sort). Each relation symbol has an arity that is an ordered sequence of variables, and must be interpreted by a cross product of the domains corresponding to this arity. In this setting, the ability to rewrite so that width becomes number of variables (discussed above) does not hold in general, since variables of different sorts cannot be identified by renaming. At the same time, the separation into variable sorts lets us define the domains associated with different variables independently and constrains pebble-game responses to the corresponding domains. These features simplify the lower-bound constructions used later in the paper.
Let V \mathcal{V} V be a finite set of variables. A variable-sorted signature is the pair ( τ , V ) (\tau,\mathcal{V}) ( τ , V ) , where τ \tau τ is a set of relation symbols such that each R ∈ τ R \in\tau R ∈ τ has an associated arity ar ( R ) ∈ V ∗ \operatorname{ar}(R) \in\mathcal{V}^{*} ar ( R ) ∈ V ∗ , where V ∗ \mathcal{V}^{*} V ∗ is the set of finite strings generated by V \mathcal{V} V . A variable-sorted structure A \mathcal{A} A consists of a nonempty finite set A x A_x A x for every x ∈ V x \in\mathcal{V} x ∈ V , called the domain of x x x , along with, for each R ∈ τ R \in\tau R ∈ τ with ar ( R ) = x 1 ⋯ x k \operatorname{ar}(R)=x_1 \cdots x_k ar ( R ) = x 1 ⋯ x k , an interpretation R A ⊆ A x 1 × ⋯ × A x k R^{\mathcal{A}} \subseteq A_{x_1} \times\cdots\times A_{x_k} R A ⊆ A x 1 × ⋯ × A x k . We always assume the domains of two distinct variables are disjoint. When convenient, we write A A A for ⋃ x ∈ V A x \bigcup_{x \in\mathcal{V}} A_x ⋃ x ∈ V A x . Formulae over ( τ , V ) (\tau,\mathcal{V}) ( τ , V ) are built from atomic formulae R ( x 1 , … , x k ) R(x_1,\ldots,x_k) R ( x 1 , … , x k ) , where R ∈ τ R \in\tau R ∈ τ and ar ( R ) = x 1 ⋯ x k \operatorname{ar}(R)=x_1 \cdots x_k ar ( R ) = x 1 ⋯ x k , along with usual first-order connectives and quantifiers (which range over the domain of the particular variable being quantified). For a variable-sorted structure A \mathcal{A} A , a substitution σ \sigma σ that maps variables to their domains, and a formula φ \varphi φ , we use ( A , σ ) ⊨ v a r φ (\mathcal{A},\sigma) \models_{\mathrm{var}} \varphi ( A , σ ) ⊨ var φ to denote that φ \varphi φ is true in A \mathcal{A} A under σ \sigma σ . We use the term one-sorted structures when we need to distinguish usual relational structures from variable-sorted structures.
Example 2.8. Consider the variable-sorted signature ( { R } , { x , y } ) (\{R\},\{x,y\}) ({ R } , { x , y }) , where ar ( R ) = x y \operatorname{ar}(R)=xy ar ( R ) = x y . Let A \mathcal{A} A be a structure over this signature with A x = { a , b } A_x=\{a,b\} A x = { a , b } , A y = { c , d } A_y=\{c,d\} A y = { c , d } , and R A = { ( a , c ) , ( b , c ) } R^{\mathcal{A}}=\{(a,c),(b,c)\} R A = {( a , c ) , ( b , c )} . Then, A ⊨ v a r ∀ x ∃ y R ( x , y ) \mathcal{A}\models_{\mathrm{var}}\forall x\exists y\,R(x,y) A ⊨ var ∀ x ∃ y R ( x , y ) but A ̸ ⊨ v a r ∀ x ∀ y R ( x , y ) \mathcal{A}\not\models_{\mathrm{var}}\forall x\forall y\,R(x,y) A ⊨ var ∀ x ∀ y R ( x , y ) .
For variable-sorted structures A \mathcal{A} A and B \mathcal{B} B over the same signature, an isomorphism is a bijection h : A → B h:A\to B h : A → B such that h ( A x ) = B x h(A_x)=B_x h ( A x ) = B x , for each x ∈ V x\in\mathcal{V} x ∈ V , and for every R ∈ τ R\in\tau R ∈ τ with ar ( R ) = x 1 ⋯ x k \operatorname{ar}(R)=x_1\cdots x_k ar ( R ) = x 1 ⋯ x k and a ˉ ∈ A x 1 × ⋯ × A x k \bar{a}\in A_{x_1}\times\cdots\times A_{x_k} a ˉ ∈ A x 1 × ⋯ × A x k , we have that a ˉ ∈ R A \bar{a}\in R^{\mathcal{A}} a ˉ ∈ R A if and only if h ( a ˉ ) ∈ R B h(\bar{a})\in R^{\mathcal{B}} h ( a ˉ ) ∈ R B . Partial isomorphisms are defined as expected, hence the definition of pebble games transfers directly to the variable-sorted setting, with the caveat that if Spoiler places a pebble in A x A_x A x , then Duplicator must respond by pebbling an element of B x B_x B x , and conversely. If Duplicator has a winning strategy for the k k k -pebble game over two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B , we write A ≡ v a r k B \mathcal{A}\equiv_{\mathrm{var}}^{k}\mathcal{B} A ≡ var k B . Throughout, we flexibly view any self-join-free QCQ φ \varphi φ as a formula in variable-sorted logic; this is done naturally by considering any atom R ( x 1 , … , x k ) R(x_1,\ldots,x_k) R ( x 1 , … , x k ) that occurs in φ \varphi φ to have ar ( R ) = x 1 ⋯ x k \operatorname{ar}(R)=x_1\cdots x_k ar ( R ) = x 1 ⋯ x k . We will make use of the following lemma that links variable-sorted structures to one-sorted structures.
Lemma 2.9. Let φ \varphi φ be a standardised self-join-free QCQ and k ∈ N + k\in\mathbb{N}_{+} k ∈ N + . If there are two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ \mathcal{A}\models_{\mathrm{var}}\varphi A ⊨ var φ , B ̸ ⊨ v a r φ \mathcal{B}\not\models_{\mathrm{var}}\varphi B ⊨ var φ , and A ≡ v a r k B \mathcal{A}\equiv_{\mathrm{var}}^{k}\mathcal{B} A ≡ var k B , then there are one-sorted structures A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ such that A ˉ ⊨ φ \bar{\mathcal{A}}\models\varphi A ˉ ⊨ φ , B ˉ ⊭ φ \bar{\mathcal{B}}\not\models\varphi B ˉ ⊨ φ , and A ˉ ≡ k B ˉ \bar{\mathcal{A}}\equiv^{k}\bar{\mathcal{B}} A ˉ ≡ k B ˉ .
This lemma ensures that lower bounds proved in the variable-sorted setting transfer back to the usual one-sorted setting. This allows us to conveniently work in the variable-sorted setting which shall help simplify subsequent proofs (see § 5 ). We note that the assumption that φ \varphi φ is standardised and self-join-free is essential to be able to transfer lower bounds in this way. Informally speaking, the fact that φ \varphi φ is self-join-free allows us to associate each relation symbol R R R that appears in φ \varphi φ with a particular tuple of variables x ⃗ \vec{x} x where R ( x ⃗ ) R(\vec{x}) R ( x ) is the single application of R R R that appears in φ \varphi φ . Moreover, since φ \varphi φ is standardised, each variable in x ⃗ \vec{x} x can be associated with its particular quantifier. This then allows us to construct R A ˉ R^{\bar{\mathcal{A}}} R A ˉ and R B ˉ R^{\bar{\mathcal{B}}} R B ˉ from R A R^{\mathcal{A}} R A and R B R^{\mathcal{B}} R B respectively; this is done by adding those tuples where at least one component corresponding to a universally quantified variable does not fall into the respective domain.
Rewriting
In this section, we recall the notions of term rewriting for first-order logic that will be used throughout the paper. The definitions are adapted from [22 ] and the references therein. While [22 ] develops the framework for positive first-order logic, we specialise the relevant concepts and results to the setting of QCQs.
Rewriting systems
A rewriting system , or just system , is a pair ( D , → ) (D,\to) ( D , → ) consisting of a set D D D and a binary relation → \to → over D D D , called a reduction . The inverse of → \to → is denoted by ← \leftarrow ← , thus, a → b a \to b a → b if and only if b ← a b \leftarrow a b ← a . Let ↔ \leftrightarrow ↔ denote → ∪ ← \to\cup\leftarrow → ∪ ← and ∗ → \mathop{^{*}\to} ∗ → , ∗ ← \mathop{^{*}\leftarrow} ∗ ← , and ∗ ↔ \mathop{^{*}\leftrightarrow} ∗ ↔ the reflexive-transitive closures of → \to → , ← \leftarrow ← , and ↔ \leftrightarrow ↔ , respectively.
Relative to a system ( D , → ) (D,\to) ( D , → ) , we say that d ∈ D d \in D d ∈ D is a normal form if d → d ′ d \to d' d → d ′ does not hold for any d ′ ∈ D d' \in D d ′ ∈ D . Moreover, for d , e ∈ D d,e \in D d , e ∈ D , we say e e e is a normal form of d d d if d ∗ → e d \mathop{^{*}\to} e d ∗ → e and e e e is a normal form.
For a set D D D and an equivalence relation ≡ \equiv ≡ on it, we define D / ≡ D/\equiv D / ≡ as the set of ≡ \equiv ≡ -equivalence classes. If ( D , → ) (D,\to) ( D , → ) is a system, then ( D , → ) / ≡ (D,\to)/\equiv ( D , → ) / ≡ denotes the system ( D / ≡ , → ) (D/\equiv,\to) ( D / ≡ , → ) , where for ≡ \equiv ≡ -classes C C C and C ′ C' C ′ , we have that C → C ′ C \to C' C → C ′ if and only if there is some d ∈ C d \in C d ∈ C and d ′ ∈ C ′ d' \in C' d ′ ∈ C ′ with d → d ′ d \to d' d → d ′ .
Rules
Consider the following rewriting rules, all of which preserve logical equivalence under the stated side conditions [22 ] . Each rule may be applied to an arbitrary subformula of a formula.
We further define the splitup rule → S ↑ \to_{S\uparrow} → S ↑ and pushup rule → P ↑ \to_{P\uparrow} → P ↑ as the inverses of the splitdown and pushdown rules, respectively.
For a set R \mathcal{R} R of subscripts for rewriting rules, we let → R = ⋃ R ∈ R → R \to_{\mathcal{R}} = \bigcup_{R \in\mathcal{R}} \to_R → R = ⋃ R ∈ R → R . For example, → { A , C } \to_{\{A,C\}} → { A , C } denotes → A ∪ → C \to_A \cup\to_C → A ∪ → C , and to avoid notational clutter we write → A C \to_{AC} → A C for → { A , C } \to_{\{A,C\}} → { A , C } . The same conventions are also applied to ↔ \leftrightarrow ↔ , ∗ → \mathop{^{*}\to} ∗ → , etc. Given a formula φ \varphi φ , we define [ φ ] R [\varphi]_{\mathcal{R}} [ φ ] R to be the ∗ ↔ R \mathop{^{*}\leftrightarrow}_{\mathcal{R}} ∗ ↔ R -equivalence class of φ \varphi φ . For example, [ φ ] A C O [\varphi]_{ACO} [ φ ] A C O denotes the ∗ ↔ A C O \mathop{^{*}\leftrightarrow}_{ACO} ∗ ↔ A C O -equivalence class of φ \varphi φ .
Notation 1. Let us fix some notation to be used throughout this article. We define the set of rewriting rules T : = { A , C , O , P ↓ , N , P ↑ } \mathcal{T} := \{A,C,O,P\downarrow,N,P\uparrow\} T := { A , C , O , P ↓ , N , P ↑ } , as well as A : = { S ↓ , S ↑ , M } ∪ T \mathcal{A} := \{S\downarrow,S\uparrow,M\} \cup\mathcal{T} A := { S ↓ , S ↑ , M } ∪ T . Thus, A \mathcal{A} A contains all the rewriting rules introduced above, whereas T \mathcal{T} T contains all of them except splitdown, splitup, and removal. Furthermore, we shall make use of the rewriting system R : = ( Q C Q , → { S ↓ , M } ) / ∗ ↔ T \mathcal{R} := (QCQ,\to_{\{S\downarrow,M\}})/\mathop{^{*}\leftrightarrow}_{\mathcal{T}} R := ( QC Q , → { S ↓ , M } ) / ∗ ↔ T .
Width Minimisation Algorithm
Let us now state a version of Theorem 4.1 of [22 ] that is specialised to QCQs; our formulation here draws both from that theorem and its proof.
Theorem 3.1 ([22 ] ). There exists an algorithm that, given a QCQ ϕ \phi ϕ , outputs a QCQ ϕ + \phi^+ ϕ + , where:
ϕ + \phi^+ ϕ + has minimum width among all formulae in [ ϕ ] A [\phi]_{\mathcal{A}} [ ϕ ] A ;
[ ϕ + ] T [\phi^+]_{\mathcal{T}} [ ϕ + ] T is a normal form of [ ϕ ] T [\phi]_{\mathcal{T}} [ ϕ ] T in the system R \mathcal{R} R ;
width ( ϕ + ) = max ψ ∈ regions ( ϕ + ) ( tw ( H ψ ) + 1 ) \operatorname{width}(\phi^+) = \max_{\psi\in\operatorname{regions}(\phi^+)}(\operatorname{tw}(H_\psi)+1) width ( ϕ + ) = max ψ ∈ regions ( ϕ + ) ( tw ( H ψ ) + 1 ) , where H ψ H_\psi H ψ denotes the hypergraph of the region ψ \psi ψ .
With oracle access to an algorithm for computing tree decompositions of minimum width, this algorithm can be implemented in polynomial time.
The algorithm roughly works as follows: given a QCQ ϕ \phi ϕ , it first computes a QCQ ϕ ′ \phi' ϕ ′ , where [ ϕ ′ ] T [\phi']_{\mathcal{T}} [ ϕ ′ ] T is a normal form of [ ϕ ] T [\phi]_{\mathcal{T}} [ ϕ ] T in the system R \mathcal{R} R . Then, the output ϕ + \phi^+ ϕ + is chosen inside [ ϕ ′ ] T [\phi']_{\mathcal{T}} [ ϕ ′ ] T by minimising each region independently, invoking an oracle for computing tree decompositions of minimum width. The argument in [22 ] shows that the output is a width-minimal QCQ inside [ ϕ ] A [\phi]_{\mathcal{A}} [ ϕ ] A .
Main Results
This section states our main results and outlines the proof strategy. The first theorem is the semantic core of the paper: for self-join-free QCQs, the logical width coincides with the optimal width obtainable by the rewriting rules A \mathcal{A} A .
Theorem 4.1. Let ϕ \phi ϕ be a self-join-free QCQ and ϕ + \phi^{+} ϕ + a self-join-free QCQ of minimum width among all formulae in [ ϕ ] A [\phi]_{\mathcal{A}} [ ϕ ] A . Then, logwidth ( ϕ ) = width ( ϕ + ) \operatorname{logwidth}(\phi) = \operatorname{width}(\phi^{+}) logwidth ( ϕ ) = width ( ϕ + ) .
The difficult direction of Theorem 4.1 is the lower bound logwidth ( ϕ ) ≥ width ( ϕ + ) \operatorname{logwidth}(\phi) \geq\operatorname{width}(\phi^{+}) logwidth ( ϕ ) ≥ width ( ϕ + ) . The converse inequality logwidth ( ϕ ) ≤ width ( ϕ + ) \operatorname{logwidth}(\phi) \leq\operatorname{width}(\phi^{+}) logwidth ( ϕ ) ≤ width ( ϕ + ) is immediate, since the rules in A \mathcal{A} A are known to preserve logical equivalence [22 ] . Combining Theorem 4.1 and Theorem 3.1 , we immediately derive:
Theorem 4.2. There is an algorithm that, given a self-join-free QCQ ϕ \phi ϕ , outputs a self-join-free QCQ ϕ + \phi^{+} ϕ + , obtained from ϕ \phi ϕ via the rewriting rules in A \mathcal{A} A , such that width ( ϕ + ) = logwidth ( ϕ ) \operatorname{width}(\phi^{+}) = \operatorname{logwidth}(\phi) width ( ϕ + ) = logwidth ( ϕ ) . Moreover, ϕ + \phi^{+} ϕ + can be computed in polynomial time given access to an oracle for computing minimum tree decompositions.
From this theorem, we can readily derive the following result on computing the width of a given self-join-free QCQ.
Corollary 4.3. Given a self-join-free QCQ ϕ \phi ϕ and a number k ∈ N k \in\mathbb{N} k ∈ N , deciding whether logwidth ( ϕ ) ≤ k \operatorname{logwidth}(\phi) \leq k logwidth ( ϕ ) ≤ k is NP-complete. Moreover, the problems of computing the logical width of a self-join-free QCQ and the treewidth of a graph are polynomial-time Turing equivalent.
Since self-join-free QCQs form a subclass of QCQs, the same reduction shows that deciding whether logwidth ( ϕ ) ≤ k \operatorname{logwidth}(\phi) \leq k logwidth ( ϕ ) ≤ k for arbitrary QCQs is NP-hard. Determining the precise complexity of this problem remains open.
We say that a region θ \theta θ of a QCQ ϕ \phi ϕ has maximum treewidth if tw ( H θ ) = max ψ ∈ regions ( ϕ ) tw ( H ψ ) \operatorname{tw}(H_{\theta}) = \max_{\psi\in\operatorname{regions}(\phi)} \operatorname{tw}(H_{\psi}) tw ( H θ ) = max ψ ∈ regions ( ϕ ) tw ( H ψ ) . The proof of Theorem 4.1 is split into two cases, according to where the maximum treewidth is attained. The first case is when there is a { ∀ } \{\forall\} { ∀ } -region with maximum treewidth, and no { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region has such treewidth; this case is rather straightforward and is handled directly. The second case is when there is a { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region with maximum treewidth. To handle it, we first establish Theorem 4.1 for so-called simple QCQs in § 5 and then lift the result to arbitrary self-join-free QCQs in Section 6.
{\forall}-Regions of Maximum Treewidth
Observe that { ∀ } \{\forall\} { ∀ } -regions do not contain any conjunctions. Thus, { ∀ } \{\forall\} { ∀ } -organised formulae can be assumed to be in the form ( ∀ y 1 ⋯ ∀ y k 1 ) ⟦ θ ⟧ (\forall y_1 \cdots\forall y_k\ 1)\llbracket\theta\rrbracket ( ∀ y 1 ⋯ ∀ y k 1 ) [ [ θ ] ] , where θ \theta θ is either an atom or a non-atomic { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -organised formula.
Theorem 4.4. Let ϕ \phi ϕ be a self-join-free QCQ and ϕ + \phi^{+} ϕ + a self-join-free QCQ of minimum width among all formulae in [ ϕ ] A [\phi]_{\mathcal{A}} [ ϕ ] A . Suppose there is a { ∀ } \{\forall\} { ∀ } -region of ϕ + \phi^{+} ϕ + with maximum treewidth, and no { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region of ϕ + \phi^{+} ϕ + has maximum treewidth. Then, logwidth ( ϕ ) = width ( ϕ + ) \operatorname{logwidth}(\phi) = \operatorname{width}(\phi^{+}) logwidth ( ϕ ) = width ( ϕ + ) .
The above result is established by showing that, if ψ = ( ∀ y 1 ⋯ ∀ y k 1 ) ⟦ θ ⟧ \psi= (\forall y_1 \cdots\forall y_k\ 1)\llbracket\theta\rrbracket ψ = ( ∀ y 1 ⋯ ∀ y k 1 ) [ [ θ ] ] with θ \theta θ non-atomic, then H θ H_{\theta} H θ has treewidth at least equal to tw ( H ψ ) \operatorname{tw}(H_{\psi}) tw ( H ψ ) . Hence, if ψ \psi ψ has maximum treewidth and no { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region has the same treewidth, then the child region θ \theta θ must be necessarily an atom. In this case, the desired lower bound follows by a direct pebble-game argument.
{\exists,\land}-Regions of Maximum Treewidth
Thanks to Theorem 4.4 , in order to prove Theorem 4.1 it suffices to show the following result.
Theorem 4.5. Let ϕ \phi ϕ be a self-join-free QCQ and ϕ + \phi^{+} ϕ + a self-join-free QCQ of minimum width in [ ϕ ] A [\phi]_{\mathsf{A}} [ ϕ ] A . Suppose there is a { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of ϕ + \phi^{+} ϕ + with maximum treewidth. Then, logwidth ( ϕ ) = width ( ϕ + ) \operatorname{logwidth}(\phi)=\operatorname{width}(\phi^{+}) logwidth ( ϕ ) = width ( ϕ + ) .
The rest of this article is dedicated to establishing precisely this theorem. Our first step in doing so is to consider some properties that must hold true for an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region. Let ϕ \phi ϕ be an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -holey formula, where X X X is the set of variables existentially quantified in it. With respect to the implicit association, we say that ϕ \phi ϕ satisfies the connectivity property if the primal graph of H ϕ ∣ X H_{\phi}\mathbin{|}_{X} H ϕ ∣ X is connected. Furthermore, we say that ϕ \phi ϕ satisfies the tightness property if every hyperedge of H ϕ H_{\phi} H ϕ , except the hyperedge containing all the free variables, contains a variable from X X X . The connectivity and tightness properties naturally lift to { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -regions of QCQs.
Lemma 4.6. Suppose ϕ \phi ϕ is a QCQ such that [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T is a normal form in the distinguished system R \mathcal{R} R . Then, every non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of ϕ \phi ϕ satisfies both the connectivity and tightness property.
The main idea behind Lemma 4.6 is simple: if an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of ϕ \phi ϕ fails connectivity or tightness, then one surely finds a formula in [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T to which the splitdown rule applies, contradicting the fact that [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T is a normal form in the system R \mathcal{R} R .
Simple QCQs
This section considers a special class of QCQs, which we call simple QCQs , and establishes a width lower bound in terms of the treewidth of an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region. Although simple QCQs may appear rather restrictive, they capture the core difficulty in proving Theorem 4.5. In Section 6, we shall sketch a sequence of reductions showing how the general case of Theorem 4.5 follows from the lower bound proved for simple QCQs.
Definition 5.1. A QCQ φ \varphi φ is simple if it is self-join-free, standardised, and of the form
φ = Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ϕ ) . \varphi= Q_{1}v_{1}Q_{2}v_{2}\cdots Q_{m-1}v_{m-1}\forall v_{m}\exists x_{1}\cdots\exists x_{k}(\phi). φ = Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ϕ ) .
where m , k ≥ 1 m,k\ge1 m , k ≥ 1 , ϕ \phi ϕ is a conjunction of atoms, Q i ∈ { ∀ , ∃ } Q_{i}\in\{\forall,\exists\} Q i ∈ { ∀ , ∃ } for i ∈ [ m − 1 ] i\in[m-1] i ∈ [ m − 1 ] , and the following conditions hold, writing θ ⟦ α 1 , … , α n ⟧ \theta\llbracket\alpha_{1},\ldots,\alpha_{n}\rrbracket θ [ [ α 1 , … , α n ] ] for the { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -organised formula equal to ∃ x 1 ⋯ ∃ x k ( ϕ ) \exists x_{1}\cdots\exists x_{k}(\phi) ∃ x 1 ⋯ ∃ x k ( ϕ ) : (1) each atom of ϕ \phi ϕ consists of a binary relation symbol applied to two distinct variables; (2) the { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ \theta θ satisfies both the connectivity and tightness properties; (3) each v i v_{i} v i and x j x_{j} x j occurs in some atom of ϕ \phi ϕ , over i ∈ [ m ] i\in[m] i ∈ [ m ] and j ∈ [ k ] j\in[k] j ∈ [ k ] . We call the region θ \theta θ of φ \varphi φ the inner region of φ \varphi φ .
Our aim in this section is to show, for every simple QCQ φ \varphi φ , that logwidth ( φ ) ≥ tw ( H θ ) + 1 \operatorname{logwidth}(\varphi)\ge\operatorname{tw}(H_{\theta})+1 logwidth ( φ ) ≥ tw ( H θ ) + 1 , where θ \theta θ is the inner region of φ \varphi φ . To this end, we show that there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ \mathcal{A}\models_{\mathrm{var}}\varphi A ⊨ var φ , B ̸ ⊨ v a r φ \mathcal{B}\not\models_{\mathrm{var}}\varphi B ⊨ var φ , but A ≡ tw ( H θ ) B \mathcal{A}\equiv^{\operatorname{tw}(H_{\theta})}\mathcal{B} A ≡ tw ( H θ ) B . Working in the variable-sorted setting lets us define the domain of each query variable independently in the construction below.
Example 5.2. Consider the simple QCQ φ ˉ : = ∀ v 1 ∀ v 2 ∃ x 1 ∃ x 2 ( R 1 ( v 1 , x 1 ) ∧ ( R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ) ) ) \bar{\varphi}:=\forall v_{1}\forall v_{2}\exists x_{1}\exists x_{2}(R_{1}(v_{1},x_{1})\wedge(R_{2}(v_{2},x_{2})\wedge R_{3}(x_{1},x_{2}))) φ ˉ := ∀ v 1 ∀ v 2 ∃ x 1 ∃ x 2 ( R 1 ( v 1 , x 1 ) ∧ ( R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ))) , and let θ ˉ ( v 1 , v 2 ) : = ∃ x 1 ∃ x 2 ( 1 ∧ ( 2 ∧ 3 ) ) \bar{\theta}(v_{1},v_{2):=\exists x_{1}\exists x_{2}(1\wedge(2\wedge3))} θ ˉ ( v 1 , v 2 ) := ∃ x 1 ∃ x 2 ( 1 ∧ ( 2 ∧ 3 )) be its inner region. The hypergraph H θ ˉ H_{\bar{\theta}} H θ ˉ has hyperedges { v 1 , x 1 } \{v_{1},x_{1}\} { v 1 , x 1 } , { v 2 , x 2 } \{v_{2},x_{2}\} { v 2 , x 2 } , and { x 1 , x 2 } \{x_{1},x_{2}\} { x 1 , x 2 } , and because free( θ ˉ ) = { v 1 , v 2 } (\bar{\theta})=\{v_{1},v_{2}\} ( θ ˉ ) = { v 1 , v 2 } . It is easy to verify that tw ( H θ ˉ ) = 2 \operatorname{tw}(H_{\bar{\theta}})=2 tw ( H θ ˉ ) = 2 , since H θ ˉ H_{\bar{\theta}} H θ ˉ is a cycle of four vertices. Thus, there is a bramble of order 3: for example, consider { { x 1 , x 2 } , { v 1 } , { v 2 } } \{\{x_{1},x_{2}\},\{v_{1}\},\{v_{2}\}\} {{ x 1 , x 2 } , { v 1 } , { v 2 }} .
Now, notice that φ ˉ → P φ ˉ ′ \bar{\varphi}\to_{\mathrm{P}}\bar{\varphi}' φ ˉ → P φ ˉ ′ , where φ ˉ ′ = ∀ v 1 ∀ v 2 ∃ x 1 ( R 1 ( v 1 , x 1 ) ∧ ∃ x 2 ( R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ) ) ) \bar{\varphi}'=\forall v_{1}\forall v_{2}\exists x_{1}(R_{1}(v_{1},x_{1})\wedge\exists x_{2}(R_{2}(v_{2},x_{2})\wedge R_{3}(x_{1},x_{2}))) φ ˉ ′ = ∀ v 1 ∀ v 2 ∃ x 1 ( R 1 ( v 1 , x 1 ) ∧ ∃ x 2 ( R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ))) , and that width ( φ ˉ ′ ) = tw ( H θ ˉ ) + 1 = 3 \operatorname{width}(\bar{\varphi}')=\operatorname{tw}(H_{\bar{\theta}})+1=3 width ( φ ˉ ′ ) = tw ( H θ ˉ ) + 1 = 3 . By establishing that the logical width of every simple QCQ is at least the treewidth of the hypergraph for the inner region plus one, we obtain that φ ˉ ′ \bar{\varphi}' φ ˉ ′ is a first-order sentence that is logically equivalent to φ ˉ \bar{\varphi} φ ˉ and has width equal to logwidth ( φ ˉ ) \operatorname{logwidth}(\bar{\varphi}) logwidth ( φ ˉ ) .
Notation 2. The following notation is fixed throughout this section.
Let φ : = Q 1 v 1 Q 2 v 2 … Q m − 1 v m − 1 ∀ v m ∃ x 1 … ∃ x k ( ϕ ) \varphi:= Q_1v_1Q_2v_2\ldots Q_{m-1}v_{m-1}\forall v_m\exists x_1\ldots\exists x_k(\phi) φ := Q 1 v 1 Q 2 v 2 … Q m − 1 v m − 1 ∀ v m ∃ x 1 … ∃ x k ( ϕ ) be the simple QCQ under discussion and θ \theta θ its inner region; for notational convenience, set Q m : = ∀ Q_m := \forall Q m := ∀ .
Let τ \tau τ be the set of relation symbols that occur in φ \varphi φ .
Let V : = { v 1 , … , v m } \mathcal{V} := \{v_1,\ldots,v_m\} V := { v 1 , … , v m } , X : = { x 1 , … , x k } \mathcal{X} := \{x_1,\ldots,x_k\} X := { x 1 , … , x k } , and Z : = V ∪ X \mathcal{Z} := \mathcal{V} \cup\mathcal{X} Z := V ∪ X .
Set s ∈ X s \in\mathcal{X} s ∈ X to be an arbitrary but fixed variable.
Let G θ : = ( Z , E θ ) G_\theta:= (\mathcal{Z},E_\theta) G θ := ( Z , E θ ) be the primal graph of H θ H_\theta H θ .
Let ρ ∈ N \rho\in\mathbb{N} ρ ∈ N denote the treewidth of G θ G_\theta G θ .
Set M \mathcal{M} M to be an arbitrary but fixed bramble of G θ G_\theta G θ with order > ρ > \rho > ρ .
Let us recall that, by definition, the hypergraph H θ H_\theta H θ contains { v 1 , … , v m } \{v_1,\ldots,v_m\} { v 1 , … , v m } as a hyperedge, as well as a hyperedge free ( α ) \operatorname{free}(\alpha) free ( α ) for each atom α \alpha α of φ \varphi φ .
Defining A \mathcal{A} A and B \mathcal{B} B
Our next focus is to define the variable-sorted structures A \mathcal{A} A and B \mathcal{B} B . For each v ∈ Z v \in\mathcal{Z} v ∈ Z , recall that E v E_v E v denotes the set of edges incident on v v v . We say that a function f v : E v → { 0 , 1 } f_v:E_v \to\{0,1\} f v : E v → { 0 , 1 } has even parity , if ∑ e ∈ E v f v ( e ) ≡ 0 ( m o d 2 ) \sum_{e\in E_v} f_v(e) \equiv0 \pmod{2} ∑ e ∈ E v f v ( e ) ≡ 0 ( mod 2 ) , and odd parity , otherwise. When convenient, we view φ \varphi φ as a set of atomic formulae, and use notation such as R ( x , y ) ∈ φ R(x,y) \in\varphi R ( x , y ) ∈ φ to indicate that R ( x , y ) R(x,y) R ( x , y ) occurs in φ \varphi φ . We define A \mathcal{A} A and B \mathcal{B} B as variable-sorted structures over the signature ( τ , Z ) (\tau,\mathcal{Z}) ( τ , Z ) .
Definition 5.3 (Domains for A \mathcal{A} A ). For z ∈ Z z \in\mathcal{Z} z ∈ Z , let F z : = { ( z , f z ) ∣ f z : E z → { 0 , 1 } has even parity } \mathcal{F}_z := \{(z,f_z) \mid f_z:E_z \to\{0,1\}\text{ has even parity}\} F z := {( z , f z ) ∣ f z : E z → { 0 , 1 } has even parity } . Then, the domains for each variable are as follows.
For 1 ≤ i < m 1 \le i < m 1 ≤ i < m , set A v i : = F v i A_{v_i} := \mathcal{F}_{v_i} A v i := F v i .
For v m v_m v m , set A v m : = F v m ∪ A v m ′ A_{v_m} := \mathcal{F}_{v_m} \cup A'_{v_m} A v m := F v m ∪ A v m ′ , where A v m ′ : = { ( v r , { v j , v r } ) ∣ v r is existentially quantified and j < r < m } A'_{v_m} := \{(v_r,\{v_j,v_r\}) \mid v_r\text{ is existentially quantified and }j<r<m\} A v m ′ := {( v r , { v j , v r }) ∣ v r is existentially quantified and j < r < m } .
For 1 ≤ i ≤ k 1 \le i \le k 1 ≤ i ≤ k , set A x i : = F x i ∪ A x i ′ A_{x_i} := \mathcal{F}_{x_i} \cup A'_{x_i} A x i := F x i ∪ A x i ′ , where A x i ′ : = { ( v r , f v r , { v j , v r } , x i ) ∣ ( v r , f v r ) ∈ F v r and j < r ≤ m } A'_{x_i} := \{(v_r,f_{v_r},\{v_j,v_r\},x_i) \mid(v_r,f_{v_r}) \in\mathcal{F}_{v_r}\text{ and }j<r\le m\} A x i ′ := {( v r , f v r , { v j , v r } , x i ) ∣ ( v r , f v r ) ∈ F v r and j < r ≤ m } .
In the latter two set definitions here, it holds that { v j , v r } ∈ E θ \{v_j,v_r\} \in E_\theta { v j , v r } ∈ E θ .
Recall from Notation 2 that s ∈ X s \in\mathcal{X} s ∈ X is arbitrary but fixed. The difference in the definitions of the domains, between the two structures, lies precisely in the domain of variable s s s .
Definition 5.4 (Domains for B \mathcal{B} B ). For each z ∈ Z ∖ { s } z \in\mathcal{Z}\setminus\{s\} z ∈ Z ∖ { s } , define B z : = A z B_z := A_z B z := A z ; for each z ∈ X ∪ { v m } z \in\mathcal{X}\cup\{v_m\} z ∈ X ∪ { v m } , define B z ′ : = A z ′ B'_z := A'_z B z ′ := A z ′ . Define B s : = F s ′ ∪ B s ′ B_s := \mathcal{F}'_s \cup B'_s B s := F s ′ ∪ B s ′ , where F s ′ : = { ( s , f s ) ∣ f s : E s → { 0 , 1 } has odd parity } \mathcal{F}'_s := \{(s,f_s) \mid f_s:E_s \to\{0,1\}\text{ has odd parity}\} F s ′ := {( s , f s ) ∣ f s : E s → { 0 , 1 } has odd parity } .
Before defining the interpretation of relation symbols, let us explain the roles of the various domain elements. When all of the domains are restricted to the elements in the sets F z \mathcal{F}_z F z , we essentially obtain a previous construction [12 ] used to obtain bounds for the logical width of conjunctive queries. In this previous construction, atoms were used to ensure that different functions f u : E u → { 0 , 1 } f_u:E_u \to\{0,1\} f u : E u → { 0 , 1 } , f v : E v → { 0 , 1 } f_v:E_v \to\{0,1\} f v : E v → { 0 , 1 } match on the edge { u , v } \{u,v\} { u , v } —if this edge is in the primal graph. The new elements, namely, the elements of A v m ′ = B v m ′ A'_{v_m}=B'_{v_m} A v m ′ = B v m ′ and A x i ′ = B x i ′ A'_{x_i}=B'_{x_i} A x i ′ = B x i ′ , are used to account for the edges of G θ G_\theta G θ between variables v 1 , … , v m v_1,\ldots,v_m v 1 , … , v m which are not witnessed by atoms, but are taken into account to determine treewidth. The new elements provide novel machinery needed to ensure that each pair of functions f u , f v f_u,f_v f u , f v match on the relevant edges.
Consider the evaluation game. Let us say that a player plays inconsistently in the r r r -th round (with r ∈ [ m ] r \in[m] r ∈ [ m ] ) if there is a previous index j j j , with j < r j<r j < r , such that v j v_j v j and v r v_r v r are set to pairs ( v j , f v j ) , ( v r , f v r ) (v_j,f_{v_j}),(v_r,f_{v_r}) ( v j , f v j ) , ( v r , f v r ) that do not match on the common edge, that is, when f v j ( { v j , v r } ) ≠ f v r ( { v j , v r } ) f_{v_j}(\{v_j,v_r\}) \ne f_{v_r}(\{v_j,v_r\}) f v j ({ v j , v r }) = f v r ({ v j , v r }) . The structures are defined so that as soon as one player plays inconsistently, the other has a winning strategy.
If Existential is the first to play inconsistently by setting v r v_r v r as above, then Universal can win by assigning v m v_m v m to the element ( v r , { v j , v r } ) (v_r,\{v_j,v_r\}) ( v r , { v j , v r }) of A v m ′ A'_{v_m} A v m ′ ; this will leave Existential with no way to win, and in particular forces Existential to set each variable x i ∈ X x_i \in\mathcal{X} x i ∈ X to a value in A x i ′ A'_{x_i} A x i ′ . In fact,
the structures shall be defined such that when Universal assigns v m v_m v m to any pair ( v r , { v j , v r } ) (v_r, \{v_j, v_r\}) ( v r , { v j , v r }) of A v m ′ A'_{v_m} A v m ′ , Existential has a winning strategy from this point if and only if there is a match on the edge { v j , v r } \{v_j, v_r\} { v j , v r } . Observe that, among the variables v 1 , … , v m v_1,\ldots,v_m v 1 , … , v m , the only one that could be set to a value outside of a set F z \mathcal{F}_z F z is v m v_m v m . Thus, v m v_m v m , which is the last universally quantified variable in the quantifier prefix, has a special role: it polices the Existential player.
If Universal is the first to play inconsistently by setting v r v_r v r as above, then Existential can win by playing consistently from that point on, and then (assuming v m v_m v m is not set to a pair in A v m ′ A'_{v_m} A v m ′ ) can set its variables x i ∈ X x_i \in\mathcal{X} x i ∈ X to values in A x i ′ A'_{x_i} A x i ′ that point out a mismatch on the edge e = { v j , v r } e = \{v_j, v_r\} e = { v j , v r } . If v m v_m v m is set to a pair in A v m ′ A'_{v_m} A v m ′ , Existential will win due to having played consistently. Thus, each variable x i ∈ X x_i \in\mathcal{X} x i ∈ X can be used to police the Universal player.
When σ \sigma σ is a variable assignment that maps each v i v_i v i , for i ∈ [ m ] i \in[m] i ∈ [ m ] , to some ( v i , f v i ) ∈ F v i (v_i, f_{v_i}) \in\mathcal{F}_{v_i} ( v i , f v i ) ∈ F v i , and each pair of functions match on their shared edge (when it exists), A \mathcal{A} A and B \mathcal{B} B shall be defined such that ( A , σ ) ⊨ v a r θ (\mathcal{A},\sigma) \models_{\mathrm{var}} \theta ( A , σ ) ⊨ var θ and ( B , σ ) ̸ ⊨ v a r θ (\mathcal{B},\sigma) \not\models_{\mathrm{var}} \theta ( B , σ ) ⊨ var θ .
The interpretations of relation symbols are defined based on how they appear as atoms in φ \varphi φ : (1) R ( x i , x j ) ∈ φ R(x_i,x_j) \in\varphi R ( x i , x j ) ∈ φ , for some R ∈ τ R \in\tau R ∈ τ and x i , x j ∈ X x_i,x_j \in\mathcal{X} x i , x j ∈ X ; (2) P ( v t , x i ) ∈ φ P(v_t,x_i) \in\varphi P ( v t , x i ) ∈ φ , for some P ∈ τ P \in\tau P ∈ τ , v t ∈ V v_t \in\mathcal{V} v t ∈ V and x i ∈ X x_i \in\mathcal{X} x i ∈ X .
Up to reversing the order of the variables, these cover all cases due to our assumption that φ \varphi φ is simple (see Definition 5.1). Note that for every v t ∈ V v_t \in\mathcal{V} v t ∈ V , there is some atom P ( v t , x i ) ∈ φ P(v_t,x_i) \in\varphi P ( v t , x i ) ∈ φ (or P ( x i , v t ) ∈ φ P(x_i,v_t) \in\varphi P ( x i , v t ) ∈ φ ) for some relation symbol P P P and some x i ∈ X x_i \in\mathcal{X} x i ∈ X : this is because the tightness condition ensures each atom of φ \varphi φ contains at least one variable from X \mathcal{X} X , and we have assumed each v t ∈ V v_t \in\mathcal{V} v t ∈ V appears in some atom of φ \varphi φ .
Definition 5.5. Let R R R be a binary relation symbol of arity ar ( R ) = x i x j \operatorname{ar}(R)=x_i x_j ar ( R ) = x i x j , where x i , x j ∈ X x_i,x_j \in\mathcal{X} x i , x j ∈ X . Then R A R^{\mathcal{A}} R A consists exactly of the tuples ( a i , a j ) (a_i,a_j) ( a i , a j ) satisfying one of the following: (1) a i = ( x i , f x i ) ∈ F x i a_i=(x_i,f_{x_i}) \in\mathcal{F}_{x_i} a i = ( x i , f x i ) ∈ F x i and a j = ( x j , f x j ) ∈ F x j a_j=(x_j,f_{x_j}) \in\mathcal{F}_{x_j} a j = ( x j , f x j ) ∈ F x j , with f x i ( { x i , x j } ) = f x j ( { x i , x j } ) f_{x_i}(\{x_i,x_j\})=f_{x_j}(\{x_i,x_j\}) f x i ({ x i , x j }) = f x j ({ x i , x j }) ; (2) a i = ( v r , f v r , e , x i ) ∈ A x i ′ a_i=(v_r,f_{v_r},e,x_i) \in A'_{x_i} a i = ( v r , f v r , e , x i ) ∈ A x i ′ and a j = ( v r , f v r , e , x j ) ∈ A x j ′ a_j=(v_r,f_{v_r},e,x_j) \in A'_{x_j} a j = ( v r , f v r , e , x j ) ∈ A x j ′ , for some shared v r v_r v r , f v r f_{v_r} f v r , e e e .
The relation R B R^{\mathcal{B}} R B is defined identically, but such that F s \mathcal{F}_s F s is replaced with F s ′ \mathcal{F}'_s F s ′ , whenever used.
Notice that R A R^{\mathcal{A}} R A is a disjoint union of two parts. The first is a subset of F x i × F x j \mathcal{F}_{x_i} \times\mathcal{F}_{x_j} F x i × F x j where the two functions agree on the common edge, and the second relates two elements of A x i ′ A'_{x_i} A x i ′ and A x j ′ A'_{x_j} A x j ′ that share all but the last component. This holds symmetrically for R B R^{\mathcal{B}} R B .
We now move on to the more complicated case, that is, the interpretation of relation symbols P P P where P ( v t , x i ) ∈ φ P(v_t,x_i) \in\varphi P ( v t , x i ) ∈ φ for v t ∈ V v_t \in\mathcal{V} v t ∈ V and x i ∈ X x_i \in\mathcal{X} x i ∈ X .
Definition 5.6. Let P P P be a binary relation symbol of arity ar ( P ) = v t x i \operatorname{ar}(P)=v_t x_i ar ( P ) = v t x i , for v t ∈ V v_t \in\mathcal{V} v t ∈ V and x i ∈ X x_i \in\mathcal{X} x i ∈ X . Then P A P^{\mathcal{A}} P A consists exactly of the pairs ( a , a ′ ) (a,a') ( a , a ′ ) satisfying one of the following: (1) a = ( v t , g v t ) ∈ F v t a=(v_t,g_{v_t}) \in\mathcal{F}_{v_t} a = ( v t , g v t ) ∈ F v t and a ′ = ( x i , f x i ) ∈ F x i a'=(x_i,f_{x_i}) \in\mathcal{F}_{x_i} a ′ = ( x i , f x i ) ∈ F x i , with g v t ( { v t , x i } ) = f x i ( { v t , x i } ) g_{v_t}(\{v_t,x_i\})=f_{x_i}(\{v_t,x_i\}) g v t ({ v t , x i }) = f x i ({ v t , x i }) . (2) t = m t=m t = m , a = ( v r , e ) ∈ A v m ′ a=(v_r,e) \in A'_{v_m} a = ( v r , e ) ∈ A v m ′ , and a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ a'=(v_r,f_{v_r},e,x_i) \in A'_{x_i} a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ , for some shared v r v_r v r . (3) a = ( v t , g v t ) ∈ F v t a=(v_t,g_{v_t}) \in\mathcal{F}_{v_t} a = ( v t , g v t ) ∈ F v t , with t ∈ [ m − 1 ] t \in[m-1] t ∈ [ m − 1 ] , and a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ a'=(v_r,f_{v_r},e,x_i) \in A'_{x_i} a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ , where v r v_r v r is existentially quantified, and (a) t = r t=r t = r implies g v t ( e ) = f v r ( e ) g_{v_t}(e)=f_{v_r}(e) g v t ( e ) = f v r ( e ) , and (b) e = { v t , v r } e=\{v_t,v_r\} e = { v t , v r } implies g v t ( e ) = f v r ( e ) g_{v_t}(e)=f_{v_r}(e) g v t ( e ) = f v r ( e ) . (4) a = ( v t , g v t ) ∈ F v t a=(v_t,g_{v_t}) \in\mathcal{F}_{v_t} a = ( v t , g v t ) ∈ F v t and a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ a'=(v_r,f_{v_r},e,x_i) \in A'_{x_i} a ′ = ( v r , f v r , e , x i ) ∈ A x i ′ , where v r v_r v r is universally quantified, and (a) t = r t=r t = r implies g v t = f v r g_{v_t}=f_{v_r} g v t = f v r ; and (b) e = { v t , v r } e=\{v_t,v_r\} e = { v t , v r } implies g v t ( e ) ≠ f v r ( e ) g_{v_t}(e)\ne f_{v_r}(e) g v t ( e ) = f v r ( e ) .
The relation P B P^{\mathcal{B}} P B is defined identically, but such that F s \mathcal{F}_s F s is replaced with F s ′ \mathcal{F}'_s F s ′ , whenever used.
Let us revisit the intuition of A \mathcal{A} A and B \mathcal{B} B . Suppose Existential is the first to make an inconsistent pick by assigning v r v_r v r to ( v r , f v r ) (v_r,f_{v_r}) ( v r , f v r ) such that f v r ( { v j , v r } ) ≠ f v j ( { v j , v r } ) f_{v_r}(\{v_j,v_r\}) \ne f_{v_j}(\{v_j,v_r\}) f v r ({ v j , v r }) = f v j ({ v j , v r }) where j < r j<r j < r and v j v_j v j has previously been assigned ( v j , f v j ) (v_j, f_{v_j}) ( v j , f v j ) . If Universal picks ( v r , { v r , v j } ) ∈ A v m ′ (v_r, \{v_r,v_j\}) \in A'_{v_m} ( v r , { v r , v j }) ∈ A v m ′ for v m v_m v m , then Existential is forced to assign every x ∈ X x \in X x ∈ X to the value ( v r , f v r , { v r , v j } , x ′ ) ∈ A x ′ (v_r, f'_{v_r,\{v_r,v_j\},x}) \in A'_{x} ( v r , f v r , { v r , v j } , x ′ ) ∈ A x ′ , each of which shares the first three components (or Existential will lose). This is because ( ( v r , { v r , v j } ) , a ′ ) ∈ P 1 A ((v_r,\{v_r,v_j\}),a') \in P^{\mathcal A}_1 (( v r , { v r , v j }) , a ′ ) ∈ P 1 A can only hold when a ′ ∈ A x i ′ a' \in A'_{x_i} a ′ ∈ A x i ′ (see Definition 5.6 (2)) along with some further reasoning that is deferred to the appendix. Note that there are atoms P 1 ( v m , x i ) , P 2 ( v r , x ℓ ) , P 3 ( v j , x ȷ ) ∈ φ P_1(v_m,x_i), P_2(v_r,x_\ell), P_3(v_j,x_{\jmath}) \in\varphi P 1 ( v m , x i ) , P 2 ( v r , x ℓ ) , P 3 ( v j , x ) ∈ φ , for some x i , x ℓ , x ȷ ∈ X x_i,x_\ell,x_{\jmath} \in X x i , x ℓ , x ∈ X , since φ \varphi φ is a simple QCQ (see Definition 5.1). However, for both ( ( v r , f v r ) , ( v r , f v r , { v r , v j } , x ℓ ′ ) ) ((v_r,f_{v_r}),(v_r,f'_{v_r,\{v_r,v_j\},x_\ell})) (( v r , f v r ) , ( v r , f v r , { v r , v j } , x ℓ ′ )) and ( ( v j , f v j ) , ( v r , f v r , { v r , v j } , x ȷ ) ) ′ ((v_j,f_{v_j}),(v_r,f'_{v_r,\{v_r,v_j\},x_{\jmath}))} (( v j , f v j ) , ( v r , f v r , { v r , v j } , x )) ′ to belong to P 2 A P^{\mathcal A}_2 P 2 A and P 3 A P^{\mathcal A}_3 P 3 A , respectively, Definition 5.6 (3) requires that f v r ( { v j , v r } ) = f v r , { v r , v j } ′ ( { v j , v r } ) = f v j ( { v j , v r } ) f_{v_r}(\{v_j,v_r\}) = f'_{v_r,\{v_r,v_j\}}(\{v_j,v_r\}) = f_{v_j}(\{v_j,v_r\}) f v r ({ v j , v r }) = f v r , { v r , v j } ′ ({ v j , v r }) = f v j ({ v j , v r }) , which is impossible by our assumption. Consequently, Universal has a winning strategy from the position where Existential makes an inconsistent pick.
On the other hand, if Universal assigns v m v_m v m to some element of A v m ′ A'_{v_m} A v m ′ that does not point to an inconsistency, then Existential has a winning strategy from that point. This follows by the above reasoning, with the exception that f v r ( { v j , v r } ) = f v r , { v r , v j } ′ ( { v j , v r } ) = f v j ( { v j , v r } ) f_{v_r}(\{v_j,v_r\}) = f'_{v_r,\{v_r,v_j\}}(\{v_j,v_r\}) = f_{v_j}(\{v_j,v_r\}) f v r ({ v j , v r }) = f v r , { v r , v j } ′ ({ v j , v r }) = f v j ({ v j , v r }) does indeed hold, along with some further reasoning.
Now suppose that Universal is the first to make an inconsistent pick by assigning v r v_r v r to ( v r , f v r ) (v_r,f_{v_r}) ( v r , f v r ) such that f v r ( { v j , v r } ) ≠ f v j ( { v j , v r } ) f_{v_r}(\{v_j,v_r\}) \ne f_{v_j}(\{v_j,v_r\}) f v r ({ v j , v r }) = f v j ({ v j , v r }) , for some j < r j < r j < r . In this case, Existential can play consistently until round m m m , and then (assuming Universal does not assign v m v_m v m to some element of A v m ′ A'_{v_m} A v m ′ , in which case Existential can win, as described above) can assign each x i ∈ X x_i \in X x i ∈ X to ( v r , f v r , { v j , v r } , x i ) ∈ A x i ′ (v_r,f_{v_r},\{v_j,v_r\},x_i) \in A'_{x_i} ( v r , f v r , { v j , v r } , x i ) ∈ A x i ′ :
For P 2 ( v r , x ℓ ) P_2(v_r,x_\ell) P 2 ( v r , x ℓ ) , we have ( ( v r , f v r ) , ( v r , f v r , { v j , v r } , x ℓ ) ) ∈ P 2 A ((v_r,f_{v_r}),(v_r,f_{v_r},\{v_j,v_r\},x_\ell)) \in P^{\mathcal A}_2 (( v r , f v r ) , ( v r , f v r , { v j , v r } , x ℓ )) ∈ P 2 A by Definition 5.6 (4a).
For P 3 ( v j , x ȷ ) P_3(v_j,x_{\jmath}) P 3 ( v j , x ) , we have ( ( v j , f v j ) , ( v r , f v r , { v j , v r } , x ȷ ) ) ∈ P 3 A ((v_j,f_{v_j}),(v_r,f_{v_r},\{v_j,v_r\},x_{\jmath})) \in P^{\mathcal A}_3 (( v j , f v j ) , ( v r , f v r , { v j , v r } , x )) ∈ P 3 A , by Definition 5.6 (4b).
For every atom P ( v q , x i ′ ) P(v_q,x'_i) P ( v q , x i ′ ) with v q ∈ V ∖ { v r , v j } v_q \in V \setminus\{v_r,v_j\} v q ∈ V ∖ { v r , v j } , we have ( ( v q , f v q ) , ( v r , f v r , { v j , v r } , x i ′ ) ) ∈ P A ((v_q,f_{v_q}),(v_r,f_{v_r},\{v_j,v_r\},x'_i)) \in P^{\mathcal A} (( v q , f v q ) , ( v r , f v r , { v j , v r } , x i ′ )) ∈ P A by the fact that the antecedents for Definition 5.6 (4a) and Definition 5.6 (4b) are both false.
From this, we can show Existential has a winning strategy from such a position. Therefore, when Universal makes an inconsistent pick first, Existential has a winning strategy from that point.
Example 5.7. Recall φ ˉ \bar{\varphi} φ ˉ defined in Example 5.2. In A \mathcal A A , each variable v v v of φ ˉ \bar{\varphi} φ ˉ has a domain containing ( v , f v ) (v,f_v) ( v , f v ) with f v : E v → { 0 , 1 } f_v:E_v \to\{0,1\} f v : E v → { 0 , 1 } having even parity. Suppose σ ( v 1 ) = ( v 1 , f v 1 ) \sigma(v_1)=(v_1,f_{v_1}) σ ( v 1 ) = ( v 1 , f v 1 ) with f v 1 ( { v 1 , v 2 } ) = 0 f_{v_1}(\{v_1,v_2\})=0 f v 1 ({ v 1 , v 2 }) = 0 , f v 1 ( { v 1 , x 1 } ) = 0 f_{v_1}(\{v_1,x_1\})=0 f v 1 ({ v 1 , x 1 }) = 0 and σ ( v 2 ) = ( v 2 , f v 2 ) \sigma(v_2)=(v_2,f_{v_2}) σ ( v 2 ) = ( v 2 , f v 2 ) with f v 2 ( { v 1 , v 2 } ) = 1 f_{v_2}(\{v_1,v_2\})=1 f v 2 ({ v 1 , v 2 }) = 1 , f v 2 ( { v 1 , x 2 } ) = 1 f_{v_2}(\{v_1,x_2\})=1 f v 2 ({ v 1 , x 2 }) = 1 . Then, let σ ( u ) = ( v 2 , f v 2 , { v 1 , v 2 } , u ) \sigma(u)=(v_2,f_{v_2},\{v_1,v_2\},u) σ ( u ) = ( v 2 , f v 2 , { v 1 , v 2 } , u ) for u ∈ { x 1 , x 2 } u \in\{x_1,x_2\} u ∈ { x 1 , x 2 } and notice by following the definitions we get:
( ( v 1 , f v 1 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 1 ) ) ∈ R 1 A ((v_1,f_{v_1}),(v_2,f_{v_2},\{v_1,v_2\},x_1)) \in R^{\mathcal A}_1 (( v 1 , f v 1 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 1 )) ∈ R 1 A , since f v 1 ( { v 1 , v 2 } ) ≠ f v 2 ( { v 1 , v 2 } ) f_{v_1}(\{v_1,v_2\}) \ne f_{v_2}(\{v_1,v_2\}) f v 1 ({ v 1 , v 2 }) = f v 2 ({ v 1 , v 2 }) ;
( ( v 2 , f v 2 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 2 ) ) ∈ R 2 A ((v_2,f_{v_2}),(v_2,f_{v_2},\{v_1,v_2\},x_2)) \in R^{\mathcal A}_2 (( v 2 , f v 2 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 2 )) ∈ R 2 A ; and
( ( v 2 , f v 2 , { v 1 , v 2 } , x 1 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 2 ) ) ∈ R 3 A ((v_2,f_{v_2},\{v_1,v_2\},x_1),(v_2,f_{v_2},\{v_1,v_2\},x_2)) \in R^{\mathcal A}_3 (( v 2 , f v 2 , { v 1 , v 2 } , x 1 ) , ( v 2 , f v 2 , { v 1 , v 2 } , x 2 )) ∈ R 3 A .
Hence ( A , σ ) ⊨ R 1 ( v 1 , x 1 ) ∧ R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ) (\mathcal A,\sigma) \models R_1(v_1,x_1) \land R_2(v_2,x_2) \land R_3(x_1,x_2) ( A , σ ) ⊨ R 1 ( v 1 , x 1 ) ∧ R 2 ( v 2 , x 2 ) ∧ R 3 ( x 1 , x 2 ) .
A and B disagree on φ \varphi φ
The following notion allows us to rule out some strategies for Universal and Existential in the evaluation games for φ \varphi φ over A \mathcal A A and B \mathcal B B .
Definition 5.8. Consider the evaluation game for φ \varphi φ over A \mathcal A A , or B \mathcal B B . For a position ( r + 1 , σ ) (r+1,\sigma) ( r + 1 , σ ) of the evaluation game with r ≤ m r \le m r ≤ m , we say that Universal (Existential) has played inconsistently if there exist indices j < i ≤ r j < i \le r j < i ≤ r where Q i = ∀ Q_i = \forall Q i = ∀ (or Q i = ∃ Q_i = \exists Q i = ∃ , respectively) such that σ ( v i ) = ( v i , f v i ) ∈ F v i \sigma(v_i)=(v_i,f_{v_i}) \in F_{v_i} σ ( v i ) = ( v i , f v i ) ∈ F v i and σ ( v j ) = ( v j , f v j ) ∈ F v j \sigma(v_j)=(v_j,f_{v_j}) \in F_{v_j} σ ( v j ) = ( v j , f v j ) ∈ F v j but where f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\}) \ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . If a player has not played inconsistently, then they have played consistently .
We show that as soon as one player plays inconsistently, the other has a winning strategy.
Lemma 5.9. Let ( r + 1 , σ ) (r+1,\sigma) ( r + 1 , σ ) be a position of the evaluation game for φ \varphi φ over A \mathcal A A or B \mathcal B B . If one player played consistently while the other player played inconsistently, then the player that played consistently has a winning strategy from the position ( r + 1 , σ ) (r+1,\sigma) ( r + 1 , σ ) .
Thus, this proves that the only viable strategy for either Universal or Existential is to play consistently. Next, we rule out another potential strategy.
Definition 5.10. Let ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) be a position of the game for φ \varphi φ over A \mathcal{A} A , where both players have played consistently. Then, Universal played dishonestly if σ ( v m ) ∈ A v m ′ \sigma(v_m) \in A'_{v_m} σ ( v m ) ∈ A v m ′ , and played honestly otherwise.
Let ( m + r + 1 , σ ) (m+r+1,\sigma) ( m + r + 1 , σ ) be a position of the game for φ \varphi φ over A \mathcal{A} A , where r ∈ [ k ] r \in[k] r ∈ [ k ] , both players have played consistently in the first m m m rounds, and Universal has played honestly. Existential played dishonestly if σ ( x r ) ∈ A x r ′ \sigma(x_r) \in A'_{x_r} σ ( x r ) ∈ A x r ′ , and played honestly otherwise.
We define having played honestly/dishonestly in the game for φ \varphi φ over B \mathcal{B} B analogously.
The following result shows us that for Universal (or Existential) to have any chance of winning, they must play honestly.
Lemma 5.11. Consider the evaluation game for φ \varphi φ over A \mathcal{A} A (respectively, over B \mathcal{B} B ). Then,
If ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) is a position of the game where both players have played consistently, but Universal has played dishonestly, then Existential has a winning strategy from this position.
If ( m + r + 1 , σ ) (m+r+1,\sigma) ( m + r + 1 , σ ) is a position of the game, where r ∈ [ k ] r \in[k] r ∈ [ k ] , such that both players have played consistently in the first m m m rounds, Universal has played honestly, and Existential has played dishonestly, then Existential will lose from this position.
We are now ready to show that the structure A \mathcal{A} A satisfies φ \varphi φ , whereas the structure B \mathcal{B} B does not.
Lemma 5.12. A ⊨ v a r φ \mathcal{A} \models_{\mathrm{var}} \varphi A ⊨ var φ and B ̸ ⊨ v a r φ \mathcal{B} \not\models_{\mathrm{var}} \varphi B ⊨ var φ .
Proof Sketch. Fix ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) to be a position of the evaluation game where both players play consistently and Universal plays honestly. We show that Existential has a winning strategy from this position for A \mathcal{A} A , and does not have a winning strategy from this position for B \mathcal{B} B .
**Regarding A ⊨ v a r φ : ∗ ∗ R e c a l l t h a t \mathcal{A} \models_{\mathrm{var}} \varphi:** Recall that A ⊨ var φ : ∗ ∗ R ec a l l t ha t \sigma(v_m)=(v_m,f_{v_m}) \in F_{v_m}a n d and an d f_{v_i}({v_i,v_j})=f_{v_j}({v_i,v_j})f o r a l l $ 1 ≤ j < i ≤ m for all \$1 \leq j < i \leq m f or a l l $1 ≤ j < i ≤ m , since both players have played consistently and honestly.
Let S ⊆ X S \subseteq\mathcal{X} S ⊆ X , where x ∈ S x \in S x ∈ S if and only if ∑ v i ∈ V ∩ N G θ ( x ) f v i ( { v i , x } ) ≡ 1 ( m o d 2 ) \sum_{v_i \in V \cap N_{G_\theta}(x)} f_{v_i}(\{v_i,x\}) \equiv1 \pmod{2} ∑ v i ∈ V ∩ N G θ ( x ) f v i ({ v i , x }) ≡ 1 ( mod 2 ) . Here, N G θ ( x ) N_{G_\theta}(x) N G θ ( x ) denotes the neighbourhood of x x x in the primal graph G θ G_\theta G θ . We can establish that ∣ S ∣ |S| ∣ S ∣ is even. Then by applying a graph-theoretic lemma, we get a subgraph of G θ ∣ X G_\theta|_{\mathcal{X}} G θ ∣ X whose set of odd-degree vertices is exactly S S S . From this, we construct an extension of σ \sigma σ to all variables of φ \varphi φ that satisfies φ \varphi φ .
**Regarding B ̸ ⊨ v a r φ : ∗ ∗ L e t \mathcal{B} \not\models_{\mathrm{var}} \varphi:** Let B ⊨ var φ : ∗ ∗ L e t \sigma'$ be an assignment that extends σ \sigma σ and is defined on all variables of φ \varphi φ . We show that assuming ( B , σ ′ ) ⊨ v a r φ (\mathcal{B},\sigma') \models_{\mathrm{var}} \varphi ( B , σ ′ ) ⊨ var φ leads to a contradiction. For each z z z , we have σ ′ ( z ) = ( z , f z ) \sigma'(z)=(z,f_z) σ ′ ( z ) = ( z , f z ) with f z : E z → { 0 , 1 } f_z:E_z \to\{0,1\} f z : E z → { 0 , 1 } , since play has been consistent and honest. Moreover, all pairs of functions must agree on a shared edge. Thus, we can consider every edge of G θ G_\theta G θ to be labelled 0 or 1. Summing the Boolean labels two ways, edgewise and vertexwise, we get a mismatch in the parity of the two summations due to the fact that the labels contributed by s s s have odd parity. Indeed, every edge contributes twice to the vertexwise sum, whereas the vertexwise parities are even at all vertices except for the distinguished vertex s s s . □ \square □
A and B are ρ \rho ρ -indistinguishable
This section shows that Duplicator wins the variable-sorted ρ \rho ρ -pebble game over A \mathcal{A} A and B \mathcal{B} B , as defined in Section 5.1. Recall that ρ = tw ( H θ ) \rho=\operatorname{tw}(H_\theta) ρ = tw ( H θ ) , where θ \theta θ is the inner region of φ \varphi φ . The proof generalises the pebble game argument given in [12 ] . A full proof is given in the appendix to deal with the differences between the structures defined in this paper and those defined in [12 ] .
Definition 5.13. Let W = ( a 1 , … , a ℓ ) W=(a_1,\ldots,a_\ell) W = ( a 1 , … , a ℓ ) be a walk in the graph G θ G_\theta G θ . For e ∈ E θ e \in E_\theta e ∈ E θ , let
occ W ( e ) : = ∣ { i ∈ [ ℓ − 1 ] ∣ e = { a i , a i + 1 } } ∣ . \operatorname{occ}_W(e):=\left|\{i \in[\ell-1] \mid e=\{a_i,a_{i+1}\}\}\right|. occ W ( e ) := ∣ { i ∈ [ ℓ − 1 ] ∣ e = { a i , a i + 1 }} ∣ .
That is, occ W ( e ) \operatorname{occ}_{W}(e) occ W ( e ) is the number of times the edge e e e appears in the walk W W W . Recall that M \mathcal{M} M is a fixed bramble of G θ G_{\theta} G θ with order > ρ > \rho > ρ . Now, for each S ⊆ Z S \subseteq Z S ⊆ Z , let
avoid M ( S ) : = ⋃ { M ∈ M ∣ M ∩ S = ∅ } M . \operatorname{avoid}_{\mathcal{M}}(S) := \bigcup_{\{M \in\mathcal{M} \mid M \cap S = \varnothing\}} M. avoid M ( S ) := { M ∈ M ∣ M ∩ S = ∅ } ⋃ M .
Thus avoid M ( S ) \operatorname{avoid}_{\mathcal{M}}(S) avoid M ( S ) denotes the union of the bramble sets in M \mathcal{M} M that are disjoint from S S S .
Recall that for a tuple t ⃗ = ( t 1 , … , t r ) \vec{t} = (t_1, \ldots, t_r) t = ( t 1 , … , t r ) , we set π i ( t ⃗ ) = t i \pi_i(\vec{t}) = t_i π i ( t ) = t i , for every i ∈ [ r ] i \in[r] i ∈ [ r ] .
We remind the reader of the definition of the domains of A \mathcal{A} A and B \mathcal{B} B , see Definition 5.3 and Definition 5.4. Observe that, with the exception of elements from A ν m ′ A'_{\nu_m} A ν m ′ and B ν m ′ B'_{\nu_m} B ν m ′ , every element of A \mathcal{A} A and B \mathcal{B} B is of the following form: the first component is a vertex of G θ G_{\theta} G θ and the second component is a function that labels edges incident to the first component in G θ G_{\theta} G θ . More formally, for a ∈ A a \in A a ∈ A , we have that π 1 ( a ) ∈ Z \pi_1(a) \in Z π 1 ( a ) ∈ Z and if a ∉ A ν m ′ a \notin A'_{\nu_m} a ∈ / A ν m ′ also holds, then π 2 ( a ) \pi_2(a) π 2 ( a ) is a function that maps E π 1 ( a ) E_{\pi_1(a)} E π 1 ( a ) to { 0 , 1 } \{0,1\} { 0 , 1 } .
Our aim is to show that Duplicator has a winning strategy for the ρ \rho ρ -pebble game over A \mathcal{A} A and B \mathcal{B} B . To do so, Duplicator fixes a bramble M \mathcal{M} M of G θ G_{\theta} G θ , and maintains the following invariant:
Suppose that i ≤ ρ i \leq\rho i ≤ ρ pebbles are placed on a 1 , … , a i ∈ A a_1,\ldots,a_i \in A a 1 , … , a i ∈ A and on the corresponding elements b 1 , … , b i ∈ B b_1,\ldots,b_i \in B b 1 , … , b i ∈ B . Then, there exists a walk W W W in G θ G_{\theta} G θ from the distinguished element s s s to some vertex in avoid M ( { π 1 ( a 1 ) , … , π 1 ( a i ) } ) \operatorname{avoid}_{\mathcal{M}}(\{\pi_1(a_1),\ldots,\pi_1(a_i)\}) avoid M ({ π 1 ( a 1 ) , … , π 1 ( a i )}) such that:
For every j ∈ { 1 , … , i } j \in\{1,\ldots,i\} j ∈ { 1 , … , i } , if π 2 ( b j ) \pi_2(b_j) π 2 ( b j ) is a function, then for every edge e e e incident to π 1 ( a j ) \pi_1(a_j) π 1 ( a j ) , we have that π 2 ( b j ) ( e ) \pi_2(b_j)(e) π 2 ( b j ) ( e ) is equal to π 2 ( a j ) ( e ) + occ W ( e ) \pi_2(a_j)(e) + \operatorname{occ}_{W}(e) π 2 ( a j ) ( e ) + occ W ( e ) (mod 2). If π 2 ( b j ) \pi_2(b_j) π 2 ( b j ) is not a function, then a j = b j a_j = b_j a j = b j .
We note that this is essentially the same as Duplicator’s strategy given in [12 ] . To formalise the above intuition, let us introduce the following definition.
Definition 5.14. Let W W W be a walk in G θ G_{\theta} G θ . For every function f : E v → { 0 , 1 } f : E_v \to\{0,1\} f : E v → { 0 , 1 } , for some vertex v v v of G θ G_{\theta} G θ , let f W : E v → { 0 , 1 } f^W : E_v \to\{0,1\} f W : E v → { 0 , 1 } denote f W ( e ) = f ( e ) + occ W ( e ) f^W(e) = f(e) + \operatorname{occ}_{W}(e) f W ( e ) = f ( e ) + occ W ( e ) (mod 2), for every e ∈ E v e \in E_v e ∈ E v . Define Ψ W : A → B \Psi_W : A \to B Ψ W : A → B as:
if a ∈ A ν m ′ a \in A'_{\nu_m} a ∈ A ν m ′ , then Ψ W ( a ) = a \Psi_W(a) = a Ψ W ( a ) = a , and
otherwise, Ψ W ( a ) \Psi_W(a) Ψ W ( a ) is obtained by replacing the second component π 2 ( a ) \pi_2(a) π 2 ( a ) by π 2 ( a ) W \pi_2(a)^W π 2 ( a ) W and keeping all other components unchanged.
Example 5.15. Recall φ ˉ \bar{\varphi} φ ˉ defined in Example 5.2. The hypergraph of the inner region θ \theta θ contains the edges { v 1 , v 2 } \{v_1,v_2\} { v 1 , v 2 } , { v 1 , x 1 } \{v_1,x_1\} { v 1 , x 1 } , { v 2 , x 2 } \{v_2,x_2\} { v 2 , x 2 } , { x 1 , x 2 } \{x_1,x_2\} { x 1 , x 2 } . Let f x 1 : E x 1 → { 0 , 1 } f_{x_1} : E_{x_1} \to\{0,1\} f x 1 : E x 1 → { 0 , 1 } be defined by f x 1 ( { v 1 , x 1 } ) = 0 f_{x_1}(\{v_1,x_1\}) = 0 f x 1 ({ v 1 , x 1 }) = 0 and f x 1 ( { x 1 , x 2 } ) = 0 f_{x_1}(\{x_1,x_2\}) = 0 f x 1 ({ x 1 , x 2 }) = 0 . Let W = ( x 1 , v 1 , x 1 , x 2 , v 2 ) W = (x_1,v_1,x_1,x_2,v_2) W = ( x 1 , v 1 , x 1 , x 2 , v 2 ) be a walk in G θ G_{\theta} G θ and observe occ W ( { x 1 , v 1 } ) = 2 \operatorname{occ}_{W}(\{x_1,v_1\}) = 2 occ W ({ x 1 , v 1 }) = 2 and occ W ( { x 1 , x 2 } ) = 1 \operatorname{occ}_{W}(\{x_1,x_2\}) = 1 occ W ({ x 1 , x 2 }) = 1 . Hence, Ψ W ( x 1 , f x 1 ) = ( x 1 , f x 1 W ) \Psi_W(x_1,f_{x_1}) = (x_1,f_{x_1}^W) Ψ W ( x 1 , f x 1 ) = ( x 1 , f x 1 W ) where f x 1 W ( { x 1 , v 1 } ) = 0 f_{x_1}^W(\{x_1,v_1\}) = 0 f x 1 W ({ x 1 , v 1 }) = 0 and f x 1 W ( { x 1 , x 2 } ) = 1 f_{x_1}^W(\{x_1,x_2\}) = 1 f x 1 W ({ x 1 , x 2 }) = 1 .
Lemma 5.16. Let 0 ≤ i ≤ ρ 0 \leq i \leq\rho 0 ≤ i ≤ ρ and let { a 1 , … , a i } ⊆ A \{a_1,\ldots,a_i\} \subseteq A { a 1 , … , a i } ⊆ A . Let W W W be a walk in G θ G_{\theta} G θ from s s s to a vertex in avoid M ( { π 1 ( a 1 ) , … , π 1 ( a i ) } ) \operatorname{avoid}_{\mathcal{M}}(\{\pi_1(a_1),\ldots,\pi_1(a_i)\}) avoid M ({ π 1 ( a 1 ) , … , π 1 ( a i )}) . Then, the mapping Ψ W \Psi_W Ψ W restricted to { a 1 , … , a i } \{a_1,\ldots,a_i\} { a 1 , … , a i } is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B .
Using Lemma 5.16 as an invariant condition, we get the following result.
Lemma 5.17. Duplicator has a winning strategy for the ρ \rho ρ -pebble game over A \mathcal{A} A and B \mathcal{B} B .
Notice that ρ \rho ρ -many pebbles can hit at most ρ \rho ρ vertices, and since the bramble has an order greater than ρ \rho ρ , some bramble set will be unhit. Thus, Duplicator can play in a way that maintains this invariant, by defining a walk from s s s to some unhit bramble set. The proofs of Lemma 5.16 and Lemma 5.17 are generalisations of the proofs of Lemma 14 and Lemma 16 in [12 ] , respectively.
To sum up, this section constructed structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ \mathcal{A} \models_{\mathrm{var}} \varphi A ⊨ var φ , B ⊨ v a r φ \mathcal{B} \models_{\mathrm{var}} \varphi B ⊨ var φ , and A ≡ v a r ρ B \mathcal{A} \equiv_{\mathrm{var}}^{\rho} \mathcal{B} A ≡ var ρ B . Thus, by Lemma 2.9 and the pebble-game characterisation recalled in Section 2, we have that logwidth ( φ ) ≥ tw ( H θ ) + 1 \operatorname{logwidth}(\varphi) \geq\operatorname{tw}(H_{\theta}) + 1 logwidth ( φ ) ≥ tw ( H θ ) + 1 , where θ \theta θ is the inner region of φ \varphi φ .
Proof Sketch of thm:main-exists-and
This section illustrates why the width lower bound for simple QCQs is sufficient to prove Theorem 4.5. The key idea is to define a sequence φ 1 , φ 2 , … , φ 5 \varphi_1, \varphi_2, \ldots, \varphi_5 φ 1 , φ 2 , … , φ 5 of formulae, where φ 1 \varphi_1 φ 1 is any self-join-free QCQ that is a normal form of [ φ 1 ] T [\varphi_1]_{\mathsf{T}} [ φ 1 ] T in the system R \mathcal{R} R and φ 5 \varphi_5 φ 5 is a simple QCQ. Moreover, we define this sequence such that for each i ∈ { 2 , … , 5 } i \in\{2, \ldots, 5\} i ∈ { 2 , … , 5 } if there are structures A i \mathcal{A}^{i} A i and B i \mathcal{B}^{i} B i that disagree on φ i \varphi_i φ i but A i ≡ v a r B i \mathcal{A}^{i} \equiv_{\mathrm{var}} \mathcal{B}^{i} A i ≡ var B i , then there are structures A i − 1 \mathcal{A}^{i-1} A i − 1 and B i − 1 \mathcal{B}^{i-1} B i − 1 that disagree on φ i − 1 \varphi_{i-1} φ i − 1 but A i − 1 ≡ v a r B i − 1 \mathcal{A}^{i-1} \equiv_{\mathrm{var}} \mathcal{B}^{i-1} A i − 1 ≡ var B i − 1 .
For the following series of reductions, we require the following definition: For a { ∀ } \{\forall\} { ∀ } region ψ \psi ψ of some QCQ φ \varphi φ with ∣ free ( ψ ) ∣ ≥ 1 |\operatorname{free}(\psi)| \geq1 ∣ free ( ψ ) ∣ ≥ 1 , the contraction of φ \varphi φ at ψ \psi ψ , denoted by φ ψ c t r \varphi_{\psi}^{\mathrm{ctr}} φ ψ ctr is defined as follows. Let F ψ : = { z 1 , … , z m } F_{\psi} := \{z_1, \ldots, z_m\} F ψ := { z 1 , … , z m } be the free variables of ψ \psi ψ , given an arbitrary ordering denoted by the subscripts. Introduce a new and unique binary relation R z i , z j ψ R_{z_i,z_j}^{\psi} R z i , z j ψ , for each pair z i , z j ∈ F ψ z_i, z_j \in F_{\psi} z i , z j ∈ F ψ with i ≤ j i \leq j i ≤ j . Then, φ ψ c t r \varphi_{\psi}^{\mathrm{ctr}} φ ψ ctr is obtained by replacing the occurrence of the subformula rooted at ψ \psi ψ in φ \varphi φ with ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ψ ( z i , z j ) \bigwedge_{1\leq i\leq j\leq m} R_{z_i,z_j}^{\psi}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ψ ( z i , z j ) .
Let φ 1 \varphi_1 φ 1 be a standardised self-join-free QCQ such that [ φ 1 ] T [\varphi_1]_{\mathsf{T}} [ φ 1 ] T is a normal form in the system R \mathcal{R} R , and let θ \theta θ be a { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of φ 1 \varphi_1 φ 1 with maximum treewidth. Our aim is to prove logwidth ( φ 1 ) > tw ( H θ ) \operatorname{logwidth}(\varphi_1) > \operatorname{tw}(H_{\theta}) logwidth ( φ 1 ) > tw ( H θ ) . The reduction is structured as follows.
Contract all { ∀ } \{\forall\} { ∀ } regions that occur below θ \theta θ and that have an atomic child region. Set φ 2 \varphi_2 φ 2 to be this new self-join-free QCQ.
To obtain φ 3 \varphi_3 φ 3 , replace all atoms of φ 2 \varphi_2 φ 2 of the form R ( z 1 , … , z m ) R(z_1, \ldots, z_m) R ( z 1 , … , z m ) with m > 2 m > 2 m > 2 with the conjunction ⋀ 1 ≤ i < j ≤ m R i , j ( z i , z j ) \bigwedge_{1\leq i<j\leq m} R_{i,j}(z_i,z_j) ⋀ 1 ≤ i < j ≤ m R i , j ( z i , z j ) , where R i , j R_{i,j} R i , j is a new relation symbol that is unique to R R R , i i i , and j j j . Thus, φ 3 \varphi_3 φ 3 is a self-join-free QCQ over a signature that only contains atoms with at most two variables.
The next step in the reduction is to obtain φ 4 \varphi_4 φ 4 by contracting each non-atomic child region of θ \theta θ . This is perhaps the most technical step in the reduction, since if ψ ( z 1 , … , z r ) \psi(z_1, \ldots, z_r) ψ ( z 1 , … , z r ) is a child region of θ \theta θ , then we wish to define the interpretation of relation symbols that occur in ψ \psi ψ in such a way as to simulate the conjunction ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) \bigwedge_{1\leq i\leq j\leq r} R_{z_i,z_j}^{\psi}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) .
Finally, φ 5 \varphi_5 φ 5 is obtained from φ 4 \varphi_4 φ 4 by restricting φ 4 \varphi_4 φ 4 to a sub-signature such that every atom of φ 5 \varphi_5 φ 5 contributes to the maximum treewidth region, and adheres to the definition of a simple QCQ. This final QCQ φ 5 \varphi_5 φ 5 can then be shown to be a simple QCQ with an inner region that has the same treewidth as the maximum treewidth { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of our original QCQ φ 1 \varphi_1 φ 1 .
By Lemma 5.12 and Lemma 5.17 , there are variable-sorted structures A \mathcal{A} A and B \mathcal{B} B that disagree on φ 5 \varphi_5 φ 5 , but for which A ≡ v a r tw ( H θ ) B \mathcal{A} \equiv_{\mathrm{var}}^{\operatorname{tw}(H_{\theta})} \mathcal{B} A ≡ var tw ( H θ ) B . Applying the reductions in reverse order essentially “expands” these two structures to structures A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + that disagree on φ 1 \varphi_1 φ 1 but for which A + ≡ v a r tw ( H θ ) B + \mathcal{A}^{+} \equiv_{\mathrm{var}}^{\operatorname{tw}(H_{\theta})} \mathcal{B}^{+} A + ≡ var tw ( H θ ) B + . Consequently, we achieve the desired lower bound.
We conclude this section by noting that the reductions performed in this section require that φ 1 \varphi_1 φ 1 is a self-join-free QCQ. To see why, consider Item 3 above. That is, φ 4 \varphi_4 φ 4 is obtained by replacing each non-atomic child region ψ ( z 1 , … , z r ) \psi(z_1,\ldots,z_r) ψ ( z 1 , … , z r ) of θ \theta θ with ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) \bigwedge_{1\leq i\leq j\leq r} R_{z_i,z_j}^{\psi}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) where each R z i , z j ψ R_{z_i,z_j}^{\psi} R z i , z j ψ is a fresh relation symbol. We define the relation symbols that appear in ψ ( z 1 , … , z r ) \psi(z_1,\ldots,z_r) ψ ( z 1 , … , z r ) to simulate ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) \bigwedge_{1\leq i\leq j\leq r} R_{z_i,z_j}^{\psi}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ r R z i , z j ψ ( z i , z j ) in order to transfer width lower bounds from φ 4 \varphi_4 φ 4 back to φ 3 \varphi_3 φ 3 . Since we have a self-join-free QCQ, we may interpret the relation symbols in ψ ( z 1 , … , z r ) \psi(z_1,\ldots,z_r) ψ ( z 1 , … , z r ) without affecting any other regions as each relation symbol may only appear in at most one region.
Conclusions
The main result of this article analysed self-join-free QCQs, and showed that there is an algorithm that, given a self-join-free QCQ φ \varphi φ , outputs a second QCQ whose width is minimal over all first-order sentences that are logically equivalent to φ \varphi φ . Our analysis revealed that this second QCQ is obtainable from the original QCQ φ \varphi φ via the application of syntactic rewriting rules. Beyond self-join-freeness being a natural syntactic restriction, there is a technical reason why we view the understanding of self-join-free QCQs as crucial. In the case of conjunctive queries (for short, CQs), which we here define as QCQs where universal quantification is not used, the logical width has been analysed [12 ] . For a given CQ ϕ \phi ϕ , the logical width can be computed by passing to the core of ϕ \phi ϕ , and then taking the treewidth (plus one) of the core. Indeed, one can apply the rewriting methods described in this article to minimise the core’s width. To prove that the treewidth (plus one) of a CQ’s core is equal to the CQ’s logical width, the mentioned analysis [12 ] can be viewed as an analysis of a self-join-free CQ obtained from the core by renaming relation symbols so that no relation symbol is repeated.5 That is, for a given CQ ϕ \phi ϕ , the logical width can be characterised by first performing the semantic step of passing to the core of ϕ \phi ϕ , and then syntactically measuring the resulting core, where repeated relation symbols are not given any special treatment.
We regard obtaining an understanding of and an algorithm for logical width minimisation of general QCQs as the most immediate and notable issue left open by this article. The situation for CQs suggests a parallel approach to understanding the logical width of general QCQs: we conjecture that the logical width of a given QCQ ϕ \phi ϕ can be obtained by passing to a core ψ \psi ψ of ϕ \phi ϕ , and then using this article’s rewriting algorithm to find a minimum width QCQ among those in [ ψ ] A [\psi]_A [ ψ ] A . This approach would involve introducing the notion of a core of a QCQ, but the work of Bova and Mogavero [13 ] gives hope that such a core notion can be defined and analysed, as it gives homomorphism-based characterisations of QCQ entailment.
Another open issue is to understand the relaxation of QCQs where free variables are permitted. Here, we can mention that, in the case of CQs, the corresponding relaxation was analysed; the main argumentation went into understanding sentences, and then the more general case of formulas could be readily derived from the case of sentences [12 ] .
Finally, we wish to mention one more open issue. The main construction of this article gives, for each self-join-free QCQ, a pair of structures that disagree on the QCQ but are locally indistinguishable. This construction generalises a previous one for CQs [12 ] , and that previous construction can be viewed as a relational analogue of the standard Tseitin parity system [34 ] , which is used widely in proof complexity. As this article’s construction generalises that previous construction to a setting where both quantifiers are present, we end by posing a question: can one perform a transfer back in the other direction, and present applications of our construction to proof complexity?
Acknowledgments
The authors would like to thank the anonymous reviewers for their numerous helpful comments and suggestions, and Stan P. Hauke for thorough proofreading of this work. H. Chen and S. M. Thompson acknowledge the support of the EPSRC grant EP/V039318/1; the bulk of the research and article preparation was performed while S. M. Thompson was employed at King’s College London. H. Chen also acknowledges the support of the EPSRC grant EP/X03190X/1. F. Mogavero acknowledges the support of the University of Naples grant FRA FORMALG (CUP:E65F22000060001)
Appendix
This appendix contains all omitted details from Section 5, except for the proof of Lemma 5.17, which is omitted due to space constraints.
Let us start with the following result that states any satisfying assignment, in either A \mathcal{A} A or B \mathcal{B} B , that maps some x i ∈ X x_i \in\mathcal{X} x i ∈ X to some 4-tuple ( v r , f v r , e , x i ) (v_r, f_{v_r}, e, x_i) ( v r , f v r , e , x i ) , must map all variables in X \mathcal{X} X to a 4-tuple with the same first three components.
Lemma A.1. Suppose σ : Z → A \sigma: \mathcal{Z} \to A σ : Z → A has ( A , σ ) ⊨ v a r φ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \varphi ( A , σ ) ⊨ var φ . If σ ( x i ) = ( v r , f v r , e , x i ) ∈ A x i A \sigma(x_i) = (v_r, f_{v_r}, e, x_i) \in A^{\mathcal{A}}_{x_i} σ ( x i ) = ( v r , f v r , e , x i ) ∈ A x i A for some x i ∈ X x_i \in\mathcal{X} x i ∈ X , then σ ( x j ) = ( v r , f v r , e , x j ) ∈ A x j A \sigma(x_j) = (v_r, f_{v_r}, e, x_j) \in A^{\mathcal{A}}_{x_j} σ ( x j ) = ( v r , f v r , e , x j ) ∈ A x j A for all x j ∈ X x_j \in\mathcal{X} x j ∈ X . The analogous result holds for B \mathcal{B} B .
Proof. We prove this result for A \mathcal{A} A ; the proof for B \mathcal{B} B is totally analogous. Fix σ : Z → A \sigma: \mathcal{Z} \to A σ : Z → A where σ ( x i ) = ( v r , f v r , e , x i ) ∈ A x i A \sigma(x_i) = (v_r, f_{v_r}, e, x_i) \in A^{\mathcal{A}}_{x_i} σ ( x i ) = ( v r , f v r , e , x i ) ∈ A x i A for some x i ∈ X x_i \in\mathcal{X} x i ∈ X , and suppose that ( A , σ ) ⊨ v a r φ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \varphi ( A , σ ) ⊨ var φ . For any R ( x p , x q ) ∈ ϕ R(x_p, x_q) \in\phi R ( x p , x q ) ∈ ϕ with x p , x q ∈ X x_p, x_q \in\mathcal{X} x p , x q ∈ X , we have that ( A , σ ) ⊨ v a r R ( x p , x q ) (\mathcal{A}, \sigma) \models_{\mathrm{var}} R(x_p, x_q) ( A , σ ) ⊨ var R ( x p , x q ) and σ ( x p ) = ( v r , f v r , e , x p ) \sigma(x_p) = (v_r, f_{v_r}, e, x_p) σ ( x p ) = ( v r , f v r , e , x p ) if and only if σ ( x q ) = ( v r , f v r , e , x q ) \sigma(x_q) = (v_r, f_{v_r}, e, x_q) σ ( x q ) = ( v r , f v r , e , x q ) ; see Definition 5.5. Now by Definition 5.1(2), the primal graph G θ ∣ X G_{\theta}|_{\mathcal{X}} G θ ∣ X is connected. Thus, for any pair x r , x s ∈ X x_r, x_s \in\mathcal{X} x r , x s ∈ X , there is a walk ( y 0 , y 1 , … , y m ) (y_0, y_1, \ldots, y_m) ( y 0 , y 1 , … , y m ) from y 0 = x r y_0 = x_r y 0 = x r to y m = x s y_m = x_s y m = x s consisting entirely of elements from X \mathcal{X} X . For every ℓ ∈ [ m ] \ell\in[m] ℓ ∈ [ m ] , since { y ℓ − 1 , y ℓ } \{y_{\ell-1}, y_\ell\} { y ℓ − 1 , y ℓ } is an edge of G θ G_\theta G θ , there is a hyperedge of H θ H_\theta H θ containing both y ℓ − 1 y_{\ell-1} y ℓ − 1 and y ℓ y_\ell y ℓ . Since both variables belong to X \mathcal{X} X , this hyperedge cannot be free( θ ) (\theta) ( θ ) ; hence, by Definition 5.1(1), there is an atom of ϕ \phi ϕ containing both y ℓ − 1 y_{\ell-1} y ℓ − 1 and y ℓ y_\ell y ℓ . □
Proof of Lemma 5.9
Proof. We prove the statement for A \mathcal{A} A ; the argument for B \mathcal{B} B is identical. Recall that
φ = Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ϕ ) . \varphi= Q_1v_1 Q_2v_2 \cdots Q_{m-1}v_{m-1} \forall v_m \exists x_1 \cdots\exists x_k(\phi). φ = Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ϕ ) .
Let ( r + 1 , σ ) (r+1,\sigma) ( r + 1 , σ ) be a position of the evaluation game with r ≤ m r \le m r ≤ m such that one player has played consistently while the other player has played inconsistently. In particular, let i i i and j j j be values with j < i ≤ r j < i \le r j < i ≤ r where σ ( v i ) = ( v i , f v i ) \sigma(v_i) = (v_i, f_{v_i}) σ ( v i ) = ( v i , f v i ) , where σ ( v j ) = ( v j , f v j ) \sigma(v_j) = (v_j, f_{v_j}) σ ( v j ) = ( v j , f v j ) , and where f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\}) \ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . Since exactly one player played inconsistently, we split this proof into the following two cases.
Case 1. Universal played inconsistently: Thus, Q i = ∀ Q_i = \forall Q i = ∀ and Universal chose ( v i , f v i ) (v_i, f_{v_i}) ( v i , f v i ) such that f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\}) \ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . Existential’s strategy is to first play consistently up to the position ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) . From this position, we consider two subcases; one where Universal has picked σ ( v m ) ∈ A v m ′ \sigma(v_m) \in A'_{v_m} σ ( v m ) ∈ A v m ′ , and one where Universal has picked σ ( v m ) ∈ F v m \sigma(v_m) \in\mathcal{F}_{v_m} σ ( v m ) ∈ F v m .
First, consider the case where σ ( v m ) ∈ A v m ′ \sigma(v_m) \in A'_{v_m} σ ( v m ) ∈ A v m ′ . That is, σ ( v m ) = ( v ℓ , { v ℓ , v j } ) \sigma(v_m)=(v_\ell,\{v_\ell,v_j\}) σ ( v m ) = ( v ℓ , { v ℓ , v j }) where v ℓ v_\ell v ℓ is existentially quantified, and j < ℓ j<\ell j < ℓ . For this case, Existential’s winning strategy from position ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) is to pick ( v ℓ , f v ℓ , { v ℓ , v j } , x ) (v_\ell,f_{v_\ell},\{v_\ell,v_j\},x) ( v ℓ , f v ℓ , { v ℓ , v j } , x ) for each x ∈ X x\in\mathcal{X} x ∈ X , where σ ( v ℓ ) = ( v ℓ , f v ℓ ) \sigma(v_\ell)=(v_\ell,f_{v_\ell}) σ ( v ℓ ) = ( v ℓ , f v ℓ ) . We shall verify that all atoms of ϕ \phi ϕ are satisfied when σ \sigma σ is the assignment resulting from the final position under this strategy.
If R ( x p , x q ) ∈ ϕ R(x_p,x_q)\in\phi R ( x p , x q ) ∈ ϕ with x p , x q ∈ X x_p,x_q\in\mathcal{X} x p , x q ∈ X , then ( ( v ℓ , f v ℓ , { v ℓ , v j } , x p ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x q ) ) ∈ R A ((v_\ell,f_{v_\ell},\{v_\ell,v_j\},x_p),(v_\ell,f_{v_\ell},\{v_\ell,v_j\},x_q))\in R^{\mathcal{A}} (( v ℓ , f v ℓ , { v ℓ , v j } , x p ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x q )) ∈ R A by Definition 5.5(2). If P ( v , x ) ∈ ϕ P(v,x)\in\phi P ( v , x ) ∈ ϕ with v ∈ V v\in\mathcal{V} v ∈ V and x ∈ X x\in\mathcal{X} x ∈ X , there are several subcases:
If v = v m v=v_m v = v m , then ( ( v ℓ , { v ℓ , v j } ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x ) ) ∈ P A ((v_\ell,\{v_\ell,v_j\}),(v_\ell,f_{v_\ell},\{v_\ell,v_j\},x))\in P^{\mathcal{A}} (( v ℓ , { v ℓ , v j }) , ( v ℓ , f v ℓ , { v ℓ , v j } , x )) ∈ P A by Definition 5.6(2).
If v = v ℓ v=v_\ell v = v ℓ , then ( ( v ℓ , f v ℓ ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x ) ) ∈ P A ((v_\ell,f_{v_\ell}),(v_\ell,f_{v_\ell},\{v_\ell,v_j\},x))\in P^{\mathcal{A}} (( v ℓ , f v ℓ ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x )) ∈ P A by Definition 5.6(3).
If v = v j v=v_j v = v j , then ( ( v j , f v j ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x ) ) ∈ P A ((v_j,f_{v_j}),(v_\ell,f_{v_\ell},\{v_\ell,v_j\},x))\in P^{\mathcal{A}} (( v j , f v j ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x )) ∈ P A by Definition 5.6(3) along with the fact that f v j ( { v ℓ , v j } ) = f v ℓ ( { v ℓ , v j } ) f_{v_j}(\{v_\ell,v_j\})=f_{v_\ell}(\{v_\ell,v_j\}) f v j ({ v ℓ , v j }) = f v ℓ ({ v ℓ , v j }) , because v ℓ v_\ell v ℓ is existentially quantified and Existential plays consistently.
If v ∉ { v m , v ℓ , v j } v\notin\{v_m,v_\ell,v_j\} v ∈ / { v m , v ℓ , v j } , then ( ( v , f v ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x ) ) ∈ P A ((v,f_v),(v_\ell,f_{v_\ell},\{v_\ell,v_j\},x))\in P^{\mathcal{A}} (( v , f v ) , ( v ℓ , f v ℓ , { v ℓ , v j } , x )) ∈ P A , where σ ( v ) = ( v , f v ) ∈ F v \sigma(v)=(v,f_v)\in\mathcal{F}_v σ ( v ) = ( v , f v ) ∈ F v , by Definition 5.6(3) along with the fact that v ≠ v ℓ v\ne v_\ell v = v ℓ and { v ℓ , v j } ≠ { v , v ℓ } \{v_\ell,v_j\}\ne\{v,v_\ell\} { v ℓ , v j } = { v , v ℓ } .
Next, consider the case where Universal has picked σ ( v m ) ∈ F v m \sigma(v_m)\in\mathcal{F}_{v_m} σ ( v m ) ∈ F v m . For each ℓ ∈ [ k ] \ell\in[k] ℓ ∈ [ k ] , define Existential’s choice as σ ( x ℓ ) : = ( v i , f v i , { v i , v j } , x ℓ ) ∈ A x ℓ ′ \sigma(x_\ell):=(v_i,f_{v_i},\{v_i,v_j\},x_\ell)\in A'_{x_\ell} σ ( x ℓ ) := ( v i , f v i , { v i , v j } , x ℓ ) ∈ A x ℓ ′ . We shall show that this is indeed a winning strategy from the position ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) . Recall that v i v_i v i is universally quantified, and Universal picked σ ( v i ) = ( v i , f v i ) \sigma(v_i)=(v_i,f_{v_i}) σ ( v i ) = ( v i , f v i ) such that f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})\ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . Again, we verify that all atoms in ϕ \phi ϕ are satisfied under the assignment σ \sigma σ that results from the final position under this strategy.
If R ( x p , x q ) ∈ ϕ R(x_p,x_q)\in\phi R ( x p , x q ) ∈ ϕ with x p , x q ∈ X x_p,x_q\in\mathcal{X} x p , x q ∈ X , then ( ( v i , f v i , { v i , v j } , x p ) , ( v i , f v i , { v i , v j } , x q ) ) ∈ R A ((v_i,f_{v_i},\{v_i,v_j\},x_p),(v_i,f_{v_i},\{v_i,v_j\},x_q))\in R^{\mathcal{A}} (( v i , f v i , { v i , v j } , x p ) , ( v i , f v i , { v i , v j } , x q )) ∈ R A by Definition 5.5(2). If P ( v , x ) ∈ ϕ P(v,x)\in\phi P ( v , x ) ∈ ϕ with v ∈ V v\in\mathcal{V} v ∈ V and x ∈ X x\in\mathcal{X} x ∈ X , there are several subcases:
If v = v i v=v_i v = v i , then ( ( v i , f v i ) , ( v i , f v i , { v i , v j } , x ) ) ∈ P A ((v_i,f_{v_i}),(v_i,f_{v_i},\{v_i,v_j\},x))\in P^{\mathcal{A}} (( v i , f v i ) , ( v i , f v i , { v i , v j } , x )) ∈ P A by Definition 5.6(4).
If v = v j v=v_j v = v j , then ( ( v j , f v j ) , ( v i , f v i , { v i , v j } , x i ) ) ∈ P A ((v_j,f_{v_j}),(v_i,f_{v_i},\{v_i,v_j\},x_i))\in P^{\mathcal{A}} (( v j , f v j ) , ( v i , f v i , { v i , v j } , x i )) ∈ P A because f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})\ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) ; which is the condition required in the definition of P A P^{\mathcal{A}} P A for this case; see Definition 5.6(4).
If v ∉ { v i , v j } v\notin\{v_i,v_j\} v ∈ / { v i , v j } , then ( ( v , f v ) , ( v i , f v i , { v i , v j } , x ) ) ∈ P A ((v,f_v),(v_i,f_{v_i},\{v_i,v_j\},x))\in P^{\mathcal{A}} (( v , f v ) , ( v i , f v i , { v i , v j } , x )) ∈ P A , where σ ( v ) = ( v , f v ) \sigma(v)=(v,f_v) σ ( v ) = ( v , f v ) , because v ≠ v i v\ne v_i v = v i and { v , v i } ≠ { v i , v j } \{v,v_i\}\ne\{v_i,v_j\} { v , v i } = { v i , v j } ; see Definition 5.6(4).
Thus, for both cases (σ ( v m ) ∈ A v m ′ \sigma(v_m)\in A'_{v_m} σ ( v m ) ∈ A v m ′ or σ ( v m ) ∈ F v m \sigma(v_m)\in\mathcal{F}_{v_m} σ ( v m ) ∈ F v m ), Existential can play in such a way that the resulting assignment is σ \sigma σ where ( A , σ ) ⊨ ϕ (\mathcal{A},\sigma)\models\phi ( A , σ ) ⊨ ϕ .
Case 2. Existential played inconsistently: Thus, Q i = ∃ Q_i=\exists Q i = ∃ and Existential chose ( v i , f v i ) (v_i,f_{v_i}) ( v i , f v i ) such that f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})\ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . Universal’s strategy is first to play consistently up to position ( m , σ ) (m,\sigma) ( m , σ ) . Then, for v m v_m v m , let Universal pick σ ( v m ) : = ( v i , { v i , v j } ) ∈ A v m ′ \sigma(v_m):=(v_i,\{v_i,v_j\})\in A'_{v_m} σ ( v m ) := ( v i , { v i , v j }) ∈ A v m ′ .
Towards a contradiction, suppose that ( A , σ ) ⊨ ∃ x 1 … ∃ x k ( ϕ ) (\mathcal{A},\sigma)\models\exists x_1\ldots\exists x_k(\phi) ( A , σ ) ⊨ ∃ x 1 … ∃ x k ( ϕ ) . Since ϕ \phi ϕ is simple, there is an atom of the form P ( v m , x ) ∈ ϕ P(v_m,x)\in\phi P ( v m , x ) ∈ ϕ for some x ∈ X x\in\mathcal{X} x ∈ X and P ∈ τ P\in\tau P ∈ τ or x ∈ X x\in\mathcal{X} x ∈ X and P ∈ τ P\in\tau P ∈ τ , by Definition 5.1(3) and Definition 5.1(2). By the definition of P A P^{\mathcal{A}} P A , we have that ( ( v i , { v i , v j } ) , ( v i , f v i ′ , { v i , v j } , x ) ) ((v_i,\{v_i,v_j\}),(v_i,f'_{v_i},\{v_i,v_j\},x)) (( v i , { v i , v j }) , ( v i , f v i ′ , { v i , v j } , x )) , for some f v i ′ : E v i → { 0 , 1 } f'_{v_i}:E_{v_i}\to\{0,1\} f v i ′ : E v i → { 0 , 1 } having even parity, are the only tuples in P A P^{\mathcal{A}} P A with ( v r , { v j , v r } ) (v_r,\{v_j,v_r\}) ( v r , { v j , v r }) being the first component, see Definition 5.6(2). Furthermore, by Lemma A.1, it follows that each x ∈ X x\in\mathcal{X} x ∈ X must then be witnessed by ( v i , f v i ′ , { v i , v j } , x ) (v_i,f'_{v_i},\{v_i,v_j\},x) ( v i , f v i ′ , { v i , v j } , x ) .
Again, since ϕ \phi ϕ is simple, there exist some T , Q ∈ τ T,Q\in\tau T , Q ∈ τ such that T ( v i , x ℓ ) , Q ( v j , x j ) ∈ ϕ T(v_i,x_\ell),Q(v_j,x_j)\in\phi T ( v i , x ℓ ) , Q ( v j , x j ) ∈ ϕ with x ℓ , x j ∈ X x_\ell,x_j\in\mathcal{X} x ℓ , x j ∈ X . We know that x ℓ x_\ell x ℓ and x j x_j x j are witnessed by ( v i , f v i ′ , { v i , v j } , x ℓ ) (v_i,f'_{v_i},\{v_i,v_j\},x_\ell) ( v i , f v i ′ , { v i , v j } , x ℓ ) and ( v i , f v i ′ , { v i , v j } , x j ) (v_i,f'_{v_i},\{v_i,v_j\},x_j) ( v i , f v i ′ , { v i , v j } , x j ) respectively. Let us now look at T A T^{\mathcal{A}} T A and Q A Q^{\mathcal{A}} Q A :
( ( v i , f v i ) , ( v i , f v i ′ , { v i , v j } , x ℓ ) ) ∈ T A ((v_i,f_{v_i}),(v_i,f'_{v_i},\{v_i,v_j\},x_\ell))\in T^{\mathcal{A}} (( v i , f v i ) , ( v i , f v i ′ , { v i , v j } , x ℓ )) ∈ T A implies f v i ( { v i , v j } ) = f v i ′ ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})=f'_{v_i}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v i ′ ({ v i , v j }) .
( ( v j , f v j ) , ( v i , f v i ′ , { v i , v j } , x j ) ) ∈ Q A ((v_j,f_{v_j}),(v_i,f'_{v_i},\{v_i,v_j\},x_j))\in Q^{\mathcal{A}} (( v j , f v j ) , ( v i , f v i ′ , { v i , v j } , x j )) ∈ Q A implies f v j ( { v i , v j } ) = f v i ′ ( { v i , v j } ) f_{v_j}(\{v_i,v_j\})=f'_{v_i}(\{v_i,v_j\}) f v j ({ v i , v j }) = f v i ′ ({ v i , v j }) .
Both of the above items hold due to Definition 5.6(3). We have thus reached a contradiction since f v i ( { v i , v j } ) ≠ f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})\ne f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) . Thus, if ( r + 1 , σ ) (r+1,\sigma) ( r + 1 , σ ) is a position where Existential played inconsistently and Universal has played consistently, then Universal has a winning strategy.
Combining the two cases (Q i = ∀ Q_i = \forall Q i = ∀ and Q i = ∃ Q_i = \exists Q i = ∃ ) concludes the proof. □
Proof of Lemma 5.11
Proof. We prove this result by establishing Item 1 and Item 2 separately over A \mathcal{A} A , since the proof for B \mathcal{B} B is analogous.
Regarding Item 1: Let ( m + 1 , σ ) (m + 1, \sigma) ( m + 1 , σ ) be a position of the evaluation game where both players have played consistently, but Universal has played dishonestly by choosing σ ( v m ) = ( v r , e ) ∈ A m ′ \sigma(v_m) = (v_r, e) \in A'_m σ ( v m ) = ( v r , e ) ∈ A m ′ with e = { v j , v r } e = \{v_j, v_r\} e = { v j , v r } and j < r j < r j < r , where v r v_r v r is existentially quantified. Since play was consistent, we have that f v r ( e ) = f v j ( e ) f_{v_r}(e) = f_{v_j}(e) f v r ( e ) = f v j ( e ) . Existential now chooses σ ( x ℓ ) = ( v r , f v r , e , x ℓ ) ∈ A x ℓ ′ \sigma(x_\ell) = (v_r, f_{v_r}, e, x_\ell) \in A'_{x_\ell} σ ( x ℓ ) = ( v r , f v r , e , x ℓ ) ∈ A x ℓ ′ for every x ℓ ∈ X x_\ell\in\mathcal{X} x ℓ ∈ X . By Definition 5.5, all R ( x p , x q ) R(x_p, x_q) R ( x p , x q ) -atoms with x p , x q ∈ X x_p, x_q \in\mathcal{X} x p , x q ∈ X are satisfied, and all P ( v , x ) P(v, x) P ( v , x ) -atoms with v ∈ V v \in\mathcal{V} v ∈ V and x ∈ X x \in\mathcal{X} x ∈ X are satisfied due to the following reasoning:
If v = v m v = v_m v = v m , then ( ( v r , e ) , ( v r , f v r , e , x ) ) ∈ P A ((v_r, e), (v_r, f_{v_r}, e, x)) \in P^\mathcal{A} (( v r , e ) , ( v r , f v r , e , x )) ∈ P A from Definition 5.6(2).
If v = v r v = v_r v = v r , then ( ( v r , f v r ) , ( v r , f v r , e , x ) ) ∈ P A ((v_r, f_{v_r}), (v_r, f_{v_r}, e, x)) \in P^\mathcal{A} (( v r , f v r ) , ( v r , f v r , e , x )) ∈ P A from Definition 5.6(3).
If v = v j v = v_j v = v j , then ( ( v j , f v j ) , ( v r , f v r , e , x ) ) ∈ P A ((v_j, f_{v_j}), (v_r, f_{v_r}, e, x)) \in P^\mathcal{A} (( v j , f v j ) , ( v r , f v r , e , x )) ∈ P A from Definition 5.6(3) along with the fact that the functions for σ ( x ℓ ) \sigma(x_\ell) σ ( x ℓ ) and σ ( v ) \sigma(v) σ ( v ) agree on e e e ; that is, f v j ( e ) = f v r ( e ) f_{v_j}(e) = f_{v_r}(e) f v j ( e ) = f v r ( e ) .
Otherwise, ( ( v , f v ) , ( v r , f v r , e , x ) ) ∈ P A ((v, f_v), (v_r, f_{v_r}, e, x)) \in P^\mathcal{A} (( v , f v ) , ( v r , f v r , e , x )) ∈ P A , with σ ( v ) = ( v , f v ) \sigma(v) = (v, f_v) σ ( v ) = ( v , f v ) , follows from Definition 5.6(3) along with the fact that e ≠ { v , v r } e \ne\{v, v_r\} e = { v , v r } and v ≠ v r v \ne v_r v = v r .
Hence, every atom of ϕ \phi ϕ is satisfied by the resulting assignment σ \sigma σ . Thus, ( A , σ ) ⊨ v a r ϕ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \phi ( A , σ ) ⊨ var ϕ , and Existential has a winning strategy from the position ( m + 1 , σ ) (m + 1, \sigma) ( m + 1 , σ ) .
Regarding Item 2: Let ( m + ℓ + 1 , σ ) (m + \ell+ 1, \sigma) ( m + ℓ + 1 , σ ) be a position of the game, where ℓ ∈ [ k ] \ell\in[k] ℓ ∈ [ k ] , such that both players have played consistently in the first m m m rounds, Universal has played honestly, but Existential has played dishonestly, that is, σ ( x ℓ ) = ( v r , f v r ′ , { v j , v r } , x ℓ ) ∈ A x ℓ ′ \sigma(x_\ell) = (v_r, f'_{v_r}, \{v_j, v_r\}, x_\ell) \in A'_{x_\ell} σ ( x ℓ ) = ( v r , f v r ′ , { v j , v r } , x ℓ ) ∈ A x ℓ ′ , for some j < r j < r j < r . Notice by Lemma A.1, it holds that Existential must pick σ ( x ) = ( v r , f v r ′ , { v j , v r } , x ) \sigma(x) = (v_r, f'_{v_r}, \{v_j, v_r\}, x) σ ( x ) = ( v r , f v r ′ , { v j , v r } , x ) for each x ∈ X x \in\mathcal{X} x ∈ X to have any chance of winning.
Let σ : Z → A \sigma: \mathcal{Z} \to A σ : Z → A be the resulting assignment here. We now show that assuming ( A , σ ) ⊨ v a r ϕ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \phi ( A , σ ) ⊨ var ϕ results in a contradiction: Consider the atom P ( v m , x ) ∈ ϕ P(v_m, x) \in\phi P ( v m , x ) ∈ ϕ for some x ∈ X x \in\mathcal{X} x ∈ X which must exist due to the fact that φ \varphi φ is simple; see Definition 5.1(3) and Definition 5.1(2). By our assumption that ( A , σ ) ⊨ v a r ϕ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \phi ( A , σ ) ⊨ var ϕ , it must hold that ( ( v m , f v m ) , ( v r , f v r ′ , { v j , v r } , x ) ) ∈ P A ((v_m, f_{v_m}), (v_r, f'_{v_r}, \{v_j, v_r\}, x)) \in P^\mathcal{A} (( v m , f v m ) , ( v r , f v r ′ , { v j , v r } , x )) ∈ P A . By Definition 5.6, this only holds when v r v_r v r is universally quantified since there are no tuples with ( a , ( v r , f v r ′ , { v j , v r } , x ) ) ∈ P A (a, (v_r, f'_{v_r}, \{v_j, v_r\}, x)) \in P^\mathcal{A} ( a , ( v r , f v r ′ , { v j , v r } , x )) ∈ P A with a ∈ F v m a \in F_{v_m} a ∈ F v m and v r v_r v r being existentially quantified.
Now consider the atoms T ( v r , x ) T(v_r, x) T ( v r , x ) and Q ( v j , x ′ ) Q(v_j, x') Q ( v j , x ′ ) , for some x , x ′ ∈ X x, x' \in\mathcal{X} x , x ′ ∈ X and T , Q ∈ τ T, Q \in\tau T , Q ∈ τ , which again must appear in ϕ \phi ϕ since φ \varphi φ is simple. We have that σ ( v r ) = ( v r , f v r ) \sigma(v_r) = (v_r, f_{v_r}) σ ( v r ) = ( v r , f v r ) , σ ( v j ) = ( v j , f v j ) \sigma(v_j) = (v_j, f_{v_j}) σ ( v j ) = ( v j , f v j ) , and σ ( x ) = ( v r , f v r ′ , { v j , v r } , x ) \sigma(x) = (v_r, f'_{v_r}, \{v_j, v_r\}, x) σ ( x ) = ( v r , f v r ′ , { v j , v r } , x ) for each x ∈ X x \in\mathcal{X} x ∈ X . Since ( A , σ ) ⊨ v a r ϕ (\mathcal{A}, \sigma) \models_{\mathrm{var}} \phi ( A , σ ) ⊨ var ϕ it follows
( ( v r , f v r ) , ( v r , f v r ′ , { v j , v r } , x ) ) ∈ T A ((v_r, f_{v_r}), (v_r, f'_{v_r}, \{v_j, v_r\}, x)) \in T^\mathcal{A} (( v r , f v r ) , ( v r , f v r ′ , { v j , v r } , x )) ∈ T A which implies f v r = f v r ′ f_{v_r} = f'_{v_r} f v r = f v r ′ ; see Definition 5.6(4).
( ( v j , f v j ) , ( v r , f v r ′ , { v j , v r } , x ) ) ∈ Q A ((v_j, f_{v_j}), (v_r, f'_{v_r}, \{v_j, v_r\}, x)) \in Q^\mathcal{A} (( v j , f v j ) , ( v r , f v r ′ , { v j , v r } , x )) ∈ Q A which implies f v j ( { v j , v r } ) ≠ f v r ( { v j , v r } ) f_{v_j}(\{v_j, v_r\}) \ne f_{v_r}(\{v_j, v_r\}) f v j ({ v j , v r }) = f v r ({ v j , v r }) ; see Definition 5.6(4).
However, we know that both players played consistently which means f v r ( { v j , v r } ) = f v j ( { v j , v r } ) f_{v_r}(\{v_j, v_r\}) = f_{v_j}(\{v_j, v_r\}) f v r ({ v j , v r }) = f v j ({ v j , v r }) . Thus, we have reached a contradiction. □
Proof of Lemma 5.12
Let us state the following well-known graph theory result, see Section 16.4 of [7 ] for example.
Lemma A.2. Let G : = ( V , E ) G := (V, E) G := ( V , E ) be a connected graph and let K ⊆ V K \subseteq V K ⊆ V such that ∣ K ∣ |K| ∣ K ∣ is even. Then, there exists a subgraph of G G G where every vertex in K K K has odd degree, and every other vertex has even degree.
Let us now give the actual proof of Lemma 5.12.
Proof. Recall that
φ : = Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 … ∃ x k ( ϕ ) . \varphi:= Q_1v_1 Q_2v_2 \cdots Q_{m-1}v_{m-1}\ \forall v_m\exists x_1\ldots\exists x_k(\phi). φ := Q 1 v 1 Q 2 v 2 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 … ∃ x k ( ϕ ) .
Fix ( m + 1 , σ ) (m+1,\sigma) ( m + 1 , σ ) to be a position of the evaluation game where both players play consistently and Universal plays honestly. That is, σ ( v i ) = ( v i , f v i ) ∈ F v i \sigma(v_i)=(v_i,f_{v_i})\in\mathcal{F}_{v_i} σ ( v i ) = ( v i , f v i ) ∈ F v i for 1 ≤ i ≤ m 1\leq i\leq m 1 ≤ i ≤ m , and f v i ( { v i , v j } ) = f v j ( { v i , v j } ) f_{v_i}(\{v_i,v_j\})=f_{v_j}(\{v_i,v_j\}) f v i ({ v i , v j }) = f v j ({ v i , v j }) for each 1 ≤ i < j ≤ m 1\leq i<j\leq m 1 ≤ i < j ≤ m . We show that Existential has a winning strategy from this position for A \mathcal{A} A , and Universal has a winning strategy from this position for B \mathcal{B} B .
**Regarding A ⊨ v a r φ \mathcal{A}\models_{\mathrm{var}}\varphi A ⊨ var φ :} Recall that σ ( v m ) = ( v m , f v m ) ∈ F v m \sigma(v_m)=(v_m,f_{v_m})\in\mathcal{F}_{v_m} σ ( v m ) = ( v m , f v m ) ∈ F v m and
f v i ( { v i , v j } ) = f v j ( { v i , v j } ) for all 1 ≤ j < i ≤ m , f_{v_i}(\{v_i,v_j\})=f_{v_j}(\{v_i,v_j\})\qquad\text{for all}\qquad1\leq j<i\leq m, f v i ({ v i , v j }) = f v j ({ v i , v j }) for all 1 ≤ j < i ≤ m ,
since both players have played consistently and Universal has played honestly. Let
S : = { x ∈ X | ∑ v i ∈ V ∩ N G θ ( x ) f v i ( { v i , x } ) ≡ 1 ( m o d 2 ) } , S:=\left\{x\in\mathcal{X}\ \middle|\ \sum_{v_i\in\mathcal{V}\cap N_{G_\theta}(x)}f_{v_i}(\{v_i,x\})\equiv1\pmod2\right\}, S := ⎩ ⎨ ⎧ x ∈ X v i ∈ V ∩ N G θ ( x ) ∑ f v i ({ v i , x }) ≡ 1 ( mod 2 ) ⎭ ⎬ ⎫ ,
where N G θ ( x ) N_{G_\theta}(x) N G θ ( x ) denotes the neighborhood of x x x in the primal graph G θ G_\theta G θ .
Let us establish that ∣ S ∣ |S| ∣ S ∣ is even: Since f v i f_{v_i} f v i has even parity for every v i ∈ V v_i\in\mathcal{V} v i ∈ V , we have
∑ v i ∈ V ∑ e ∈ E v i f v i ( e ) ≡ 0 ( m o d 2 ) . \sum_{v_i\in\mathcal{V}}\sum_{e\in E_{v_i}}f_{v_i}(e)\equiv0\pmod2. v i ∈ V ∑ e ∈ E v i ∑ f v i ( e ) ≡ 0 ( mod 2 ) .
For each edge { v i , v j } ∈ ( V 2 ) \{v_i,v_j\}\in\binom{\mathcal{V}}{2} { v i , v j } ∈ ( 2 V ) , set b v i , v j : = f v i ( { v i , v j } ) b_{v_i,v_j}:=f_{v_i}(\{v_i,v_j\}) b v i , v j := f v i ({ v i , v j }) . Notice that b v i , v j = f v j ( { v i , v j } ) b_{v_i,v_j}=f_{v_j}(\{v_i,v_j\}) b v i , v j = f v j ({ v i , v j }) since both players have played consistently. It follows that
∑ v i ∈ V ∑ e ∈ E v i f v i ( e ) ≡ ∑ { v i , v j } ∈ ( V 2 ) 2 b v i , v j + ∑ x ∈ X ∑ v i ∈ V ∩ N G θ ( x ) f v i ( { v i , x } ) ( m o d 2 ) . \sum_{v_i\in\mathcal{V}}\sum_{e\in E_{v_i}}f_{v_i}(e)\equiv\sum_{\{v_i,v_j\}\in\binom{\mathcal{V}}{2}}2b_{v_i,v_j}+\sum_{x\in\mathcal{X}}\sum_{v_i\in\mathcal{V}\cap N_{G_\theta}(x)}f_{v_i}(\{v_i,x\})\pmod2. v i ∈ V ∑ e ∈ E v i ∑ f v i ( e ) ≡ { v i , v j } ∈ ( 2 V ) ∑ 2 b v i , v j + x ∈ X ∑ v i ∈ V ∩ N G θ ( x ) ∑ f v i ({ v i , x }) ( mod 2 ) .
By the definition of S S S , for any x ∈ X x\in\mathcal{X} x ∈ X we have that
∑ v i ∈ V ∩ N G θ ( x ) f v i ( { v i , x } ) ≡ 1 ( m o d 2 ) ⟺ x ∈ S . \sum_{v_i\in\mathcal{V}\cap N_{G_\theta}(x)}f_{v_i}(\{v_i,x\})\equiv1\pmod2\qquad\Longleftrightarrow\qquad x\in S. v i ∈ V ∩ N G θ ( x ) ∑ f v i ({ v i , x }) ≡ 1 ( mod 2 ) ⟺ x ∈ S .
Furthermore, it is immediate that ∑ { v i , v j } ∈ ( V 2 ) 2 b v i , v j ≡ 0 ( m o d 2 ) \sum_{\{v_i,v_j\}\in\binom{\mathcal{V}}{2}}2b_{v_i,v_j}\equiv0\pmod2 ∑ { v i , v j } ∈ ( 2 V ) 2 b v i , v j ≡ 0 ( mod 2 ) . Therefore,
0 ≡ ∑ v i ∈ V ∑ e ∈ E v i f v i ( e ) ≡ ∣ S ∣ ( m o d 2 ) . 0\equiv\sum_{v_i\in\mathcal{V}}\sum_{e\in E_{v_i}}f_{v_i}(e)\equiv|S|\pmod2. 0 ≡ v i ∈ V ∑ e ∈ E v i ∑ f v i ( e ) ≡ ∣ S ∣ ( mod 2 ) .
Since ∣ S ∣ |S| ∣ S ∣ is even and G θ ∣ X G_\theta|_{\mathcal{X}} G θ ∣ X is connected (by Definition 5.1(2)), we may apply Lemma A.2 to obtain a subgraph H : = ( V ( H ) , E ( H ) ) H:=(V(H),E(H)) H := ( V ( H ) , E ( H )) of G θ ∣ X G_\theta|_{\mathcal{X}} G θ ∣ X whose set of odd-degree vertices is exactly S S S . For each x i ∈ X x_i\in\mathcal{X} x i ∈ X , define a function f x i : E x i → { 0 , 1 } f_{x_i}:E_{x_i}\to\{0,1\} f x i : E x i → { 0 , 1 } by:
for every { x i , x j } ∈ E θ \{x_i,x_j\}\in E_\theta { x i , x j } ∈ E θ with x j ∈ X x_j\in\mathcal{X} x j ∈ X , set f x i ( { x i , x j } ) = 1 f_{x_i}(\{x_i,x_j\})=1 f x i ({ x i , x j }) = 1 iff { x i , x j } ∈ E ( H ) \{x_i,x_j\}\in E(H) { x i , x j } ∈ E ( H ) .
for every { v ℓ , x i } ∈ E θ \{v_\ell,x_i\}\in E_\theta { v ℓ , x i } ∈ E θ with v ℓ ∈ V v_\ell\in\mathcal{V} v ℓ ∈ V , set f x i ( { v ℓ , x i } ) = f v ℓ ( { v ℓ , x i } ) f_{x_i}(\{v_\ell,x_i\})=f_{v_\ell}(\{v_\ell,x_i\}) f x i ({ v ℓ , x i }) = f v ℓ ({ v ℓ , x i }) .
We claim that each f x i f_{x_i} f x i has even parity. The degree of x i x_i x i in H H H , which we will denote by deg H ( x i ) \deg_H(x_i) deg H ( x i ) , is odd if and only if x i ∈ S x_i\in S x i ∈ S . Moreover,
∑ v ℓ ∈ V ∩ N G θ ( x i ) f x i ( { v ℓ , x i } ) = ∑ v ℓ ∈ V ∩ N G θ ( x i ) f v ℓ ( { v ℓ , x i } ) , \sum_{v_\ell\in\mathcal{V}\cap N_{G_\theta}(x_i)}f_{x_i}(\{v_\ell,x_i\})=\sum_{v_\ell\in\mathcal{V}\cap N_{G_\theta}(x_i)}f_{v_\ell}(\{v_\ell,x_i\}), v ℓ ∈ V ∩ N G θ ( x i ) ∑ f x i ({ v ℓ , x i }) = v ℓ ∈ V ∩ N G θ ( x i ) ∑ f v ℓ ({ v ℓ , x i }) ,
by the definition of f x i f_{x_i} f x i , which is also odd iff x i ∈ S x_i\in S x i ∈ S by definition of S S S . Therefore,
∑ e ∈ E x i f x i ( e ) ≡ deg H ( x i ) + ∑ v ℓ ∈ V ∩ N G θ ( x i ) f v ℓ ( { v ℓ , x i } ) ≡ 0 ( m o d 2 ) \sum_{e\in E_{x_i}}f_{x_i}(e)\equiv\deg_H(x_i)+\sum_{v_\ell\in\mathcal{V}\cap N_{G_\theta}(x_i)}f_{v_\ell}(\{v_\ell,x_i\})\equiv0\pmod2 e ∈ E x i ∑ f x i ( e ) ≡ deg H ( x i ) + v ℓ ∈ V ∩ N G θ ( x i ) ∑ f v ℓ ({ v ℓ , x i }) ≡ 0 ( mod 2 )
and so ( x i , f x i ) ∈ F x i (x_i,f_{x_i})\in\mathcal{F}_{x_i} ( x i , f x i ) ∈ F x i for all i ∈ [ k ] i\in[k] i ∈ [ k ] .
Now define an assignment σ ′ : Z → A \sigma' : \mathcal{Z} \to\mathcal{A} σ ′ : Z → A by letting σ ′ ( v i ) = σ ( v i ) \sigma'(v_i) = \sigma(v_i) σ ′ ( v i ) = σ ( v i ) for all v i ∈ V v_i \in V v i ∈ V and σ ′ ( x i ) = ( x i , f x i ) \sigma'(x_i) = (x_i,f_{x_i}) σ ′ ( x i ) = ( x i , f x i ) for all x i ∈ X x_i \in X x i ∈ X . We show that ( A , σ ′ ) ⊨ v a r ϕ (\mathcal{A},\sigma') \models_{\mathrm{var}} \phi ( A , σ ′ ) ⊨ var ϕ . Let Q ( z , z ′ ) Q(z,z') Q ( z , z ′ ) be any atom of ϕ \phi ϕ . Since the query is simple, Q ( z , z ′ ) Q(z,z') Q ( z , z ′ ) is either of the form R ( x i , x j ) R(x_i,x_j) R ( x i , x j ) for some x i , x j ∈ X x_i,x_j \in X x i , x j ∈ X and R ∈ τ R \in\tau R ∈ τ , or it is of the form P ( v r , x i ) P(v_r,x_i) P ( v r , x i ) for some v r ∈ V v_r \in V v r ∈ V , x i ∈ X x_i \in X x i ∈ X and P ∈ τ P \in\tau P ∈ τ . In the first case, by the construction of f x i f_{x_i} f x i , we have
f x i ( { x i , x j } ) = f x j ( { x i , x j } ) , f_{x_i}(\{x_i,x_j\}) = f_{x_j}(\{x_i,x_j\}), f x i ({ x i , x j }) = f x j ({ x i , x j }) ,
hence ( ( x i , f x i ) , ( x j , f x j ) ) ∈ R A ((x_i,f_{x_i}),(x_j,f_{x_j})) \in R^{\mathcal{A}} (( x i , f x i ) , ( x j , f x j )) ∈ R A . In the second case, by construction
f v r ( { v r , x i } ) = f x i ( { v r , x i } ) , f_{v_r}(\{v_r,x_i\}) = f_{x_i}(\{v_r,x_i\}), f v r ({ v r , x i }) = f x i ({ v r , x i }) ,
and so ( ( v r , f v r ) , ( x i , f x i ) ) ∈ P A ((v_r,f_{v_r}),(x_i,f_{x_i})) \in P^{\mathcal{A}} (( v r , f v r ) , ( x i , f x i )) ∈ P A . Thus every atom of ϕ \phi ϕ is satisfied under σ ′ \sigma' σ ′ , i.e. ( A , σ ′ ) ⊨ v a r ϕ (\mathcal{A},\sigma') \models_{\mathrm{var}} \phi ( A , σ ′ ) ⊨ var ϕ , and hence ( A , σ ) ⊨ v a r ∃ x 1 ⋯ ∃ x k ( ϕ ) (\mathcal{A},\sigma) \models_{\mathrm{var}} \exists x_1 \cdots\exists x_k(\phi) ( A , σ ) ⊨ var ∃ x 1 ⋯ ∃ x k ( ϕ ) .
**Regarding B ̸ ⊨ v a r φ : ∗ ∗ T o w a r d s a c o n t r a d i c t i o n , s u p p o s e t h a t E x i s t e n t i a l h a s a w i n n i n g s t r a t e g y f r o m \mathcal{B} \not\models_{\mathrm{var}} \varphi:** Towards a contradiction, suppose that Existential has a winning strategy from B ⊨ var φ : ∗ ∗ T o w a r d s a co n t r a d i c t i o n , s u pp ose t ha tE x i s t e n t ia l ha s a w innin g s t r a t e g y f r o m (m+1,\sigma)$. Let σ ′ \sigma' σ ′ be the final position such that ( B , σ ′ ) ⊨ v a r ϕ (\mathcal{B},\sigma') \models_{\mathrm{var}} \phi ( B , σ ′ ) ⊨ var ϕ where both players have played consistently and honestly. Thus σ ′ ( z ) = ( z , f z ) ∈ F ′ \sigma'(z)=(z,f_z) \in F' σ ′ ( z ) = ( z , f z ) ∈ F ′ for all z ∈ Z z \in\mathcal{Z} z ∈ Z . Furthermore, for any z , z ′ ∈ Z z,z' \in\mathcal{Z} z , z ′ ∈ Z where { z , z ′ } \{z,z'\} { z , z ′ } is an edge of G θ G_\theta G θ , we have that f z ( { z , z ′ } ) = f z ′ ( { z , z ′ } ) f_z(\{z,z'\})=f_{z'}(\{z,z'\}) f z ({ z , z ′ }) = f z ′ ({ z , z ′ }) ; otherwise ( σ ′ ( z ) , σ ′ ( z ′ ) ) ∉ T B (\sigma'(z),\sigma'(z')) \notin T^{\mathcal{B}} ( σ ′ ( z ) , σ ′ ( z ′ )) ∈ / T B where T ∈ τ T \in\tau T ∈ τ with ar ( T ) = z z ′ \operatorname{ar}(T)=zz' ar ( T ) = z z ′ ; recall Definition 5.5 and Definition 5.6 . By definition, we have that
∑ e ∈ E z f z ( e ) ≡ { 1 ( m o d 2 ) , if z = s , 0 ( m o d 2 ) , otherwise . \sum_{e\in E_z} f_z(e) \equiv
\begin{cases}
1 \pmod{2}, & \text{if } z=s,\\
0 \pmod{2}, & \text{otherwise}.
\end{cases} e ∈ E z ∑ f z ( e ) ≡ { 1 ( mod 2 ) , 0 ( mod 2 ) , if z = s , otherwise .
Letting b z , z ′ : = f z ( { z , z ′ } ) = f z ′ ( { z , z ′ } ) b_{z,z'} := f_z(\{z,z'\})=f_{z'}(\{z,z'\}) b z , z ′ := f z ({ z , z ′ }) = f z ′ ({ z , z ′ }) for any { z , z ′ } ∈ E θ \{z,z'\} \in E_\theta { z , z ′ } ∈ E θ , we get
1 ≡ ∑ e ∈ E s f s ( e ) + ∑ z ∈ Z ∖ { s } ∑ e ∈ E z f z ( e ) = ∑ { z , z ′ } ∈ E θ 2 ⋅ b z , z ′ ≡ 0 ( m o d 2 ) 1 \equiv\sum_{e\in E_s} f_s(e) + \sum_{z\in\mathcal{Z}\setminus\{s\}}\sum_{e\in E_z} f_z(e) = \sum_{\{z,z'\}\in E_\theta} 2\cdot b_{z,z'} \equiv0 \pmod{2} 1 ≡ e ∈ E s ∑ f s ( e ) + z ∈ Z ∖ { s } ∑ e ∈ E z ∑ f z ( e ) = { z , z ′ } ∈ E θ ∑ 2 ⋅ b z , z ′ ≡ 0 ( mod 2 )
and thus gives us the desired contradiction. □
Proof of lemma:partial-iso
Proof. Let h h h be the mapping Ψ W \Psi_W Ψ W restricted to { a 1 , … , a i } \{a_1,\ldots,a_i\} { a 1 , … , a i } and fix b ℓ : = h ( a ℓ ) b_\ell:= h(a_\ell) b ℓ := h ( a ℓ ) for each ℓ ∈ [ i ] \ell\in[i] ℓ ∈ [ i ] . We first establish the following claim:
Claim 1. h h h is an injective partial mapping from A A A to B B B .
Proof of Claim. First, we show that b ℓ ∈ B b_\ell\in B b ℓ ∈ B for those ℓ ∈ [ i ] \ell\in[i] ℓ ∈ [ i ] where a ℓ ∉ A ν m ′ a_\ell\notin A'_{\nu_m} a ℓ ∈ / A ν m ′ ; the case where a ℓ ∈ A ν m ′ a_\ell\in A'_{\nu_m} a ℓ ∈ A ν m ′ is obvious since B ν m ′ = A ν m ′ B'_{\nu_m}=A'_{\nu_m} B ν m ′ = A ν m ′ . We distinguish between two cases:
Case 1, π 1 ( a ℓ ) = s \pi_1(a_\ell)=s π 1 ( a ℓ ) = s : For this case, we have that ∑ e ∈ E s occ W ( e ) ≡ 1 ( m o d 2 ) \sum_{e\in E_s}\operatorname{occ}_W(e)\equiv1\pmod{2} ∑ e ∈ E s occ W ( e ) ≡ 1 ( mod 2 ) since W W W starts at s s s , ends at t ≠ s t\ne s t = s , and G θ G_\theta G θ does not contain self-loops. Notice that a ℓ a_\ell a ℓ is of the form ( s , f s ) (s,f_s) ( s , f s ) where f s : E s → { 0 , 1 } f_s:E_s\to\{0,1\} f s : E s → { 0 , 1 } such that ∑ e ∈ E s f s ( e ) ≡ 0 ( m o d 2 ) \sum_{e\in E_s}f_s(e)\equiv0\pmod{2} ∑ e ∈ E s f s ( e ) ≡ 0 ( mod 2 ) because these tuples ( s , f s ) (s,f_s) ( s , f s ) are the only elements of A A A where the first component is s s s . Consequently, we have that ∑ e ∈ E s f s W ( e ) ≡ 1 ( m o d 2 ) \sum_{e\in E_s}f_s^W(e)\equiv1\pmod{2} ∑ e ∈ E s f s W ( e ) ≡ 1 ( mod 2 ) and thus b ℓ = ( s , f s W ) ∈ B b_\ell=(s,f_s^W)\in B b ℓ = ( s , f s W ) ∈ B .
Case 2, π 1 ( a ℓ ) ≠ s \pi_1(a_\ell)\ne s π 1 ( a ℓ ) = s : Let π 1 ( a ℓ ) = z \pi_1(a_\ell)=z π 1 ( a ℓ ) = z for some z ∈ Z z\in\mathcal{Z} z ∈ Z . We have that ∑ e ∈ E z occ W ( e ) ≡ 0 ( m o d 2 ) \sum_{e\in E_z}\operatorname{occ}_W(e)\equiv0\pmod{2} ∑ e ∈ E z occ W ( e ) ≡ 0 ( mod 2 ) since the walk W W W does not start or end at z z z , and G θ G_\theta G θ does not contain self-loops. Thus, ∑ e ∈ E z π 2 ( a ℓ ) W ( e ) ≡ 0 ( m o d 2 ) \sum_{e\in E_z}\pi_2(a_\ell)^W(e)\equiv0\pmod{2} ∑ e ∈ E z π 2 ( a ℓ ) W ( e ) ≡ 0 ( mod 2 ) which means that b ℓ ∈ B b_\ell\in B b ℓ ∈ B by definition.
We have now established that h h h is indeed a partial mapping from A A A to B B B and it is clear by definition that h h h is injective. Furthermore, h h h clearly respects the sorts. ◁
All that remains is to establish the following claim:
Claim 2. For any j , ℓ ∈ [ i ] j,\ell\in[i] j , ℓ ∈ [ i ] and any relation symbol T ∈ τ T\in\tau T ∈ τ , we have that
( a j , a ℓ ) ∈ T A ⟺ ( h ( a j ) , h ( a ℓ ) ) ∈ T B . (a_j,a_\ell)\in T^{\mathcal{A}} \Longleftrightarrow(h(a_j),h(a_\ell))\in T^{\mathcal{B}}. ( a j , a ℓ ) ∈ T A ⟺ ( h ( a j ) , h ( a ℓ )) ∈ T B .
Let j , ℓ ∈ [ i ] j,\ell\in[i] j , ℓ ∈ [ i ] be arbitrary but fixed values, and let T ∈ τ T\in\tau T ∈ τ be an arbitrary but fixed relation symbol. We prove the above claim for two cases:
Case 1, a j , a ℓ ∉ A ν m ′ a_j,a_\ell\notin A'_{\nu_m} a j , a ℓ ∈ / A ν m ′ : It immediately follows that b j , b ℓ ∉ B ν m ′ b_j,b_\ell\notin B'_{\nu_m} b j , b ℓ ∈ / B ν m ′ . To ease some notation, let
z j = π 1 ( a j ) z_j = \pi_1(a_j) z j = π 1 ( a j ) and f j = π 2 ( a j ) f_j = \pi_2(a_j) f j = π 2 ( a j ) ,
z ℓ = π 1 ( a ℓ ) z_\ell= \pi_1(a_\ell) z ℓ = π 1 ( a ℓ ) and f ℓ = π 2 ( a ℓ ) f_\ell= \pi_2(a_\ell) f ℓ = π 2 ( a ℓ ) ,
z j ′ = π 1 ( b j ) z'_j = \pi_1(b_j) z j ′ = π 1 ( b j ) and f j ′ = π 2 ( b j ) f'_j = \pi_2(b_j) f j ′ = π 2 ( b j ) , and
z ℓ ′ = π 1 ( b ℓ ) z'_\ell= \pi_1(b_\ell) z ℓ ′ = π 1 ( b ℓ ) and f ℓ ′ = π 2 ( b ℓ ) f'_\ell= \pi_2(b_\ell) f ℓ ′ = π 2 ( b ℓ ) .
Note that by Definition 5.5 and Definition 5.6, if
f j ( e ) = f ℓ ( e ) ⟺ f j ′ ( e ) = f ℓ ′ ( e ) . f_j(e) = f_\ell(e) \iff f'_j(e) = f'_\ell(e). f j ( e ) = f ℓ ( e ) ⟺ f j ′ ( e ) = f ℓ ′ ( e ) .
for any e ∈ dom ( f j ) ∩ dom ( f ℓ ) e \in\operatorname{dom}(f_j) \cap\operatorname{dom}(f_\ell) e ∈ dom ( f j ) ∩ dom ( f ℓ ) , then
( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B (a_j, a_\ell) \in T^{\mathcal{A}} \iff(b_j, b_\ell) \in T^{\mathcal{B}} ( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B
for any T ∈ τ T \in\tau T ∈ τ . For some intuition as to why this holds, the only difference between a j a_j a j and b j b_j b j (as well as a ℓ a_\ell a ℓ and b ℓ b_\ell b ℓ ) is that we have swapped out f j f_j f j with f j ′ f'_j f j ′ (respectively, f ℓ f_\ell f ℓ with f ℓ ′ f'_\ell f ℓ ′ ). Therefore, the truth values for the antecedents of the conditional definitions in Definition 5.6, such as Definition 5.6(4), remain unchanged.
( ⇒ ) (\Rightarrow) ( ⇒ ) Assume f j ( e ) = f ℓ ( e ) f_j(e) = f_\ell(e) f j ( e ) = f ℓ ( e ) . By definition, there is a walk W W W from s s s to avoidM ( { π 1 ( a 1 ) , … , π 1 ( a i ) } ) _{\mathcal{M}}(\{\pi_1(a_1), \ldots, \pi_1(a_i)\}) M ({ π 1 ( a 1 ) , … , π 1 ( a i )}) such that
f j ′ ( e ) ≡ f j ( e ) + occ W ( e ) ( m o d 2 ) , f'_j(e) \equiv f_j(e) + \operatorname{occ}_W(e) \pmod{2}, f j ′ ( e ) ≡ f j ( e ) + occ W ( e ) ( mod 2 ) ,
f ℓ ′ ( e ) ≡ f ℓ ( e ) + occ W ( e ) ( m o d 2 ) f'_\ell(e) \equiv f_\ell(e) + \operatorname{occ}_W(e) \pmod{2} f ℓ ′ ( e ) ≡ f ℓ ( e ) + occ W ( e ) ( mod 2 )
for any edge e ∈ E θ e \in E_\theta e ∈ E θ . Thus, it follows that f j ′ ( e ) = f ℓ ′ ( e ) f'_j(e) = f'_\ell(e) f j ′ ( e ) = f ℓ ′ ( e ) .
( ⇐ ) (\Leftarrow) ( ⇐ ) Assume f j ′ ( e ) = f ℓ ′ ( e ) f'_j(e) = f'_\ell(e) f j ′ ( e ) = f ℓ ′ ( e ) . Similarly, we have a walk W W W from s s s to avoidM ( π 1 ( a 1 ) , … , π 1 ( a i ) ) _{\mathcal{M}}(\pi_1(a_1), \ldots, \pi_1(a_i)) M ( π 1 ( a 1 ) , … , π 1 ( a i )) such that
f j ( e ) ≡ f j ′ ( e ) − occ W ( e ) ( m o d 2 ) , f_j(e) \equiv f'_j(e) - \operatorname{occ}_W(e) \pmod{2}, f j ( e ) ≡ f j ′ ( e ) − occ W ( e ) ( mod 2 ) ,
f ℓ ( e ) ≡ f ℓ ′ ( e ) − occ W ( e ) ( m o d 2 ) f_\ell(e) \equiv f'_\ell(e) - \operatorname{occ}_W(e) \pmod{2} f ℓ ( e ) ≡ f ℓ ′ ( e ) − occ W ( e ) ( mod 2 )
for any edge e ∈ E θ e \in E_\theta e ∈ E θ . Thus, it follows that f j ( e ) = f ℓ ( e ) f_j(e) = f_\ell(e) f j ( e ) = f ℓ ( e ) .
Due to the fact that v j = v j ′ v_j = v'_j v j = v j ′ and v ℓ = v ℓ ′ v_\ell= v'_\ell v ℓ = v ℓ ′ and moreover, if π 3 ( a j ) \pi_3(a_j) π 3 ( a j ) or π 4 ( a j ) \pi_4(a_j) π 4 ( a j ) is defined, then π 3 ( a j ) = π 3 ( b j ) \pi_3(a_j) = \pi_3(b_j) π 3 ( a j ) = π 3 ( b j ) and π 4 ( a j ) = π 4 ( b j ) \pi_4(a_j) = \pi_4(b_j) π 4 ( a j ) = π 4 ( b j ) it follows (from the definition of the interpretation of relations in A \mathcal{A} A and B \mathcal{B} B )
( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B . (a_j, a_\ell) \in T^{\mathcal{A}} \iff(b_j, b_\ell) \in T^{\mathcal{B}}. ( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B .
Thus, we are done for this case.
Case 2, a j ∈ A v m ′ a_j \in A'_{v_m} a j ∈ A v m ′ or a ℓ ∈ A v m ′ a_\ell\in A'_{v_m} a ℓ ∈ A v m ′ . Suppose first that a j ∈ A v m ′ a_j \in A'_{v_m} a j ∈ A v m ′ . By definition of the mapping h h h , we have b j = a j b_j = a_j b j = a j , since elements of A v m ′ A'_{v_m} A v m ′ are left unchanged. Thus, it suffices to show that for every a ℓ a_\ell a ℓ and every relation symbol T ∈ τ T \in\tau T ∈ τ ,
( a j , a ℓ ) ∈ T A ⟺ ( a j , b ℓ ) ∈ T B . (a_j, a_\ell) \in T^{\mathcal{A}} \iff(a_j, b_\ell) \in T^{\mathcal{B}}. ( a j , a ℓ ) ∈ T A ⟺ ( a j , b ℓ ) ∈ T B .
By construction of the structures, elements of A v m ′ A'_{v_m} A v m ′ can only appear as the first component of some relation P A P^{\mathcal{A}} P A where P ( v m , x i ) P(v_m,x_i) P ( v m , x i ) occurs in ϕ \phi ϕ . More precisely, if a j = ( v r , e ) ∈ A v m ′ a_j = (v_r,e) \in A'_{v_m} a j = ( v r , e ) ∈ A v m ′ , then ( ( v r , e ) , ( v r , f v r , e , x i ) ) ∈ P A ((v_r,e),(v_r,f_{v_r,e},x_i)) \in P^{\mathcal{A}} (( v r , e ) , ( v r , f v r , e , x i )) ∈ P A by Definition 5.6(2), and no other tuples in P A P^{\mathcal{A}} P A have first component ( v r , e ) (v_r,e) ( v r , e ) . The same holds in B \mathcal{B} B , since the interpretation of P P P is defined analogously.
Hence, ( a j , a ℓ ) ∈ P A (a_j,a_\ell) \in P^{\mathcal{A}} ( a j , a ℓ ) ∈ P A if and only if a ℓ a_\ell a ℓ is some ( v r , f v r , e , x i ) ∈ A x i ′ (v_r,f_{v_r,e},x_i) \in A'_{x_i} ( v r , f v r , e , x i ) ∈ A x i ′ for some x i ∈ X x_i \in\mathcal{X} x i ∈ X . By the definition of h h h , we have that h ( ( v r , f v r , e , x i ) ) = ( v r , f v r , e W , x i ) h((v_r,f_{v_r,e},x_i)) = (v_r,f^W_{v_r,e},x_i) h (( v r , f v r , e , x i )) = ( v r , f v r , e W , x i ) and thus we immediately have that ( a j , ( v r , f v r , e W , x i ) ) ∈ P B (a_j,(v_r,f^W_{v_r,e},x_i)) \in P^{\mathcal{B}} ( a j , ( v r , f v r , e W , x i )) ∈ P B by Definition 5.6(2). Likewise, if ( h ( a j ) , h ( a ℓ ) ) ∈ P B (h(a_j),h(a_\ell)) \in P^{\mathcal{B}} ( h ( a j ) , h ( a ℓ )) ∈ P B with a j ∈ A v m ′ a_j \in A'_{v_m} a j ∈ A v m ′ , then a j = h ( a j ) a_j = h(a_j) a j = h ( a j ) and h ( a ℓ ) = ( v r , f v r , e W , x i ) h(a_\ell) = (v_r,f^W_{v_r,e},x_i) h ( a ℓ ) = ( v r , f v r , e W , x i ) and thus ( a j , a ℓ ) ∈ P A (a_j,a_\ell) \in P^{\mathcal{A}} ( a j , a ℓ ) ∈ P A .
The case where a ℓ ∈ A v m ′ a_\ell\in A'_{v_m} a ℓ ∈ A v m ′ is obvious: elements of A v m ′ A'_{v_m} A v m ′ never occur as the second component of any relation.
Consequently, for the case where at least one of a j a_j a j , a ℓ a_\ell a ℓ lies in A ω m ′ A'_{\omega_m} A ω m ′ , we have
( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B . (a_j,a_\ell) \in T^{\mathcal{A}} \Longleftrightarrow(b_j,b_\ell) \in T^{\mathcal{B}}. ( a j , a ℓ ) ∈ T A ⟺ ( b j , b ℓ ) ∈ T B .
This completes the proof that h h h is a partial isomorphism. □
Omitted Details From sec:prelims
Proof of lemma:var-sorted
Proof. We shall define the one-sorted structure A ˉ \bar{\mathcal{A}} A ˉ given the variable-sorted structure A \mathcal{A} A , the definition for B ˉ \bar{\mathcal{B}} B ˉ follows analogously. Let x 1 , … , x m x_1,\ldots,x_m x 1 , … , x m be the variables that appear in φ \varphi φ , and let A x i A_{x_i} A x i denote the domain for each x i x_i x i in the structure A \mathcal{A} A . Recall that the domains for variables are pairwise disjoint in a variable-sorted structure.
We may assume φ \varphi φ is in prenex normal form for the following reason: since φ \varphi φ is standardised, we have that ( Q x α ) ∧ β (Qx\alpha)\wedge\beta ( Q xα ) ∧ β is logically equivalent to Q x ( α ∧ β ) Qx(\alpha\wedge\beta) Q x ( α ∧ β ) as x ∉ free ( β ) x\notin\operatorname{free}(\beta) x ∈ / free ( β ) ; likewise, α ∧ ( Q x β ) \alpha\wedge(Qx\beta) α ∧ ( Q x β ) is logically equivalent to Q x ( α ∧ β ) Qx(\alpha\wedge\beta) Q x ( α ∧ β ) . Thus, let φ = Q 1 x 1 ⋯ Q m x m ϕ \varphi=Q_1x_1\cdots Q_mx_m\phi φ = Q 1 x 1 ⋯ Q m x m ϕ where Q i ∈ { ∀ , ∃ } Q_i\in\{\forall,\exists\} Q i ∈ { ∀ , ∃ } for each i ∈ [ m ] i\in[m] i ∈ [ m ] and ϕ \phi ϕ is a self-join-free conjunction of atoms. Further assume, without loss of generality, that x i ∈ free ( ϕ ) x_i\in\operatorname{free}(\phi) x i ∈ free ( ϕ ) for each i ∈ [ m ] i\in[m] i ∈ [ m ] .
Let A ˉ : = ⨄ i ∈ [ m ] A x i \bar{A}:=\biguplus_{i\in[m]}A_{x_i} A ˉ := ⨄ i ∈ [ m ] A x i be the domain for A ˉ \bar{\mathcal{A}} A ˉ . For each atom R ( x i 1 , x i 2 , … , x i r ) R(x_{i_1},x_{i_2},\ldots,x_{i_r}) R ( x i 1 , x i 2 , … , x i r ) that appears in φ \varphi φ , we shall define R A ˉ R^{\bar{\mathcal{A}}} R A ˉ based on R A R^{\mathcal{A}} R A along with how x i 1 , … , x i r x_{i_1},\ldots,x_{i_r} x i 1 , … , x i r are quantified. Let
E R : = { p ∈ [ r ] ∣ x i p is existentially quantified } , E_R:=\{p\in[r]\mid x_{i_p}\text{ is existentially quantified}\}, E R := { p ∈ [ r ] ∣ x i p is existentially quantified } ,
U R : = { p ∈ [ r ] ∣ x i p is universally quantified } . U_R:=\{p\in[r]\mid x_{i_p}\text{ is universally quantified}\}. U R := { p ∈ [ r ] ∣ x i p is universally quantified } .
Since φ \varphi φ is standardised and self-join-free, E R E_R E R and U R U_R U R are well-defined. For ( a 1 , … , a r ) ∈ A ˉ r (a_1,\ldots,a_r)\in\bar{A}^{r} ( a 1 , … , a r ) ∈ A ˉ r , let ( a 1 , … , a r ) ∈ R A ˉ (a_1,\ldots,a_r)\in R^{\bar{\mathcal{A}}} ( a 1 , … , a r ) ∈ R A ˉ if and only if:
For every p ∈ E R p\in E_R p ∈ E R , we have that a p ∈ A x i p a_p\in A_{x_{i_p}} a p ∈ A x i p , and either (1) a q ∈ A x i q a_q\in A_{x_{i_q}} a q ∈ A x i q for every q ∈ U R q\in U_R q ∈ U R , and ( a 1 , … , a r ) ∈ R A (a_1,\ldots,a_r)\in R^{\mathcal{A}} ( a 1 , … , a r ) ∈ R A ; or (2) a q ∉ A x i q a_q\notin A_{x_{i_q}} a q ∈ / A x i q for some q ∈ U R q\in U_R q ∈ U R .
We now show that A ⊨ v a r φ \mathcal{A}\models_{\mathrm{var}}\varphi A ⊨ var φ if and only if A ˉ ⊨ φ \bar{\mathcal{A}}\models\varphi A ˉ ⊨ φ . The argument for B \mathcal{B} B and B ˉ \bar{\mathcal{B}} B ˉ is identical. Let us proceed via an evaluation game argument (refer back to Definition 2.2 for the formal definition of the evaluation game). When restricting the game to variable-sorted logic, we simply add the additional constraint that both Universal and Existential must pick an element from the correct domain (i.e., if they are picking an element to assign to x i x_i x i , then that element belongs to A x i A_{x_i} A x i ). Since φ \varphi φ is fixed, we simply say “the game over A \mathcal{A} A ” to denote the evaluation game over A \mathcal{A} A and φ \varphi φ , and likewise with A ˉ \bar{\mathcal{A}} A ˉ .
( A ⊨ v a r φ ⟹ A ˉ ⊨ φ ) (\mathcal{A}\models_{\mathrm{var}}\varphi\Longrightarrow\bar{\mathcal{A}}\models\varphi) ( A ⊨ var φ ⟹ A ˉ ⊨ φ ) Suppose Existential has a winning strategy over the variable-sorted structure A \mathcal{A} A . Let us define a winning strategy for Existential over A ˉ \bar{\mathcal{A}} A ˉ using their winning strategy over A \mathcal{A} A as a guide. First, for each ℓ ∈ [ m ] \ell\in[m] ℓ ∈ [ m ] with Q ℓ = ∀ Q_\ell=\forall Q ℓ = ∀ , fix some arbitrary element d ℓ ∈ A x ℓ d_\ell\in A_{x_\ell} d ℓ ∈ A x ℓ .
In the game over A ˉ \bar{\mathcal{A}} A ˉ , for any i ∈ [ m ] i\in[m] i ∈ [ m ] with Q i = ∀ Q_i=\forall Q i = ∀ , suppose Universal picks a for x i x_i x i . We simulate this move in the game over A \mathcal{A} A by assigning x i x_i x i to a if a ∈ A x i a\in A_{x_i} a ∈ A x i , and to d i d_i d i otherwise. Existential then plays the game over A ˉ \bar{\mathcal{A}} A ˉ according to their strategy in A \mathcal{A} A . Thus, for j ∈ [ m ] j\in[m] j ∈ [ m ] with Q j = ∃ Q_j=\exists Q j = ∃ , we have that the value chosen for x j x_j x j belongs to A x j A_{x_j} A x j .
Let σ ˉ \bar{\sigma} σ ˉ be the assignment resulting from the final position in the game over A ˉ \bar{\mathcal{A}} A ˉ where Existential plays the above-defined strategy, and let σ \sigma σ be the assignment resulting from the final position in the game over A \mathcal{A} A where Existential plays with their winning strategy. Since Existential has a winning strategy over A \mathcal{A} A , we have that ( A , σ ) ⊨ v a r ϕ (\mathcal{A},\sigma)\models_{\mathrm{var}}\phi ( A , σ ) ⊨ var ϕ . Let R ( x i 1 , … , x i r ) R(x_{i_1},\ldots,x_{i_r}) R ( x i 1 , … , x i r ) be an arbitrary atom in ϕ \phi ϕ . If every universally quantified variable among x i 1 , … , x i r x_{i_1},\ldots,x_{i_r} x i 1 , … , x i r is assigned by σ ˉ \bar{\sigma} σ ˉ to its intended domain, then σ ˉ \bar{\sigma} σ ˉ and σ \sigma σ agree on x i 1 , … , x i r x_{i_1},\ldots,x_{i_r} x i 1 , … , x i r . Since ( A , σ ) ⊨ v a r R ( x i 1 , … , x i r ) (\mathcal{A},\sigma)\models_{\mathrm{var}}R(x_{i_1},\ldots,x_{i_r}) ( A , σ ) ⊨ var R ( x i 1 , … , x i r ) , it follows from the definition of R A ˉ R^{\bar{\mathcal{A}}} R A ˉ that ( A ˉ , σ ˉ ) ⊨ R ( x i 1 , … , x i r ) (\bar{\mathcal{A}},\bar{\sigma}) \models R(x_{i_1},\ldots,x_{i_r}) ( A ˉ , σ ˉ ) ⊨ R ( x i 1 , … , x i r ) . Otherwise, at least one universally quantified variable x i j x_{i_j} x i j with 1 ≤ j ≤ r 1 \le j \le r 1 ≤ j ≤ r is assigned outside its intended domain by σ ˉ \bar{\sigma} σ ˉ . Since Existential’s choices all lie in their intended domains, the definition of R A ˉ R^{\bar{\mathcal{A}}} R A ˉ again implies that ( A ˉ , σ ˉ ) ⊨ R ( x i 1 , … , x i r ) (\bar{\mathcal{A}},\bar{\sigma}) \models R(x_{i_1},\ldots,x_{i_r}) ( A ˉ , σ ˉ ) ⊨ R ( x i 1 , … , x i r ) .
Therefore, the defined strategy for Existential in A ˉ \bar{\mathcal{A}} A ˉ is indeed a winning strategy, since every atomic formula in φ \varphi φ is satisfied by the resulting variable assignment.
( A ˉ ⊨ φ ⇒ A ⊨ v a r φ ) (\bar{\mathcal{A}} \models\varphi\mathrel{\Rightarrow} \mathcal{A} \models_{\mathrm{var}} \varphi) ( A ˉ ⊨ φ ⇒ A ⊨ var φ ) Assume that Existential has a winning strategy in the game over the one-sorted structure A ˉ \bar{\mathcal{A}} A ˉ . Let us define a winning strategy for Existential in A \mathcal{A} A using the game over A ˉ \bar{\mathcal{A}} A ˉ as a guide. For each choice Universal makes in the game over A \mathcal{A} A , mirror that choice in the game over A ˉ \bar{\mathcal{A}} A ˉ , and let Existential respond to both games using their winning strategy over A ˉ \bar{\mathcal{A}} A ˉ . Notice that in the game on A ˉ \bar{\mathcal{A}} A ˉ , if Q i = ∃ Q_i = \exists Q i = ∃ , then Existential must pick some a ∈ A x i a \in A_{x_i} a ∈ A x i for x i x_i x i . This is because no variable assignment σ \sigma σ with σ ( x i ) ∉ A x i \sigma(x_i) \notin A_{x_i} σ ( x i ) ∈ / A x i can satisfy any atom R ( x i 1 , … , x i r ) ∈ φ R(x_{i_1},\ldots,x_{i_r}) \in\varphi R ( x i 1 , … , x i r ) ∈ φ with x i = x i j x_i = x_{i_j} x i = x i j for some j ∈ [ r ] j \in[r] j ∈ [ r ] . Therefore, if Existential picks some a ∉ A x i a \notin A_{x_i} a ∈ / A x i , then they will lose. Thus, any pick adhering to Existential’s winning strategy in the game over A ˉ \bar{\mathcal{A}} A ˉ is also a valid choice for Existential in A \mathcal{A} A . Consequently, Existential’s winning strategy in the game over A ˉ \bar{\mathcal{A}} A ˉ immediately transfers to a winning strategy in the game over A \mathcal{A} A .
We have established that A ⊨ v a r φ ⟺ A ˉ ⊨ φ \mathcal{A} \models_{\mathrm{var}} \varphi\Longleftrightarrow\bar{\mathcal{A}} \models\varphi A ⊨ var φ ⟺ A ˉ ⊨ φ . The symmetric reasoning means B ⊨ v a r φ ⟺ B ˉ ⊨ φ \mathcal{B} \models_{\mathrm{var}} \varphi\Longleftrightarrow\bar{\mathcal{B}} \models\varphi B ⊨ var φ ⟺ B ˉ ⊨ φ . Indeed, if there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ \mathcal{A} \models_{\mathrm{var}} \varphi A ⊨ var φ and B ̸ ⊨ v a r φ \mathcal{B} \not\models_{\mathrm{var}} \varphi B ⊨ var φ , then there exist one-sorted structures A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ such that A ˉ ⊨ φ \bar{\mathcal{A}} \models\varphi A ˉ ⊨ φ and B ˉ ⊭ φ \bar{\mathcal{B}} \not\models\varphi B ˉ ⊨ φ .
( A ≡ v a r k B ⇒ A ˉ ≡ k B ˉ ) (\mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B} \mathrel{\Rightarrow} \bar{\mathcal{A}} \equiv^{k} \bar{\mathcal{B}}) ( A ≡ var k B ⇒ A ˉ ≡ k B ˉ ) Assume A ≡ v a r k B \mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B} A ≡ var k B . We show that Duplicator has a winning strategy for the k k k -pebble game over the one-sorted structures A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ .
Duplicator uses their winning strategy from the variable-sorted game for the one-sorted game. Since the domains of the variables are disjoint, every element a ∈ A ˉ a \in\bar{A} a ∈ A ˉ belongs to exactly one set A x i A_{x_i} A x i , and likewise every b ∈ B ˉ b \in\bar{B} b ∈ B ˉ belongs to exactly one B x i B_{x_i} B x i . Thus, whenever Spoiler pebbles an element a ∈ A ˉ a \in\bar{A} a ∈ A ˉ , Duplicator treats this like Spoiler pebbling a ∈ A x i a \in A_{x_i} a ∈ A x i . Duplicator then responds in the game over A \mathcal{A} A and B \mathcal{B} B by pebbling b ∈ B x i b \in B_{x_i} b ∈ B x i , and for the game over A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ , Duplicator mirrors this choice by pebbling the same b ∈ B ˉ b \in\bar{B} b ∈ B ˉ . The case where Spoiler pebbles an element of B ˉ \bar{B} B ˉ is symmetric.
We now show that this is a winning strategy for Duplicator. Let ( α , β ) (\alpha,\beta) ( α , β ) be an arbitrary position of the game over A \mathcal{A} A and B \mathcal{B} B where Duplicator plays with their winning strategy; thus implying ( α , β ) (\alpha,\beta) ( α , β ) forms a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B . By Duplicator’s strategy for the game over A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ , this is also a position for the one-sorted game. We shall show that ( α , β ) (\alpha,\beta) ( α , β ) forms a partial isomorphism between A ˉ \bar{\mathcal{A}} A ˉ and B ˉ \bar{\mathcal{B}} B ˉ . It is immediate that { ( α ( p ) , β ( p ) ) ∣ p ∈ dom ( α ) } \{(\alpha(p),\beta(p)) \mid p \in\operatorname{dom}(\alpha)\} {( α ( p ) , β ( p )) ∣ p ∈ dom ( α )} defines an injective partial mapping.
Notice that for every pebble p ∈ dom ( α ) p \in\operatorname{dom}(\alpha) p ∈ dom ( α ) , we have that α ( p ) ∈ A x i \alpha(p) \in A_{x_i} α ( p ) ∈ A x i if and only if β ( p ) ∈ B x i \beta(p) \in B_{x_i} β ( p ) ∈ B x i ; we call this domain preservation for this proof. Recall that the sets E R E_R E R and U R U_R U R denote which components of ( x i 1 , … , x i r ) (x_{i_1},\ldots,x_{i_r}) ( x i 1 , … , x i r ) are existentially quantified and universally quantified.
Let R ( x i 1 , … , x i r ) R(x_{i_1},\ldots,x_{i_r}) R ( x i 1 , … , x i r ) be an arbitrary atom of φ \varphi φ . Let ( a 1 , … , a r ) (a_1,\ldots,a_r) ( a 1 , … , a r ) be a tuple of pebbled elements of A ˉ \bar{A} A ˉ , and let ( b 1 , … , b r ) (b_1,\ldots,b_r) ( b 1 , … , b r ) be the corresponding tuple of pebbled elements of B ˉ \bar{B} B ˉ . By domain preservation, we have that a p ∈ A x i p a_p \in A_{x_{i_p}} a p ∈ A x i p if and only if b p ∈ B x i p b_p \in B_{x_{i_p}} b p ∈ B x i p . We now establish that:
( a 1 , … , a r ) ∈ R A ˉ ⇒ ( b 1 , … , b r ) ∈ R B ˉ . (a_1,\ldots,a_r) \in R^{\bar{\mathcal{A}}} \mathrel{\Rightarrow} (b_1,\ldots,b_r) \in R^{\bar{\mathcal{B}}}. ( a 1 , … , a r ) ∈ R A ˉ ⇒ ( b 1 , … , b r ) ∈ R B ˉ .
The converse direction is symmetric.
Suppose ( a 1 , … , a r ) ∈ R A ˉ (a_1,\ldots,a_r) \in R^{\bar{\mathcal{A}}} ( a 1 , … , a r ) ∈ R A ˉ . By the definition of R A ˉ R^{\bar{\mathcal{A}}} R A ˉ , we have that a p ∈ A x i p a_p \in A_{x_{i_p}} a p ∈ A x i p , for every p ∈ E R p \in E_R p ∈ E R . Therefore, by domain preservation, b p ∈ B x i p b_p \in B_{x_{i_p}} b p ∈ B x i p for every p ∈ E R p \in E_R p ∈ E R . We now consider two cases:
There is some p ∈ U R p \in U_R p ∈ U R such that a p ∉ A x i p a_p \notin A_{x_{i_p}} a p ∈ / A x i p . By domain preservation, we have that b p ∉ B x i p b_p \notin B_{x_{i_p}} b p ∈ / B x i p and therefore ( b 1 , … , b r ) ∈ R B ˉ (b_1,\ldots,b_r) \in R^{\bar{\mathcal{B}}} ( b 1 , … , b r ) ∈ R B ˉ by definition.
(2) For all p ∈ U R p \in U_R p ∈ U R we have a p ∈ A x i p a_p \in A_{x_i p} a p ∈ A x i p . Thus, each component of ( a 1 , … , a r ) (a_1,\ldots,a_r) ( a 1 , … , a r ) and ( b 1 , … , b r ) (b_1,\ldots,b_r) ( b 1 , … , b r ) lies in its intended domain. This implies ( a 1 , … , a r ) ∈ R A ˉ (a_1,\ldots,a_r) \in R^{\bar A} ( a 1 , … , a r ) ∈ R A ˉ and thus ( b 1 , … , b r ) ∈ R B ˉ (b_1,\ldots,b_r) \in R^{\bar B} ( b 1 , … , b r ) ∈ R B ˉ . Therefore, by definition, ( b 1 , … , b r ) ∈ R B ˉ (b_1,\ldots,b_r) \in R^{\bar B} ( b 1 , … , b r ) ∈ R B ˉ .
Consequently, ( α , β ) (\alpha,\beta) ( α , β ) forms a partial isomorphism between A ˉ \bar A A ˉ and B ˉ \bar B B ˉ and thus Duplicator has a winning strategy for the k k k -pebble game between A ˉ \bar A A ˉ and B ˉ \bar B B ˉ as required. □
C Omitted Details From Section 4
Proof of Theorem 4.2
Proof. Given a self-join-free QCQ φ \varphi φ , apply the algorithm of Theorem 3.1 to obtain φ + ∈ [ φ ] A \varphi^+ \in[\varphi]_{\mathcal A} φ + ∈ [ φ ] A where φ + \varphi^+ φ + has the minimum width among all formulae in [ φ ] A [\varphi]_{\mathcal A} [ φ ] A . Thus, by Theorem 4.1 , we have that width ( φ + ) = logwidth ( φ ) \operatorname{width}(\varphi^+) = \operatorname{logwidth}(\varphi) width ( φ + ) = logwidth ( φ ) . □
Proof of Corollary 4.3
Proof. For membership in NP, one first computes the normal form used by the algorithm of Theorem 3.1 , together with its region hypergraphs. This can be done in polynomial time [22 Theorem 4.2] before the calls for minimum tree decompositions. As described after Theorem 3.1 , the regions are then minimised independently, and their minimum widths are given by their respective treewidths plus one. Hence, logwidth ( φ ) ≤ k \operatorname{logwidth}(\varphi) \leq k logwidth ( φ ) ≤ k precisely when every such region hypergraph has treewidth at most k − 1 k-1 k − 1 . Therefore, it suffices to guess and verify a tree decomposition of width at most k − 1 k-1 k − 1 for each region hypergraph. Since there are polynomially many such hypergraphs, each of polynomial size, these decompositions form a polynomial-size certificate.
For NP-hardness, let G = ( V , E ) G=(V,E) G = ( V , E ) be a graph on n n n vertices, with V = { v 1 , … , v n } V=\{v_1,\ldots,v_n\} V = { v 1 , … , v n } . We may assume that G G G has at least one edge, since the edgeless case is trivial. Introduce a fresh binary relation symbol R i , j R_{i,j} R i , j for every edge { v i , v j } ∈ E \{v_i,v_j\} \in E { v i , v j } ∈ E with i < j i<j i < j . Now, consider the self-join-free CQ
φ G : = ∃ v 1 ⋯ ∃ v n ⋀ i < j , { v i , v j } ∈ E R i , j ( v i , v j ) . \varphi_G := \exists v_1 \cdots\exists v_n \bigwedge_{i<j,\{v_i,v_j\}\in E} R_{i,j}(v_i,v_j). φ G := ∃ v 1 ⋯ ∃ v n i < j , { v i , v j } ∈ E ⋀ R i , j ( v i , v j ) .
The primal graph of its unique { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region is obtained from G G G by removing its isolated vertices, and hence has the same treewidth. Thus, by Theorems 3.1 and 4.1 , logwidth ( φ G ) = tw ( G ) + 1 \operatorname{logwidth}(\varphi_G)=\operatorname{tw}(G)+1 logwidth ( φ G ) = tw ( G ) + 1 . In particular, tw ( G ) ≤ t \operatorname{tw}(G) \leq t tw ( G ) ≤ t iff logwidth ( φ G ) ≤ t + 1 \operatorname{logwidth}(\varphi_G) \leq t+1 logwidth ( φ G ) ≤ t + 1 . NP-hardness thus immediately follows from the NP-completeness of the treewidth decision problem [4 ] .
The same arguments yield the polynomial-time Turing equivalence. After the polynomial-time normalisation discussed above, the logical width is obtained by computing the treewidth of polynomially many region hypergraphs and taking their maximum plus one. Conversely, the construction above gives tw ( G ) = logwidth ( φ G ) − 1 \operatorname{tw}(G)=\operatorname{logwidth}(\varphi_G)-1 tw ( G ) = logwidth ( φ G ) − 1 . □
Proof of Theorem 4.4
Let us proceed with the following lemma.
Lemma C.1. Let φ \varphi φ be a self-join-free QCQ, let φ + \varphi^+ φ + be a self-join-free QCQ with minimum width among all formulae in [ φ ] A [\varphi]_{\mathcal A} [ φ ] A , and let ψ [ θ ] \psi[\theta] ψ [ θ ] be an { ∀ } \{\forall\} { ∀ } -organised formula that is a subformula of φ + \varphi^+ φ + . Then, the following conditions hold:
(1) If θ \theta θ is not an atom, then tw ( H ψ ) ≤ tw ( H θ ) \operatorname{tw}(H_\psi) \leq\operatorname{tw}(H_\theta) tw ( H ψ ) ≤ tw ( H θ ) .
(2) If θ \theta θ is an atom, then logwidth ( φ ) ≥ tw ( H ψ ) + 1 \operatorname{logwidth}(\varphi) \geq\operatorname{tw}(H_\psi)+1 logwidth ( φ ) ≥ tw ( H ψ ) + 1 .
Proof. First, consider the case given in Item 1. Interpreting ψ \psi ψ as a holey { ∀ } \{\forall\} { ∀ } -formula, we have that ψ = ∀ y 1 ⋯ ∀ y k 1 \psi= \forall y_1 \cdots\forall y_{k_1} ψ = ∀ y 1 ⋯ ∀ y k 1 , with an association a a a such that a ( 1 ) = { y 1 , … , y k 1 , z 1 , … , z n } a(1)=\{y_1,\ldots,y_{k_1},z_1,\ldots,z_n\} a ( 1 ) = { y 1 , … , y k 1 , z 1 , … , z n } , where free ( ψ ) = { z 1 , … , z n } \operatorname{free}(\psi)=\{z_1,\ldots,z_n\} free ( ψ ) = { z 1 , … , z n } . Thus, the hypergraph of ψ \psi ψ contains the hyperedges { y 1 , … , y k 1 , z 1 , … , z n } \{y_1,\ldots,y_{k_1},z_1,\ldots,z_n\} { y 1 , … , y k 1 , z 1 , … , z n } … and { z 1 , … , z n } \{z_1,\ldots,z_n\} { z 1 , … , z n } . Now consider the hypergraph of θ \theta θ , where θ \theta θ is interpreted as a holey { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -formula that is the child region of ψ \psi ψ . Clearly, the free variables of θ \theta θ are { y 1 , … , y k , z 1 , … , z n } \{y_1,\ldots,y_k,z_1,\ldots,z_n\} { y 1 , … , y k , z 1 , … , z n } , and by definition H θ H_\theta H θ has a hyperedge that contains all the free variables of θ \theta θ . Thus, tw ( H ψ ) ≤ tw ( H θ ) \operatorname{tw}(H_\psi) \leq\operatorname{tw}(H_\theta) tw ( H ψ ) ≤ tw ( H θ ) .
The rest of this proof is focused on Item 2. Let ψ ⟦ θ ⟧ = ∀ y 1 ⋯ ∀ y k R ( x 1 , … , x r ) \psi\llbracket\theta\rrbracket= \forall y_1\cdots\forall y_k R(x_1,\ldots,x_r) ψ [ [ θ ] ] = ∀ y 1 ⋯ ∀ y k R ( x 1 , … , x r ) . To establish this case, we define two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r ϕ + \mathcal{A}\models_{\mathrm{var}}\phi^+ A ⊨ var ϕ + , B ̸ ⊨ v a r ϕ + \mathcal{B}\not\models_{\mathrm{var}}\phi^+ B ⊨ var ϕ + , and A ≡ v a r t B \mathcal{A}\equiv^t_{\mathrm{var}}\mathcal{B} A ≡ var t B , where t = tw ( H ψ ) t=\operatorname{tw}(H_\psi) t = tw ( H ψ ) . Notice that t = ∣ { x 1 , … , x r } ∣ − 1 t = |\{x_1,\ldots,x_r\}|-1 t = ∣ { x 1 , … , x r } ∣ − 1 since { x 1 , … , x r } \{x_1,\ldots,x_r\} { x 1 , … , x r } is a hyperedge of H ψ H_\psi H ψ that contains all the vertices in H ψ H_\psi H ψ .
For every variable u u u of ϕ + \phi^+ ϕ + , let A u = B u = { ∗ u } A_u=B_u=\{*_{u}\} A u = B u = { ∗ u } . For every atom T ( w 1 , … , w p ) T(w_1,\ldots,w_p) T ( w 1 , … , w p ) that occurs in ϕ + \phi^+ ϕ + with T ≠ R T\neq R T = R , let T A : = { ( ∗ w 1 , … , ∗ w p ) } T^\mathcal{A}:=\{(*_{w_1},\ldots,*_{w_p})\} T A := {( ∗ w 1 , … , ∗ w p )} and let T B : = { ( ∗ w 1 , … , ∗ w p ) } T^\mathcal{B}:=\{(*_{w_1},\ldots,*_{w_p})\} T B := {( ∗ w 1 , … , ∗ w p )} . For the relation symbol R R R , such that R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) appears in ψ ⟦ θ ⟧ \psi\llbracket\theta\rrbracket ψ [ [ θ ] ] , let R A : = { ( ∗ x 1 , … , ∗ x r ) } R^\mathcal{A}:=\{(*_{x_1},\ldots,*_{x_r})\} R A := {( ∗ x 1 , … , ∗ x r )} and let R B = ∅ R^\mathcal{B}=\varnothing R B = ∅ . Thus, for both A \mathcal{A} A and B \mathcal{B} B , there is a single variable assignment σ \sigma σ for the variables of ϕ + \phi^+ ϕ + that respects domains: That is, σ ( u ) = ∗ u \sigma(u)=*_{u} σ ( u ) = ∗ u for every variable u u u that appears in ϕ + \phi^+ ϕ + .
Clearly, A ⊨ v a r ϕ + \mathcal{A}\models_{\mathrm{var}}\phi^+ A ⊨ var ϕ + since every variable is assigned to the unique element of its domain, and with this assignment every atomic formula in ϕ + \phi^+ ϕ + is satisfied. To show B ̸ ⊨ v a r ϕ + \mathcal{B}\not\models_{\mathrm{var}}\phi^+ B ⊨ var ϕ + , notice that for the unique assignment σ \sigma σ resulting from the evaluation game, we get ( B , σ ) ⊭ R ( x 1 , … , x r ) (\mathcal{B},\sigma)\not\models R(x_1,\ldots,x_r) ( B , σ ) ⊨ R ( x 1 , … , x r ) since R B = ∅ R^\mathcal{B}=\varnothing R B = ∅ . Thus, Universal has a winning strategy over B \mathcal{B} B and ϕ + \phi^+ ϕ + .
All that remains is to show A ≡ v a r t B \mathcal{A}\equiv^t_{\mathrm{var}}\mathcal{B} A ≡ var t B . That is, Duplicator wins the t t t -pebble game over A \mathcal{A} A and B \mathcal{B} B . If Spoiler pebbles ∗ u *_{u} ∗ u for some variable u u u , then Duplicator’s only choice is to pick ∗ u *_{u} ∗ u in the other structure. Let ( α , β ) (\alpha,\beta) ( α , β ) be an arbitrary position of the game where Duplicator plays the above-defined strategy. Immediately from Duplicator’s strategy, { ( α ( p ) , β ( p ) ) ∣ p ∈ dom ( α ) } \{(\alpha(p),\beta(p))\mid p\in\operatorname{dom}(\alpha)\} {( α ( p ) , β ( p )) ∣ p ∈ dom ( α )} defines an injective partial mapping. Moreover, since all relation symbols T ≠ R T\neq R T = R are interpreted the same in both A \mathcal{A} A and B \mathcal{B} B , we only need to consider R R R .
Recall that R A = { ( ∗ x 1 , ∗ x 2 , … , ∗ x r ) } R^\mathcal{A}=\{(*_{x_1},*_{x_2},\ldots,*_{x_r})\} R A = {( ∗ x 1 , ∗ x 2 , … , ∗ x r )} . The number of distinct elements occurring in the tuple ( ∗ x 1 , … , ∗ x r ) (*_{x_1},\ldots,*_{x_r}) ( ∗ x 1 , … , ∗ x r ) is ∣ { x 1 , … , x r } ∣ = t + 1 |\{x_1,\ldots,x_r\}|=t+1 ∣ { x 1 , … , x r } ∣ = t + 1 . Since we are considering the t t t -pebble game, no reachable position can contain all these elements simultaneously. Hence, for any tuple of pebbles p ˉ ∈ dom ( α ) r \bar{p}\in\operatorname{dom}(\alpha)^r p ˉ ∈ dom ( α ) r , we have that α ( p ˉ ) ∉ R A \alpha(\bar{p})\notin R^\mathcal{A} α ( p ˉ ) ∈ / R A and β ( p ˉ ) ∉ R B \beta(\bar{p})\notin R^\mathcal{B} β ( p ˉ ) ∈ / R B simply because α ( p ˉ ) \alpha(\bar{p}) α ( p ˉ ) and β ( p ˉ ) \beta(\bar{p}) β ( p ˉ ) do not have enough distinct components.
Thus A ⊨ v a r ϕ + \mathcal{A}\models_{\mathrm{var}}\phi^+ A ⊨ var ϕ + , B ̸ ⊨ v a r ϕ + \mathcal{B}\not\models_{\mathrm{var}}\phi^+ B ⊨ var ϕ + and A ≡ v a r tw ( H ψ ) B \mathcal{A}\equiv^{\operatorname{tw}(H_\psi)}_{\mathrm{var}}\mathcal{B} A ≡ var tw ( H ψ ) B . By invoking Lemma 2.9 and Theorem 2.3 , we have logwidth ( ϕ ) ≥ tw ( H ψ ) + 1 \operatorname{logwidth}(\phi)\geq\operatorname{tw}(H_\psi)+1 logwidth ( ϕ ) ≥ tw ( H ψ ) + 1 . □
Then, the actual proof of Theorem 4.4 is a straightforward application of Lemma C.1 :
Proof. We derive this result by establishing two inequalities.
(≥ \geq ≥ ): By Lemma C.1 (1), it must hold that any such region with maximum treewidth must be of the form ∀ y ˉ R ( z ˉ ) \forall\bar{y}R(\bar{z}) ∀ y ˉ R ( z ˉ ) where R ∈ τ R\in\tau R ∈ τ . Let θ \theta θ be a { ∀ } \{\forall\} { ∀ } -region with maximum treewidth. Invoking Lemma C.1 (2), any first-order formula equivalent to ϕ + \phi^+ ϕ + necessarily uses at least tw ( H θ ) + 1 \operatorname{tw}(H_\theta)+1 tw ( H θ ) + 1 variables.
(≤ \leq ≤ ): This direction follows from Theorem 3.1 . □
Proof of lemma:connected-and-tight
Proof. We prove this result in two parts.
Connectivity Property. Towards a contradiction, assume that ϕ \phi ϕ is a QCQ where [ ϕ ] T [\phi]_{\mathcal{T}} [ ϕ ] T is a normal form of the system R \mathcal{R} R and there exists a { ∃ , λ } \{\exists,\lambda\} { ∃ , λ } -region ψ \psi ψ of ϕ \phi ϕ which does not have the connectivity property. Using the pushup rule, we can assume that ψ \psi ψ is in prenex normal-form. Set ψ = ∃ x 1 ⋯ ∃ x k ϕ \psi=\exists x_1\cdots\exists x_k\phi ψ = ∃ x 1 ⋯ ∃ x k ϕ where ϕ \phi ϕ is a quantifier-free holey formula, and let a a a be an association for each hole in ϕ \phi ϕ . We shall use X X X for { x 1 , … , x k } \{x_1,\ldots,x_k\} { x 1 , … , x k } for the remainder of this proof. Partition X X X into X 1 ∪ ˙ X 2 X_1\mathbin{\dot\cup}X_2 X 1 ∪ ˙ X 2 such that the hypergraph H ψ ∣ X H_\psi|X H ψ ∣ X is the disjoint union of H ψ ∣ X 1 H_\psi|X_1 H ψ ∣ X 1 and H ψ ∣ X 2 H_\psi|X_2 H ψ ∣ X 2 . That is, H ψ ∣ X 1 H_\psi|X_1 H ψ ∣ X 1 and H ψ ∣ X 2 H_\psi|X_2 H ψ ∣ X 2 have no vertices or edges in common, but the union of the vertices and edges of these two hypergraphs accounts for all the vertices and edges in H ψ ∣ X H_\psi|X H ψ ∣ X . Without loss of generality, we may assume X 1 = { x 1 , … , x r } X_1 = \{x_1,\ldots,x_r\} X 1 = { x 1 , … , x r } and X 2 = { x r + 1 , … , x k } X_2 = \{x_{r+1},\ldots,x_k\} X 2 = { x r + 1 , … , x k } where 1 ≤ r < k 1 \le r < k 1 ≤ r < k . Then, using the associativity and commutativity rules, let ψ 2 = ∃ x 1 ⋯ ∃ x k ( φ 1 ∧ φ 2 ) \psi_2 = \exists x_1\cdots\exists x_k(\varphi_1 \land\varphi_2) ψ 2 = ∃ x 1 ⋯ ∃ x k ( φ 1 ∧ φ 2 ) such that ⋃ i is a hole of φ 1 a ( i ) = X 1 \bigcup_{i\text{ is a hole of }\varphi_1}a(i)=X_1 ⋃ i is a hole of φ 1 a ( i ) = X 1 , and ⋃ j is a hole of φ 2 a ( j ) = X 2 \bigcup_{j\text{ is a hole of }\varphi_2}a(j)=X_2 ⋃ j is a hole of φ 2 a ( j ) = X 2 ; note that this can be done since there is a one-to-one correspondence between hyperedges in H ψ ∣ X H_{\psi}\mathbin{|}X H ψ ∣ X and a ( i ) a(i) a ( i ) for some hole i i i of φ \varphi φ . Observe that ψ 2 \psi_2 ψ 2 belongs to the equivalence class [ ψ ] T [\psi]_{\mathsf{T}} [ ψ ] T since we have only used the pushup rule, the commutativity rule, and the associativity rule. We now have that ψ 2 → P ↓ ∗ ψ 3 \psi_2 \mathrel{\mathop{\to}\limits^{*}_{\mathsf{P}\downarrow}} \psi_3 ψ 2 P ↓ → ∗ ψ 3 where
ψ 3 = ∃ x 1 ⋯ ∃ x r ( φ 1 ) ∧ ∃ x r + 1 ⋯ ∃ x k ( φ 2 ) . \psi_3=\exists x_1\cdots\exists x_r(\varphi_1)\land\exists x_{r+1}\cdots\exists x_k(\varphi_2). ψ 3 = ∃ x 1 ⋯ ∃ x r ( φ 1 ) ∧ ∃ x r + 1 ⋯ ∃ x k ( φ 2 ) .
Again, observe that ψ 3 \psi_3 ψ 3 belongs to [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T since we have used the pushdown rule, which belongs to T \mathsf{T} T .
Notice that we can take ϕ \phi ϕ and replace the subformula ψ \psi ψ with ψ 3 \psi_3 ψ 3 to obtain a new QCQ ϕ ′ \phi' ϕ ′ which belongs to [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T . Since ψ \psi ψ is a non-top region of ϕ \phi ϕ , there exists some subformula θ \theta θ of ϕ \phi ϕ such that
θ = ∀ y 1 ⋯ ∀ y p ( ∃ x 1 ⋯ ∃ x r ( φ 1 ) ∧ ∃ x r + 1 ⋯ ∃ x k ( φ 2 ) ) . \theta=\forall y_1\cdots\forall y_p\left(\exists x_1\cdots\exists x_r(\varphi_1)\land\exists x_{r+1}\cdots\exists x_k(\varphi_2)\right). θ = ∀ y 1 ⋯ ∀ y p ( ∃ x 1 ⋯ ∃ x r ( φ 1 ) ∧ ∃ x r + 1 ⋯ ∃ x k ( φ 2 ) ) .
We are now able to perform the splitdown rule on θ \theta θ which contradicts our assumption that [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T is a normal form of the system R \mathcal{R} R .
Tightness Property. Towards a contradiction, assume that ϕ \phi ϕ is a QCQ where [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T is a normal form of the system R \mathcal{R} R and there exists a non-top { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region ψ \psi ψ of ϕ \phi ϕ which does not have the tightness property. Using the pushup rule, we can assume that ψ \psi ψ is in prenex normal-form. Set ψ = ∃ x 1 ⋯ ∃ x k ⋀ 1 ≤ i ≤ n i \psi=\exists x_1\cdots\exists x_k\bigwedge_{1\le i\le n}i ψ = ∃ x 1 ⋯ ∃ x k ⋀ 1 ≤ i ≤ n i to be a holey formula and let a a a be the corresponding association. Since ψ \psi ψ does not have the tightness property, there exists a hyperedge e e e of H ψ H_\psi H ψ , that is not the single hyperedge containing all the free variables, but where e ⊆ free ( ψ ) e\subseteq\operatorname{free}(\psi) e ⊆ free ( ψ ) . Set r ∈ [ n ] r\in[n] r ∈ [ n ] such that a ( r ) = e a(r)=e a ( r ) = e .
Using the commutativity rule and the associativity rule, we have that ψ → A C ∗ ψ 2 \psi\mathrel{\mathop{\to}\limits^{*}_{\mathsf{AC}}}\psi_2 ψ AC → ∗ ψ 2 where
ψ 2 = ∃ x 1 ⋯ ∃ x k ( ⋀ i ∈ [ n ] ∖ { r } i ∧ r ) . \psi_2=\exists x_1\cdots\exists x_k\left(\bigwedge_{i\in[n]\setminus\{r\}}i\land r\right). ψ 2 = ∃ x 1 ⋯ ∃ x k i ∈ [ n ] ∖ { r } ⋀ i ∧ r .
We now have that ψ 2 → P ↓ ∗ ψ 3 \psi_2\mathrel{\mathop{\to}\limits^{*}_{\mathsf{P}\downarrow}}\psi_3 ψ 2 P ↓ → ∗ ψ 3 where
ψ 3 = ( ∃ x 1 ⋯ ∃ x k ⋀ i ∈ [ n ] ∖ { r } i ) ∧ r . \psi_3=\left(\exists x_1\cdots\exists x_k\bigwedge_{i\in[n]\setminus\{r\}}i\right)\land r. ψ 3 = ∃ x 1 ⋯ ∃ x k i ∈ [ n ] ∖ { r } ⋀ i ∧ r .
However, since ψ \psi ψ is a non-top region of ϕ \phi ϕ , there is a { ∀ } \{\forall\} { ∀ } -region with ψ \psi ψ as its child region. We can therefore perform the splitdown rule on ϕ ′ \phi' ϕ ′ which contradicts our assumption that [ ϕ ] T [\phi]_{\mathsf{T}} [ ϕ ] T is a normal form of the system R \mathcal{R} R . □
D Omitted Details From sec:qsg
Recall that all omitted details from Section 5 apart from the proof of Lemma 5.17 can be found in Section A.
Proof of lemma:winning-strat
Proof. For any a ∈ A a\in A a ∈ A , any walk W W W in G θ G_\theta G θ , and any function f : E a → { 0 , 1 } f:E_a\to\{0,1\} f : E a → { 0 , 1 } , recall that f W : E a → { 0 , 1 } f^W:E_a\to\{0,1\} f W : E a → { 0 , 1 } is the function defined as
f W ( e ) : = f ( e ) + occ W ( e ) ( m o d 2 ) f^W(e):=f(e)+\operatorname{occ}_W(e)\pmod2 f W ( e ) := f ( e ) + occ W ( e ) ( mod 2 )
for each e ∈ E a e\in E_a e ∈ E a . Duplicator maintains the following invariant after each round:
Invariant: Suppose 0 ≤ i ≤ p 0\le i\le p 0 ≤ i ≤ p pebbles are placed on a 1 , … , a i ∈ A a_1,\ldots,a_i\in A a 1 , … , a i ∈ A and b 1 , … , b i ∈ B b_1,\ldots,b_i\in B b 1 , … , b i ∈ B . Then, there exists a walk W W W in G θ G_\theta G θ from s s s to t ∈ A t\in A t ∈ A avoiding M ( { π 1 ( a 1 ) , … , π 1 ( a i ) } ) \mathcal{M}(\{\pi_1(a_1),\ldots,\pi_1(a_i)\}) M ({ π 1 ( a 1 ) , … , π 1 ( a i )}) such that b ℓ = Ψ W ( a ℓ ) b_\ell=\Psi_W(a_\ell) b ℓ = Ψ W ( a ℓ ) for every ℓ ∈ [ i ] \ell\in[i] ℓ ∈ [ i ] . By Lemma 5.16 , any position satisfying this invariant is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B . Hence, it suffices to show that Duplicator can always respond so as to preserve the invariant.
For the initial position, where no pebbles are placed, choose any bramble set M ∈ M M \in\mathcal{M} M ∈ M with s ∉ M s \notin M s ∈ / M . Since G θ G_\theta G θ is connected, there exists a walk W W W from s s s to some t ∈ M t \in M t ∈ M and thus the invariant holds.
Now assume the invariant holds for i < ρ i < \rho i < ρ pebbles with respect to some walk W W W ending in some t ∈ avoid M ( { π 1 ( a 1 ) , … , π 1 ( a i ) } ) t \in\operatorname{avoid}_{\mathcal{M}}(\{\pi_1(a_1), \ldots, \pi_1(a_i)\}) t ∈ avoid M ({ π 1 ( a 1 ) , … , π 1 ( a i )}) . Suppose Spoiler places a new pebble on some element a i + 1 ∈ A a_{i+1} \in A a i + 1 ∈ A (the case where Spoiler plays in B B B is symmetric).
Since M \mathcal{M} M has order greater than ρ \rho ρ , the set { π 1 ( a 1 ) , … , π 1 ( a i + 1 ) } \{\pi_1(a_1), \ldots, \pi_1(a_{i+1})\} { π 1 ( a 1 ) , … , π 1 ( a i + 1 )} cannot hit M \mathcal{M} M . Hence, there exists M ′ ∈ M M' \in\mathcal{M} M ′ ∈ M such that M ′ ⊆ avoid M ( { π 1 ( a 1 ) , … , π 1 ( a i + 1 ) } ) M' \subseteq\operatorname{avoid}_{\mathcal{M}}(\{\pi_1(a_1), \ldots, \pi_1(a_{i+1})\}) M ′ ⊆ avoid M ({ π 1 ( a 1 ) , … , π 1 ( a i + 1 )}) . Choose some t ′ ∈ M ′ t' \in M' t ′ ∈ M ′ .
Since bramble sets pairwise touch, there exists a walk W ′ W' W ′ from t t t to t ′ t' t ′ whose vertices lie entirely in M ∪ M ′ M \cup M' M ∪ M ′ . Let W ′ ′ W'' W ′′ be the concatenation of the walks W W W and W ′ W' W ′ . Then, W ′ ′ W'' W ′′ is a walk from s s s to t ′ t' t ′ with t ′ ∈ avoid M ( { π 1 ( a 1 ) , … , π 1 ( a i + 1 ) } ) t' \in\operatorname{avoid}_{\mathcal{M}}(\{\pi_1(a_1), \ldots, \pi_1(a_{i+1})\}) t ′ ∈ avoid M ({ π 1 ( a 1 ) , … , π 1 ( a i + 1 )}) .
Duplicator now responds with b i + 1 b_{i+1} b i + 1 such that if a i + 1 ∈ A ρ , m ′ a_{i+1} \in A'_{\rho,m} a i + 1 ∈ A ρ , m ′ , then b i + 1 = a i + 1 b_{i+1}=a_{i+1} b i + 1 = a i + 1 ; otherwise, b i + 1 b_{i+1} b i + 1 is the tuple Ψ W ′ ′ ( a i + 1 ) \Psi_{W''}(a_{i+1}) Ψ W ′′ ( a i + 1 ) .
For ℓ ≤ i \ell\leq i ℓ ≤ i , note that W ′ W' W ′ avoids π 1 ( a 1 ) , … , π 1 ( a i ) \pi_1(a_1), \ldots, \pi_1(a_i) π 1 ( a 1 ) , … , π 1 ( a i ) . Hence, for every edge e ∈ E π 1 ( a ℓ ) e \in E_{\pi_1(a_\ell)} e ∈ E π 1 ( a ℓ ) , we have that occ W ′ ′ ( e ) = occ W ( e ) \operatorname{occ}_{W''}(e)=\operatorname{occ}_{W}(e) occ W ′′ ( e ) = occ W ( e ) . Thus the invariant holds with the new walk W ′ ′ W'' W ′′ .
Consequently, Duplicator has a winning strategy since the invariant can be maintained for at most ρ \rho ρ pebbles, and every position satisfying the invariant is a partial isomorphism (Lemma 5.16 ). □
E Omitted Details From sec:reductions
This section establishes Theorem 4.5 , by reducing the problem to simple QCQs. That is, for any self-join-free QCQ φ \varphi φ and a non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ \theta θ of maximum treewidth, to establish that logwidth ( φ ) > tw ( H θ ) \operatorname{logwidth}(\varphi)>\operatorname{tw}(H_\theta) logwidth ( φ ) > tw ( H θ ) , it suffices to show that logwidth ( ϕ ) > tw ( H θ ) \operatorname{logwidth}(\phi)>\operatorname{tw}(H_\theta) logwidth ( ϕ ) > tw ( H θ ) for a certain simple QCQ ϕ \phi ϕ obtained from φ \varphi φ . The case where our { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region with maximum treewidth is a top region shall be dealt with separately in Section E.5 (although most of the machinery defined in this section will also be used there).
Notation 3. Throughout this section, we fix φ \varphi φ to be an arbitrary standardised self-join-free QCQ such that [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T is a normal form in the system R \mathcal{R} R . We assume there is a non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of φ \varphi φ with maximum treewidth, and we fix θ \theta θ to denote such a region.
For this section, we require some definitions:
Definition E.1. An { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ ′ \theta' θ ′ of φ \varphi φ has the clasped condition if for every u ∈ free ( θ ′ ) u \in\operatorname{free}(\theta') u ∈ free ( θ ′ ) , there exists a variable x x x that is existentially quantified in θ ′ \theta' θ ′ such that u u u and x x x appear in some hyperedge of H θ ′ H_{\theta'} H θ ′ .
Recall that since [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T is a normal form in the system R : = ( Q C Q , → { S ↓ , M } ) ∗ / ↔ T \mathcal{R}:=(\mathrm{QCQ},\to_{\{S_{\downarrow},\mathcal{M}\}})^{*}/\leftrightarrow_{\mathsf{T}} R := ( QCQ , → { S ↓ , M } ) ∗ / ↔ T , every non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of φ \varphi φ has the tightness property (see Lemma 4.6), and therefore immediately has the clasped condition.
Notice that since φ \varphi φ is a standardised and self-join-free QCQ, every region occurring in φ \varphi φ is unique. Indeed, every atomic region of φ \varphi φ must occur exactly once, since φ \varphi φ is self-join-free. Moreover, every non-top and non-atomic region of φ \varphi φ contains a quantifier; otherwise, it would be a { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region only containing conjunction and occurring below a { ∀ } \{\forall\} { ∀ } -region, and thus would permit a splitdown, contradicting [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T being a normal form of R \mathcal{R} R . Therefore, since φ \varphi φ is standardised, every region containing a quantification is unique. The top region either does not contain a quantifier (and thus is unique) or contains the quantification of a variable unique to that region.
Since each region of φ \varphi φ has a unique occurrence, we may say that a region occurs below another region without ambiguity. Moreover, we may define the subformula rooted at a region:
Definition E.2. Let ρ \rho ρ be a region of φ \varphi φ . We define the subformula of φ \varphi φ rooted at ρ \rho ρ , denoted sub φ ( ρ ) \operatorname{sub}_{\varphi}(\rho) sub φ ( ρ ) , to be the unique subformula of φ \varphi φ whose top region is ρ \rho ρ .
Since every region has a unique occurrence, this is well-defined. Next, we define the contraction of a region:
Definition E.3. For a { ∀ } \{\forall\} { ∀ } region ρ \rho ρ of φ \varphi φ where ∣ free ( ρ ) ∣ ≥ 1 |\operatorname{free}(\rho)| \ge1 ∣ free ( ρ ) ∣ ≥ 1 , the contraction of φ \varphi φ at ρ \rho ρ , denoted by φ ρ c t r \varphi_{\rho}^{\mathrm{ctr}} φ ρ ctr is defined as follows: Let F ρ : = { z 1 , … , z m } F_{\rho} := \{z_{1}, \ldots, z_{m}\} F ρ := { z 1 , … , z m } be the free variables of ρ \rho ρ , given in an arbitrary order. Introduce a new and unique binary relation R z i , z j ρ R_{z_i,z_j}^{\rho} R z i , z j ρ for each pair z i , z j ∈ F ρ z_i,z_j \in F_{\rho} z i , z j ∈ F ρ where i ≤ j i \le j i ≤ j . Then, φ ρ c t r \varphi_{\rho}^{\mathrm{ctr}} φ ρ ctr is obtained by replacing sub φ ( ρ ) \operatorname{sub}_{\varphi}(\rho) sub φ ( ρ ) with ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) \bigwedge_{1 \le i \le j \le m} R_{z_i,z_j}^{\rho}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) .
Intuitively speaking, we shall use Definition E.3 to contract all regions that occur below our distinguished { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region with maximum treewidth. Once this has been done, we are able to assume our distinguished region only has atomic child regions.
Contracting Basic Regions
We say that a { ∀ } \{\forall\} { ∀ } -region ρ \rho ρ of φ \varphi φ is a θ \theta θ -basic region if ρ \rho ρ that occurs below θ \theta θ , and ρ \rho ρ has a single child region that is an atom α \alpha α . The first technical step is to contract all θ \theta θ -basic regions.
Lemma E.4. Let ρ \rho ρ be a θ \theta θ -basic region of φ \varphi φ where ∣ free ( ρ ) ∣ ≥ 1 |\operatorname{free}(\rho)| \ge1 ∣ free ( ρ ) ∣ ≥ 1 . Let φ ′ : = φ ρ c t r \varphi' := \varphi_{\rho}^{\mathrm{ctr}} φ ′ := φ ρ ctr . If there exist variable-sorted structures A \mathcal{A} A and B \mathcal{B} B over the signature of φ ′ \varphi' φ ′ such that
A ⊨ v a r φ ′ , B ̸ ⊨ v a r φ ′ , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi',\ \mathcal{B} \not\models_{\mathrm{var}} \varphi',\ \mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B}, A ⊨ var φ ′ , B ⊨ var φ ′ , A ≡ var k B ,
then, there exist variable-sorted structures A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + over the signature of φ \varphi φ such that
A + ⊨ v a r φ , B + ̸ ⊨ v a r φ , A + ≡ v a r k B + . \mathcal{A}^{+} \models_{\mathrm{var}} \varphi,\ \mathcal{B}^{+} \not\models_{\mathrm{var}} \varphi,\ \mathcal{A}^{+} \equiv_{\mathrm{var}}^{k} \mathcal{B}^{+}. A + ⊨ var φ , B + ⊨ var φ , A + ≡ var k B + .
Proof. Let F ρ = free ( ρ ) = { z 1 , … , z m } F_{\rho} = \operatorname{free}(\rho) = \{z_{1}, \ldots, z_{m}\} F ρ = free ( ρ ) = { z 1 , … , z m } , where m ≥ 1 m \ge1 m ≥ 1 , and let ψ : = sub φ ( ρ ) \psi:= \operatorname{sub}_{\varphi}(\rho) ψ := sub φ ( ρ ) , that is:
ψ ( z 1 , … , z m ) = ∀ y 1 ⋯ ∀ y ℓ R ( t 1 , … , t r ) \psi(z_{1},\ldots,z_{m}) = \forall y_{1}\cdots\forall y_{\ell}\,R(t_{1},\ldots,t_{r}) ψ ( z 1 , … , z m ) = ∀ y 1 ⋯ ∀ y ℓ R ( t 1 , … , t r )
for some atom R ( t 1 , … , t r ) R(t_{1},\ldots,t_{r}) R ( t 1 , … , t r ) and some variables y 1 , … , y ℓ y_{1},\ldots,y_{\ell} y 1 , … , y ℓ with ℓ ≥ 1 \ell\ge1 ℓ ≥ 1 . For convenience, let R i , j C : = ( R z i , z j ρ ) C R_{i,j}^{C} := \left(R_{z_i,z_j}^{\rho}\right)^{C} R i , j C := ( R z i , z j ρ ) C for each C ∈ { A , B } C \in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } and each $1 \le i \le j \le m$.
We now define, for each C ∈ { A , B } C \in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } , a variable-sorted structure C + C^{+} C + over the signature of φ \varphi φ . Since φ \varphi φ is standardised, the variables y 1 , … , y ℓ y_{1},\ldots,y_{\ell} y 1 , … , y ℓ occur only inside ψ \psi ψ . For each j ∈ [ ℓ ] j \in[\ell] j ∈ [ ℓ ] , set C y j + : = { ∗ y j } C_{y_j}^{+} := \{\ast_{y_j}\} C y j + := { ∗ y j } . For every other variable u u u of φ \varphi φ , set C u + : = C u C_{u}^{+} := C_{u} C u + := C u , where C u C_{u} C u is the domain for u u u in C C C .
For every relation symbol Q Q Q occurring in φ \varphi φ with Q ≠ R Q \ne R Q = R , set Q C + : = Q C Q^{C^{+}} := Q^{C} Q C + := Q C . This is well-defined since R R R occurs in ψ \psi ψ and φ \varphi φ is self-join-free. Moreover, every relation symbol Q ≠ R Q \ne R Q = R occurring in φ \varphi φ also occurs in φ ′ \varphi' φ ′ , and, since φ \varphi φ is standardised, its domains are inherited from C C C .
For each i ∈ [ m ] i \in[m] i ∈ [ m ] , fix one position p i ∈ [ r ] p_i \in[r] p i ∈ [ r ] such that t p i = z i t_{p_i} = z_i t p i = z i , which must exist since z 1 , … , z m z_1,\ldots,z_m z 1 , … , z m are the free variables of ψ \psi ψ . It remains to define the interpretation of R R R in C + C^{+} C + . For every tuple ( c 1 , … , c r ) ∈ C t 1 + × ⋯ × C t r + (c_1,\ldots,c_r) \in C_{t_1}^{+} \times\cdots\times C_{t_r}^{+} ( c 1 , … , c r ) ∈ C t 1 + × ⋯ × C t r + where C t q + C_{t_q}^{+} C t q + denotes the domain of the variable t q t_q t q , let
( c 1 , … , c r ) ∈ R C + ⟺ ( c p i , c p j ) ∈ R i , j C for every 1 ≤ i ≤ j ≤ m . (c_1,\ldots,c_r) \in R^{C^{+}} \Longleftrightarrow(c_{p_i},c_{p_j}) \in R_{i,j}^{C}\ \text{for every } 1 \le i \le j \le m. ( c 1 , … , c r ) ∈ R C + ⟺ ( c p i , c p j ) ∈ R i , j C for every 1 ≤ i ≤ j ≤ m .
The components occupied by the variables y 1 , … , y ℓ y_1,\ldots,y_{\ell} y 1 , … , y ℓ simply take the value from their singleton domain.
We claim that for every assignment σ \sigma σ defined on F ρ F_{\rho} F ρ , we have
( C + , σ ) ⊨ v a r ψ ⟺ ( C , σ ) ⊨ v a r ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) . (1) (C^{+},\sigma) \models_{\mathrm{var}} \psi\Longleftrightarrow(C,\sigma) \models_{\mathrm{var}} \bigwedge_{1 \le i \le j \le m} R_{z_i,z_j}^{\rho}(z_i,z_j). \tag*{(1)} ( C + , σ ) ⊨ var ψ ⟺ ( C , σ ) ⊨ var 1 ≤ i ≤ j ≤ m ⋀ R z i , z j ρ ( z i , z j ) . (1)
Since each C y j + C^+_{y_j} C y j + is a singleton, there is exactly one extension of σ \sigma σ that includes the variables y 1 , … , y ℓ y_1,\ldots,y_\ell y 1 , … , y ℓ . Let σ ′ \sigma' σ ′ be such an extension, then ( C + , σ ′ ) ⊨ v a r R ( t 1 , … , t r ) (C^+,\sigma') \models_{\mathrm{var}} R(t_1,\ldots,t_r) ( C + , σ ′ ) ⊨ var R ( t 1 , … , t r ) if and only if ( σ ( z i ) , σ ( z j ) ) ∈ R i , j C (\sigma(z_i),\sigma(z_j)) \in R^{C}_{i,j} ( σ ( z i ) , σ ( z j )) ∈ R i , j C for every $1 \leq i \leq j \leq m$, by the definition of R C + R^{C^+} R C + . Thus, Eq. (1) holds.
Since φ ′ \varphi' φ ′ is obtained from φ \varphi φ by replacing ψ \psi ψ with ⋁ 1 ≤ i ≤ j ≤ m R z i , z j R ( z i , z j ) \bigvee_{1\leq i\leq j\leq m} R^{\mathcal{R}}_{z_i,z_j}(z_i,z_j) ⋁ 1 ≤ i ≤ j ≤ m R z i , z j R ( z i , z j ) , along with Eq. (1), a straightforward induction on the syntax tree of φ \varphi φ , gives us C ⊨ v a r φ C \models_{\mathrm{var}} \varphi C ⊨ var φ if and only if C ⊨ v a r φ ′ C \models_{\mathrm{var}} \varphi' C ⊨ var φ ′ for each C ∈ { A , B } C \in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } . Hence, A + ⊨ v a r φ \mathcal{A}^+ \models_{\mathrm{var}} \varphi A + ⊨ var φ and B + ̸ ⊨ v a r φ \mathcal{B}^+ \not\models_{\mathrm{var}} \varphi B + ⊨ var φ .
It remains to be shown that A + ≡ v a r k B + \mathcal{A}^+ \equiv^k_{\mathrm{var}} \mathcal{B}^+ A + ≡ var k B + . Duplicator transfers their winning strategy from the k k k -pebble game over A \mathcal{A} A and B \mathcal{B} B to the k k k -pebble game over A + \mathcal{A}^+ A + and B + \mathcal{B}^+ B + as follows: If Spoiler plays an element that inherited from A \mathcal{A} A or B \mathcal{B} B , Duplicator responds according to the original winning strategy over A \mathcal{A} A and B \mathcal{B} B . If Spoiler plays the unique element ∗ y j *_{y_j} ∗ y j in one of the new singleton domains, Duplicator plays ∗ y j *_{y_j} ∗ y j on the other side. The strategy is symmetric for moves made in B + \mathcal{B}^+ B + by Spoiler.
We verify that every position reached by this strategy is a partial isomorphism. First, immediately from Duplicator’s strategy, every position reached results in an injective partial mapping. Every relation symbol Q ≠ R Q \ne R Q = R is dealt with by the original strategy, since Q A + = Q A Q^{\mathcal{A}^+}=Q^{\mathcal{A}} Q A + = Q A and Q B + = Q B Q^{\mathcal{B}^+}=Q^{\mathcal{B}} Q B + = Q B .
It remains to consider R R R . Suppose that a 1 , … , a r a_1,\ldots,a_r a 1 , … , a r are pebbled elements from A + \mathcal{A}^+ A + and b 1 , … , b r b_1,\ldots,b_r b 1 , … , b r are the corresponding pebbled elements from B + \mathcal{B}^+ B + such that ( a 1 , … , a r ) ∈ R A + (a_1,\ldots,a_r) \in R^{\mathcal{A}^+} ( a 1 , … , a r ) ∈ R A + . The components corresponding to variables among y 1 , … , y ℓ y_1,\ldots,y_\ell y 1 , … , y ℓ are elements from their singleton domain. For the chosen coordinates p 1 , … , p m p_1,\ldots,p_m p 1 , … , p m corresponding to z 1 , … , z m z_1,\ldots,z_m z 1 , … , z m , membership in R A + R^{\mathcal{A}^+} R A + gives ( a p i , a p j ) ∈ R i , j A (a_{p_i},a_{p_j}) \in R^{\mathcal{A}}_{i,j} ( a p i , a p j ) ∈ R i , j A for every $1 \leq i \leq j \leq m$. Since R z i , z j φ R^{\varphi}_{z_i,z_j} R z i , z j φ is a relation symbol of φ ′ \varphi' φ ′ , by Duplicator’s strategy we have that ( b p i , b p j ) ∈ R i , j B (b_{p_i},b_{p_j}) \in R^{\mathcal{B}}_{i,j} ( b p i , b p j ) ∈ R i , j B for every 1 ≤ i ≤ j ≤ m . H e n c e , b y t h e d e f i n i t i o n o f 1 \leq i \leq j \leq m. Hence, by the definition of 1 ≤ i ≤ j ≤ m . H e n ce , b y t h e d e f ini t i o n o f R^{\mathcal{B}^+}$, we have that ( b 1 , … , b r ) ∈ R B + (b_1,\ldots,b_r) \in R^{\mathcal{B}^+} ( b 1 , … , b r ) ∈ R B + . The converse implication, from B + \mathcal{B}^+ B + to A + \mathcal{A}^+ A + , is identical.
Thus, every reachable position under Duplicator’s strategy is a partial isomorphism. Therefore A + ≡ v a r k B + \mathcal{A}^+ \equiv^k_{\mathrm{var}} \mathcal{B}^+ A + ≡ var k B + .
Notation
Notation 4. For the remainder of this section, fix φ 2 \varphi_2 φ 2 to denote the self-join-free QCQ obtained from φ \varphi φ by iteratively and exhaustively contracting all θ \theta θ -basic regions.
Lemma E.5. If there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 2 , B ̸ ⊨ v a r φ 2 , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi_2,\qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_2,\qquad\mathcal{A} \equiv^k_{\mathrm{var}} \mathcal{B}, A ⊨ var φ 2 , B ⊨ var φ 2 , A ≡ var k B , then logwidth ( φ ) > k \operatorname{logwidth}(\varphi) > k logwidth ( φ ) > k .
Proof. Suppose that there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 2 , B ̸ ⊨ v a r φ 2 , A ≡ v a r k B . \mathcal{A} \models_{\mathrm{var}} \varphi_2,\qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_2,\qquad\mathcal{A} \equiv^k_{\mathrm{var}} \mathcal{B}. A ⊨ var φ 2 , B ⊨ var φ 2 , A ≡ var k B .
Let Ψ 1 , Ψ 2 , … , Ψ r \Psi_1,\Psi_2,\ldots,\Psi_r Ψ 1 , Ψ 2 , … , Ψ r be the intermediate formulae that are obtained on the way to φ 2 \varphi_2 φ 2 . That is, let Ψ 1 = φ \Psi_1=\varphi Ψ 1 = φ , Ψ r = φ 2 \Psi_r=\varphi_2 Ψ r = φ 2 , and where, for i ∈ [ r − 1 ] i \in[r-1] i ∈ [ r − 1 ] , the formula Ψ i + 1 \Psi_{i+1} Ψ i + 1 is obtained from Ψ i \Psi_i Ψ i by contracting a θ \theta θ -basic region. By Lemma E.4 (which applies verbatim, even though it is stated in terms of φ \varphi φ ) for i ∈ [ r − 1 ] i \in[r-1] i ∈ [ r − 1 ] , if there exist variable-sorted structures A i + 1 \mathcal{A}_{i+1} A i + 1 and B i + 1 \mathcal{B}_{i+1} B i + 1 such that
A i + 1 ⊨ v a r Ψ i + 1 , B i + 1 ̸ ⊨ v a r Ψ i + 1 , A i + 1 ≡ v a r k B i + 1 , \mathcal{A}_{i+1} \models_{\mathrm{var}} \Psi_{i+1},\qquad\mathcal{B}_{i+1} \not\models_{\mathrm{var}} \Psi_{i+1},\qquad\mathcal{A}_{i+1} \equiv^k_{\mathrm{var}} \mathcal{B}_{i+1}, A i + 1 ⊨ var Ψ i + 1 , B i + 1 ⊨ var Ψ i + 1 , A i + 1 ≡ var k B i + 1 ,
then there exist variable-sorted structures A i \mathcal{A}_i A i and B i \mathcal{B}_i B i such that
A i ⊨ v a r Ψ i , B i ̸ ⊨ v a r Ψ i , A i ≡ v a r k B i . \mathcal{A}_i \models_{\mathrm{var}} \Psi_i,\qquad\mathcal{B}_i \not\models_{\mathrm{var}} \Psi_i,\qquad\mathcal{A}_i \equiv^k_{\mathrm{var}} \mathcal{B}_i. A i ⊨ var Ψ i , B i ⊨ var Ψ i , A i ≡ var k B i .
Thus, with A = A r \mathcal{A}=\mathcal{A}_r A = A r and B = B r \mathcal{B}=\mathcal{B}_r B = B r , there exist structures A 1 \mathcal{A}_1 A 1 and B 1 \mathcal{B}_1 B 1 with
A 1 ⊨ v a r φ , B 1 ̸ ⊨ v a r φ , A 1 ≡ v a r k B 1 . \mathcal{A}_1 \models_{\mathrm{var}} \varphi,\qquad\mathcal{B}_1 \not\models_{\mathrm{var}} \varphi,\qquad\mathcal{A}_1 \equiv^k_{\mathrm{var}} \mathcal{B}_1. A 1 ⊨ var φ , B 1 ⊨ var φ , A 1 ≡ var k B 1 .
Finally, invoking Lemma 2.9, we have that logwidth ( φ ) > k \operatorname{logwidth}(\varphi) > k logwidth ( φ ) > k .
Binary Relation Encoding
In this section, we take φ 2 \varphi_2 φ 2 and construct φ 3 \varphi_3 φ 3 which is a self-join-free QCQ over a binary signature (that is, all atomic formulae that appear in φ 3 \varphi_3 φ 3 are applications of binary, unary, or nullary relation symbols). We call φ 3 \varphi_3 φ 3 the binary relation encoding of φ 2 \varphi_2 φ 2 , and is defined as follows:
Notation 5. Fix φ 3 \varphi_3 φ 3 to be the formula obtained from φ 2 \varphi_2 φ 2 by replacing each atomic formula of the form R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) , where r > 2 r>2 r > 2 , with ⋀ 1 ≤ i < j ≤ r R i , j ( x i , x j ) \bigwedge_{1\le i<j\le r}R_{i,j}(x_i,x_j) ⋀ 1 ≤ i < j ≤ r R i , j ( x i , x j ) where R i , j R_{i,j} R i , j is a new relation symbol for each i , j i,j i , j and each such relation symbol R R R .
Notice that in the binary relation encoding, we simply replace atomic formulae with a conjunction of atomic formulae. Therefore, there is a one-to-one mapping between a { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region in φ 2 \varphi_2 φ 2 and the corresponding { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region (with which the original region is replaced) in φ 3 \varphi_3 φ 3 .
Observation 1. Let χ \chi χ be an arbitrary { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region of φ 2 \varphi_2 φ 2 , and let χ ′ \chi' χ ′ be the corresponding { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region in φ 3 \varphi_3 φ 3 . Then, the primal graphs of H χ H_\chi H χ and H χ ′ H_{\chi'} H χ ′ are isomorphic.
Proof. Take any two variables x x x and y y y that appear in φ 2 \varphi_2 φ 2 . Note that the construction of φ 3 \varphi_3 φ 3 does not add or remove any variables, and therefore x x x and y y y appear in φ 3 \varphi_3 φ 3 . Let G χ G_\chi G χ and G χ ′ G_{\chi'} G χ ′ be the primal graphs of H χ H_\chi H χ and H χ ′ H_{\chi'} H χ ′ respectively. If { x , y } \{x,y\} { x , y } appears as an edge of G χ G_\chi G χ , then x x x and y y y appear in some atomic formula of φ 2 \varphi_2 φ 2 (or are both free variables of χ \chi χ ) and by the construction of φ 3 \varphi_3 φ 3 must also appear in some atomic formula of φ 3 \varphi_3 φ 3 (or are also free variables of χ ′ \chi' χ ′ ), implying { x , y } \{x,y\} { x , y } appears as an edge of G χ ′ G_{\chi'} G χ ′ . The other direction is symmetric. □
Notation 6. Fix θ ˉ \bar{\theta} θ ˉ to be the { ∃ , ∧ } \{\exists,\land\} { ∃ , ∧ } -region of φ 3 \varphi_3 φ 3 that corresponds to the region θ \theta θ of φ 2 \varphi_2 φ 2 . Recall that θ \theta θ is the region of φ 2 \varphi_2 φ 2 with maximum treewidth.
Lemma E.6. If there exist variable-sorted structures A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + such that
A + ⊨ v a r φ 3 , B + ̸ ⊨ v a r φ 3 , A + ≡ v a r k B + , \mathcal{A}^{+}\models_{\mathrm{var}}\varphi_3,\qquad\mathcal{B}^{+}\not\models_{\mathrm{var}}\varphi_3,\qquad\mathcal{A}^{+}\equiv_{\mathrm{var}}^{k}\mathcal{B}^{+}, A + ⊨ var φ 3 , B + ⊨ var φ 3 , A + ≡ var k B + ,
then there exist variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 2 , B ̸ ⊨ v a r φ 2 , A ≡ v a r k B . \mathcal{A}\models_{\mathrm{var}}\varphi_2,\qquad\mathcal{B}\not\models_{\mathrm{var}}\varphi_2,\qquad\mathcal{A}\equiv_{\mathrm{var}}^{k}\mathcal{B}. A ⊨ var φ 2 , B ⊨ var φ 2 , A ≡ var k B .
Proof. Suppose the existence of variable-sorted structures A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + such that A + ⊨ v a r φ 3 \mathcal{A}^{+}\models_{\mathrm{var}}\varphi_3 A + ⊨ var φ 3 , B + ̸ ⊨ v a r φ 3 \mathcal{B}^{+}\not\models_{\mathrm{var}}\varphi_3 B + ⊨ var φ 3 and A + ≡ v a r k B + \mathcal{A}^{+}\equiv_{\mathrm{var}}^{k}\mathcal{B}^{+} A + ≡ var k B + .
We shall define A \mathcal{A} A over the signature of φ 2 \varphi_2 φ 2 . Let A \mathcal{A} A have the same universe as A + \mathcal{A}^{+} A + for every variable. For any nullary, unary, or binary relation symbol P P P , let P A : = P A + P^{\mathcal{A}}:=P^{\mathcal{A}^{+}} P A := P A + .
Now let R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) be an atomic formula that appears in φ 2 \varphi_2 φ 2 where r > 2 r>2 r > 2 . Define R A R^{\mathcal{A}} R A such that:
( a 1 , … , a r ) ∈ R A ⟺ ( a i , a j ) ∈ R i , j A + for all 1 ≤ i < j ≤ r . (a_1,\ldots,a_r)\in R^{\mathcal{A}}\Longleftrightarrow(a_i,a_j)\in R_{i,j}^{\mathcal{A}^{+}}\text{ for all }1\le i<j\le r. ( a 1 , … , a r ) ∈ R A ⟺ ( a i , a j ) ∈ R i , j A + for all 1 ≤ i < j ≤ r .
Next, we show that A ⊨ v a r φ 3 ⟺ A ⊨ v a r φ 2 \mathcal{A}\models_{\mathrm{var}}\varphi_3\Longleftrightarrow\mathcal{A}\models_{\mathrm{var}}\varphi_2 A ⊨ var φ 3 ⟺ A ⊨ var φ 2 . Notice that for any variable assignment f f f on x 1 , … , x r x_1,\ldots,x_r x 1 , … , x r we have that:
( A , f ) ⊨ v a r R ( x 1 , … , x r ) ⟺ ( A + , f ) ⊨ v a r ⋀ 1 ≤ i < j ≤ r R i , j ( x i , x j ) . (\mathcal{A},f)\models_{\mathrm{var}}R(x_1,\ldots,x_r)\Longleftrightarrow(\mathcal{A}^{+},f)\models_{\mathrm{var}}\bigwedge_{1\le i<j\le r}R_{i,j}(x_i,x_j). ( A , f ) ⊨ var R ( x 1 , … , x r ) ⟺ ( A + , f ) ⊨ var 1 ≤ i < j ≤ r ⋀ R i , j ( x i , x j ) .
Moreover, φ 3 \varphi_3 φ 3 is obtained by replacing each atom R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) with r > 2 r>2 r > 2 with ⋀ 1 ≤ i < j ≤ r R i , j ( x i , x j ) \bigwedge_{1\le i<j\le r}R_{i,j}(x_i,x_j) ⋀ 1 ≤ i < j ≤ r R i , j ( x i , x j ) . Thus, A + ⊨ v a r φ 3 ⟺ A ⊨ v a r φ 2 \mathcal{A}^{+}\models_{\mathrm{var}}\varphi_3\Longleftrightarrow\mathcal{A}\models_{\mathrm{var}}\varphi_2 A + ⊨ var φ 3 ⟺ A ⊨ var φ 2 by a straightforward induction on the syntax tree. The analogous statement holds for B + \mathcal{B}^{+} B + and B \mathcal{B} B . Assuming A + ⊨ v a r φ 3 \mathcal{A}^{+}\models_{\mathrm{var}}\varphi_3 A + ⊨ var φ 3 and B + ̸ ⊨ v a r φ 3 \mathcal{B}^{+}\not\models_{\mathrm{var}}\varphi_3 B + ⊨ var φ 3 , we get A ⊨ v a r φ 2 \mathcal{A}\models_{\mathrm{var}}\varphi_2 A ⊨ var φ 2 and B ̸ ⊨ v a r φ 2 \mathcal{B}\not\models_{\mathrm{var}}\varphi_2 B ⊨ var φ 2 .
All that remains is to prove A + ≡ v a r k B + ⟹ A ≡ v a r k B \mathcal{A}^{+}\equiv_{\mathrm{var}}^{k}\mathcal{B}^{+}\Longrightarrow\mathcal{A}\equiv_{\mathrm{var}}^{k}\mathcal{B} A + ≡ var k B + ⟹ A ≡ var k B . Consider any position ( α , β ) (\alpha,\beta) ( α , β ) of the k k k -pebble game over A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + that results from Duplicator’s winning strategy. Let a 1 , … , a m ∈ A a_1,\ldots,a_m\in A a 1 , … , a m ∈ A and b 1 , … , b m ∈ B b_1,\ldots,b_m\in B b 1 , … , b m ∈ B for some m ≤ k m\le k m ≤ k such that α ( p i ) = a i \alpha(p_i)=a_i α ( p i ) = a i and β ( p i ) = b i \beta(p_i)=b_i β ( p i ) = b i for pebbles p 1 , … , p m p_1,\ldots,p_m p 1 , … , p m . Immediately, ( α , β ) (\alpha,\beta) ( α , β ) forms a partial isomorphism between A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + . We claim that ( α , β ) (\alpha,\beta) ( α , β ) also forms a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B .
Suppose ( a i 1 , … , a i r ) ∈ R A (a_{i_1},\ldots,a_{i_r})\in R^{\mathcal{A}} ( a i 1 , … , a i r ) ∈ R A for any relation symbol R R R where r > 2 r>2 r > 2 , and i 1 , … , i r ∈ { 1 , … , m } i_1,\ldots,i_r\in\{1,\ldots,m\} i 1 , … , i r ∈ { 1 , … , m } . By the definition of R A R^{\mathcal{A}} R A it holds that ⋀ 1 ≤ p < q ≤ r R p , q A + ( a i p , a i q ) \bigwedge_{1\leq p<q\leq r}R^{\mathcal{A}^{+}}_{p,q}(a_{i_p},a_{i_q}) ⋀ 1 ≤ p < q ≤ r R p , q A + ( a i p , a i q ) and since ( α , β ) (\alpha,\beta) ( α , β ) forms a partial isomorphism, we have that ⋀ 1 ≤ p < q ≤ r R p , q B + ( b i p , b i q ) \bigwedge_{1\leq p<q\leq r}R^{\mathcal{B}^{+}}_{p,q}(b_{i_p},b_{i_q}) ⋀ 1 ≤ p < q ≤ r R p , q B + ( b i p , b i q ) . Immediately from the definition of R p , q B + R^{\mathcal{B}^{+}}_{p,q} R p , q B + for 1 ≤ p < q ≤ r 1\leq p<q\leq r 1 ≤ p < q ≤ r , it follows that ( b i 1 , … , b i r ) ∈ R B (b_{i_1},\ldots,b_{i_r})\in R^{\mathcal{B}} ( b i 1 , … , b i r ) ∈ R B . The converse direction (from R B R^{\mathcal{B}} R B to R A R^{\mathcal{A}} R A ) is symmetric. The proof concludes by noticing that unary and binary relations remain unchanged between A \mathcal{A} A and A + \mathcal{A}^{+} A + , and B \mathcal{B} B and B + \mathcal{B}^{+} B + . □ \square □
Recall that φ 3 \varphi_3 φ 3 is a self-join-free QCQ obtained from φ \varphi φ by contracting all the θ \theta θ -basic regions, and then performing the binary relation encoding.
Lemma E.7. If there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ 3 \mathcal{A}\models_{\mathrm{var}}\varphi_3 A ⊨ var φ 3 , B ̸ ⊨ v a r φ 3 \mathcal{B}\not\models_{\mathrm{var}}\varphi_3 B ⊨ var φ 3 , A ≡ v a r k B \mathcal{A}\equiv^{k}_{\mathrm{var}}\mathcal{B} A ≡ var k B , then logwidth ( φ ) > k \operatorname{logwidth}(\varphi)>k logwidth ( φ ) > k .
Proof. This follows by combining Lemma E.6 and Lemma E.4. □ \square □
Contracting More Regions
We say that a { ∀ } \{\forall\} { ∀ } -region ρ \rho ρ of φ 3 \varphi_3 φ 3 is a lowest { ∀ } \{\forall\} { ∀ } -region of φ 3 \varphi_3 φ 3 if sub φ 3 ( ρ ) \operatorname{sub}_{\varphi_3}(\rho) sub φ 3 ( ρ ) does not have a non-top { ∀ } \{\forall\} { ∀ } -region. In other words, ρ \rho ρ is the unique { ∀ } \{\forall\} { ∀ } -region in sub φ 3 ( ρ ) \operatorname{sub}_{\varphi_3}(\rho) sub φ 3 ( ρ ) .
Lemma E.8. For any lowest { ∀ } \{\forall\} { ∀ } -region ρ \rho ρ that occurs below θ \theta θ , we have that sub φ 3 ( ρ ) = ρ ⟦ χ ⟧ \operatorname{sub}_{\varphi_3}(\rho)=\rho\llbracket\chi\rrbracket sub φ 3 ( ρ ) = ρ [ [ χ ] ] where χ \chi χ is an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region such that:
The top node of the parse tree of χ \chi χ is an existential quantifier,
all child regions of χ \chi χ are atomic,
χ \chi χ has the connectivity property, and
χ \chi χ has the clasped condition.
Proof. Note that in our original QCQ φ \varphi φ , the subformulae rooted at any lowest { ∀ } \{\forall\} { ∀ } -regions are of the form ( ∀ y 1 ′ ⋯ ∀ y 1 ′ ) ⟦ χ ⟧ (\forall y'_1\cdots\forall y'_1)\llbracket\chi\rrbracket ( ∀ y 1 ′ ⋯ ∀ y 1 ′ ) [ [ χ ] ] , where either:
χ \chi χ is an atomic formula, or
χ \chi χ is an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -formula with an existential quantifier as the top node of the parse tree.
This holds by the following reasoning: The only alternative for χ \chi χ is that it is an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -formula with conjunction as the top node of the parse tree. However, we can then perform the splitdown rule on φ \varphi φ , contradicting the fact that [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T is a normal form in the system R \mathcal{R} R .
We know that χ \chi χ has the connectivity property and the tightness property if χ \chi χ is a non-atomic { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region; recall Lemma 4.6. Further recall that to obtain φ 3 \varphi_3 φ 3 , we first contracted all the θ \theta θ -basic regions (after which, all subformulae rooted at a lowest { ∀ } \{\forall\} { ∀ } region below θ \theta θ have a non-atomic { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } child region), then performed a binary relation encoding. Therefore, there are no { ∀ } \{\forall\} { ∀ } -regions occurring below θ ˉ \bar{\theta} θ ˉ whose subformula has the form ρ ⟦ χ ⟧ \rho\llbracket\chi\rrbracket ρ [ [ χ ] ] with χ \chi χ being an atom. Recall that θ ˉ \bar{\theta} θ ˉ is the region of φ 3 \varphi_3 φ 3 that corresponds to the distinguished region θ \theta θ of φ \varphi φ .
Thus, for any lowest { ∀ } \{\forall\} { ∀ } -region ρ \rho ρ occurring below θ ˉ \bar{\theta} θ ˉ , we have that sub φ 3 ( ρ ) \operatorname{sub}_{\varphi_3}(\rho) sub φ 3 ( ρ ) is of the form ( ∀ y 1 ′ ⋯ ∀ y 1 ′ ) ⟦ χ ′ ⟧ (\forall y'_1\cdots\forall y'_1)\llbracket\chi'\rrbracket ( ∀ y 1 ′ ⋯ ∀ y 1 ′ ) [ [ χ ′ ] ] where χ ′ \chi' χ ′ is a non-atomic { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region. The binary relation encoding simply replaces atoms with a conjunction of binary atoms. Therefore, the top node of the parse tree of χ ′ \chi' χ ′ must be an existential quantifier. Clearly all child regions of χ ′ \chi' χ ′ must be atomic, since otherwise they are a { ∀ } \{\forall\} { ∀ } -region, contradicting ρ \rho ρ being a lowest { ∀ } \{\forall\} { ∀ } -region. The fact that χ ′ \chi' χ ′ has the connectivity property and the clasped condition follows immediately from Observation 1, and the fact that the
hyperedge representing a θ \theta θ -basic region has been replaced with an equivalent clique when passing from φ \varphi φ to φ 3 \varphi_3 φ 3 . □
Next, we work towards a result analogous to Lemma E.4 for the more difficult case where we contract a subformula of the form ∀ y ˉ ∃ x ˉ χ \forall\bar{y}\exists\bar{x}\,\chi ∀ y ˉ ∃ x ˉ χ , where χ \chi χ is a conjunction of atomic formulae. Fix ρ \rho ρ to be an arbitrary region below θ ˉ \bar{\theta} θ ˉ such that sub φ 3 ( ρ ) \operatorname{sub}_{\varphi_3}(\rho) sub φ 3 ( ρ ) is of the form
ψ ( z 1 , … , z m ) = ∀ y 1 ⋯ ∀ y ℓ ∃ x 1 ⋯ ∃ x n χ \psi(z_1,\ldots,z_m)=\forall y_1\cdots\forall y_\ell\exists x_1\cdots\exists x_n\,\chi ψ ( z 1 , … , z m ) = ∀ y 1 ⋯ ∀ y ℓ ∃ x 1 ⋯ ∃ x n χ
where χ \chi χ is a conjunction of binary atomic formulae, and where m , ℓ , n ≥ 1 m,\ell,n\ge1 m , ℓ , n ≥ 1 . Fix ζ \zeta ζ to be the inner region ∃ x 1 ⋯ ∃ x n χ \exists x_1\cdots\exists x_n\,\chi ∃ x 1 ⋯ ∃ x n χ of ψ \psi ψ .
Recall that when contracting ρ \rho ρ , we replace ψ \psi ψ with ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) \bigwedge_{1\le i\le j\le m}R^\rho_{z_i,z_j}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) . Let C C C be an arbitrary variable-sorted structure over the signature of ( φ 3 ) ρ ctr (\varphi_3)^{\operatorname{ctr}}_\rho ( φ 3 ) ρ ctr . We define the structure C ρ C^\rho C ρ over the signature of φ 3 \varphi_3 φ 3 . For convenience, let R i , j C : = ( R z i , z j ρ ) C R^C_{i,j}:=(R^\rho_{z_i,z_j})^C R i , j C := ( R z i , z j ρ ) C for each 1 ≤ i ≤ j ≤ m 1\le i\le j\le m 1 ≤ i ≤ j ≤ m .
Defining the Structure C ρ C^\rho C ρ
Domains. For each variable u u u of φ 3 \varphi_3 φ 3 , let C u C_u C u be the domain of u u u in C C C . We define the domain C u ρ C^\rho_u C u ρ of u u u in C ρ C^\rho C ρ as follows:
For every variable u u u of φ 3 \varphi_3 φ 3 that is not quantified inside ψ \psi ψ , set C u ρ : = C u C^\rho_u:=C_u C u ρ := C u .
For each t < ℓ t<\ell t < ℓ , set C y t ρ : = { ∗ y t } C^\rho_{y_t}:=\{\ast_{y_t}\} C y t ρ := { ∗ y t } .
Set C y ℓ ρ : = { s z i ∣ i ∈ [ m ] } C^\rho_{y_\ell}:=\{s_{z_i}\mid i\in[m]\} C y ℓ ρ := { s z i ∣ i ∈ [ m ]} .
Set C x p ρ : = { ( z i , a , x p ) ∣ i ∈ [ m ] , a ∈ C z i } C^\rho_{x_p}:=\{(z_i,a,x_p)\mid i\in[m],\,a\in C_{z_i}\} C x p ρ := {( z i , a , x p ) ∣ i ∈ [ m ] , a ∈ C z i } for every p ∈ [ n ] p\in[n] p ∈ [ n ] .
Interpretation of Relation Symbols. For every relation symbol Q Q Q that appears in φ 3 \varphi_3 φ 3 but does not appear in ψ \psi ψ , let Q C ρ : = Q C Q^{C^\rho}:=Q^C Q C ρ := Q C . This is well-defined since φ 3 \varphi_3 φ 3 is standardised and self-join-free. Let us define the interpretation of relation symbols according to the corresponding atom in χ \chi χ , up to reversing the order of the variables:
For each relation symbol S S S such that S ( z i , x p ) ∈ χ S(z_i,x_p)\in\chi S ( z i , x p ) ∈ χ for some i ∈ [ m ] i\in[m] i ∈ [ m ] and p ∈ [ n ] p\in[n] p ∈ [ n ] , let
S C ρ : = { ( a , ( z j , b , x p ) ) | j ∈ [ m ] , b ∈ C z j , { ( a , b ) ∈ R i , j C if i ≤ j , ( b , a ) ∈ R j , i C if i > j } . S^{C^\rho}:=\left\{(a,(z_j,b,x_p))\ \middle|\ j\in[m],\,b\in C_{z_j},\,
\begin{cases}
(a,b)\in R^C_{i,j} & \text{if }i\le j,\\
(b,a)\in R^C_{j,i} & \text{if }i>j
\end{cases}
\right\}. S C ρ := { ( a , ( z j , b , x p )) j ∈ [ m ] , b ∈ C z j , { ( a , b ) ∈ R i , j C ( b , a ) ∈ R j , i C if i ≤ j , if i > j } .
For each relation symbol P P P such that P ( y ℓ , x p ) ∈ χ P(y_\ell,x_p)\in\chi P ( y ℓ , x p ) ∈ χ for some p ∈ [ n ] p\in[n] p ∈ [ n ] , let
P C ρ : = { ( s z i , ( z i , a , x p ) ) ∣ i ∈ [ m ] , a ∈ C z i } . P^{C^\rho}:=\{(s_{z_i},(z_i,a,x_p))\mid i\in[m],\,a\in C_{z_i}\}. P C ρ := {( s z i , ( z i , a , x p )) ∣ i ∈ [ m ] , a ∈ C z i } .
For each relation symbol E E E such that E ( x p , x q ) ∈ χ E(x_p,x_q)\in\chi E ( x p , x q ) ∈ χ for some p , q ∈ [ n ] p,q\in[n] p , q ∈ [ n ] , let
E C ρ : = { ( ( z i , a , x p ) , ( z i , a , x q ) ) ∣ i ∈ [ m ] , a ∈ C z i } . E^{C^\rho}:=\{((z_i,a,x_p),(z_i,a,x_q))\mid i\in[m],\,a\in C_{z_i}\}. E C ρ := {(( z i , a , x p ) , ( z i , a , x q )) ∣ i ∈ [ m ] , a ∈ C z i } .
For every other atom F ( u , v ) ∈ χ F(u,v)\in\chi F ( u , v ) ∈ χ , we let F C ρ : = C u ρ × C v ρ F^{C^\rho}:=C^\rho_u\times C^\rho_v F C ρ := C u ρ × C v ρ .
Lemma E.9. Let φ ′ : = ( φ 3 ) ρ ctr \varphi' := (\varphi_3)^{\operatorname{ctr}}_\rho φ ′ := ( φ 3 ) ρ ctr . For any variable-sorted structure C C C over the signature of φ ′ \varphi' φ ′ , we have that C ⊨ v a r φ ′ C\models_{\mathrm{var}}\varphi' C ⊨ var φ ′ if and only if $C^\rho\models_{\mathrm{var}}\varphi_3.
Proof. For convenience, let R i , j C R^C_{i,j} R i , j C be shorthand for ( R z i , z j ρ ) C (R^\rho_{z_i,z_j})^C ( R z i , z j ρ ) C for each $1\le i\le j\le m. We start by establishing
( C ρ , σ ) ⊨ v a r ψ ⟺ ( σ ( z i ) , σ ( z j ) ) ∈ R i , j C for every 1 ≤ i ≤ j ≤ m (2) (C^\rho,\sigma)\models_{\mathrm{var}}\psi\Longleftrightarrow(\sigma(z_i),\sigma(z_j))\in R^C_{i,j}\text{ for every }1\le i\le j\le m \tag*{(2)} ( C ρ , σ ) ⊨ var ψ ⟺ ( σ ( z i ) , σ ( z j )) ∈ R i , j C for every 1 ≤ i ≤ j ≤ m (2)
for any variable assignment σ \sigma σ on { z 1 , … , z m } \{z_1,\ldots,z_m\} { z 1 , … , z m } . We proceed by proving both directions independently. ( ⇒ : ) (\Rightarrow\colon) ( ⇒ : ) Fix an arbitrary variable assignment σ \sigma σ on z 1 , … , z m z_1,\ldots,z_m z 1 , … , z m such that ( C ρ , σ ) ⊨ v a r ψ (C^\rho,\sigma)\models_{\mathrm{var}}\psi ( C ρ , σ ) ⊨ var ψ . Towards a contradiction, assume that there is some i , j ∈ [ m ] i,j\in[m] i , j ∈ [ m ] with i ≤ j i\le j i ≤ j such that ( σ ( z i ) , σ ( z j ) ) ∉ R i , j C (\sigma(z_i),\sigma(z_j))\notin R^C_{i,j} ( σ ( z i ) , σ ( z j )) ∈ / R i , j C . Let σ ′ \sigma' σ ′
::: extend σ ′ \sigma' σ ′ by σ ′ ( y t ) = ∗ y t \sigma'(y_t)=*_{y_t} σ ′ ( y t ) = ∗ y t for each t ∈ [ ℓ − 1 ] t\in[\ell-1] t ∈ [ ℓ − 1 ] and σ ′ ( y ℓ ) = s z j \sigma'(y_\ell)=s_{z_j} σ ′ ( y ℓ ) = s z j . Since ( C ρ , σ ) ⊨ v a r ψ (C^\rho,\sigma)\models_{\mathrm{var}}\psi ( C ρ , σ ) ⊨ var ψ , there exists an extension σ ′ ′ \sigma'' σ ′′ of σ ′ \sigma' σ ′ to the variables x 1 , … , x n x_1,\ldots,x_n x 1 , … , x n such that ( C ρ , σ ′ ′ ) ⊨ v a r χ (C^\rho,\sigma'')\models_{\mathrm{var}}\chi ( C ρ , σ ′′ ) ⊨ var χ . Fix such an assignment σ ′ ′ \sigma'' σ ′′ .
By Lemma E.8 , we know that the inner region ζ \zeta ζ of ψ \psi ψ has the clasped condition and thus contains the following atomic formulae:
P ( y ℓ , x p ) P(y_\ell,x_p) P ( y ℓ , x p ) for some p ∈ [ n ] p\in[n] p ∈ [ n ] and some relation symbol P P P ;
S ( z i , x p ′ ) S(z_i,x_{p'}) S ( z i , x p ′ ) for some p ′ ∈ [ n ] p'\in[n] p ′ ∈ [ n ] and some relation symbol S S S ; and
S 2 ( z j , x p ′ ′ ) S_2(z_j,x_{p''}) S 2 ( z j , x p ′′ ) for some p ′ ′ ∈ [ n ] p''\in[n] p ′′ ∈ [ n ] and some relation symbol S 2 S_2 S 2 .
Since ( C ρ , σ ′ ′ ) ⊨ v a r P ( y ℓ , x p ) (C^\rho,\sigma'')\models_{\mathrm{var}}P(y_\ell,x_p) ( C ρ , σ ′′ ) ⊨ var P ( y ℓ , x p ) where σ ′ ′ ( y ℓ ) = s z j \sigma''(y_\ell)=s_{z_j} σ ′′ ( y ℓ ) = s z j , it follows from the definition of P C ρ P^{C^\rho} P C ρ that σ ′ ′ ( x p ) \sigma''(x_p) σ ′′ ( x p ) must be ( z j , b ′ , x p ) (z_j,b',x_p) ( z j , b ′ , x p ) for some b ′ ∈ C z j b'\in C_{z_j} b ′ ∈ C z j . Moreover, since the hypergraph of ψ \psi ψ induced on { x 1 , … , x n } \{x_1,\ldots,x_n\} { x 1 , … , x n } is connected, along with the definition of the relations E C ρ E^{C^\rho} E C ρ where E ( x q , x q ′ ) ∈ χ E(x_q,x_{q'})\in\chi E ( x q , x q ′ ) ∈ χ for some q , q ′ ∈ [ n ] q,q'\in[n] q , q ′ ∈ [ n ] , it follows that σ ′ ′ ( x q ) = ( z j , b ′ , x q ) \sigma''(x_q)=(z_j,b',x_q) σ ′′ ( x q ) = ( z j , b ′ , x q ) for each q ∈ [ n ] q\in[n] q ∈ [ n ] (the proof of Lemma A.1 gives a proof of an analogous result, the reasoning of which can be applied here).
Now consider the fact that ( C ρ , σ ′ ′ ) ⊨ v a r S 2 ( z j , x p ′ ′ ) (C^\rho,\sigma'')\models_{\mathrm{var}}S_2(z_j,x_{p''}) ( C ρ , σ ′′ ) ⊨ var S 2 ( z j , x p ′′ ) where σ ′ ′ ( z j ) = b \sigma''(z_j)=b σ ′′ ( z j ) = b for some b ∈ C z j b\in C_{z_j} b ∈ C z j and that σ ′ ′ ( x p ′ ′ ) = ( z j , b ′ , x p ′ ′ ) \sigma''(x_{p''})=(z_j,b',x_{p''}) σ ′′ ( x p ′′ ) = ( z j , b ′ , x p ′′ ) . However, ( b , ( z j , b ′ , x p ′ ′ ) ) ∈ S 2 C ρ (b,(z_j,b',x_{p''}))\in S_2^{C^\rho} ( b , ( z j , b ′ , x p ′′ )) ∈ S 2 C ρ if and only if b = b ′ b=b' b = b ′ .
Next, consider the fact that ( C ρ , σ ′ ′ ) ⊨ v a r S ( z i , x p ′ ) (C^\rho,\sigma'')\models_{\mathrm{var}}S(z_i,x_{p'}) ( C ρ , σ ′′ ) ⊨ var S ( z i , x p ′ ) where σ ′ ′ ( z i ) = a \sigma''(z_i)=a σ ′′ ( z i ) = a and σ ′ ′ ( x p ′ ) = ( z j , b , x p ′ ) \sigma''(x_{p'})=(z_j,b,x_{p'}) σ ′′ ( x p ′ ) = ( z j , b , x p ′ ) such that ( a , b ) ∉ ( R z i , z j ρ ) C (a,b)\notin(R^\rho_{z_i,z_j})^C ( a , b ) ∈ / ( R z i , z j ρ ) C . This gives a contradiction, as ( a , ( z j , b , x p ′ ) ) ∈ S C ρ (a,(z_j,b,x_{p'}))\in S^{C^\rho} ( a , ( z j , b , x p ′ )) ∈ S C ρ if and only if ( a , b ) ∈ R i , j C (a,b)\in R^C_{i,j} ( a , b ) ∈ R i , j C .
( ⇐ : ) (\Leftarrow:) ( ⇐: ) Fix an arbitrary assignment σ \sigma σ for z 1 , … , z m z_1,\ldots,z_m z 1 , … , z m such that ( σ ( z i ) , σ ( z j ) ) ∈ R i , j C (\sigma(z_i),\sigma(z_j))\in R^C_{i,j} ( σ ( z i ) , σ ( z j )) ∈ R i , j C for each 1 ≤ i ≤ j ≤ m 1\leq i\leq j\leq m 1 ≤ i ≤ j ≤ m . Our aim here is to establish that ( C ρ , σ ) ⊨ v a r ψ (C^\rho,\sigma)\models_{\mathrm{var}}\psi ( C ρ , σ ) ⊨ var ψ .
Let σ ′ \sigma' σ ′ be an extension of σ \sigma σ for the variables y 1 , … , y ℓ y_1,\ldots,y_\ell y 1 , … , y ℓ , and note that since C y i ρ = { ∗ y i } C^\rho_{y_i}=\{*_{y_i}\} C y i ρ = { ∗ y i } for each i < ℓ i<\ell i < ℓ , we have that σ ′ ( y i ) = ∗ y i \sigma'(y_i)=*_{y_i} σ ′ ( y i ) = ∗ y i for each i < ℓ i<\ell i < ℓ . Fix an arbitrary k ∈ [ m ] k\in[m] k ∈ [ m ] such that σ ′ ( y ℓ ) = s z k \sigma'(y_\ell)=s_{z_k} σ ′ ( y ℓ ) = s z k . We define the witness for each x p x_p x p with p ∈ [ n ] p\in[n] p ∈ [ n ] as ( z k , σ ( z k ) , x p ) (z_k,\sigma(z_k),x_p) ( z k , σ ( z k ) , x p ) . Let σ ′ ′ \sigma'' σ ′′ be the extension of σ ′ \sigma' σ ′ such that σ ′ ′ ( x p ) = ( z k , σ ( z k ) , x p ) \sigma''(x_p)=(z_k,\sigma(z_k),x_p) σ ′′ ( x p ) = ( z k , σ ( z k ) , x p ) for each p ∈ [ n ] p\in[n] p ∈ [ n ] and notice that it suffices to establish that ( C ρ , σ ′ ′ ) ⊨ v a r χ (C^\rho,\sigma'')\models_{\mathrm{var}}\chi ( C ρ , σ ′′ ) ⊨ var χ . Furthermore, as χ \chi χ is a conjunction of atomic formulae, it suffices to check each such atomic formula.
For E ( x p , x q ) ∈ χ E(x_p,x_q)\in\chi E ( x p , x q ) ∈ χ with p , q ∈ [ n ] p,q\in[n] p , q ∈ [ n ] , we have that ( σ ′ ′ ( x p ) , σ ′ ′ ( x q ) ) = ( ( z k , σ ( z k ) , x p ) , ( z k , σ ( z k ) , x q ) ) ∈ E C ρ (\sigma''(x_p),\sigma''(x_q))=((z_k,\sigma(z_k),x_p),(z_k,\sigma(z_k),x_q))\in E^{C^\rho} ( σ ′′ ( x p ) , σ ′′ ( x q )) = (( z k , σ ( z k ) , x p ) , ( z k , σ ( z k ) , x q )) ∈ E C ρ by the definition of E C ρ E^{C^\rho} E C ρ .
For P ( y ℓ , x p ) ∈ χ P(y_\ell,x_p)\in\chi P ( y ℓ , x p ) ∈ χ with p ∈ [ n ] p\in[n] p ∈ [ n ] , we have that ( σ ′ ′ ( y ℓ ) , σ ′ ′ ( x p ) ) = ( s z k , ( z k , σ ( z k ) , x p ) ) ∈ P C ρ (\sigma''(y_\ell),\sigma''(x_p))=(s_{z_k},(z_k,\sigma(z_k),x_p))\in P^{C^\rho} ( σ ′′ ( y ℓ ) , σ ′′ ( x p )) = ( s z k , ( z k , σ ( z k ) , x p )) ∈ P C ρ by the definition of P C ρ P^{C^\rho} P C ρ .
For S ( z i , x p ) ∈ χ S(z_i,x_p)\in\chi S ( z i , x p ) ∈ χ with i ∈ [ m ] i\in[m] i ∈ [ m ] and p ∈ [ n ] p\in[n] p ∈ [ n ] , we have that ( σ ′ ′ ( z i ) , σ ′ ′ ( x p ) ) = ( σ ( z i ) , ( z k , σ ( z k ) , x p ) ) ∈ S C ρ (\sigma''(z_i),\sigma''(x_p))=(\sigma(z_i),(z_k,\sigma(z_k),x_p))\in S^{C^\rho} ( σ ′′ ( z i ) , σ ′′ ( x p )) = ( σ ( z i ) , ( z k , σ ( z k ) , x p )) ∈ S C ρ due to the following reasoning:
If i ≤ k i\leq k i ≤ k , then ( σ ( z i ) , ( z k , σ ( z k ) , x p ) ) ∈ S C ρ (\sigma(z_i),(z_k,\sigma(z_k),x_p))\in S^{C^\rho} ( σ ( z i ) , ( z k , σ ( z k ) , x p )) ∈ S C ρ by the definition of S C ρ S^{C^\rho} S C ρ along with the fact that ( σ ( z i ) , σ ( z k ) ) ∈ R i , k C (\sigma(z_i),\sigma(z_k))\in R^C_{i,k} ( σ ( z i ) , σ ( z k )) ∈ R i , k C .
If i > k i>k i > k , then ( σ ( z k ) , σ ( z i ) ) ∈ R k , i C (\sigma(z_k),\sigma(z_i))\in R^C_{k,i} ( σ ( z k ) , σ ( z i )) ∈ R k , i C and therefore ( σ ( z i ) , ( z k , σ ( z k ) , x p ) ) ∈ S C ρ (\sigma(z_i),(z_k,\sigma(z_k),x_p))\in S^{C^\rho} ( σ ( z i ) , ( z k , σ ( z k ) , x p )) ∈ S C ρ by definition.
Finally, for any other F ( u , v ) ∈ χ F(u,v)\in\chi F ( u , v ) ∈ χ , we have that ( σ ′ ′ ( u ) , σ ′ ′ ( v ) ) ∈ F C ρ (\sigma''(u),\sigma''(v))\in F^{C^\rho} ( σ ′′ ( u ) , σ ′′ ( v )) ∈ F C ρ since F C ρ = C u ρ × C v ρ F^{C^\rho}=C^\rho_u\times C^\rho_v F C ρ = C u ρ × C v ρ .
Since σ ′ \sigma' σ ′ was chosen as an arbitrary extension of σ \sigma σ , it follows that ( C ρ , σ ) ⊨ v a r ψ (C^\rho,\sigma)\models_{\mathrm{var}}\psi ( C ρ , σ ) ⊨ var ψ . □ \square □
Lemma E.10. A ≡ v a r k B ⟹ A ρ ≡ v a r k B ρ \mathcal{A}\equiv^k_{\mathrm{var}}\mathcal{B}\Longrightarrow\mathcal{A}^\rho\equiv^k_{\mathrm{var}}\mathcal{B}^\rho A ≡ var k B ⟹ A ρ ≡ var k B ρ for any two variable-sorted structures A , B \mathcal{A},\mathcal{B} A , B over the signature of ( φ 3 ) ρ c t r (\varphi_3)^{\mathrm{ctr}}_\rho ( φ 3 ) ρ ctr .
Proof. Let Duplicator use their winning strategy for the k k k -pebble game on A \mathcal{A} A and B \mathcal{B} B as a guide.
If Spoiler plays an element a ∈ A u = A u ρ a \in A_u = A_u^\rho a ∈ A u = A u ρ for some variable u u u not quantified inside ψ \psi ψ , then Duplicator responds with the element b ∈ B u = B u ρ b \in B_u = B_u^\rho b ∈ B u = B u ρ using their winning strategy on A , B \mathcal{A}, \mathcal{B} A , B .
If Spoiler plays ( z i , a , x p ) ∈ A x p ρ (z_i,a,x_p) \in A_{x_p}^\rho ( z i , a , x p ) ∈ A x p ρ , Duplicator first treats the parameter a ∈ A z i a \in A_{z_i} a ∈ A z i as a move in the game on A , B \mathcal{A}, \mathcal{B} A , B . Let b ∈ B z i b \in B_{z_i} b ∈ B z i be the response in the game over A \mathcal{A} A and B \mathcal{B} B . Duplicator then plays ( z i , b , x p ) ∈ B x p ρ (z_i,b,x_p) \in B_{x_p}^\rho ( z i , b , x p ) ∈ B x p ρ .
If Spoiler plays an element of the form ∗ y t *_{y_t} ∗ y t or s z i s_{z_i} s z i , then Duplicator plays the identically named element on the other side.
The strategy for moves from B ρ B^\rho B ρ to A ρ A^\rho A ρ is symmetric.
We now show that every position reached by this strategy is a partial isomorphism. Let ( α ρ , β ρ ) (\alpha^\rho,\beta^\rho) ( α ρ , β ρ ) be a position reached in the k k k -pebble game on A ρ A^\rho A ρ and B ρ B^\rho B ρ where Duplicator plays their above-defined strategy.
We define the projected position ( α , β ) (\alpha,\beta) ( α , β ) in the game over A \mathcal{A} A and B \mathcal{B} B as follows. For every pebble p p p in the domain of α ρ \alpha^\rho α ρ and β ρ \beta^\rho β ρ let:
α ( p ) : = { α ρ ( p ) if α ρ ( p ) ∈ A u for some variable u not quantified inside ψ , a if α ρ ( p ) = ( z i , a , x q ) , undefined if α ρ ( p ) = ∗ y t or s z i . \alpha(p) :=
\begin{cases}
\alpha^\rho(p) & \text{if } \alpha^\rho(p) \in A_u \text{ for some variable } u \text{ not quantified inside } \psi,\\
a & \text{if } \alpha^\rho(p) = (z_i,a,x_q),\\
\text{undefined} & \text{if } \alpha^\rho(p) = *_{y_t} \text{ or } s_{z_i}.
\end{cases} α ( p ) := ⎩ ⎨ ⎧ α ρ ( p ) a undefined if α ρ ( p ) ∈ A u for some variable u not quantified inside ψ , if α ρ ( p ) = ( z i , a , x q ) , if α ρ ( p ) = ∗ y t or s z i .
and analogously, let
β ( p ) : = { β ρ ( p ) if β ρ ( p ) ∈ B u for some variable u not quantified inside ψ , b if β ρ ( p ) = ( z i , b , x q ) , undefined if β ρ ( p ) = ∗ y t or s z i . \beta(p) :=
\begin{cases}
\beta^\rho(p) & \text{if } \beta^\rho(p) \in B_u \text{ for some variable } u \text{ not quantified inside } \psi,\\
b & \text{if } \beta^\rho(p) = (z_i,b,x_q),\\
\text{undefined} & \text{if } \beta^\rho(p) = *_{y_t} \text{ or } s_{z_i}.
\end{cases} β ( p ) := ⎩ ⎨ ⎧ β ρ ( p ) b undefined if β ρ ( p ) ∈ B u for some variable u not quantified inside ψ , if β ρ ( p ) = ( z i , b , x q ) , if β ρ ( p ) = ∗ y t or s z i .
Ignoring pebbles whose projections are undefined, the projected pair ( α , β ) (\alpha,\beta) ( α , β ) is a reachable position in the original k k k -pebble game when Duplicator follows their winning strategy. Thus, ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism.
We now prove that ( α ρ , β ρ ) (\alpha^\rho,\beta^\rho) ( α ρ , β ρ ) is a partial isomorphism. First, { ( α ρ ( p ) , β ρ ( p ) ) ∣ p ∈ dom ( α ρ ) } \{(\alpha^\rho(p),\beta^\rho(p)) \mid p \in\operatorname{dom}(\alpha^\rho)\} {( α ρ ( p ) , β ρ ( p )) ∣ p ∈ dom ( α ρ )} defines an injective partial mapping, since ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism. In particular, if two pebbled elements in A ρ A^\rho A ρ have the same projection in A A A , then their responses have the same projection in B B B .
Next, consider a relation symbol Q Q Q that does not occur inside ψ \psi ψ . By definition, Q A ρ = Q A Q^{A^\rho}=Q^A Q A ρ = Q A and Q B ρ = Q B Q^{B^\rho}=Q^B Q B ρ = Q B . Thus, Q Q Q is dealt with by the fact that ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B . It remains to consider relation symbols occurring inside ψ \psi ψ . To that end, let p p p and p ′ p' p ′ be two arbitrary pebbles in dom ( α ρ ) \operatorname{dom}(\alpha^\rho) dom ( α ρ ) .
Consider P ( y ℓ , x q ) ∈ χ P(y_\ell,x_q) \in\chi P ( y ℓ , x q ) ∈ χ . If ( α ρ ( p ) , α ρ ( p ′ ) ) ∈ P A ρ (\alpha^\rho(p),\alpha^\rho(p')) \in P^{A^\rho} ( α ρ ( p ) , α ρ ( p ′ )) ∈ P A ρ , then, by definition of P A ρ P^{A^\rho} P A ρ , there are i ∈ [ m ] i \in[m] i ∈ [ m ] and a ∈ A z i a \in A_{z_i} a ∈ A z i such that
α ρ ( p ) = s z i and α ρ ( p ′ ) = ( z i , a , x q ) . \alpha^\rho(p)=s_{z_i}
\qquad\text{and}\qquad
\alpha^\rho(p')=(z_i,a,x_q). α ρ ( p ) = s z i and α ρ ( p ′ ) = ( z i , a , x q ) .
Immediately from Duplicator’s strategy, we have that
β ρ ( p ) = s z i and β ρ ( p ′ ) = ( z i , b , x q ) \beta^\rho(p)=s_{z_i}
\qquad\text{and}\qquad
\beta^\rho(p')=(z_i,b,x_q) β ρ ( p ) = s z i and β ρ ( p ′ ) = ( z i , b , x q )
for some b ∈ B z i b \in B_{z_i} b ∈ B z i . Hence, ( β ρ ( p ) , β ρ ( p ′ ) ) ∈ P B ρ (\beta^\rho(p),\beta^\rho(p')) \in P^{B^\rho} ( β ρ ( p ) , β ρ ( p ′ )) ∈ P B ρ . The converse direction is symmetric.
Next, consider E ( x p , x q ) ∈ χ E(x_p,x_q) \in\chi E ( x p , x q ) ∈ χ . If ( α ρ ( p ) , α ρ ( p ′ ) ) ∈ E A ρ (\alpha^\rho(p),\alpha^\rho(p')) \in E^{A^\rho} ( α ρ ( p ) , α ρ ( p ′ )) ∈ E A ρ , then there are i ∈ [ m ] i \in[m] i ∈ [ m ] and a ∈ A z i a \in A_{z_i} a ∈ A z i such that
α ρ ( p ) = ( z i , a , x p ) and α ρ ( p ′ ) = ( z i , a , x q ) . \alpha^\rho(p)=(z_i,a,x_p)
\qquad\text{and}\qquad
\alpha^\rho(p')=(z_i,a,x_q). α ρ ( p ) = ( z i , a , x p ) and α ρ ( p ′ ) = ( z i , a , x q ) .
Immediately from Duplicator’s strategy, we have that
β ρ ( p ) = ( z i , b , x p ) and β ρ ( p ′ ) = ( z i , b , x q ) , \beta^{\rho}(p)=(z_i,b,x_p) \quad\text{and}\quad\beta^{\rho}(p')=(z_i,b,x_q), β ρ ( p ) = ( z i , b , x p ) and β ρ ( p ′ ) = ( z i , b , x q ) ,
and hence ( β ρ ( p ) , β ρ ( p ′ ) ) ∈ E B ρ (\beta^{\rho}(p),\beta^{\rho}(p'))\in E^{\mathcal{B}^{\rho}} ( β ρ ( p ) , β ρ ( p ′ )) ∈ E B ρ . Again, the converse direction is symmetric.
Now, consider S ( z i , x q ) ∈ χ S(z_i,x_q)\in\chi S ( z i , x q ) ∈ χ . Assume ( α ρ ( p ) , α ρ ( p ′ ) ) ∈ S A ρ (\alpha^{\rho}(p),\alpha^{\rho}(p'))\in S^{\mathcal{A}^{\rho}} ( α ρ ( p ) , α ρ ( p ′ )) ∈ S A ρ . Then α ρ ( p ) = a ∈ A z i \alpha^{\rho}(p)=a\in A_{z_i} α ρ ( p ) = a ∈ A z i and α ρ ( p ′ ) = ( z j , a ′ , x q ) \alpha^{\rho}(p')=(z_j,a',x_q) α ρ ( p ′ ) = ( z j , a ′ , x q ) for some j ∈ [ m ] j\in[m] j ∈ [ m ] and a ′ ∈ A z j a'\in A_{z_j} a ′ ∈ A z j . Further suppose that i ≤ j i\leq j i ≤ j , the case where i > j i>j i > j is immediate. By definition of S A ρ S^{\mathcal{A}^{\rho}} S A ρ , we have ( a , a ′ ) ∈ ( R z i , z j ρ ) A (a,a')\in(R^{\rho}_{z_i,z_j})^{\mathcal{A}} ( a , a ′ ) ∈ ( R z i , z j ρ ) A . Since ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B , and since R z i , z j ρ R^{\rho}_{z_i,z_j} R z i , z j ρ is a relation symbol of φ ′ \varphi' φ ′ , we get ( b , b ′ ) ∈ ( R z i , z j ρ ) B (b,b')\in(R^{\rho}_{z_i,z_j})^{\mathcal{B}} ( b , b ′ ) ∈ ( R z i , z j ρ ) B . Hence ( b , ( z j , b ′ , x q ) ) ∈ S B ρ (b,(z_j,b',x_q))\in S^{\mathcal{B}^{\rho}} ( b , ( z j , b ′ , x q )) ∈ S B ρ . The converse implication, from B ρ \mathcal{B}^{\rho} B ρ to A ρ \mathcal{A}^{\rho} A ρ , is symmetric. Therefore, S S S is dealt with.
Every remaining relation symbol F F F , with F ( u , v ) ∈ χ F(u,v)\in\chi F ( u , v ) ∈ χ , is interpreted as F A ρ : = A u ρ × A v ρ F^{\mathcal{A}^{\rho}}:=A_u^{\rho}\times A_v^{\rho} F A ρ := A u ρ × A v ρ , and likewise, F B ρ : = B u ρ × B v ρ F^{\mathcal{B}^{\rho}}:=B_u^{\rho}\times B_v^{\rho} F B ρ := B u ρ × B v ρ . Thus, it is immediate that such a relation symbol F F F is dealt with.
Hence, every position reachable by Duplicator’s strategy is a partial isomorphism between A ρ \mathcal{A}^{\rho} A ρ and B ρ \mathcal{B}^{\rho} B ρ . Therefore, Duplicator has a winning strategy in the k k k -pebble game over A ρ \mathcal{A}^{\rho} A ρ and B ρ \mathcal{B}^{\rho} B ρ , and so A ρ ≡ v a r k B ρ \mathcal{A}^{\rho}\equiv^{k}_{\mathrm{var}}\mathcal{B}^{\rho} A ρ ≡ var k B ρ .
Notation 7. Let φ 4 \varphi_4 φ 4 be obtained by iteratively and exhaustively contracting all lowest { ∀ } \{\forall\} { ∀ } -regions occurring below θ ˉ \bar{\theta} θ ˉ .
Thus, in φ 4 \varphi_4 φ 4 , our distinguished region with maximum treewidth θ ˉ \bar{\theta} θ ˉ only has atomic child regions.
Lemma E.11. Let Φ \Phi Φ be an intermediate formula obtained from φ 3 \varphi_3 φ 3 by contracting some collection of lowest { ∀ } \{\forall\} { ∀ } -regions that occur below θ ˉ \bar{\theta} θ ˉ . Then, for every lowest { ∀ } \{\forall\} { ∀ } -region ρ \rho ρ of Φ \Phi Φ occurring below θ ˉ \bar{\theta} θ ˉ , the formula sub Φ ( ρ ) \operatorname{sub}_{\Phi}(\rho) sub Φ ( ρ ) has the form ρ ⟦ χ ⟧ \rho\llbracket\chi\rrbracket ρ [ [ χ ] ] where χ \chi χ is an { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region such that:
(1) the top node of the parse tree of χ \chi χ is an existential quantifier;
(2) all child regions of χ \chi χ are atomic;
(3) χ \chi χ has the connectivity property; and
(4) χ \chi χ has the clasped condition.
Proof. We proceed by induction on the number of contractions used to obtain Φ \Phi Φ from φ 3 \varphi_3 φ 3 . The base case is Lemma E.8. Now suppose the claim holds for an intermediate formula Φ \Phi Φ , and let ρ \rho ρ be a lowest { ∀ } \{\forall\} { ∀ } -region of Φ \Phi Φ that occurs below θ ˉ \bar{\theta} θ ˉ . Let Φ ′ : = Φ ρ c t r \Phi' := \Phi^{\mathrm{ctr}}_{\rho} Φ ′ := Φ ρ ctr . We show that every subformula of sub Φ ′ ( θ ˉ ) \operatorname{sub}_{\Phi'}(\bar{\theta}) sub Φ ′ ( θ ˉ ) rooted at a lowest { ∀ } \{\forall\} { ∀ } -region has the required form.
The contraction of ρ \rho ρ replaces the corresponding subformula by ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) \bigwedge_{1\leq i\leq j\leq m}R^{\rho}_{z_i,z_j}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ρ ( z i , z j ) , where z 1 , … , z m z_1,\ldots,z_m z 1 , … , z m are the free variables of ρ \rho ρ . In particular, the contraction neither introduces nor removes any quantifiers.
Let η \eta η be a lowest { ∀ } \{\forall\} { ∀ } -region of Φ ′ \Phi' Φ ′ that occurs in θ ˉ \bar{\theta} θ ˉ . There are two cases:
(1) Suppose that η \eta η already occurred as a lowest { ∀ } \{\forall\} { ∀ } -region of Φ \Phi Φ . Then, η \eta η is disjoint from the contracted occurrence of ρ \rho ρ . Therefore, the contraction does not change η \eta η , and the desired properties follow from the induction hypothesis.
(2) Suppose that η \eta η was not lowest in Φ \Phi Φ . Since the contraction creates no new { ∀ } \{\forall\} { ∀ } -regions, the region η \eta η must already have occurred in Φ \Phi Φ , and it becomes lowest in Φ ′ \Phi' Φ ′ because ρ \rho ρ occurs below η \eta η and was contracted. The subformula rooted at η \eta η is η ⟦ χ ⟧ \eta\llbracket\chi\rrbracket η [ [ χ ] ] , where χ \chi χ is the unique child { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of η \eta η . The top node of χ \chi χ is still an existential quantifier, since contraction only replaces proper { ∀ } \{\forall\} { ∀ } -organised subformulae of χ \chi χ by a conjunction of atomic formulae. Moreover, since η \eta η is lowest in Φ ′ \Phi' Φ ′ , every child region of χ \chi χ in Φ ′ \Phi' Φ ′ is atomic.
Consider the effect of contracting a proper lowest { ∀ } \{\forall\} { ∀ } -subregion ω \omega ω below χ \chi χ with free( ω ) = { z 1 , … , z m } (\omega)=\{z_1,\ldots,z_m\} ( ω ) = { z 1 , … , z m } . Before the contraction, this child region contributes the hyperedge { z 1 , … , z m } \{z_1,\ldots,z_m\} { z 1 , … , z m } to the hypergraph of χ \chi χ . After the contraction, it is replaced by ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ω ( z i , z j ) \bigwedge_{1\leq i\leq j\leq m}R^{\omega}_{z_i,z_j}(z_i,z_j) ⋀ 1 ≤ i ≤ j ≤ m R z i , z j ω ( z i , z j ) . Thus, in the primal graph of H χ H_{\chi} H χ , the contraction replaces the clique on { z 1 , … , z m } \{z_{1},\ldots,z_{m}\} { z 1 , … , z m } by the same clique. Consequently, the primal graph of H χ H_{\chi} H χ is unchanged by the contraction and thus, the connectivity property and the clasped condition are preserved.
Therefore, every lowest { ∀ } \{\forall\} { ∀ } -region occurring below θ ˉ \bar{\theta} θ ˉ has the required form, completing the induction.
By the above lemma, at every intermediate step of constructing φ 4 \varphi_{4} φ 4 from φ 3 \varphi_{3} φ 3 , every subformula of θ ˉ \bar{\theta} θ ˉ rooted at a lowest { ∀ } \{\forall\} { ∀ } -region has the correct form for invoking Lemma E.9 and Lemma E.10.
Lemma E.12. If there exist variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that:
A ⊨ v a r φ 4 , B ̸ ⊨ v a r φ 4 , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi_{4}, \qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_{4}, \qquad\mathcal{A} \equiv^{k}_{\mathrm{var}} \mathcal{B}, A ⊨ var φ 4 , B ⊨ var φ 4 , A ≡ var k B , then, there exist variable-sorted structures A ′ \mathcal{A}' A ′ and B ′ \mathcal{B}' B ′ such that
A ′ ⊨ v a r φ 3 , B ′ ̸ ⊨ v a r φ 3 , A ′ ≡ v a r k B ′ . \mathcal{A}' \models_{\mathrm{var}} \varphi_{3}, \qquad\mathcal{B}' \not\models_{\mathrm{var}} \varphi_{3}, \qquad\mathcal{A}' \equiv^{k}_{\mathrm{var}} \mathcal{B}'. A ′ ⊨ var φ 3 , B ′ ⊨ var φ 3 , A ′ ≡ var k B ′ .
Proof. Let φ 3 = Φ 0 , Φ 1 , … , Φ r = φ 4 \varphi_{3}=\Phi_{0},\Phi_{1},\ldots,\Phi_{r}=\varphi_{4} φ 3 = Φ 0 , Φ 1 , … , Φ r = φ 4 be the sequence of QCQs obtained during the construction of φ 4 \varphi_{4} φ 4 . That is, for each i ∈ [ r ] i \in[r] i ∈ [ r ] , there is some lowest { ∀ } \{\forall\} { ∀ } -region ρ i − 1 \rho_{i-1} ρ i − 1 of Φ i − 1 \Phi_{i-1} Φ i − 1 that occurs below θ ˉ \bar{\theta} θ ˉ and where Φ i = ( Φ i − 1 ) ρ i − 1 c t r \Phi_{i}=(\Phi_{i-1})^{\mathrm{ctr}}_{\rho_{i-1}} Φ i = ( Φ i − 1 ) ρ i − 1 ctr . By Lemma E.11 , each sub Φ i − 1 ( ρ i − 1 ) \operatorname{sub}\Phi_{i-1}(\rho_{i-1}) sub Φ i − 1 ( ρ i − 1 ) has the correct form to invoke Lemma E.9 and Lemma E.10.
Assume there exists A r \mathcal{A}^{r} A r and B r \mathcal{B}^{r} B r such that
A r ⊨ v a r Φ r , B r ̸ ⊨ v a r Φ r , A r ≡ v a r k B r . \mathcal{A}^{r} \models_{\mathrm{var}} \Phi_{r}, \qquad\mathcal{B}^{r} \not\models_{\mathrm{var}} \Phi_{r}, \qquad\mathcal{A}^{r} \equiv^{k}_{\mathrm{var}} \mathcal{B}^{r}. A r ⊨ var Φ r , B r ⊨ var Φ r , A r ≡ var k B r .
For each 0 ≤ i < r 0 \leq i < r 0 ≤ i < r , let A i : = ( A i + 1 ) ρ i \mathcal{A}^{i}:=(\mathcal{A}^{i+1})_{\rho_{i}} A i := ( A i + 1 ) ρ i be obtained using the expansion construction associated with the contraction of ρ i \rho_{i} ρ i . Let B i : = ( B i + 1 ) ρ i \mathcal{B}^{i}:=(\mathcal{B}^{i+1})_{\rho_{i}} B i := ( B i + 1 ) ρ i be defined analogously. By Lemma E.9 and Lemma E.10, for each i i i from r − 1 r-1 r − 1 to 0 0 0 , we have that:
A i + 1 ⊨ v a r Φ i + 1 , B i + 1 ̸ ⊨ v a r Φ i + 1 , A i + 1 ≡ v a r k B i + 1 \mathcal{A}^{i+1} \models_{\mathrm{var}} \Phi_{i+1}, \qquad\mathcal{B}^{i+1} \not\models_{\mathrm{var}} \Phi_{i+1}, \qquad\mathcal{A}^{i+1} \equiv^{k}_{\mathrm{var}} \mathcal{B}^{i+1} A i + 1 ⊨ var Φ i + 1 , B i + 1 ⊨ var Φ i + 1 , A i + 1 ≡ var k B i + 1
implies
A i ⊨ v a r Φ i , B i ̸ ⊨ v a r Φ i , A i ≡ v a r k B i . \mathcal{A}^{i} \models_{\mathrm{var}} \Phi_{i}, \qquad\mathcal{B}^{i} \not\models_{\mathrm{var}} \Phi_{i}, \qquad\mathcal{A}^{i} \equiv^{k}_{\mathrm{var}} \mathcal{B}^{i}. A i ⊨ var Φ i , B i ⊨ var Φ i , A i ≡ var k B i .
Thus, by induction, we have established our desired claim.
Lemma E.13. If there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 4 , B ̸ ⊨ v a r φ 4 , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi_{4}, \qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_{4}, \qquad\mathcal{A} \equiv^{k}_{\mathrm{var}} \mathcal{B}, A ⊨ var φ 4 , B ⊨ var φ 4 , A ≡ var k B , then logwidth ( φ ) > k \operatorname{logwidth}(\varphi)>k logwidth ( φ ) > k .
Proof. This follows by combining Lemma E.12 and Lemma E.7 .
So far, we have reduced our QCQ φ \varphi φ to φ 4 \varphi_{4} φ 4 where every atom in φ 4 \varphi_{4} φ 4 has an arity of at most size two, and where we have a { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ ˉ \bar{\theta} θ ˉ of φ 4 \varphi_{4} φ 4 such that:
Every child region of θ ˉ \bar{\theta} θ ˉ is an atomic formula;
tw ( H θ ˉ ) = tw ( H θ ) \operatorname{tw}(H_{\bar{\theta}})=\operatorname{tw}(H_{\theta}) tw ( H θ ˉ ) = tw ( H θ ) ;
θ ˉ \bar{\theta} θ ˉ has the connectivity property; and
θ ˉ \bar{\theta} θ ˉ has the clasped condition.
Definition E.14. Let ( τ , V ) (\tau,V) ( τ , V ) be a variable-sorted signature, and let τ = X ⊔ Y \tau=X\sqcup Y τ = X ⊔ Y . For a variable-sorted structure A \mathcal{A} A over ( τ , V ) (\tau,V) ( τ , V ) , let A ∣ Y \mathcal{A}|_Y A ∣ Y be the ( Y , V ) (Y,V) ( Y , V ) -structure with the same domains for each variable as A \mathcal{A} A , and consists of a relation R A ∣ Y : = R A R^{\mathcal{A}|_Y}:=R^\mathcal{A} R A ∣ Y := R A for every R ∈ Y R\in Y R ∈ Y .
For a QCQ φ \varphi φ , we define φ ∣ Y \varphi|_Y φ ∣ Y recursively as follows:
If R ∈ Y R\in Y R ∈ Y , then R ( z ‾ ) ∣ Y : = R ( z ‾ ) R(\overline{z})|_Y:=R(\overline{z}) R ( z ) ∣ Y := R ( z ) , and if R ∈ X R\in X R ∈ X , then R ( z ‾ ) ∣ Y : = ⊤ R(\overline{z})|_Y:=\top R ( z ) ∣ Y := ⊤ .
( α ∧ β ) ∣ Y : = ( α ∣ Y ∧ β ∣ Y ) (\alpha\land\beta)|_Y:=(\alpha|_Y\land\beta|_Y) ( α ∧ β ) ∣ Y := ( α ∣ Y ∧ β ∣ Y ) for QCQs α , β \alpha,\beta α , β
( Q x α ) ∣ Y : = Q x ( α ∣ Y ) (Qx\alpha)|_Y:=Qx(\alpha|_Y) ( Q xα ) ∣ Y := Q x ( α ∣ Y ) for a QCQ α \alpha α and Q ∈ { ∀ , ∃ } Q\in\{\forall,\exists\} Q ∈ { ∀ , ∃ } .
Then, we remove ⊤ \top ⊤ by first exhaustively applying Q x ⊤ = ⊤ Qx\top=\top Q x ⊤ = ⊤ and then exhaustively applying α ∧ ⊤ = ⊤ ∧ α = α \alpha\land\top=\top\land\alpha=\alpha α ∧ ⊤ = ⊤ ∧ α = α .
Next, we show that we can simply “ignore” certain relation symbols in the following way:
Lemma E.15. Let ( τ , V ) (\tau,V) ( τ , V ) be a variable-sorted signature, and let τ = X ⊔ Y \tau=X\sqcup Y τ = X ⊔ Y . Let A \mathcal{A} A and B \mathcal{B} B be variable-sorted ( τ , V ) (\tau,V) ( τ , V ) -structures where for every R ∈ X R\in X R ∈ X with ar ( R ) = s 1 ⋯ s m \operatorname{ar}(R)=s_1\cdots s_m ar ( R ) = s 1 ⋯ s m , we have that R A = A s 1 × ⋯ × A s m R^\mathcal{A}=A_{s_1}\times\cdots\times A_{s_m} R A = A s 1 × ⋯ × A s m and R B = B s 1 × ⋯ × B s m R^\mathcal{B}=B_{s_1}\times\cdots\times B_{s_m} R B = B s 1 × ⋯ × B s m . Let ϕ \phi ϕ be a QCQ over ( τ , S ) (\tau,S) ( τ , S ) . Then C ⊨ v a r ϕ \mathcal{C}\models_{\mathrm{var}}\phi C ⊨ var ϕ if and only if C ∣ Y ⊨ v a r ϕ ∣ Y \mathcal{C}|_Y\models_{\mathrm{var}}\phi|_Y C ∣ Y ⊨ var ϕ ∣ Y for C ∈ { A , B } \mathcal{C}\in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } . Moreover, A ∣ Y ≡ v a r k B ∣ Y \mathcal{A}|_Y\equiv_{\mathrm{var}}^k\mathcal{B}|_Y A ∣ Y ≡ var k B ∣ Y implies A ≡ v a r k B \mathcal{A}\equiv_{\mathrm{var}}^k\mathcal{B} A ≡ var k B .
Proof. We prove a slightly stronger claim by induction on the structure of ϕ \phi ϕ : for every C ∈ { A , B } \mathcal{C}\in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } , every subformula ϕ ′ \phi' ϕ ′ of ϕ \phi ϕ , and every assignment σ \sigma σ of the free variables of ϕ ′ \phi' ϕ ′ to elements of their respective domains, we have
( C , σ ) ⊨ v a r ϕ ′ ⟺ ( C ∣ Y , σ ) ⊨ v a r ϕ ′ ∣ Y . (\mathcal{C},\sigma)\models_{\mathrm{var}}\phi' \Longleftrightarrow(\mathcal{C}|_Y,\sigma)\models_{\mathrm{var}}\phi'|_Y. ( C , σ ) ⊨ var ϕ ′ ⟺ ( C ∣ Y , σ ) ⊨ var ϕ ′ ∣ Y .
The atomic case is immediate. If the atom is R ( z 1 , … , z m ) R(z_1,\ldots,z_m) R ( z 1 , … , z m ) with R ∈ X R\in X R ∈ X , then it is true under every assignment (with the correct sorts) because R C : = C z 1 × ⋯ × C z m R^\mathcal{C}:=C_{z_1}\times\cdots\times C_{z_m} R C := C z 1 × ⋯ × C z m ; hence:
( C , σ ) ⊨ v a r R ( z 1 , … , z m ) ⟺ ( C ∣ Y , σ ) ⊨ v a r ⊤ . (\mathcal{C},\sigma)\models_{\mathrm{var}}R(z_1,\ldots,z_m) \Longleftrightarrow(\mathcal{C}|_Y,\sigma)\models_{\mathrm{var}}\top. ( C , σ ) ⊨ var R ( z 1 , … , z m ) ⟺ ( C ∣ Y , σ ) ⊨ var ⊤.
If R ∈ Y R\in Y R ∈ Y , then the interpretation of R R R is unchanged, and therefore
( C , σ ) ⊨ v a r R ( z 1 , … , z m ) ⟺ ( C ∣ Y , σ ) ⊨ v a r R ( z 1 , … , z m ) (\mathcal{C},\sigma)\models_{\mathrm{var}}R(z_1,\ldots,z_m) \Longleftrightarrow(\mathcal{C}|_Y,\sigma)\models_{\mathrm{var}}R(z_1,\ldots,z_m) ( C , σ ) ⊨ var R ( z 1 , … , z m ) ⟺ ( C ∣ Y , σ ) ⊨ var R ( z 1 , … , z m )
is immediate. The conjunction and quantifier cases follow directly from the induction hypothesis, using the fact that C \mathcal{C} C and C ∣ Y \mathcal{C}|_Y C ∣ Y have the same domains for each variable.
The rest of the proof is dedicated to showing A ∣ Y ≡ v a r k B ∣ Y \mathcal{A}|_Y\equiv_{\mathrm{var}}^k\mathcal{B}|_Y A ∣ Y ≡ var k B ∣ Y implies A ≡ v a r k B \mathcal{A}\equiv_{\mathrm{var}}^k\mathcal{B} A ≡ var k B . Let P P P be the set of pebbles and let α : P → A \alpha:P\to A α : P → A and β : P → B \beta:P\to B β : P → B be partial mappings. We show that ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A ∣ Y \mathcal{A}|_Y A ∣ Y and B ∣ Y \mathcal{B}|_Y B ∣ Y implies ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B . Thus, Duplicator can simply copy their winning strategy over A ∣ Y \mathcal{A}|_Y A ∣ Y and B ∣ Y \mathcal{B}|_Y B ∣ Y to get a winning strategy between A \mathcal{A} A and B \mathcal{B} B .
Suppose ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A ∣ Y \mathcal{A}|_Y A ∣ Y and B ∣ Y \mathcal{B}|_Y B ∣ Y . Pick some arbitrary F ∈ Y F\in Y F ∈ Y , and since F A = F A ∣ Y F^\mathcal{A}=F^{\mathcal{A}|_Y} F A = F A ∣ Y , along with F B = F B ∣ Y F^\mathcal{B}=F^{\mathcal{B}|_Y} F B = F B ∣ Y , clearly
α ( p ‾ ) ∈ F A ⟺ β ( p ‾ ) ∈ F B . \alpha(\overline{p})\in F^\mathcal{A}\Longleftrightarrow\beta(\overline{p})\in F^\mathcal{B}. α ( p ) ∈ F A ⟺ β ( p ) ∈ F B .
for any p ‾ ∈ dom ( α ) ∣ ar ( F ) ∣ \overline{p}\in\operatorname{dom}(\alpha)^{|\operatorname{ar}(F)|} p ∈ dom ( α ) ∣ ar ( F ) ∣ .
It remains to check relation symbols in X X X . Pick some arbitrary R ∈ X R\in X R ∈ X . Suppose p i 1 , … , p i ℓ ∈ dom ( α ) p_{i_1},\ldots,p_{i_\ell}\in\operatorname{dom}(\alpha) p i 1 , … , p i ℓ ∈ dom ( α ) such that α ( p i j ) ∈ A s j \alpha(p_{i_j})\in A_{s_j} α ( p i j ) ∈ A s j , and β ( p i j ) ∈ B s j \beta(p_{i_j})\in B_{s_j} β ( p i j ) ∈ B s j , and ar ( R ) = s 1 ⋯ s ℓ \operatorname{ar}(R)=s_1\cdots s_\ell ar ( R ) = s 1 ⋯ s ℓ , and notice that any set of pebbles from dom ( α ) \operatorname{dom}(\alpha) dom ( α ) where the previously mentioned condition does not hold cannot describe a tuple from R A R^\mathcal{A} R A or R B R^\mathcal{B} R B . Clearly, ( α ( p i 1 ) , … , α ( p i ℓ ) ) ∈ R A (\alpha(p_{i_1}),\ldots,\alpha(p_{i_\ell}))\in R^\mathcal{A} ( α ( p i 1 ) , … , α ( p i ℓ )) ∈ R A and ( β ( p i 1 ) , … , β ( p i ℓ ) ) ∈ R B (\beta(p_{i_1}),\ldots,\beta(p_{i_\ell}))\in R^\mathcal{B} ( β ( p i 1 ) , … , β ( p i ℓ )) ∈ R B for any such p i 1 , … , p i ℓ ∈ P p_{i_1},\ldots,p_{i_\ell}\in P p i 1 , … , p i ℓ ∈ P . This is because R A = A s 1 × ⋯ × A s ℓ R^\mathcal{A}=A_{s_1}\times\cdots\times A_{s_\ell} R A = A s 1 × ⋯ × A s ℓ and R B = B s 1 × ⋯ × B s ℓ R^\mathcal{B}=B_{s_1}\times\cdots\times B_{s_\ell} R B = B s 1 × ⋯ × B s ℓ . Thus, ( α , β ) (\alpha,\beta) ( α , β ) is a partial isomorphism between A \mathcal{A} A and B \mathcal{B} B . □
Notation 8. Let τ : = X θ ˉ ⊔ X e l s e \tau:= X_{\bar{\theta}} \sqcup X_{\mathrm{else}} τ := X θ ˉ ⊔ X else be a partition, where X θ ˉ X_{\bar{\theta}} X θ ˉ contains all relation symbols R R R , such that R ( u , v ) R(u,v) R ( u , v ) occurs in θ ˉ \bar{\theta} θ ˉ (up to reordering of the variables) where u ≠ v u \ne v u = v and:
u ∈ free ( θ ˉ ) u \in\operatorname{free}(\bar{\theta}) u ∈ free ( θ ˉ ) and v ∉ free ( θ ˉ ) v \notin\operatorname{free}(\bar{\theta}) v ∈ / free ( θ ˉ ) , or
u , v ∉ free ( θ ˉ ) u,v \notin\operatorname{free}(\bar{\theta}) u , v ∈ / free ( θ ˉ ) .
Then, set φ 4 ′ : = φ 4 ∣ X θ ˉ \varphi'_4 := \varphi_4|_{X_{\bar{\theta}}} φ 4 ′ := φ 4 ∣ X θ ˉ , and then φ 5 \varphi_5 φ 5 is obtained from φ 4 ′ \varphi'_4 φ 4 ′ by exhaustive applications of Q x α → M α Qx\alpha\to_M \alpha Q xα → M α where x ∉ free ( α ) x \notin\operatorname{free}(\alpha) x ∈ / free ( α ) .
We say Q x α Qx\alpha Q xα where x ∉ free ( α ) x \notin\operatorname{free}(\alpha) x ∈ / free ( α ) and Q ∈ { ∃ , ∀ } Q \in\{\exists,\forall\} Q ∈ { ∃ , ∀ } is a vacuous quantifier .
Lemma E.16. If there exist variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 5 , B ̸ ⊨ v a r φ 5 , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi_5,\qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_5,\qquad\mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B}, A ⊨ var φ 5 , B ⊨ var φ 5 , A ≡ var k B , then, there exist variable-sorted structures C \mathcal{C} C and D \mathcal{D} D such that
C ⊨ v a r φ 4 , D ̸ ⊨ v a r φ 4 , C ≡ v a r k D . \mathcal{C} \models_{\mathrm{var}} \varphi_4,\qquad\mathcal{D} \not\models_{\mathrm{var}} \varphi_4,\qquad\mathcal{C} \equiv_{\mathrm{var}}^{k} \mathcal{D}. C ⊨ var φ 4 , D ⊨ var φ 4 , C ≡ var k D . Proof. Suppose that there exist variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ 5 \mathcal{A} \models_{\mathrm{var}} \varphi_5 A ⊨ var φ 5 , B ̸ ⊨ v a r φ 5 \mathcal{B} \not\models_{\mathrm{var}} \varphi_5 B ⊨ var φ 5 , and A ≡ v a r k B \mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B} A ≡ var k B .
Let Rem \operatorname{Rem} Rem be the set of variables whose quantification is removed in the reduction from φ 4 ′ \varphi'_4 φ 4 ′ to φ 5 \varphi_5 φ 5 .
Let A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + be variable-sorted structures defined from A \mathcal{A} A and B \mathcal{B} B by keeping the same domains and relation interpretations on the variables and relation symbols occurring in φ 5 \varphi_5 φ 5 , and by setting A u + : = { a u ∗ } A^{+}_{u} := \{a^{*}_{u}\} A u + := { a u ∗ } and B u + : = { b u ∗ } B^{+}_{u} := \{b^{*}_{u}\} B u + := { b u ∗ } for each u ∈ Rem u \in\operatorname{Rem} u ∈ Rem . For every u ∈ Rem u \in\operatorname{Rem} u ∈ Rem , we have that A u + ≠ ∅ ≠ B u + A^{+}_{u} \ne\varnothing\ne B^{+}_{u} A u + = ∅ = B u + and therefore adding vacuous quantifiers does not affect truth value, implying:
A + ⊨ v a r φ 4 ′ , B + ̸ ⊨ v a r φ 4 ′ , A + ≡ v a r k B + . \mathcal{A}^{+} \models_{\mathrm{var}} \varphi'_4,\qquad\mathcal{B}^{+} \not\models_{\mathrm{var}} \varphi'_4,\qquad\mathcal{A}^{+} \equiv_{\mathrm{var}}^{k} \mathcal{B}^{+}. A + ⊨ var φ 4 ′ , B + ⊨ var φ 4 ′ , A + ≡ var k B + . Here, Duplicator’s strategy for the k k k -pebble game over A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + is identical to their k k k -pebble strategy over A \mathcal{A} A and B \mathcal{B} B , unless Spoiler picks an element from A u + A^{+}_{u} A u + (or B u + B^{+}_{u} B u + ) for some u ∈ Rem u \in\operatorname{Rem} u ∈ Rem , in which case Duplicator responds with the unique element in the corresponding domain.
Now define C \mathcal{C} C and D \mathcal{D} D as extensions of A + \mathcal{A}^{+} A + and B + \mathcal{B}^{+} B + to the signature τ \tau τ . For every relation symbol R ∈ X e l s e R \in X_{\mathrm{else}} R ∈ X else with ar ( R ) = s 1 ⋯ s m \operatorname{ar}(R) = s_1 \cdots s_m ar ( R ) = s 1 ⋯ s m , set
R C : = C s 1 × ⋯ × C s m , R D : = D s 1 × ⋯ × D s m . R^{\mathcal{C}} := C_{s_1} \times\cdots\times C_{s_m},\qquad R^{\mathcal{D}} := D_{s_1} \times\cdots\times D_{s_m}. R C := C s 1 × ⋯ × C s m , R D := D s 1 × ⋯ × D s m . For every R ∈ X θ ˉ R \in X_{\bar{\theta}} R ∈ X θ ˉ , let R C = R A + R^{\mathcal{C}} = R^{\mathcal{A}^{+}} R C = R A + and R D = R B + R^{\mathcal{D}} = R^{\mathcal{B}^{+}} R D = R B + .
Then C ∣ X θ ˉ = A + \mathcal{C}|_{X_{\bar{\theta}}} = \mathcal{A}^{+} C ∣ X θ ˉ = A + and D ∣ X θ ˉ = B + \mathcal{D}|_{X_{\bar{\theta}}} = \mathcal{B}^{+} D ∣ X θ ˉ = B + . Hence, by Lemma E.15, we get
C ⊨ v a r φ 4 ⟺ A + ⊨ v a r φ 4 ′ \mathcal{C} \models_{\mathrm{var}} \varphi_4 \Longleftrightarrow\mathcal{A}^{+} \models_{\mathrm{var}} \varphi'_4 C ⊨ var φ 4 ⟺ A + ⊨ var φ 4 ′ and
D ⊨ v a r φ 4 ⟺ B + ⊨ v a r φ 4 ′ . \mathcal{D} \models_{\mathrm{var}} \varphi_4 \Longleftrightarrow\mathcal{B}^{+} \models_{\mathrm{var}} \varphi'_4. D ⊨ var φ 4 ⟺ B + ⊨ var φ 4 ′ . Therefore
C ⊨ v a r φ 4 , D ̸ ⊨ v a r φ 4 . \mathcal{C} \models_{\mathrm{var}} \varphi_4,\qquad\mathcal{D} \not\models_{\mathrm{var}} \varphi_4. C ⊨ var φ 4 , D ⊨ var φ 4 . Since A + ≡ v a r k B + \mathcal{A}^{+} \equiv_{\mathrm{var}}^{k} \mathcal{B}^{+} A + ≡ var k B + , the “moreover” part of Lemma E.15 gives us C ≡ v a r k D \mathcal{C} \equiv_{\mathrm{var}}^{k} \mathcal{D} C ≡ var k D . □
Lemma E.17. If there exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ v a r φ 5 , B ̸ ⊨ v a r φ 5 , A ≡ v a r k B , \mathcal{A} \models_{\mathrm{var}} \varphi_5,\qquad\mathcal{B} \not\models_{\mathrm{var}} \varphi_5,\qquad\mathcal{A} \equiv_{\mathrm{var}}^{k} \mathcal{B}, A ⊨ var φ 5 , B ⊨ var φ 5 , A ≡ var k B , then logwidth ( φ ) > k \operatorname{logwidth}(\varphi) > k logwidth ( φ ) > k .
Proof. This follows by combining Lemma E.16 and Lemma E.13. □
Recall that our original QCQ φ \varphi φ is a normal form of R : = ( Q C Q , → { S ↓ , M } ) / ∗ ↔ T \mathcal{R} := (\mathrm{QCQ}, \to_{\{S_{\downarrow},M\}})/{\mathord{*}\leftrightarrow_T} R := ( QCQ , → { S ↓ , M } ) / ∗ ↔ T , and contains the distinguished non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ \theta θ of maximum treewidth.
Lemma E.18. φ 5 \varphi_5 φ 5 is a simple QCQ, with an inner region θ ˉ ′ \bar{\theta}' θ ˉ ′ , where tw ( H θ ˉ ′ ) = tw ( H θ ) \operatorname{tw}(H_{\bar{\theta}'}) = \operatorname{tw}(H_{\theta}) tw ( H θ ˉ ′ ) = tw ( H θ ) .
Proof. Let θ ˉ \bar{\theta} θ ˉ denote the region of φ 4 \varphi_4 φ 4 corresponding to the distinguished region θ \theta θ of φ \varphi φ . Recall that φ 5 \varphi_5 φ 5 is obtained from φ 4 \varphi_4 φ 4 by deleting all atoms whose relation symbols lie outside of X θ ˉ X_{\bar{\theta}} X θ ˉ and then removing vacuous quantifiers. Let θ ˉ ′ \bar{\theta}' θ ˉ ′ be the region induced by θ ˉ \bar{\theta} θ ˉ after this deletion.
First, let us verify that φ 5 \varphi_5 φ 5 is a simple QCQ. Since φ \varphi φ is self-join-free and all reductions used to obtain φ 5 \varphi_5 φ 5 do not introduce repeating relation symbols, φ 5 \varphi_5 φ 5 is also self-join-free. Moreover, by the definition of X θ ˉ X_{\bar{\theta}} X θ ˉ , every atom that remains in φ 5 \varphi_5 φ 5 is a binary atom applied to two distinct variables. This is because all atoms that are nullary, unary, or of the form R ( u , u ) R(u,u) R ( u , u ) are deleted, and all atoms with an arity of more than two have been replaced by their binary relation encoding.
All atoms outside of θ ˉ \bar{\theta} θ ˉ are deleted when passing from φ 4 \varphi_4 φ 4 to φ 5 \varphi_5 φ 5 . Thus, after removing vacuous quantifiers, the remaining QCQ has the form
Q 1 v 1 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ψ ) , Q_1v_1 \cdots Q_{m-1}v_{m-1}\forall v_m\exists x_1 \cdots\exists x_k(\psi), Q 1 v 1 ⋯ Q m − 1 v m − 1 ∀ v m ∃ x 1 ⋯ ∃ x k ( ψ ) ,
where ∃ x 1 ⋯ ∃ x k ( ψ ) \exists x_1 \cdots\exists x_k(\psi) ∃ x 1 ⋯ ∃ x k ( ψ ) is the subformula rooted at θ ˉ ′ \bar{\theta}' θ ˉ ′ . Since θ \theta θ is a non-top region, θ ˉ \bar{\theta} θ ˉ must have at least one free variable. Moreover, [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T is a normal form of R \mathcal{R} R , and thus no quantifier in φ \varphi φ is vacuous. Hence, when obtaining φ 5 \varphi_5 φ 5 , at least one universal quantifier precedes θ ˉ ′ \bar{\theta}' θ ˉ ′ . Thus, m ≥ 1 m \ge1 m ≥ 1 .
Let us now check the connectivity property and the tightness property. The connectivity property holds because when passing from φ 4 \varphi_4 φ 4 to φ 5 \varphi_5 φ 5 , we do not remove atoms whose two distinct variables are quantified in θ ˉ \bar{\theta} θ ˉ . Therefore, the hypergraph induced by H θ ˉ ′ H_{\bar{\theta}'} H θ ˉ ′ on the variables quantified in θ ˉ ′ \bar{\theta}' θ ˉ ′ is isomorphic to the corresponding hypergraph induced by H θ ˉ H_{\bar{\theta}} H θ ˉ on the variables quantified in θ ˉ \bar{\theta} θ ˉ and this latter hypergraph is connected. For the tightness property, let e e e be an arbitrary hyperedge of H θ ˉ ′ H_{\bar{\theta}'} H θ ˉ ′ . If this hyperedge corresponds to an atom, then this atom has not been deleted to obtain φ 5 \varphi_5 φ 5 and thus contains at least one variable that is existentially quantified in θ ′ \theta' θ ′ .
Next, let us show that tw ( H θ ˉ ) = tw ( H θ ) \operatorname{tw}(H_{\bar{\theta}}) = \operatorname{tw}(H_{\theta}) tw ( H θ ˉ ) = tw ( H θ ) . The transformations from θ \theta θ to θ ˉ \bar{\theta} θ ˉ preserve the primal graph of the region: contracting subregions replaces a child with a conjunction of binary atoms, inducing the same clique on its associated variables, and the binary encoding of higher-arity atoms replace the clique induced by that atom with the same clique. Therefore, tw ( H θ ˉ ) = tw ( H θ ) \operatorname{tw}(H_{\bar{\theta}}) = \operatorname{tw}(H_{\theta}) tw ( H θ ˉ ) = tw ( H θ ) .
Now consider passing from θ ˉ \bar{\theta} θ ˉ to θ ˉ ′ \bar{\theta}' θ ˉ ′ . This deletes atoms outside of θ ˉ \bar{\theta} θ ˉ , nullary and unary atoms, as well as atoms of the form R ( u , u ) R(u,u) R ( u , u ) , and atoms R ( u , v ) R(u,v) R ( u , v ) with u , v ∈ free ( θ ˉ ) u,v \in\operatorname{free}(\bar{\theta}) u , v ∈ free ( θ ˉ ) . Deleting the first three types of atoms clearly does not affect the primal graph, and the last kind does not affect it because free ( θ ˉ ) \operatorname{free}(\bar{\theta}) free ( θ ˉ ) is already a hyperedge. Therefore, the primal graph, and therefore the treewidth, is unchanged when passing from θ ˉ \bar{\theta} θ ˉ to θ ˉ ′ \bar{\theta}' θ ˉ ′ .
Consequently, φ 5 \varphi_5 φ 5 is a simple QCQ with an inner region θ ˉ ′ \bar{\theta}' θ ˉ ′ with tw ( H θ ˉ ′ ) = tw ( H θ ) \operatorname{tw}(H_{\bar{\theta}'}) = \operatorname{tw}(H_{\theta}) tw ( H θ ˉ ′ ) = tw ( H θ ) .
Lemma E.19. Let θ ′ \theta' θ ′ be the inner region of φ 5 \varphi_5 φ 5 . There exist two variable-sorted structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ v a r φ 5 \mathcal{A} \models_{\mathrm{var}} \varphi_5 A ⊨ var φ 5 , B ⊨ v a r φ 5 \mathcal{B} \models_{\mathrm{var}} \varphi_5 B ⊨ var φ 5 , and A ⊨ v a r ρ B \mathcal{A} \models_{\mathrm{var}}^{\rho} \mathcal{B} A ⊨ var ρ B , where ρ = tw ( H θ ˉ ′ ) . \rho= \operatorname{tw}(H_{\bar{\theta}'}). ρ = tw ( H θ ˉ ′ ) .
This immediately follows from Lemma 5.12 and Lemma 5.17. Combining this with Lemma E.17:
Theorem E.20. logwidth ( φ ) > tw ( H θ ) \operatorname{logwidth}(\varphi) > \operatorname{tw}(H_{\theta}) logwidth ( φ ) > tw ( H θ ) .
Recall that we fixed θ \theta θ to be a non-top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region of φ \varphi φ . Thus, all that remains is to deal with the case where the maximum-treewidth { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region is a top { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region.
Edge Case: θ \theta θ is a top region of φ \varphi φ
Let φ \varphi φ be an arbitrary standardised self-join-free QCQ such that [ φ ] T [\varphi]_{\mathsf{T}} [ φ ] T is a normal form in the system R \mathcal{R} R . Now consider the remaining case in which the maximum-treewidth { ∃ , ∧ } \{\exists,\wedge\} { ∃ , ∧ } -region θ \theta θ is a top region. Since θ \theta θ is top, free ( θ ) = ∅ \operatorname{free}(\theta) = \emptyset free ( θ ) = ∅ , thus the hyperedges of H θ H_{\theta} H θ are determined precisely by the association with the holes that appear in θ \theta θ . We apply to θ \theta θ the same transformations as in Section E.1–E.3. That is,
Contract { ∀ } \{\forall\} { ∀ } -subregions of θ \theta θ that have an atomic child region.
Replace higher-arity atoms by their binary encoding.
Contract the remaining { ∀ } \{\forall\} { ∀ } -subregions of θ \theta θ .
By the same primal graph-preservation argument as in Observation 1, the resulting existential-positive sentence φ ′ \varphi' φ ′ has an associated hypergraph H φ ′ H_{\varphi'} H φ ′ with tw ( H θ ) = tw ( H φ ′ ) \operatorname{tw}(H_{\theta}) = \operatorname{tw}(H_{\varphi'}) tw ( H θ ) = tw ( H φ ′ ) . The formula φ ′ \varphi' φ ′ is in the correct form to invoke Theorem 6 of [12 ] . Hence, there exist finite structures A \mathcal{A} A and B \mathcal{B} B such that A ⊨ φ ′ \mathcal{A} \models\varphi' A ⊨ φ ′ , B ⊭ φ ′ \mathcal{B} \not\models\varphi' B ⊨ φ ′ and A ≡ k B \mathcal{A} \equiv^{k} \mathcal{B} A ≡ k B with k = tw ( H φ ′ ) k = \operatorname{tw}(H_{\varphi'}) k = tw ( H φ ′ ) . Equivalently, logwidth ( φ ′ ) ≥ tw ( H φ ′ ) + 1 \operatorname{logwidth}(\varphi') \ge\operatorname{tw}(H_{\varphi'}) + 1 logwidth ( φ ′ ) ≥ tw ( H φ ′ ) + 1 .
It remains to lift this lower bound back to φ \varphi φ . We start with the following:
Lemma E.21. Let φ \varphi φ be a standardised and self-join-free QCQ. If there exist one-sorted structures A \mathcal{A} A and B \mathcal{B} B such that
A ⊨ φ , B ⊭ φ , A ≡ k B , \mathcal{A} \models\varphi,\quad\mathcal{B} \not\models\varphi,\quad\mathcal{A} \equiv^{k} \mathcal{B}, A ⊨ φ , B ⊨ φ , A ≡ k B , then, there exist variable-sorted structures A ′ \mathcal{A}' A ′ and B ′ \mathcal{B}' B ′ such that
A ′ ⊨ v a r φ , B ′ ̸ ⊨ v a r φ , A ′ ≡ v a r k B ′ . \mathcal{A}' \models_{\mathrm{var}} \varphi,\quad\mathcal{B}' \not\models_{\mathrm{var}} \varphi,\quad\mathcal{A}' \equiv^{k}_{\mathrm{var}} \mathcal{B}'. A ′ ⊨ var φ , B ′ ⊨ var φ , A ′ ≡ var k B ′ .
Proof. Let A A A be the domain of A \mathcal{A} A and let B B B be the domain of B \mathcal{B} B . For each x x x that appears in φ \varphi φ , let A x ′ : = A × { x } A'_x := A \times\{x\} A x ′ := A × { x } and let B x ′ : = B × { x } B'_x := B \times\{x\} B x ′ := B × { x } be the domains for x x x in A ′ \mathcal{A}' A ′ and B ′ \mathcal{B}' B ′ , respectively. For each atom R ( x 1 , … , x r ) R(x_1,\ldots,x_r) R ( x 1 , … , x r ) that appears in φ \varphi φ , let
( ( a 1 , x 1 ) , … , ( a r , x r ) ) ∈ R A ′ ⟺ ( a 1 , … , a r ) ∈ R A . ((a_1,x_1),\ldots,(a_r,x_r)) \in R^{\mathcal{A}'} \Longleftrightarrow(a_1,\ldots,a_r) \in R^{\mathcal{A}}. (( a 1 , x 1 ) , … , ( a r , x r )) ∈ R A ′ ⟺ ( a 1 , … , a r ) ∈ R A .
The relation symbols in B ′ \mathcal{B}' B ′ are interpreted analogously. Relation symbols that do not appear in φ \varphi φ are interpreted arbitrarily.
Immediately, we get C ⊨ φ \mathcal{C} \models\varphi C ⊨ φ if and only if C ′ ⊨ v a r φ \mathcal{C}' \models_{\mathrm{var}} \varphi C ′ ⊨ var φ for C ∈ { A , B } \mathcal{C} \in\{\mathcal{A},\mathcal{B}\} C ∈ { A , B } . This is because a variable assignment σ \sigma σ is uniquely coupled with σ ′ \sigma' σ ′ such that σ ( x ) = a \sigma(x) = a σ ( x ) = a if and only if σ ′ ( x ) = ( a , x ) \sigma'(x) = (a,x) σ ′ ( x ) = ( a , x ) . Thus, any subformula of φ \varphi φ is true under σ \sigma σ if and only if it is true under σ ′ \sigma' σ ′ , by the definition of relations in C ′ \mathcal{C}' C ′ .
Moreover, A ≡ k B \mathcal{A} \equiv^{k} \mathcal{B} A ≡ k B implies A ′ ≡ v a r k B ′ \mathcal{A}' \equiv^{k}_{\mathrm{var}} \mathcal{B}' A ′ ≡ var k B ′ by augmenting Duplicator’s strategy with responding in the corresponding domain. That is, if Spoiler picks some ( a , x ) (a,x) ( a , x ) in the game over A ′ \mathcal{A}' A ′ and B ′ \mathcal{B}' B ′ , Duplicator consults their winning strategy over A \mathcal{A} A and B \mathcal{B} B with Spoiler picking a a a . If Duplicator’s one-sorted winning strategy says to respond with b b b , then Duplicator responds in the variable-sorted game with ( b , x ) (b,x) ( b , x ) . □
By Lemma E.21, we may assume Theorem 6 of [12 ] yields variable-sorted structures A \mathcal{A} A and B \mathcal{B} B with A ⊨ v a r φ ′ \mathcal{A} \models_{\mathrm{var}} \varphi' A ⊨ var φ ′ , B ̸ ⊨ v a r φ ′ \mathcal{B} \not\models_{\mathrm{var}} \varphi' B ⊨ var φ ′ and A ≡ v a r k B \mathcal{A} \equiv^{k}_{\mathrm{var}} \mathcal{B} A ≡ var k B ; where k = tw ( H φ ′ ) k = \operatorname{tw}(H_{\varphi'}) k = tw ( H φ ′ ) .
For each transformation used to obtain φ ′ \varphi' φ ′ , apply the corresponding lemma from Section E.1-E.3 to obtain structures A ′ \mathcal{A}' A ′ and B ′ \mathcal{B}' B ′ such that A ′ ⊨ v a r φ \mathcal{A}' \models_{\mathrm{var}} \varphi A ′ ⊨ var φ , B ′ ̸ ⊨ v a r φ \mathcal{B}' \not\models_{\mathrm{var}} \varphi B ′ ⊨ var φ , and A ′ ≡ v a r k B ′ \mathcal{A}' \equiv^{k}_{\mathrm{var}} \mathcal{B}' A ′ ≡ var k B ′ . Thus, logwidth ( φ ) > k = tw ( H θ ) \operatorname{logwidth}(\varphi) > k = \operatorname{tw}(H_{\theta}) logwidth ( φ ) > k = tw ( H θ ) .