2012 ACM Subject Classification Theory of computation → \to → Constraint and logic programming; Theory of computation → \to → Finite Model Theory
Keywords and phrases Constraint satisfaction, temporal constraints, fixed-point logic, counting, polymorphisms, bounded width, sampling
Funding Both authors have been funded by the European Research Council (Project POCOCOP, ERC Synergy Grant 101071674). Views and opinions expressed are however those of the authors 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.
Acknowledgements The authors would like to thank Antoine Mottet for the discussions on the topic of this paper.
AI Disclosure. OpenAI’s ChatGPT was used for initial algorithm and proof development, as well as drafting an initial LaTeX file. It contributed the ideas of the outer colour-pair testing in the algorithm, and using the syntactical normal forms for algebraic products of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) . Many of the other ideas, e.g., using the combination of sampling and consistency algorithms, determining the colours via cycle-consistency of the induced finite CSP, and using palette polymorphisms came from the authors, and some others emerged during discussions with ChatGPT. The authors reviewed and revised all arguments produced by LLMs; the proofs have been streamlined and rewritten. In particular, the entire text of the paper has been written by the authors. The authors verified the mathematical content, claims and citations and take full responsibility for the paper.
Introduction
A constraint satisfaction problem (CSP) is a computational problem where we are given a finite set of variables and a finite set of constraints, and the question is whether variables can be assigned values in a fixed relational structure so that all the constraints are satisfied. One of the central research topics about CSPs is their descriptive complexity depending on the type of constraints that is allowed in the input (see, e.g., the survey article [16 ] ). A prominent formalism in descriptive complexity is fixed-point logic (FP), a powerful extension of first-order logic [23 ] . Every problem that can be expressed in fixed-point logic is in P, i.e., can be solved in polynomial time. And indeed, many of the important polynomial-time algorithms for CSPs that are based on establishing some form of local consistency can be formulated in fixed-point logic. However, it is known that some CSPs in P cannot be expressed in fixed-point logic: this is for instance the case for the problem of deciding whether a given system of linear equations has a solution over the two-element field [1 ] (which can be solved in polynomial time by Gaussian elimination).
To discuss the current state of the art, it will be convenient to formulate CSPs as homomorphism problems : for a fixed relational structure B \mathcal{B} B , called the template , we view CSP(B \mathcal{B} B ) as the class of all finite structures A \mathcal{A} A that have a homomorphism to B \mathcal{B} B . We may now ask: for which structures B \mathcal{B} B is there a sentence Φ \Phi Φ in FP such that a finite structure A \mathcal{A} A has a homomorphism to B \mathcal{B} B if and only if A \mathcal{A} A satisfies Φ \Phi Φ ? If this is the case, we say that CSP(B \mathcal{B} B ) is in FP (and use analogous conventions for other logics discussed below).
If B \mathcal{B} B is a finite structure, it turns out that CSP(B \mathcal{B} B ) is in FP if and only if it is in Datalog (an extremely restricted fragment of FP) if and only if it is in FPC (an extremely powerful extension of FP by a counting mechanism) [1 , 2 ] . In general, these logics are known to have different expressive power: for instance, Parity , which is the class of all structures whose domain has even cardinality, is expressible in FPC, but not in FP. This stunning gap in the descriptive complexity of finite-domain CSPs coincides with a fundamental border in universal algebra, which can be characterized in numerous different ways. To state one of these characterisations, which will be of fundamental importance for our results, we need the concept of a polymorphism of B \mathcal{B} B ; this is an operation B s → B B^{s} \to B B s → B preserving every relation from the signature of B \mathcal{B} B coordinatewise. Focussing on formulations that will be important later, we mention that the following are equivalent:
CSP(B \mathcal{B} B ) is in FP;
CSP(B \mathcal{B} B ) is in Datalog;
for every prime p p p , the structure B \mathcal{B} B cannot pp-construct ( Z p ; + , 1 ) (\mathbb{Z}_p; +, 1) ( Z p ; + , 1 ) ;
B \mathcal{B} B has polymorphisms g 1 : B 3 → B g_1 : B^3 \to B g 1 : B 3 → B and g 2 : B 4 → B g_2 : B^4 \to B g 2 : B 4 → B that are 3-4 weak near-unanimity operations, i.e., they satisfy, for all x , y ∈ B x, y \in B x , y ∈ B ,
g 1 ( x , x , y ) = g 1 ( x , y , x ) = g 1 ( y , x , x ) = g 2 ( x , x , x , y ) = g 2 ( x , x , y , x ) = g 2 ( x , y , x , x ) = g 2 ( y , x , x , x ) . g_1(x,x,y) = g_1(x,y,x) = g_1(y,x,x)
= g_2(x,x,x,y) = g_2(x,x,y,x) = g_2(x,y,x,x) = g_2(y,x,x,x). g 1 ( x , x , y ) = g 1 ( x , y , x ) = g 1 ( y , x , x ) = g 2 ( x , x , x , y ) = g 2 ( x , x , y , x ) = g 2 ( x , y , x , x ) = g 2 ( y , x , x , x ) .
If B \mathcal{B} B is an arbitrary structure over an infinite domain, all of the mentioned equivalences fail [12 ] . They even fail if we focus on a model-theoretically very tame class of templates, namely on temporal structures , which are structures with domain Q \mathbb{Q} Q whose relations are (parameter-free) first-order definable in ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) . We give two concrete examples of temporal structures, because their CSPs, which are called temporal CSPs , exhibit different descriptive complexities.
Example 1. Let R min : = { ( x , y , z ) ∈ Q 3 ∣ x > y ∨ x > z } R_{\min} := \{(x,y,z) \in\mathbb{Q}^3 \mid x > y \lor x > z\} R m i n := {( x , y , z ) ∈ Q 3 ∣ x > y ∨ x > z } . Then CSP( Q ; R min ) (\mathbb{Q}; R_{\min}) ( Q ; R m i n ) is in FP [12 ] , but not in Datalog [4 ] .
Example 2. Let X = { ( x , y , z ) ∈ Q 3 ∣ ( x = y ∧ y < z ) ∨ ( y = z ∧ z < x ) ∨ ( z = x ∧ x < y ) } X = \{(x,y,z) \in\mathbb{Q}^3 \mid(x = y \land y < z) \lor(y = z \land z < x) \lor(z = x \land x < y)\} X = {( x , y , z ) ∈ Q 3 ∣ ( x = y ∧ y < z ) ∨ ( y = z ∧ z < x ) ∨ ( z = x ∧ x < y )} . Then CSP( Q ; X ) (\mathbb{Q}; X) ( Q ; X ) is in P [8 ] , but not in FPC [12 ] .
Also none of the algebraic characterisations mentioned above capture containment in Datalog, FP, or FPC (and are also inequivalent). Nonetheless, the descriptive complexity of temporal CSPs has been classified. Also for temporal CSPs, there is a gap in the descriptive complexity landscape: they are either in FP, or not even in FPC [12 ] . For arbitrary CSPs, it is an open problem whether containment in FPC implies containment in FP [12 ] .
Finite on Top of Temporal
In this paper, we address a class of CSPs which is of fundamental importance for advancing our understanding of the descriptive complexity of CSPs in general. The class naturally generalises both the class of temporal CSPs and the class of finite-domain CSPs.
Definition 3. Fix k ≥ 1 k \ge1 k ≥ 1 and let B = [ k ] × Q B = [k] \times\mathbb{Q} B = [ k ] × Q , where [ k ] = { 1 , … , k } [k] = \{1,\ldots,k\} [ k ] = { 1 , … , k } . Then C i : = { i } × Q C_i := \{i\} \times\mathbb{Q} C i := { i } × Q carries a strict rational order < i <_{i} < i ; the relation ∼ \sim ∼ says that two elements belong to the same part. Formally,
D k = ( B ; < 1 , … , < k , ∼ ) , ( i , a ) < j ( i ′ , b ) ⟺ i = i ′ = j and a < b \mathcal{D}_k = (B; <_1,\ldots,<_{k},\sim), \qquad
(i,a) <_j (i',b) \Longleftrightarrow i = i' = j \text{ and } a < b D k = ( B ; < 1 , … , < k , ∼ ) , ( i , a ) < j ( i ′ , b ) ⟺ i = i ′ = j and a < b ( i , a ) ∼ ( i ′ , b ) ⟺ i = i ′ . (i,a) \sim(i',b) \Longleftrightarrow i = i'. ( i , a ) ∼ ( i ′ , b ) ⟺ i = i ′ . A structure is called finite-on-top-of-temporal if it is a first-order expansion of D k \mathcal{D}_k D k with a finite relational signature.
In the context of this definition, we call [ k ] [k] [ k ] the colour set, and if ( i , a ) ∈ B (i,a) \in B ( i , a ) ∈ B , then we call i i i the colour of ( i , a ) ∈ C i (i,a) \in C_i ( i , a ) ∈ C i . We may thus view D k \mathcal{D}_k D k as k k k distinguished copies of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) , and additionally an equivalence relation that relates elements that have the same colour.
The class of CSPs for templates that are finite-on-top-of-temporal is contained in a larger class of CSPs from the literature, and in fact is quite prototypical in this class, which will be discussed in the following.
Restricted Orbit Growth
A fruitful way of obtaining classification results in model theory, and consequently of restricting the class of templates for CSPs, is to focus on structures B \mathfrak{B} B such that for every number of variables n n n , there is a restricted number of essentially different solutions . Formally, let f B ( n ) f_{\mathfrak{B}}(n) f B ( n ) be the number of orbits of Aut ( B ) \operatorname{Aut}(\mathfrak{B}) Aut ( B ) in its natural action on the set of n n n -element subsets of B B B .
Example 4. A structure B \mathfrak{B} B is finite if and only if f B ( n ) f_{\mathfrak{B}}(n) f B ( n ) is eventually 0.
Example 5. A famous result of Cameron [17 ] states that for any countably infinite structure B \mathfrak{B} B , we have f B ( n ) = 1 f_{\mathfrak{B}}(n)=1 f B ( n ) = 1 for all n ∈ N n\in\mathbb{N} n ∈ N if and only if B \mathfrak{B} B is isomorphic to a temporal structure.
Example 6. By the theorem of Ryll-Nardzewski, Engeler, and Svenonius (see, e.g., [20 ] ) a countable structure B \mathfrak{B} B is ω \omega ω -categorical1 if and only if f B ( n ) f_{\mathfrak{B}}(n) f B ( n ) is finite for all n ∈ N n\in\mathbb{N} n ∈ N .
It is easy to see that if B \mathfrak{B} B is finite-on-top-of-temporal, then f B ( n ) f_{\mathfrak{B}}(n) f B ( n ) is polynomial: if B \mathfrak{B} B is a first-order expansion of D k \mathcal{D}_k D k for some k ≥ 1 k\geq1 k ≥ 1 , then f B ( n ) = f D k ( n ) = ( n + k − 1 k − 1 ) f_{\mathfrak{B}}(n)=f_{\mathcal{D}_k}(n)=\binom{n+k-1}{k-1} f B ( n ) = f D k ( n ) = ( k − 1 n + k − 1 ) is the number of ways how to write n n n as a sum n 1 + ⋯ + n k n_1+\cdots+n_k n 1 + ⋯ + n k of non-negative integers n 1 , … , n k n_1,\ldots,n_k n 1 , … , n k . Another example of structures B \mathfrak{B} B where f B f_{\mathfrak{B}} f B is polynomial are cellular structures : this is the smallest class C \mathcal{C} C of structures that contains countable disjoint unions of a finite structure and is closed under finite disjoint unions and finite-index first-order reducts [13 ] .
Countable structures where f B ( n ) f_{\mathfrak{B}}(n) f B ( n ) is bounded by a polynomial have been classified by Thiery and Falque [18 ] . It turns out that besides the structures mentioned above these are precisely the structures that have an expansion by finitely many constants which is bidefinable with a disjoint union of a finite-on-top-of-temporal structure and a cellular structure [14 Theorem 1.6] .
This programme sits within a broader hierarchy of orbit growth. For countable homogeneous ω \omega ω -categorical relational structures, growth bounded by 2 O ( n ) 2^{O(n)} 2 O ( n ) is conjectured to be equivalent to monadic NIP , meaning that NIP persists under arbitrary expansions by unary predicates [15 Conjecture 1] . The implication from this growth bound to monadic NIP is already known [15 Theorem 1.2] . Further up the hierarchy, every first-order reduct of a homogeneous structure in a finite relational signature has subset-orbit growth bounded by 2 O ( n r ) 2^{O(n^r)} 2 O ( n r ) : if the maximum relation arity is r ≥ 1 r\geq1 r ≥ 1 , there are at most 2 O ( n r ) 2^{O(n^r)} 2 O ( n r ) labelled induced structures on n n n elements, and homogeneity identifies isomorphism types with subset orbits. The polynomial-growth case is thus a natural starting point for a systematic classification within this much larger class.
The Classification
Let X = ( Q ; X ) \mathfrak{X}=(\mathbb{Q};X) X = ( Q ; X ) , where X ( x , y , z ) ⟺ x = y < z ∨ y = z < x ∨ z = x < y X(x,y,z)\Longleftrightarrow x=y<z\lor y=z<x\lor z=x<y X ( x , y , z ) ⟺ x = y < z ∨ y = z < x ∨ z = x < y . For a nontrivial abelian group M M M , let A M = ( M ; R M , { a } a ∈ M ) \mathfrak{A}_M=(M;R_M,\{a\}_{a\in M}) A M = ( M ; R M , { a } a ∈ M ) , where R M ( x , y , z , t ) R_M(x,y,z,t) R M ( x , y , z , t ) means x + y = z + t x+y=z+t x + y = z + t ; we call these structures affine . To formulate our result, we also need the concept of pp-constructions , defined in § 2 . Such constructions transfer CSP definability in FPC [12 ] .
Theorem 7. Let B \mathfrak{B} B be finite-on-top-of-temporal. Then the following are equivalent.
CSP( B ) (\mathfrak{B}) ( B ) is definable in FPC;
B \mathcal{B} B pp-constructs neither F \mathbb{F} F nor any finite affine structure.
CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is definable in FP ∗ \operatorname{FP}^{*} FP ∗ , i.e., in fixed-point logic with an ordered auxiliary number sort and without counting terms (see, e.g., [19 ] , [25 ] ).
Note that in general, FP ⊊ FP ∗ ⊊ FPC \operatorname{FP} \subsetneq\operatorname{FP}^{*} \subsetneq\operatorname{FPC} FP ⊊ FP ∗ ⊊ FPC . While FP ∗ \operatorname{FP}^{*} FP ∗ can express for example parity of the domain of a structure, it cannot express parity of a unary predicate interpreted in a structure, which FPC \operatorname{FPC} FPC can express.
We also give an algebraic characterization in terms of polymorphisms. Preservation of the relation ∼ \sim ∼ from Definition 3 gives an induced operation f ~ : [ k ] s → [ k ] \tilde{f} : [k]^s \to[k] f ~ : [ k ] s → [ k ] , with
f ~ ( π ( a 1 ) , … , π ( a s ) ) : = π ( f ( a 1 , … , a s ) ) , \tilde{f}(\pi(a_1),\ldots,\pi(a_s)) := \pi(f(a_1,\ldots,a_s)), f ~ ( π ( a 1 ) , … , π ( a s )) := π ( f ( a 1 , … , a s )) ,
where π ( ( i , a ) ) : = i \pi((i,a)) := i π (( i , a )) := i . Since f f f preserves the colours, the operation f ~ \tilde{f} f ~ is idempotent , i.e., satisfies f ~ ( c , … , c ) = c \tilde{f}(c,\ldots,c)=c f ~ ( c , … , c ) = c for all c ∈ [ k ] c \in[k] c ∈ [ k ] . Let T T T consist of the temporal operations min \min min , mi \operatorname{mi} mi , ll \operatorname{ll} ll , and their duals (defined in Section 2).
Theorem 8. Let B \mathcal{B} B be finite-on-top-of-temporal. Then the equivalent items from Theorem 7 are also equivalent to
both of the following conditions hold:
(a) for each i ∈ [ k ] i \in[k] i ∈ [ k ] , some binary f i ∈ Pol ( B ) f_i \in\operatorname{Pol}(\mathcal{B}) f i ∈ Pol ( B ) restricts on C i 2 C_i^2 C i 2 to e i ∘ t i e_i \circ t_i e i ∘ t i , where t i ∈ T t_i \in T t i ∈ T and e i : C i ↪ C i e_i : C_i \hookrightarrow C_i e i : C i ↪ C i is order-preserving;
(b) Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains g 1 , g 2 g_1,g_2 g 1 , g 2 such that g ~ 1 \tilde{g}_1 g ~ 1 and g ~ 2 \tilde{g}_2 g ~ 2 are 3-4 weak near-unanimity operations.
Algorithm and Proof Idea
For an instance A \mathcal{A} A of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) with n n n variables, let S n \mathcal{S}_n S n be the substructure of B \mathcal{B} B with domain [ k ] × [ n ] [k] \times[n] [ k ] × [ n ] . Note that S n \mathcal{S}_n S n has the property that A \mathcal{A} A homomorphically maps to B \mathcal{B} B if and only if it maps to S n \mathcal{S}_n S n . We then use an algorithm which takes both A \mathcal{A} A and S n \mathcal{S}_n S n as input and runs in polynomial time in the size of ( A , S n ) (\mathcal{A},\mathcal{S}_n) ( A , S n ) . Examples of such algorithms are the arc-consistency procedure, the path consistency procedure, AIP, BLP, AIP-BLP and various singleton versions of these algorithms. This technique was introduced under the name sampling by Bodirsky, Macpherson, and Thapper [9 ] and further developed by Bodirsky and Greiner, Mottet, and Zhuk; see Section 1.5.
In our setting, the uniform algorithm is as follows. Add universal constraints on all variables and on every pair of variables. Run constraint-singleton arc-consistency (CSAC), with an additional outer test that fixes each available tuple in an auxiliary pair constraint and reruns CSAC. The algorithm is polynomial; we show that it has a uniform fixed-point implementation in Section 6.
To prove the correctness of our algorithm, we use the sets of relations on S S S computed by the algorithm. These relations need not be closed under the polymorphisms g 1 , g 2 , f 1 , … , f k g_1,g_2,f_1,\ldots,f_k g 1 , g 2 , f 1 , … , f k witnessing the … We present only first-order expansions of D k \mathfrak{D}_k D k . The full version will prove the corresponding classification for arbitrary first-order reducts of this structure.
Related Work
Bodirsky, Macpherson, and Thapper introduced sampling for infinite-domain CSPs and combined samples with arc-consistency [9 ] . Bodirsky and Greiner developed sampling for combinations of theories [6 ] . Mottet [24 ] used sampling to obtain new algorithms for the tractable temporal CSPs described in [8 ] ; Zhuk identified singleton consistency procedures for the min, mi, and ll cases and their duals and introduced criteria for the correctness of these algorithms using palette maps [28 ] .
Preliminaries
Fixed-Point Logic
FP is first-order logic with inflationary fixed points and arbitrary finite nesting. We use least fixed points for monotone operators. FPC additionally has an ordered number sort N n = { 0 , … , n } N_n = \{0, \ldots, n\} N n = { 0 , … , n } and counting terms on inputs of size n n n [19 ] . FP* is its fragment without counting terms, but retaining N n N_n N n and mixed-sort fixed points.
Relational Structures, CSPs and Polymorphisms
A relational signature is a set of relation symbols R R R , each with arity k ∈ N ≥ 1 k \in\mathbb{N}_{\ge1} k ∈ N ≥ 1 . A relational τ \tau τ -structure A \mathcal{A} A consists of a set A A A , called the domain , together with a relation R A ⊆ A k R^\mathcal{A} \subseteq A^k R A ⊆ A k for every symbol R ∈ τ R \in\tau R ∈ τ of arity k k k . A structure is called finite if its domain is finite. A relational τ ′ \tau' τ ′ -structure A ′ \mathcal{A}' A ′ with the same domain as A \mathcal{A} A and τ ⊆ τ ′ \tau\subseteq\tau' τ ⊆ τ ′ is an expansion of A \mathcal{A} A if R A = R A ′ R^\mathcal{A} = R^{\mathcal{A}'} R A = R A ′ for all R ∈ τ R \in\tau R ∈ τ , and A \mathcal{A} A is called a reduct of A ′ \mathcal{A}' A ′ .
An atomic formula of τ \tau τ is a formula which uses only relation symbols from τ \tau τ and equality. A first-order τ \tau τ -formula is built from atomic formulas of τ \tau τ , using Boolean connectives, i.e., negation, conjunction, and disjunction, as well as the quantifiers ∃ x \exists x ∃ x and ∀ x \forall x ∀ x . The quantifiers range over elements of the domain of the structure. If ϕ ( x 1 , … , x n ) \phi(x_1,\ldots,x_n) ϕ ( x 1 , … , x n ) is a τ \tau τ -formula and A \mathcal{A} A is a τ \tau τ -structure, then ϕ A \phi^\mathcal{A} ϕ A denotes the relation { ( a 1 , … , a n ) ∈ A n ∣ A ⊨ ϕ ( a 1 , … , a n ) } \{(a_1,\ldots,a_n) \in A^n \mid\mathcal{A} \models\phi(a_1,\ldots,a_n)\} {( a 1 , … , a n ) ∈ A n ∣ A ⊨ ϕ ( a 1 , … , a n )} , called the *relation defined by ϕ \phi ϕ over A \mathcal{A} A . A formula is called primitive positive if it is built exclusively from atomic formulas, existential quantifiers, and conjunctions. A relation R R R is first-order definable over A \mathcal{A} A if there exists a first-order τ \tau τ -formula ϕ ( x 1 , … , x n ) \phi(x_1,\ldots,x_n) ϕ ( x 1 , … , x n ) such that R R R equals ϕ A \phi^\mathcal{A} ϕ A . If the formula ϕ \phi ϕ can be chosen to be primitive positive, then we say that R R R is pp-definable over A \mathcal{A} A . If every new relation of an expansion A ′ \mathcal{A}' A ′ of A \mathcal{A} A is definable by a first-order formula, then A ′ \mathcal{A}' A ′ is an fo-expansion . A reduct of an fo-expansion is called an fo-reduct . A substructure of a τ \tau τ -structure A \mathcal{A} A is a τ \tau τ -structure A ′ \mathcal{A}' A ′ with domain A ′ ⊆ A A' \subseteq A A ′ ⊆ A and R A ′ = R A ∩ A ′ k R^{\mathcal{A}'} = R^\mathcal{A} \cap A'^k R A ′ = R A ∩ A ′ k for each k k k -ary R ∈ τ R \in\tau R ∈ τ . We also say that A ′ \mathcal{A}' A ′ is induced on A ′ A' A ′ by A \mathcal{A} A , and write A [ A ′ ] \mathcal{A}[A'] A [ A ′ ] for A ′ \mathcal{A}' A ′ . For relational structures A \mathcal{A} A and B \mathcal{B} B of the same signature, a homomorphism from A \mathcal{A} A to B \mathcal{B} B is a function h : A → B h \colon A \to B h : A → B that preserves all relations of A \mathcal{A} A , that is, for every R ∈ τ R \in\tau R ∈ τ , if ( a 1 , … , a k ) ∈ R A (a_1,\ldots,a_k) \in R^\mathcal{A} ( a 1 , … , a k ) ∈ R A , then ( h ( a 1 ) , … , h ( a k ) ) ∈ R B (h(a_1),\ldots,h(a_k)) \in R^\mathcal{B} ( h ( a 1 ) , … , h ( a k )) ∈ R B . If there are homomorphisms from A \mathcal{A} A to B \mathcal{B} B and vice versa then we call A \mathcal{A} A and B \mathcal{B} B homomorphically equivalent . A pp-power of A \mathcal{A} A is a relational structure with domain A d A^d A d , for some d ≥ 1 d \ge1 d ≥ 1 , where r r r -ary relations, viewed as d r dr d r -ary relations on A A A , are pp-definable over A \mathcal{A} A . We say that A \mathcal{A} A pp-constructs B \mathcal{B} B if B \mathcal{B} B is homomorphically equivalent to a pp-power of A \mathcal{A} A . Pp-constructability is transitive [3 ] .
The constraint satisfaction problem (CSP) of B \mathcal{B} B is the computational problem of deciding whether a given finite structure A \mathcal{A} A with the same signature as B \mathcal{B} B and domain A A A , called the instance, maps homomorphically to B \mathbb{B} B , which is called the template . If a homomorphism s : A → B s\colon\mathbb{A} \to\mathbb{B} s : A → B exists, then s s s is called a solution of A \mathbb{A} A for CSP(B \mathbb{B} B ). A constraint of A \mathbb{A} A is an atomic formula ϕ ( a 1 , … , a s ) \phi(a_{1},\ldots,a_{s}) ϕ ( a 1 , … , a s ) whose variables a 1 , … , a s a_{1},\ldots,a_{s} a 1 , … , a s are elements of A \mathbb{A} A such that A ⊨ ϕ ( a 1 , … , a s ) \mathbb{A} \models\phi(a_{1},\ldots,a_{s}) A ⊨ ϕ ( a 1 , … , a s ) . We denote the set of all constraints of A \mathbb{A} A by Φ \Phi Φ . For a constraint ϕ ( x 1 , … , x s ) \phi(x_{1},\ldots,x_{s}) ϕ ( x 1 , … , x s ) of A \mathbb{A} A , we put s ϕ = s s_{\phi}=s s ϕ = s , and V ϕ = { x 1 , … , x s } V_{\phi}=\{x_{1},\ldots,x_{s}\} V ϕ = { x 1 , … , x s } . An n n n -ary polymorphism of a relational structure A \mathbb{A} A is a function f : A n → A f\colon A^{n} \to A f : A n → A such that for every R R R in the signature of A \mathbb{A} A , if a ˉ 1 , … , a ˉ n ∈ R A \bar{a}_{1},\ldots,\bar{a}_{n} \in R^{\mathbb{A}} a ˉ 1 , … , a ˉ n ∈ R A , then f ( a ˉ 1 , … , a ˉ n ) ∈ R A f(\bar{a}_{1},\ldots,\bar{a}_{n}) \in R^{\mathbb{A}} f ( a ˉ 1 , … , a ˉ n ) ∈ R A . We denote by Pol ( A ) \operatorname{Pol}(\mathbb{A}) Pol ( A ) the set of all polymorphisms of A \mathbb{A} A , and conversely, for a set of operations S S S , we write Inv ( S ) \operatorname{Inv}(S) Inv ( S ) for the set of relations which are preserved by all operations in S S S . The set Pol ( A ) \operatorname{Pol}(\mathbb{A}) Pol ( A ) is a clone, that is, a set of operations which is closed under composition and which contains all projections (see [27 ] , [26 ] ). A non-empty relation R R R is pp-definable in a countable ω \omega ω -categorical structure A \mathbb{A} A if and only if it is preserved by all polymorphisms of A \mathbb{A} A ([10 ] ). For a set of operations S S S on A A A , we say that S S S is locally closed if for all n ≥ 1 n \ge1 n ≥ 1 and all n n n -ary operations g g g we have that g ∈ S g \in S g ∈ S whenever for all finite subsets F ⊆ A n F \subseteq A^{n} F ⊆ A n , there is f ∈ S f \in S f ∈ S such that f f f and g g g agree on F F F . A clone is locally closed if and only if it is the polymorphism clone of a relational structure (see, e.g., [27 ] ).
Algebras and Terms
A functional signature is a set of function symbols f f f , each with an arity r ∈ N r \in\mathbb{N} r ∈ N . An algebra A \mathbb{A} A of signature σ \sigma σ consists of a non-empty domain A A A and an operation f A : A r → A f^{\mathbb{A}}\colon A^{r} \to A f A : A r → A for each r r r -ary symbol f ∈ σ f \in\sigma f ∈ σ . A subalgebra of A \mathbb{A} A is an algebra B \mathbb{B} B of the same signature σ \sigma σ whose domain B ⊆ A B \subseteq A B ⊆ A is non-empty and closed under all operations of σ \sigma σ , with f B = f A ∣ B r f^{\mathbb{B}}=f^{\mathbb{A}}|_{B^{r}} f B = f A ∣ B r for every r r r -ary f ∈ σ f \in\sigma f ∈ σ . For a non-empty X ⊆ A X \subseteq A X ⊆ A , the subalgebra generated by X X X , denoted by Sg A ( X ) \operatorname{Sg}^{\mathbb{A}}(X) Sg A ( X ) , is the smallest subalgebra of A \mathbb{A} A whose domain contains X X X .
An r r r -ary operation f f f on A A A is idempotent if f ( x , … , x ) = x f(x,\ldots,x)=x f ( x , … , x ) = x holds for every x ∈ A x \in A x ∈ A . An algebra is idempotent if all operations from its signature are idempotent. The power A I \mathbb{A}^{I} A I of A \mathbb{A} A for a finite non-empty set I I I is an algebra with domain A I A^{I} A I and operations defined coordinatewise as f A I ( a 1 , … , a r ) ( i ) = f A ( a 1 ( i ) , … , a r ( i ) ) f^{\mathbb{A}^{I}}(a_{1},\ldots,a_{r})(i)=f^{\mathbb{A}}(a_{1}(i),\ldots,a_{r}(i)) f A I ( a 1 , … , a r ) ( i ) = f A ( a 1 ( i ) , … , a r ( i )) for all i ∈ I i \in I i ∈ I .
A σ \sigma σ -term is a variable or an expression f ( t 1 , … , t r ) f(t_{1},\ldots,t_{r}) f ( t 1 , … , t r ) , where f ∈ σ f \in\sigma f ∈ σ is r r r -ary and t 1 , … , t r t_{1},\ldots,t_{r} t 1 , … , t r are σ \sigma σ -terms. A term t ( x 1 , … , x n ) t(x_{1},\ldots,x_{n}) t ( x 1 , … , x n ) is interpreted in a σ \sigma σ -structure A \mathbb{A} A by recursively replacing each symbol f f f by f A f^{\mathbb{A}} f A . We denote the resulting operation A n → A A^{n} \to A A n → A by t A t^{\mathbb{A}} t A .
Temporal CSPs
A temporal structure is a first-order reduct of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) . A temporal CSP is a problem CSP(B \mathbb{B} B ) where B \mathbb{B} B is a temporal structure with finite signature. We use the following binary operations on Q \mathbb{Q} Q . The operation min : Q 2 → Q \min\colon\mathbb{Q}^{2} \to\mathbb{Q} min : Q 2 → Q is defined by taking the minimal value of x x x and y y y with regard to < < < . The operation mi : Q 2 → Q \operatorname{mi}\colon\mathbb{Q}^{2} \to\mathbb{Q} mi : Q 2 → Q is defined by
mi ( x , y ) : = { α ( x ) if x = y , β ( y ) if x > y , γ ( x ) if x < y , \operatorname{mi}(x,y) :=
\begin{cases}
\alpha(x) & \text{if } x=y,\\
\beta(y) & \text{if } x>y,\\
\gamma(x) & \text{if } x<y,
\end{cases} mi ( x , y ) := ⎩ ⎨ ⎧ α ( x ) β ( y ) γ ( x ) if x = y , if x > y , if x < y ,
where α , β , γ : Q → Q \alpha,\beta,\gamma\colon\mathbb{Q} \to\mathbb{Q} α , β , γ : Q → Q are increasing embeddings such that α ( x ) < β ( x ) < γ ( x ) < α ( y ) \alpha(x)<\beta(x)<\gamma(x)<\alpha(y) α ( x ) < β ( x ) < γ ( x ) < α ( y ) whenever x < y x<y x < y . An ll \operatorname{ll} ll -operation is an operation ll : Q 2 → Q \operatorname{ll}\colon\mathbb{Q}^{2} \to\mathbb{Q} ll : Q 2 → Q such that, for all x , y , x ′ , y ′ ∈ Q x,y,x',y' \in\mathbb{Q} x , y , x ′ , y ′ ∈ Q , it holds that ll ( x , y ) < ll ( x ′ , y ′ ) \operatorname{ll}(x,y)<\operatorname{ll}(x',y') ll ( x , y ) < ll ( x ′ , y ′ ) whenever
x ≤ 0 x \leq0 x ≤ 0 and x < x ′ x<x' x < x ′ , or
x ≤ 0 x \leq0 x ≤ 0 and x = x ′ x=x' x = x ′ and y < y ′ y<y' y < y ′ , or
x > 0 x>0 x > 0 and x ′ > 0 x'>0 x ′ > 0 and y < y ′ y<y' y < y ′ , or
We define p p pp pp as an arbitrary binary operation on Q \mathbb{Q} Q such that p p ( x , y ) ≤ p p ( x ′ , y ′ ) pp(x,y) \leq pp(x',y') pp ( x , y ) ≤ pp ( x ′ , y ′ ) if and only if either x ≤ 0 x \leq0 x ≤ 0 and x ≤ x ′ x \leq x' x ≤ x ′ , or x > 0 x > 0 x > 0 , x ′ > 0 x' > 0 x ′ > 0 , and y ≤ y ′ y \leq y' y ≤ y ′ . A binary operation f f f on Q \mathbb{Q} Q is called a lex-operation if f ( x , y ) < f ( x ′ , y ′ ) f(x,y) < f(x',y') f ( x , y ) < f ( x ′ , y ′ ) if and only if either x < x ′ x < x' x < x ′ , or x = x ′ x = x' x = x ′ and y < y ′ y < y' y < y ′ . For a k k k -ary operation f f f on Q \mathbb{Q} Q , we call the operation given by − f ( − x 1 , … , − x k ) -f(-x_1,\ldots,-x_k) − f ( − x 1 , … , − x k ) the dual of f f f . To distinguish them from their duals, we call min \min min , mi \operatorname{mi} mi and ll \operatorname{ll} ll primal .
Proposition 9 ([8 Propositions 25, 27], [4, Lemma 12.4.4] ). For a temporal structure B \mathcal{B} B :
If Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains min \min min or mi \operatorname{mi} mi , then Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains p p pp pp .
If Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains ll \operatorname{ll} ll , then Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains a lex-operation.
If Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains both p p pp pp and a lex-operation, then Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains ll \operatorname{ll} ll .
The importance of these operations in our context is that if B \mathcal{B} B is a temporal structure with at least one of the polymorphisms min \min min , mi \operatorname{mi} mi , and ll \operatorname{ll} ll , then CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) can be expressed in FPC [12 ] .
Theorem 10 ([12 Theorem 1.3] ). Let B \mathcal{B} B be a temporal structure with finite relational signature. The following are equivalent:
CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is expressible in FP.
CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is expressible in FPC.
B \mathcal{B} B does not pp-construct { 0 , 1 } ; 1 I N 3 \{0,1\};1\mathrm{IN}3 { 0 , 1 } ; 1 IN 3 and X \mathfrak{X} X .
B \mathcal{B} B is preserved by min \min min , mi \operatorname{mi} mi , ll \operatorname{ll} ll , the dual of one of these operations, or by a constant operation.
Nested Singleton Consistency
Throughout the following, let B \mathcal{B} B be finite-on-top-of-temporal, i.e., a finite-signature first-order expansion of D k \mathcal{D}_k D k , and additionally assume that B \mathcal{B} B satisfies both conditions from item (4) of Theorem 8. Let A \mathcal{A} A be an instance of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) , with variables A A A and constraints Φ \Phi Φ . Our goal is to describe an algorithm that decides whether there exists a homomorphism from A \mathcal{A} A to B \mathcal{B} B ; equivalently, whether Φ \Phi Φ is satisfiable in B \mathcal{B} B .
Tuber Systems
Let A \mathcal{A} A be an instance of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) . A tuber system L = ( L φ ) φ ∈ Φ L = (L_\varphi)_{\varphi\in\Phi} L = ( L φ ) φ ∈ Φ of A \mathcal{A} A is a collection of sets such that L φ ⊆ φ B L_\varphi\subseteq\varphi^{\mathcal{B}} L φ ⊆ φ B for φ ∈ Φ \varphi\in\Phi φ ∈ Φ . Assume that every element x ∈ A x \in A x ∈ A appears in unary constraints of Φ \Phi Φ ; if not, add the (trivial) unary constraint ⊤ A ( x ) \top^{\mathcal{A}}(x) ⊤ A ( x ) . Define, for each x ∈ A x \in A x ∈ A , the set L x : = ⋂ φ ∈ Φ V φ = { x } L φ L_x := \bigcap_{\substack{\varphi\in\Phi\\ V_\varphi= \{x\}}} L_\varphi L x := ⋂ φ ∈ Φ V φ = { x } L φ , the intersection of the L φ L_\varphi L φ for all unary constraints φ \varphi φ on x x x . The tuber system L L L is finite if every set L φ L_\varphi L φ with φ ∈ Φ \varphi\in\Phi φ ∈ Φ is finite, and non-empty if every set is non-empty. For x i ∈ A x_i \in A x i ∈ A and φ ∈ Φ \varphi\in\Phi φ ∈ Φ with A ⊨ φ ( x 1 , … , x i , … , x s ) \mathcal{A} \models\varphi(x_1,\ldots,x_i,\ldots,x_s) A ⊨ φ ( x 1 , … , x i , … , x s ) , we define pr x i ( L φ ) : = { b ∈ B ∣ ∃ u ∈ L φ : u i = b } \operatorname{pr}_{x_i}(L_\varphi) := \{b \in B \mid\exists u \in L_\varphi: u_i = b\} pr x i ( L φ ) := { b ∈ B ∣ ∃ u ∈ L φ : u i = b } . Similarly, for a tuple t t t satisfying a constraint φ ( x 1 , … , x s ) \varphi(x_1,\ldots,x_s) φ ( x 1 , … , x s ) , we denote by pr x i ( t ) \operatorname{pr}_{x_i}(t) pr x i ( t ) the element t i t_i t i . A tuber subsystem K ≤ L K \leq L K ≤ L is a tuber system of A \mathcal{A} A such that for all φ ∈ Φ \varphi\in\Phi φ ∈ Φ , we have K φ ⊆ L φ K_\varphi\subseteq L_\varphi K φ ⊆ L φ .
A tuber system L L L of A \mathcal{A} A is arc-consistent (AC) if pr x i ( L φ ) = L x \operatorname{pr}_{x_i}(L_\varphi) = L_x pr x i ( L φ ) = L x holds for every φ ∈ Φ \varphi\in\Phi φ ∈ Φ and every x ∈ V φ x \in V_\varphi x ∈ V φ , and constraint-singleton arc-consistent (CSAC) if it is AC and if for each φ ∈ Φ \varphi\in\Phi φ ∈ Φ and every u ∈ L φ u \in L_\varphi u ∈ L φ , there is an AC tuber subsystem K φ , u ≤ L K^{\varphi,u} \leq L K φ , u ≤ L with K φ φ , u = { u } K^{\varphi,u}_\varphi= \{u\} K φ φ , u = { u } . The subsystem K φ , u K^{\varphi,u} K φ , u is then called an AC-certificate for ( φ , u ) (\varphi,u) ( φ , u ) . We call L L L singleton arc-consistent if we only require AC-certificates for all values of L x L_x L x for each x ∈ A x \in A x ∈ A . An instance A \mathcal{A} A of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is (constraint-singleton) arc-consistent if it has a non-empty (constraint-singleton) arc-consistent tuber system L L L . Arc-consistency of a tuber system L L L can be obtained by successively deleting tuples u u u from L ϕ L_{\phi} L ϕ if there is x ∈ V ϕ x \in V_{\phi} x ∈ V ϕ such that for some constraint ψ \psi ψ with x ∈ V ψ x \in V_{\psi} x ∈ V ψ , we have pr x ( u ) ∉ pr x ( L ψ ) \operatorname{pr}_{x}(u) \notin\operatorname{pr}_{x}(L_{\psi}) pr x ( u ) ∈ / pr x ( L ψ ) , until AC is reached. CSAC is obtained by repeatedly restricting a constraint ϕ \phi ϕ from Φ \Phi Φ to a tuple u u u from L ϕ L_{\phi} L ϕ , i.e., temporarily replacing L ϕ L_{\phi} L ϕ by { u } \{u\} { u } , and obtaining AC on this instance; removing u u u from L ϕ L_{\phi} L ϕ if obtaining AC yields the empty set. If obtaining (CS)AC yields the empty set, then there is no homomorphism from A \mathcal{A} A to B \mathcal{B} B compatible with the initial tuber system L L L , and the instance is rejected. The algorithm obtaining (CS)AC stops iterating when it reaches a (CS)AC system. The proof for expressibility in FP is given in § 6 .
A constraint walk in A \mathcal{A} A is a sequence of variables from A \mathcal{A} A and constraints from Φ \Phi Φ of the form W = x 0 W ϕ 1 x 1 W … ϕ l x l W W=x^{W}_{0}\phi_{1}x^{W}_{1}\ldots\phi_{l}x^{W}_{l} W = x 0 W ϕ 1 x 1 W … ϕ l x l W , where x j − 1 W , x j W ∈ V ϕ j x^{W}_{j-1},x^{W}_{j}\in V_{\phi_{j}} x j − 1 W , x j W ∈ V ϕ j . Note that distinct variables x j − 1 W , x j W x^{W}_{j-1},x^{W}_{j} x j − 1 W , x j W of the walk might represent the same element x ∈ A x\in\mathcal{A} x ∈ A of the instance. A constraint walk W W W is realised in a tuber system L L L of A \mathcal{A} A if there is a sequence of values ( a 0 , … , a l ) ∈ L x 0 W × ⋯ × L x l W (a_{0},\ldots,a_{l})\in L_{x^{W}_{0}}\times\cdots\times L_{x^{W}_{l}} ( a 0 , … , a l ) ∈ L x 0 W × ⋯ × L x l W such that for all i ∈ [ l ] i\in[l] i ∈ [ l ] , there is a tuple t ∈ L ϕ i t\in L_{\phi_{i}} t ∈ L ϕ i with pr x i − 1 W ( t ) = a i − 1 \operatorname{pr}_{x^{W}_{i-1}}(t)=a_{i-1} pr x i − 1 W ( t ) = a i − 1 and pr x i W ( t ) = a i \operatorname{pr}_{x^{W}_{i}}(t)=a_{i} pr x i W ( t ) = a i . A map r : { 0 , … , l } → B r:\{0,\ldots,l\}\to B r : { 0 , … , l } → B with r ( i ) ∈ L x i W r(i)\in L_{x^{W}_{i}} r ( i ) ∈ L x i W sending each index i i i of the walk to the element a i ∈ L x i W a_{i}\in L_{x^{W}_{i}} a i ∈ L x i W witnessing the above property is called a realisation of W W W in L L L . An arc-consistent tuber system L L L of A \mathcal{A} A is cycle-consistent if for every x ∈ A x\in A x ∈ A and every a ∈ L x a\in L_{x} a ∈ L x , every constraint walk with x 0 W = x l W = x x^{W}_{0}=x^{W}_{l}=x x 0 W = x l W = x has a realisation r r r in L L L with r ( 0 ) = r ( l ) = a r(0)=r(l)=a r ( 0 ) = r ( l ) = a . Note that SAC implies cycle consistency: Since the instance obtained by restricting x x x to a a a has an AC subsystem K a ≤ L K^{a}\leq L K a ≤ L for every a ∈ L x a\in L_{x} a ∈ L x , we can find a realisation by starting with r ( 0 ) = a r(0)=a r ( 0 ) = a and taking r ( i ) r(i) r ( i ) as any value b i ∈ K x i W a b_{i}\in K^{a}_{x^{W}_{i}} b i ∈ K x i W a such that there is t ∈ K ϕ i a t\in K^{a}_{\phi_{i}} t ∈ K ϕ i a with pr x i − 1 W ( t ) = r ( i − 1 ) \operatorname{pr}_{x^{W}_{i-1}}(t)=r(i-1) pr x i − 1 W ( t ) = r ( i − 1 ) and pr x i W ( t ) = b i \operatorname{pr}_{x^{W}_{i}}(t)=b_{i} pr x i W ( t ) = b i , the existence of which is guaranteed by AC. Since we will ultimately reach x l W = x x^{W}_{l}=x x l W = x , the only choice for r ( l ) r(l) r ( l ) is a a a .
Theorem 11 (Finite cycle consistency [21 ] ). Let A \mathcal{A} A be a finite relational structure with 3 3 3 -4 4 4 weak near-unanimity polymorphisms. Then every cycle-consistent instance of CSP(A \mathcal{A} A ) has a solution.
The Algorithm
We may assume that the instance A \mathcal{A} A is not trivial, i.e., that n : = ∣ A ∣ ≥ 1 n:=|\mathcal{A}|\geq1 n := ∣ A ∣ ≥ 1 and that all constraints ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ have arity at least 1. Denote by S S S the finite subset of B \mathcal{B} B containing n n n elements from each C i C_i C i , i.e., S = { ( i , 1 ) , … , ( i , n ) ∣ 1 ≤ i ≤ k } S=\{(i,1),\ldots,(i,n)\mid1\leq i\leq k\} S = {( i , 1 ) , … , ( i , n ) ∣ 1 ≤ i ≤ k } , and let S : = B [ S ] \mathcal{S}:=\mathcal{B}[S] S := B [ S ] be the induced finite substructure of B \mathcal{B} B on S S S . In this context, we also call the sets ( L ϕ ) ϕ ∈ Φ (L_{\phi})_{\phi\in\Phi} ( L ϕ ) ϕ ∈ Φ of a tuber system constraint lists . The initial constraint lists are L ϕ = ϕ B ∩ Sar ( ϕ ) L_{\phi}=\phi^{\mathcal{B}}\cap\operatorname{Sar}(\phi) L ϕ = ϕ B ∩ Sar ( ϕ ) , where ar ( ϕ ) \operatorname{ar}(\phi) ar ( ϕ ) denotes the arity of ϕ \phi ϕ . Additionally, we add for every ordered pair of variables x , y ∈ A x,y\in A x , y ∈ A a constraint ψ x y \psi_{xy} ψ x y , whose constraint list we initialize as the full binary relation S \mathcal{S} S if x ≠ y x\neq y x = y , and as { ( a , a ) ∣ a ∈ S } \{(a,a)\mid a\in S\} {( a , a ) ∣ a ∈ S } if x = y x=y x = y . We denote the set of the added pair constraints by Ψ \Psi Ψ , and define L x : = pr x ( L ψ x x ) L_x:=\operatorname{pr}_x(L_{\psi_{xx}}) L x := pr x ( L ψ xx ) . In the context of this algorithm, a tuber system L L L of A \mathcal{A} A always also contains the sets ( L ψ ) ψ ∈ Ψ (L_{\psi})_{\psi\in\Psi} ( L ψ ) ψ ∈ Ψ .
The algorithm is described in the following.
Obtain CSAC on the current tuber system L L L . Reject if an empty set is derived.
For each ψ ∈ Ψ \psi\in\Psi ψ ∈ Ψ and u ∈ L ψ u\in L_{\psi} u ∈ L ψ , restrict ψ \psi ψ to u u u in a copy of L L L and obtain CSAC on the copy. a. If the empty set is derived, remove the tuple u u u from L ψ L_{\psi} L ψ and restart at step 1. b. If CSAC accepts the modified instance, continue.
If the algorithm terminates without deriving the empty set, accept.
If the algorithm accepts, then the accepted tuber system L ′ L' L ′ is finite and CSAC. Additionally, for every ψ ∈ Ψ \psi\in\Psi ψ ∈ Ψ and every u ∈ L ψ ′ u\in L'_{\psi} u ∈ L ψ ′ , there is a non-empty CSAC subsystem K ψ , u ≤ L ′ K^{\psi,u}\leq L' K ψ , u ≤ L ′ with K ψ ψ , u = { u } K^{\psi,u}_{\psi}=\{u\} K ψ ψ , u = { u } , called the CSAC-certificate for ( ψ , u ) (\psi,u) ( ψ , u ) . The algorithm terminates in polynomial time in the size of the input.
Determining the Colours
Let A \mathcal{A} A , B \mathcal{B} B and Φ \Phi Φ be as in the previous section. Let g 1 , g 2 g_1,g_2 g 1 , g 2 be the polymorphisms witnessing condition (b) of Theorem 8, and let E = ( [ k ] ; g ~ 1 , g ~ 2 ) \mathcal{E}=([k];\widetilde{g}_1,\widetilde{g}_2) E = ([ k ] ; g 1 , g 2 ) be the finite algebra on the colour set [ k ] [k] [ k ] and with the two operations g ~ 1 , g ~ 2 \widetilde{g}_1,\widetilde{g}_2 g 1 , g 2 .
Lemma 12. Let f ∈ Pol ( B ) f\in\operatorname{Pol}(\mathcal{B}) f ∈ Pol ( B ) be s s s -ary, and let L 1 , … , L s L^1,\ldots,L^s L 1 , … , L s be finite CSAC tuber systems of A \mathcal{A} A . Then the tuber system H : = f ( L 1 , … , L s ) H:=f(L^1,\ldots,L^s) H := f ( L 1 , … , L s ) , defined for each constraint ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ as
H ϕ : = f ( L ϕ 1 , … , L ϕ s ) = { f ( a 1 , … , a s ) ∣ a j ∈ L ϕ j , j ∈ [ s ] } , H_\phi:=f(L^1_\phi,\ldots,L^s_\phi)=\left\{f(a^1,\ldots,a^s)\mid a^j\in L^j_\phi,j\in[s]\right\}, H ϕ := f ( L ϕ 1 , … , L ϕ s ) = { f ( a 1 , … , a s ) ∣ a j ∈ L ϕ j , j ∈ [ s ] } , is finite and CSAC.
Proof. Let L 1 , … , L s L^1,\ldots,L^s L 1 , … , L s be finite CSAC tuber systems of A \mathcal{A} A . We define the system P P P by
P ϕ : = { ( ( a i 1 , … , a i s ) ) i ∈ V ϕ ∣ ( a i j ) i ∈ V ϕ ∈ L ϕ j , j ∈ [ s ] } P_\phi:=\left\{\left((a_i^1,\ldots,a_i^s)\right)_{i\in V_\phi}\mid(a_i^j)_{i\in V_\phi}\in L^j_\phi,j\in[s]\right\} P ϕ := { ( ( a i 1 , … , a i s ) ) i ∈ V ϕ ∣ ( a i j ) i ∈ V ϕ ∈ L ϕ j , j ∈ [ s ] }
for every ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ . Applying f f f coordinatewise to every tuple of P ϕ P_\phi P ϕ yields H ϕ H_\phi H ϕ . Since, for arbitrary ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ , each a j ∈ L ϕ j a^j\in L^j_\phi a j ∈ L ϕ j satisfies ϕ \phi ϕ , and f f f is a polymorphism of B \mathcal{B} B by assumption, we get that also each f ( a 1 , … , a s ) f(a^1,\ldots,a^s) f ( a 1 , … , a s ) satisfies ϕ \phi ϕ . By construction, P P P and H H H are finite tuber systems. For every x ∈ V ϕ x\in V_\phi x ∈ V ϕ , we have
pr x ( P ϕ ) = ∏ j = 1 s pr x ( L ϕ j ) = ∏ j = 1 s L x j = P x , \operatorname{pr}_x(P_\phi)=\prod_{j=1}^{s}\operatorname{pr}_x(L^j_\phi)=\prod_{j=1}^{s}L_x^j=P_x, pr x ( P ϕ ) = j = 1 ∏ s pr x ( L ϕ j ) = j = 1 ∏ s L x j = P x ,
where ∏ \prod ∏ denotes the Cartesian product of sets, and the middle equality holds since each L j L^j L j is CSAC and hence AC. Similarly,
pr x ( H ϕ ) = { f ( a x 1 , … , a x s ) ∣ a j ∈ L ϕ j , j ∈ [ s ] } = f ( pr x ( P ϕ ) ) = f ( P x ) = H x , \operatorname{pr}_x(H_\phi)=\left\{f(a_x^1,\ldots,a_x^s)\mid a^j\in L^j_\phi,j\in[s]\right\}=f(\operatorname{pr}_x(P_\phi))=f(P_x)=H_x, pr x ( H ϕ ) = { f ( a x 1 , … , a x s ) ∣ a j ∈ L ϕ j , j ∈ [ s ] } = f ( pr x ( P ϕ )) = f ( P x ) = H x ,
so it follows that both P P P and H H H are AC. To prove CSAC of H H H , fix an arbitrary constraint ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ and a tuple a ∈ P ϕ a\in P_\phi a ∈ P ϕ . We write a x a_x a x for the tuple ( a x 1 , … , a x s ) (a_x^1,\ldots,a_x^s) ( a x 1 , … , a x s ) . Note that for every j ∈ [ s ] j\in[s] j ∈ [ s ] , we have a j = ( a x j ) x ∈ V ϕ ∈ L ϕ j a^j=(a_x^j)_{x\in V_\phi}\in L^j_\phi a j = ( a x j ) x ∈ V ϕ ∈ L ϕ j . Choose for each j j j an AC-certificate K j ≤ L j K^j\leq L^j K j ≤ L j with K ϕ j = { a j } . A s b e f o r e , d e f i n e t h e t u b e r s y s t e m K^j_\phi=\{a^j\}. As before, define the tuber system K ϕ j = { a j } . A s b e f or e , d e f in e t h e t u b er sy s t e m Q:=\prod_{j=1}^{s}K^j$, and N : = f ( Q ) N:=f(Q) N := f ( Q ) . By the same argument as for P P P and H H H , we get that N N N and Q Q Q are AC. Since Q ≤ P Q\leq P Q ≤ P and N ≤ H N\leq H N ≤ H , and Q ϕ = { a } Q_\phi=\{a\} Q ϕ = { a } and N ϕ = { f ( a ) } N_\phi=\{f(a)\} N ϕ = { f ( a )} by construction, it follows that each tuple of every constraint list of P P P and H H H has an AC-certificate. Thus, P P P and H H H are CSAC. ◀
Assume the algorithm from § 3.2 accepts A \mathcal{A} A , and let S S S be the tuber system at the end of the algorithm. For every constraint θ ∈ Φ ∪ Ψ \theta\in\Phi\cup\Psi θ ∈ Φ ∪ Ψ , let T θ T_\theta T θ denote the smallest relation containing S θ S_\theta S θ and closed under both g 1 g_1 g 1 and g 2 g_2 g 2 . Since g 1 , g 2 ∈ Pol ( B ) g_1,g_2\in\operatorname{Pol}(\mathcal{B}) g 1 , g 2 ∈ Pol ( B ) , all tuples in T θ T_\theta T θ satisfy θ \theta θ . The sets T x T_x T x for all x ∈ A x\in A x ∈ A are defined similarly. Furthermore, we set D x : = π ( T x ) D_x:=\pi(T_x) D x := π ( T x ) for all x ∈ A x\in A x ∈ A and Q ψ x y : = { ( π ( a ) , π ( b ) ) ∣ ( a , b ) ∈ T ψ x y } Q_{\psi_{xy}}:=\{(\pi(a),\pi(b))\mid(a,b)\in T_{\psi_{xy}}\} Q ψ x y := {( π ( a ) , π ( b )) ∣ ( a , b ) ∈ T ψ x y } for each ψ x y ∈ Ψ \psi_{xy}\in\Psi ψ x y ∈ Ψ .
Lemma 13. (i) Each D x D_x D x , x ∈ A x\in A x ∈ A , is a non-empty subalgebra of E \mathcal{E} E .
(ii) The tuber system W : = { D x ∣ x ∈ A } ∪ { Q ψ x y ∣ ψ x y ∈ Ψ } W:=\{D_x\mid x\in A\}\cup\{Q_{\psi_{xy}}\mid\psi_{xy}\in\Psi\} W := { D x ∣ x ∈ A } ∪ { Q ψ x y ∣ ψ x y ∈ Ψ } is SAC.
(iii) For every ψ x y ∈ Ψ \psi_{xy}\in\Psi ψ x y ∈ Ψ and every ( a , b ) ∈ Q ψ x y (a,b)\in Q_{\psi_{xy}} ( a , b ) ∈ Q ψ x y , there is a finite CSAC tuber system L ≤ T L\leq T L ≤ T with π ( L x ) = { a } \pi(L_x)=\{a\} π ( L x ) = { a } and π ( L y ) = { b } \pi(L_y)=\{b\} π ( L y ) = { b } .
Proof. To prove (i), note that the projection π : ( B ; g 1 , g 2 ) → ( [ k ] ; g ~ 1 , g ~ 2 ) \pi:(B;g_1,g_2)\to([k];\widetilde{g}_1,\widetilde{g}_2) π : ( B ; g 1 , g 2 ) → ([ k ] ; g 1 , g 2 ) is a homomorphism, and observe that D x = π ( T x ) D_x=\pi(T_x) D x = π ( T x ) , where T x T_x T x is the closure of the set S x S_x S x under g 1 , g 2 g_1,g_2 g 1 , g 2 in B B B . Since g ~ 1 , g ~ 2 \tilde{g}_1,\tilde{g}_2 g ~ 1 , g ~ 2 are the only operations of E \mathcal{E} E and S x S_x S x is non-empty, it follows that D x D_x D x is a non-empty subalgebra of E \mathcal{E} E .
For (ii), we first show that the tuber system T T T is non-empty and AC. We define for every { g 1 , g 2 } \{g_1,g_2\} { g 1 , g 2 } -term t t t with arity q t q_t q t the tuber system L t L^t L t via
L θ t : = { t B ( u 1 , … , u q t ) ∣ u 1 , … , u q t ∈ S θ } , L^t_\theta:= \{t^{\mathcal{B}}(u_1,\ldots,u_{q_t}) \mid u_1,\ldots,u_{q_t} \in S_\theta\}, L θ t := { t B ( u 1 , … , u q t ) ∣ u 1 , … , u q t ∈ S θ } ,
for each θ ∈ Φ ∪ Ψ \theta\in\Phi\cup\Psi θ ∈ Φ ∪ Ψ , and where t B t^{\mathcal{B}} t B denotes the operation defined by t t t in B \mathcal{B} B . Since S S S is non-empty, also L t L^t L t is non-empty for every { g 1 , g 2 } \{g_1,g_2\} { g 1 , g 2 } -term t t t . By Lemma 12 , each L t L^t L t is also finite and CSAC. For every θ ∈ Φ ∪ Ψ \theta\in\Phi\cup\Psi θ ∈ Φ ∪ Ψ , we have that T θ = ⋃ t L θ t T_\theta= \bigcup_t L^t_\theta T θ = ⋃ t L θ t . For θ ∈ Φ ∪ Ψ \theta\in\Phi\cup\Psi θ ∈ Φ ∪ Ψ , we get pr x ( T θ ) = pr x ( ⋃ t L θ t ) = ⋃ t L x t = T x \operatorname{pr}_x(T_\theta) = \operatorname{pr}_x(\bigcup_t L^t_\theta) = \bigcup_t L^t_x = T_x pr x ( T θ ) = pr x ( ⋃ t L θ t ) = ⋃ t L x t = T x , so T T T is AC, and non-empty, since S θ ⊆ T θ S_\theta\subseteq T_\theta S θ ⊆ T θ for each θ \theta θ . In particular, for every ψ x y ∈ Ψ \psi_{xy} \in\Psi ψ x y ∈ Ψ , we have pr 1 ( Q ψ x y ) = π ( pr 1 ( T ψ x y ) ) = π ( T x ) = D x \operatorname{pr}_1(Q_{\psi_{xy}}) = \pi(\operatorname{pr}_1(T_{\psi_{xy}})) = \pi(T_x) = D_x pr 1 ( Q ψ x y ) = π ( pr 1 ( T ψ x y )) = π ( T x ) = D x , and pr 2 ( Q ψ x y ) = D y \operatorname{pr}_2(Q_{\psi_{xy}}) = D_y pr 2 ( Q ψ x y ) = D y . Thus, the tuber system W W W is an AC tuber system. For SAC, fix x ∈ A x \in A x ∈ A and a value a ∈ D x a \in D_x a ∈ D x . Choose b ∈ T x b \in T_x b ∈ T x with π ( b ) = a \pi(b) = a π ( b ) = a , and choose a { g 1 , g 2 } \{g_1,g_2\} { g 1 , g 2 } -term t t t such that b ∈ L x t b \in L^t_x b ∈ L x t . Since L t L^t L t is CSAC, there is an AC tuber subsystem K t ≤ L t K^t \leq L^t K t ≤ L t with K x t = { b } K^t_x = \{b\} K x t = { b } . For each y ∈ A y \in A y ∈ A , set U y = π ( K y t ) U_y = \pi(K^t_y) U y = π ( K y t ) and U ψ y z = { ( π ( c ) , π ( d ) ) ∣ ( c , d ) ∈ K ψ y z t } U_{\psi_{yz}} = \{(\pi(c),\pi(d)) \mid(c,d) \in K^t_{\psi_{yz}}\} U ψ y z = {( π ( c ) , π ( d )) ∣ ( c , d ) ∈ K ψ y z t } for ψ y z ∈ Ψ \psi_{yz} \in\Psi ψ y z ∈ Ψ . By construction, U U U is non-empty and a subsystem of W W W , and since pr 1 ( U ψ y z ) = π ( pr 1 ( K ψ y z t ) ) = π ( K y t ) = U y \operatorname{pr}_1(U_{\psi_{yz}}) = \pi(\operatorname{pr}_1(K^t_{\psi_{yz}})) = \pi(K^t_y) = U_y pr 1 ( U ψ y z ) = π ( pr 1 ( K ψ y z t )) = π ( K y t ) = U y and pr 2 ( U ψ y z ) = U z \operatorname{pr}_2(U_{\psi_{yz}}) = U_z pr 2 ( U ψ y z ) = U z , we get that U U U is an AC-certificate, thus proving SAC of W W W .
To prove (iii), consider ( a , b ) ∈ Q ψ x y (a,b) \in Q_{\psi_{xy}} ( a , b ) ∈ Q ψ x y and choose a tuple u ∈ T ψ x y u \in T_{\psi_{xy}} u ∈ T ψ x y with π ( u x ) = a \pi(u_x) = a π ( u x ) = a and π ( u y ) = b \pi(u_y) = b π ( u y ) = b . By construction, we obtain u u u as u = t B ( u 1 , … , u q ) u = t^{\mathcal{B}}(u_1,\ldots,u_q) u = t B ( u 1 , … , u q ) for a { g 1 , g 2 } \{g_1,g_2\} { g 1 , g 2 } -term t t t of arity q q q , and with u 1 , … , u q ∈ S ψ x y u_1,\ldots,u_q \in S_{\psi_{xy}} u 1 , … , u q ∈ S ψ x y . Since S S S is a tuber system the algorithm accepted, there is, for every j ∈ [ q ] j \in[q] j ∈ [ q ] , a finite non-empty CSAC tuber system L j ≤ S L^j \leq S L j ≤ S with L ψ x y j = { u j } L^j_{\psi_{xy}} = \{u_j\} L ψ x y j = { u j } . By Lemma 12 , the tuber system L : = t B ( L 1 , … , L q ) L := t^{\mathcal{B}}(L^1,\ldots,L^q) L := t B ( L 1 , … , L q ) is a finite CSAC subsystem of T T T , which by construction satisfies L ψ x y = { u } L_{\psi_{xy}} = \{u\} L ψ x y = { u } , and thus also π ( L x ) = { a } \pi(L_x) = \{a\} π ( L x ) = { a } and π ( L y ) = { b } \pi(L_y) = \{b\} π ( L y ) = { b } . ◀
Proposition 14. Let A \mathcal{A} A be an instance of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) which the algorithm from § 3.2 accepts, and let S S S be the non-empty tuber system on which the algorithm terminates. Then there is a map c : A → [ k ] c : A \to[k] c : A → [ k ] as well as a finite non-empty CSAC tuber system U U U of A \mathcal{A} A such that for every φ ∈ Φ \varphi\in\Phi φ ∈ Φ ,
U φ ⊆ B ∩ ∏ j = 1 s φ C c ( x j ) (1) U_\varphi\subseteq\mathcal{B} \cap\prod_{j=1}^{s_\varphi} C_{c(x_j)} \tag*{(1)} U φ ⊆ B ∩ j = 1 ∏ s φ C c ( x j ) (1) holds. A tuber system satisfying property (1) is called c c c -colour-determined.
Proof. Let T T T , D D D , Q Q Q and W W W be defined as for Lemma 13 . For each ψ x y ∈ Ψ \psi_{xy} \in\Psi ψ x y ∈ Ψ and each ( a , b ) ∈ Q ψ x y (a,b) \in Q_{\psi_{xy}} ( a , b ) ∈ Q ψ x y , we choose a CSAC tuber system L x y , a b ≤ T L^{xy,ab} \leq T L x y , ab ≤ T such that π ( L x x y , a b ) = { a } \pi(L^{xy,ab}_x) = \{a\} π ( L x x y , ab ) = { a } and π ( L y x y , a b ) = { b } \pi(L^{xy,ab}_y) = \{b\} π ( L y x y , ab ) = { b } . By Lemma 13 (iii), such tuber systems exist for all constraints and values. We enumerate those systems as L 1 , … , L s ≤ T L^1,\ldots,L^s \leq T L 1 , … , L s ≤ T . Define P x : = ∏ l = 1 s L x l P_x := \prod_{l=1}^{s} L^l_x P x := ∏ l = 1 s L x l , and define Λ : = { ( x , u ) ∣ x ∈ A , u ∈ P x } \Lambda:= \{(x,u) \mid x \in A,u \in P_x\} Λ := {( x , u ) ∣ x ∈ A , u ∈ P x } and r ( x , u ) l = π ( u l ) r^l_{(x,u)} = \pi(u_l) r ( x , u ) l = π ( u l ) . We define a relation R R R on E Λ \mathcal{E}^\Lambda E Λ , a power of the finite colour algebra E \mathcal{E} E , by R : = Sg E Λ ( r 1 , … , r s ) R := \operatorname{Sg}_{\mathcal{E}^\Lambda}(r^1,\ldots,r^s) R := Sg E Λ ( r 1 , … , r s ) , i.e., R R R is the subalgebra of E Λ \mathcal{E}^\Lambda E Λ generated by the ∣ Λ ∣ |\Lambda| ∣Λ∣ -tuples r 1 , … , r s r^1,\ldots,r^s r 1 , … , r s . By construction, we have that R ⊆ ∏ ( x , u ) ∈ Λ D x R \subseteq\prod_{(x,u)\in\Lambda} D_x R ⊆ ∏ ( x , u ) ∈ Λ D x .
We claim that for every ( x , u ) ∈ Λ (x,u) \in\Lambda ( x , u ) ∈ Λ , also pr ( x , u ) ( R ) = D x \operatorname{pr}_{(x,u)}(R) = D_x pr ( x , u ) ( R ) = D x holds. Fix an arbitrary x ∈ A x \in A x ∈ A and a ∈ D x a \in D_x a ∈ D x . Since Q ψ x x = { ( a , b ) ∣ b ∈ D x } Q_{\psi_{xx}} = \{(a,b) \mid b \in D_x\} Q ψ xx = {( a , b ) ∣ b ∈ D x } , we have ( a , a ) ∈ Q ψ x x (a,a) \in Q_{\psi_{xx}} ( a , a ) ∈ Q ψ xx . By construction of the algorithm, there exists a CSAC tuber system L l L^l L l with π ( L x l ) = { a } \pi(L^l_x) = \{a\} π ( L x l ) = { a } .
Take an arbitrary u ∈ P x = ∏ j = 1 s L x j u \in P_x = \prod_{j=1}^{s}L^j_x u ∈ P x = ∏ j = 1 s L x j . It follows that u l ∈ L x l u_l \in L^l_x u l ∈ L x l , and thus r ( x , u ) l = π ( u l ) = a r^l_{(x,u)} = \pi(u_l) = a r ( x , u ) l = π ( u l ) = a . Importantly, since l l l does not depend on u u u , we know that also r ( x , u ′ ) l = a r^l_{(x,u')} = a r ( x , u ′ ) l = a holds for all u ′ ≠ u u' \ne u u ′ = u . Since r l ∈ R r^l \in R r l ∈ R by definition, we know that a ∈ pr ( x , u ) ( R ) a \in\operatorname{pr}_{(x,u)}(R) a ∈ pr ( x , u ) ( R ) . Since the choice of a ∈ D x a \in D_x a ∈ D x was arbitrary, we get D x ⊆ pr ( x , u ) ( R ) D_x \subseteq\operatorname{pr}_{(x,u)}(R) D x ⊆ pr ( x , u ) ( R ) , proving the claim.
Additionally, we consider the projection for pairs of distinct coordinates. For i = ( x , u ) i=(x,u) i = ( x , u ) and j = ( y , v ) j=(y,v) j = ( y , v ) , define pr i j ( R ) = { ( r i , r j ) ∣ r ∈ R } \operatorname{pr}_{ij}(R)=\{(r_i,r_j)\mid r\in R\} pr ij ( R ) = {( r i , r j ) ∣ r ∈ R } . We claim that for x ≠ y x\ne y x = y , we have Q ψ x y ⊆ pr i j ( R ) Q_{\psi_{xy}}\subseteq\operatorname{pr}_{ij}(R) Q ψ x y ⊆ pr ij ( R ) , while for x = y x=y x = y and u ≠ v u\ne v u = v , we get { ( a , a ) ∣ a ∈ D x } ⊆ pr i j ( R ) \{(a,a)\mid a\in D_x\}\subseteq\operatorname{pr}_{ij}(R) {( a , a ) ∣ a ∈ D x } ⊆ pr ij ( R ) . Let x ≠ y x\ne y x = y , and consider arbitrary ( a , b ) ∈ Q ψ x y (a,b)\in Q_{\psi_{xy}} ( a , b ) ∈ Q ψ x y . Select a CSAC tuber system L l L^l L l such that π ( L x l ) = { a } \pi(L_x^l)=\{a\} π ( L x l ) = { a } and π ( L y l ) = { b } \pi(L_y^l)=\{b\} π ( L y l ) = { b } . Since u ∈ P x u\in P_x u ∈ P x and v ∈ P y v\in P_y v ∈ P y , we have u l ∈ L x l u_l\in L_x^l u l ∈ L x l and v l ∈ L y l v_l\in L_y^l v l ∈ L y l , and so the same tuple r l ∈ R r^l\in R r l ∈ R satisfies both r i l = π ( u l ) = a r_i^l=\pi(u_l)=a r i l = π ( u l ) = a and r j l = π ( v l ) = b r_j^l=\pi(v_l)=b r j l = π ( v l ) = b , i.e., ( a , b ) ∈ pr i j ( R ) (a,b)\in\operatorname{pr}_{ij}(R) ( a , b ) ∈ pr ij ( R ) . Since the choice of ( a , b ) ∈ Q ψ x y (a,b)\in Q_{\psi_{xy}} ( a , b ) ∈ Q ψ x y was arbitrary, we have Q ψ x y ⊆ pr i j ( R ) Q_{\psi_{xy}}\subseteq\operatorname{pr}_{ij}(R) Q ψ x y ⊆ pr ij ( R ) . For i = ( x , u ) i=(x,u) i = ( x , u ) and j = ( x , v ) j=(x,v) j = ( x , v ) with u ≠ v u\ne v u = v , choose an arbitrary a ∈ D x a\in D_x a ∈ D x , and select a CSAC tuber system L l L^l L l such that π ( L x l ) = { a } \pi(L_x^l)=\{a\} π ( L x l ) = { a } . Since now both u l , v l ∈ L x l u_l,v_l\in L_x^l u l , v l ∈ L x l , we get r i l = π ( u l ) = a = π ( v l ) = r j l r_i^l=\pi(u_l)=a=\pi(v_l)=r_j^l r i l = π ( u l ) = a = π ( v l ) = r j l , proving that ( a , a ) ∈ pr i j ( R ) (a,a)\in\operatorname{pr}_{ij}(R) ( a , a ) ∈ pr ij ( R ) for each a ∈ D x a\in D_x a ∈ D x .
We now construct an instance H \mathfrak{H} H of CSP( [ k ] ; R , ( D x ) x ∈ A , ( Δ D x ) x ∈ A ) ([k];R,(D_x)_{x\in A},(\Delta_{D_x})_{x\in A}) ([ k ] ; R , ( D x ) x ∈ A , ( Δ D x ) x ∈ A ) , where Δ D x : = { ( a , a ) ∣ a ∈ D x } \Delta_{D_x}:=\{(a,a)\mid a\in D_x\} Δ D x := {( a , a ) ∣ a ∈ D x } . Note that all relations of this template are invariant under g ~ 1 , g ~ 2 \tilde g_1,\tilde g_2 g ~ 1 , g ~ 2 , i.e., the template has 3-4 weak near-unanimity polymorphisms. The instance H \mathfrak{H} H is defined as follows:
The variable set of H \mathfrak{H} H is Λ \Lambda Λ . Fix an enumeration v 1 , … , v λ ∈ Λ v_1,\ldots,v_\lambda\in\Lambda v 1 , … , v λ ∈ Λ , where λ = ∣ Λ ∣ \lambda=|\Lambda| λ = ∣Λ∣ .
For each variable ( x , u ) ∈ Λ (x,u)\in\Lambda ( x , u ) ∈ Λ , add a constraint D x ( ( x , u ) ) D_x((x,u)) D x (( x , u )) .
For each pair of variables ( x , u ) , ( x , w ) ∈ Λ (x,u),(x,w)\in\Lambda ( x , u ) , ( x , w ) ∈ Λ , add a constraint Δ D x ( ( x , u ) , ( x , w ) ) \Delta_{D_x}((x,u),(x,w)) Δ D x (( x , u ) , ( x , w )) .
Add one R R R -constraint on all variables of Λ \Lambda Λ , i.e., R ( v 1 , … , v λ ) R(v_1,\ldots,v_\lambda) R ( v 1 , … , v λ ) .
The instance H \mathfrak{H} H is AC, which follows directly from our previously proved claims.
To see that H \mathfrak{H} H is also cycle consistent, note that we can use SAC of the tuber system W W W from Lemma 13 (ii). The only constraint of H \mathfrak{H} H not having a corresponding set in W W W is R R R , but since Q ψ x y ⊆ pr i j ( R ) Q_{\psi_{xy}}\subseteq\operatorname{pr}_{ij}(R) Q ψ x y ⊆ pr ij ( R ) and all Q ψ x y Q_{\psi_{xy}} Q ψ x y are sets in W W W , all steps possible in W W W are possible in R R R . Fix a closed constraint walk in H \mathfrak{H} H starting at v 0 = ( x 0 , u 0 ) v_0=(x_0,u_0) v 0 = ( x 0 , u 0 ) and a value a ∈ D x 0 a\in D_{x_0} a ∈ D x 0 . Choose an AC tuber system W ′ ≤ W W'\le W W ′ ≤ W with W x 0 ′ = { a } W'_{x_0}=\{a\} W x 0 ′ = { a } and W ψ x y ′ ⊆ Q ψ x y W'_{\psi_{xy}}\subseteq Q_{\psi_{xy}} W ψ x y ′ ⊆ Q ψ x y for each ψ x y ∈ Ψ \psi_{xy}\in\Psi ψ x y ∈ Ψ , the existence of which is given by SAC of W W W . We set the values d i d_i d i for each variable v i = ( x i , u i ) v_i=(x_i,u_i) v i = ( x i , u i ) of the constraint walk recursively, beginning with d 0 : = a d_0:=a d 0 := a . If for v i + 1 v_{i+1} v i + 1 we have x i + 1 = x i x_{i+1}=x_i x i + 1 = x i , we set d i + 1 : = d i d_{i+1}:=d_i d i + 1 := d i . This works for each possible constraint θ i + 1 \theta_{i+1} θ i + 1 between v i v_i v i and v i + 1 v_{i+1} v i + 1 : if θ i + 1 \theta_{i+1} θ i + 1 is either of the form D x i D_{x_i} D x i or Δ D x i \Delta_{D_{x_i}} Δ D x i , it follows from the definitions. If θ i + 1 \theta_{i+1} θ i + 1 is R R R , this follows since we have shown before that { ( a , a ) ∣ a ∈ D x } ⊆ pr ( x , u ) ( x , v ) ( R ) \{(a,a)\mid a\in D_x\}\subseteq\operatorname{pr}_{(x,u)(x,v)}(R) {( a , a ) ∣ a ∈ D x } ⊆ pr ( x , u ) ( x , v ) ( R ) . If, on the other hand, for v i + 1 v_{i+1} v i + 1 we have x i + 1 ≠ x i x_{i+1}\ne x_i x i + 1 = x i , then the constraint θ i + 1 \theta_{i+1} θ i + 1 has to be R R R , and we set d i + 1 d_{i+1} d i + 1 such that ( d i , d i + 1 ) ∈ W ψ x i x i + 1 ′ (d_i,d_{i+1})\in W'_{\psi_{x_i x_{i+1}}} ( d i , d i + 1 ) ∈ W ψ x i x i + 1 ′ . This choice is compatible with R R R since Q ψ x y ⊆ pr i j ( R ) Q_{\psi_{xy}}\subseteq\operatorname{pr}_{ij}(R) Q ψ x y ⊆ pr ij ( R ) . At the end of the constraint walk, we get d m = W x m ′ = W x 0 ′ = { a } d_m=W'_{x_m}=W'_{x_0}=\{a\} d m = W x m ′ = W x 0 ′ = { a } , proving cycle consistency of H \mathfrak{H} H .
By Theorem 11 , the instance H \mathfrak{H} H has a solution, i.e., a map p : Λ → [ k ] p:\Lambda\to[k] p : Λ → [ k ] preserving all constraint relations. By construction of H \mathfrak{H} H , we have p ( x , u ) = p ( x , u ′ ) p(x,u)=p(x,u') p ( x , u ) = p ( x , u ′ ) for all ( x , u ) , ( x , u ′ ) ∈ Λ (x,u),(x,u')\in\Lambda ( x , u ) , ( x , u ′ ) ∈ Λ . We define c c c as this constant value for each x x x , i.e., c ( x ) : = p ( x , u ) c(x):=p(x,u) c ( x ) := p ( x , u ) . Since the relation R R R is generated by the ∣ Λ ∣ |\Lambda| ∣Λ∣ -tuples r 1 , … , r s r^1,\ldots,r^s r 1 , … , r s , there is an s s s -ary { g 1 , g 2 } \{g_1,g_2\} { g 1 , g 2 } -term t t t such that, evaluated in E \mathcal{E} E , we have t E ( r 1 , … , r s ) = ( p ( ( x , u ) ) ) ( x , u ) ∈ Λ t^{\mathcal{E}}(r^1,\ldots,r^s)=(p((x,u)))_{(x,u)\in\Lambda} t E ( r 1 , … , r s ) = ( p (( x , u )) ) ( x , u ) ∈ Λ . We evaluate the term t t t in B \mathcal{B} B and define L ′ : = t B ( L 1 , … , L s ) L':=t^{\mathcal{B}}(L^1,\ldots,L^s) L ′ := t B ( L 1 , … , L s ) . Since t B ∈ Pol ( B ) t^{\mathcal{B}}\in\operatorname{Pol}(\mathcal{B}) t B ∈ Pol ( B ) , the tuber system L ′ L' L ′ is finite and CSAC by Lemma 12 . Also, for each x ∈ A x\in A x ∈ A and every b ∈ L x ′ b\in L'_x b ∈ L x ′ , there is u = ( u 1 , … , u s ) ∈ P x u=(u_1,\ldots,u_s)\in P_x u = ( u 1 , … , u s ) ∈ P x such that b = t B ( u 1 , … , u s ) b=t^{\mathcal{B}}(u_1,\ldots,u_s) b = t B ( u 1 , … , u s ) . Since
π ( b ) = π ( t B ( u 1 , … , u s ) ) = t E ( r ( x , u ) 1 , … , r ( x , u ) s ) = p ( x , u ) = c ( x ) , \pi(b)=\pi\left(t^{\mathcal{B}}(u_1,\ldots,u_s)\right)=t^{\mathcal{E}}\left(r^1_{(x,u)},\ldots,r^s_{(x,u)}\right)=p(x,u)=c(x), π ( b ) = π ( t B ( u 1 , … , u s ) ) = t E ( r ( x , u ) 1 , … , r ( x , u ) s ) = p ( x , u ) = c ( x ) ,
we get L x ′ ⊆ C c ( x ) L'_x\subseteq C_{c(x)} L x ′ ⊆ C c ( x ) . Since L ′ ≤ T L'\le T L ′ ≤ T , we also get L ϕ ′ ⊆ Φ B L'_\phi\subseteq\Phi^{\mathcal{B}} L ϕ ′ ⊆ Φ B for all ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ . Defining U U U as the restriction of L ′ L' L ′ to Φ \Phi Φ and A A A (i.e., removing the sets L ψ ′ L'_\psi L ψ ′ for all ψ ∈ Ψ \psi\in\Psi ψ ∈ Ψ ) gives the required CSAC tuber system U U U of A \mathcal{A} A , finishing the proof.
Solutions from Determined Colours
In this section we show that an instance with a colour-determined CSAC tuber system has a solution. The goal of this section is to prove the following lemma.
Lemma 15. Let B \mathcal{B} B be finite-on-top-of-temporal satisfying the assumptions of (4) from Theorem 8. Let A \mathcal{A} A be an instance of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) with constraints Φ \Phi Φ . Assume there is a map c : A → [ k ] c: A \to[k] c : A → [ k ] and a finite non-empty c c c -colour-determined CSAC tuber system S S S . Then the instance A \mathcal{A} A has a solution in B \mathcal{B} B with colours c c c .
The proof of this lemma will use syntactical normal forms for relations of algebraic products of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) as well as results about palette totally-symmetric maps, both are given below.
In the following, we write Q ( d ) \mathbb{Q}^{(d)} Q ( d ) for the d d d -ary algebraic product of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) , i.e., the structure ( Q d ; < 1 , … , < d , = 1 , … , = d ) (\mathbb{Q}^{d}; <_{1}, \ldots, <_{d}, =_{1}, \ldots, =_{d}) ( Q d ; < 1 , … , < d , = 1 , … , = d ) , where u < i v u <_{i} v u < i v means u i < v i u_{i} < v_{i} u i < v i , and u = i v u =_{i} v u = i v means u i = v i u_{i} = v_{i} u i = v i . Let P \mathcal{P} P be a first-order expansion of Q ( d ) \mathbb{Q}^{(d)} Q ( d ) . Since all polymorphisms of P \mathcal{P} P preserve = i =_{i} = i for all i ∈ [ d ] i \in[d] i ∈ [ d ] , the i i i -th coordinate of the output depends only on the i i i -th coordinates of the inputs. Thus, the restriction of f ∈ Pol ( P ) f \in\operatorname{Pol}(\mathcal{P}) f ∈ Pol ( P ) to its i i i -th coordinates, written f ∣ i f|_{i} f ∣ i , is unique and yields an operation of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) .
Theorem 16 ([7 Proposition 4.38] ). Let d ≥ 2 d \ge2 d ≥ 2 , and let P \mathcal{P} P be a first-order expansion of Q ( d ) \mathbb{Q}^{(d)} Q ( d ) . Let S ⊆ [ d ] S \subseteq[d] S ⊆ [ d ] be such that
for every p ∈ S p \in S p ∈ S there exists f p ∈ Pol ( P ) f_{p} \in\operatorname{Pol}(\mathcal{P}) f p ∈ Pol ( P ) such that f p ∣ p f_{p}|_{p} f p ∣ p is an l l ll l l -operation, and
for every p ∈ [ d ] ∖ S p \in[d] \setminus S p ∈ [ d ] ∖ S there exists f p ∈ Pol ( P ) f_{p} \in\operatorname{Pol}(\mathcal{P}) f p ∈ Pol ( P ) such that f p ∣ p f_{p}|_{p} f p ∣ p is a p p pp pp -operation, but there is no g ∈ Pol ( P ) g \in\operatorname{Pol}(\mathcal{P}) g ∈ Pol ( P ) such that g ∣ p g|_{p} g ∣ p is a l e x lex l e x -operation.
Then, every relation of P \mathcal{P} P can be defined by a conjunction of clauses of one of the following forms, for some p ∈ [ d ] p \in[d] p ∈ [ d ] :
(a) if p ∈ [ d ] ∖ S p \in[d] \setminus S p ∈ [ d ] ∖ S , then the clauses can be chosen to be of the form
u 1 ≠ i 1 v 1 ∨ ⋯ ∨ u m ≠ i m v m ∨ y 1 ≠ p x ∨ ⋯ ∨ y k ≠ p x ∨ z 1 ≤ p x ∨ ⋯ ∨ z l ≤ p x u_{1} \ne_{i_{1}} v_{1} \lor\cdots\lor u_{m} \ne_{i_{m}} v_{m} \lor y_{1} \ne_{p} x \lor\cdots\lor y_{k} \ne_{p} x \lor z_{1} \le_{p} x \lor\cdots\lor z_{l} \le_{p} x u 1 = i 1 v 1 ∨ ⋯ ∨ u m = i m v m ∨ y 1 = p x ∨ ⋯ ∨ y k = p x ∨ z 1 ≤ p x ∨ ⋯ ∨ z l ≤ p x where i 1 , … , i m ∈ S i_{1}, \ldots, i_{m} \in S i 1 , … , i m ∈ S , and
(b) if p ∈ S p \in S p ∈ S , then the clauses can be chosen to be clauses of the form
x 1 ≠ i 1 y 1 ∨ ⋯ ∨ x m ≠ i m y m ∨ z 1 < p z 0 ∨ ⋯ ∨ z l < p z 0 ∨ ( z 0 = p ⋯ = p z l ) x_{1} \ne_{i_{1}} y_{1} \lor\cdots\lor x_{m} \ne_{i_{m}} y_{m} \lor z_{1} <_{p} z_{0} \lor\cdots\lor z_{l} <_{p} z_{0} \lor(z_{0} =_{p} \cdots=_{p} z_{l}) x 1 = i 1 y 1 ∨ ⋯ ∨ x m = i m y m ∨ z 1 < p z 0 ∨ ⋯ ∨ z l < p z 0 ∨ ( z 0 = p ⋯ = p z l ) for i 1 , … , i m ∈ S i_{1}, \ldots, i_{m} \in S i 1 , … , i m ∈ S , and where the last disjunct may be omitted.
Palette Maps
We follow the terminology from [28 ] .
Definition 17. Let k 1 , … , k n ∈ N k_{1}, \ldots, k_{n} \in\mathbb{N} k 1 , … , k n ∈ N , and let m = ∑ i k i m = \sum_{i} k_{i} m = ∑ i k i . A function f : B m → B f: B^{m} \to B f : B m → B is ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -block totally symmetric if the value f ( a ˉ 1 , … , a ˉ n ) f(\bar{a}_{1}, \ldots, \bar{a}_{n}) f ( a ˉ 1 , … , a ˉ n ) depends only on the sets ( { ( a ˉ i ) j ∣ j ∈ [ k i ] } ) i ∈ [ n ] \left(\{(\bar{a}_{i})_{j} \mid j \in[k_{i}]\}\right)_{i \in[n]} ( {( a ˉ i ) j ∣ j ∈ [ k i ]} ) i ∈ [ n ] . An m m m -tuple t t t is a ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette tuple if every value appearing somewhere in t t t fills some block entirely, i.e., if for all i ∈ [ n ] i \in[n] i ∈ [ n ] and j ∈ [ k i ] j \in[k_{i}] j ∈ [ k i ] , there is l ∈ [ n ] l \in[n] l ∈ [ n ] such that, for c : = t k 1 + ⋯ + k l − 1 + j c := t_{k_{1}+\cdots+k_{l-1}+j} c := t k 1 + ⋯ + k l − 1 + j , the l l l -th block of t t t is ( c , … , c ) (c, \ldots, c) ( c , … , c ) . A function f : B m → B f: B^{m} \to B f : B m → B is ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette totally symmetric if it is ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -block totally symmetric on all ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette tuples from B m B^{m} B m . A function f : B m → B f: B^{m} \to B f : B m → B is called a ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette polymorphism of B \mathcal{B} B if, for each relation symbol R R R and each ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette tuple ( a ˉ 1 , … , a ˉ m ) ∈ ( R B ) m (\bar{a}_{1}, \ldots, \bar{a}_{m}) \in(R^{\mathcal{B}})^{m} ( a ˉ 1 , … , a ˉ m ) ∈ ( R B ) m , we have f ( a ˉ 1 , … , a ˉ m ) ∈ R B f(\bar{a}_{1}, \ldots, \bar{a}_{m}) \in R^{\mathcal{B}} f ( a ˉ 1 , … , a ˉ m ) ∈ R B . We denote the set of all ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -palette polymorphisms of B \mathcal{B} B by ( k 1 , … , k n ) (k_{1}, \ldots, k_{n}) ( k 1 , … , k n ) -Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) .
Lemma 18 ([28 Corollary 6.5 and Lemma 6.12] ). Let B \mathcal{B} B be a temporal structure with min ∈ Pol ( B ) \operatorname{min} \in\operatorname{Pol}(\mathcal{B}) min ∈ Pol ( B ) . Then Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains palette totally symmetric functions of all arities and block sizes.
Lemma 19 ([28 Corollary 6.15 and Lemma 6.12] ). Let B \mathcal{B} B be a temporal structure with ll ∈ Pol ( B ) \operatorname{ll} \in\operatorname{Pol}(\mathcal{B}) ll ∈ Pol ( B ) . Then ( k 1 , … , k n ) (k_1,\ldots,k_n) ( k 1 , … , k n ) -Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) contains a ( k 1 , … , k n ) (k_1,\ldots,k_n) ( k 1 , … , k n ) -palette totally symmetric function for all k 1 , … , k n , n ∈ N k_1,\ldots,k_n,n \in\mathbb{N} k 1 , … , k n , n ∈ N . One possible choice for such a function is f ( v ˉ 1 , … , v ˉ n ) : = e n ( min ( v ˉ 1 ) , … , min ( v ˉ n ) ) f(\bar{v}_1,\ldots,\bar{v}_n):=e_n(\min(\bar{v}_1),\ldots,\min(\bar{v}_n)) f ( v ˉ 1 , … , v ˉ n ) := e n ( min ( v ˉ 1 ) , … , min ( v ˉ n )) , where e n : Q n ↪ Q e_n:\mathbb{Q}^n \hookrightarrow\mathbb{Q} e n : Q n ↪ Q preserves the lexicographic order.
Theorem 21 ([28 Lemma 6.13] ). Let B \mathcal{B} B be a relational structure, and suppose that for all n , k 1 , … , k n ∈ N n,k_1,\ldots,k_n \in\mathbb{N} n , k 1 , … , k n ∈ N there exists a ( k 1 , … , k n ) (k_1,\ldots,k_n) ( k 1 , … , k n ) -palette totally symmetric operation in ( k 1 , … , k n ) (k_1,\ldots,k_n) ( k 1 , … , k n ) -Pol ( B ) \operatorname{Pol}(\mathcal{B}) Pol ( B ) . Then every instance A \mathcal{A} A of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) with a finite non-empty CSAC tuber system has a solution.
Proof of Lemma 15
We now have all ingredients required to prove that any instance A \mathcal{A} A of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) with a non-empty c c c -colour-determined CSAC tuber system S S S has a solution with colours c : A → [ k ] c:A \to[k] c : A → [ k ] . We refer to tuples u ∈ S φ u \in S_\varphi u ∈ S φ satisfying the colouring c c c as c c c -coloured.
Proof of Lemma 15. We first construct an operation f f f from the operations f 1 , … , f k f_1,\ldots,f_k f 1 , … , f k and show that f f f preserves all relations on c c c -coloured palette tuples with the help of Theorem 16 . We then use this map to apply Theorem 21 . Assume that every f i ∣ C i f_i|_{C_i} f i ∣ C i is of the form e i ∘ t i e_i \circ t_i e i ∘ t i for some order-preserving embedding e i : C i ↪ C i e_i:C_i \hookrightarrow C_i e i : C i ↪ C i and t i ∈ { min , mi , ll } t_i \in\{\min,\operatorname{mi},\operatorname{ll}\} t i ∈ { min , mi , ll } . This is without loss of generality: If some t i t_i t i is a dual of those, we reverse the order in C i C_i C i and consider the primal operation. Assume also that k ≥ 2 k \ge2 k ≥ 2 ; for k = 1 k=1 k = 1 the result is given in [28 ] .
For every constraint φ ∈ Φ \varphi\in\Phi φ ∈ Φ with variables V φ = { x 1 , … , x s } V_\varphi=\{x_1,\ldots,x_s\} V φ = { x 1 , … , x s } , we write d j : = c ( x j ) d_j:=c(x_j) d j := c ( x j ) and define a relation R ^ φ ⊆ ( Q k ) s \widehat{R}_\varphi\subseteq(\mathbb{Q}^k)^s R φ ⊆ ( Q k ) s by
R ^ φ ( z 1 , … , z s ) : ⟺ ( ( d 1 , z 1 [ d 1 ] ) , … , ( d s , z s [ d s ] ) ) ∈ φ B . \widehat{R}_\varphi(z_1,\ldots,z_s):\Longleftrightarrow((d_1,z_1[d_1]),\ldots,(d_s,z_s[d_s]))\in\varphi^{\mathcal{B}}. R φ ( z 1 , … , z s ) :⟺ (( d 1 , z 1 [ d 1 ]) , … , ( d s , z s [ d s ])) ∈ φ B .
where by z [ d ] z[d] z [ d ] we refer to the d d d -th entry of z ∈ Q k z\in\mathbb{Q}^k z ∈ Q k . We define a structure over Q k \mathbb{Q}^k Q k by P : = ( Q k ; ( R ^ φ ) φ ∈ Φ , ( = i ) i ∈ [ k ] , ( < i ) i ∈ [ k ] ) . \mathcal{P}:=(\mathbb{Q}^k;(\widehat{R}_\varphi)_{\varphi\in\Phi},(=_{i})_{i\in[k]},(<_{i})_{i\in[k]}). P := ( Q k ; ( R φ ) φ ∈ Φ , ( = i ) i ∈ [ k ] , ( < i ) i ∈ [ k ] ) . Each f i f_i f i induces coordinate polymorphisms for each d ∈ [ k ] d\in[k] d ∈ [ k ] , by taking f i ∣ d f_i|_d f i ∣ d as f i ∣ C d f_i|_{C_d} f i ∣ C d , so, like in Section 5.1, we get coordinate-wise defined polymorphisms w i ∈ Pol ( P ) w_i\in\operatorname{Pol}(\mathcal{P}) w i ∈ Pol ( P ) with w i ∣ i = e i ∘ t i w_i|_i=e_i\circ t_i w i ∣ i = e i ∘ t i . We may take each w i w_i w i such that w i ∣ i = t i w_i|_i=t_i w i ∣ i = t i , this preserves the same relations, i.e., is still a polymorphism of P \mathcal{P} P . Define J : = { i ∈ [ k ] ∣ ∃ f ∈ Pol ( P ) such that f ∣ i is a lex-operation } J:=\{i\in[k]\mid\exists f\in\operatorname{Pol}(\mathcal{P})\text{ such that }f|_i\text{ is a lex-operation}\} J := { i ∈ [ k ] ∣ ∃ f ∈ Pol ( P ) such that f ∣ i is a lex-operation } , and write D i : = { w ∣ i : w ∈ Pol ( P ) } D_i:=\{w|_i:w\in\operatorname{Pol}(\mathcal{P})\} D i := { w ∣ i : w ∈ Pol ( P )} . Since P \mathcal{P} P is a first-order expansion of Q ( k ) \mathbb{Q}^{(k)} Q ( k ) , each D i D_i D i contains Aut ( Q ; < ) \operatorname{Aut}(\mathbb{Q};<) Aut ( Q ; < ) . Additionally, each D i D_i D i is locally closed by [7 Proposition 3.5] . Thus Z i = ( Q ; Inv ( D i ) ) \mathcal{Z}_i=(\mathbb{Q};\operatorname{Inv}(D_i)) Z i = ( Q ; Inv ( D i )) is a temporal structure with Pol ( Z i ) = D i \operatorname{Pol}(\mathcal{Z}_i)=D_i Pol ( Z i ) = D i . Applying Proposition 9 yields an ll \operatorname{ll} ll -operation in D i D_i D i for all i ∈ J i\in J i ∈ J , while for all i ∉ J i\notin J i ∈ / J , we get t i ∈ { min , mi } t_i\in\{\min,\operatorname{mi}\} t i ∈ { min , mi } , and thus also a pp \operatorname{pp} pp -operation in D i D_i D i . By definition, these operations are coordinate projections of polymorphisms of P \mathcal{P} P . Theorem 16 now gives us for each R ^ φ \widehat{R}_\varphi R φ a definition of the form
Λ φ ( z ˉ ) ∧ ⋀ p ∉ J λ ( χ φ , p , λ ( z ˉ ) ∨ ψ φ , p , λ ( z ˉ [ p ] ) ) . \Lambda_\varphi(\bar{z})\land\bigwedge_{\substack{p\notin J\\ \lambda}}\left(\chi_{\varphi,p,\lambda}(\bar{z})\vee\psi_{\varphi,p,\lambda}(\bar{z}[p])\right). Λ φ ( z ˉ ) ∧ p ∈ / J λ ⋀ ( χ φ , p , λ ( z ˉ ) ∨ ψ φ , p , λ ( z ˉ [ p ]) ) .
where Λ φ \Lambda_\varphi Λ φ is preserved by ll \operatorname{ll} ll and uses only coordinates in J = { p 1 , … , p m } J=\{p_1,\ldots,p_m\} J = { p 1 , … , p m } , while each χ φ , p , λ \chi_{\varphi,p,\lambda} χ φ , p , λ is a disjunction of disequalities between same coordinate entries from J J J , and each ψ φ , p , λ \psi_{\varphi,p,\lambda} ψ φ , p , λ uses only values at coordinate p p p . If J = ∅ J = \varnothing J = ∅ , then we take Λ ϕ = ⊤ \Lambda_{\phi} = \top Λ ϕ = ⊤ . Considering the tuples flat ( z ˉ ) ∈ Q s m \operatorname{flat}(\bar{z}) \in\mathbb{Q}^{sm} flat ( z ˉ ) ∈ Q s m , defined by flat ( z ˉ ) = ( z 1 [ p 1 ] , … , z 1 [ p m ] , … , z s [ p 1 ] , … , z s [ p m ] ) \operatorname{flat}(\bar{z}) = (z_1[p_1], \ldots, z_1[p_m], \ldots, z_s[p_1], \ldots, z_s[p_m]) flat ( z ˉ ) = ( z 1 [ p 1 ] , … , z 1 [ p m ] , … , z s [ p 1 ] , … , z s [ p m ]) , the formula Λ ϕ \Lambda_{\phi} Λ ϕ defines an ℓ ℓ \ell\ell ℓℓ -invariant temporal relation T ϕ ⊆ Q s m T_{\phi} \subseteq\mathbb{Q}^{sm} T ϕ ⊆ Q s m . Denote by T \mathcal{T} T the expansion of ( Q ; < ) (\mathbb{Q}; <) ( Q ; < ) by all T ϕ T_{\phi} T ϕ , ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ . Clearly, we have ℓ ℓ ∈ Pol ( T ) \ell\ell\in\operatorname{Pol}(\mathcal{T}) ℓℓ ∈ Pol ( T ) .
Fix arbitrary t , b 1 , … , b t ∈ N t, b_1, \ldots, b_t \in\mathbb{N} t , b 1 , … , b t ∈ N and write q = ∑ i b i q = \sum_i b_i q = ∑ i b i . By Lemma 19, there exists a ( b 1 , … , b t ) (b_1, \ldots, b_t) ( b 1 , … , b t ) -palette totally symmetric L : Q q → Q L \colon\mathbb{Q}^q \to\mathbb{Q} L : Q q → Q preserving all T ϕ T_{\phi} T ϕ on ( b 1 , … , b t ) (b_1, \ldots, b_t) ( b 1 , … , b t ) -palette tuples. Choose L L L as described in Lemma 19. Let M M M be a q q q -ary ( b 1 , … , b t ) (b_1, \ldots, b_t) ( b 1 , … , b t ) -palette totally symmetric operation preserving all mi \operatorname{mi} mi -invariant temporal relations, the existence of which is guaranteed by Lemma 18. We define G p : Q q → Q G_p \colon\mathbb{Q}^q \to\mathbb{Q} G p : Q q → Q by
G p : = { L , if p ∈ J , M , if p ∉ J and t p = mi min , if p ∉ J and t p = min , G_p :=
\begin{cases}
L, & \text{if } p \in J,\\
M, & \text{if } p \notin J \text{ and } t_p = \operatorname{mi}\\
\min, & \text{if } p \notin J \text{ and } t_p = \min,
\end{cases} G p := ⎩ ⎨ ⎧ L , M , min , if p ∈ J , if p ∈ / J and t p = mi if p ∈ / J and t p = min ,
and from G p G_p G p we obtain f : B q → B f \colon B^q \to B f : B q → B by defining f ( ( i , a 1 ) , … , ( i , a q ) ) : = ( i , G i ( a 1 , … , a q ) ) f((i,a_1), \ldots, (i,a_q)) := (i,G_i(a_1,\ldots,a_q)) f (( i , a 1 ) , … , ( i , a q )) := ( i , G i ( a 1 , … , a q )) on monochromatic tuples, and f ( ( i 1 , a 1 ) , … , ( i q , a q ) ) : = ( 1 , 0 ) f((i_1,a_1),\ldots,(i_q,a_q)) := (1,0) f (( i 1 , a 1 ) , … , ( i q , a q )) := ( 1 , 0 ) for all tuples where not all i j i_j i j are equal. Since all G p G_p G p are ( b 1 , … , b t ) (b_1,\ldots,b_t) ( b 1 , … , b t ) -palette totally symmetric, so is f f f .
In order to apply Theorem 21 , we define for each ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ a relation ϕ c B : = ϕ B ∩ ∏ x ∈ V ϕ C c ( x ) \phi^{\mathcal{B}}_c := \phi^{\mathcal{B}} \cap\prod_{x \in V_{\phi}} C_c(x) ϕ c B := ϕ B ∩ ∏ x ∈ V ϕ C c ( x ) , and a structure B c : = ( B ; ( ϕ c B ) ϕ ∈ Φ , ( C i ) i ∈ [ k ] ) \mathcal{B}_c := (B;(\phi^{\mathcal{B}}_c)_{\phi\in\Phi},(C_i)_{i \in[k]}) B c := ( B ; ( ϕ c B ) ϕ ∈ Φ , ( C i ) i ∈ [ k ] ) . By construction, we get f ∈ ( b 1 , … , b t ) - Pol ( B c ) f \in(b_1,\ldots,b_t)\text{-}\operatorname{Pol}(\mathcal{B}_c) f ∈ ( b 1 , … , b t ) - Pol ( B c ) . We now have to verify that f f f preserves every constraint on ( b 1 , … , b t ) (b_1,\ldots,b_t) ( b 1 , … , b t ) -palette tuples. Let ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ be arbitrary, and let ( a 1 , … , a q ) (a^1,\ldots,a^q) ( a 1 , … , a q ) be a ( b 1 , … , b t ) (b_1,\ldots,b_t) ( b 1 , … , b t ) -palette tuple, with a r = ( ( d 1 , a 1 r ) , … , ( d s , a s r ) ) ∈ ϕ c B a^r = ((d_1,a^r_1),\ldots,(d_s,a^r_s)) \in\phi^{\mathcal{B}}_c a r = (( d 1 , a 1 r ) , … , ( d s , a s r )) ∈ ϕ c B for each r ∈ [ q ] r \in[q] r ∈ [ q ] . We extend each a r a^r a r to an s s s -tuple a ^ r \hat{a}^r a ^ r of elements of Q k \mathbb{Q}^k Q k by defining a ^ j r [ p ] : = a j r \hat{a}^r_j[p] := a^r_j a ^ j r [ p ] := a j r if p = d j p=d_j p = d j , and a ^ j r [ p ] : = 0 \hat{a}^r_j[p] := 0 a ^ j r [ p ] := 0 else. By construction, we have a ^ r ∈ R ^ ϕ \hat{a}^r \in\hat{R}_{\phi} a ^ r ∈ R ^ ϕ for each r ∈ [ q ] r \in[q] r ∈ [ q ] , and the sequence a ^ 1 , … , a ^ q \hat{a}^1,\ldots,\hat{a}^q a ^ 1 , … , a ^ q still constitutes a ( b 1 , … , b t ) (b_1,\ldots,b_t) ( b 1 , … , b t ) -palette tuple. Define h j [ p ] : = G p ( a ^ j 1 [ p ] , … , a ^ j q [ p ] ) h_j[p] := G_p(\hat{a}^1_j[p],\ldots,\hat{a}^q_j[p]) h j [ p ] := G p ( a ^ j 1 [ p ] , … , a ^ j q [ p ]) , and put h ˉ : = ( h 1 , … , h s ) \bar{h} := (h_1,\ldots,h_s) h ˉ := ( h 1 , … , h s ) . We show that h ˉ ∈ R ^ ϕ \bar{h} \in\hat{R}_{\phi} h ˉ ∈ R ^ ϕ .
Since every a ^ r \hat{a}^r a ^ r satisfies Λ ϕ \Lambda_{\phi} Λ ϕ , we get flat ( a ^ r ) ∈ T ϕ \operatorname{flat}(\hat{a}^r) \in T_{\phi} flat ( a ^ r ) ∈ T ϕ , and all q q q of them constitute a palette tuple, so applying L L L preserves T ϕ T_{\phi} T ϕ . Since G p = L G_p = L G p = L for each p ∈ J p \in J p ∈ J , we get that h ˉ \bar{h} h ˉ satisfies Λ ϕ \Lambda_{\phi} Λ ϕ .
Take any clause of the form χ ϕ , p , λ ∨ ψ ϕ , p , λ \chi_{\phi,p,\lambda} \lor\psi_{\phi,p,\lambda} χ ϕ , p , λ ∨ ψ ϕ , p , λ . We know that each a ^ r \hat{a}^r a ^ r satisfies this clause. Assume first that some a ^ r \hat{a}^r a ^ r satisfies χ ϕ , p , λ \chi_{\phi,p,\lambda} χ ϕ , p , λ . Then there are j , j ′ ∈ [ s ] j,j' \in[s] j , j ′ ∈ [ s ] and p ′ ∈ J p' \in J p ′ ∈ J such that a ^ j r [ p ′ ] ≠ a ^ j ′ r [ p ′ ] \hat{a}^r_j[p'] \ne\hat{a}^r_{j'}[p'] a ^ j r [ p ′ ] = a ^ j ′ r [ p ′ ] . Since p ′ ∈ J p' \in J p ′ ∈ J , we have G p ′ = L G_{p'} = L G p ′ = L , and by the choice of L L L as in Lemma 19, we get h j [ p ′ ] ≠ h j ′ [ p ′ ] h_j[p'] \ne h_{j'}[p'] h j [ p ′ ] = h j ′ [ p ′ ] . Since this holds for all p ′ ∈ J p' \in J p ′ ∈ J and all j , j ′ ∈ [ s ] j,j' \in[s] j , j ′ ∈ [ s ] with a ^ j r [ p ′ ] ≠ a ^ j ′ r [ p ′ ] \hat{a}^r_j[p'] \ne\hat{a}^r_{j'}[p'] a ^ j r [ p ′ ] = a ^ j ′ r [ p ′ ] , it follows that h ˉ \bar{h} h ˉ satisfies χ ϕ , p , λ \chi_{\phi,p,\lambda} χ ϕ , p , λ . Assume now that no a ^ r \hat{a}^r a ^ r satisfies χ ϕ , p , λ \chi_{\phi,p,\lambda} χ ϕ , p , λ . Define a relation P ϕ , p , λ : = pr R ^ ϕ ∩ χ ϕ , p , λ P_{\phi,p,\lambda} := \operatorname{pr}_{\hat{R}_{\phi} \cap\chi_{\phi,p,\lambda}} P ϕ , p , λ := pr R ^ ϕ ∩ χ ϕ , p , λ . All a ^ r [ p ] \hat{a}^r[p] a ^ r [ p ] are in P ϕ , p , λ P_{\phi,p,\lambda} P ϕ , p , λ . Since ψ ϕ , p , λ \psi_{\phi,p,\lambda} ψ ϕ , p , λ is a conjunction of equalities, the relation ψ ϕ , p , λ \psi_{\phi,p,\lambda} ψ ϕ , p , λ is preserved by t p t_p t p , which is either mi \operatorname{mi} mi or min \min min . It follows that h ˉ [ p ] = G p ( a ^ 1 [ p ] , … , a ^ q [ p ] ) ∈ P ϕ , p , λ \bar{h}[p] = G_p(\hat{a}^1[p],\ldots,\hat{a}^q[p]) \in P_{\phi,p,\lambda} h ˉ [ p ] = G p ( a ^ 1 [ p ] , … , a ^ q [ p ]) ∈ P ϕ , p , λ , i.e., that h ˉ \bar{h} h ˉ satisfies ψ ϕ , p , λ \psi_{\phi,p,\lambda} ψ ϕ , p , λ .
Putting this together, we get h ˉ ∈ R ^ ϕ \bar{h} \in\hat{R}_{\phi} h ˉ ∈ R ^ ϕ , which implies, by construction, that f ( a 1 , … , a q ) ∈ ϕ c B f(a^1,\ldots,a^q) \in\phi^{\mathcal{B}}_c f ( a 1 , … , a q ) ∈ ϕ c B , showing that f f f preserves each constraint ϕ ∈ Φ \phi\in\Phi ϕ ∈ Φ on c c c -coloured ( b 1 , … , b t ) (b_1,\ldots,b_t) ( b 1 , … , b t ) -palette tuples. Since t , b 1 , … , b t t,b_1,\ldots,b_t t , b 1 , … , b t were chosen arbitrarily, we can apply Theorem 21 and get a solution of the instance I ′ \mathcal{I}' I ′ of CSP( B c ) (\mathcal{B}_c) ( B c ) , where I ′ \mathcal{I}' I ′ has domain A A A and is constructed from I \mathcal{I} I by replacing each constraint ϕ \phi ϕ by ϕ c \phi_c ϕ c , which corresponds to the determined colours c c c . Since each variable is assigned a value in B B B with colour according to c c c , this homomorphism is also a solution of I \mathcal{I} I for CSP( B ) (\mathcal{B}) ( B ) .
Proposition 22 (Correctness). Let B \mathcal{B} B be a relational structure satisfying the conditions of (6) from Theorem 8. Then the algorithm described in § 3.2 decides CSP( B ) (\mathcal{B}) ( B ) .
Proof. Let I \mathcal{I} I be an instance of CSP( B ) (\mathcal{B}) ( B ) . If a solution exists, i.e., a homomorphism s : A → B s \colon A \to B s : A → B , then, since ∣ A ∣ = n |A| = n ∣ A ∣ = n , we can use automorphisms of B \mathcal{B} B to move s ( A ) s(A) s ( A ) into the sample S S S on which the algorithm operates. By construction, no values occurring in s ( A ) s(\mathcal{A}) s ( A ) will be deleted from any set of the tuber system, so the algorithm accepts.
Assume now the algorithm accepts A \mathcal{A} A as an instance of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) . By Proposition 14 , there is a colour-determined CSAC tuber system of A \mathcal{A} A , and Lemma 15 then gives a solution of A \mathcal{A} A .
Fixed-Point Implementation
The algorithm described in Section 3.2 has a uniform logical implementation in F P ∗ \mathrm{FP}^{*} FP ∗ . Fix a structure B \mathcal{B} B which is finite-on-top-of-temporal. We will specify an F P ∗ \mathrm{FP}^{*} FP ∗ sentence Ψ \Psi Ψ such that a given finite structure A \mathcal{A} A satisfies Ψ \Psi Ψ if and only if A \mathcal{A} A has a homomorphism to B \mathcal{B} B . A fixed first-order sentence handles inputs with fewer than M ≥ k M \ge k M ≥ k elements; this allows each colour to be represented by one numerical variable on the remaining inputs. The sentence Ψ \Psi Ψ has three nested fixed points to perform AC deletions, singleton tests for CSAC, and colour-pair tests, respectively. We will first define Ψ \Psi Ψ and then prove that it has the required properties.
Let σ \sigma σ be the signature of B \mathcal{B} B . Let r R r_R r R be the arity of R ∈ σ R \in\sigma R ∈ σ , and put J = { R ∈ σ : r R > 0 } ∪ { ρ } \mathcal{J} = \{R \in\sigma: r_R > 0\} \cup\{\rho\} J = { R ∈ σ : r R > 0 } ∪ { ρ } , where ρ \rho ρ labels the auxiliary pair constraints and r ρ = 2 r_\rho= 2 r ρ = 2 . Fix a bijection ℓ : J → [ ∣ J ∣ ] \ell: \mathcal{J} \to[|\mathcal{J}|] ℓ : J → [ ∣ J ∣ ] . Define M : = max { k , ∣ J ∣ } M := \max\{k, |\mathcal{J}|\} M := max { k , ∣ J ∣ } .
Define the numerical first-order formulas
ν 0 ( q ) : = ¬ ∃ p ( p < q ) , \nu_0(q) := \neg\exists p\,(p < q), ν 0 ( q ) := ¬∃ p ( p < q ) ,
ν i + 1 ( q ) : = ∃ p ( ν i ( p ) ∧ p < q ∧ ¬ ∃ s ( p < s ∧ s < q ) ) ( 0 ≤ i < M ) . \nu_{i+1}(q) := \exists p\,(\nu_i(p) \wedge p < q \wedge\neg\exists s\,(p < s \wedge s < q)) \qquad(0 \le i < M). ν i + 1 ( q ) := ∃ p ( ν i ( p ) ∧ p < q ∧ ¬∃ s ( p < s ∧ s < q )) ( 0 ≤ i < M ) .
Thus, ν i \nu_i ν i defines the number i i i whenever it is present, and L a r g e : = ∃ q ν M ( q ) \mathrm{Large} := \exists q\,\nu_M(q) Large := ∃ q ν M ( q ) tests whether the input has at least M M M elements.
Let F \mathcal{F} F be the finite set of all σ \sigma σ -structures on { 1 , … , t } \{1,\ldots,t\} { 1 , … , t } , for integers 0 ≤ t < M 0 \le t < M 0 ≤ t < M , that admit a homomorphism to B \mathcal{B} B . For each F ∈ F \mathcal{F} \in\mathcal{F} F ∈ F , let θ F \theta_{\mathcal{F}} θ F be the first-order sentence asserting that the input is isomorphic to F \mathcal{F} F : existentially name all its elements, assert that they are distinct and exhaust the universe, and specify the truth value of every relation tuple. Put κ B : = ⋁ F ∈ F θ F \kappa_{\mathcal{B}} := \bigvee_{\mathcal{F}\in\mathcal{F}}\theta_{\mathcal{F}} κ B := ⋁ F ∈ F θ F . This fixed first-order sentence handles all inputs with fewer than M M M elements.
For the remaining inputs, a value code v = ( c , p ) v = (c,p) v = ( c , p ) consists of one numerical variable c c c for its colour and one numerical variable p p p for its rank . Define Value ( c , p ) : = ⋁ a ∈ [ k ] ν a ( c ) ∧ ¬ ν 0 ( p ) \operatorname{Value}(c,p) := \bigvee_{a\in[k]} \nu_a(c) \wedge\neg\nu_0(p) Value ( c , p ) := ⋁ a ∈ [ k ] ν a ( c ) ∧ ¬ ν 0 ( p ) .
It is easy to see that the expansion of D k \mathcal{D}_k D k by the unary relations C 1 , … , C k C_1,\ldots,C_k C 1 , … , C k is homogeneous, and therefore has quantifier elimination , i.e., for each R ∈ σ R \in\sigma R ∈ σ of positive arity there exists a quantifier-free definition χ R \chi_R χ R of R B R^{\mathcal{B}} R B in ( D k , C 1 , … , C k ) (\mathcal{D}_k,C_1,\ldots,C_k) ( D k , C 1 , … , C k ) . Translate it into a numerical formula χ R # ( v 1 , … , v r R ) \chi_R^{\#}(v_1,\ldots,v_{r_R}) χ R # ( v 1 , … , v r R ) as follows. Equality becomes equality of value codes, ∼ \sim ∼ becomes equality of colour variables, C a C_a C a becomes Col a \operatorname{Col}_a Col a , and < a <_{a} < a becomes equality of both colours to a a a together with the numerical comparison of ranks.
We encode the constraint lists of a tuber system, including the auxiliary pair constraints ψ x γ \psi_{x\gamma} ψ x γ from Section 3.2. Throughout this section, L x L_x L x abbreviates pr x ( L ψ x γ ) \operatorname{pr}_x(L_{\psi_{x\gamma}}) pr x ( L ψ x γ ) . Thus, a non-empty system is AC precisely when pr x ( L ϕ ) = L x \operatorname{pr}_x(L_\phi)=L_x pr x ( L ϕ ) = L x for every constraint ϕ \phi ϕ containing x x x . Testing every constraint tuple also tests every variable value, since pinning ( a , a ) (a,a) ( a , a ) in L ψ x x L_{\psi_{xx}} L ψ xx pins x x x to a a a . The outer tests will pin individual tuples of the pair constraints and run CSAC on the resulting system.
For the translation of colour predicates, put Col a ( c , p ) : = ν a ( c ) \operatorname{Col}_a(c,p) := \nu_a(c) Col a ( c , p ) := ν a ( c ) for a ∈ [ k ] a \in[k] a ∈ [ k ] ; thus Value ( c , p ) \operatorname{Value}(c,p) Value ( c , p ) is ( ⋁ a ∈ [ k ] ν a ( c ) ) ∧ ¬ ν 0 ( p ) (\bigvee_{a\in[k]} \nu_a(c)) \wedge\neg\nu_0(p) ( ⋁ a ∈ [ k ] ν a ( c )) ∧ ¬ ν 0 ( p ) . All of these choices depend only on B \mathcal{B} B .
Put m = max j ∈ J r j m = \max_{j\in\mathcal{J}} r_j m = max j ∈ J r j . For R ∈ J ∩ σ R \in\mathcal{J}\cap\sigma R ∈ J ∩ σ , let I R ( x 1 , … , x r R ) I_R(x_1,\ldots,x_{r_R}) I R ( x 1 , … , x r R ) be R ( x 1 , … , x r R ) R(x_1,\ldots,x_{r_R}) R ( x 1 , … , x r R ) ; put I ρ = ⊤ I_\rho= \top I ρ = ⊤ and χ ρ # = ⊤ \chi_\rho^{\#} = \top χ ρ # = ⊤ . A label is represented by one numerical variable λ \lambda λ , using Lab j ( λ ) : = ν ℓ ( j ) ( λ ) \operatorname{Lab}_j(\lambda) := \nu_{\ell(j)}(\lambda) Lab j ( λ ) := ν ℓ ( j ) ( λ ) . A constraint code is a tuple α = ( λ , x ) \alpha= (\lambda,\mathbf{x}) α = ( λ , x ) , where x = ( x 1 , … , x m ) \mathbf{x} = (x_1,\ldots,x_m) x = ( x 1 , … , x m ) consists of input variables. A tuple code is t = ( α , v ) t=(\alpha,\mathbf{v}) t = ( α , v ) , where v = ( v 1 , … , v m ) \mathbf{v}=(v_1,\ldots,v_m) v = ( v 1 , … , v m ) consists of value-code blocks. The following formulas describe the constraints and their initial lists:
Con ( λ , x ) : = ⋁ j ∈ J ( Lab j ( λ ) ∧ I j ( x 1 , … , x r j ) ∧ ⋀ r j < i ≤ m x i = x 1 ) . \operatorname{Con}(\lambda,\mathbf{x}) := \bigvee_{j\in\mathcal{J}}\left(\operatorname{Lab}_j(\lambda)\land I_j(x_1,\ldots,x_{r_j})\land\bigwedge_{r_j<i\leq m}x_i=x_1\right). Con ( λ , x ) := j ∈ J ⋁ Lab j ( λ ) ∧ I j ( x 1 , … , x r j ) ∧ r j < i ≤ m ⋀ x i = x 1 .
Tup ( λ , x , v ) : = Con ( λ , x ) ∧ ⋀ i ∈ [ m ] Value ( v i ) \operatorname{Tup}(\lambda,\mathbf{x},\mathbf{v}) := \operatorname{Con}(\lambda,\mathbf{x})\land\bigwedge_{i\in[m]}\operatorname{Value}(v_i) Tup ( λ , x , v ) := Con ( λ , x ) ∧ i ∈ [ m ] ⋀ Value ( v i )
∧ ⋀ i , j ∈ [ m ] ( x i = x j → v i = v j ) {}\land\bigwedge_{i,j\in[m]}(x_i=x_j\to v_i=v_j) ∧ i , j ∈ [ m ] ⋀ ( x i = x j → v i = v j )
∧ ⋁ j ∈ J ( Lab j ( λ ) ∧ χ λ # ( v 1 , … , v r j ) ) . {}\land\bigvee_{j\in\mathcal{J}}\left(\operatorname{Lab}_j(\lambda)\land\chi^\#_\lambda(v_1,\ldots,v_{r_j})\right). ∧ j ∈ J ⋁ ( Lab j ( λ ) ∧ χ λ # ( v 1 , … , v r j ) ) .
Positions beyond the arity of a constraint repeat x 1 x_1 x 1 and its value. The equality implications also ensure that repeated variables receive equal values. In particular, the initial list of ψ x x \psi_{xx} ψ xx consists exactly of the diagonal pairs. Each tuple on the distinct variables of a constraint has a unique code. The formula Con \operatorname{Con} Con is independent of Tup \operatorname{Tup} Tup , so an initially empty constraint list still has a constraint code.
In what follows, t , u t,u t , u denote tuples of code variables, α \alpha α a tuple of constraint-code variables, x x x an input variable, and v v v a value-code block. Expressions such as α ( t ) \alpha(t) α ( t ) , x i ( t ) x_i(t) x i ( t ) and v i ( t ) v_i(t) v i ( t ) abbreviate the corresponding blocks of variables. Define
At ( α , t ) : = Tup ( t ) ∧ α = α ( t ) , \operatorname{At}(\alpha,t):=\operatorname{Tup}(t)\land\alpha=\alpha(t), At ( α , t ) := Tup ( t ) ∧ α = α ( t ) ,
Inc ( α , x ) : = Con ( α ) ∧ ⋁ i ∈ [ m ] x = x i ( α ) , \operatorname{Inc}(\alpha,x):=\operatorname{Con}(\alpha)\land\bigvee_{i\in[m]}x=x_i(\alpha), Inc ( α , x ) := Con ( α ) ∧ i ∈ [ m ] ⋁ x = x i ( α ) ,
Val ( t , x , v ) : = Tup ( t ) ∧ ⋁ i ∈ [ m ] ( x = x i ( t ) ∧ v = v i ( t ) ) , \operatorname{Val}(t,x,v):=\operatorname{Tup}(t)\land\bigvee_{i\in[m]}(x=x_i(t)\land v=v_i(t)), Val ( t , x , v ) := Tup ( t ) ∧ i ∈ [ m ] ⋁ ( x = x i ( t ) ∧ v = v i ( t )) ,
Pair ( t ) : = Tup ( t ) ∧ Lab ρ ( λ ( t ) ) . \operatorname{Pair}(t):=\operatorname{Tup}(t)\land\operatorname{Lab}_{\rho}(\lambda(t)). Pair ( t ) := Tup ( t ) ∧ Lab ρ ( λ ( t )) .
Tuple equalities are coordinatewise. Quantifiers over codes abbreviate quantification over their input and numerical variables.
Let D D D be a relation variable with the argument places of a tuple code; it records the deleted tuples. Put
Reject ( D ) : = ∃ α ( Con ( α ) ∧ ∀ t ( At ( α , t ) → D ( t ) ) ) , \operatorname{Reject}(D):=\exists\alpha\left(\operatorname{Con}(\alpha)\land\forall t\left(\operatorname{At}(\alpha,t)\to D(t)\right)\right), Reject ( D ) := ∃ α ( Con ( α ) ∧ ∀ t ( At ( α , t ) → D ( t ) ) ) ,
Bad ( D , t ) : = Tup ( t ) ∧ ∃ x ∃ v ∃ α ( Val ( t , x , v ) ∧ Inc ( α , x ) \operatorname{Bad}(D,t):=\operatorname{Tup}(t)\land\exists x\exists v\exists\alpha\left(\operatorname{Val}(t,x,v)\land\operatorname{Inc}(\alpha,x)
\right. Bad ( D , t ) := Tup ( t ) ∧ ∃ x ∃ v ∃ α ( Val ( t , x , v ) ∧ Inc ( α , x )
∧ ∀ u ( ( At ( α , u ) ∧ Val ( u , x , v ) ) → D ( u ) ) ) . \left.
{}\land\forall u\left((\operatorname{At}(\alpha,u)\land\operatorname{Val}(u,x,v))\to D(u)\right)\right). ∧ ∀ u ( ( At ( α , u ) ∧ Val ( u , x , v )) → D ( u ) ) ) .
The first formula detects an empty remaining constraint list, including one that was empty initially. The second detects a tuple whose value at some variable has no support in another constraint list containing that variable. The diagonal pair constraints supply all the information otherwise stored in variable lists.
For tuple-code variables t , u t,u t , u , define
P t ( u ) : = Tup ( t ) ∧ Tup ( u ) ∧ α ( t ) = α ( u ) ∧ u ≠ t . P_t(u):=\operatorname{Tup}(t)\land\operatorname{Tup}(u)\land\alpha(t)=\alpha(u)\land u\ne t. P t ( u ) := Tup ( t ) ∧ Tup ( u ) ∧ α ( t ) = α ( u ) ∧ u = t .
Adding P t P_t P t to the deletion set restricts the constraint list containing t t t to that tuple. If t t t has already been deleted, the resulting list is empty. For a formula F F F with a deletion-predicate parameter and a formula θ \theta θ on tuple codes, F [ θ ] F[\theta] F [ θ ] denotes substitution for that parameter, with bound variables renamed to avoid capture. The same convention applies to Reject ( θ ) \operatorname{Reject}(\theta) Reject ( θ ) .
For example, Z ∨ P t Z \lor P_t Z ∨ P t means w ↦ Z ( w ) ∨ P t ( w ) w \mapsto Z(w) \lor P_t(w) w ↦ Z ( w ) ∨ P t ( w ) , with w w w fresh. Pinning parameters remain free in the inner fixed points.
With Z Z Z a relation variable of the same arity as D D D , define
A [ D ] ( t ) : = [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ Bad ( Z , u ) ) ] ( t ) . (2) \mathcal{A}[D](t) := [\operatorname{lfp}_{Z,u}(D(u) \lor Z(u) \lor\operatorname{Bad}(Z,u))](t). \tag*{(2)} A [ D ] ( t ) := [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ Bad ( Z , u ))] ( t ) . (2)
This formula performs the deletions needed for AC. Testing each tuple of every constraint list gives
C [ D ] ( t ) : = [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ A [ Z ] ( u ) ∨ ( Tup ( u ) ∧ Reject ( A [ Z ∨ P u ] ) ) ) ] ( t ) . (3) \mathcal{C}[D](t) := [\operatorname{lfp}_{Z,u}(D(u) \lor Z(u) \lor\mathcal{A}[Z](u) \lor(\operatorname{Tup}(u) \land\operatorname{Reject}(\mathcal{A}[Z \lor P_u])))](t). \tag*{(3)} C [ D ] ( t ) := [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ A [ Z ] ( u ) ∨ ( Tup ( u ) ∧ Reject ( A [ Z ∨ P u ])))] ( t ) . (3)
Finally, test each tuple of each auxiliary pair constraint by running CSAC after pinning that tuple:
O [ D ] ( t ) : = [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ C [ Z ] ( u ) ∨ ( Pair ( u ) ∧ Reject ( C [ Z ∨ P u ] ) ) ) ] ( t ) . (4) \mathcal{O}[D](t) := [\operatorname{lfp}_{Z,u}(D(u) \lor Z(u) \lor\mathcal{C}[Z](u) \lor(\operatorname{Pair}(u) \land\operatorname{Reject}(\mathcal{C}[Z \lor P_u])))](t). \tag*{(4)} O [ D ] ( t ) := [ lfp Z , u ( D ( u ) ∨ Z ( u ) ∨ C [ Z ] ( u ) ∨ ( Pair ( u ) ∧ Reject ( C [ Z ∨ P u ])))] ( t ) . (4)
All deletion predicates occur positively. Since the code lengths and the sets of labels are fixed, these are F P ∗ \mathrm{FP}^{*} FP ∗ formulas. They implement the three levels of deletion in § 3.2 , with all currently justified deletions performed in parallel. Define
Ψ : = κ B ∨ ( Large ∧ ¬ Reject ( O [ ⊥ ] ) ) , (5) \Psi:= \kappa_{\mathcal{B}} \lor(\operatorname{Large} \land\neg\operatorname{Reject}(\mathcal{O}[\bot])), \tag*{(5)} Ψ := κ B ∨ ( Large ∧ ¬ Reject ( O [ ⊥ ])) , (5)
where ⊥ \bot ⊥ is the always-false predicate on tuple codes. Expanding the abbreviations yields a closed F P ∗ \mathrm{FP}^{*} FP ∗ sentence in signature σ \sigma σ . It uses neither counting terms nor an order on input elements.
Proposition 23. Under conditions (a) and (b), for every finite σ \sigma σ -structure A \mathcal{A} A , A ⊨ Ψ \mathcal{A} \models\Psi A ⊨ Ψ if and only if there is a homomorphism A → B \mathcal{A} \to\mathcal{B} A → B . In particular, CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is definable in F P ∗ \mathrm{FP}^{*} FP ∗ .
Proof. Write n = ∣ A ∣ n = \lvert\mathcal{A} \rvert n = ∣ A ∣ . If n < M n < M n < M , then Large is false and the definition of κ B \kappa_{\mathcal{B}} κ B proves the assertion, including for the empty input. Suppose n ≥ M n \ge M n ≥ M . Then Large is true and κ B \kappa_{\mathcal{B}} κ B is false.
The number sort N n = { 0 , … , n } N_n = \{0,\ldots,n\} N n = { 0 , … , n } contains every colour and label code. Value codes represent the sample S = [ k ] × [ n ] S = [k] \times[n] S = [ k ] × [ n ] , and χ R # \chi^{\#}_{R} χ R # defines R B ∩ S r R R^{\mathcal{B}} \cap S^{r_R} R B ∩ S r R . Consequently, Con and Tup encode the constraints of A \mathcal{A} A , including the auxiliary pair constraints, and their initial lists L φ 0 L^0_{\varphi} L φ 0 , with nullary constraints omitted. Let Θ \Theta Θ be this set of constraints, including all ψ x y \psi_{xy} ψ x y for x , y ∈ A x,y \in A x , y ∈ A . Identify the set of tuple codes with U = { ( φ , a ) : φ ∈ Θ , a ∈ L φ 0 } \mathcal{U} = \{(\varphi,a) : \varphi\in\Theta,\ a \in L^0_{\varphi}\} U = {( φ , a ) : φ ∈ Θ , a ∈ L φ 0 } . For D ⊆ U D \subseteq\mathcal{U} D ⊆ U , write L φ D = { a ∈ L φ 0 : ( φ , a ) ∉ D } L^D_{\varphi} = \{a \in L^0_{\varphi} : (\varphi,a) \notin D\} L φ D = { a ∈ L φ 0 : ( φ , a ) ∈ / D } and L x D = pr x ( L ψ x x D ) L^D_x = \operatorname{pr}_x(L^D_{\psi_{xx}}) L x D = pr x ( L ψ xx D ) . We identify the formulas with the relations they define on these codes.
Every non-empty AC subsystem of L D L^D L D survives the deletions in A [ D ] \mathcal{A}[D] A [ D ] , since it supplies a support for each of its tuples in every incident constraint list. Conversely, if ¬ Reject ( A [ D ] ) \neg\operatorname{Reject}(\mathcal{A}[D]) ¬ Reject ( A [ D ]) , no remaining tuple is unsupported. The projections of all constraint lists containing x x x therefore agree, and equal the projection of the diagonal list L ψ x x A [ D ] L^{\mathcal{A}[D]}_{\psi_{xx}} L ψ xx A [ D ] . Thus L A [ D ] L^{\mathcal{A}[D]} L A [ D ] is AC. It is the greatest non-empty AC subsystem of L D L^D L D ; rejection occurs precisely when no such subsystem exists.
Similarly, every non-empty CSAC subsystem K ⊆ L D K \subseteq L^D K ⊆ L D survives C [ D ] \mathcal{C}[D] C [ D ] . AC deletions preserve K K K , and an AC-certificate in K K K for a tuple t t t prevents rejection after adding P t P_t P t . Conversely, put Z = C [ D ] Z = \mathcal{C}[D] Z = C [ D ] and suppose ¬ Reject ( Z ) \neg\operatorname{Reject}(Z) ¬ Reject ( Z ) . Closure gives A [ Z ] = Z \mathcal{A}[Z] = Z A [ Z ] = Z , so L Z L^Z L Z is AC. For each surviving tuple code t t t , closure also gives ¬ Reject ( A [ Z ∨ P t ] ) \neg\operatorname{Reject}(\mathcal{A}[Z \lor P_t]) ¬ Reject ( A [ Z ∨ P t ]) . The preceding paragraph supplies a non-empty AC subsystem of L Z L^{\mathcal{Z}} L Z whose list at α ( t ) \alpha(t) α ( t ) consists only of the tuple coded by t t t . Hence L Z L^{\mathcal{Z}} L Z is CSAC. Certificates for variable values follow by applying this observation to diagonal pair tuples. Thus C [ D ] C[D] C [ D ] leaves the greatest non-empty CSAC subsystem, or rejects if none exists.
Suppose first that a homomorphism A → B \mathcal{A} \to\mathcal{B} A → B exists. By sampling, there is one, say h h h , whose image lies in S S S . Let K ϕ K_{\phi} K ϕ contain the tuple assigned by h h h to the variables of ϕ \phi ϕ , for each ϕ ∈ Θ \phi\in\Theta ϕ ∈ Θ . This defines a non-empty CSAC subsystem of L D L^{\mathcal{D}} L D . By induction, none of its tuples is deleted at any stage of O [ ⊥ ] O[\perp] O [ ⊥ ] . Indeed, CSAC deletions preserve K K K . If a pair tuple t t t belongs to K K K , pinning t t t also preserves K K K , which witnesses that the ensuing CSAC test cannot reject. Every list therefore retains its tuple from h h h , and A ⊨ Ψ \mathcal{A} \models\Psi A ⊨ Ψ .
Conversely, suppose A ⊨ Ψ \mathcal{A} \models\Psi A ⊨ Ψ , and put D ∗ = O [ ⊥ ] D_* = O[\perp] D ∗ = O [ ⊥ ] and L = L D ∗ L = L^{D_*} L = L D ∗ . Then ¬ Reject ( D ∗ ) \neg\operatorname{Reject}(D_*) ¬ Reject ( D ∗ ) and C [ D ∗ ] = D ∗ C[D_*] = D_* C [ D ∗ ] = D ∗ , so L L L is a finite non-empty CSAC tuber system. For every x , y ∈ A x,y \in A x , y ∈ A and a ∈ L ψ x y a \in L_{\psi_{xy}} a ∈ L ψ x y , let t t t code ( ψ x y , a ) (\psi_{xy},a) ( ψ x y , a ) . Since t t t survives and Pair ( t ) \operatorname{Pair}(t) Pair ( t ) holds, the outer fixed-point equation implies ¬ Reject ( C [ D ∗ ∨ P t ] ) \neg\operatorname{Reject}(C[D_* \vee P_t]) ¬ Reject ( C [ D ∗ ∨ P t ]) . Its remaining constraint lists form a finite non-empty CSAC subsystem K ≤ L K \leq L K ≤ L with K ψ x y = { a } K_{\psi_{xy}} = \{a\} K ψ x y = { a } . Thus
for every x , y ∈ A and a ∈ L ψ x y , there is a finite \text{for every }x,y \in A\text{ and }a \in L_{\psi_{xy}},\text{ there is a finite} for every x , y ∈ A and a ∈ L ψ x y , there is a finite
non-empty CSAC subsystem K ≤ L with K ψ x y = { a } . (6) \text{non-empty CSAC subsystem }K \leq L\text{ with }K_{\psi_{xy}} = \{a\}. \tag*{(6)} non-empty CSAC subsystem K ≤ L with K ψ x y = { a } . (6)
With the variable lists read from the diagonal constraints, this is exactly the certificate property used in the proof of Proposition 14. That proof applies to L L L and yields a finite non-empty colour-determined CSAC tuber system. Lemma 15 then gives a homomorphism A → B \mathcal{A} \to\mathcal{B} A → B . ◀
Obstructions and the Classification
In this section we show that the CSP of a structure that does not satisfy one of the conditions in (4) of Theorem 8 is inexpressible in FPC, and then finish the proof of Theorem 7 and Theorem 8.
Lemma 24. Let B \mathcal{B} B be finite-on-top-of-temporal, let i ∈ [ k ] i \in[k] i ∈ [ k ] , and let t : C i 2 → C i t: C_i^2 \to C_i t : C i 2 → C i . Then t ∈ { f ∣ C i ∣ f ∈ Pol ( B ) } t \in\{f|_{C_i} \mid f \in\operatorname{Pol}(\mathcal{B})\} t ∈ { f ∣ C i ∣ f ∈ Pol ( B )} if and only if there exists a binary f ∈ Pol ( B ) f \in\operatorname{Pol}(\mathcal{B}) f ∈ Pol ( B ) and an embedding e : C i ↪ C i e: C_i \hookrightarrow C_i e : C i ↪ C i such that f ∣ C i 2 = e ∘ t f|_{C_i^2} = e \circ t f ∣ C i 2 = e ∘ t .
Proof. Suppose first that f ∈ Pol ( B ) f \in\operatorname{Pol}(\mathcal{B}) f ∈ Pol ( B ) is such that f ∣ C i 2 = e ∘ t f|_{C_i^2} = e \circ t f ∣ C i 2 = e ∘ t , and let F ⊆ C i 2 F \subseteq C_i^2 F ⊆ C i 2 be finite. The map sending e ( a ) e(a) e ( a ) to a a a for a ∈ t ( F ) a \in t(F) a ∈ t ( F ) is a finite partial automorphism of ( C i ; < i ) (C_i; <_i) ( C i ; < i ) . Extend it to an automorphism of this order, and act as the identity on the other colours. The resulting map α \alpha α is an automorphism of D k \mathcal{D}_k D k , hence of B \mathcal{B} B . Thus α ∘ f \alpha\circ f α ∘ f agrees with t t t on F F F , proving that t ∈ { f ∣ C i ∣ f ∈ Pol ( B ) } t \in\{f|_{C_i} \mid f \in\operatorname{Pol}(\mathcal{B})\} t ∈ { f ∣ C i ∣ f ∈ Pol ( B )} .
Conversely, suppose t ∈ { f ∣ C i ∣ f ∈ Pol ( B ) } t \in\{f|_{C_i} \mid f \in\operatorname{Pol}(\mathcal{B})\} t ∈ { f ∣ C i ∣ f ∈ Pol ( B )} . Take the elementary diagram of B \mathcal{B} B , using constants c a c_a c a for a ∈ B a \in B a ∈ B , i.e., the set of all first-order sentences that hold in the expansion of B \mathcal{B} B with the additional constants c a c_a c a for a ∈ B a \in B a ∈ B . Then further expand the signature by fresh constant symbols z ( a , b ) z_{(a,b)} z ( a , b ) , one for every ( a , b ) ∈ B 2 (a,b) \in B^2 ( a , b ) ∈ B 2 . For every basic r r r -ary relation R R R and all ( a 1 , … , a r ) , ( b 1 , … , b r ) ∈ R B (a_1,\ldots,a_r),(b_1,\ldots,b_r) \in R^{\mathcal{B}} ( a 1 , … , a r ) , ( b 1 , … , b r ) ∈ R B , add R ( z ( a 1 , b 1 ) , … , z ( a r , b r ) ) . R(z_{(a_1,b_1)},\ldots,z_{(a_r,b_r)}). R ( z ( a 1 , b 1 ) , … , z ( a r , b r ) ) . Also add z ( a , b ) = c t ( a , b ) z_{(a,b)} = c_{t(a,b)} z ( a , b ) = c t ( a , b ) for all a , b ∈ C i a,b \in C_i a , b ∈ C i . Let T T T be the resulting set of first-order sentences. Every finite subset of T T T is satisfiable in B \mathcal{B} B : interpret the c a c_a c a by a a a and the z ( a , b ) z_{(a,b)} z ( a , b ) using a global polymorphism whose restriction agrees with t t t at the finitely many specified pairs. A standard model theory argument using Compactness and downward Löwenheim–Skolem therefore give a countable model M \mathcal{M} M of T T T (see, e.g., [20 ] ). Its reduct to the signature of B \mathcal{B} B is isomorphic to B \mathcal{B} B by ω \omega ω -categoricity of B \mathcal{B} B . Fix such an isomorphism h h h , and define f ( a , b ) = h ( z ( a , b ) M ) f(a,b) = h(z^{\mathcal{M}}_{(a,b)}) f ( a , b ) = h ( z ( a , b ) M ) and e ( a ) = h ( c a M ) e(a) = h(c_{a}^{\mathcal{M}}) e ( a ) = h ( c a M ) for a ∈ C i a \in C_i a ∈ C i . The relation-preservation sentences make f f f a polymorphism of B \mathcal{B} B . The elementary diagram makes e e e an increasing embedding into C i C_i C i , and the added equalities give f ∣ C i 2 = e ∘ t f|_{C_i^2} = e \circ t f ∣ C i 2 = e ∘ t .
Proposition 25 ([1], [12, Theorem 2.7, Proposition 2.8]). Let B \mathcal{B} B and C \mathcal{C} C be structures with finite relational signatures such that B \mathcal{B} B is pp-constructible from C \mathcal{C} C . If CSP ( C ) \operatorname{CSP}(\mathcal{C}) CSP ( C ) is expressible in FPC, then CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is expressible in FPC.
Proposition 26. Let B \mathcal{B} B be finite-on-top-of-temporal which does not satisfy one of the conditions in Theorem 8. Then B \mathcal{B} B pp-constructs X \mathcal{X} X or some finite affine structure, and CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is inexpressible in FPC.
Proof. Assume first that B \mathcal{B} B does not satisfy condition (a) for i ∈ [ k ] i \in[k] i ∈ [ k ] . By Lemma 24, we get that C i : = { f ∣ C i ∣ f ∈ Pol ( B ) } C_i := \{f|_{C_i} \mid f \in\operatorname{Pol}(\mathcal{B})\} C i := { f ∣ C i ∣ f ∈ Pol ( B )} contains no operation from T \mathcal{T} T . Note that ( C i ; < i ) ≅ ( Q ; < ) (C_i; <_i) \cong(\mathbb{Q}; <) ( C i ; < i ) ≅ ( Q ; < ) , and that every automorphism of ( C i ; < i ) (C_i; <_i) ( C i ; < i ) can be extended to an automorphism of B \mathcal{B} B . Hence, after appropriately identifying C i C_i C i with Q \mathbb{Q} Q we obtain Aut ( Q ; < ) ⊆ C i \operatorname{Aut}(\mathbb{Q}; <) \subseteq C_i Aut ( Q ; < ) ⊆ C i , and since C i C_i C i is locally closed, Pol ( Q ; Inv ( C i ) ) = C i \operatorname{Pol}(\mathbb{Q}; \operatorname{Inv}(C_i)) = C_i Pol ( Q ; Inv ( C i )) = C i . Since for each t ∈ T t \in\mathcal{T} t ∈ T we have t ∉ C i t \notin C_i t ∈ / C i , there is some R t ∈ Inv ( C i ) R_t \in\operatorname{Inv}(C_i) R t ∈ Inv ( C i ) such that R t R_t R t is not preserved by t t t . We take G : = ( Q ; < , ( R t ) t ∈ T ) \mathcal{G} := (\mathbb{Q}; <, (R_t)_{t \in\mathcal{T}}) G := ( Q ; < , ( R t ) t ∈ T ) . This G \mathcal{G} G is a temporal structure with finite signature and no polymorphism from T \mathcal{T} T . By Theorem 10 , it pp-constructs X \mathcal{X} X or ( { 0 , 1 } ; 1 I N 3 ) (\{0,1\}; 1\mathrm{IN}3) ({ 0 , 1 } ; 1 IN 3 ) , and CSP ( G ) \operatorname{CSP}(\mathcal{G}) CSP ( G ) is inexpressible in FPC. For every relation R R R of G \mathcal{G} G , the relation R ( i ) : = { ( ( i , a 1 ) , … , ( i , a r ) ) ∣ ( a 1 , … , a r ) ∈ R } R^{(i)} := \{((i,a_1),\ldots,(i,a_r)) \mid(a_1,\ldots,a_r) \in R\} R ( i ) := {(( i , a 1 ) , … , ( i , a r )) ∣ ( a 1 , … , a r ) ∈ R } is preserved by all polymorphisms of B \mathcal{B} B and hence is pp-definable in B \mathcal{B} B . We obtain a pp-construction of G \mathcal{G} G in B \mathcal{B} B . Proposition 25 implies that CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is inexpressible in FPC. By transitivity of pp-constructions, B \mathcal{B} B pp-constructs either X \mathcal{X} X or ( { 0 , 1 } ; 1 I N 3 ) (\{0,1\}; 1\mathrm{IN}3) ({ 0 , 1 } ; 1 IN 3 ) . In the former case, we are done. In the latter case, by [4 Theorem 3.2.2] , it also constructs a finite affine structure.
Assume now that B \mathcal{B} B does not satisfy condition (b), i.e., there are no g 1 , g 2 ∈ Pol ( B ) g_1,g_2 \in\operatorname{Pol}(\mathcal{B}) g 1 , g 2 ∈ Pol ( B ) such that g ~ 1 , g ~ 2 \widetilde{g}_1,\widetilde{g}_2 g 1 , g 2 are 3-4 weak near-unanimity operations. We write C : = { f ~ ∣ f ∈ Pol ( B ) } C := \{\widetilde{f} \mid f \in\operatorname{Pol}(\mathcal{B})\} C := { f ∣ f ∈ Pol ( B )} . Since ∼ \sim ∼ is a relation of B \mathcal{B} B and thus taking induced operations commutes with composition, C C C is a clone over [ k ] [k] [ k ] which does not contain 3-4 weak near-unanimity operations. Write H \mathcal{H} H for the set of ternary and quaternary operations on [ k ] [k] [ k ] which are not in C C C , i.e., H ∩ C = ∅ \mathcal{H} \cap C = \varnothing H ∩ C = ∅ . For each h ∈ H h \in\mathcal{H} h ∈ H , choose R h ∈ Inv ( C ) R_h \in\operatorname{Inv}(C) R h ∈ Inv ( C ) not preserved by h h h , and take C : = ( [ k ] ; ( R h ) h ∈ H ) \mathcal{C} := ([k]; (R_h)_{h \in\mathcal{H}}) C := ([ k ] ; ( R h ) h ∈ H ) . By the choice of all R h R_h R h from Inv ( C ) \operatorname{Inv}(C) Inv ( C ) , all ternary and quaternary polymorphisms of C \mathcal{C} C are precisely the 3- and 4-ary operations in C C C . By [22 Theorem 2.8] (also see [5 Theorem 15.62] ), we know that C \mathcal{C} C pp-constructs a finite affine structure and, by [1 Theorem 10] , CSP ( C ) \operatorname{CSP}(\mathcal{C}) CSP ( C ) is inexpressible in FPC. For every relation R R R of C \mathcal{C} C , the relation R ^ : = { ( b 1 , … , b r ) ∣ ( π ( b 1 ) , … , π ( b r ) ) ∈ R } \widehat{R} := \{(b_1,\ldots,b_r) \mid(\pi(b_1),\ldots,\pi(b_r)) \in R\} R := {( b 1 , … , b r ) ∣ ( π ( b 1 ) , … , π ( b r )) ∈ R } is preserved by all polymorphisms of B \mathcal{B} B , and so has a pp-definition. This yields a pp-construction of C \mathcal{C} C in B \mathcal{B} B , so Proposition 25 again gives the inexpressibility of CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) in FPC, and by transitivity of pp-constructions, also B \mathcal{B} B pp-constructs a finite affine structure.
Proof of Theorems 7 and 8. We prove the equivalence of the four items by showing ( 4 ) → ( 3 ) → ( 1 ) → ( 2 ) → ( 4 ) (4) \rightarrow(3) \rightarrow(1) \rightarrow(2) \rightarrow(4) ( 4 ) → ( 3 ) → ( 1 ) → ( 2 ) → ( 4 ) . By Proposition 23, if B \mathcal{B} B is finite-on-top-of-temporal satisfying the conditions of (4), then CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is definable in FP∗ ^* ∗ , which is item (3). By definition, FP∗ ⊆ ^* \subseteq ∗ ⊆ FPC, so (3) implies (1). The implication (1) to (2) follows by contraposition and transitivity of pp-constructions, since neither X \mathcal{X} X nor any finite affine structure have a CSP expressible in FPC ([12], [1]), and the implication from (2) to (4) follow by contraposition of Proposition 26.
Remark 27 (Decidability of the meta-problem). Given k k k and first-order definitions of the additional relations of B \mathcal{B} B , it is decidable whether conditions (a) and (b) in Theorem 8 hold, and hence it is decidable whether CSP ( B ) \operatorname{CSP}(\mathcal{B}) CSP ( B ) is definable in FPC. This essentially follows from the results and techniques in [11 ] and will be presented in the full version of this paper.
Conclusion and Open Problems
We proved that every CSP for a template which is finite-on-top-of-temporal is either expressible in F P ∗ \mathrm{FP}^{*} FP ∗ , or not even expressible in FPC. The difficult part is showing that there exists an F P ∗ \mathrm{FP}^{*} FP ∗ sentence in the situation where known obstructions to FPC fail. Our F P ∗ \mathrm{FP}^{*} FP ∗ sentence implements a relatively expensive algorithm based on first sampling a sufficiently large finite substructure of the template and then running a consistency algorithm which establishes an extension of the constraint singleton arc-consistency algorithm of Zhuk. We do not know whether a simpler, less expensive form of consistency suffices (but our proof strategy relies on it).
The proof also leaves open whether ordinary FP suffices throughout the positive class. The full version will extend the classification to arbitrary first-order reducts of D k \mathfrak{D}_k D k . We mention two orthogonal directions for future research.
Classify the CSPs for finite-on-top-of-temporal templates with respect to containment in P and NP-hardness. This is challenging, because it is a proper generalisation of the Bulatov-Zhuk dichotomy result; in fact, already the case k = 2 k = 2 k = 2 is challenging, because it requires to deal with combinations of quotient clones that cannot be solved by Datalog with algorithms for temporal CSPs that cannot be expressed in FPC; it is in general unclear which tractable templates can arise in this setting.
Determine which structures of polynomial orbit growth have a CSP in F P ∗ \mathrm{FP}^{*} FP ∗ and in FPC.