We revisit the complexity classification of constraint satisfaction problems (CSPs) for first-order reducts of (Z,<), established by Bodirsky, Martin, and Mottet in 2018. Following their approach, we give a self-contained proof of this classification, correcting several errors in the argument. We further show that, with the exception of cases arising from finite-domain CSPs, all tractable cases are solved by a well-known uniform algorithm, eliminating the need for the collection of ad-hoc algorithms used in the original paper.
A central component of the proof allows the analysis to be restricted to first-order reducts of (Z,<) that contain the successor relation. We substantially simplify this reduction and generalize the underlying construction. This generalization allows us to apply the same technique to first-order reducts of the triangular lattice graph and of infinite regular trees, yielding a complete complexity classification for these classes of structures, in particular a P versus NP-complete dichotomy.
1 Introduction
The constraint satisfaction problem CSP(M) of a relational structure M asks, given a primitive positive sentence ϕ over the signature of M, that is, an existentially quantified conjunction of atomic formulas, whether ϕ holds in M. Equivalently, viewing ϕ as encoding, in the natural way, a structure N over the same signature, this is the question of whether there exists a homomorphism from N to M. When M is finite, the complexity of CSP(M) is by now completely understood: the celebrated proof of the Feder–Vardi dichotomy conjecture shows that every such problem is solvable in polynomial time or NP-complete. For infinite M, no such general classification can be expected, but CSP(N) has been studied extensively for first-order reducts N of a fixed infinite structure M. A first-order reduct of M is a structure with the same domain whose relations are first-order definable in M. Complete complexity classifications, and in several cases full P versus NP-complete dichotomies, have been obtained for the CSPs of first-order reducts of the order of the rationals, the random graph, the random poset, and various other ω-categorical structures.
Among these structures, first-order reducts of (Z,<) occupy a distinguished position: (Z,<) is not ω-categorical, a property that in the other cases provides powerful tools, most notably a correspondence between primitive positive definability and preservation by polymorphisms, for classifying the complexity of the corresponding CSPs. Essentially, the relations that first-order reducts of (Z,<) can express beyond those already definable over (Q,<) are relations that constrain the distance between elements.
Example 1. Let diff2:={(a,a+2)∣a∈Z}. Then ∃u∀v(x<v<y↔u=v) defines diff2 in (Z,<) and hence (Z,diff2) is a first-order reduct of (Z,<).
At the same time, every CSP of a first-order reduct of (Q,<) equals CSP(Γ) for some first-order reduct Γ of (Z,<). So the latter class strictly generalizes the former. The complexity of CSP(Γ) for every finite-signature, first-order reduct Γ of (Z,<) was classified by Bodirsky, Martin, and Mottet [7], building on an earlier classification, due to Bodirsky et al. [8], of the CSPs of locally finite, finite-signature, first-order reducts of (Z,succ), the integers equipped with the successor relation. More recently, the classification of Bodirsky, Martin, and Mottet [7] has found application beyond its original setting: Dabrowski et al. [11] use it as a key ingredient in the parametrized complexity analysis of disjunctive temporal problems.
*Funded by the European Union (ERC, POCOCOP, 101071674). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
In this paper we revisit the classification of Bodirsky, Martin, and Mottet [7] and make the following contributions. We correct several errors in the original proof. Most importantly, the argument in [7] relies on the claim that every first-order reduct of (Z,<) that contains the successor relation either primitively positively defines < or is itself a first-order reduct of (Z,succ). We show that this claim is false, and we close the resulting gap in the classification. We also show that, with the exception of those cases whose CSP equals the CSP of a finite structure, every tractable CSP( Γ) for a first-order reduct Γ of (Z,<) can be solved by a single, well-known uniform algorithm, which removes the need for the collection of ad-hoc algorithms designed separately for individual cases in [7] and in [8]. Our main technical contribution, however, is a significant simplification and generalization of the technique underlying the reduction, in [7], of the full classification to the case of first-order reducts of (Z,<) that contain the successor relation. As a minor additional point, whereas the original proof relies on quantifier elimination in a way that only works for finite signatures, our proof does not rely on quantifier elimination in the same way and therefore also applies to reducts with infinite signatures. Finally, we demonstrate the reach of this generalized technique by applying it to two further classes of structures: first-order reducts of the triangular lattice graph, and first-order reducts of infinite regular trees. In both cases we obtain a full complexity classification, and in particular a P versus NP-complete dichotomy, for the corresponding CSPs.
Tool and computational resource disclosure Large language models were used to assist with the writing and editing of this manuscript. All mathematical content was developed without AI assistance. GPT-6 Astra by OpenAI was used to review an earlier version of the manuscript and identified mathematical errors. All identified errors were corrected without AI assistance.
Notation N denotes the non-negative integers, including zero, and for n∈N, [n]:={1,…,n}. We write aˉ for a tuple (a1,…,ak); if the tuple itself carries an index, as in aˉi, we instead write its entries as ai(1),…,ai(k). The projection onto the i-th coordinate is written πi, i.e., πi(aˉ):=ai, and the projection of a relation R of arity k onto coordinates I⊆[k] is written ProjI(R):={(πi(aˉ))i∈I∣aˉ∈R}. Given an equivalence relation ∼ and an element a, [a]∼ denotes the ∼-equivalence class of a. A, M, N, and occasionally M, denote structures with respective domains A, M, and N, while Γ and Δ are reserved for first-order reducts of a fixed structure. The σ-reduct of a τ-structure M, for σ⊆τ, is written M↾σ; the substructure induced by A⊆M is written M∣A, and the same bar notation restricts a function or relation to a subset of its domain. We write M⪯N to mean that M is an elementary substructure of N. Let Hom(M,N) denote the set of homomorphisms from M to N, End(M):=Hom(M,M), and Aut(M) the automorphism group of M. When M and N are relational, we further let Pol(M,N):=⋃k∈NHom(Mk,N). For a binary relation symbol R, n∈Z, and variables x,y, define
Finally, for S,T⊆Z and ∘∈{+,−,⋅}, we write S∘T:={s∘t∣s∈S,t∈T}, and n∘T:={n}∘T, S∘n:=S∘{n} for n∈Z.
2 Saturation
A recurring theme in our proofs, already used by Bodirsky, Martin, and Mottet [7], is that in order to study CSP( Γ) for a first-order reduct Γ of (Z,<), it is useful to look not at Γ itself, but at a suitably enriched, saturated version of it. Recall that a countable structure is saturated if, informally, it realizes every consistent pattern of properties expressible with finitely many parameters, that is, every consistent type over a finite parameter set is realized in the structure. Passing to a saturated elementary extension does not change which first-order sentences are true, and in particular preserves the CSP.
The countable saturated models of the theory of (Z,<) are simple: they look like a dense linear order in which every point has been replaced by a copy of (Z,<), or equivalently, Q×Z ordered lexicographically.
Definition 2. For a first-order reduct Γ of (Z,<), let Q.Γ be the first-order reduct of (Q×Z,<) over the same signature whose relations are defined by the same formulas.
To work with such structures Q.Γ conveniently, we extend the difference operator on Z to Q×Z: for (p,a),(q,b)∈Q×Z, we define
(p,a)−(q,b):=⎩⎨⎧a−b∞−∞ifp=qifp>qifp<q.
What changes when passing from Γ to Q.Γ, and what makes this passage useful, is the set of endomorphisms. Recall that a relation is primitive positive, or pp-, definable in a structure if it can be defined by an existentially quantified conjunction of atomic formulas over that structure, and that every pp-definable relation is preserved by all endomorphisms of the structure. This matters for the complexity of CSP(Γ): if a relation is pp-definable in Γ, a constraint on it can be simulated using the relations of Γ that are already present, so adding it to the signature does not change the complexity of the problem. A saturated extension typically admits many endomorphisms that Γ does not, and this richer supply of endomorphisms lets us rule out pp-definability for relations where the endomorphisms of Γ alone would not suffice.
Example 3. Let Γ:=(Z,diff2,¬succ,=). Then End(Γ)={Z→Z,a↦a+n∣n∈Z}, while Q.Γ has an endomorphism e with ∣e(a)−e(b)∣=∞ for all a,b∈Q×Z with a−b∈/2Z. It follows that Γ does not pp-define succ, a fact that is not visible just from the endomorphisms of Γ itself.
Even more useful, and central to our proofs, is a partial converse of this fact. By compactness, if every endomorphism of Q.Γ exhibits some fixed first-order definable behavior, then this behavior is already forced by a finite substructure, in the sense that the way endomorphisms act on finitely many elements already entails how they act everywhere else. By encoding this finite witness as a primitive positive formula in the natural way, we can turn a purely algebraic hypothesis, namely that some property is preserved by all endomorphisms of Q.Γ, into a pp-definability statement about Γ.
2.1 Local and global
The finite-witness phenomenon described above is, at heart, a compactness argument, so it is natural to make it precise in the framework of first-order logic. The basic tool for reasoning about homomorphisms in this framework is the positive diagram Diag+(M) of a structure M, defined as the set of atomic sentences valid in (M,(a)a∈M). Its usefulness stems from the easily verified fact that (N,(ba)a∈M)⊨Diag+(M) if and only if a↦ba defines a homomorphism M→N.
The full strength of saturation is not needed for our arguments; a weaker property suffices. Recall that a structure M is κ-universal, for a cardinal κ, if every structure N≡M with ∣N∣<κ embeds elementarily into M. Every saturated structure M is ∣M∣+-universal [see 15, Theorem 10.1.6], so everything we prove for universal structures applies to saturated ones.
As a warm-up that already makes use of universality, we prove the following folklore result, which we will need later.
Lemma 4. Let M be an infinite relational κ-universal τ-structure with ℵ0+∣τ∣<κ. Then M has a finite-range endomorphism if and only if there exists a finite structure N with CSP(M)=CSP(N).
Proof. Since the other direction is trivial, we assume that there is some finite τ-structure N with CSP(M)=CSP(N). Now, for all finite A⊆M and σ⊆τ there exists a homomorphism h:(M∣A)↾σ→N↾σ and thus N,(h(a))a∈A⊨Diag+((M∣A)↾σ). By compactness it follows that Th(N)∪Diag+(M) is consistent and hence has a model N′. Since N is finite we have N≅N′↾τ. Moreover, N′⊨Diag+(M) implies that there exists a homomorphism f:M→N.
Similarly, for all finite σ⊆τ there is a homomorphism N↾σ→M↾σ and by compactness the set Th(M)∪Diag+(N) is consistent. Hence, by the Löwenheim-Skolem theorem [see 15, Corollary 3.1.5] it has a model M′ of size less than κ, whose τ-reduct admits a homomorphism from N. Since M is κ-universal and M≡M′↾τ, there exists an elementary embedding M′↾τ→M. Thus, we have a homomorphism g:N→M and g∘f is a finite-range endomorphism of M.
With the technique rehearsed, we now turn to Proposition 5, which we prove in a more general form than the preceding discussion requires. First, rather than restricting attention to endomorphisms, we consider homomorphisms from an arbitrary structure to M. Second, we assume only universality instead of full saturation.
Proposition 5. Let M be an infinite relational κ-universal τ-structure with ℵ0+∣τ∣<κ and N a structure with signature σ⊆τ and ∣N∣<κ. Suppose Φ is a set of τ-formulas in variables {xa∣a∈N} such that
forallh∈Hom(N,M↾σ)thereisϕ∈ΦwithM⊨ϕ((h(a))a∈N).
Then there are finite A⊆N, ρ⊆σ and Ψ⊆Φ in variables {xa∣a∈A} such that
forallh∈Hom(A,M↾ρ)thereisϕ∈ΨwithM⊨ϕ((h(a))a∈A)
where A is the ρ-reduct of N∣A.
Proof. Suppose for contradiction that the set
Th(M)∪Diag+(N)∪{¬ϕ((a)a∈N)∣ϕ∈Φ}
is consistent. Then by the Löwenheim-Skolem theorem [see 15, Corollary 3.1.5] it has a model B of size less than κ. Since B⊨Diag+(N)∪{¬ϕ((a)a∈N)∣ϕ∈Φ}, there is a homomorphism f:N→B↾σ with B⊨¬ϕ((f(a))a∈N) for all ϕ∈Φ. Because B⊨Th(M) and M is κ-universal there exists an elementary embedding g:B↾τ→M. However, now h:=g∘f is a homomorphism N→M↾σ with M⊨¬ϕ((h(a))a∈N) for all ϕ∈Φ contradicting the assumption.
Hence, the set is inconsistent and by compactness there are finite A⊆N, ρ⊆σ and Ψ⊆Φ in variables {xa∣a∈A} such that for A:=(N∣A)↾ρ the subset
Th(M)∪Diag+(A)∪{¬ϕ((a)a∈A)∣ϕ∈Ψ}
is inconsistent and thus
Th(M)∪Diag+(A)⊢ϕ∈Ψ⋁ϕ((a)a∈A).
Now, if h:A→M↾ρ is a homomorphism we have M,(h(a))a∈A⊨Diag+(A), and hence there is some ϕ∈Ψ with M⊨ϕ((h(a))a∈A).
3 A general framework
Apart from saturation, (Q×Z,<) has further properties that we exploit in our simplified proof of the reduction, mentioned in the introduction, of the classification of CSP( Γ), for first-order reducts Γ of (Z,<), to the case where Γ contains the successor relation. First, its automorphism group is transitive, i.e., for all a,b∈Q×Z there is f∈Aut(Q×Z,<) with f(a)=b. Second, every automorphism of a single copy of (Z,<) inside (Q×Z,<) can be extended to an automorphism of the full structure by leaving the elements of all other copies unchanged. Third, the copy of (Z,<) containing a given element of Q×Z coincides with the algebraic closure of that element in (Q×Z,<); moreover, this copy clearly embeds elementarily into (Q×Z,<). Formally, for a τ-structure M and A⊆M, the algebraic closure aclM(A) consists of all a∈M for which there is a τ-formula ϕ(x,y1,…,yk) and bˉ∈Ak such that M⊨ϕ(a,bˉ) and the set {a′∈M∣M⊨ϕ(a′,bˉ)} is finite. However, in a saturated structure algebraic closure admits an easier characterization: if M is saturated and ∣A∣<∣M∣, then a∈aclM(A) if and only if the set {f(a)∣f∈Aut(M),f∣A=idA} is finite [see 16, Proposition 4.3.27]. We introduce a notion for structures satisfying suitable abstractions of the three properties above.
Definition 6. A relational, infinite, saturated structure M is nice if
Aut(M)istransitive,
(trans)
M∣acl(a)⪯Mforsome(equivalentlyall)a∈M,
(emb)
a∈acl(b)⟹b∈acl(a),
(sym)
f∈Aut(M∣acl(a))⟹f∪idM\acl(a)∈Aut(M).
(ext)
For elements a,b of a nice structure M, we write a≍b if acl(a)=acl(b). By (sym), the ≍-class of a is exactly acl(a), i.e., acl(a)=[a]≍.
Lemma 7. Let M be a first-order reduct of a nice structure M. Then the following are equivalent.
M∣aclM(a) has a finite-range endomorphism for some (equivalently all) a∈M.
CSP(M)=CSP(N) for a finite structure N.
M has a finite-range endomorphism.
Proof. If e∈End(M∣aclM(a)) has finite range, then M∣e(aclM(a)) is finite with the same CSP as M∣aclM(a). By (emb) we have M≡M∣aclM(a) and hence CSP(M)=CSP(M∣e(aclM(a))).
If CSP(M)=CSP(N) for a finite structure N, then M has a finite-range endomorphism by Lemma 4.
Suppose e∈End(M) such that e(M)=:A is finite and has minimal size, i.e., ∣e(M)∣≤∣f(M)∣ for all f∈End(M). Then e(A)=A, which means that e∣A is a permutation of A. Since e∣A∣!∣A=idA let us assume w.l.o.g. that already e∣A=idA. Fix any a∈A and suppose for contradiction that there exists b′∈aclM(a) with b:=e(b′)∈/aclM(a). By (ext) and (trans) there is f∈Aut(M) with f(a)=b′ and f(c)=c for all c∈M∖aclM(a). Now, for g:=e∘f the restriction g∣A is a permutation of A with g∣A(a)=b=g∣A(b). Hence, g(A)⊊A, which means that (g∘e)(M)⊊A contradicts our choice of e. It follows that e(aclM(a))⊆aclM(a) and thus e∣aclM(a) is a finite-range endomorphism of M∣aclM(a).
We also fix some general notation used throughout. For a set A, F⊆AA, and aˉ∈Ak, we let aˉF:={f(aˉ)∣f∈F}. Typically, A is the domain of a structure A and F is Aut(A) or End(A); in the former case we call aˉF the orbit of aˉ in A. An orbit of a pair is called an orbital.
Lemma 8. Let M be nice. If a1≍⋯≍ak, then aˉAut(M) is first-order definable in M.
Proof. If k=1 we are done because Aut(M) is transitive and hence a1Aut(M) is defined by the formula x=x. Suppose k>1 and (a1,…,ak−1)Aut(M) is defined by a formula ϕ(xˉ). Let A⊆M be minimal such that it contains ak and is definable in M by a formula ψ(a1,…,ak−1,x). Since ak∈aclM(a1,…,ak−1) we know that such a set exists and that it is finite. Clearly, akAut(M,a1,…,ak−1)⊆A. Now, suppose for contradiction that there exists b∈A∖akAut(M,a1,…,ak−1). Since M is saturated there is a formula χ(a1,…,ak−1,x) such that M⊨χ(a1,…,ak−1,ak) but M⊨χ(a1,…,ak−1,b) [see 16, Propositions 4.2.13 and 4.3.3]. However, now the formula ψ(a1,…,ak−1,x)∧χ(a1,…,ak−1,x) defines a proper subset of A that contains ak, which contradicts the minimality of A. Therefore, ψ(a1,…,ak−1,x) defines akAut(M,a1,…,ak−1). It follows that ϕ(x1,…,xk−1)∧ψ(x1,…,xk) defines (a1,…,ak)Aut(M).
Definition 9. For a first-order reduct M of a nice structure M we define ∼M⊆M2 such that
a∼Mb⟺e(a)≍e(b)foralle∈End(M).
Note, that ∼M is an equivalence relation and preserved by End(M).
Lemma 10. Let M be a first-order reduct of a nice structure M. If a1∼M⋯∼Mak, then M pp-defines aˉEnd(M), which is a finite union of k-orbits of Aut(M).
Proof. Suppose w.l.o.g. that M is a σ-reduct of M. For any e∈End(M) we have e(a1)≍⋯≍e(ak) and thus by Lemma 8 a formula ϕe((xa)a∈aˉ) that defines e(aˉ)Aut(M) in M. Let Φ:={ϕe∣e∈End(M)}. Then by Proposition 5 there are finite A⊆M, ρ⊆σ and Ψ⊆Φ such that for all h∈Hom(A,M↾ρ) there is ϕ∈Ψ with M⊨ϕ((h(a))a∈aˉ), where A is the ρ-reduct of M∣A. Let ψ((xa)a∈aˉ) be the pp-formula obtained by existentially quantifying all xb with b∈/aˉ in ⋀{Rxb1…xbℓ∣R∈ρ,(b1,…,bℓ)∈RA}. Now, M⊨ψ((ba)a∈aˉ) iff there is h∈Hom(A,M↾ρ) with h(a)=ba for all a∈aˉ. Hence, if M⊨ψ((ba)a∈aˉ) then M⊨ϕ((ba)a∈aˉ) for some ϕ∈Ψ and thus (ba)a∈aˉ∈aˉEnd(M). Because every ϕ∈Ψ defines a k-orbit of Aut(M) it follows that the relation defined by ψ is a finite union of k-orbits. On the other hand, every e∈End(M) induces a homomorphism A→M↾ρ and thus we have M⊨ψ(e(aˉ)) for all e∈End(M).
Proposition 11. Let M be a first-order reduct of a nice structure M and let ≈⊆∼M be an equivalence relation that is preserved by End(M) such that for all a∼Mb there is e∈End(M) with e(a)≈e(b). Then there exists e∈End(M) such that
e(M) is finite or
for all a,b∈M either e(a)≈e(b) or e(a)=e(b).
Proof. First, we claim that whenever B⊆M and for all e∈End(M) there are a,b∈B with e(a)≈e(b) and e(a)≍e(b), then there exists a finite A⊆B such that
there is a finite union U⊆≍ of orbitals of Aut(M) so that
for all e∈End(M) there are a,b∈e(A) with a≈b and (a,b)∈U. (*)
For every e∈End(M) pick some a,b∈B with e(a)≈e(b) and e(a)≍e(b) and let ϕe(xa,xb) be a formula defining (e(a),e(b))Aut(M), which exists by Lemma 8. Then by Proposition 5, using the set Φ:={ϕe∣e∈End(M)}, there are finite A⊆B and Ψ⊆Φ such that for all e∈End(M) there are ϕ∈Ψ and a,b∈A with M⊨ϕ(e(a),e(b)). Since each ϕ∈Ψ defines an orbital of Aut(M), the set U:={(a,b)∈M2∣ϕ∈Ψ,M⊨ϕ(a,b)} is a finite union of orbitals. Because ≈ is preserved by Aut(M)⊆End(M) we have U∩≈=∅, which proves the claim.
Suppose we are not in Case 2 and let A⊆M be finite of minimal size satisfying (). If A={a,b} then for all e∈End(M) we have e(a)≍e(b) and thus a∼Mb. Hence, by assumption there exists some f∈End(M) such that f(a)≈f(b), which contradicts A satisfying (). It follows that A contains at least three elements.
Now, suppose for contradiction that there are e∈End(M) and distinct a,b∈e(A) with a≈b. Clearly, e(A) satisfies (). By our minimality assumption on the size of A the set e(A)∖{a} does not satisfy (). From what we proved earlier it follows that there exists some f∈End(M) such that for all c,d∈e(A)∖{a} we have f(c)≈f(d) or f(c)≈f(d). Because e(A) satisfies (*) there is some c∈e(A)∖{a} such that f(a)≈f(c) and f(a)≍f(c). Since ≈ is preserved by End(M) we have f(a)≈f(b) and in particular f(a)≍f(b). It follows that f(b)≈f(c) and f(b)≍f(c) contradicting the choice of f.
Therefore, for every e∈End(M) and all distinct a,b∈A we have e(a)≈e(b). Now, for all e∈End(M) and B⊆e(A), since B does not satisfy (), there is some fB∈End(M) with fB(a)≈fB(b) for all distinct a,b∈B. Because A contains at least three elements it follows that there are e∈End(M) and a∈e(A) such that a≈b for all b∈e(A)∖{a}=:B. Fix any a′∈aclM(a). By (trans) and (ext), there exists g∈Aut(M) with g(a)=a′ and g(b)=b for all b∈B. Now, as e(A) satisfies (), there is some b∈B such that (fB(a′),fB(b))=((fB∘g)(a),(fB∘g)(b))∈U. Since we picked a′∈aclM(a) arbitrarily we get that fB(aclM(a))⊆{c∣b∈fB(B),(c,b)∈U}. It follows that fB(aclM(a)) is finite. Now, fB∣aclM(a) is a homomorphism M∣aclM(a)→M with finite range. By (emb) we have M≡M∣aclM(a) and thus by Lemma 4 there exists an endomorphism of M with finite range.
Lemma 12. Let M be a first-order reduct of a nice structure M and ≈⊆∼Γ an equivalence relation that is preserved by Aut(M) and such that ≈∩aclM(a)2 has finitely many equivalence classes for all a∈M. Then the following are equivalent.
M has a finite-range endomorphism.
There exists a finite union U of orbitals of Aut(M) such that for all a≈b there exists e∈End(M) with (e(a),e(b))∈U.
Proof. Since the other direction is trivial, we prove that Item 2 implies Item 1. Because ∼Γ⊇≈ is preserved by End(M), we can assume w.l.o.g. that U⊆∼Γ. Let V:=UEnd(M). Then by Lemma 10 the set V is a finite union of orbitals of Aut(M).
Suppose for contradiction that for all e∈End(M) there are a,b∈M such that e(a)≈e(b) and (e(a),e(b))∈/V. For each e∈End(M) we fix such a,b∈M and let ϕe(xa,xb) be a formula defining the orbital (e(a),e(b))Aut(M) in M. Such formulas exist by Lemma 8. Setting Φ:={ϕe∣e∈End(M)}, by Proposition 5 there exists a finite A⊆M such that
for all e∈End(M) there are a,b∈A with e(a)≈e(b) and (e(a),e(b))∈/V.
and fix a finite A⊆M satisfying ( †) such that W(A) has minimal size. Now, pick any (a,b)∈W(A) and let e∈End(M) with e(a)≈e(b) and (e(a),e(b))∈/V. By assumption there exists f∈End(M) such that for g:=f∘e we have (g(a),g(b))∈U. Now, g(A) satisfies ( †) with W(g(A))⊆g(W(A))∖{(g(a),g(b))} contradicting our choice of A.
Hence, there exists e∈End(M) such that for all a,b∈M we have e(a)≈e(b) or (e(a),e(b))∈V. Fix a∈M and let B⊆aclM(a) be minimal such that e(B) contains exactly one representative of each equivalence class of ≈∩e(aclM(a)). Since ∼Γ∩aclM(a)2⊇≈∩aclM(a)2 has finitely many equivalence classes, there is a finite C⊆M such that e(B)⊆⋃c∈CaclM(c). Because ≈∩aclM(c)2 has finitely many equivalence classes for each c∈C, it follows that B is finite. Now, for each c∈aclM(a) there exists b∈B such that (e(b),e(c))∈V. Since V⊆≍ is a finite union of orbitals of Aut(M) it follows that e(aclM(a))⊆{c∣b∈B,(e(b),c)∈V} is finite. Thus, e∣aclM(a):M∣aclM(a)→M is a homomorphism with finite range and by Lemma 4 with (emb) it follows that M has a finite-range endomorphism.
4 PP-Defining successor
We now apply the results from Section 3 to first-order reducts of (Z,<) in order to prove Theorem 20, which shows that every such reduct falls into one of four categories. For two of these categories, the complexity of the corresponding CSP is already fully classified, and for a third we can establish NP-hardness by a simple argument (Lemma 22). This leaves only the case in which the reduct pp-defines the successor relation, so for the remainder of the paper we may restrict attention to reducts containing succ.
This was already shown by Bodirsky, Martin, and Mottet [7], but their proof is long, spanning pages 10 to 27, and only applies to reducts with finite signature, owing to the way it relies on quantifier elimination. In contrast, our proof amounts to applying the results of Section 3 to an appropriately chosen relation (Definition 14); the main task of this section is to verify that this relation satisfies the required assumptions in the case relevant to our classification.
Two basic facts about (Q×Z,<) will be useful throughout: for all a,b∈Q×Z the orbital (a,b)Aut(Q×Z,<) is {(c,d)∈(Q×Z)2∣a−b=c−d}, and it is not hard to see that (Q×Z,<) is nice, with a≍b⟺∣a−b∣<∞.
It is also convenient to introduce some notation for working with first-order reducts of (Z,<) and their saturated counterparts. Given S⊆Z, let diffS:={(a,b)∈Z2∣b−a∈S} and distS:=diffS∪diff−S, and use the same notation for the corresponding relations on Q×Z whenever S is finite, with the intended domain always clear from context. Singletons are abbreviated by diffn:=diff{n} and distn:=dist{n} for n∈Z, and we write (p,a)+n:=(p,a+n) for (p,a)∈Q×Z and n∈Z.
Lemma 13. If ∼⊆(Q×Z)2 is a non-total equivalence relation that is preserved by Aut(Q×Z,<) then there exists n∈N such that a∼b⟺a−b∈nZ.
Proof. If there are a∼b with ∣a−b∣=∞, it follows from (trans), (emb) and (ext) that ∼ is total against the assumption. Since ∼ is preserved by Aut(Q×Z,<), it is a union of orbitals and thus a∼b⟺a−b∈S for some non-empty S⊆Z. If S={0} we are done setting n:=0. Otherwise, let n:=gcdS. By Bézout's identity there are s1,…,sk∈S and m1,…,mk∈Z such that m1s1+⋯+mksk=n. Hence, for any a∈Q×Z there is a ∼-path from a to a+n. It follows that n∈S and thus a∼b⟺a−b∈nZ. □
To simplify notation, for a first-order reduct Γ of (Z,<) we will write ∼Γ instead of ∼Q,Γ (see Definition 9).
Definition 14. For a first-order reduct Γ of (Z,<) let ≈Γ⊆(Q×Z)2 such that
a≈Γb⟺∣e(a)−e(b)∣≤∣a−b∣<∞foralle∈End(Q.Γ).
For Proposition 11 to apply, we would like ≈Γ to be an equivalence relation that is preserved by End(Q.Γ). In general, however, neither property holds, as the following example shows.
Example 15. Let Γ:=(Z,dist{0,1,2},dist{0,1,2,3}). Then (0,0)≈Γ(0,3)≈Γ(0,1). However,
is an endomorphism of Q.Γ with ∣e(0,0)−e(0,1)∣=2>1=∣(0,0)−(0,1)∣, so (0,0)≈Γ(0,1); hence ≈Γ is not transitive. Moreover, e(0,1)=(0,2)≈Γ(0,3)=e(0,3), so ≈Γ is not preserved by e.
Fortunately, in the case relevant to our classification, namely, whenever Γ has no finite-range endomorphism, ≈Γ is both an equivalence relation and preserved by End(Q.Γ), as we show below. The proof of the next lemma is partly based on that of [7, Lemma 5.23].
Lemma 16. Let Γ be a first-order reduct of (Z,<) without a finite-range endomorphism. If a≈Γb then Q.Γ pp-defines diff b−a or dist b−a.
Proof. By Lemma 13 there exists r∈N such that c∼Γd⟺c−d∈rZ for all c,d∈Q×Z. If r=0, since ≈Γ⊆∼Γ we have a=b and diffa−b is pp-defined by x=y. Suppose r>0. By Lemma 10 there exists m:=max{∣e(c)−e(c+r)∣∣c∈Q×Z,e∈End(Q.Γ)}∈rN>0. From Lemma 7 it follows that Q.Γ does not have a finite-range endomorphism and hence by Lemma 12 there is some n∈rN such that ∣e(c)−e(c+n)∣>m for all e∈End(Q.Γ) and c∈Q×Z. Taking n∈rN minimal with this property yields ∣e(c)−e(c+n)∣≥n>m for all e∈End(Q.Γ) and c∈Q×Z. Now, suppose for contradiction that there are e∈End(Q.Γ) and c,d∈Q×Z with c−d∈rZ such that e(c)−e(c+n)≥n≤e(d+n)−e(d). We assume w.l.o.g. that ∣c−d∣=r. Then
Summing over these inequalities yields 0≥2n−2m contradicting n>m. Hence, for all ℓ∈Z, e∈End(Q.Γ) and c∈Q×Z we have ∣e(c)−e(c+ℓn)∣≥∣ℓn∣. Choosing ℓ:=b−a, by Lemma 10 Q.Γ pp-defines Q:=(a,a+n(b−a))End(Q.Γ). By Lemma 10 Q.Γ also pp-defines R:=(a,b)End(Q.Γ). It is now easy to see that ∃z(Rxy∧Rn−1yz∧Qxz) pp-defines diffb−a or distb−a.
x≤∣a−b∣≥n∣a−b∣y≤(n−1)∣a−b∣≥Rk−1∃z
Lemma 17. Let Γ be a first-order reduct of (Z,<) without a finite-range endomorphism. Then ≈Γ is an equivalence relation.
Proof. It is clear that ≈Γ is reflexive and symmetric. Moreover, if a≈Γb≈Γc with a≤b≤c then also a≈Γc. It remains to show that a≈Γb≈Γc with a<c<b implies a≈Γc. Since ≈Γ is preserved by Aut(Q.Γ), for d:=a−(b−c) we have d≈Γa and d≈Γc.
Hence, b≈Γd and by Lemma 16 we get ∣e(b)−e(d)∣=∣b−d∣ for all e∈End(Q.Γ). It follows that ∣e(a)−e(c)∣=∣a−c∣ for all e∈End(Q.Γ) and thus a≈Γc.
Fact 18. The structures (Z,<) and (Z, (x+n<y)n∈Z) are interdefinable and Th(Z,(x+n<y)n∈Z) has quantifier elimination.
Lemma 19 ([see 7, Lemma 5.28]). Let Γ be a first-order reduct of (Z,<) and n∈N>0. Then there exists a first-order reduct Δ of (Z,<) such that Γ∣nZ→Δ, a↦a/n and Q.Γ∣Q×nZ→Q.Δ, (p,a)↦(p,a/n) are isomorphisms.
Proof. By Fact 18, for every R in the signature τ of Γ there exists a quantifier-free formula ϕR(xˉ) in the language σ:={x+m<y∣m∈Z} such that (Z,σ)⊨ϕR(aˉ)⟺aˉ∈RΓ. For each R∈τ let ψR be the formula ϕR with every atomic formula of the form x+m<y replaced by x+⌊m/n⌋<y. We pick Δ to be the first-order reduct of (Z,<) with signature τ and aˉ∈RΔ⟺(Z,σ)⊨ψR(aˉ) for all R∈τ. Then for all a,b∈Z we get na+m<nb⟺a+⌊m/n⌋<b and thus
Theorem 20. Let Γ be a first-order reduct of (Z,<). Then Q.Γ is homomorphically equivalent to one of the following:
a finite structure;
a first-order reduct of (Q,<);
a first-order reduct of (Q×Z,<) that pp-defines succ;
a first-order reduct of (Q×Z,<) that pp-defines distn for every n∈N.
Proof. If Γ has an endomorphism e with finite range, then it has the same CSP as the finite structure Γ∣e(Z) and we are in Case 1 by Lemma 4. Suppose from now on that Γ does not have a finite-range endomorphism and note that by Lemma 7 neither does Q.Γ have a finite-range endomorphism. Then by Lemma 17, ≈Γ is an equivalence relation. Since ≈Γ⊆∼Γ, by Lemma 10 for all a∼Γb there exists e∈End(Q.Γ), maximizing ∣e(a)−e(b)∣, with e(a)≈Γe(b). Now, by Proposition 11 there exists e∈End(Q.Γ) such that for all a,b∈Q×Z either e(a)≈Γe(b) or ∣e(a)−e(b)∣=∞. By Lemma 13 there exists n∈N such that a≈Γb⟺a−b∈nZ. Composing e with an appropriate automorphism of (Q×Z,<) we get an endomorphism of Q.Γ whose image is contained in Q×nZ. Let us assume that already e(Q×Z)⊆Q×nZ. Then Q.Γ is homomorphically equivalent to Q.Γ∣Q×nZ. If n=0, it is easy to see that Q.Γ∣Q×nZ is isomorphic to a first-order reduct of (Q,<) and we are in Case 2. Suppose that n>0. Then by Lemma 19 there exists a first-order reduct Δ of (Z,<) such that ι:Q.Γ∣Q×nZ→Q.Δ, (p,a)↦(p,a/n) is an isomorphism.
We claim that a≈Δb⟺∣a−b∣<∞. Suppose for contradiction that there are a,b∈Q×Z with ∣a−b∣<∞ and a≈Δb. Then there exists f∈End(Q.Δ) with ∣f(a)−f(b)∣>∣a−b∣.
Q.ΓeidQ.Γ∣Q×nZιι−1Q.Δ⋂f
Hence, writing na:=ι−1(a) and nb:=ι−1(b), the function g:=ι−1∘f∘ι is an endomorphism of Q.Γ∣Q×nZ with ∣g(na)−g(nb)∣>∣na−nb∣. Let c,d∈Q×Z with c−d=na−nb∈nZ and thus c≈Γd. Then by Lemma 16, diffc−d or distc−d is pp-definable in Q.Γ, which means that ∣e(c)−e(d)∣=∣c−d∣. Let h∈Aut(Q×Z,<) with h({e(c),e(d)})={na,nb}. Then ∣(g∘h∘e)(c)−(g∘h∘e)(d)∣=∣g(na)−g(nb)∣>∣na−nb∣=∣c−d∣, which contradicts c≈Γd.
By Lemma 16 for each n∈N the structure Q.Δ pp-defines diffn or distn. If it pp-defines diff1 we are in Case 3. Suppose it pp-defines dist1. Then it pp-defines distn for all n∈N and we are in Case 4 or there is some n∈N>0 such that Q.Δ pp-defines diffn and ∃z(dist1(x,y)∧dist1n−1(y,z)∧diffn(x,z)) is a pp-definiton of succ, which again means that we are in Case 3.
xdist1dist1ydist1n−1diffn∃z
Example 21. Let Γ:=(Z,diff{4,10,16}). Then for any injective f:{0,1}×Q→Q the map
e:Q×Z→Q×Z,(p,a)↦(f(amod2,p),a)
is an endomorphism of Q.Γ with ∣e(p,a)−e(p,a+1)∣=∞. Since (a,a+10),(a+6,a+10),(a+2,a+6)∈diff{4,10,16} we get a∼Γa+2 and hence a∼Γb⟺a−b∈2Z. The function
pp-defines diff₄ and ≈ₜ ⊆ ~ₜ it follows that a ≈ₜ b ⇔ a - b ∈ 4Z. We have g(Q × Z) ⊆ Q × 4Z and hence Q.Γ is homomorphically equivalent to Q.Γ|ₚ×4Z. Let Δ := (Z, diff_{{1,4}}). Then Q.Δ is isomorphic to Q.Γ|ₚ×4Z and pp-defines succ via the formula
Proof. The formula ∃z(dist3(x,z)∧dist1(y,z)) pp-defines dist{2,4}. The map
e:Z→Z,a↦{amod6(a−1)mod6ifa∈2Zotherwise
is an endomorphism of (Z,dist{2,4}) with e(Z)={0,2,4}. Hence, CSP({0,2,4},dist{2,4}) reduces in polynomial time to CSP(Z,dist1,dist3). Since ({0,2,4},dist{2,4}) is isomorphic to the complete graph K3 on three elements, its CSP is NP-hard by [14].
5 Tractable cases
Our next goal is to show that the CSP of every finite-signature first-order reduct of (Z,<) that is preserved by a so-called modular min or modular max polymorphism, or whose relations are all definable by certain Horn formulas, is tractable. Rather than reproducing the ad-hoc algorithms of [7], some of which originate in [8], we show that these CSPs are already solved by well-known uniform algorithms. Like the original algorithms, ours rely on sampling: given an instance of the CSP, we can efficiently compute a finite substructure of the reduct, called the sample, such that the instance is a yes-instance of the original CSP if and only if it is a yes-instance of the CSP of the sample. If, in addition, the CSP of the sample can be solved by an algorithm running in time polynomial in the size of the input and in the size of the sample, then combining the two steps yields an efficient algorithm for the original CSP.
A convenient framework for reasoning about sampling is a generalization of CSPs, the promise constraint satisfaction problem. For relational τ-structures M and N with a homomorphism M→N, the problem PCSP(M,N) takes as input a finite structure A of finite signature σ⊆τ, and asks to distinguish the case that A maps homomorphically to M↾σ from the case that A does not map homomorphically to N↾σ. Since PCSP(M,M) coincides with CSP(M), promise constraint satisfaction problems generalize constraint satisfaction problems.
Definition 23. A uniform algorithm is a polynomial time algorithm that accepts a pair of finite structures A and M with finite relational signatures if A maps homomorphically to M. It is allowed to accept even when such a homomorphism does not exist.
Assuming M is finite with signature τ, we say a uniform algorithm solves PCSP(M,N) if, whenever it accepts (A,M↾σ) for a finite σ⊆τ and a finite σ-structure A, then A maps homomorphically to N↾σ.
The following lemma isolates what makes sampling work for first-order reducts of (Z,<).
Lemma 24 ([see 7, Lemma 5.4]). Let Γ be a first-order reduct of (Z,<) with a finite signature τ. Then there exists n∈N such that for every τ-structure M and all functions f,g:M→Q×Z with
f(a)<f(b)⟺g(a)<g(b) and
f(a)−f(b)=m⟺g(a)−g(b)=m for all m∈{−n,…,n}
for all a,b∈M, we have f∈Hom(M,Q.Γ)⟺g∈Hom(M,Q.Γ).
Proof. By Fact 18, for every R∈τ there exists a quantifier-free formula ϕR(xˉ) over the language σ:={x+m<y∣m∈Z} such that (Q×Z,σ)⊨ϕR(aˉ)⟺aˉ∈RQ.Γ. Let n be the maximum among all ∣m∣ such that an atomic formula of the form x+m<y appears in ϕR for some R∈τ.
If a,b∈M with ∣f(a)−f(b)∣≤n then f(a)−f(b)=g(a)−g(b) and thus f(a)+m<f(b)⟺g(a)+m<g(b) for all m∈Z. Suppose that a,b∈M with ∣f(a)−f(b)∣>n. Then ∣g(a)−g(b)∣>n and for all m∈{−n,…,n} we have f(a)+m<f(b)⟺f(a)<f(b)⟺g(a)<g(b)⟺g(a)+m<g(b). Now, for all R∈τ (of arity k) and aˉ∈Mk it follows that f(aˉ)∈RQ.Γ⟺(Q×Z,σ)⊨ϕR(f(aˉ))⟺(Q×Z,σ)⊨ϕR(g(aˉ))⟺g(aˉ)∈RQ.Γ.
Using this, we can now capture the whole sampling argument.
Lemma 25. Let Γ be a finite-signature first-order reduct of (Z,<). If there exists a uniform algorithm that solves PCSP(Γ∣[n],Γ) for every n∈N, then CSP(Γ)∈P.
Proof. By Lemma 24 there exists n∈N such that a finite structure A maps homomorphically to Γ iff it maps homomorphically to Γ∣[m] for m:=(n+1)⋅∣A∣. Using the quantifier-free definitions of the relations of Γ given by Fact 18, we can compute Γ∣[m] in time polynomial in ∣A∣. Invoking the uniform algorithm that solves PCSP(Γ∣[m],Γ) on (A,Γ∣[m]) now computes whether A homomorphically maps to Γ in time polynomial in the size of A.
5.1 Tractability of modular min and max
We now aim to prove Proposition 36: if a finite-signature first-order reduct of (Z,<) admits a modular min or modular max polymorphism, then the uniform algorithm singleton-arc-consistency (SINGLAC) [see 21] solves the CSP of every finite substructure. Combined with the sampling lemma, this yields tractability of CSP(Γ) for every finite-signature first-order reduct Γ of (Z,<) admitting such a polymorphism.
Definition 26. For d∈N>0 let
dmax:Z2→Z,(a,b)↦{max(a,b)aifa≡bmoddotherwise.
The function mind is defined analogously.
Bodirsky, Martin, and Mottet [7] already correctly identify preservation by a modular min or max polymorphism as a source of tractability, but for the proof they refer to [8], asserting that the local-finiteness assumption underlying that paper is not needed in this particular case. This assertion is incorrect: the proof of [8, Lemma 34] does rely on local-finiteness, via the claim that every relation R⊆Zk that is first-order definable in (Z,succ) and preserved by mind or maxd satisfies ai−a1≡bi−b1modd for all aˉ,bˉ∈R and i∈[k]. As the following example shows, this claim fails in general.
Example 27. The structure (Z,{aˉ∈Z4∣a2−a1∈{2,4},a4−a3=1}) is preserved by min2 and max2. However, its relation contains tuples aˉ and bˉ such that a1−a3≡b1−b3mod2.
What the proof in [8] actually needs is a suitable decomposability property for relations, which we establish in Lemma 32. Combined with results from [21], this decomposition already suffices to establish tractability, so we do not need to rely on the techniques of [8] at all.
Towards Lemma 32, we first investigate what it means for a binary relation to be preserved by a modular min or max polymorphism. This requires understanding which binary relations are definable in (Z,<); while we are at it, we also classify which of them are already definable in (Z,succ), for later use.
Fact 28. The structures (Z, succ) and (Z, (diff_n)_n∈Z) are interdefinable and Th(Z, (diff_n)_n∈Z) has quantifier elimination.
Lemma 29. A binary relation R⊆Z2 is first-order definable over (Z,<) if and only if R=diffS for some S⊆Z such that {s∈S∣s+1∈/S} is finite. It is first-order definable over (Z,succ) iff S is finite or cofinite.
Proof. For a set S⊆Z let S′:={s∈S∣s+1∈/S}.
Suppose R is first-order definable over (Z,<). Then by Fact 18 there exists a quantifier-free definition ϕ(x,y) of R in (Z,(x+n<y)n∈Z). Since ¬(x+n<y) is equivalent to y+(−n−1)<x we can even assume that ϕ is positive. We prove the claim by structural induction on ϕ. If ϕ(x,y)=(x+n<y), then R=diffS for S:={n+1,n+2,…} and S′=∅. If ϕ(x,y)=(y+n<x), we have R=diffS for S:={−n−1,−n−2,…} and S′={−n−1}. Suppose ψ(x,y) and χ(x,y) define diffU and diffV respectively with U′ and V′ finite. If ϕ=ψ∧χ or ϕ=ψ∨χ then R=diffS for S:=U∩V or S:=U∪V. In both cases we have S′⊆U′∪V′ and hence S′ is finite.
For the other direction let S⊆Z with S′ finite. If S is finite, diffS is defined by ⋁s∈Ssuccs(x,y). If S is cofinite, ¬diffZ∖S(x,y) defines diffS. Suppose S is neither finite nor cofinite. Since S′ is finite, there exists n∈N such that either −m∈/S and m∈S for all m>n or −m∈S and m∈/S for all m>n. Because both cases are symmetric let us assume that the former holds. Then x+n<y∨diffS∩{−n,…,n}(x,y) defines diffS.
The proof for definability over (Z,succ) is similar using Fact 28.
Lemma 30. Let R⊆Z2 be first-order definable over (Z,<) and preserved by mind or maxd for some d>1. If for some a∈Z there are infinitely many b∈Z with (a,b)∈R then R=Z2.
Proof. Suppose R is preserved by maxd. The proof for mind is analogous. Suppose w.l.o.g. that there are infinitely many b≥a such that (a,b)∈R. Then by Lemma 29 there is some c∈Z such that (a,b)∈R for all b≥c. Assuming that R=Z2 we can pick c minimal with that property. Then (a−d,c−1)∈R and thus (a,c−1)=(maxd(a−d,a),maxd(c−1,c))∈R contradicting the minimality of c.
Given a relation R⊆Zk and d∈N, for i,j∈[k] we write i∼j if ai−aj≡bi−bjmodd for all aˉ,bˉ∈R. Both R and d will always be clear from context.
Lemma 31. Let R⊆Zk be first-order definable over (Z,<) and preserved by mind or maxd. Then for all aˉ∈R and n[1]∼,…,n[k]∼∈Z we have (ai+n[i]∼)i∈[k]∈R.
Proof. If d=1 we are done, so assume d>1. Suppose R is preserved by maxd. The proof for mind is analogous. It suffices to show that for every ∼-equivalence class I⊆[k],aˉ∈R and n∈Z we have aˉ′∈R for
ai′:={ai+naiifi∈Iifi∈/I.
Let aˉ0:=aˉ and aˉ1,…,aˉℓ∈R such that for all i∈I and j∈[k]∖I there is r∈[ℓ] with ai≡ar(i)modd and aj≡ar(j)modd.
Pick m∈dZ such that m≥∣ar(i)−as(j)∣ for all i,j∈[k] and r,s∈{0,…,ℓ}. Extending addition to tuples componentwise, let bˉ0:=aˉ and
and hence, if r<ℓ, we have ∣ar+1(i)−br(i)∣≤∣ar+1(i)−ar(i)∣+∣ar(i)−br−1(i)∣+∣br−1(i)−br(i)∣≤m+mr+2mr=mr+1. Now, let bˉ:=bˉℓ. Then by induction and since ai≡br(i)modd for all i∈[k] and r∈[ℓ], we get
Let N:=∑r∈[ℓ](3r−1) and note that Ni≤N for all i∈[k]. For i∈I we have ai≡ar(i)modd for all r∈[ℓ] and thus Ni=N. Moreover, by our choice of aˉ1,…,aˉℓ we get Nj<N for all j∈[k]∖I. Now, let cˉ:=maxd(aˉ,bˉ−m(N−1))∈R. Then
ci={ai+maiifi∈Iifi∈/I
for all i∈[k]. Hence, cˉ witnesses that the binary relation pp-defined by
contains (m,0). Since we can pick m arbitrarily large, by Lemma 30 the relation is full, which concludes the proof.
Lemma 32. Let R⊆Zk be first-order definable over (Z,<) and preserved by mind or maxd. Then
R=i∈[k]⋂{(a1,…,ak)∈Zk∣(aj)j∼i∈Proj[i]∼(R)}.
Proof. Suppose R is preserved by maxd. The proof for mind is analogous. The inclusion from left to right is trivial. For the other direction we show that for all aˉ,bˉ∈R and i∈[k] the tuple aˉ′ with
aj′:={ajbjifi∼jifi∼j
for all j∈[k] is in R. The claim then follows by induction. Let n[1]∼,…,n[k]∼∈Z such that for all j∈[k] we have both aj≡bj+n[j]∼modd and aj≤bj+n[j]∼ if and only if j∼i. By Lemma 31 (bj+n[j]∼)j∈[k]∈R and thus cˉ with
for all j∈[k] is in R. Applying Lemma 31 again yields aˉ′∈R.
With Lemma 32 in place, we can now use techniques by Zhuk [21] to prove tractability of the CSP for first-order reducts of (Z,<) admitting a modular min or max polymorphism.
Definition 33. Let n,k1,…,kn∈N>0. A tuple (a1,1,…,a1,k1;…;an,1,…,an,kn) is (k1,…,kn)-palette if for all i∈[n] and j∈[ki] there is some ℓ∈[n] such that ai,j=aℓ,1=⋯=aℓ,kℓ. If a tuple is (k1,…,kn)-palette for k1=⋯=kn=:m, we call it (n×m)-palette.
Definition 34. Let n,k1,…,kn∈N>0. A function f:Ak1+⋯+kn→B is (k1,…,kn)-palette totally symmetric if there exists a function g:P(A)n→B such that
for all (k1,…,kn)-palette tuples from Ak1+⋯+kn. If a function is (k1,…,kn)-palette totally symmetric for k1=⋯=kn=:m, we call it (n×m)-palette totally symmetric.
Lemma 35. Let Γ be a first-order reduct of (Z,<) that admits mind or maxd as a polymorphism. Then Γ admits a conservative (k1,…,kn)-palette totally symmetric polymorphism for all n,k1,…,kn∈N>0.
Proof. From any conservative (n×m)-palette totally symmetric polymorphism, by identifying variables, we can construct a conservative (k1,…,kn)-palette totally symmetric polymorphism for arbitrary k1,…,kn∈[m]. Hence, it is enough to show that Γ admits a conservative (n×m)-palette totally symmetric polymorphism for all n,m∈N>0. Suppose maxd is a polymorphism of Γ. The proof for mind is analogous. Let f:Znm→Z such that
where i∈[n] is minimal with ai,1≡⋯≡ai,mmodd if such an i exists and
f(a1,1,⋯,a1,m;⋯;an,1,⋯,an,m)=a1,1
otherwise. Clearly, f is conservative, i.e., f(aˉ)∈aˉ for all aˉ∈Znm.
Let aˉ:=(a1,1,…,a1,m;…;an,1,…,an,m)∈Znm be (n×m)-palette. Then there exists i∈[n] such that ai,1=⋯=ai,m and hence f(aˉ)=max(aj,1,…,aj,m) for some j∈[n]. Thus, f is (n×m)-palette totally symmetric.
Next, we show that f is a polymorphism of Γ. Let R be a relation of Γ and aˉi,j:=(ai,j(1),…,ai,j(k))∈R for all i∈[n] and j∈[m]. By Lemma 32 it suffices to show that f preserves Proj[i]∼(R) for every i∈[k], so assume for simplicity that ∼=[k]2. Suppose there are ℓ∈[n] and i∈[k] such that aℓ,1(i)≡⋯≡aℓ,m(i) mod d and let ℓ be minimal with this property. Since ∼=[k]2, for any j∈[k] we get aℓ,1(j)≡⋯≡aℓ,m(j) mod d. Hence, applying f coordinatewise yields
On the other hand, if there are no ℓ∈[n] and i∈[k] with aℓ,1(i)≡⋯≡aℓ,m(i), we get
f(aˉ1,1,⋯,aˉ1,m;⋯;aˉn,1,⋯,aˉn,m)=aˉ1,1∈R.
Therefore, f preserves R.
By [21, Theorem 3.5] the next proposition follows immediately.
Proposition 36. Let Γ be a finite-signature first-order reduct of (Z,<) that admits mind or maxd as a polymorphism. Then for any finite A⊆Z the problem CSP(Γ∣A) is solved by SINGLAC.
5.2 Horn relations
Another source of tractability for CSP( Γ) arises when Γ is a first-order reduct of (Z,succ) whose relations can be expressed as a collection of implications stating that fixed differences among some pairs of variables force a fixed difference between two others. To make this precise, call a first-order formula Horn if it is quantifier-free, in conjunctive normal form, and each clause contains at most one positive literal. A relation that is first-order definable over (Z,succ) or (Q×Z,succ) is then Horn-definable if it can be defined by a Horn formula over (Z,(diffn)n∈Z) or (Q×Z,(diffn)n∈Z), respectively, and we call a first-order reduct of (Z,succ) or (Q×Z,succ) Horn if all of its relations are Horn-definable. Using techniques by Zhuk [21] once more, we show that the constraint-singleton-arc-consistency algorithm (CSINGLAC) efficiently solves the CSP of every such Horn reduct.
Definition 37. Let A and B be relational structures over the same signature τ. For n,k1,…,kn∈N>0 with m:=k1+⋯+kn, by (k1,…,kn)-Pol(A,B) we denote the set of functions f:Am→B such that for every R∈τ and every (k1,…,kn)-palette tuple (aˉ1,…,aˉm)∈(RA)m we have f(aˉ1,…,aˉm)∈RB.
Lemma 38. Let Γ be a finite-signature first-order Horn reduct of (Z,succ). Then (k1,…,kℓ)−Pol(Γ∣[n],Γ) contains a (k1,…,kℓ)-palette totally symmetric function for all n∈N and ℓ,k1,…,kℓ∈N>0.
Proof. For every relation R of Γ fix a defining Horn formula and let t′∈N such that t′≥∣t∣ for every negative literal ¬difft(xi,xj) appearing in one of these formulas. It is not hard to see that there exists an injective function g:[n]ℓ→Z preserving succ such that ∣g(aˉ)−g(bˉ)∣>t′ whenever there are i,j∈[ℓ] with ai−bi=aj−bj. We claim that for m:=k1+⋯+kℓ
is the desired function. Clearly, f is (k1,…,kℓ)-palette totally symmetric, so we just have to show that it is in (k1,…,kℓ)-Pol(Γ∣[n], Γ). Let R be a relation of Γ, (aˉ1,1,…,aˉ1,k1;…;aˉℓ,1,…,aˉℓ,kℓ)∈(R∣[n])m a (k1,…,kℓ)-palette tuple and bˉ:=f(aˉ1,1,…,aˉ1,k1;…;aˉℓ,1,…,aˉℓ,kℓ). Since Γ is Horn, R is definable by a Horn-formula ϕ(xˉ) in (Z,(diffn)n∈Z). Let ψ be a clause of ϕ. If ψ contains a positive literal difft(xr,xs) which is satisfied by aˉi,j for all i∈[ℓ] and j∈[ki], then minj∈kiai,j(s)−minj∈kiai,j(r)=t for all i∈[ℓ] and since g preserves succ it follows that bˉ satisfies difft(xr,xs) and thus ψ. Otherwise there are i∈[ℓ] and j∈[ki] such that aˉi,j satisfies a negative literal ¬difft(xr,xs) of ψ. By the palette property there exists i′∈[ℓ] such that aˉi,j=aˉi′,1=⋯=aˉi′,ki′. Now, minj∈[ki′]ai′,j(s)−minj∈[ki′]ai′,j(r)=ai,j(s)−ai,j(r)=t. By our choice of g, it follows that bˉ satisfies ¬difft(xr,xs) and hence ψ. Thus, bˉ satisfies every clause of ϕ, which means bˉ∈R.
By [21, Lemma 6.13] we get the following proposition.
Proposition 39. Let Γ be a finite-signature first-order reduct of (Z,succ). If Γ is Horn, then for every n∈N the algorithm CSINGLAC solves PCSP(Γ∣[n],Γ).
6 Hard cases
Having covered all sources of tractability for the CSP of first-order reducts of (Z,<), we now turn to sources of NP-hardness. All of our hardness proofs proceed by reduction from an NP-hard finite-domain CSP, using the following lemma.
Lemma 40. Let Γ be a finite-signature first-order reduct of (Z,<). If Γ pp-defines diff S for some S⊆Z, then CSP(Γ∣S)≤PCSP(Γ).
Proof. Let ϕ be an instance of CSP(Γ∣S) and x a fresh variable which does not occur in ϕ. Let ψ(x) be the formula ϕ with every atomic subformula Rx1…xk replaced by
Rx1…xk∧i∈[k]⋀diffS(x,xi).
Then it is easy to see that Γ∣S⊨ϕ⟺Γ⊨ψ(0)⟺Γ⊨∃xψ. Since ∃xψ can be computed from ϕ in polynomial time we get CSP(Γ∣S)≤PCSP(Γ).
6.1 Hardness from binary relations
We begin by identifying cases where binary relations alone already cause NP-hardness. The main role here is played by relations of the form diffD, where, for some d∈N, D is a convex subset of dZ, possibly shifted by a constant.
Definition 41. A set D⊆Z is a d-progression, for d∈N, if a−b∈dZ for all a,b∈D, and a+d∈D whenever a∈D is not the maximum of D.
Since we always assume succ to be present, shifts by constants will not concern us much, as the following observation shows.
Observation 42. Let S⊆Z and n∈Z. Then in (Z,succ,diffS) the formula ∃z(diffS(x,z)∧succn(y,z)) pp-defines diffS−n.
We give a simpler proof of the next lemma than the original one by Bodirsky et al. [8].
Lemma 43 ([8, Lemma 43]). Let S⊆Z be finite with ∣S∣>1 and d:=gcd{s−t∣s,t∈S}. Then (Z,succ,diffS) pp-defines diffD for every finite d-progression D⊆Z.
Proof. Let S={s1,…,sk}. By Observation 42 we can assume w.l.o.g. that 0∈S. Then d=gcd(S) and by Bézout's identity there are n1,…,nk∈Z such that n1s1+⋯+nksk=d. Hence,
∃x2⋯xki∈[k]⋀diffSni(xi,xi+1)
pp-defines diff_T for some finite T⊆dZ with 0,d∈T. Again by Observation 42 we can pp-define diff_U for U:=T−minT. Now, for i∈N let Ui⊆Z such that diff_U_i = diff_U^i, i.e.,
Ui={{0}Ui−1+Uifi=0ifi>0.
Since 0∈U⊆dN we get 0∈Ui⊆dN for all i∈N. Therefore, maxUi=i⋅maxU and hence
∣Ui∣≤maxUi/d+1=i⋅maxU/d+1(1)
for all i∈N. Now, for all i∈N let Di be the largest d-progression contained in Ui and note that ∣D1∣>1. Since Di+D1⊆Ui+1 is a d-progression we get ∣Di+1∣≥∣Di+D1∣=∣Di∣+∣D1∣−1≥∣Di∣+1 for all i∈N. Thus, there exists some n∈N such that for all i≥n we have maxDi−minDi≥maxU−d, which means that Di+{0,maxU}⊆Ui+1 is a d-progression. Hence,
for all i>n. Let m∈N such that ∣Dm∣>r+1 and define
Vi:={UmVi−1∩(Vi−1+d)ifi=0ifi>0
for all i∈N. Then
Vi={maxE∣E⊆Umisad−progressionwith∣E∣=i+1}
for all i∈N. By our choice of m there are exactly two d-progressions of size ∣Dm∣−1>r in Um, namely Dm∖{minDm} and Dm∖{maxDm}. Thus, V:=V∣Dm∣−2={maxDm−d,maxDm}. Using Observation 42 and the fact that diffVi(x,y)∧diffVi+d(x,y) pp-defines diffVi+1 for all i∈N, we get that diff{0,d} is pp-definable.
Finally, let D⊆Z be an arbitrary non-empty finite d-progression. Then diff{0,d}∣D∣−1=diffD−minD and by Observation 42 we can indeed pp-define diffD.
Bodirsky et al. [8] prove the following lemma using Lemmas 43 and 45. Their proof of Lemma 45, however, is incomplete; we therefore first prove the next lemma, using techniques by Barto, Kozik, and Niven [2], and then use it to give an independent proof of Lemma 45.
Lemma 44 ([8, Lemma 44]). Let S⊆Z be finite and not a d-progression for any d∈N. Then CSP(Z,succ,diffS) is NP-hard.
Proof. Let d:=gcd{s−t∣s,t∈S}. Since S is not a d-progression there exists a∈{minS,minS+d,…,maxS}∖S. Let T:=S−a⊆dZ and note that by Observation 42, diffT is pp-definable using succ and diffS. Since 0∈/T the graph G:=(Z,diffT) has no loops.
First, we claim that G has algebraic length 1, i.e., there are
has a solution in N or equivalently in Z. Clearly, this is equivalent to
z1t1+⋯+zℓtℓ=0z1+⋯+zℓ=1
having a solution in Z. Combining both equations we get
z1t1+⋯+zℓ−1tℓ−1+(1−z1−⋯−zℓ−1)tℓ=0
and equivalently
z1(t1−tℓ)+⋯+zℓ−1(tℓ−1−tℓ)=−tℓ.
Now, this equation has a solution in Z iff gcd(t1−tℓ,…,tℓ−1−tℓ) divides tℓ. But gcd(t1−tℓ,…,tℓ−1−tℓ)=d, which divides tℓ. This proves the claim.
Since T⊆dZ it follows that G∣D has algebraic length 1 for every finite but sufficiently large d-progressions D⊆Z.
Next, we show that for large finite d-progressions D⊆Z the induced subgraph G∣D is smooth, i.e., for all a∈D there are b,c∈D such that (a,b),(c,a)∈diffT. Note, that minT<0<maxT. So if a≥minD−minT or a≤maxD−maxT there exists b∈D with (a,b)∈diffT, namely b:=a+minT or b:=a+maxT respectively. Similarly, if a≥minD+maxT or a≤maxD+minT there exists c∈D with (c,a)∈diffT, namely c:=a−maxT or c:=a−minT respectively. Hence, picking D such that maxD−minD≥maxT−minT is sufficient.
Now, let D⊆Z be a finite d-progression which is large enough such that G∣D is smooth and has algebraic length 1. Then CSP(G∣D) is NP-hard [2]. Since by Lemma 43 the structure (Z,succ,diffS) pp-defines diffD, by Lemma 40 we get CSP(G∣D)≤PCSP(G,diffD)≤PCSP(Z,succ,diffS) and thus CSP(Z,succ,diffS) is NP-hard.
As mentioned before, the proof of the following lemma given in [8] is incomplete: it fails whenever a,b,c∈Z are pairwise distinct and (b−a)/(c−a) or (c−a)/(b−a) is an even integer. We give a complete proof below.
Lemma 45 ([see 8, Lemma 40]). Let a,b,c∈Z be pairwise different with ∣a−b∣=∣a−c∣. Then CSP(Z,succ,diff{a,b},diff{a,c}) is NP-hard.
Proof. We can assume w.l.o.g. that 0=a<b<c. If 2b=c then {a,b,c,b+c} is not a d-progression for any d and since diff {a,b,c,b+c} is pp-definable we get hardness by Lemma 44. Suppose 2b=c. We claim that CSP(Z, succb, diff {a,b}, diff {a,c}) is NP-hard. Because of homomorphic equivalence we can assume that b=1. From Lemmas 43 and 40 it follows that CSP({0,1,2}, succ, diff {0,1}, diff {0,2}) reduces to this problem. We show that this finite structure does not have a cyclic polymorphism of arity greater than 1, which means that it is NP-hard by [1]. Suppose for contradiction that f:{0,1,2}k→{0,1,2} is such a polymorphism. Since it preserves succ it has to be idempotent. Now, for all ℓ<k−1, since f preserves diff {0,1}
Since f is cyclic the right side of both differences are equal and hence it follows that
f(ℓ0,…,0,1,2,…,2)=f(ℓ+10,…,0,1,2,…,2)
for all ℓ<k−1. In particular, f(0,…,0,1)=f(1,2,…,2). Because f is idempotent and preserves diff {0,1} we derive f(0,…,0,1)=f(1,2,…,2)=1. Since f preserves succ we get f(1,…,1,2)=2 and f(0,1,…,1)=0. However, this contradicts f preserving diff {0,1}.
Proposition 46. Let diff_S and diff_T be first-order definable over (Z,<) for some S,T ⊆ Z with |S| > 1. If S is not cofinite and there is no d∈N such that both diff_S and diff_T are d-progressions, then CSP(Z, succ, diff_S, diff_T) is NP-hard.
Proof. First, we show that we can assume S to be finite and T to be finite or cofinite. Suppose that one of them, let us say S, is neither finite nor cofinite. By Lemma 29 there exists n∈N such that either −m∈/S and m∈S for all m≥n or −m∈S and m∈/S for all m≥n. Since both cases are symmetric we suppose that the former applies. Note, that diffS(y,x) pp-defines diff−S and hence diffU for U:=−S+2n+1 is pp-definable by Observation 42. Now, S∩U is finite and contains n and n+1. Since diffS(x,y)∧diffU(x,y) pp-defines diffS∩U it follows by Lemma 43 that diffD is pp-definable for every finite 1-progression D⊆Z. Suppose S is not a d-progression for any d∈N. Then there exists m∈N such that S∩{−m,…,m} is not a d-progression for any d∈N. Since diffS(x,y)∧diff{−m,…,m}(x,y) pp-defines diffS∩{−m,…,m}, NP-hardness of CSP(Z, succ, diffS, diffT) follows by Lemma 44. So suppose S is a d-progression for some d∈N. Since S is infinite, by Lemma 29 it can only be a 1-progression. However, we already showed that we can pp-define diffD for every finite 1-progression D⊆Z so we may as well use {0,1} instead of S.
Since S is finite, if it is not a d-progression for any d∈N we get hardness by Lemma 44, so assume S is a d-progression.
Suppose T is finite. If T is not a d′-progression for any d′∈N, again we get hardness from Lemma 44. On the other hand, if T is a d′-progression, it contains at least two elements because otherwise it is a d-progressions. Hence, by Lemma 43 we can pp-define diff {0,d} and diff {0,d′}, which yields hardness by Lemma 45.
Suppose now that T is cofinite. Let m:=min(Z∖T) and n:=max(Z∖T). Pick k∈N minimal such that m+kd>n and let U:={m−2d,m−d,m,m+d,…,m+kd}. Then m−2d,m−d,m+kd∈T∩U with k>0 and m∈/T∩U, which means that T∩U is not a d-progression. Lemma 43 yields a pp-definition of diffU and therefore diffT∩U(x,y) is pp-defined by diffT(x,y)∧diffU(x,y). Hence, we get hardness by Lemma 44.
6.2 Hardness from higher arity relations
Of course, hardness of a CSP can also originate from relations of arity greater than two. Our next goal is to show that, provided succ and a relation of the form diff_{0,d} are present, the absence of d-modular max and min polymorphisms already yields hardness for CSPs of first-order reducts of (Z, succ).
Bodirsky et al. [8] invest some work into showing that a relation satisfying the assumptions of the next lemma pp-defines an even nicer relation, from which they then derive hardness. We instead give a direct and simple proof of NP-hardness.
Definition 47. A function f:Ak→A with k≥2 is called a weak near-unanimity (WNU) if f(b,a,…,a)=f(a,b,a,…,a)=⋯=f(a,…,a,b) for all a,b∈A.
Lemma 48. Let Γ be a first-order reduct of (Z,<) containing succ, diff {0,1} and a relation R⊆Zk∖{(0,…,0)} with k≥3 such that for all i∈[k] we have
(i−10,…,0,1,0,…,0)∈Ror(i−10,…,0,−1,0,…,0)∈R.
Then Γ admits max or min as a polymorphism or CSP(Γ) is NP-hard.
Proof. If (i−10,…,0,1,0,…,0)∈R for all i∈[k] or (i−10,…,0,−1,0,…,0)∈R for all i∈[k], then min,
max and the ternary majority operation do not preserve R∣{0,1}. Since diff {0,1} restricted to {0,1} is not preserved by the ternary minority operation, it follows that CSP(Γ∣{0,1}) is NP-hard by Schaefer's Theorem [18] and using Lemma 40 we are done. Hence, suppose w.l.o.g. that
(δ,0,…,0),(0,δ,0,…,0),(0,0,−δ,0,…,0)∈R
for some δ∈{−1,1}.
Assuming that CSP(Γ) is not NP-hard, we show that Γ, depending on δ, admits min or max as a polymorphism. Let n∈N>0. Then by Lemmas 40 and 43, the CSP of Γ∣{−2n,…,2n} is not NP-hard. Note, that this structure is a finite core. Hence, by combining [10] and [17] (see also [3, Corollary 42]), it admits an ℓ-ary idempotent WNU polymorphism f.
We assume for the sake of contradiction that f(δ,0,…,0)=0 and prove by induction on i∈[ℓ] that f(iδ,…,δ,0,…,0)=0, which holds for i=0 by idempotency of f. For the induction step we use that
where the first row contains i non-zero entries, implies f(i+10,…,0,−δ,…,−δ)=−δ since (0,…,0)∈/R and f preserves R. By preservation of succ we get f(i+1δ,…,δ,0,…,0)=0. Hence, by induction it follows that f(δ,…,δ)=0, which contradicts f being idempotent. Thus, f(δ,0,…,0)=0 and by idempotency and preservation of diff {0,1} we get f(δ,0,…,0)=δ. With preservation of succ it also follows that f(2δ,δ,…,δ)=2δ and since diff {0,1} is preserved we get f(0,δ,…,δ)=f(δ,…,δ,0)=δ.
We now prove inductively for all a,b∈{−n,…,n} that f(a,b,…,b)=max(a,b) if δ=1 and that f(a,b,…,b)=min(a,b) if δ=−1. Suppose this holds for ∣a−b∣≤t. Then f(δt,0,…,0)=δt=f(0,δt,…,δt) and by preservation of diff {0,1} we have f(δt+δ,0,…,0), f(0,δt+δ,…,δt+δ)∈{δt,δt+δ}. Now,
imply f(δt+δ,0,…,0)=δt+δ=f(0,δt+δ,…,δt+δ). Since f is defined on {−2n,…,2n} and preserves succ, this concludes the proof.
Lemma 49 ([see 7, Proposition 7.11]). Let Γ be a first-order reduct of (Z,<) containing succ and diff {0,1}. If Γ admits neither max nor min as a polymorphism then CSP(Γ) is NP-hard.
Proof. Let R⊆Zk be a relation of minimal arity that is pp-definable in Γ and not preserved by max. By Proposition 46, if Γ pp-defines diff T for some T⊆Z which is not a 1-progression, then CSP(Γ) is NP-hard. Hence, using Lemma 29 we assume that all pp-definable binary relations are of the form diff T for a 1-progression T⊆Z. Since all such relations are preserved by max we get that k>2. Note, that S:={aˉ∈Zk∣(ai)i∈I∈ProjI(R),I⊆[k],∣I∣=k−1} is pp-definable in Γ. Thus, S is preserved by max iff ProjI(R) is preserved by max for all I⊆[k] with ∣I∣=k−1. Because R has minimal arity it follows that R⊊S. Hence, there exists aˉ∈S∖R, which means that there are b1,…,bk∈Z such that (a1,…,ai−1,bi,ai+1,…,ak)∈R for all i∈[k]. Let Q⊆Zk be the relation pp-defined by ∃yˉ(Ryˉ∧⋀i∈[k]succai(xi,yi)). Then (0,…,0)∈/Q but for each i∈[k] we have
(i−10,…,0,bi−ai,0,…,0)∈Q.
We set Q0:=Q and for i∈[k] pp-define Qi⊆Zk inductively by
Note, that diff {−ni,…,ni} is pp-definable from succ and diff {0,1} by Lemma 43. Now, for each i∈[k] we have (0,…,0)∈/Qi and there are c1,…,ci∈{−1,1} such that
(j−10,…,0,cj,0,…,0)∈Qiforallj∈[i].
We get that Qk satisfies the requirements of Lemma 48 and since Γ does not admit min or max as a polymorphism it follows that CSP(Γ) is NP-hard.
Lemma 50 ([see 7, Lemma 7.4]). Let R⊆Zk be first-order definable in (Z,succ). Then R has a positive quantifier-free definition in (Z,(diffn)n∈Z) or the structure (Z,succ,R) pp-defines diff_S for some cofinite S⊊Z.
Proof. By Fact 28 the relation R has a quantifier-free definition in (Z,(diffn)n∈Z). Let m∈N be maximal so that every such definition which is in disjunctive normal form contains a clause with at least m negative literals. Among the quantifier-free definitions of R that are in disjunctive normal form and contain no more than m negative literals in each clause, we choose ϕ(xˉ) to be one that minimizes the number of clauses containing m negated literals. If m=0, then ϕ is a positive quantifier-free definition of R in (Z,(diffn)n∈Z), so suppose that m>0. Let ψ(xˉ) be a clause of ϕ containing m negative literals and let ¬diffℓ(xr,xs) be such a literal. Further, let ϕ′(xˉ) be the formula ϕ without the clause ψ and let ψ′(xˉ) be the clause ψ without the literal ¬diffℓ(xr,xs). If in ψ′ the variables xr and xs are connected by a chain of positive literals, then ψ′ implies diffn(xr,xs) for some n∈Z, which means that ϕ′∨ψ′ already defines R contradicting the minimality assumptions. Hence, there exists I⊆[k] containing r but not s such that for every positive literal diffn(xi,xj) in ψ′ we have i∈I⟺j∈I. Moreover, there is some aˉ∈Zk satisfying ψ′∧diffℓ(xr,xs) but not ϕ′ because otherwise ϕ′∨ψ′ would again define R.
We now claim that existentially quantifying all variables except for xr and xs in
yields a pp-definition of diff_S for some cofinite S⊊Z. By Lemma 29 the relation is of the form diff_S for some finite or cofinite S⊆Z. Since aˉ∈/R we get that as−ar∈/S and hence S⊊Z. To show that S is infinite, fix n∈N with n>max{∣ai−aj∣+∣n′∣∣¬diffn′(xi,xj) appears in ψ} and let
bi:={aiai+nifi∈Iifi∈/I
for all i∈[k]. Since aˉ satisfies ψ′, bˉ satisfies every literal of ψ containing only variables xi and xj with i∈I⟺j∈I. By our choice of I, every other literal of ψ is of the form ¬diffn′(xi,xj). Because we picked n such that ∣n′∣<n−∣ai−aj∣≤∣bi−bj∣∈{∣ai−aj±n∣}, bˉ satisfies all these literals and hence ψ. It follows that bˉ satisfies χ and because we have infinitely many choices for n the set S must be infinite.
Bodirsky, Martin, and Mottet [7, Proposition 7.12] establish hardness of the CSP for positive first-order expansions of (Z, succ) that admit neither mind nor maxd as a polymorphism. Their proof, however, assumes that every binary projection has the form diffS for some finite S⊆Z, which does not hold in general, since a binary projection may also be the full relation Z2. We resolve this issue and thereby close the gap.
Proposition 51. Let Γ be a first-order reduct of (Z,succ) containing succ and diff {0,d} for some d∈N>0. If Γ admits neither maxd nor mind as a polymorphism then CSP(Γ) is NP-hard.
Proof. If d=1 we are done by Lemma 49, so suppose that d>1. We can assume that all relations of Γ have a positive quantifier-free definition in (Z,(diffn)n∈Z) because otherwise by Lemma 50 for some cofinite S⊊Z the relation diffS is pp-definable in Γ, which means that CSP(Γ) is NP-hard by Proposition 46. It can easily be verified that diffS is preserved by maxd and mind for every d-progression S⊆Z and for S=Z. Thus, if Γ pp-defines a binary relation that is not preserved by mind or maxd, then by Lemma 29 this relation is of the form diffS where S⊊Z is not a d-progression and again CSP(Γ) is NP-hard by Proposition 46. Hence, let us assume that all pp-definable binary relations are preserved by mind and maxd.
Let Q⊆Zk be of minimal arity such that it is pp-definable in Γ and not preserved by maxd. We claim that there are aˉ,bˉ∈Q with maxd(aˉ,bˉ)∈/Q such that ai≡bimodd for all i∈[k]. For i,j∈[k] let i∼j if ai−aj≡bi−bjmodd for all aˉ,bˉ∈Q. Suppose ∼=[k]2 and let aˉ,bˉ∈Q with maxd(aˉ,bˉ)∈/Q. Then ai≡bimodd for all i∈[k] because otherwise ai≡bimodd for all i∈[k] and maxd(aˉ,bˉ)=aˉ∈Q. So assume that ∼=[k]2. Since Q is not preserved by maxd, there is some cˉ∈maxd(Q×Q)∖Q. Because Q has minimal arity among the pp-definable relations that are not preserved by maxd, for every ℓ∈[k] the relation Proj[k]∖{ℓ}(Q) is preserved by maxd. With Lemma 31 it follows that for all ℓ∈[k] and n[1]∼,…,n[k]∼∈Z there is some c′∈Z such that
Let ϕ(xˉ) be a positive quantifier-free definition of Q in (Z,(diffn)n∈Z) which is in disjunctive normal form and note that if i∼j then xi and xj are connected by a chain of (positive) literals in every clause of ϕ. It follows that if ℓ∈[k] with [ℓ]∼={ℓ}, then ϕ contains a clause that is equivalent to
for some cℓ′∈Z. We prove the claim separately for the following three cases.
Case 1: There are r,s∈[k] with [r]∼={r}, [s]∼={s} and r∼s.
Take any n[r]∼∈dZ≤0 with n[r]∼≤cr−cr′ and set n[i]∼:=0 for all i∼r. Similarly, let m[s]∼∈dZ≤0 with m[s]∼≤cs−cs′ and m[i]∼:=0 for all i∼s. Then
satisfies ψs, which means that aˉ,bˉ∈Q. Note, that for all i∈/[r]∼∪[s]∼ we have ai=bi=ci. For i∈[r]∼∖{r} we get ai−bi=(ci+n[i]∼)−ci=n[r]∼∈dZ and thus ai≡bimodd. Similarly, ai≡bimodd for all i∈[s]∼∖{s}. Since [r]∼={r} there exists some i∈[r]∼∖{r}. Hence, ar−ai≡br−bimodd and with ai≡bimodd it follows that ar≡brmodd. The same argument shows that as≡bsmodd and therefore ai≡bimodd for all i∈[k]. To prove the claim, it now suffices to verify that max(ai,bi)=ci for all i∈[k]. Trivially, this holds for all i∈/[r]∼∪[s]∼. For i∈[r]∼∖{r} we have max(ai,bi)=max(ci+n[r]∼,ci)=ci because n[r]∼≤0. Similarly, we get max(ai,bi)=ci for all i∈[s]∼∖{s}. Finally, max(ar,br)=max(cr′+n[r]∼,cr)=cr and max(as,bs)=max(cs,cs′+m[s]∼)=cs by our choice of n[r]∼ and m[s]∼.
Case 2: There are r,s∈[k] with [r]∼={r} and [s]∼={s}.
Let cs′∈Z such that aˉ:=(c1,…,cs−1,cs′,cs+1,…,ck)∈Q. Fix n[r]∼∈dZ≤0 with n[r]∼≤cr−cr′ and let n[i]∼:=0 for all i∈/[r]∼∪[s]∼. Then for any n[s]∼∈Z the tuple
satisfies ψr and hence bˉ∈Q. Note, that for all i∈/[r]∼∪[s]∼ we have ai=bi=ci. For all i∈[r]∼∖{r} we get bi−ai=(ci+n[i]∼)−ci=n[r]∼∈dZ and thus ai≡bimodd. Since there exists such an i∈[r]∼∖{r} we have ar−ai≡br−bimodd and it follows that ar≡brmodd. Now, choosing n[s]∼ such that n[s]∼≡cs′−csmodd yields ai≡bimodd for all i∈[k]. If additionally n[s]∼≥cs′−cs then maxd(aˉ,bˉ)=max(aˉ,bˉ)=(c1,…,cs−1,cs+n[s]∼,cs+1,…,ck). Suppose (c1,…,cs−1,cs+n[s]∼,cs+1,…,ck)∈Q for all n[s]∼≥cs′−cs with n[s]∼≡cs′−csmodd. Then, because ϕ is positive, we have (c1,…,cs−1,c′,cs+1,…,ck)∈Q for all c′∈Z, which contradicts cˉ∈/Q. Hence, we can choose n[s]∼ in a way such that ai≡bimodd for all i∈[k] and max(aˉ,bˉ)∈/Q.
Case 3: [r]∼={r} for all r∈[k].
We have Proj[k]∖{r}(Q)=Zk−1. Hence, ϕ contains a clause which has no chain of literals connecting xi and xj for any distinct i,j∈[k]∖{r}. Since Q=Zk, this clause must be equivalent to diffnr(xr,xr′) for some nr∈Z and r′∈[k]∖{r}. We also get such a clause equivalent to diffns(xs,xs′) for s∈[k]∖{r,r′}. If r=s′ we swap r and r′, so that out of r,r′,s,s′ only r′ and s′ can be equal. Let m∈N with m>d such that for every literal diffm′(xi,xj) in ϕ we have ∣m′∣<m. Writing {i1,…,ik−2}:=[k]∖{r,s}, let R⊆Z2 be the relation pp-defined by existentially quantifying all variables but xr and xi1 in Qxˉ∧succkm(xr,xs)∧⋀j∈{1,…,k−3}succm(xij,xij+1).
xrxi1m∃xi2m⋯m∃xik−2∃xs
km
By Lemma 29, R=diffS for some S⊆Z. Since ϕ contains a clause equivalent to diffnr(xr,xr′), there is some t∈S with t<m. On the other hand, because ϕ contains a clause equivalent to diffns(xs,xs′), there exists t∈S with t>km−(k−2)m=2m. Suppose S∩{m,m+1…,2m}=∅. Then Q contains a tuple with ∣ai−aj∣≥m for all distinct i,j∈[k]. By our choice of m, this tuple cannot satisfy a literal in ϕ, which means that Q=Zk, a contradiction. Thus, S∩{m,m+1,…,2m}=∅ and because m>d the set S cannot be a d-progression. It is now easy to verify that diffS is not preserved by maxd contradicting our assumption that all pp-definable binary relations are preserved.
We have now proved the claim that Q contains tuples aˉ and bˉ with maxd(aˉ,bˉ)∈/Q such that ai≡bimodd for all i∈[k]. Let D⊆dZ be a finite d-progression containing bi−ai−b1+a1 for all i∈[k]. Note, that diffD is pp-definable in Γ by Lemma 43 and let R⊆Zk be the relation pp-defined by
Then ci≡cjmodd for all cˉ∈R and i,j∈[k]. Moreover, R∣dZ contains aˉ′:=(0,…,0) and bˉ′:=(bi−ai)i∈[k] but not max(aˉ′,bˉ′). An analogous argument shows that Γ pp-defines a relation T⊆Zℓ with ci≡cjmodd for all cˉ∈T and i,j∈[ℓ] such that T∣dZ is not preserved by min. It is now easy to verify that Δ:=(Z,succd,diff{0,d},R,T) is homomorphically equivalent to Δ∣dZ, which by Lemma 19 is isomorphic to a first-order reduct (Z,succ,diff{0,1},R′,T′) of (Z,<). Hence, CSP(Z,succ,diff{0,1},R′,T′) reduces to CSP(Γ) and is NP-hard by Lemma 49.
6.3 Non-Horn-definable relations
Earlier, we established tractability for CSPs of first-order reducts of (Z,<) that admit a modular max or min polymorphism, or whose relations are Horn-definable in (Z,succ). We now complete the hardness side of the classification for first-order expansions of (Z,succ): using the results established so far in this section, we show that the CSP of any such expansion is NP-hard unless it is tractable for one of these two reasons.
Lemma 52. Let R⊆(Q×Z)k be first-order definable over (Q×Z,succ). Then there exists a finite S⊆Z such that for all aˉ,bˉ∈(Q×Z)k that satisfy
ai−aj=n⟺bi−bj=n
for all n∈S, we have aˉ∈R⟺bˉ∈R.
Proof. By Fact 28 there exists a quantifier-free first-order formula over the language (diffn)n∈Z that defines R. Let S be the set of constants n appearing in this formula. Then the claim follows immediately. □
Lemma 53 ([7, Proposition 6.1]). Let R⊆(Q×Z)k be first-order definable over (Q×Z,succ). Then R is Horn-definable iff it is preserved by any (equivalently all) binary injective polymorphism(s) of (Q×Z,succ).
Proof. Let M:=(Q×Z,(diffn)n∈Z). By Fact 28 the relation R has a quantifier-free first-order definition over M. It is not hard to see that there exists some embedding M2→M. By [4, Proposition 5.9] it follows that R is Horn-definable over M iff it is preserved by any (equivalently all) embedding(s) M2→M. Therefore, it suffices to show that the embeddings M2→M are exactly the binary injective polymorphisms of (Q×Z,succ). Since the other direction is trivial, we prove that every binary injective polymorphism f of (Q×Z,succ) is an embedding M2→M. First, we observe that f is a homomorphism M2→M because for every n∈Z the relation diffn is pp-definable by succn(x,y) over (Q×Z,succ). Now, let (a,b),(c,d)∈(Q×Z)2 and n∈Z such that (a,b),(c,d)∈/diffnM2. Then a+n=c or b+n=d and since f is an injective homomorphism M2→M preserving succ, we get f(a,b)+n=f(a+n,b+n)=f(c,d). Hence, f is an embedding.
Lemma 54. Let R⊆(Q×Z)k be first-order definable over (Q×Z,succ). Then R is not Horn-definable if and only if (Q×Z,succ,R) pp-defines a non-empty relation Q⊆(Q×Z)ℓ with ℓ≤k such that
there exists n∈N so that for all aˉ∈Q there are distinct i,j∈[ℓ] with ∣ai−aj∣≤n, and
for all distinct i,j∈[ℓ] there are aˉ,bˉ∈Q with ai−aj=bi−bj or ∣ai−aj∣=∣bi−bj∣=∞.
Proof. Suppose for contradiction that R is Horn-definable and satisfies Items 1 and 2. Then by Lemma 53 the structure (Q×Z,succ,R) admits a binary injective polymorphism f, which preserves Q. Note, that for all aˉ,bˉ∈(Q×Z)ℓ and i,j∈[ℓ] we have
ai−aj=bi−bj∈Z⟺f(ai,bi)−f(aj,bj)∈Z.
Let aˉ∈Q and I:={(i,j)∈[ℓ]2∣∣ai−aj∣=∞}. Suppose there are distinct i,j∈[ℓ] with (i,j)∈/I. By Item 2 there exists bˉ∈Q such that ai−aj=bi−bj. Now, for cˉ:=f(aˉ,bˉ)∈Q we have ∣ci−cj∣=∞ and ∣ci′−cj′∣=∞ for all (i′,j′)∈I. By induction it follows that there exists dˉ∈Q with ∣di−dj∣=∞ for all distinct i,j∈[ℓ]. However, this contradicts Item 1.
For the other direction, fix a binary injective polymorphism f of (Q×Z,succ) and suppose that R is not Horn-definable. Then f does not preserve R by Lemma 53. Suppose there are aˉ,bˉ∈R and distinct i,j∈[k] such that m:=ai−aj=bi−bj∈Z and cˉ:=f(aˉ,bˉ)∈/R. Since f preserves succ we have ci−cj=m and thus the relation of arity k−1 that is pp-defined by ∃xj(Rxˉ∧succm(xj,xi)) is not preserved by f. By induction we get a pp-definable relation Q of arity ℓ≤k that contains aˉ,bˉ with cˉ:=f(aˉ,bˉ)∈/Q and such that for all distinct i,j∈[ℓ] we have ai−aj=bi−bj or ∣ai−aj∣=∣bi−bj∣=∞. In particular, Q satisfies Item 2. Since ∣ci−cj∣=∞ for all distinct i,j∈[ℓ] and cˉ∈/Q, by Lemma 52 it follows that Q satisfies Item 1 as well.
Bodirsky, Martin, and Mottet [7] give a syntactic proof of the following lemma. We take a different route, using the characterization of non-Horn-definable relations from Lemma 54.
Lemma 55 ([7, Proposition 7.7]). Let R⊆Zk be first-order definable over (Z,succ). If R is not Horn-definable then (Z,succ,R) pp-defines a binary relation that is not Horn-definable.
Proof. Let Q⊆(Q×Z)ℓ be a relation that is pp-definable over Q.(Z,succ,R) and satisfies Items 1 and 2 from Lemma 54. Suppose Q has minimal arity among all such relations. If ℓ=2 we are done so suppose ℓ>2.
Let m∈N with m>n, where n is from Item 1 of Lemma 54, and pick distinct r,s∈[ℓ]. We define Qr,sm⊆(Q×Z)ℓ to be the relation pp-defined by Qxˉ∧succm(xr,xs). Suppose Qr,sm is non-empty and let I⊆[ℓ] be maximal such that ProjI(Qr,sm) satisfies Item 2 from Lemma 54. Clearly,
∅⊊I⊊[ℓ]. Note, that for every i∈[ℓ] there is a unique i′∈I such that for all aˉ,bˉ∈Qr,sm we have ai−ai′=bi−bi′∈Z. We claim that there are aˉ∈Qr,sm and distinct i,j∈[ℓ] with ∣ai−aj∣≤n and i′=j′. Suppose otherwise. Let t:=max{∣ai−ai′∣∣i∈[ℓ],aˉ∈Qr,sm}. Since Q⊇Qr,sm satisfies Item 1 from Lemma 54, for any aˉ∈Qr,sm there are distinct i,j∈[ℓ] with ∣ai−aj∣≤n. Now, ∣ai′−aj′∣≤∣ai′−ai∣+∣ai−aj∣+∣aj−aj′∣≤t+n+t=n+2t and with i′,j′∈I being distinct it follows that ProjI(Qr,sm) also satisfies Item 1 of Lemma 54. This contradicts the minimality assumption on the arity of Q and thus proves the claim. We now have some aˉ∈Qr,sm and distinct i,j∈[ℓ] with ∣ai−aj∣≤n and i′=j′. By the definition of i′ and j′, it follows that ai−aj=ai−ai′+aj′−aj=bi−bi′+bj′−bj=bi−bj for all bˉ∈Qr,sm. Hence, for all m>n and distinct r,s∈[ℓ] there are distinct i,j∈[ℓ] such that
as−ar=m⟹∣ai−aj∣≤n
for all aˉ∈Q.
We claim that for all distinct r,s∈[ℓ] there are distinct i,j∈[ℓ] such that
∣ar−as∣=∞⟹∣ai−aj∣≤n
for all aˉ∈Q. Otherwise, there are distinct r,s∈[ℓ] such that for all distinct i,j∈[ℓ] there exists aˉ∈Q with ∣ar−as∣=∞ and ∣ai−aj∣>n. By Lemma 52 there exists m>n such that for all distinct i,j∈[ℓ] there is some aˉ∈Q with as−ar=m and ∣ai−aj∣>n. However, this contradicts what we showed before and thus the claim holds.
By the minimality assumption on the arity of Q, the relation Proj[ℓ−1](Q) violates Item 1 or 2 from Lemma 54. Since it cannot violate Item 2, for every m∈N there is some aˉ∈Q with ∣ar−as∣>m for all distinct r,s∈[ℓ−1]. By Lemma 52 (or a simple compactness argument) there exists aˉ∈Q such that ∣ar−as∣=∞ for all distinct r,s∈[ℓ−1]. Since Q satisfies Item 1 of Lemma 54, there is some r∈[ℓ−1] with ∣ar−aℓ∣≤n. Let s∈[ℓ−1]∖{r}. Then ∣ai−aj∣=∞>n for all distinct i,j∈[ℓ] with {i,j}={r,ℓ}. Hence, for all bˉ∈Q we have ∣br−bs∣=∞⟹∣br−bℓ∣≤n and ∣bs−bℓ∣=∞⟹∣br−bℓ∣≤n. Now, by the same argument as before there is some bˉ∈Q such that ∣bi−bj∣=∞ for all distinct i,j∈[ℓ]∖{s}. In particular, ∣br−bℓ∣=∞ and thus ∣br−bs∣=∞ or ∣bs−bℓ∣=∞, contradicting at least one of the implications we just proved. Therefore, Q cannot have arity greater than 2, which concludes the proof.
Proposition 56. Let Γ be a first-order reduct of (Z,succ) containing succ. If Γ contains a non-Horn-definable relation and for all d∈N>0 neither admits maxd nor mind as a polymorphism, then CSP(Γ) is NP-hard.
Proof. Since Γ contains a non-Horn-definable relation, by Lemma 55 it pp-defines a binary relation that is not Horn-definable. By Lemma 29 this relation is of the form diffS for some finite or cofinite S⊆Z. Since for cofinite S the relation diffS is defined by the Horn-formula ⋀n∈Z∖S¬diffn(x,y), S must be finite. If S={n} for some n∈Z then the Horn-formula diffn(x,y) defines diffS. Hence, S is finite with ∣S∣>1. Let d:=gcd{s−t∣s,t∈S}. Then by Lemma 43 we can pp-define diff{0,d}. With Proposition 51 it follows that CSP(Γ) is NP-hard.
7 PP-Defining the order
Proposition 56 settles the last remaining case of the complexity classification of the CSPs of first-order reducts of (Z, succ). Of course, not every first-order reduct of (Z,<) is a first-order reduct of (Z, succ). Bodirsky, Martin, and Mottet [7, Lemma 5.37] claim, and give a proof, that every first-order reduct of (Z,<) that pp-defines succ but is not a first-order reduct of (Z, succ) also pp-defines <, and use this to obtain a full classification. As the following example shows, this is false.
Example 57. Let Γ:=(Z,succ,Cycl) where Cycl⊆Z3 is defined by x<y<z∨y<z<x∨z<x<y. It is easy to find an automorphism of (Q×Z,succ) which is not an automorphism of Q. Γ and hence Γ is not a first-order reduct of (Z,succ). However, for any r∈R∖Q and order preserving maps f:(−∞,r)→(r,∞) and g:(r,∞)→(−∞,r) the mapping
is an endomorphism of Q.Γ, which does not preserve <. Therefore, < is not pp-definable in Γ.
To give a correct proof of the full complexity classification, we spend this section investigating the “global” behavior of endomorphisms of first-order reducts of (Q×Z,<), and use a result by Bodirsky and Kára [6] to show that every counterexample to the claim of Bodirsky, Martin, and Mottet [7] has an NP-hard CSP.
Remark 58. Lemma 5.37 in [7] is false, and as a consequence the proof of Theorem 5.1 in that paper is incorrect. Nevertheless, the statement of Theorem 5.1 can still be true: this holds provided that every first-order reduct of (Z,<) that contains succ, but is neither a first-order reduct of (Z,succ) nor pp-defines <, instead pp-defines distn for every n∈N.
Definition 59. Let ⋅^:Q→Q×Z,p↦(p,0). Given a first-order reduct Γ of (Z,<) containing succ, for e∈End(Q.Γ) we define e~:=π1∘e∘⋅^. We write End(Q.Γ):={e~∣e∈End(Q.Γ)}.
Lemma 60. Let Γ be a first-order reduct of (Z,<) containing succ. For all e∈End(Q.Γ) and bˉ∈ZQ the map Q×Z→Q×Z,(p,a)↦(e~(p),a+bp) is an endomorphism of Q.Γ.
Proof. Since e preserves succ, for every p∈Q there is some cp∈Z such that e(p,cp)=(e~(p),bp). Let f∈Aut(Q×Z,<) such that f(p,0)=(p,cp) for all p∈Q. Then g:=e∘f is an endomorphism of Q⋅Γ with g(p,0)=e(p,cp)=(e~(p),bp) for all p∈Q. Since g preserves succ we get g(p,a)=(e~(p),a+bp) as desired.
Fact 61. Let A be a set. Then E⊆AA is a closed submonoid of AA with the topology of pointwise convergence iff there exists a relational structure A with domain A and E=End(A).
Lemma 62. Let Γ be a first-order reduct of (Z,<) containing succ. Then there exists a first-order reduct Γ of (Q,<) such that End(Q.Γ)=End(Γ).
Proof. First, we show that End(Q.Γ) is closed in QQ equipped with the topology of pointwise convergence. Let Σ be a directed set and (eσ)σ∈Σ∈End(Q.Γ)Σ with a limit point f∈QQ. Then for every p∈Q, f(p) is a limit point of (eσ(p))σ∈Σ [see 12, Proposition 2.6.5]. Hence, (f(p),a) is a limit point of ((eσ(p),a))σ∈Σ for every (p,a)∈Q×Z. It follows that for gσ:Q×Z→Q×Z,(p,a)↦(eσ(p),a) the function h:Q×Z→Q×Z,(p,a)↦(f(p),a) is a limit point of (gσ)σ∈Σ in the topology of pointwise convergence on (Q×Z)Q×Z [see 12, Proposition 2.6.5]. By Lemma 60, we have gσ∈End(Q.Γ) for every σ∈Σ. Since End(Q.Γ) is closed (Fact 61) we get that h∈End(Q.Γ) [see 12, Corollary 1.6.4]. Thus, f=h~∈End(Q.Γ) and hence End(Q.Γ) is closed [see 12, Corollary 1.6.4].
By Fact 61, End(Q.Γ) being closed implies that it is the endomorphism monoid of a relational structure Γ with domain Q. It is not hard to see that Aut(Q,<)⊆End(Q.Γ) and thus every relation of Γ is preserved by Aut(Q,<). By [6, Corollary 3] it follows that Γ is a first-order reduct of (Q,<).
Lemma 63. Let Γ be a first-order reduct of (Z,<) containing succ. If End(Q.Γ) contains all permutations of Q, then Γ is a first-order reduct of (Z,succ).
Proof. It is easy to see that if End(Q.Γ) contains all permutations of Q then Aut(Q×Z,succ)⊆Aut(Q.Γ). The result now immediately follows from [7, Theorem 3.4].
Lemma 64. Let Γ be a first-order reduct of (Z,<) containing succ. If End(Q.Γ) contains a constant operation, then Γ is a first-order reduct of (Z,succ).
Proof. Let ≺ be any linear order on Q. We claim that there exists e∈End(Q.Γ) such that e~(p)<e~(q) for all p,q∈Q with p≺q. Suppose otherwise. Then by Proposition 5, setting
there are a finite {p1,…,pk}⊆Q with p1≺⋯≺pk and n∈N such that for all e∈End(Q.Γ) there are distinct i,j∈[k] such that ∣e(p^i)−e(p^j)∣<n or both i<j and e(p^i)≥e(p^j). However, by assumption there exists f∈End(Q.Γ) such that f~(Q)={r} for some r∈Q and with Lemma 60 it follows that there exists e∈End(Q.Γ) with e(p^i)=(r,in) for all i∈[k]. This is a contradiction since e(p^j)−e(p^i)=(j−i)n≥n for all i,j∈[k] with i<j.
By Lemma 62 there is a first-order reduct Γ of (Q,<) with End(Γ)=End(Q.Γ). Noting that the e~ from our claim are injective, it follows from [6, Proposition 19] that End(Γ,=) is the set of all injective unary operations on Q and thus End(Q.Γ) contains all permutations of Q. By Lemma 63 we get that Γ is a first-order reduct of (Z,succ).
Lemma 65. Let Γ be a first-order reduct of (Z,<) containing succ. If End(Q.Γ) contains Q→Q,p↦−p, then Γ is a first-order reduct of (Z,succ).
Proof. If End(Q.Γ) contains a constant operation or all permutations of Q, we are done by Lemmas 63 and 64. Suppose for contradiction that this is not the case. By Lemma 62 there exists a first-order reduct Γ of (Q,<) with End(Q.Γ)=End(Γ) and by [6, Proposition 19] End(Γ) preserves the relation defined by the formula
which we call ϕSep(xˉ). Let p1,…,p4∈Q with p1<⋯<p4. Then by Proposition 5, setting Φ:={ϕSep(xp^1,…,xp^4)}, there are a finite A⊆Q×Z containing p^1,…,p^4 and a finite subset ρ of the signature of Γ such that for all h∈Hom(A,Q.Γ↾ρ) where A:=(Q.Γ∣A)↾ρ, we have (Q×Z,<)⊨ϕSep(h(p^1),…,h(p^4)). Since A is finite, we can choose n∈N sufficiently large such that by Lemma 24
is a homomorphism. Let g∈Aut(Q×Z,<) with g(p^2)=(0,0). By assumption and Lemma 60, e:Q.Γ→Q.Γ, (q,a)↦(−q,a) is an endomorphism and thus h:=e∘g∘f is a homomorphism A→Q.Γ↾ρ.
We now have h(p^3)<h(p^4)<h(p^2)<h(p^1), which contradicts (Q×Z,<)⊨ϕSep(h(p^1),…,h(p^4)). □
Lemma 66. Let Γ be a first-order reduct of (Z,<) containing succ. If End(Q.Γ) preserves <, then Q.Γ pp-defines <.
Proof. Let p1,p2∈Q with p1<p2. By Proposition 5, setting Φ:={xp^1<xp^2}, there are a finite A⊆Q×Z containing p^1,p^2 and a finite subset ρ of the signature of Γ such that for all h∈Hom(A,Q.Γ↾ρ), where A:=(Q.Γ∣A)↾ρ, we have h(p^1)<h(p^2). From Lemma 24 it follows that there exists n∈N such that for all a,b∈Q×Z with b−a≥n there exists a homomorphism h:A→Q.Γ↾ρ with h(p^1)=a and h(p^2)=b. Let ϕ(xp^1,xp^2) be the pp-formula obtained by existentially quantifying all variables but xp^1 and xp^2 in ⋀{Rxa1…xak∣R∈ρ,(a1,…,ak)∈RA}. Observe that Q.Γ⊨ϕ(a,b) iff there exists a homomorphism h:A→Q.Γ↾ρ with h(p^1)=a and h(p^2)=b. Hence, ϕ pp-defines a relation diff_S in Q.Γ where S⊆N>0 with m∈S for all m≥n.
We fix T minimizing n′∈N>0 among all T⊆N>0 such that Q.Γ pp-defines diffT and m∈T for all m≥n′. If n′=1 then diffT=< and we are done, so suppose n′>1. Let U:=(T−1)∩(T−n′+1) and note that by Observation 42 Q.Γ pp-defines diffU.
Now, U⊆T−1⊆N and because n′−1∈/T we have 0∈/T−n′+1⊇U and thus U⊆N>0. Moreover, for every m≥n′−1 we have m∈U, which contradicts our choice of T.
Proposition 67. Let Γ be a first-order reduct of (Z,<) that contains succ. Then one of the following holds:
Γ is a first-order reduct of (Z,succ);
Γ pp-defines <;
CSP( Γ) is NP-hard.
Proof. If End(Q,Γ) contains all permutations of Q, a constant operation or the map Q→Q,p↦−p, then Γ is a first-order reduct of (Z,succ) by Lemmas 63, 64 and 65 respectively. In the case that End(Q,Γ) preserves < we get from Lemma 66 that Γ pp-defines <. Since by Lemma 62 there exists a first-order reduct Γ of (Q,<) with End(Q,Γ)=End(Γ), by [6, Proposition 19] the only remaining case is that Cycl=pˉEnd(Q,Γ) for any pˉ∈Cycl:={(p1,p2,p3)∈Q∣p1<p2<p3 or p2<p3<p1 or p3<p1<p2}. Fix pˉ∈Cycl and let ϕCycl(x1,x2,x3):=x1<x2<x3∨x2<x3<x1∨x3<x1<x2. Then by Proposition 5, setting Φ:={ϕCycl(xp^1,xp^2,xp^3)}, there are a finite A⊆Q×Z containing p^1,p^2,p^3 and a finite subset ρ of the signature of Γ such that for all h∈Hom(A,Q,Γ↾ρ) where A:=(Q,Γ∣A)↾ρ we have (Q×Z,<)⊨ϕCycl(h(p^1),h(p^2),h(p^3)). By Lemma 24 there is some n∈N such that for all aˉ∈(Q×Z)3 with (Q×Z,<)⊨ϕCycl(aˉ) and ∣ai−aj∣≥n for all distinct i,j∈[3] there exists a homomorphism h:A→Q,Γ↾ρ with h(p^i)=ai for all i∈[3]. Let ψ(xp^1,xp^2,xp^3) be the pp-formula obtained by existentially quantifying all variables but xp^1,xp^2,xp^3 in ⋀{Rxa1…xak∣R∈ρ,(a1,…,ak)∈RA}. We now have Q,Γ⊨ψ(aˉ) iff there is a homomorphism h:A→Q,Γ↾ρ with h(p^i)=ai for all i∈[3]. Thus,
It follows that in Γ the pp-formula ∃z(ψ(x,y,z)∧succ2n+3(x,z)) defines diff_S for some finite S⊆Z containing n+1 and n+2. Moreover, ∃y(ψ(x,y,z)∧succn+1(x,y)) pp-defines diff_T for a cofinite T⊆Z with 0∈/T. Now, by Proposition 46, CSP( Z, succ, diff_S, diff_T) and thus also CSP( Γ) are NP-hard.
8 Classification
We now combine the results from Sections 4 to 7 to prove the full complexity classification.
Lemma 68. Let Γ be a finite-signature first-order reduct of (Z,<). Then CSP(Γ)∈NP.
Proof. By Lemma 24 there exists n∈N such that a finite structure A maps homomorphically to Γ iff it maps homomorphically to Γ∣[m] for m:=(n+1)⋅∣A∣. Hence, we can use a homomorphism h:A→Γ∣[m] as a certificate for the existence of a homomorphism A→Γ. Using the quantifier-free definitions of the relations of Γ, which exist by Fact 18, we can efficiently verify that h is a homomorphism A→Γ∣[m]. □
Theorem 69 ([see 7, Theorem 4.2]). Let Γ be a finite-signature first-order reduct of (Z,<). Then there exists Δ with CSP(Γ)=CSP(Δ) such that one of the following holds.
Δ is finite; then CSP(Δ)∈P∪NP−c by [9] and [19, 20].
Δ is a first-order reduct of (Q,<); then CSP(Δ)∈P∪NP−c by [6].
Δ is a first-order reduct of (Z,<) preserved by mind or maxd for some d; then CSP(Δ)∈P.
Δ is a first-order Horn reduct of (Z,succ); then CSP(Δ)∈P.
CSP(Δ)∈NP−c.
Proof. We have CSP(Γ)∈NP by Lemma 68. By Theorem 20, there exists Δ with CSP(Γ)=CSP(Δ), and one of the following four cases applies. If Δ is finite, we are in Case 1. If Δ is a first-order reduct of (Q,<), we are in Case 2. If Δ is a first-order reduct of (Z,<) that pp-defines distn for all n∈N, then by Lemma 22 we are in Case 5. Otherwise, Δ is a first-order reduct of (Z,<) that pp-defines succ, and we assume from now on that Δ contains the relation succ. Now, by Proposition 67 we are in Case 5 or either Δ is a first-order reduct of (Z,succ) or pp-defines <. In any case, if there is d∈N>0 such that Δ admits mind or maxd as a polymorphism, then by Lemma 25 and Proposition 36 we have CSP(Δ)∈P and are in Case 3. So suppose that Δ does not admit mind or maxd for any d∈N>0. If Δ is a first-order reduct of (Z,succ), then either it is Horn and we are in Case 4 by Lemma 25 and Proposition 39, or it is not Horn and we are in Case 5 by Proposition 56. On the other hand, if Δ pp-defines <, then ∃uv(succ(u,x)∧succ2(x,v)∧u<y<v) pp-defines diff {0,1} and hence we are in Case 5 by Lemma 49. □
Corollary 70. Let Γ be a finite-signature first-order reduct of (Z,<). Then CSP(Γ)∈P∪NP−c.
To conclude our study of first-order reducts of (Z,<), we show that a single uniform algorithm suffices to solve all tractable CSPs of first-order reducts of (Z,<) that are not the CSP of a finite structure.
Definition 71. A height 1 identity is an expression of the form f(xi1,…,xim)≈g(xj1,…,xjn), where f and g are function symbols of arity m and n, respectively, i1,…,im,j1,…,jn∈N, and x0,x1,… are variables. An interpretation I, sending each k-ary function symbol to some function in BAk, satisfies such an identity if I(f)(ai1,…,aim)=I(g)(aj1,…,ajn) for all aˉ∈AN. We call a finite set Σ of height 1 identities a height 1 condition. A set of functions F⊆⋃k∈NBAk satisfies Σ if there exists an interpretation I, sending every function symbol occurring in Σ to a function in F of matching arity, such that I satisfies every identity in Σ.
Lemma 72. Let M and N be relational structures with finite signatures and CSP(M)=CSP(N). If a height 1 condition is satisfied by Pol(M∣A,M) for every finite A⊆M, then it is satisfied by Pol(N∣B,N) for every finite B⊆N.
The same holds for (k1,…,kn)-Pol( M∣A,M) and (k1,…,kn)-Pol( N∣B,N).
Proof. Suppose Σ is a height 1 condition satisfied by Pol(M∣A,M) for all finite A⊆M and let B⊆N be finite. Since CSP(M)=CSP(N), there exists a homomorphism h:N∣B→M. Let f1,…,fm∈Pol(M∣h(B),M) of arities ℓ1,…,ℓm∈N satisfy Σ. Because CSP(M)=CSP(N), for A:=⋃i∈[m]fi(h(B)ℓi) there is a homomorphism g:M∣A→N. It is now easy to verify that f1′,…,fm′ with fi′:Bℓi→N, (a1,…,aki)↦(g∘fi)(h(a1),…,h(aki)) for all i∈[m] satisfy Σ in Pol(N∣B,N).
The proof for (k1,…,kn)-Pol(M∣A, M) and (k1,…,kn)-Pol(N∣B, N) is analogous. We only have to check that f1′,…,fm′∈(k1,…,kn)-Pol(N∣B, N). This follows immediately from g and h being homomorphisms and the fact that applying a unary function componentwise preserves the property of being a (k1,…,kn)-palette tuple.
A useful feature of uniform algorithms is that they can be combined: for instance, running two of them independently on the same input and accepting only if both accept yields another uniform algorithm, one that solves every CSP solved by either of the two. The algorithm CSINGLAC ∧ SINGLAIP is exactly this combination of CSINGLAC and SINGLAIP [see 21]. By the next theorem, this also means that a uniform algorithm for finite-domain CSPs, should one be found, would immediately yield a uniform algorithm solving all tractable CSPs of first-order reducts of (Z,<).
Theorem 73. Let Γ be a finite-signature first-order reduct of (Z,<). Then one of the following holds.
CSP(Γ)=CSP(Δ) for a finite structure Δ.
PCSP( Γ∣[n], Γ) is solved by CSINGLAC ∧ SINGLAIP for every n∈N.
CSP( Γ) is NP-complete.
Proof. Suppose CSP( Γ) is neither the CSP of a finite structure nor NP-hard. Then, by Theorem 69, CSP( Γ) = CSP( Δ) for some Δ that is a first-order reduct of ( Q,<), a first-order reduct of ( Z,<) admitting a modular min or max polymorphism, or a first-order Horn reduct of ( Z, succ). By [21], to show that PCSP( Γ∣[n], Γ) is solved by CSINGLAC ∧ SINGLAIP, it suffices to establish one of the following.
Pol(Γ∣[n],Γ) contains a so-called (2k1+1,…,2kℓ+1)-palette alternating function for all ℓ,k1,…,kℓ∈N>0. Equivalently, Pol(Γ∣[n],Γ) satisfies a certain height 1 condition ΣSINGLAIPk1,…,kℓ for all ℓ,k1,…,kℓ∈N>0.
For all ℓ,k1,…,kℓ∈N>0 the set (k1,…,kℓ)-Pol(Γ∣[n], Γ) contains a (k1,…,kℓ)-palette totally symmetric function. Equivalently, (k1,…,kℓ)-Pol(Γ∣[n], Γ) satisfies a certain height 1 condition ΣCSINGLACk1,…,kℓ for all ℓ,k1,…,kℓ∈N>0.
Since every finite substructure of Δ embeds into Δ∣[m] for some m∈N, Lemma 72 lets us establish the above for Δ instead of Γ. For Δ a first-order reduct of (Q,<), this was done by Zhuk [21, Section 6]. For Δ a first-order reduct of (Z,<) admitting a modular min or max polymorphism, the statement follows from Lemma 35. For Δ a first-order Horn reduct of (Z,succ), it follows from Lemma 38.
9 The triangular lattice graph
In this section, we give a first, simple application of the techniques from Section 3 beyond (Z,<): we classify the complexity of the CSP for first-order reducts of the triangular lattice graph, and establish a P versus NP-complete dichotomy for this class of structures. Throughout this section, let G:=(V,E) denote the triangular lattice graph, illustrated in Figure 1.
Figure 1: A finite part of the triangular lattice graph.
Lemma 74. Let Γ be a finite-signature first-order reduct of G. Then CSP(Γ)∈NP.
Proof. The structure G is interpretable in (Z,succ). Indeed, it is not hard to see that (Z2,E) with E⊆(Z2)2 defined by
It follows that CSP(Γ) reduces in polynomial time to CSP(Δ) for a finite-signature first-order reduct Δ of (Z,<). By Lemma 68, CSP(Δ) and hence CSP(Γ) are in NP.
As before, our approach relies on the saturated counterparts of first-order reducts of G. We construct such a counterpart by letting ω.G:=(ω×V,E), where Eω.G:={((n,a),(n,b))∣n∈ω,(a,b)∈EG}, so that ω.G consists of countably many disjoint copies of G, and for a first-order reduct Γ of G, write ω.Γ for the first-order reduct of ω.G over the same signature whose relations are defined by the same formulas. As one would expect from this construction, ω.G is nice, with a≍b if and only if a and b lie in the same copy of G. For simplicity, we write ∼Γ instead of ∼ω.Γ (see Definition 9).
Lemma 75. Let Γ be a first-order reduct of G with no finite-range endomorphism. If ∼Γ is trivial, then ω.Γ is homomorphically equivalent to a first-order reduct of (N,=).
Proof. Since Γ does not have a finite-range endomorphism, by Lemma 7 neither does ω.Γ. Hence, by Proposition 11 there exists e∈End(ω.Γ) such that for all a,b∈ω×V either e(a)∼Γe(b) or e(a)∼e(b). Fix some a∈V. Since ∼Γ is trivial, we can compose e with an appropriate automorphism of ω.G and get an endomorphism of ω.Γ whose image is contained in ω×{a}. Let us assume that already e(ω×V)⊆ω×{a}. Then ω.Γ is homomorphically equivalent to ω.Γ∣ω×{a}. Since every permutation of ω×{a} preserves the relations of ω.Γ∣ω×{a}, this structure is isomorphic to a first-order reduct of (N,=) [see 5].
Proposition 76. Let Γ be a first-order reduct of G with no finite-range endomorphism. If ∼Γ is non-trivial, then CSP(Γ) is NP-hard.
Proof. By Lemmas 7 and 12 there are a,b∈ω×V such that a∼Γb and e(a)=e(b) for all e∈End(ωΓ). It follows from Lemma 10 that R:=(a,b)End(ωΓ) is a finite union of orbitals of Aut(ωG) and pp-definable in ωΓ. For each d∈ω×V, let fd be an automorphism of ωG that rotates the copy of G containing d by 60∘ clockwise about d. Moreover, let c:=fa(b) and note that c=fb5(a).
Then (a,c)=(fa(a),fa(b))∈R and (c,b)=(fb5(a),fb5(b))∈R. Since R is symmetric we get (a,a),(a,b),(a,c)∈R2 and hence A:={d∣(a,d)∈R2} contains a,b and c. Moreover, A is finite because R⊆∼Γ⊆≍ is a finite union of orbitals of Aut(ωG). Thus, (A,R∣A) is a finite, undirected graph without loops that contains the triangle a,b,c and by [14] its CSP is NP-hard. The same argument as in the proof of Lemma 40 shows that CSP(A,R∣A) reduces in polynomial time to CSP(Γ), and hence that CSP(Γ) is NP-hard as well.
Theorem 77. Let Γ be a finite-signature first-order reduct of G. Then one of the following holds.
Γ is homomorphically equivalent to a finite structure and CSP(Γ)∈P∪NP−c.
ω.Γ is homomorphically equivalent to a first-order reduct of (N,=) and CSP(Γ)∈P∪NP−c.
CSP(Γ)∈NP−c.
Proof. If Γ has a finite-range endomorphism, we are in Case 1 by [9] and [19, 20], so suppose otherwise. Then if ∼Γ is trivial, by Lemma 75 and [5] we are in Case 2. On the other hand, if ∼Γ is non-trivial we are in Case 3 by Lemma 74 and Proposition 76.
10 Infinite regular trees
We conclude the paper with a second application of the techniques from Section 3: we classify the complexity of the CSP for first-order reducts of infinite regular trees, and establish a P versus NP-complete dichotomy for this class of structures. While the overall approach mirrors the one for the triangular lattice graph in Section 9, the argument here is marginally more involved. Throughout this section, fix some n∈N>1, and let Tn:=(V,E) denote the infinite n-regular tree, i.e., the (up to isomorphism unique) infinite, undirected, connected, and acyclic graph in which every vertex has degree n.
As in Section 9, the saturated model ω.Tn:=(ω×V,E) consists of countably many disjoint copies of Tn; for a first-order reduct Γ of Tn, we again write ω.Γ for the first-order reduct of ω.Tn over the same signature whose relations are defined by the same formulas. This construction yields a nice model ω.Tn of the theory of Tn.
For vertices u,v∈V, write ∣u−v∣ for their distance in Tn, and extend this to a,b∈ω×V by setting ∣a−b∣:=∞ whenever a and b have different first coordinates. It then holds that a≍b⟺∣a−b∣<∞, and (a,b)Aut(ωTn)={(c,d)∈(ω×V)2∣∣a−b∣=∣c−d∣} for all a,b∈ω×V. Finally, given S⊆N, let distS:={(u,v)∈V2∣∣u−v∣∈S}, using the same notation for the corresponding relation on ωTn. For m∈N, we write distm:=dist{m}.
Lemma 78. The structures Tn and (V,(distm)m∈N) are interdefinable and Th(V,(distm)m∈N) has quantifier elimination.
Proof. We have E=dist1 and distm is defined in Tn by Emxy∧⋀ℓ∈{0,…,m−1}¬Eℓxy. For the quantifier elimination see [13].
Lemma 79. Let Γ be a finite-signature first-order reduct of Tn. Then CSP(Γ)∈NP.
Proof. By Lemma 78, every relation R of Γ is definable in (V,(distm)m∈N) by a quantifier-free formula. Let m∈N be maximal such that distm appears in one of those formulas. It is now easy to see that a finite structure A maps homomorphically to Γ if and only if there exists a subtree (V′,E′) of Tn of size (m+1)⋅∣A∣ such that A maps homomorphically to Γ∣V′. Hence, we can use (V′,E′) together with a homomorphism h:A→Γ∣V′ as a certificate for a homomorphism A→Γ. Clearly, its size is polynomial in ∣A∣. Moreover, we can efficiently verify that (V′,E′) is a subtree of Tn, use the quantifier-free definitions of the relations of Γ to compute Γ∣V′ from (V′,E′) and verify that h is a homomorphism.
As before, we write ∼Γ instead of ∼ω.Γ for simplicity.
Lemma 80. Let Γ be a first-order reduct of Tn. Then there exists r∈N such that a∼Γb⟺∣a−b∣∈rN for all a,b∈ω×V. If n>2, we have r∈{0,1,2}.
Proof. The same idea as in the proof of Lemma 13 shows that there exists r∈N with a∼Γb⟺∣a−b∣∈rN for all a,b∈ω×V. Suppose n>2 and r=0. Then there are distinct a,b∈ω×V with a∼Γb. Since n>2 there exists c∈ω×V such that ∣a−b∣=∣a−c∣ and ∣b−c∣=2.
Hence, there exists f∈Aut(ω×V,E) with f(a)=a and f(b)=c. Because ∼Γ is preserved by Aut(ω×V,E) we get a∼Γc and thus b∼Γc. It follows that r divides 2 and hence r∈{1,2}.
Lemma 81. Let Γ be a first-order reduct of Tn with no finite-range endomorphism. If ∼Γ is trivial, then ω.Γ is homomorphically equivalent to a first-order reduct of (N,=).
Proof. The proof is completely analogous to that of Lemma 75; we include it here for the reader's convenience. Since Γ does not have a finite-range endomorphism, by Lemma 7 neither does ω.Γ. Hence, by Proposition 11 there exists e∈End(ω.Γ) such that for all a,b∈ω×V either e(a)∼Γe(b) or ∣e(a)−e(b)∣=∞. Fix some a∈V. Since ∼Γ is trivial, we can compose e with an appropriate automorphism of (ω×V,E) and get an endomorphism of ω.Γ whose image is contained in ω×{a}. Let us assume that already e(ω×V)⊆ω×{a}. Then ω.Γ is homomorphically equivalent to ω.Γ∣ω×{a}. Since every permutation of ω×{a} preserves the relations of ω.Γ∣ω×{a}, this structure is isomorphic to a first-order reduct of (N,=) [see 5].
Proposition 82. Let Γ be a first-order reduct of Tn with no finite-range endomorphism. If ∼Γ is non-trivial, then CSP(Γ) is NP-hard.
Proof. If n=2, then Γ is isomorphic to a first-order reduct of (Z,<). Let us assume Γ itself is a first-order reduct of (Z,<). Since Γ does not have a finite-range endomorphism and ∼Γ is non-trivial, inspection of the proof of Theorem 20 shows that Q.Γ is homomorphically equivalent to a first-order reduct of (Q×Z,<) that pp-defines succ or distm for all m∈N. Because Q.Γ has Q×Z→Q×Z, (p,a)↦(p,−a) as an automorphism, it cannot be homomorphically equivalent to a first-order reduct of (Q×Z,<) that pp-defines succ. It follows by Lemma 22 that CSP(Γ) is NP-hard.
Suppose n>2. By Lemma 7, ω.Γ does not have a finite-range endomorphism. Hence, by Lemmas 12 and 80 there are a,b∈ω×V with ∣a−b∣∈4N>0 and e(a)=e(b) for all e∈End(ω.Γ). Let c∈ω×V with ∣a−c∣=∣b−c∣=∣a−b∣/2=:m. Then by Lemma 80 we have a∼Γb∼Γc. It follows from Lemma 10 that ω.Γ pp-defines (a,b)End(ω.Γ) and (a,c)End(ω.Γ) and that these relations are of the form distS and distT, respectively, for finite S,T⊆N. Note, that 0∈/S, m∈T and 2m∈S. An argument similar to the proof of Lemma 40 shows that CSP(ω.Γ∣A)≤PCSP(Γ) where A:={d∈ω×V∣∣c−d∣∈T}. Observe, that (A,distS∣A) is an undirected graph with no loops. Moreover, since n>2 there exists d∈A with ∣a−d∣=∣b−d∣=2m and thus a,b and d form a triangle in (A,distS∣A) (Figure 2). By [14] it follows that CSP(A,distS∣A) and thus CSP(Γ) are NP-hard.
Figure 2: The dashed triangle causes NP-hardness.
Theorem 83. Let Γ be a finite-signature first-order reduct of Tn. Then one of the following holds.
Γ is homomorphically equivalent to a finite structure and CSP(Γ)∈P∪NP−c.
ω.Γ is homomorphically equivalent to a first-order reduct of (N,=) and CSP(Γ)∈P∪NP−c.
CSP(Γ)∈NP−c.
Proof. If Γ has a finite-range endomorphism, we are in Case 1 by [9] and [19, 20], so suppose otherwise. Then if ∼Γ is trivial, by Lemma 81 and [5] we are in Case 2. On the other hand, if ∼Γ is non-trivial we are in Case 3 by Lemma 79 and Proposition 82.
References
[1] Libor Barto and Marcin Kozik. “Absorbing Subalgebras, Cyclic Terms, and the Constraint Satisfaction Problem”. In: Log. Methods Comput. Sci. 8.1 (2012). DOI: 10.2168/LMCS-8(1:7)2012.
[2] Libor Barto, Marcin Kozik, and Todd Niven. “The CSP Dichotomy Holds for Digraphs with No Sources and No Sinks (A Positive Answer to a Conjecture of Bang-Jensen and Hell)”. In: SIAM J. Comput. 38.5 (2009), pp. 1782–1802. DOI: 10.1137/070708093.
[3] Libor Barto, Andrei A. Krokhin, and Ross Willard. "Polymorphisms, and How to Use Them". In: The Constraint Satisfaction Problem: Complexity and Approximability. Vol. 7. Dagstuhl Follow-Ups. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2017, pp. 1–44. DOI: 10.4230/DFU.VOL7.15301.1.
[4] Manuel Bodirsky, Martin Hils, and Barnaby Martin. “On the Scope of the Universal-Algebraic Approach to Constraint Satisfaction”. In: Log. Methods Comput. Sci. 8.3 (2012). DOI: 10.2168/LMCS-8(3:13)2012.
[5] Manuel Bodirsky and Jan Kára. “The Complexity of Equality Constraint Languages”. In: Theory Comput. Syst. 43.2 (2008), pp. 136–158. DOI: 10.1007/S00224-007-9083-9.
[6] Manuel Bodirsky and Jan Kára. “The complexity of temporal constraint satisfaction problems”. In: J. ACM 57.2 (2010), 9:1–9:41. DOI: 10.1145/1667053.1667058.
[7] Manuel Bodirsky, Barnaby Martin, and Antoine Mottet. “Discrete Temporal Constraint Satisfaction Problems”. In: J. ACM 65.2 (2018), 9:1–9:41. DOI: 10.1145/3154832.
[8] Manuel Bodirsky et al. “Distance constraint satisfaction problems”. In: Inf. Comput. 247 (2016), pp. 87–105. DOI: 10.1016/J.IC.2015.11.010.
[9] Andrei A. Bulatov. “A Dichotomy Theorem for Nonuniform CSPs”. In: 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017. IEEE Computer Society, 2017, pp. 319–330. DOI: 10.1109/FOCS.2017.37.
[10] Andrei A. Bulatov, Peter Jeavons, and Andrei A. Krokhin. “Classifying the Complexity of Constraints Using Finite Algebras”. In: SIAM J. Comput. 34.3 (2005), pp. 720–742. DOI: 10.1137/S0097539700376676.
[11] Konrad K. Dabrowski et al. “Resolving Inconsistencies in Disjunctive Temporal Constraints: a Parameterized Complexity Classification”. In: Proceedings of the 23rd International Conference on Principles of Knowledge Representation and Reasoning, KR 2026, Lisbon, Portugal, July 20-23, 2026. 2026. DOI: 10.24963/KR.2026/24.
[12] Ryszard Engelking. General Topology. Revised and completed edition. Vol. 6. Sigma Series in Pure Mathematics. Heldermann Verlag, Berlin, 1989. ISBN: 3-88538-006-4.
[13] Shawn Hedman and Wai Yan Pong. “Quantifier-eliminable locally finite graphs”. In: Math. Log. Q. 57.2 (2011), pp. 180–185. DOI: 10.1002/MALQ.200910130.
[14] Pavol Hell and Jaroslav Nešetril. “On the complexity of H-coloring”. In: J. Comb. Theory B 48.1 (1990), pp. 92–110. DOI: 10.1016/0095-8956(90)90132-J.
[15] Wilfrid Hodges. Model theory. Vol. 42. Encyclopedia of mathematics and its applications. Cambridge University Press, 1993. ISBN: 978-0-521-30442-9.
[16] David Marker. Model theory: An Introduction. Vol. 217. Graduate Texts in Mathematics. Springer-Verlag, New York, 2002. ISBN: 0-387-98760-6.
[17] Miklós Maróti and Ralph McKenzie. “Existence theorems for weakly symmetric operations”. In: Algebra Univers. 59.3 (2008), pp. 463–489. DOI: 10.1007/s00012-008-2122-9.
[18] Thomas J. Schaefer. “The Complexity of Satisfiability Problems”. In: Proceedings of the 10th Annual ACM Symposium on Theory of Computing, May 1-3, 1978, San Diego, California, USA. ACM, 1978, pp. 216–226. DOI: 10.1145/800133.804350.
[19] Dmitriy Zhuk. “A Proof of CSP Dichotomy Conjecture”. In: 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017. IEEE Computer Society, 2017, pp. 331–342. DOI: 10.1109/FOCS.2017.38.
[20] Dmitriy Zhuk. “A Proof of the CSP Dichotomy Conjecture”. In: J. ACM 67.5 (2020), 30:1–30:78. DOI: 10.1145/3402029.
[21] Dmitriy Zhuk. Singleton algorithms for the Constraint Satisfaction Problem. 2026. arXiv: 2509.18434v3 [cs.L0].