The complexity of positive first-order logic without equality

# The complexity of positive first-order logic without equality

Univ Clermont1
EA2146.    BARNABY MARTIN
Durham University.
###### Abstract

We study the complexity of evaluating positive equality-free sentences of first-order (FO) logic over a fixed, finite structure . This may be seen as a natural generalisation of the non-uniform quantified constraint satisfaction problem . We introduce surjective hyper-endomorphisms and use them in proving a Galois connection that characterises definability in positive equality-free FO. Through an algebraic method, we derive a complete complexity classification for our problems as ranges over structures of size at most three. Specifically, each problem is either in , is -complete, is -complete or is -complete.

Quantified Constraints, Equality-free Logics, Galois Connection
\newdef

definition[theorem]Definition \newdefremark[theorem]Remark \newdefremarks[theorem]Remarks \categoryF.4.1Mathematical Logic and Formal LanguagesMathematical Logic[Computational Logic] \termsLanguages, Theory

{bottomstuff}

Author’s addresses: Florent Madelaine, Univ Clermont1, EA2146, Laboratoire d’algorithmique et d’image de Clermont-Ferrand, Aubière, F-63170, France. florent.madelaine@u-clermont1.fr. Barnaby Martin, School of Engineering and Computing Sciences, Durham University, Durham DH1 3LE, U.K. barnabymartin@gmail.com.

## 1 Introduction

The evaluation problem under a logic – here always a fragment of first-order logic () – takes as input a structure (model) and a sentence of , and asks whether .111We resist the better known terminology of ‘model checking problem’ because in the majority of this paper we consider the structure to be fixed. When is the existential conjunctive positive fragment of , -, the evaluation problem is equivalent to the much-studied constraint satisfaction problem (CSP). Similarly, when is the (quantified) conjunctive positive fragment of , -, the evaluation problem is equivalent to the well-studied quantified constraint satisfaction problem (QCSP). In this manner, the QCSP is the generalisation of the CSP in which universal quantification is restored to the mix. In both cases it is essentially irrelevant whether or not equality is permitted in the sentences, as it may be propagated out by substitution. Much work has been done on the parameterisation of these problems by the structure – that is, where is fixed and only the sentence is input. It is conjectured [8] that the ensuing problems attain only the complexities  and -complete. This may appear surprising given that 1.) so many natural  problems may be expressed as CSPs (see, e.g., myriad examples in [10]) and 2.)  itself does not have this ‘dichotomy’ property (assuming ) [12]. While this dichotomy conjecture remains open, it has been proved for certain classes of (e.g., for structures of size at most three [4] and for undirected graphs [9]). The like parameterisation of the QCSP is also well-studied, and while no overarching polychotomy has been conjectured, only the complexities , -complete and -complete are known to be attainable (for trichotomy results on certain classes see [3, 18], as well as the dichotomy for boolean structures, e.g., in [6]).

In previous work, [16, 15], we have studied the evaluation problem, parameterised by the structure, under various fragments of  obtained by restrictions on which of the symbols of is permitted. Of course, many of the ostensibly such fragments may be discarded as totally trivial or as repetitions through de Morgan duality. There are four fragments each equivalent to the CSP and QCSP: these are -, -, -, - and -, -, -, -, respectively. Here, equivalent means that a complexity classification for one yields a complexity classification for the other; but, the complexity classes need not be the same. For example, the class of problems given by fixing the structure under - would display dichotomy between  and -complete iff the like class of problems under - displays dichotomy between  and -complete. Various complexity classifications are obtained in [16, 15] and it is observed that the only interesting fragment, other than the eight associated with CSP and QCSP, is -.222 For many of the other fragments the complexity classification is nearly trivial. For example, this is true for -, - and - (also for these classes with or ). For others the classification may be read through the Schaefer classification for boolean CSP and QCSP, because computational hardness is clear over fixed structures of size at least three. For example, this is the case for -, - and -, -. Note that the consideration of is not explicit in [16, 15]. Similarly, fragments involving both quantifiers and or are not explicitly considered. In both cases, the results may be read off from de Morgan duality together with standard Schaefer class results (for which we refer to [6]). The evaluation problem over - may be seen as the generalisation of the QCSP in which disjunction is returned to the mix. Note that the absence of equality is here important, as there is no general method for its being propagated out by substitution. Indeed, we will see that evaluating the related fragment - is -complete on any structure of size at least two.

In this paper we initiate a study of the evaluation problem for the fragment - over a fixed relational – the problem we denote . We demonstrate at least that this class displays a complexity-theoretic richness absent from those other fragments that are not associated with the CSP or QCSP. It is possibly to be hoped, however, that a full classification for this class is not as resistant as that for the CSP or QCSP. We undertake our study through the algebraic method that has been so fruitful in the study of the CSP and QCSP (see [11, 4, 3, 5]). To this end, we define surjective hyper-endomorphisms and use them to define a new Galois connection that characterises definability under -.333While this Galois connection appears here for the first time, it does follow a general recipe as outlined, e.g., in [2]. Note that it is not clear that the many different Galois connections associated with fragments of  can be proved in a straightforwardly uniform manner. We are able to prove a complete complexity classification for when ranges over structures of size at most three. On the class of boolean structures we see dichotomy between  and -complete. On the class of structures of size three we see tetrachotomy between , -complete, -complete and -complete. Some of the results that appear in this paper had been obtained through adhoc methods in [17] – although there the tetrachotomy extends only to digraphs and not arbitrary relational structures. Also, little insight was provided as to the underlying properties of the classification. It is a pleasing consequence of our algebraic approach that we can give quite simple explanation to the delineation of our subclasses.

The paper is organised as follows. In Section 2, we introduce the preliminaries, including the relevant Galois connection together with the central notions of surjective hyper-endomorphism (she) and down-she-monoid. In Section 3, we outline conditions under which the problem either drops from or attains maximal complexity. In Section 4 we classify the complexity of the problems , when ranges over, firstly, boolean structures and, secondly, structures of size three. In the first instance a dichotomy – between  and -complete – is obtained; in the second instance a tetrachotomy – between , -complete, -complete and -complete – is obtained. We conclude, in Section 5, with some final remarks.

An extended abstract of this paper has appeared as [14].

## 2 Preliminaries

Throughout, let be a finite structure, with domain , over the finite relational signature . Let  and  be the positive fragments of first-order (FO) logic, without and with equality, respectively. An extensional relation is one that appears in the signature . We will usually denote extensional relations of by and other relations by (or by some formula that defines them). In   the atomic formulae are exactly substitution instances of extensional relations. The problem has:

• Input: a sentence .

• Question: does

The related problem permits sentences that may involve equalities, in the obvious way. When is of size one, the evaluation of any  sentence may be accomplished in  (essentially, the quantifiers are irrelevant and the problem amounts to the boolean sentence value problem, see [13]). In this case, it follows that both and are also in .

Consider the set and its power set . A hyper-operation on is a function from to (that the image may not be the empty set corresponds to the hyper-operation being total, in the parlance of [1]). If the hyper-operation has the additional property that

• for all , there exists such that ,

then we designate (somewhat abusing terminology) surjective. A surjective hyper-operation (shop) in which each element is mapped to a singleton set is identified with a permutation (bijection). A surjective hyper-endomorphism (she) of is a surjective hyper-operation on that satisfies, for all extensional relations of ,

• if then, for all , .

More generally, for , we say is a she from to if is a she of and . A she may be identified with a surjective endomorphism if each element is mapped to a singleton set. On finite structures surjective endomorphisms are necessarily automorphisms.

For an enumeration of the elements of , let the quantifier-free formula be a conjunction of the positive facts of , where the variables correspond to the elements . That is, for an extensional relation of , appears as an atom in iff . For example, let be the antireflexive -clique, that is the structure with domain and single binary relation

 E:={(0,1),(1,0),(1,2),(2,1),(2,0),(0,2)}.

Then

 ΦK3(v0,v1,v2):=E(v0,v1)∧E(v1,v0)∧E(v1,v2)∧E(v2,v1)∧E(v2,v0)∧E(v0,v2).

The existential sentence is known as the canonical query of . More generally, for a (not necessarily distinct) -tuple of elements , define the quantifier-free to be the conjunction of the positive facts of , where the variables correspond to the elements . That is, appears as an atom in iff . For example,

 ΦK3(0,0,2)(v0,v1,v2):=E(v0,v2)∧E(v2,v0)∧E(v1,v2)∧E(v2,v1).

We refer to elements in as (also ), or when this is an enumeration. We reserve to refer to variables in  formulae.

### 2.1 Galois Connections

For a set of shops on the finite domain , let be the set of relations on of which each is a she (when these relations are viewed as a structure over ). We say that is invariant or preserved by (the shops in) . Let be the set of shes of . Let be the set of automorphisms of .

Let and be the sets of relations that may be defined on in  and , respectively.

###### Lemma 2.1

Let be a -tuple of elements of . There exists:

• a formula s.t. iff there is an automorphism from to .

• a formula s.t. iff there is a she from to .

{proof}

For Part , let an enumeration of the elements of and be the associated conjunction of positive facts. Set

 ∃v1,…,v|B| ΦB(v1,…,v|B|)∧∀v (v=v1∨…∨v=v|B|)∧u1=vλ1∧…∧uk=vλk,

where , …, . The forward direction follows since is finite, so any surjective endomorphism is necessarily an automorphism. The backward direction follows since all first-order formulae are preserved by automorphism.

[Part .] This will require greater dexterity. Let , be an enumeration of and . Recall that is a conjunction of the positive facts of , where the variables correspond to the elements . Similarly, is the conjunction of the positive facts of , where the variables correspond to the elements . Set

 ∃v1,…,v|B| ΦB(r,s)(u1,…,uk,v1,…,v|B|)∧∀w1…w|B|
 ⋁t∈B|B|ΦB(r,s,t)(u1,…,uk,v1,…,v|B|,w1,…,w|B|).

[Part , backwards.] Suppose is a she from to , where (we will wish to differentiate the two occurrences of ). We aim to prove that . Choose arbitrary as witnesses for . Let be any valuation of and take arbitrary s.t. , …, (here we use surjectivity). Let . It follows from the definition of she that

 B′ ⊨ ΦB(r,s)(r′1,…,r′k,s′1,…,s′|B|)∧ΦB(r,s,t)(r′1,…,r′k,s′1,…,s′|B|,t′1,…,t′|B|).

[Part , forwards.] Assume that , where . Let be an enumeration of .444One may imagine and to be the same enumeration, but this is not essential. In any case, we will wish to keep the dashes on the latter set to remind us they are in and not . Choose some witness elements for and a witness tuple s.t.

 (†) B′⊨ ΦB(r,s)(r′1,…,r′k,s′1,…,s′|B|)∧ΦB(r,s,t)(r′1,…,r′k,s′1,…,s′|B|,b′1,…,b′|B|).

Consider the following partial hyper-operations from .

• given by , for .

• given by , for .         (totality.)

• given by iff , for .         (surjectivity.)

Let ; is a hyper-operation whose surjectivity is guaranteed by (note that totality is guaranteed by ). That is a she follows from the right-hand conjunct of .

###### Theorem 2.2

For a finite structure we have

• and

• .

{proof}

Part is well-known and may be proved in a similar, albeit simpler, manner to Part , which we now prove.

[.] This is proved by induction on the complexity of .

(Base Case.) .555The variables may appear multiply in and in any order. Thus is an instance of an extensional relation under substitution and permutation of positions. Follows from the definition of she.

(Inductive Step.) There are four subcases. We progress through them in a workmanlike fashion. Take .

.666The presence of, e.g., in should not be taken as indication that all appear free in both and . Let . Suppose ; then both and . By Inductive Hypothesis (IH), for any , both and , whence .

. Let . Suppose ; then one of or ; w.l.o.g. the former. By IH, for any , , whence .

. Let . Suppose ; then for each , . By IH, for any , we have for all (remember is surjective), , whereupon .

. Let . Suppose ; then for some , . By IH, for any (remember can not be empty), , whereupon .

[] Consider the -ary relation . Let be the tuples of . Set

 θS(u1,…,uk) := θr1(u1,…,uk)∨…∨θrm(u1,…,uk).

Manifestly, . For , note that (the ‘identity’ she will be formally introduced in the next section). That now follows from Part of Lemma 2.1, since . Let indicate the existence of a logspace many-to-one reduction. The following theorem is our counterpart to Corollary 4.11 of [10] (for CSP) and Theorem 3.1 of [3] (for QCSP).

###### Theorem 2.3

Let and be finite structures over the same domain .

• If then .

• If then .

{proof}

Again, Part is well-known and the proof is similar to that of Part , which we give. If , then . From Theorem 2.2, it follows that . Recalling that contains only a finite number of extensional relations, we may therefore effect a Logspace reduction from to by straightforward substitution of predicates.

### 2.2 Down-she-monoids

Consider a finite domain . The identity shop is defined by . Given shops and , define the composition by . Finally, a shop is a sub-shop of – denoted – if , for all . A set of surjective shops on a finite set is a down-she-monoid (DSM), if it contains , and is closed under composition and sub-shops (of course, not all sub-hyper-operations of a shop are surjective – we are only concerned with those that are). is a she of all structures, and, if and are shes of , then so is . Further, if is a she of , then so is for all (surjective) . It follows that is always a DSM. The DSMs of form a lattice under (set-theoretic) inclusion and, as per the Galois connection of the previous section, classify the complexities of . If is a set of shops on , then let denote the minimal DSM containing the operations of . If is the singleton , then, by abuse of notation, we write instead of

For a shop , define its inverse by . Note that is also a shop and , though only if is a permutation. For a set of shops , let . If is a DSM then so is . We will see this algebraic duality resonates with the de Morgan duality of and , and the complexity-theoretic duality of and . However, we resist discussing it further as it plays no direct role in the derivation of our results.

A permutation subgroup on a finite set is a set of permutations of closed under composition. It may easily be verified that such a set contains the identity and is closed under inverse. A permutation subgroup may be identified with a particular type of DSM in which all shops have only singleton sets in their range. The permutation subgroups form a lattice under inclusion whose minimal element contains just the identity and whose maximal element is the symmetric group . As per the Galois connection of the previous section, this lattice classifies the complexities of – although we shall see these are relatively uninteresting.

In the lattice of DSMs, the minimal element still contains just , but the maximal element contains all shops. However, the lattice of permutation subgroups always appears as a sub-lattice within the lattice of DSMs.

## 3 Classification methods

We are now in a position to study the interplay between the shes of a structure and the complexity of the problem .

### 3.1 Shes inducing lower complexity

We begin by studying three classes of she, the presence of any of which reduces the complexity of the problem . Let be a finite structure, with distinct elements . We define the following shops from to .

 ∀b(x):={Bif x=b{x}otherwise.
 ∃b(x):={x,b}
 ∀b∃b′(x):={Bif x=b% {b′}otherwise.

We call their classes -, - and -shops, respectively.

In Figure 1, four digraphs are drawn. For typographic reasons we will mark-up, e.g., the shop , and as . It may easily be verified that the DSMs are as follows.

 shE(G1)shE(G2)shE(G3)shE(G4)⟨\resizebox11.381102pt$00111212$⟩⟨\resizebox11.381102pt$00101222$⟩⟨\resizebox11.381102pt$02101222$,\resizebox11.381102pt$0010122$⟩⟨\resizebox11.381102pt$0012112012$⟩

We see that , and admit the shes , and , respectively. admits each of the shes , , , and . {remarks} We have not considered shes , defined as above but with . The DSM is easily seen to contain all shops. It follows that any structure that has as a she already has all shes of the form with .

Note that the DSMs and do not in general coincide, though the first is always a subset of the following three. Also, we note the identities , and . We now give a series of three lemmas, one associated with each of the shops , and . They will ultimately be used in a form of quantifier elimination that will diminish the complexity of , if has one of these as a she.

###### Lemma 3.1

Let be a formula of . Let be a finite structure with as a she. Then

 B⊨∀u φ(u,v) ⟺ B⊨φ(b,v).
{proof}

The forward direction is trivial; we prove the backward. Consider the relation defined by the formula , where , of on . By Theorem 2.2, it is invariant under . For any , assume . Taking an arbitrary , and noting each and , we derive . The result follows.

###### Lemma 3.2

Let be a formula of . Let be a finite structure with as a she. Then

 B⊨∃u φ(u,v) ⟺ B⊨φ(b,v).
{proof}

The backward direction is trivial; we prove the forward. Consider the relation defined by the formula , where , of on . By Theorem 2.2, it is invariant under . For any , and some , assume . Noting each and , we derive . The result follows.

###### Lemma 3.3

Let be a formula of , where the arity of is . Let be a finite structure with as a she. For all and ,

 B⊨φ(b,x) \lx@stackrel(I)⟹ B⊨φ(c,x) \lx@stackrel(II)⟹ B⊨φ(b′,x).
{proof}

Consider the relation defined by the formula of on . By Theorem 2.2, it is invariant under . Take arbitrary . Noting that is from , we have and . Part follows. Now noting that , Part follows. We are now ready to state how the presence of -, - or -shops as shes of can diminish the complexity of . In each case we proceed by quantifier elimination.

###### Theorem 3.4

If has a -shop as a she then is in . If has an -shop as a she then is in . If has a -shop as a she then is in .

{proof}

Let be a sentence of , and let (respectively, and ) be with all universal variables substituted by (respectively, existential variables substituted by and universal variables substituted by and existential variables substituted by ).

If has a she , then consider a sentence , w.l.o.g. in prenex form. It follows by repeated application of Lemma 3.1 on – either from the outermost quantifier in, or from the innermost quantifier out – that