Universal Algebraic Methods for Constraint Satisfaction Problems

After substantial progress over the last 15 years, the"algebraic CSP-dichotomy conjecture"reduces to the following: every local constraint satisfaction problem (CSP) associated with a finite idempotent algebra is tractable if and only if the algebra has a Taylor term operation. Despite the tremendous achievements in this area (including recently announce proofs of the general conjecture), there remain examples of small algebras with just a single binary operation whose CSP resists direct classification as either tractable or NP-complete using known methods. In this paper we present some new methods for approaching such problems, with particular focus on those techniques that help us attack the class of finite algebras known as"commutative idempotent binars"(CIBs). We demonstrate the utility of these methods by using them to prove that every CIB of cardinality at most 4 yields a tractable CSP.


Introduction
The "CSP-dichotomy conjecture" of Tomás Feder and Moshe Vardi [FV99] asserts that every constraint satisfaction problem (CSP) over a fixed finite constraint language is either NP-complete or tractable. (The current status of the conjecture is discussed in the note at the end of this introduction.) A discovery of Jeavons, Cohen and Gyssens in [JCG97]-later refined by Bulatov, Jeavons and Krokhin in [BJK05]-was the ability to transfer the question of the complexity of the CSP over a set of relations to a question of algebra. Specifically, these authors showed that the complexity of any particular CSP depends solely on the polymorphisms of the constraint relations, that is, the functions preserving all the constraints. The transfer to universal algebra was made complete by Bulatov, Jeavons, and Krokhin in recognizing that with any set R of constraint relations one can associate an algebra A(R) whose operations consist of the polymorphisms of R.
Following this, the CSP-dichotomy conjecture of Feder and Vardi was recast as a universal algebra problem once it was recognized that the conjectured sharp dividing line between those CSPs that are NP-complete and those that are tractable was seen to depend upon universal algebraic properties of the associated algebra. One such property is the existence of a Taylor term (defined in Section 2.2.2). Roughly speaking, the "algebraic CSP-dichotomy conjecture" is the following: The CSP associated with a finite idempotent algebra is tractable if and only if the algebra has a Taylor term operation in its clone. We state this more precisely (postponing technical definitions) as follows: Conjecture 1.1. If A is an algebra with a Taylor term in its clone and if R is a finite set of relations compatible with A, then CSP(R) is tractable. Conversely, if A is an idempotent algebra with no Taylor term in its clone, then there exists a finite set R of relations such that CSP(R) is NP-complete.
The second sentence of the conjecture was already established in [BJK05]. The proof of the assertion in the first sentence was recently announced (independently) by Andrei Bulatov [Bul17] and Dmitriy Zhuk [Zhu17,Zhu20], as discussed in the note at the end of this section. The purpose of the present work is to provide new methods for establishing the truth of first sentence of the conjecture for certain special classes of algebras. Another goal is to give concrete examples demonstrating how these methods work.
Algebraists have identified two quite different techniques for proving that a finite idempotent algebra is tractable. One, often called the "local consistency algorithm," works for any finite algebra lying in an idempotent, congruence-meet-semidistributive variety (SD-∧ for short). See [BK09] or [BK12] for details. The other, informally called the "few subpowers technique," applies to any finite idempotent algebra possessing an edge term [IMM + 10]. Definitions of these terms appear in Section 6.3. While these two algorithms cover a wide class of interesting algebras, they were not enough to resolve the full dichotomy conjecture above. Several researchers attempted to combine the two existing approaches in a way that captures the outstanding cases. In this paper, we do as well.
For example, suppose that A is a finite, idempotent algebra possessing a congruence, θ, such that A/θ lies in an SD-∧ variety and every congruence class of θ has an edge term. It is not hard to show that A has a Taylor term. Can local consistency be combined with few subpowers to prove that A is tractable?
We can formalize this idea as follows. Let V and W be idempotent varieties. The Mal'tsev product of V and W is the class The Mal'tsev product V • W is always an idempotent quasivariety, but is generally not closed under homomorphic images. A worthwhile goal for future work would be to prove that if all finite members of V and W are tractable, then the same will hold for all finite members of V • W. Tellingly, Freese and McKenzie show in [FM17] that a number of important properties are preserved by Mal'tsev product.
Theorem 1.2 [FM17]. Let V and W be idempotent varieties. For each of the following properties, P, if both V and W have P, then so does H(V • W): (1) being idempotent; (2) having a Taylor term; (3) being SD-∧; (4) having an edge term.
It follows from Theorem 1.2 that if both V and W are SD-∧, or both have an edge term, then every finite member of H(V • W) is tractable. So the next step would be to consider V with one of these properties and W with the other. But even if we could prove that tractability is preserved by Mal'tsev product, that would not be enough. In particular, simple algebras would remain problematic. Interestingly, Barto and Kozik developed an approach that is particularly well-suited to dealing with simple algebras in this context. In LICS'10 ( [BK10]), these researchers proved a powerful "Absorption Theorem" for products of two "absorption-free" algebras in a Taylor variety. At a more recent workshop [Bar15], Barto announced further joint work with Kozik on a general "Rectangularity Theorem" that gives conditions under which a subdirect product of simple nonabelian algebras contains a full product of "minimal absorbing" subalgebras. (Terms in quotes and other technicalities are defined below.) In Section 5 of the present paper we state and prove a version of Barto and Kozik's Rectangularity Theorem. In Section 8, we apply this tool, together with some techniques involving Mal'tsev products and other new decomposition strategies, to prove that every commutative, idempotent binar of cardinality at most 4 is tractable. Note. Subsequent to the initial submission of this manuscript, Andrei Bulatov [Bul17] and Dmitriy Zhuk [Zhu17] independently announced a resolution of Conjecture 1.1. Even more recently, Zhuk's proof appeared in [Zhu20]. The proofs are ingenious, lengthy, and exceedingly complex, but overall follow a strategy similar to the one outlined above. Nonetheless, we feel the methods and results presented here are useful for tackling specific problems, and doing so more directly than would be possible using the approaches offered by proofs of the general conjecture.

Definitions and Notations
2.1. Notation for projections, scopes, and kernels. Here we collect definitions and notations used in the sequel. Some of these will be reintroduced more carefully later, as needed.
An operation f : A n → A is called idempotent provided f (a, a, . . . , a) = a for all a ∈ A. Examples of idempotent operations are the projection functions and these play an important role in later sections, so we start by introducing a flexible notation for them.
2.2. Notation for algebraic structures. This section introduces the notation we use for algebras and related concepts. The reader should consult [Ber12] for more details and background on general (universal) algebras and the varieties they inhabit.
2.2.1. Product algebras. Fix n ∈ N, let F be a set of operation symbols, and for each i ∈n let A i = A i , F be an algebra of type F . LetĀ = A 0 × A 1 × · · · × A n−1 = n A i denote the product algebra. If k n and if σ :k →n is a one-one function, then we denote by p σ :Ā k A σ(i) the projection ofĀ onto the "σ-factors" ofĀ, which is an algebra homomorphism; thus the kernel η σ defined in (2.2) is a congruence relation ofĀ.
. A clone of operations on A is a subset of O A that contains all projection operations and is closed under general composition. If A = A, F A denotes the algebra with universe A and set of basic operations F , then Clo(A) denotes the clone generated by F , which is also known as the clone of term operations of A. We write Clo n (A) to denote the n-ary members of Clo(A) (despite the fact that Clo n (A) is not a clone). A strong Mal'tsev condition is a primitive positive sentence in the language of clones. A Mal'tsev condition is a countably infinite disjunction of strong Mal'tsev conditions {ϕ i } that get weaker as i increases (that is, ϕ i ϕ i+1 ). A nontrivial Mal'tsev condition is one that fails in some variety (equivalently, fails in the variety of sets). An idempotent Mal'tsev condition is one that satisfies the following: for each term f appearing in the condition, the identity f (x, . . . , x) ≈ x is a consequence of the identities in the Mal'tsev condition. (See, e.g., [Ber12] or [KK13] for more details.) Walter Taylor proved in [Tay77] that a variety V satisfies some nontrivial idempotent Mal'tsev condition if and only if it satisfies one of the following form: for some n, V has an idempotent n-ary term t such that for each i ∈n there is an identity of the form t( * , . . . , * , x, * , . . . , * ) ≈ t( * , . . . , * , y, * , . . . , * ) true in V where distinct variables x and y appear in the i-th position on either side of the identity. Such a term t is now commonly called a Taylor term.
Throughout this paper we assume all algebras are finite (though some results may apply more generally). Starting in Section 5, we make the additional assumption that the algebras in question come from a single Taylor variety V, by which we mean that V has a Taylor term and every term of V is idempotent.
2.2.3. Subdirect products. If k, n ∈ N, if A = (A 0 , A 1 , . . . , A n−1 ) is a list of sets, and if σ :k →n is a k-tuple of indices, then a relation R over A with scope σ is a subset of the Cartesian product A σ(0) × A σ(1) × · · · × A σ(k−1) . Let F be a set of operation symbols and for each i ∈n let A i = A i , F be an algebra of type F . IfĀ = n A i is the product of these algebras, then a relation R over A with scope σ is called compatible withĀ if it is closed under the basic operations in F . In other words, R is compatible if the induced algebra R = R, F is a subalgebra of k A σ(j) . If R is compatible with the product algebra and if the projection of R onto each factor is surjective, then R is called a subdirect product of the algebras in the list (A σ(0) , A σ(1) , . . . , A σ(k−1) ); we denote this situation by writing R sd k A σ(j) .

Abelian Algebras
In later sections nonabelian algebras will play the following role: some of the theorems will begin with the assumption that a particular algebra A is nonabelian and then proceed to show that if the result to be proved were false, then A would have to be abelian. To prepare the way for such arguments, we review some basic facts about abelian algebras.
3.1. Definitions. Let A = A, F A be an algebra. A reflexive, symmetric, compatible binary relation T ⊆ A 2 is called a tolerance of A. Given a pair (u, v) ∈ A m × A m of m-tuples of A, we write u T v just in case u(i) T v(i) for all i ∈m. We state a number of definitions in this section using tolerance relations, but the definitions don't change when the tolerance in question happens to be a congruence relation (i.e., a transitive tolerance).
Suppose S and T are tolerances on A. An S, T -matrix is a 2 × 2 array of the form where t, a, b, u, v have the following properties: then we say that S centralizes T modulo δ and we write C(S, T ; δ). That is, C(S, T ; δ) means that (3.1) holds for all , m, t, a, b, u, v satisfying properties (i)-(iii).
The commutator of S and T , denoted by [S, T ], is the least congruence δ such that C(S, T ; δ) holds. Note that C(S, T ; 0 A ) is equivalent to [S, T ] = 0 A , and this is sometimes called the S, T -term condition; when it holds we say that S centralizes T , and write C(S, T ). A tolerance T is called abelian if C(T, T ) (i.e., [T, T ] = 0 A ). An algebra A is called abelian if 1 A is abelian (i.e., C(1 A , 1 A )).

3.2.
Facts about centralizers and abelian congruences. We now collect some useful facts about centralizers of congruence relations that are needed in Section 5. The facts listed in the first lemma below are well-known and easy to prove. ( Lemma 3.1. Let A be an algebra and suppose B is a subalgebra of A. Let α, β, γ, δ, α i β j , γ k be congruences of A, for some i ∈ I, j ∈ J, k ∈ K. Then the following hold: (4) if C(α, β; γ) and α α, then C(α , β; γ); (5) if C(α, β; γ) and β β, then C(α, β ; γ); The next two lemmas are essential in a number proofs below. The first lemma identifies special conditions under which certain quotient congruences are abelian. The second gives fairly general conditions under which quotients of abelian congruences are abelian.

Absorption Theory
In this section we survey some of the theory related to an important concept called absorption, which was invented by Libor Barto and Marcin Kozik. (In [BK17], these authors provide their own survey, to which we refer the reader for more details.) After introducing the concept, we discuss some of the properties that make absorption so useful. The main results in this section are not new. The only possibly novel contributions are some straightforward observations in Section 4.3 (though these have likely been observed by others). Our intention here is merely to collect and present these results in a way that makes them easy to apply in the sequel.
Let A be an algebra and t ∈ Clo(A) a k-ary term operation. A subalgebra B A is said to be absorbing in A with respect to t if for all 1 j k and for all denotes the set {t(x) | x ∈ D}. The notation B A and the phrase "B absorbs A" are used just in case B is an absorbing subalgebra of A with respect to some term. To be explicit about the term, one writes B t A, and t is sometimes called an absorbing term for B in this case. If B is a subuniverse of A, then B A means that the subalgebra B = B, . . . , with universe B, absorbs A. The notation B A means that B is a minimal absorbing subalgebra of A, that is, B is minimal (with respect to set inclusion) among the absorbing subuniverses of A. An algebra is said to be absorption-free if it has no proper absorbing subalgebras. 4.1. Absorption theorem. In later sections, we will make frequent use of a powerful tool of Barto and Kozik called the "Absorption Theorem" (Thm 2.3 of [BK12]). This result concerns the special class of "linked" subsets of products. A subset R ⊆ A 0 × A 1 is said to be linked if it satisfies the following: for a, a ∈ Proj 0 R there exist elements c 0 , c 2 , . . . , c 2n ∈ A 0 and c 1 , c 3 , . . . , c 2n+1 ∈ A 1 such that c 0 = a, c 2n = a , and for all 0 i < n, (c 2i , c 2i+1 ) ∈ R and (c 2i+2 , c 2i+1 ) ∈ R. A subalgebra R A 0 × A 1 linked just in case its universe is.
Here is an easily proved fact that provides some equivalent ways to define "linked." Then the following are equivalent: (1) R is linked; Theorem 4.2 (Absorption Theorem [BK12, Thm 2.3]). If V is an idempotent locally finite variety, then the following are equivalent: Before moving on to the next subsection, we need another definition. If f : A → A and g : A m → A are -ary and m-ary operations on A, then by f g we mean the m-ary operation that maps a = (a 11 , . . . , a 1m , a 21 , . . . , a 2m , . . . , a m ) ∈ A m to (f g)(a) = f (g(a 11 , . . . , a 1m ), g(a 21 , . . . , a 2m ), . . . , g(a 1 , . . . , a m )).

4.2.
Properties of absorption. In this section we prove some easy facts about algebras that hold quite generally. In particular, we don't assume the presence of Taylor terms or other Mal'tsev conditions in this section. However, for the sake of simplicity, we do assume that all algebras are finite and belong to a single idempotent variety, though some of the results of this section hold for infinite algebras as well. Almost all of the results in this section are well known. The only exceptions are mild generalizations of facts that have already appeared in print. We have restated or reworked some of the known results in a way that makes them easier for us to apply. Lemma 4.3. Let A be an algebra with term operations f and g. If B A with respect to either f or g, then B A with respect to f g.
The straightforward proof appears in Section A.1. The next corollary is easy to prove by induction on p.
Corollary 4.4. Fix p < ω, a variety V, algebras A, B ∈ V, and terms t 0 , t 1 , . . . , t p−1 in the language of V. If B t i A for some 0 i < p, then B s A, where s = t 0 t 1 · · · t p−1 . • If B f A, C g A, B ∩ C = ∅, and t = f g, then B ∩ C t A.
The following is an easy corollary of Lemma 4.5 (for proof see Sec. A.2) and so is the generalization to finite products and minimal absorbing subalgebras given in Lemma 4.7 (and proved in Sec. A.3). Corollary 4.6.
Lemma 4.7. Let B i A i (0 i < n) be algebras and define B := n B i and A := Here is another simple observation with a trivial proof that is nonetheless quite useful for proving certain algebras absorption-free.
Lemma 4.8. Let B and C be subalgebras of a finite idempotent algebra A. Suppose B t A, and suppose D = B ∩ C = ∅. Then the restriction of t to C is an absorbing term for D in C, whence D C.
Lemma 4.7 and Lemma 4.8 yield the following observation that we will need in Section 6: is an absorbing subuniverse of R. For 0 < j k, we say that a k-ary term operation t of an algebra A depends on its j-th argument provided there exist a 0 , a 1 , . . . , a k−1 such that p(x) := t(a 0 , . . . , a j−2 , x, a j , . . . , a k−1 ) is a nonconstant polynomial of A.
Let A be an algebra, and s ∈ C ⊆ A. We call s a sink for C provided the following holds: for every term t ∈ Clo k (A) and all 0 < j k, if t depends on its j-th argument, then t(c 0 , c 1 , . . . , c j−2 , s, c j , . . . , c k−1 ) = s for all c i ∈ C. If B is an absorbing subuniverse that intersects nontrivially with a set containing a sink, then B must also contain the sink. We conclude this subsection with three more properties of absorption that will be useful below. The first of these is proved in Section A.5 below.
Lemma 4.12 [BK12, cf. Prop 2.15]. Let A 0 and A 1 be finite idempotent algebras of the same type, let R sd A 0 × A 1 and assume R is linked. If S R, then S is also linked.

4.3.
Linking is easy, sometimes. We will apply the Absorption Theorem frequently below, so we pause here to consider one of the hypotheses of the theorem that might seem less familiar to some readers. Specifically, we consider when we should expect a subdirect product to be linked, as required of R sd A 0 × A 1 in the statement of the Absorption Theorem. We show that in some special cases the hypothesis comes essentially for free, courtesy of the following elementary property of subdirect products: Lemma 4.14. Let A 0 and A 1 be algebras. Suppose R sd A 0 ×A 1 and let ρ i = ker(R A i ) denote the kernel of the i-th projection of R onto A i .
In a locally finite Taylor variety, when one factor of A 0 × A 1 is abelian and the other is simple and nonabelian, linking comes for free; that is, every subdirect product of such A 0 × A 1 is linked, as we now prove.
Corollary 4.16. Suppose A 0 and A 1 are algebras in a locally finite Taylor variety. If A 0 is abelian and A 1 is simple and nonabelian, then every subdirect product of A 1 , then R intersects A 0 × B 1 nontrivially and this intersection forms a linked subdirect product of A 0 × B 1 .
Proof. Suppose R sd A 0 × A 1 is not linked. Since A 1 is simple, ρ 0 ρ 1 by Lemma 4.14.
This is a contradiction since R/θ is abelian for all θ ∈ Con R (by Remark 3.6). For the second part, since R is subdirect, it follows that R ∩ (A 0 × B 1 ) is nonempty and subdirect by Lemmas 4.12 and 4.13. By Corollary 4.9, R ∩ (A 0 × B 1 ) R, so Lemma 4.12 implies that the intersection is also linked. Corollary 4.17. Let A 0 , A 1 , . . . , A n−1 be algebras in a locally finite Taylor variety. Suppose A 0 is simple, nonabelian, and A 1 , A 2 , . . . , A n−1 are abelian. If R sd The Absorption Theorem, Lemmas 4.11-4.13, and Corollaries 4.9, 4.15, 4.16 yield Lemma 4.18. Let A 0 and A 1 be finite algebras in a Taylor variety with minimal absorbing Proof.
(i) First note that R is linked, by Corollary 4.15. Let R := R ∩ (B 0 × B 1 ). Then by Lemma 4.11 R sd B 0 × B 1 , and by Corollary 4.9 R R, so R is also linked, by Lemma 4.12. The hypotheses of the Absorption Theorem-with R in place of R and B i in place of A i -are now satisfied. Therefore, Also, R 0 := Proj 0 R is abelian, so we can apply Lemma 4.18 (ii), with R 0 in place of A 1 .

The Rectangularity Theorem
5.1. Some history. In late May of 2015 we attended a workshop on "Open Problems in Universal Algebra," at which Libor Barto announced a new theorem that he and Marcin Kozik proved called the "Rectangularity Theorem." At this meeting Barto gave a detailed overview of the proof [Bar15]. The authors of the present paper then made a concerted effort over many months to fill in the details and produce a complete proof. Unfortunately, each attempt uncovered a gap that we were unable to fill. Nonetheless, we found a slightly different route to the theorem. Our argument is similar to the one presented by Barto in most of its key aspects. In particular, we make heavy use of absorption and the Absorption Theorem plays a key role. However, we were unable to complete the proof without a new "Linking Lemma" (Lem. 5.4) that we proved using a general result of Kearnes and Kiss. Thus, our argument is similar in spirit to the original, but is (at the time of this writing, to our knowledge) the first complete proof of Barto and Kozik's Rectangularity Theorem to appear in print. We hope our presentation sheds addition light on the result. In the next subsection, we prove the Rectangularity Theorem and some corollaries that we will apply in Section 6, where we show how to use these results to determine the complexity of certain constraint satisfaction problems.

Preliminaries.
We are mainly concerned with finite algebras belonging to a single Taylor variety V (though some results below hold more generally). As mentioned, our goal in this subsection is a proof of the Rectangularity Theorem of Barto and Kozik. The theorem can be described informally as follows: Start with finite algebras A 0 , A 1 , . . . , A n−1 in a Taylor variety with minimal absorbing subalgebras B i A i . Suppose at most one of these algebras is abelian and the nonabelian algebras are simple. Let R be a subdirect product of n A i . Then (under a few more assumptions) if R intersects nontrivially with the product n B i , then R contains the entire product n B i . Our proof of this result will depend on a number of useful lemmas that we now prove. Notation.
be the kernel of the projection of R onto the coordinates σ. Thus, ρ σ = η σ ∩ R 2 . • For σ ⊆n, let σ :=n − σ, and take R sd σ A i × σ A i to meanthe following: (1) R is a subalgebra of • We sometimes use R σ as shorthand for Proj σ R, the projection of R onto coordinates σ.

Rectangularity theorem.
With a few more preliminary results, we will be ready to prove the general Rectangularity Theorem. The first of these comes from combining Lemma 4.7, transitivity of absorption, Corollary 4.9, and Lemma 4.12.
Lemma 5.1. Let A 0 , A 1 , . . . , A n−1 be finite algebras in a Taylor variety, let B i A i for each i ∈n, and letn = σ ∪ σ be a partition of {0, 1, . . . , n − 1} into two nonempty disjoint subsets. Assume R is a linked subdirect product of σ A i and σ A i , and suppose Proof. By Lemma 4.11, R sd σ B i × σ B i , and by Corollary 4.9, R R. Therefore, Lemma 4.12 implies R is linked. By Lemma 4.7 and transitivity of absorption, it follows that σ B i and σ B i are both absorption-free, so the Absorption Theorem implies that Next, we recall a theorem of Keith Kearnes and Emil Kiss, proved in [KK13], about algebras in a Taylor variety. The context in which we apply Theorem 5.2 is that of the following corollary.
Before proceeding, let us remark that the statements of many results to follow will include the hypothesis that subdirect products do not involve redundant factors (since such factors can be combined into one without changing the solution set of the corresponding CSP instance). This is expressed by assuming that kernels of projections onto distinct coordinates are distinct, that is, ρ i = ρ j for all i = j.
Lemma 5.4 (Linking Lemma). Let n 2 and k :=n − {k}. Let A 0 , A 1 , . . . , A n−1 be finite algebras in a Taylor variety, and let B i A i for all 0 i < n. Suppose • at most one A i is abelian, • all nonabelian factors are simple, Then there exists k such that R sd A k × R k is linked. Proof. By way of contradiction, suppose ρ k ∨ ρ k < 1 R for all 0 k < n.
Case 2. Exactly one A i is abelian. Assume without loss of generality that A 0 is the abelian factor. Then, for k > 0, A k is simple and nonabelian, so ρ k is a coatom of Con R. Therefore, (Note that this holds for every 0 < k < n.) Now, let θ = ρ 0 := i =0 ρ i . Let τ be a maximal subset of 0 such that ρ τ > θ. Obviously τ is a proper subset of 0 . Moreover, by (5.2) there exists j ∈ 0 such that ρ τ ρ j . Since ρ j is a coatom, ρ τ ∨ ρ j = 1 R , and by maximality of τ , we have ρ τ ∧ ρ j = θ.
Theorem 5.2 yields C(ρ τ ∨ ρ j , ρ τ ∨ ρ j ; ρ j ) if and only if C(ρ τ , ρ τ ; ρ τ ∧ ρ j ); equivalently, However, C(1 R , 1 R ; ρ j ) implies A j is abelian, but A 0 is the only abelian factor, so which is false by (5.3). Thus, ρ 0 ∧ ρ τ θ. It follows that ρ 0 ∧ ρ τ = 0 R . By (5.2), then, there are at least two distinct indices, say, j and , inn that do not belong to τ . By maximality of We have assembled all the tools we will use to accomplish the main goal of this subsection, which is to prove the following: • all nonabelian factors are simple, Proof. It suffices to prove B 0 × B 1 × · · · × B n−1 ⊆ R, which we do by induction on the number of factors in the product A 0 × A 1 × · · · × A n−1 . For n = 2 the result holds by Lemma 4.18. Fix n > 2 and assume for all 2 k < n that the result holds for subdirect products of k factors. We prove the result for subdirect products of n factors.
Let σ be a nonempty proper subset ofn (so 1 |σ| < n). As above σ is the complement of σ inn, and R σ is the projection of R onto coordinates in σ. Each of the projections R σ and R σ satisfies the assumptions of the theorem. (Indeed, R σ sd σ A i and for all In fact, σ B i R σ as well, by minimality of σ B i σ A i , and transitivity of absorption. To summarize, for every ∅ σ n , By the Linking Lemma, R sd R k × R k is linked for some k. Thus, by Lemma 5.1, the proof is complete.
Theorem 5.5 can be adapted to handle cases in which there are multiple abelian factors.
Corollary 5.6. Let A 0 , A 1 , . . . , A n−1 be finite algebras in a Taylor variety, and let Proof. If α = ∅ then the product has no abelian factors and the result follows immediately from the Rectangularity Theorem.
and this product has a single abelian factor, R α α A i . If θ denotes the kernel of the projection of R onto R α , then for all j < m we have θ = ρ i j , since R α is abelian while A i j is not. We can now apply the Rectangularity Theorem to this subdirect representation since the projection congruences are pairwise distinct.
We conclude this subsection with two observations that facilitate application of the results above to CSP problems.
Corollary 5.7. Let A 0 , A 1 , . . . , A n−1 be finite algebras in a Taylor variety with B i A i for all 0 i < n, and let α ⊆n. Suppose R and S are subdirect products of The generalization to more than two subdirect products is trivial. Nonetheless, for future reference, we record the general formulation of the Rectangularity Theorem in (1) A i is abelian for each i ∈ α, (2) A i is nonabelian and simple for each i / ∈ α,

CSP Applications
In this section we give a precise definition of what we mean by a "constraint satisfaction problem," and what it means for such a problem to be "tractable." We then give examples demonstrating how to use the algebraic tools developed above to prove tractability.
6.1. Definition of a constraint satisfaction problem. We give a definition of "constraint satisfaction problem" that is convenient for our purposes. This is not the most general definition possible, but let us postpone consideration of the scope of our setup.
Let A = A, F be a finite idempotent algebra, and let Sub(A) and S(A) denote the set of subuniverses and subalgebras of A, respectively.
Definition 6.1. Let A be a collection of algebras of the same similarity type. We define CSP(A) to be the following decision problem: -V is a set of n variables; often we take V to ben = {0, 1, . . . , n − 1}; -A is a list (A 0 , A 1 , . . . , A n−1 ) ∈ A n of algebras from A, one for each variable; -C is a list ((σ 0 , R 0 ), . . . , (σ J−1 , R J−1 )) of constraints; each σ j is a scope function with arity ar(σ j ) = m j ; each R j is a constraint relation, which we take to be the universe of a subdirect product of the algebras in A whose indices belong to im σ j ; that is, • A solution to the instance V, A, C is an assignment f : V → n A i of values to variables that satisfies all constraint relations. More precisely, f ∈ n A i and f • σ j ∈ R j holds for all 0 j < J. We denote the set of solutions to V, A, C by Sol(C,n).
(i) The scope function σ i :m i → V picks the m i variables involved in the constraint relation R i . Thus, ((σ 0 , R 0 ), . . . , (σ J−1 , R J−1 )) ∈ i<J V m i . (ii) Frequently we require that arities of scope functions are bounded above by, say, m ar(σ j ) (j < J), which yields the local constraint satisfaction problem CSP(A, m), with instances so restricted. (iii) If (σ, R) ∈ C is a constraint of an n-variable instance, and if Sol((σ, R),n) denotes the set of tuples in n A i that satisfy (σ, R), then Thus, the instance V, A, C has solution set Sol(C,n) 6.2. Instance size and tractability. The computational complexity of an algorithm for solving instances of a CSP is measured as a function of input size. Thus, in order to say what it means for CSP(A) to be "computationally tractable," we need a definition of input size. This amounts to determining the number of bits required to completely specify an instance of the problem. In practice, an upper bound on the size is usually sufficient. Using the notation in Definition 6.1 as a guide, we bound the size of an instance I = V, A, C of CSP(A). Let q = max(|A 0 |, |A 1 |, . . . , |A n−1 |), let r be the maximum rank of an operation symbol in the similarity type, and p the number of operation symbols. Then each member of the list A requires at most pq r log q bits to specify. Thus size(A) npq r log q.
Finally, the constraint relation R j requires at most q m j · m j · log q bits. Thus, size(R 0 , R 1 , . . . , R J−1 ) Jq m · m log q.
Combining these encodings and using the fact that log q q, we deduce size(I) npq r+1 + Jmq m+1 + Jmn. (6.1) In particular, for the problem CSP(A, m), the maximum scope arity, m, is fixed, as is r.
In this case, we can assume J n m . Consequently, size(I) ∈ O((nq) m+1 ) which yields a polynomial bound (in nq) for the size of the instance.
A problem is called tractable if there exists a deterministic algorithm that solves all instances of the problem and does so in an amount of time that is bounded above by a polynomial function of the input size. We can use Definition 6.1 above to classify the complexity of an algebra A, or collection of algebras A, according to the complexity of their corresponding constraint satisfaction problems.
An algorithm A is called a polynomial-time algorithm for CSP(A) if there exist constants c and d such that, given an instance I of CSP(A) of size S = size(I), A halts in at most cS d steps and outputs whether or not I has a solution. In this case, we say A "solves the decision problem CSP(A) in polynomial time" and we call the algebras in A "jointly tractable." We say that A is jointly locally tractable if, for every natural number, m, there is a polynomial-time algorithm A m that solves CSP(A, m). We call an algebra A tractable when A = S(A) is jointly tractable. We emphasize that CSP(A) is a decision problem, that is, the algorithm is only required to respond "yes" or "no" to the question of whether a particular instance has a solution, it does not have to actually produce a solution. However, it turns out that if CSP(A) is tractable then the corresponding search problem is also tractable; thus, one could design the algorithm to find a solution in polynomial time, if a solution exists, see [BJK05,Cor 4.9].
6.3. Sufficient conditions for tractability. A meet semidistributive lattice is one that satisfies the quasiidentity x ∧ y ≈ x ∧ z → x ∧ y ≈ x ∧ (y ∨ z). A variety is called SD-∧ if every member of the variety has a meet semidistributive congruence lattice. Idempotent SD-∧ varieties are known to be Taylor varieties [HM88]. In [BK12], Barto and Kozik proved the following.
A second important technique for establishing tractability is the "few subpowers algorithm" of [IMM + 10], which its discoverers describe as a broad generalization of Gaussian elimination.
Definition 6.4. Let V be a variety and k an integer, k > 1. A (k + 1)-ary term t is called a k-edge term for V if the following k identities hold in V: Clearly, every Mal'tsev term and every near unanimity term is an edge term, and every edge term is idempotent and Taylor. Combining the main results of [BIM + 10] and [IMM + 10] yields the following theorem.
Theorem 6.5. Let A be a finite idempotent algebra with an edge term. Then A is tractable.
Finally, we note that tractability is largely preserved by familiar algebraic constructions.
Theorem 6.6 [BJK05]. Let A be a finite, idempotent, tractable algebra. Every subalgebra and finite power of A is tractable. Every homomorphic image of A is locally tractable.
6.4. Rectangularity Theorem: obstacles and applications. The goal of this subsection is to consider aspects of the Rectangularity Theorem that limit its utility as a tool for proving tractability of CSPs. We give a brief overview of the potential obstacles, and then consider each one in more detail. (1) Abelian factors must have easy partial solutions. One potential limitation concerns abelian factors in the product algebra associated with a CSP instance. Indeed, application of Corollary 5.8 requires a partial solution x ∈ Proj α R to the restricted instance derived from projecting constraints onto abelian factors. Fortunately, Section 6.4.1 will show that this obstacle is easily overcome.
(2) Intersecting products of minimal absorbing subalgebras. The Rectangularity Theorem (and corollaries) assumes the universes of the subdirect products in question intersect nontrivially with a single product B i of minimal absorbing subuniverses. We refer to "minimal absorbing subuniverses" quite frequently, so from now on we call them masses; that is, • mass := minimal absorbing subuniverse; • mass product := product of masses. Assumption (4) of Corollary 5.8 requires all constraint relations intersect nontrivially with a single mass product. This is a real limitation, as we demonstrate in Section 6.4.2.
(3) Nonabelian factors must be simple. This is the most obvious limitation of the theorem and at this point we don't have a completely general means of overcoming it. However, there are some work-arounds that can be useful in special cases; we describe these below. In the next two subsections we address potential limitations (1) and (2). In Section 7 we develop alternative methods for proving tractability of nonsimple algebras, and in Section 8 we apply these methods in the special setting of "commutative idempotent binars." 6.4.1. Tractability of abelian algebras. To address concern (1) above we observe that finite abelian algebras yield tractable CSPs. We show how to use this and the Rectangularity Theorem to find solutions to CSP instances (or prove none exists). To begin, recall the result of tame congruence theory [HM88, Thm 7.12] that we reformulated above in Lemma 3.4. As noted in Remark 3.6 above, this result has the following important corollary. (For a proof that avoids tame congruence theory, see [BKS15, Thm 5.1].) Theorem 6.7. Let V be a locally finite variety with a Taylor term. Every finite abelian member of V generates a congruence-permutable variety. Consequently, every finite abelian member of V is tractable.
Let A be a finite algebra in a Taylor variety and fix an instance I = V, A, C of CSP(S(A)) with n = |V| variables. Suppose all nonabelian algebras in the list A are simple. Let α ⊆n denote the indices of the abelian algebras in A, and assume without loss of generality that α = {0, 1, . . . , q − 1}. That is, A 0 , A 1 , . . . , A q−1 are finite idempotent abelian algebras. Consider the restricted instance I α obtained by dropping all constraints with scopes that do not intersect α, and by restricting the remaining constraint relations to the abelian factors. Since the only algebras involved in I α are abelian, this is an instance of a tractable CSP. Therefore, we can check in polynomial-time whether or not I α has a solution. If there is no solution, then the original instance I has no solution. On the other hand, suppose f α ∈ j∈α A j is a solution to I α . In Corollary 5.8, to reach the conclusion that the full instance has a solution, we required a partial solution x ∈ Proj α R . This is precisely what f α provides.
To summarize, we look for a partial solution by restricting the instance to abelian factors and, if successful, we use the partial solution for x in Corollary 5.8. Then, if the remaining hypotheses of Corollary 5.8 hold, we conclude that a solution to the original instance exists. If no solution to the restricted instance exists, then the original instance has no solution. Thus, assumption (5) of Corollary 5.8 does not limit the application of the result.
6.4.2. Mass products. This section concerns products of minimal absorbing subalgebras, or "mass products." Hypothesis (4) of Corollary 5.8 assumes that all constraint relations intersect nontrivially with a single mass product. Instances where this hypothesis does not hold are easy to contrive.  1, 1, 0), (1, 1, 1)}. Then there are mass products that intersect nontrivially with either R or S, and each of R and S fully contains every mass product that it intersects. However, there is no single mass product intersecting nontrivially with both R and S. The example described above is very special. In particular, there is no solution to the instance with constraint relations R and S. We might hope that when an instance does have a solution, then there must be a solution that passes through a mass product. As we now demonstrate, this is false. In fact, Example 6.9 presents subdirect powers that intersect nontrivially (so the instance has a solution), yet their intersection avoids every mass product (so the Rectangularity Theorem cannot locate a solution nor prove none exists).
Proposition 6.8. There exists an algebra A with subdirect powers R and S such that R ∩ S = ∅ and R ∩ S ∩ B i = ∅, for every collection {B i } of masses.
We prove this by simply producing an example that meets the stated conditions.

C. Bergman and W. DeMeo
Vol. 18:1 6.5. Algorithm synthesis for heterogeneous problems. We now present a new result (Theorem 6.13) which, like the Rectangularity Theorem, aims to describe some of the elements that must belong to certain subdirect products. The conclusions we draw are weaker than those of Theorem 5.5, but the hypotheses required here are simpler, and the motivation is different. We have in mind subdirect products of "heterogeneous" families of algebras. What we mean by this is described and motivated as follows: let C 1 , . . . , C m be classes of algebras, all of the same signature. Perhaps we are lucky enough to possess a single algorithm that proves the algebras in C i are jointly tractable. Suppose instead that we have no such single algorithm at hand, but at least we do happen to know that the classes C i are separately tractable; that is, for each i we have a proof (or program) P i certifying the tractability of CSP(C i ). It is natural to ask whether and under what conditions it might be possible to derive from {P i | 1 i m} a single proof (program) certifying that the algebras in C i are jointly tractable, so that CSP( C i ) is tractable.
The results in this section take a step in this direction by considering two special classes of algebras that are known to be separately tractable, and demonstrating that they are, in fact, jointly tractable. We apply this tool in Section 7.2.2 to prove tractability of a CSP involving algebras that were already known to be tractable, but not previously known to be jointly tractable.
The results here involve special term operations called cube terms and transitive terms. A k-ary idempotent term t is a cube term if for every coordinate i k, t satisfies an identity of the form t(x 1 , . . . , x k ) ≈ y, where x 1 , . . . , x k ∈ {x, y} and x i = x. (See [BIM + 10].) A k-ary operation f on a set A is called transitive in the i-th coordinate if for every u, v ∈ A, there exist a 1 , . . . , a k ∈ A such that a i = u and f (a 1 , . . . , a n ) = v. Operations that are transitive in every coordinate are called transitive. (See [BKS15].) Fact 6.10. Let A be a finite idempotent algebra and suppose t is a cube term operation on A. Then t is a transitive term operation on A.
Proof. This follows immediately from the definitions. is closed under the taking of homomorphic images, subalgebras, and finite products. That is, T is a pseudovariety.
We also require the following obvious fact about nontrivial algebras in a Taylor variety. (We call an algebra nontrivial if it has more than one element in its universe.) Fact 6.12. If A and B are nontrivial algebras in a Taylor variety V, then for some k > 1 there is a k-ary term t in V such that t A and t B each depends on at least two of its arguments.
Finally, we are ready for the main result of this section.
Theorem 6.13. Let A 0 , A 1 , . . . , A n−1 be finite idempotent algebras in a Taylor variety and assume there exists a proper nonempty subset α ⊂n such that • A i has a cube term for all i ∈ α, • A j has a sink s j ∈ A j for all j ∈ α ; let s ∈ α A j be a tuple of sinks. If R sd n A i , then the set X := R α × {s} is a subuniverse of R. Remark 6.14. To foreshadow applications of Theorem 6.13, imagine we have algebras of the type described, and a collection R of subdirect products of these algebras. Suppose also that we have somehow determined that the intersection of the α-projections of these subdirect products is nonempty, say, x α ∈ R∈R R α . Then the full intersection R will also be nonempty, since according to the theorem it must contain the tuple that is x α on α and s off α.
Proof. Fix x ∈ X, so x • α = s and x • α ∈ R α . We prove x ∈ R. Define A α = α A i and A α = α A i , so R α and R are subuniverses of A α and A α × A α , respectively. By Fact 6.10, for each i ∈ α every subalgebra of A i has a transitive term operation. Moreover, the class T defined in (6.2) is a pseudovariety, so every subalgebra of A α has a transitive term operation. Suppose there are J subalgebras of A α and let {t j | 0 j < J} denote the collection of transitive term operations, one for each subalgebra. Then it is not hard to prove that t := t 0 t 1 · · · t J−1 (defined in Sec. 4.1) is a transitive term for every subalgebra of A α . In particular t is transitive for the subalgebra with universe R α .
Assume t is N -ary. Fix j ∈ α . We may assume without loss of generality that t A j depends on its first argument, at position 0. (It must depend on at least one argument by idempotence.) Now, since R is a subdirect product of n A i , there exists r (j) ∈ R such that r (j) (j) = s j , the sink in A j . Since x • α ∈ R α and since t Aα is transitive over R α , there exist r 1 , . . . , r N −1 in R such that belongs to R and satisfies y (j) • α = x • α and y (j) (j) = s j .
If α = {j}, we are done, since y (j) = x in that case. If |α | > 1, then we repeat the foregoing procedure for each j ∈ α and obtain a subset {y (j) | j ∈ α } of R, each member of which agrees with x on α and has a sink in some position j ∈ α .
Next, choose distinct j, k ∈ α . Suppose w is a Taylor term for V. Then by Fact 6.12 we may assume without loss of generality that w A j depends on its p-th argument and w A k depends on its q-th argument, for some p = q. Consider z := w ΠA i (y (j) , . . . , y (j) , y (k) , y (j) , . . . , y (j) ) q-th argument Evidently, z(j) = s j , z(k) = s k , and z • α = x • α by idempotence, since, when restricted to indices in α, all the input arguments agree and are equal to x • α. If α = {j, k}, we are done. Otherwise, choose ∈ α − {j, k}, and again w A depends on at least one of its arguments, say, the u-th. Let z := w ΠA i (z, . . . , z, y ( ) , z . . . , z).

u-th argument
Then z belongs to R, agrees with x on α, and satisfies z (j) = s j , z (k) = s k , and z ( ) = s . Continuing in this way until the set α is exhausted produces an element in R that agrees with x everywhere. In other words, x itself belongs to R.
In Section 7.2.2 we apply Theorem 6.13 in the special case where "has a cube term" in the first hypothesis is replaced with "is abelian." Let us be explicit. Corollary 6.15. Let A 1 , . . . , A n−1 be finite idempotent algebras in a locally finite Taylor variety. Suppose there exists 0 < k < n − 1 such that Proof. Since Ak := i<k A i is abelian and lives in a locally finite Taylor variety, there exists a term m such that m Ak is a Mal'tsev operation on Ak (Theorem 6.7). Since a Mal'tsev term is a cube term, the result follows from Theorem 6.13.

Problem Instance Reductions
In this section we develop some useful notation for taking an instance of a CSP and restricting or reducing it in various ways, either by removing variables or by reducing modulo a sequence of congruence relations. The utility of these tools will be demonstrated in Section 8. Throughout this section, A will denote a finite idempotent algebra. The problem we will focus on is CSP(A), defined in Section 6.1, and we will be particularly interested in the special case in which A = S(A).
Recall, we denote an n-variable instance of CSP(S(A)) by I = n , A, C , wheren = {0, 1, . . . , n − 1} represents the set of variables, A = (A 0 , A 1 , . . . , A n−1 ) is a list of n subalgebras of A, and C = ((σ 0 , R 0 ), (σ 1 , R 1 ), . . . , (σ J−1 , R J−1 )) is a list of constraints with respective arities ar(σ j ) = m j . Thus, R j ⊆ i<m j A σ(i) . Much of the discussion below refers to an arbitrary constraint in C. In such cases it will simplify notation to drop subscripts and denote the constraint by (σ, R).

Variable reductions.
7.1.1. Partial scopes and partial constraints. Consider the restriction of an n-variable CSP instance I to the first k of its variables, for some k n. This results in a new partial scope given by the function σ σ −1 (k ∩ im σ) . Call this the k-partial scope of σ and, to simplify the notation, let . Ifk ∩ im σ = ∅ then the k-partial scope of σ is the empty function. To obtain the k-partial constraint of (σ, R), we take the k-partial scope of σ as the new scope; for the constraint relation we take the restriction of each tuple in R to its first p = |k ∩ im σ| coordinates. If we let R ← − k = R σ −1 (k ∩ im σ) , then the k-partial constraint of (σ, R) is given by (σ ← − k , R ← − k ). For example, let σ be a scope consisting of variables 2, 4, 7, so (σ(0), σ(1), σ(2)) = (2, 4, 7). To find the 5-partial constraint of (σ, R), restrict (σ, R) to the first k = 5 variables of the instance. Then, σ −1 (k ∩ im σ) = σ −1 {2, 4} = {0, 1}, and σ ← − k = (σ(0), σ(1)) = (2, 4), so We might be tempted to call Sol(I,k) the set of "partial solutions," but that's a bit misleading since an f ∈ Sol(I,k) may or may not extend to a solution to the full instance I.
7.2.1. Quotient instances. Suppose θ i ∈ Con(A i ) (0 i < n) and define θ = (θ 0 , . . . , θ n−1 ). For x = (x 0 , x 1 , . . . , x n−1 ) ∈ n A i , let x/θ denote the tuple whose i-th component is the We need a more general notation than this since our tuples may come from m A σ(i) for some scope function σ :m →n. Viewing x ∈ n A i (resp., θ) as a function fromn to A i (resp., Con(A i )), write x • σ ∈ m A σ(i) and θ • σ ∈ m Con(A σ(i) ) for the corresponding scope-restricted tuples, and then define Given θ and (σ, R) ∈ C, define the set C/θ of quotient constraints by {(σ, R/θ) | (σ, R) ∈ C}, where (7.1) Here are a few easily proved facts about quotient constraints.  The quotient instance I/θ is the instance of CSP(HS(A)) described in Fact 7.2.

Block instances. Let
A be a collection of finite idempotent algebras. Let I = n , A, C be an n-variable instance of CSP(A), where A = (A 0 , A 1 , . . . , A n−1 ) and C is a finite set of constraints. If θ ∈ n Con(A i ) and x ∈ n A i , then the tuple x/θ of θ i -blocks is actually a list of algebras, by idempotence.
For each constraint (σ, R) ∈ C, consider restricting the relation R to the x i /θ i -classes in its scope σ. In other words, replace the constraint (σ, R) with the block constraint (σ, R ∩ Π σ x/θ), where we have defined Π σ x/θ to be the product of the blocks x σ(i) /θ σ(i) (1 i m). Finally, let I x/θ = n , x/θ, C x/θ denote the problem instance of CSP(S(A)) specified by the constraint set C x/θ := {(σ, R ∩ Π σ x/θ) | (σ, R) ∈ C}. We call I x/θ the x/θ-block instance of I. Evidently, a solution to I x/θ is also a solution to I. 7.3. The Quotient-Block strategy. The notions "quotient instance" and "block instance" suggest the following strategy for solving CSPs that works in certain special cases (one of which we will see in Example 7.4): First search for a solution x/θ to the quotient instance I/θ for some conveniently chosen θ. If no quotient solution exists, then the original instance I has no solution. Otherwise, if x/θ is a solution to I/θ, then try to solve the x/θ-block instance of I. If successful, then the instance I has a solution. Otherwise, try again with a different solution to I/θ. If all solutions to the quotient instance are exhausted without finding a solution to a corresponding block instance, then I has no solution.
This approach is effective as long as we can find a quotient instance I/θ for which there is a polynomial bound on the number of quotient solutions. Although this is not always possible (consider instances involving only simple algebras!), there are situations in which an appropriate choice of congruences makes it easy to check that every instance has quotient instance with a very small number of solutions. We present an example.
Example 7.4. Let A = {0, 1, 2, 3}, · , be an algebra with a single binary operation given by the table on the left in Figure 1. The proper nonempty subuniverses are {0, 1}, {1, 2, 3}, and the singletons. The algebra A has a single proper nontrivial congruence relation, Θ, with partition |01|2|3|. The quotient algebra A/Θ is a 3-element Steiner quasigroup, which happens to be abelian. Denote the latter by Sq 3 and note the middle table in Figure 1 describing its binary operation. Observe that the subalgebra {1, 2, 3} of A is also isomorphic to Sq 3 .
As Theorem 6.7 predicts, the algebra A/Θ has a Mal'tsev term q(x, y, z) = y · (x · z). Let s(x, y) = q(x, y, y) = y · (x · y). Then A/Θ s(x, y) ≈ x. By iterating the term s on its second variable, we arrive at a term t(x, y) such that, in A, t(x, t(x, y)) = t(x, y). In fact, t(x, y) = x · (y · (x · y)). To summarize A t(x, t(x, y)) ≈ t(x, y) The table for t appears on the right in Figure 1.
Proof. Let I = n , A, C be an instance of CSP(A). Recall, the set of solutions to I is Sol(C,n) = C R ← − σ . We shall apply Corollary 6.15 to establish tractability. We have A = We may assume without loss of generality that, for each constraint (σ, R) appearing in C, the associated algebra R is a subdirect product of Let 0 denote the bottom element of each semilattice. For each constraint (σ, R), let R ← − α be an abbreviation for R σ −1 (α∩im σ) (the projection of R onto factors in its scope with indices in α). Let 0 denote a tuple of 0's of length |α ∩ im σ|. Then Corollary 6.15 implies that for each constraint (σ, R) ∈ C we have Obviously, if I has a solution, then the α-partial instance I α also has a solution. Conversely, if f ∈ α A i is a solution to I α , then (7.2) implies that g ∈ n A i defined by is a solution to I. We conclude that I has a solution if and only if the α-partial instance has a solution. Since abelian algebras yield tractable CSPs, the proof is complete. Now we address the tractability of the example at hand.
Proposition 7.6. If A, · is the four-element algebra with operation table given in Figure 1, then CSP(S(A)) is tractable.
Proof. Let I = n , A, C be an instance of CSP(S(A)) whereA = (A 0 , A 1 , . . . , A n−1 ) ∈ S(A) n . For each i ∈n, let θ i = Θ if A i = A, and let θ i = 0 A i otherwise. The universes A i /θ i of the quotient algebras satisfy In the first two cases A i /θ i is isomorphic to Sq 3 and in the third case A i /θ i is a 2-element meet semilattice. (Singleton factors, A i /θ i = {a}, are safely ignored because all solutions must assign the the value a to the associated variable.) Let θ = (θ 0 , θ 1 , . . . , θ n−1 ) and consider the quotient instance I/θ which, by the observations in the preceding paragraph, is an instance of CSP(A), where A = {Sq 3 , S 2 }. By Lemma 7.5, I/θ can be solved in polynomial-time. If I/θ has no solution, then neither does I. Otherwise, let f ∈ Sol(I/θ,n) be a solution to the quotient instance. We will use f to 12:26

C. Bergman and W. DeMeo
Vol. 18:1 construct a solution g ∈ Sol(I,n) to the original instance. (In so doing, we often map a singleton set to its inhabitant via the usual set union operation; e.g., {x} = x.) In other terms, Assume the factors are rearranged if necessary so that this correspondence is on-the-nose equality. By definition, θ i is Θ for i ∈ α and 0 A i for i / ∈ α. Thus, the i-th entry of A/θ is The i-th value f (i) of the quotient solution must belong to Note that f (i) is a singleton for all i / ∈ α 0 , and recall that {a} = a. Define g ∈ n A i as follows: g(i) = 0 if i ∈ α 0 ∪ γ, and g(i) = f (i), if i ∈ α 1 ∪ β. We will prove g ∈ Sol(I,n).
Fix an arbitrary constraint (σ, R) ∈ C, let S := im σ be the set of indices in the scope of R, and let S c :=n − S denote the complement of S with respect ton. Since we assumed f solves I/θ and satisfies (7.3) there must exist r ∈ n A i satisfying not only (σ, R) but also the following: r(i) ∈ {0, 1} for i ∈ α 0 and r(i) = f (i) for i / ∈ α 0 . Now consider other elements satisfying the (arbitrary) constraint (σ, R). By subdirectness of R, for each ∈ α 0 ∪ γ there exists x ∈ n A i satisfying (σ, R) and x ( ) = 0. Since r and x satisfy (σ, R)-that is r • σ ∈ R and x • σ ∈ R-we also have t(r, x ) • σ ∈ R. Consider the entries of t(r, x ), using the partitionn = α 0 ∪ α 1 ∪ β ∪ γ defined above. Since x ( ) = 0, we have t(r, x )( ) = 0. For i = , observe the following: To summarize, for each ∈ α 0 ∪ γ, there exists t(r, x ) ∈ n A i satisfying (σ, R) and having values t(r, x )(i) ∈ {0, 1} for i ∈ α 0 ∪ γ and Finally, take the product of all members of {t(r, x ) | ∈ α 0 ∪ γ} with respect to the binary operation of the original algebra A, · to obtain t(r, x 1 ) · t(r, x 2 ) · · · · · t(r, x L ) = g, where L = |α 0 ∪ γ|. This proves that g ∈ Sol((σ, R),n). Since the constraint (σ, R) was arbitrary, we have g ∈ Sol(I,n), as desired.
Example 7.4 and Proposition 7.6 do not fully illustrate the scope of the quotient-block strategy since, as we saw in the proof, every solution f to the quotient instance I/θ induced a solution g on the block instance f /θ. In general, we may not be so lucky. Nonetheless, we demonstrated the quotient-block strategy on this example because the analysis carried out in Section 8 requires that the associated CSP is tractable (as asserted in Proposition 7.6).
7.4. The least block algorithm. This section describes an algorithm that was apparently discovered by "some subset of" Petar Marković and Ralph McKenzie. We first learned about this by reading Marković's slides [sJM + 11] from a 2011 talk in Krakow which gives a one-slide description of the algorithm. Since no proof (or even formal statement of the assumptions) from the originators of this result seems to be forthcoming, we include our own version and proof in this section. Let A be a finite idempotent algebra and let θ be a congruence on A. Recall that by idempotence, every θ-class of A will be a subalgebra of A. Suppose that, as an algebra, each θ-class comes from a variety, E, possessing a (k + 1)-ary edge term, e. Define s(x, y) = e(y, y, x, x, . . . , x). Then according to Definition 6.4, E s(x, y) ≈ x. By iterating s on its second variable, we obtain a binary term t such that Assume, finally, that the induced algebra A/θ, t A/θ is a linearly ordered meet semilattice. When this occurs, we call A an Edge-by-Chain (EC) algebra, and we say, "A is EC." Our objective in this subsection is to prove the following theorem.
Proof. Recall, an algebra A is tractable if the problem CSP(S(A)) is solvable in polynomial time. (See Subsection 6.2.) Let A be finite, idempotent and EC. We continue to use the congruence θ and term t developed above. Let I be an instance of the problem CSP(S(A)). Thus I is a triple V, A, C in which A = (A 0 , A 1 , . . . , A n−1 ) is a list of subalgebras of A, see Definition 6.1. The congruence θ induces a congruence (which we will continue to call θ) on each A i , and the term t will induce a linearly ordered semilattice structure on A i /θ. In other words, each A i is also an EC algebra.
Therefore, for each i < n, the structure of A i /θ, t will be of the form C i,0 < C i,1 < · · · < C i,q i in which each C i,j is a θ-class of A i . We have the following useful relationship.
To see this, let w = t(u, v). Then w ∈ C i,j , since the quotient structure is a semilattice under t. Therefore, by (7.4), t(u, w) = t(u, t(u, v)) = t(u, v) = w. On the other hand, since u, w ∈ C i,j ∈ E we have t(u, w) = u by (7.5). Thus u = w.
Recall that for an index k n, the kth-partial instance of I is the instance, Ik, obtained by restricting I to the first k variables (Section 7.1.2). The set of solutions to Ik is denoted Sol(I,k).
For every k < n we recursively define the index j k by j k = least j q k such that Sol(I, k + 1) If there is a k such that no such j k exists, then j k , j k+1 , . . . are undefined.
To complete the proof of Theorem 7.7, we need to prove two final claims. Claim 7.9. j i can be computed in polynomial time for all i < n.
One direction of Claim 7.8 is immediate: if j n−1 is defined then Sol(I) = Sol(I,n) is nonempty. We address the converse. Assume that I has solutions. We argue, by induction on k, that every j k is defined. For the base step, choose any g ∈ Sol(I). Since g(0) ∈ A 0 , there is some such that g(0) ∈ C 0, . Then j 0 is defined and is at most . Now assume that j 0 , j 1 , . . . , j k−1 are defined, but j k is undefined. Let f ∈ Sol(I,k) ∩ k−1 i=0 C i,j i . Since j k is undefined, f has no extension to a member of Sol(I, k + 1). We shall derive a contradiction. Since I has a solution, the restricted instance I k+1 certainly has solutions. Choose any g ∈ Sol(I, k + 1) with g(k) ∈ C k, for the smallest possible . Let C = (σ 0 , R 0 ), (σ 1 , R 1 ), . . . , (σ J−1 , R J−1 ) be the list of constraints of I. By assumption, for each m < J, f is a solution to (σ m , R m ) k (the restriction of R m to its first k variables). Therefore, there is an extension, f m , of f , to k + 1 variables such that f m is a solution to (σ m , R m ) k+1 .
Let m < J and set h m = t(g, f m ). Since both g and f m are solutions to (σ m , R m ) k+1 , and t is a term, h m is also a solution to (σ m , R m ) k+1 . For every i < k we have f m (i) = . The latter relation holds by (7.6) and the choice of g. It follows that every h m coincides with h 0 . Since h m satisfies R m , we have h 0 ∈ Sol(I, k + 1). This contradicts our assumption that f has no extension to a member of Sol(I, k + 1).
Finally, we must verify Claim 7.9. Assume we have computed j i , for i < k. To compute j k we proceed as follows.
for j = 0 to q k do B ← (C 0,j 0 , C 1,j 1 , . . . , C k−1,j k−1 , C k,j ) if I B has a solution in CSP(B) then return j return Failure In this algorithm, I B is the instance of CSP(B) obtained by first restricting I to its first k + 1 variables, and then restricting each constraint relation to B. Since the members of B all lie in the edge-term variety E, it follows from Theorems 6.5 and 6.6 that CSP(B) runs in polynomial-time.

CSPs of Commutative Idempotent Binars
Taylor terms were defined in Section 2.2.2. It is not hard to see that a binary term is Taylor if and only if it is idempotent and commutative. This suggests, in light of the algebraic CSP-dichotomy conjecture, that we study commutative, idempotent binars (CIB's for short), that is, algebras with a single basic binary operation that is commutative and idempotent. If the conjecture is true, then every finite CIB should be tractable.
The associative CIBs are precisely the semilattices. Finite semilattices have long been known to be tractable, [JCG97]. The variety of semilattices is SD-∧ and is equationally complete. Every nontrivial semilattice must contain a subalgebra isomorphic to the unique two-element semilattice, S 2 = {0, 1}, ∧ , and conversely, S 2 generates the variety of all semilattices. As we shall see, the algebra S 2 plays a central role in the structure of CIBs. In particular, the omission of S 2 implies tractability.
Theorem 8.1. If A is a finite CIB then the following are equivalent: (1) A has an edge term.
The proof that (1) implies (2) appears in [BIM + 10] and holds for general finite idempotent algebras. The contrapositive of (2) implies (3) is easy: if S 2 ∈ HS(A), then S 2 2 ∈ V(A), and the congruence lattice of S 2 2 is not modular. So it remains to show that (3) implies (1). For this we use the idea of a "cube-term blocker" ( [MMM12]). A cube term blocker (CTB) for an algebra A is a pair (D, S) of subuniverses with the following properties: ∅ < D < S A and for every term t(x 0 , x 1 , . . . , x n−1 ) of A there is an index i ∈n such that, for all s = (s 0 , s 1 , . . . , s n−1 ) ∈ S n , if s i ∈ D then t(s) ∈ D.  (3) is false. In fact, something stronger is true. Kearnes has shown that if V is any variety of CIBs that omits S 2 , then V is congruence permutable [Kea16].
Before proving the next corollary, we need two more definitions. A variety is called regular if it is defined by regular identities. In contrast, a variety is called strongly irregular if it satisfies an identity t(x, y) ≈ x for some binary term t in which both x and y appear [BF15]. Every strongly irregular variety has an equational base consisting of a set of regular identities and a single strongly irregular identity. Note that most "interesting" varieties are strongly irregular-most Maltsev conditions involve a strongly irregular identity. For example, the Maltsev condition for congruence-permutability has a ternary term q(x, y, z) satisfying q(x, y, y) ≈ x, which is a strongly irregular identity. By contrast, the variety of semilattices is regular.
The proof of the next result will refer to strongly irregular varieties and P lonka sums. Our definitions of these concepts are the same as those found in [BF15], but we include them here for completeness. A variety is called strongly irregular if it satisfies an identity t(x, y) ≈ x for some binary term t in which both x and y appear. A similarity type of algebras is said to be plural if it contains no nullary operation symbols, and at least one non-unary operation symbol.
Let S, ∨ be a semilattice, {A s | s ∈ S} a collection of algebras of plural type ρ : F → N, and {ϕ s,t : A s → A t | s ∨ t} a collection of homomorphisms satisfying ϕ s,s = 1 As and ϕ t,u • ϕ s,t = ϕ s,u . The P lonka sum of the system A s : s ∈ S; ϕ s,t : s ∨ t is the algebra A of type ρ with universe A = · {A s |s ∈ S} and for f ∈ F a basic n-ary operation, f A (x 1 , x 2 , . . . , x n ) = f As (ϕ s 1 ,s (x 1 ), ϕ s 2 ,s (x 2 ), . . . , ϕ sn,s (x n )) in which s = s 1 ∨ s 2 ∨ · · · ∨ s n and x i ∈ A s i for 1 ≤ i ≤ n.
Proof. By the theorem, V(A 0 ) and V(A 1 ) each have an edge term. By Theorem 1.2, H V(A 0 ) • V(A 1 ) has an edge term as well. Since A 0 × A 1 lies in this variety, it possesses that same edge term. Iterating this process, the algebra B = A 0 × · · · × A n−1 has an edge term, hence is tractable by Theorem 6.5.
Let t(x 1 , . . . , x k+1 ) be an edge term for B. Then according to the first identity in Definition 6.4, V(B) is a strongly irregular variety. Consequently, the algebra B × S 2 is a P lonka sum of two copies of B. As a P lonka sum of tractable algebras, Theorem 4.1 of [BF15] implies that B × S 2 is tractable as well.
It follows from the corollary and Theorem 6.6 that every finite member of V(A 0 × A 1 × · · · × A n−1 × S 2 ) is at least locally tractable.
As a counterpoint to Theorem 8.1, we mention the following. The proof requires some basic tame congruence theory, for which we refer the reader to [HM88, Thm 9.10]. In a congruence-permutable variety, an algebra is abelian if and only if it is polynomially equivalent to a faithful, unital module over a ring. See [Ber12,Thm 7.35] for a full discussion. For example, consider the ring Z 3 as a module over itself. Define the binary polynomial x · y = 2x + 2y on this module. The table for this operation is given at the left of Figure 2. Conversely, we can retrieve the module operations from '·' by x + y = 0 · (x · y) and 2x = 0 · x. Consequently, the commutative idempotent binar Sq 3 is abelian.
In light of Theorem 6.7, every finite, abelian CIB will be of this form. We make the following observation.
Proposition 8.6. A finite, abelian CIB has odd order.
Proof. Let A be a finite, abelian CIB. By Theorem 6.7 (since every CIB is Taylor), A is polynomially equivalent to a faithful, unital module M over a ring R. The basic operation of A must be a polynomial of M . Thus there are r, s ∈ R and b ∈ M such that x·y = rx+sy +b. Let 0 denote the zero element of M . Then 0 = 0 · 0 = r0 + s0 + b = b. The condition x · y = y · x implies rx + sy = ry + sx, so (by taking y = 0 and since M is faithful), r = s. Finally by idempotence, 2r = 1. Now, if A, hence M , has even cardinality, there is an element a ∈ A, a = 0, of additive order 2. Thus a = a · a = 2ra = 0 which is a contradiction.
For the remainder of this section, let A be a CIB with universen. We consider the various possibilities for n and A (up to isomorphism), and in each case show that the associated CSP is tractable. In order to make it clear that our inventory is complete, a few of the arguments and computations are postponed until the end. n = 2. There is a unique 2-element CIB, namely S 2 . Idempotence determines the diagonal entries in the table, and by commutativity, the remaining two entries must be equal. The choices 0 and 1 for the off-diagonal yield a meet-semilattice and a join-semilattice respectively. As we remarked above, every finite semilattice is tractable, and, in fact, Sl, the variety of semilattices, is SD-∧. n = 3, A not simple. Let θ ∈ Con A be nontrivial (i.e., 0 A < θ < 1 A ). By idempotence, every congruence class is a subalgebra. Evidently, A/θ has cardinality 2, one θ class has 2 elements, and the other has 1. From the uniqueness of the 2-element algebra, A/θ and each of the θ-classes are semilattices. Consequently, A ∈ Sl • Sl. By Theorem 1.2, Sl • Sl is SD-∧, so by Theorem 6.3, A is tractable. n = 3, A simple. If A has no proper nontrivial subalgebras, then in A, x = y =⇒ x · y / ∈ {x, y}. It follows that A must be the 3-element Steiner quasigroup, Sq 3 , of Figure 2. By Corollary 8.4, A is tractable.
Finally, if A has a proper nontrivial subalgebra, that subalgebra must be isomorphic to S 2 . Thus no nontrivial subalgebra of A is abelian. By Theorem 8.5, A generates an SD-∧ variety, so is tractable by Theorem 6.3. For future reference, we remark that there are two non-isomorphic algebras meeting the description in this paragraph, T 1 and T 2 . Their tables are given in Figure 2. n = 4, A not simple. Let θ be a maximal congruence of A. Then A/θ is simple, so A/θ is isomorphic to one of T 1 , T 2 , Sq 3 , or S 2 . If A/θ ∼ = T i , then the θ-classes must have sizes 1, 1, and 2. Consequently, each θ-class is a semilattice, so A ∈ Sl • V(T i ) which is SD-∧ by the computations above and Theorem 1.2. Thus A is tractable.
The next case to consider is A/θ ∼ = Sq 3 . Without loss of generality, assume that θ partitions the universe as |01|2|3|, and further that 0 · 1 = 0. From these data we deduce that the operation table for A must be · 0 1 2 3 0 0 0 3 2 1 0 1 3 2 2 3 3 2 a 3 2 2 a 3 with a ∈ {0, 1}. If a = 0, then the only way to obtain 1 as a product is 1 · 1. In that case there is a homomorphism onto S 2 with kernel ψ = |023|1|. We have θ ∩ ψ = 0 A , so A is a subdirect product of Sq 3 × S 2 . Therefore, by Corollary 8.4, A is tractable. More problematic is the case a = 1, but we already established tractability of that algebra in Example 7.4.
Finally, suppose that A/θ ∼ = S 2 . The possible sizes of the θ-classes are 3, 1 or 2, 2. If neither class is isomorphic to Sq 3 then the classes both lie in an SD-∧ variety, so by Theorem 1.2, A too lies in an SD-∧ variety and is thus tractable. If one of the classes is isomorphic to Sq 3 (there are 7 such algebras), then A is an EC algebra (the term t(x, y) = y · (x · y) is Maltsev, hence is an edge term) and we can apply Theorem 7.7 to establish that A is tractable. n = 4, A simple. By Theorem 8.5, if HS(A) contains no nontrivial abelian algebra, then A is tractable. Thus, we may as well assume that HS(A) contains an abelian algebra. By Proposition 8.6, A itself is nonabelian. Consequently (since A is simple) A must have a subalgebra isomorphic to Sq 3 . Without loss of generality, let us assume that {1, 2, 3} forms this subalgebra. Similarly, by Corollary 8.4, we can assume that HS(A) contains a copy of S 2 . Examining the 2-and 3-element CIBs, it is easy to see that if S 2 ∈ HS(A), then already S 2 ∈ S(A). By the symmetry of Sq 3 , and the fact that it contains no semilattice, we can assume that {0, 1} forms the semilattice. Thus, the table for A must have one of the following two forms.
Our intent is to apply the rectangularity theorem to establish the tractability of these 7 algebras. For this, we need to determine the minimal absorbing subuniverses of each subalgebra of A. First observe that if {a, b} forms a copy of S 2 with a · b = a, then {a} t {a, b}, with t(x, y) = x · y, while {b} is not absorbing since a is a sink (Lemma 4.10). Second, by Lemma 4.13, Sq 3 is absorption-free, which is to say, it is its own minimal absorbing subalgebra. Now let B be a proper minimal absorbing subalgebras of A i , for i < 7. Then either B ∩ {1, 2, 3} is absorbing in {1, 2, 3} or it is empty (Lemma 4.8). As {1, 2, 3} ∼ = Sq 3 is absorption free and B is a proper subalgebra of A, we must have B = {1, 2, 3} or B = {0}. However the first of these is impossible because {1, 2, 3}∩{0, 1} = {1}, which is not absorbing in {0, 1} since 0 is a sink. Thus the only possible proper absorbing subalgebra of A is {0}.
For i 2, {0} is indeed absorbing in A i . We believe that the shortest binary absorbing term in each case is as follows.
(8.1) However, observe that if i > 2 then according to Figure 3 either u 2 = 2 or u 3 = 3. If u 2 = 2 then 2 is a sink for the subuniverse {0, 2}. In that case {0} = B ∩ {0, 2} is not absorbing in {0, 2} contradicting the fact that B is absorbing in A. A similar argument works for u 3 = 3 and {0, 3}. Thus A i is absorption free for i > 2. We summarize these computations in the following table.
Algebra Minimal Absorbing Subalgebra The crucial point here is that every member of S(A i ) has a unique minimal absorbing subalgebra. We make one more observation. Let i < 7 and let h be an automorphism of A i . Then h(0) = 0. This holds because {1, 2, 3} must be preserved by h, as it is the unique 3-element subalgebra. Of course since S 2 has no nontrivial automorphisms, h(0) = 0 also holds in that algebra.
We now proceed to argue that each algebra from Figure 3 is tractable. Following Definition 6.1, let I = V, A, S, R be an instance of CSP(A i ), for some i < 7. We shall simply write A instead of A i . We have A = (C 0 , C 1 , . . . , C n−1 ), in which each C i is a subalgebra of A, and R = (R 0 , . . . , R J−1 ) is a list of subdirect products of the various C k 's. We must show that there is an algorithm that determines, in polynomial time, whether this instance has a solution. For this we will use Corollary 5.8.
For every k < n let B k be the minimal absorbing subuniverse of C k . As mentioned, B k is unique. Let α = { k < n : C k is abelian } and set α =n − α. By reordering the factors, we may assume that α = {0, 1, . . . , p − 1} for some p < n.
Fix j < J. There is an equivalence relation on α defined by k ∼ j iff ρ j k = ρ j . Call the least index in each equivalence class the leader. The remaining elements are the followers. When k ∼ j , subdirectness of R j implies that C k ∼ = R j /ρ j k = R j /ρ j ∼ = C . Thus, there is an isomorphism h j k, : C k → C such that Proj k, (R j ) = (x, h j k, (x)) : x ∈ C k . These maps are consistent in the sense that if k ∼ ∼ m then h k,m = h ,m • h k, . Observe also that h k, (B k ) = B , since the minimal absorbing subalgebra is unique in each factor. Moreover, 12:34

C. Bergman and W. DeMeo
Vol. 18:1 from our comments about automorphisms, and since k, ∈ α , we have h k, (0) = 0. Finally, for k ∼ j , define H j k, = Proj k, (R j ), so (0, 0) ∈ H j k, whenever k ∼ j . For each j < J, let the relationR j be obtained from R j as follows. First, for each follower , remove the -th variable from the scope of R j . Then, defineR j = R j × / ∈im σ j C . LetR = (R j : j < J) andH = (H j k, : j < J, k ∼ j ). Lastly, letĪ denote the modification of I withR ∪H replacing R and every scope equal to V. Then the solution set ofĪ is identical to the solution set of the original instance I. (To be more precise, the relations inR ∪H are pp-definable (see [BKW17,Sec. 3.1]) from R and conversely.) Consider the partial instanceĪp. This is an instance of the problem CSP(Sq 3 ), which is tractable. If the partial instance has no solution, then neither does I, and we halt. So suppose thatĪp has a solution, x. (We do not actually need to know x, just that it exists.) Since Sq 3 is absorption-free, x ∈ α C k = α B k .
We now wish to apply Corollary 5.8 to show that The first 3 conditions follow from the definition of α and the construction of theR j 's. The fifth condition holds because of the solution x to the partial instance. We must address the fourth requirement. Fix j < J. We shall show thatR j intersects B k . We have two cases to consider. First, suppose that i < 3. In that case the minimal absorbing subalgebra of A is {0}, with corresponding absorbing term given in (8.1). Think of that term as a nonassociative product. For every ∈ α, B = {1, 2, 3} = C , while for ∈ α , B = {0}. SinceR j is subdirect, for every ∈ α there is a tuple r ∈ R j with r = 0. Let r be the "product" (under the absorbing term) of all the r 's. (For definiteness, associate to the right.) Then, since {0} is absorbing, r = 0 ∈ B for every ∈ α , and for ∈ α, r ∈ C = B . Thus the condition is satisfied.
The argument when i 3 is not very different. In this case, let β = { < n : C = S 2 }. Note that if / ∈ β then B = C . As before, for ∈ β let r be a tuple with r = 0, and let r be the product. (This time simply use the basic binary operation to compute the product. It is, after all, an absorbing term for S 2 .) Then for ∈ β, r = 0 ∈ B , while, for / ∈ β, r ∈ C = B .
Thus inclusion (8.2) holds. Let 0 denote a tuple of 0's indexed by α , and set y to be the concatenation of x with 0. Then y ∈ R by (8.2). On the other hand, for any j < J and k ∼ j , we have (y k , y ) = (0, 0) ∈ H j k, . Thus y is a solution toĪ.

Acknowledgements
The authors wish to thank the anonymous referee for identifying errors, suggesting corrections, and providing many other valuable suggestions for improvements. The authors also gratefully acknowledge the support of National Science Foundation grant no. 1500218.