1 Introduction

In universal algebra, investigations of systems of equations usually focus on either finding a solution, the complexity of finding a solution or deciding if there is a solution at all. For us the main interest is the “shape” of the solution sets, just like in the following basic result of linear algebra: solution sets of systems of homogeneous linear equations in n variables over a field K are precisely the subspaces of the vector space \(K^{n}\), i.e., sets of n-tuples that are closed under linear combinations. Our goal is to give a similar characterization (i.e., a kind of closure condition) for solution sets of systems of equations over arbitrary finite algebras.

Let us fix a nonempty set A and a set F of operations on A; then we obtain the algebra \(\mathbb {A}=(A, F)\). Any equation over \(\mathbb {A}\) is of the form \(f(x_1, \ldots , x_n) = g(x_1, \ldots , x_n)\), where f and g are n-ary term functions. We can also say that f and g are from the set [F] of operations generated by F by means of compositions. After this observation we can see that in every equation, the operations on both sides are from \(C:=[F]\), which we will call the clone generated by F (Definition 2.1). We will investigate solution sets of systems of equations over finite algebras in this view. The algebraic sets studied by B. I. Plotkin in his universal algebraic geometry [10] are essentially the same as our solution sets; the only difference being that we consider only finite systems of equations. Recently A. Di Nola, G. Lenzi and G. Vitale characterized the solution sets of certain systems of equations over lattice ordered abelian groups (see [3]).

In our previous paper [12] we proved that for any system of equations over a clone C, the solution set is closed under the centralizer of the clone C (see Definition 2.2). We also proved that for clones of Boolean functions this condition is sufficient as well. We will say that a clone (or the associated algebra) has Property \({{\,\mathrm{(SDC)}\,}}\) if closure under the centralizer characterizes the solution sets (here SDC stands for “Solution sets are Definable by closure under the Centralizer”). Thus clones of Boolean functions (i.e., two-element algebras) always have Property \({{\,\mathrm{(SDC)}\,}}\), and in [12] we gave an example of a three-element algebra that does not have Property \({{\,\mathrm{(SDC)}\,}}\). In this paper we describe all finite lattices and semilattices with Property \({{\,\mathrm{(SDC)}\,}}\). In Section 2 we present the necessary notations and definitions. In Section 3 we give a connection between Property \({{\,\mathrm{(SDC)}\,}}\) and quantifier elimination of certain primitive positive formulas. Also we show that for systems of equations over a clone C, if all solution sets can be described by closure under a clone D, then D must be the centralizer of C. Section 4 contains the full description of finite lattices with Property \({{\,\mathrm{(SDC)}\,}}\): a finite lattice has Property \({{\,\mathrm{(SDC)}\,}}\) if and only if it is a Boolean lattice. In Section 5 finite semilattices having Property \({{\,\mathrm{(SDC)}\,}}\) are described as semilattice reducts of distributive lattices.

2 Preliminaries

2.1 Operations and clones

Let A be an arbitrary set with at least two elements. By an operation on A we mean a map \(f:A^{n}\rightarrow A\); the positive integer n is called the arity of the operation f. The set of all operations on A is denoted by \({\mathcal {O}}_A\). For a set \(F\subseteq {\mathcal {O}}_A\) of operations, by \(F^{(n)}\) we mean the set of n-ary members of F. In particular, \({\mathcal {O}}_A^{(n)}\) stands for the set of all n-ary operations on A.

We will denote tuples by boldface letters, and we will use the corresponding plain letters with subscripts for the components of the tuples. For example, if \({\mathbf {a}}\in A^{n}\), then \(a_{i}\) denotes the i-th component of \({\mathbf {a}}\), i.e., \({\mathbf {a}}=(a_{1},\ldots ,a_{n})\). In particular, if \(f\in {\mathcal {O}}_A^{(n)}\), then \(f({\mathbf {a}})\) is a short form for \(f(a_{1},\ldots ,a_{n})\). If \({\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)}\in A^{n}\) and \(f\in \mathcal {O}_{A}^{(m)}\), then \(f({\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)})\) denotes the n-tuple obtained by applying f to the tuples \({\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)}\) componentwise:

$$\begin{aligned} f({\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)})=\bigl (f(t_{1}^{(1)},\ldots ,t_{1}^{(m)}),\ldots ,f(t_{n}^{(1)},\ldots ,t_{n}^{(m)})\bigr ). \end{aligned}$$

We say that \(T\subseteq A^{n}\) is closed underC, if for all \(m\in {\mathbb {N}},{\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)}\in T\) and for all \(f\in C^{(m)}\) we have \(f({\mathbf {t}}^{(1)},\ldots ,{\mathbf {t}}^{(m)})\in T\).

Let \(f\in {\mathcal {O}}_A^{(n)}\) and \(g_{1},\ldots ,g_{n}\in {\mathcal {O}}_A^{(k)}\). By the composition of f by \(g_{1},\ldots ,g_{n}\) we mean the operation \(h\in {\mathcal {O}}_A^{(k)}\) defined by

$$\begin{aligned} h({\mathbf {x}})=f\bigl (g_{1}({\mathbf {x}}),\ldots ,g_{n}({\mathbf {x}})\bigr )\text { for all }{\mathbf {x}}\in A^{k}. \end{aligned}$$

Now we present the precise definition of clones.

Definition 2.1

If \(C\subseteq {\mathcal {O}}_A\) is closed under composition and contains the projections\(e_i^{(n)}:(x_{1},\ldots ,x_{n})\mapsto x_{i}\) for all \(1\le i\le n\in {\mathbb {N}}\), then C is said to be a clone (notation: \(C\le {\mathcal {O}}_A\)).

For an arbitrary set F of operations on A, there is a least clone [F] containing F, called the clone generated by F. The elements of this clone are those operations that can be obtained from members of F and from projections by finitely many compositions. In other words, [F] is the set of term operations of the algebra \(\mathbb {A}= (A,F)\).

The set of all clones on A is a lattice under inclusion; the greatest element of this lattice is \({\mathcal {O}}_A\), and the least element is the trivial clone consisting of projections only. There are countably infinitely many clones on the two-element set; these have been described by Post [11], hence the lattice of clones on \(\{0,1\}\) is called the Post lattice. If A is a finite set with at least three elements, then the clone lattice on A is of continuum cardinality [8], and it is a very difficult open problem to describe all clones on A even for \(\vert A\vert =3\).

2.2 Centralizer clones

We say that the operations \(f\in {\mathcal {O}}_A^{(n)}\) and \(g\in {\mathcal {O}}_A^{(m)}\)commute (notation: \(f\perp g\)) if

$$\begin{aligned}&f\bigl (g(a_{11},a_{12},\dotsc ,a_{1m}),\dotsc ,g(a_{n1},a_{n2},\dotsc ,a_{nm})\bigr )\\&\quad =g\bigl (f(a_{11},a_{21},\dotsc ,a_{n1}),\dotsc ,f(a_{1m},a_{2m},\dotsc ,a_{nm})\bigr ) \end{aligned}$$

holds for all \(a_{ij}\in A~(1\le i\le n,1\le j\le m)\). This can be visualized as follows: for every \(n\times m\) matrix \(Q=(a_{ij})\), first applying g to the rows of Q and then applying f to the resulting column vector yields the same result as first applying f to the columns of Q and then applying g to the resulting row vector (see Figure 1).

Fig. 1
figure 1

Commutation of f and g

Definition 2.2

For any \(F\subseteq {\mathcal {O}}_A\), the set \(F^{*}:=\{g\in {\mathcal {O}}_A\mid f\perp g\) for all \(f\in F\}\) is called the centralizer of F.

It is easy to verify that if \(f,g_{1},\ldots ,g_{n}\) all commute with an operation h, then the composition \(f(g_{1},\ldots ,g_{n})\) also commutes with h. This implies that \(F^*\) is a clone for all \(F \subseteq {\mathcal {O}}_A\) (even if F itself is not a clone).

Clones arising in this form are called primitive positive clones; such clones seem to be quite rare: there are only finitely many primitive positive clones over any finite set [2].

Example 2.3

Let K be a field, and let L be the clone of all operations over K that are represented by a linear polynomial:

$$\begin{aligned} L:=\{a_{1}x_{1}+\cdots +a_{k}x_{k}+c \mid k\ge 0,a_{1},\ldots ,a_{k},c\in K\}. \end{aligned}$$

Since L is generated by the operations \(x+y\), \(ax~(a\in K)\) and the constants \(c\in K\), the centralizer \(L^{*}\) consists of those operations f over K that commute with \(x+y\) and ax (i.e., f is additive and homogeneous), and also commute with the constants (i.e., \(f(c,\ldots ,c)=c\) for all \(c\in K\)):

$$\begin{aligned} L^{*}:=\{a_{1}x_{1}+\cdots +a_{k}x_{k} \mid k\ge 1,a_{1},\ldots ,a_{k}\in K\text { and }a_{1}+\cdots +a_{k}=1\}. \end{aligned}$$

Similarly, one can verify that \(L_{0}^{*}=L_{0}\) for the clone

$$\begin{aligned} L_{0}:=\{a_{1}x_{1}+\cdots +a_{k}x_{k} \mid k\ge 0,a_{1},\ldots ,a_{k}\in K\}. \end{aligned}$$

2.3 Equations and solution sets

Let us fix a finite set A, a clone \(C\le {\mathcal {O}}_A\) and a natural number n. By an n-ary equation overC (C-equation for short) we mean an equation of the form \(f(x_{1},\ldots ,x_{n})=g(x_{1},\ldots ,x_{n})\), where \(f,g\in C^{(n)}\). We will often simply write this equation as a pair (fg). A system ofC-equations is a finite set of C-equations of the same arity:

$$\begin{aligned} {\mathcal {E}}:=\bigl \{(f_{1},g_{1}),\ldots ,(f_{t},g_{t})\bigr \}\text {, where }f_{i},g_{i}\in C^{(n)} (i=1,\ldots ,t). \end{aligned}$$

Note that we consider only systems consisting of a finite number of equations. This does not restrict generality, since we are dealing only with finite algebras. We define the set of solutions of\({\mathcal {E}}\) as the set

$$\begin{aligned} {\text {Sol}}({\mathcal {E}}):=\bigl \{{\mathbf {a}}\in A^{n} \mid f_{i}({\mathbf {a}})=g_{i}({\mathbf {a}})\text { for }i=1,\ldots ,t\bigr \}. \end{aligned}$$

For \({\mathbf {a}}\in A^{n}\) we denote by \({\text {Eq}}_{C}({\mathbf {a}})\) the set of C-equations satisfied by \({\mathbf {a}}\):

$$\begin{aligned} {\text {Eq}}_{C}({\mathbf {a}}):=\bigl \{(f,g) \mid f,g\in C^{(n)}\text { and }f({\mathbf {a}})=g({\mathbf {a}})\bigr \}. \end{aligned}$$

Let \(T\subseteq A^{n}\) be an arbitrary set of tuples. We denote by \({\text {Eq}}_{C}(T)\) the set of C-equations satisfied by T:

$$\begin{aligned} {\text {Eq}}_{C}(T):=\bigcap _{{\mathbf {a}}\in T}{\text {Eq}}_{C}({\mathbf {a}}). \end{aligned}$$

Remark 2.4

For any given \(n \in {\mathbb {N}}\) and \(C\le {\mathcal {O}}_A\), the operators \({{\,\mathrm{Sol}\,}}\) and \({{\,\mathrm{Eq}\,}}_C\) give rise to a Galois connection between sets of n-tuples and systems of n-ary equations. In particular, if T is the solution set of a system of equations (i.e., T is Galois closed), then \(T={{\,\mathrm{Sol}\,}}({{\,\mathrm{Eq}\,}}_C(T))\); moreover, \({\mathcal {E}}={{\,\mathrm{Eq}\,}}_C(T)\) is the largest system of equations with \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\).

Example 2.5

Considering the “linear” clones of Example 2.3, L-equations are linear equations and \(L_{0}\)-equations are homogeneous linear equations.

In a previous paper [12] we proved that for any clone, the solution sets are closed under the centralizer of the clone. Furthermore, we proved the following theorem, which characterizes solution sets of systems of equations over clones of Boolean functions.

Theorem 2.6

[12]. For any clone of Boolean functions \(C\le \mathcal {O}_{\{0,1\}}\) and \(T\subseteq \{0,1\}^n\), the following conditions are equivalent:

  1. (a)

    there is a system \({\mathcal {E}}\) of C-equations such that \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\);

  2. (b)

    T is closed under \(C^*\).

Thus for two-element algebras, closure under the centralizer characterizes solution sets. We will say that a clone C has Property \({{\,\mathrm{(SDC)}\,}}\), if this is true for the clone:

Property

(SDC). The following are equivalent for all \(n \in {\mathbb {N}}\) and \(T \subseteq A^n\):

  1. (a)

    there exists a system \({\mathcal {E}}\) of C-equations such that \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\);

  2. (b)

    the set T is closed under \(C^*\).

Here SDC is an abbreviation for “Solution sets are Definable by closure under the Centralizer”. In [12] we presented a clone on a three-element set that does not have Property \({{\,\mathrm{(SDC)}\,}}\), showing that in general this is not a trivial property.

2.4 The Pol-Inv Galois connection

For a positive integer h, a set \(\rho \subseteq A^{h}\) is called an h-ary relation on A; let \({\mathcal {R}}_A\) denote the set of all relations on A. For any \(R \subseteq {\mathcal {R}}_A\), let \(R^{(h)}\) denote the h-ary part ofR, i.e., the set of h-ary members of R.

For a relation \(\rho \subseteq A^h\) and operation \(f \in {\mathcal {O}}_A^{(n)}\), if for arbitrary tuples \({\mathbf {a}}^{(1)}, \ldots , {\mathbf {a}}^{(n)} \in \rho \) we have \(f({\mathbf {a}}^{(1)}, \ldots , {\mathbf {a}}^{(n)}) \in \rho \), then we say that f is a polymorphism of \(\rho \), or \(\rho \) is an invariant relation of f (or we also say that fpreserves\(\rho \)). We will denote this as \(f\vartriangleright \rho \). Note that \(f \vartriangleright \rho \) is equivalent to \(\rho \) being closed under f (see Section 2.1). Preservation induces the so-called \({\text {Pol}}\)-\({\text {Inv}}\)Galois connection. For any \(F \subseteq {\mathcal {O}}_A\) and for any \(R \subseteq {\mathcal {R}}_A\), let

$$\begin{aligned} {\text {Inv}}{(F)}&:=\{ \rho \in {\mathcal {R}}_A\mid \forall f\in F:f\vartriangleright \rho \}, \text { and} \\ {\text {Pol}}{(R)}&:=\{ f \in {\mathcal {O}}_A\mid \forall \rho \in R:f\vartriangleright \rho \}. \end{aligned}$$

It is easy to verify that \({\text {Pol}}{(R)}\) is a clone for all \(R \subseteq {\mathcal {R}}_A\). Moreover, for every set of operations F on a finite set, the clone generated by F is \([F]={\text {Pol}}({\text {Inv}}(F))\) by the results of Bodnarčuk, Kalužnin, Kotov, Romov and Geiger [1, 5].

Given a set of relations \(R \subseteq {\mathcal {R}}_A\), a primitive positive formula overR (pp. formula for short) is a formula of the form

(2.1)

where \(\rho _j \in R^{(r_j)}\), and \(z_i^{(j)} \ (j = 1, \ldots , t, \text { and } i=1, \ldots , r_j)\) are variables from the set \(\{x_1, \ldots , x_n, y_1, \ldots , y_m\}\). The set

$$\begin{aligned} {\text {rel}}{(\Phi )}:=\{ (a_1, \ldots , a_n) \mid \Phi (a_1, \ldots , a_n) \text { is true}\} \end{aligned}$$

is an n-ary relation, which is the relation defined by\(\Phi \). If \(R \subseteq {\mathcal {R}}_A\), then let \(\langle R\rangle _\exists \) denote the set of all relations that can be defined by a primitive positive formula over \(R\cup \{=\}\), and let \(\langle R \rangle _{\not \exists }\) denote the set of all relations that can be defined by a quantifier-free primitive positive formula over \(R\cup \{=\}\). If \(R \subseteq {\mathcal {R}}_A\) contains the equality relation and R is closed under primitive positive definability, then we say that R is a relational clone. The relational clone generated by R is \(\langle R \rangle _\exists ={\text {Inv}}({\text {Pol}}(R))\) [1, 5].

For \(f \in {\mathcal {O}}_A^{(n)}\), we define the following relation on A, called the graph off:

$$\begin{aligned} f^{\bullet } =\{ ( a_{1},\ldots ,a_{n},b) \mid f(a_{1},\ldots ,a_{n}) =b\} \subseteq A^{n+1}. \end{aligned}$$

For \(F\subseteq {\mathcal {O}}_A\), let \(F^{\bullet } =\{ f^{\bullet } \mid f\in F\}\). It is not hard to see that for any \(f \in {\mathcal {O}}_A^{(n)}\) and \(g \in {\mathcal {O}}_A^{(m)}\) the function f commutes with g if and only if f preserves the graph of g (or equivalently, if and only if g preserves the graph of f). Therefore for any \(F \subseteq {\mathcal {O}}_A\) we have \(F^*={\text {Pol}}(F^\bullet )\).

3 Quantifier elimination

Let \(F \subseteq {\mathcal {O}}_A\), then let \(F^{\circ } \) denote the set of all relations that are solution sets of some equation over F:

$$\begin{aligned} F^{\circ } =\bigl \{ {{\,\mathrm{Sol}\,}}(f,g) \bigm | n\in {\mathbb {N}},\mathbb {~}f,g\in F^{(n)} \bigr \} \subseteq {\mathcal {R}}_A. \end{aligned}$$

The following remark shows that the graph of an operation \(f \in F\) also belongs to \(F^\circ \).

Remark 3.1

Let \(f \in {\mathcal {O}}_A^{(n)}\), and define \({\widetilde{f}} \in {\mathcal {O}}_A^{(n+1)}\) by \({\widetilde{f}}(x_1,\ldots , x_n, x_{n+1}):=f(x_1,\ldots , x_n)\). Then we have

$$\begin{aligned}&{{\,\mathrm{Sol}\,}}\big ({\widetilde{f}},\, e_{n+1}^{(n+1)}\big ) \\&\quad =\bigl \{ (a_1, \ldots , a_n, b) \in A^{n+1} \bigm | {\widetilde{f}}(a_1, \ldots , a_n, b)=e_{n+1}^{(n+1)}(a_1,\ldots , a_n, b) \bigr \} \\&\quad =\bigl \{ (a_1, \ldots , a_n, b) \in A^{n+1} \bigm | f(a_1, \ldots , a_n)=b \bigr \}= f^\bullet . \end{aligned}$$

The following three lemmas prepare the proof of Theorem 3.6, which gives us an equivalent condition to Property \({{\,\mathrm{(SDC)}\,}}\) that we will use in Sections 4 and 5.

Lemma 3.2

For every clone \(C\le {\mathcal {O}}_A\), we have \(C^{\bullet }\subseteq C^{\circ }\) and \(\left\langle C^{\bullet }\right\rangle _{\exists }=\left\langle C^{\circ }\right\rangle _{\exists }\).

Proof

In accordance with Remark 3.1, for all \(f \in C\) we have \({{\,\mathrm{Sol}\,}}({\widetilde{f}},e_{n+1}^{(n+1)})=f^\bullet \in C^\circ \). Therefore \(C^\bullet \subseteq C^\circ \), which implies that \( \langle C^\bullet \rangle _\exists \subseteq \langle C^\circ \rangle _\exists \). To prove the reversed containment, let us consider an arbitrary relation \(\rho ={{\,\mathrm{Sol}\,}}(f,g) \in C^\circ \) with \(f,g \in C^{(n)}\). Then, for any \((x_1, \ldots , x_n) \in A^n\), we have

This means that \(\rho \) can be defined by a pp. formula over \(\{f^\bullet , g^\bullet \}\), therefore \(\rho \in \langle C^\bullet \rangle _\exists \). Thus, we obtain \(C^\circ \subseteq \langle C^\bullet \rangle _\exists \), and this implies that \(\langle C^\circ \rangle _\exists \subseteq \langle \langle C^\bullet \rangle _\exists \rangle _\exists = \langle C^\bullet \rangle _\exists \). Therefore \(\langle C^{\bullet }\rangle _\exists =\langle C^{\circ }\rangle _\exists \). \(\square \)

Lemma 3.3

For every clone \(C\le {\mathcal {O}}_A\) and \(T\subseteq A^{n}\), there is a system \({\mathcal {E}}\) of C-equations such that \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\) if and only if \(T\in \langle C^{\circ }\rangle _{\not \exists }\).

Proof

Let \(\Phi \) be an arbitrary quantifier-free pp. formula over \(C^\circ \). By definition, \(\Phi \) is of the form

where \(n, t \in {\mathbb {N}}, f_j, g_j \in C^{(r_j)}\) and \(z_1^{(j)}, \ldots , z_{r_j}^{(j)} \in \{x_1, \ldots , x_n\}\) for all \(j= 1, \ldots , t\). We define the operations \({\widetilde{f_j}}(x_1, \ldots , x_n):=f_j(z_1^{(j)}, \ldots , z_{r_j}^{(j)})\) and \({\widetilde{g_j}}(x_1, \ldots , x_n):=g_j(z_1^{(j)}, \ldots , z_{r_j}^{(j)})\) (by identifying variables and by adding fictitious variables) for all \(j=1, \ldots , t\). Then \(\Phi \) is equivalent to the formula

and \({\widetilde{f_j}}, {\widetilde{g_j}} \in C^{(n)}\) for all \(j= 1, \ldots , t\). Since \(\Phi \) and \(\Psi \) are equivalent, they define the same set \(T \subseteq A^n\), and it is obvious that the set defined by \(\Psi \) is the solution set of the system \(\{({\widetilde{f_1}},{\widetilde{g_1}}),\ldots ,({\widetilde{f_t}},{\widetilde{g_t}})\}\). Conversely, it is clear that every solution set can be defined by a quantifier-free pp. formula of the form of \(\Psi \). \(\square \)

Lemma 3.4

For every clone \(C \le {\mathcal {O}}_A\), we have \({\text {Inv}}{(C^*)}=\langle C^\bullet \rangle _\exists \). Consequently, a set \(T \subseteq A^n\) is closed under \(C^ *\) if and only if \(T\in \langle C^\circ \rangle _\exists \).

Proof

From Section 2 using that \(F^*={\text {Pol}}(F^\bullet )\) and that \({\text {Inv}}({\text {Pol}}(R))= \langle R \rangle _\exists \), we have

$$\begin{aligned} {\text {Inv}}{(C^*)} ={\text {Inv}}{({\text {Pol}}{(C^\bullet )})}=\langle C^\bullet \rangle _\exists . \end{aligned}$$

The second statement of the lemma follows immediately from Lemma 3.2 by observing that T is closed under \(C^*\) if and only if \(T \in {\text {Inv}}(C^*)\). \(\square \)

Theorem 3.5

[12]. For every clone \(C\le {\mathcal {O}}_A\) and \(T\subseteq A^{n}\), if there is a system \({\mathcal {E}}\) of C-equations such that \(T= {{\,\mathrm{Sol}\,}}({\mathcal {E}}) \), then T is closed under \(C^{*}\).

Proof

Let \(C\le {\mathcal {O}}_A, T\subseteq A^{n}\), and let \({\mathcal {E}}\) be a system of C-equations and \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\). By Lemma 3.3 we have \(T \in \langle C^\circ \rangle _{\not \exists } \subseteq \langle C^\circ \rangle _\exists \). Using Lemma 3.4, this means that T is closed under \(C^*\). \(\square \)

The previous theorem shows that in Property \({{\,\mathrm{(SDC)}\,}}\), condition (a) implies (b). Therefore, for all clones \(C \le {\mathcal {O}}_A\), it suffices to investigate the implication \((\text {b}) \implies (\text {a})\). As a consequence of Lemmas 3.2, 3.3 and 3.4, we obtain the promised equivalent reformulation of Property \({{\,\mathrm{(SDC)}\,}}\) in terms of quantifier elimination.

Theorem 3.6

For every clone \(C\le {\mathcal {O}}_A\), the following five conditions are equivalent:

  1. (i)

    C has Property \({{\,\mathrm{(SDC)}\,}}\);

  2. (ii)

    \(\langle C^\circ \rangle _{\not \exists }={\text {Inv}}{(C^{*})}\);

  3. (iii)

    \(\langle C^\circ \rangle _{\not \exists }=\langle C^\circ \rangle _\exists \);

  4. (iv)

    every primitive positive formula over \(C^{\circ }\) is equivalent to a quantifier-free primitive positive formula over \(C^\circ \);

  5. (v)

    \(\langle C^\circ \rangle _{\not \exists }\) is a relational clone.

Proof

  • (i)\(\iff \)(ii): By Lemma 3.3, T is the solution set of some system of equations over C if and only if \(T \in \langle C^\circ \rangle _{\not \exists }\).

  • (ii)\(\iff \)(iii): This follows from (the proof of) Lemma 3.4.

  • (iii)\(\iff \)(iv): This is trivial.

  • (iii)\(\iff \)(v): This follows from the fact that the relational clone generated by \(\langle C^\circ \rangle _{\not \exists }\) is \(\langle C^\circ \rangle _\exists \). \(\square \)

In the following corollary, we will see that Theorem 3.6 implies that \(C^*\) is the only clone that can describe solution sets over C (if there is such a clone at all). Thus, the abbreviation SDC can also stand for “Solution sets are Definable by closure under any Clone”.

Corollary 3.7

Let \(C \le {\mathcal {O}}_A\) be a clone, and assume that there is a clone D such that for all \(n\in {\mathbb {N}}\) and \(T \subseteq A^n\) the following equivalence holds:

$$\begin{aligned} T \text { is the solution set of a system of { C}-equations} \iff T \text { is closed under } D. \end{aligned}$$

Then we have \(D=C^*\).

Proof

The condition in the corollary gives us by Lemma 3.3 that for all \(T \subseteq A^n\), we have \(T \in \langle C^\circ \rangle _{\not \exists }\) if and only if \(T \in {\text {Inv}}{(D)}\). This means that \(\langle C^\circ \rangle _{\not \exists } = {\text {Inv}}{(D)}\), thus \(\langle C^\circ \rangle _{\not \exists }\) is a relational clone. Therefore, by Theorem 3.6 this is equivalent to the condition \({\text {Inv}}{(C^*)}= \langle C^\circ \rangle _{\not \exists } ={\text {Inv}}{(D)}\). Applying the operator \({\text {Pol}}\) to the last equality we get that

$$\begin{aligned} C^*={\text {Pol}}{({\text {Inv}}{(C^*)})}={\text {Pol}}{({\text {Inv}}{(D)})}=D. \end{aligned}$$

\(\square \)

4 Systems of equations over lattices

In this, and in the following section \(\mathbb {L}=(L, \wedge , \vee )\) denotes a finite lattice, with meet operation \(\wedge \) and join operation \(\vee \). Furthermore, \(0_\mathbb {L}\) denotes the least and \(1_\mathbb {L}\) denotes the greatest element of \(\mathbb {L}\) (that is, \(0_\mathbb {L}=\bigwedge L\) and \(1_\mathbb {L}=\bigvee L\)).

The following lemma shows that Property \({{\,\mathrm{(SDC)}\,}}\) does not hold for non-distributive lattices, i.e., solution sets of systems of equations over a non-distributive lattice can not be characterized via closure conditions.

Lemma 4.1

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite lattice. If Property \({{\,\mathrm{(SDC)}\,}}\) holds for \(C=[\wedge , \vee ]\), then \(\mathbb {L}\) is a distributive lattice.

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a non-distributive finite lattice and \(C=[\wedge , \vee ] \le {\mathcal {O}}_L\). By Lemma 3.4, the set

$$\begin{aligned} T=\{ (x,y) \mid \exists u \in L:u \wedge x = u \wedge y \text { and } u \vee x = u \vee y \} \subseteq L^2 \end{aligned}$$

is closed under \(C^*\). We prove that T is not the solution set of a system of equations over C, hence Property \({{\,\mathrm{(SDC)}\,}}\) does not hold for C. Suppose that there exists a system of C-equations \({\mathcal {E}}\) such that \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\). Since \(\mathbb {L}\) is not distributive, by Birkhoff’s theorem we know that there is a sublattice of \(\mathbb {L}\), which is isomorphic either to \(N_5\) or \(M_3\). Now neither of the equations

$$\begin{aligned} x=y \ (\iff x \wedge y = x \vee y),\quad x=x \wedge y,\quad x=x \vee y,\quad y = x \wedge y, \quad y = x \vee y \end{aligned}$$

belong to \({\mathcal {E}}\); we prove this by presenting a counterexample for each equation. These counterexamples are shown in Figure 2, where we choose the elements a and b as presented in the figure. (Note that an element u, chosen like on the figure, shows that \((a,b), (b, a) \in T\). In the table, the entry \((x_1,y_1)\) in the line starting with the term s(xy) and column starting with the term t(xy) witnesses that \((x_1,y_1)\) is not a solution of \(s(x, y) = t(x, y)\).)

Fig. 2
figure 2

Counterexamples showing that these equations do not belong to \({\mathcal {E}}\)

There are no other non-trivial 2-variable equations over C, therefore we get that T satifies only trivial equations, hence \(T=L^2\). This is a contradiction, since \((0_\mathbb {L}, 1_\mathbb {L}) \notin T\). \(\square \)

The following lemma will help us prove that Property \({{\,\mathrm{(SDC)}\,}}\) can only hold for Boolean lattices. Before the lemma, for a distributive lattice \(\mathbb {L}\) we define the median of the elements \(x, y, z \in L\) as

$$\begin{aligned} m(x, y, z) = (x \wedge y) \vee (x \wedge z) \vee (y \wedge z) = (x \vee y) \wedge (x \vee z) \wedge (y \vee z). \end{aligned}$$

Lemma 4.2

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a distributive lattice, and for all \(x, y, z, u \in L\) let

$$\begin{aligned} p(x,y,z,u)=(x \wedge y) \vee (x \wedge z) \vee (y \wedge z) \vee (u \wedge x) \vee (u \wedge y) \vee (u \wedge z). \end{aligned}$$

Then for all \(x, y, z, u \in L\) we have

$$\begin{aligned} p(x,y,z,u)=x \vee y \vee z \vee u \iff m(x,y,z) \vee u = x \vee y \vee z. \end{aligned}$$

Proof

Let \(x,y,z, u \in L\) be arbitrary elements. Let us denote m(xyz) simply by m and p(xyzu) by p for better readability.

First let us suppose that \(p=x \vee y \vee z \vee u\). It is easy to see that \(p \le x \vee y \vee z\) always holds (since every meet in p is less than or equal to \(x \vee y \vee z\)). Since \(p=x \vee y \vee z \vee u\), we get that \(p \le x \vee y \vee z \le x \vee y \vee z \vee u = p\), hence \(p=x \vee y \vee z\). Observe that by the distributivity of \(\mathbb {L}\), p can be rewritten as \(p=m \vee (u \wedge (x \vee y \vee z))\), and from the previous chain of inequalities we can see that \(u \le x \vee y \vee z\), therefore we have \(p=m \vee u\). Thus \( m \vee u = p = x \vee y \vee z\).

For the other direction suppose that \(m \vee u = x \vee y \vee z\). Using that \(\mathbb {L}\) is distributive, we get that \(p = m \vee (u \wedge (x \vee y \vee z))= (m \vee u) \wedge (m \vee (x \vee y \vee z))\), and by the assumption this implies that \(p=x \vee y \vee z\). Our assumption also implies that \(u \le x \vee y \vee z\), therefore we have \(p = x \vee y \vee z \vee u\). \(\square \)

Theorem 4.3

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite distributive lattice. If Property \({{\,\mathrm{(SDC)}\,}}\) holds for \(C=[\wedge , \vee ]\), then \(\mathbb {L}\) is a Boolean lattice.

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite distributive lattice and let \(C=[\wedge , \vee ] \le {\mathcal {O}}_L\). Since \(\mathbb {L}\) is distributive, by Birkhoff’s representation theorem \(\mathbb {L}\) can be embedded into a Boolean lattice \(\mathbb {B}\), hence we may suppose without loss of generality that \(\mathbb {L}\) is already a sublattice of \(\mathbb {B}\). We can also assume that \(0_\mathbb {L}=0_\mathbb {B}\) and \(1_\mathbb {L}=1_\mathbb {B}\). Let us denote the complement of an element \(x \in \mathbb {B}\) by \(x'\). We define the dual of \(p=p(x,y,z,u)\) (from Lemma 4.2) as \(p^d=q=q(x,y,z,u)\), i.e.,

$$\begin{aligned} q(x,y,z,u)= (x \vee y) \wedge (x \vee z) \wedge (y \vee z) \wedge (u \vee x) \wedge (u \vee y) \wedge (u \vee z). \end{aligned}$$

Let T be the following set:

$$\begin{aligned} T = \big \{(x,y,z) \in L^3 \bigm | \exists u \in L&:p(x,y,z,u) = x \vee y \vee z \vee u \text { and } \\&\quad q(x,y,z,u) = x \wedge y \wedge z \wedge u \big \}. \end{aligned}$$

By Lemma 3.4, the set T is closed under \(C^*\). Let \((x, y, z) \in T\) be arbitrary with an element \(u \in L\) witnessing that \((x,y,z) \in T\). From Lemma 4.2 it follows that \(p(x,y,z,u) = x \vee y \vee z \vee u\) if and only if \(m \vee u = x \vee y \vee z\). Meeting both sides of the latter equality by \(m'\), we get

$$\begin{aligned} u \wedge m'= (m \wedge m') \vee (u \wedge m')= (m \vee u) \wedge m' = (x \vee y \vee z) \wedge m'. \end{aligned}$$
(4.1)

By the dual of Lemma 4.2, we know that \(q(x,y,z,u) = x \wedge y \wedge z \wedge u\) if and only if \(m \wedge u = x \wedge y \wedge z\). Then joining the last equality and (4.1), we get that

$$\begin{aligned} u&= u \wedge 1_\mathbb {L}= u \wedge (m' \vee m) = (u \wedge m') \vee (u \wedge m) \\&= ((x \vee y \vee z) \wedge m') \vee (x \wedge y \wedge z). \end{aligned}$$

It is not hard to derive from the defining identities of Boolean algebras that the latter formula is in fact the symmetric difference \(x \vartriangle y \vartriangle z\) in \(\mathbb {B}\). Alternatively, using Stone’s representation theorem for Boolean algebras, we may assume that x, y and z are sets, and that the operations \(\wedge , \vee , '\) are the set-theoretic intersection, union and complementation. Then m corresponds to the set of elements that belong to at least two of the sets x, y and z. Thus \((x \vee y \vee z) \wedge m'\) consists of those elements that belong to exactly one of x, y and z, and \(((x \vee y \vee z) \wedge m') \vee (x \wedge y \wedge z)\) contains those elements that belong to one or three of the sets x, y and z, and this is indeed \(x \vartriangle y \vartriangle z\) in \(\mathbb {B}\).

We have proved that the element u witnessing that \((x,y,z)\in T\) can only be \(x \vartriangle y \vartriangle z\):

$$\begin{aligned} \forall x,y,z\in L:(x,y,z) \in T \iff \exists u \in L:u=x \vartriangle y \vartriangle z \iff x \vartriangle y \vartriangle z \in L. \end{aligned}$$
(4.2)

It is easy to see that \(\{0_\mathbb {L},1_\mathbb {L}\}^3 \subseteq T\), and using the main theorem of [6], we get that if \((f, g) \in {{\,\mathrm{Eq}\,}}(T)\), then \(f=g\) must hold. (In our case this theorem says that every term function of \(\mathbb {L}\) is uniquely determined by its restriction to \(\{0,1\}^3\).) Therefore only trivial equations can appear in \({{\,\mathrm{Eq}\,}}(T)\), hence \(T=L^3\). Then (4.2) implies that \(\mathbb {L}\) is closed under the ternary operation \(x \vartriangle y \vartriangle z\). In particular, for any \(x \in L\) we have \(x \vartriangle 0 \vartriangle 1 = x' \in L\), which means that \(\mathbb {L}\) is a Boolean lattice. \(\square \)

We will need the following lemmas for the proof of Theorem 4.7, which states that Boolean lattices have Property \({{\,\mathrm{(SDC)}\,}}\). This will complete the determination of lattices with Property \({{\,\mathrm{(SDC)}\,}}\).

Lemma 4.4

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite distributive lattice and let \(C=[\wedge , \vee ]\le {\mathcal {O}}_L\). Then every system of C-equations is equivalent to a system of inequalities \(\{p_1 \le q_1, \ldots , p_l\le q_l\}\), where \(p_i \in [\wedge ]\) and \(q_i \in [\vee ]\) (\(i=1,\ldots , l\)).

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite distributive lattice, let \(C=[\wedge , \vee ]\le {\mathcal {O}}_L\) and let

$$\begin{aligned} {\mathcal {E}}=\{f_1=g_1, \ldots , f_t=g_t\} \end{aligned}$$

be a system of C-equations. For arbitrary \(a, b \in L\) we have \(a=b\) if and only if \(a \le b\) and \(b \le a\), therefore \({\mathcal {E}}\) is equivalent to the system of inequalities

$$\begin{aligned} {\mathcal {E}}'=\{ f_1 \le g_1, g_1\le f_1, \ldots , f_t \le g_t, g_t \le f_t\}. \end{aligned}$$

Denote the disjunctive normal forms of the left hand sides of the inequalities in \({\mathcal {E}}'\) as \(DNF_j\), and denote the conjunctive normal forms of the right hand sides of the inequalities in \({\mathcal {E}}'\) as \(CNF_j\) (\(j =1, \ldots , 2t\)). Then \({\mathcal {E}}'\) is equivalent to the system of inequalities

$$\begin{aligned} \{DNF_1 \le CNF_1, \ldots , DNF_{2t} \le CNF_{2t}\}. \end{aligned}$$

Each \(DNF_j\) is a join of some meets, and each \(CNF_j\) is a meet of some joins. Therefore, for every j the inequality \(DNF_j \le CNF_j\) holds if and only if every meet in \(DNF_j\) is less than or equal to every join in \(CNF_j\). This means that there exists a system of inequalities \(\{p_1 \le q_1, \ldots , p_l \le q_l\}\) equivalent to \({\mathcal {E}}\), such that \(p_i \in [\wedge ]\) and \(q_i \in [\vee ]\) (\(i=1,\ldots , l\)). \(\square \)

Lemma 4.5

Let \(\mathbb {B}=(B, \wedge , \vee , ')\) be a Boolean algebra. Then for arbitrary \(a, b, c, d, u \in B\), we have

  1. (i)

    \(a \wedge u \le b \iff u \le a' \vee b\);

  2. (ii)

    \(b \le a \vee u \iff u \ge a' \wedge b\);

  3. (iii)

    \(a \wedge b' \le c' \vee d \iff a \wedge c \le b \vee d\).

Proof

Let \(a, b, c, d, u \in B\) be arbitrary elements. For the proof of (i) let us first suppose that \(a \wedge u \le b\). Joining both sides of the inequality by \(a'\), we get

$$\begin{aligned} a' \vee (a \wedge u) = (a' \vee a) \wedge (a' \vee u) = 1_\mathbb {B}\wedge (a' \vee u) = a' \vee u \le a' \vee b, \end{aligned}$$

and from this, \(u \le a' \vee b\) follows. For the other direction, if \(u \le a' \vee b\) holds, then meeting both sides by a, we get that

$$\begin{aligned} a \wedge u \le a \wedge (a' \vee b) = (a \wedge a') \vee (a \wedge b) = 0_\mathbb {B}\vee (a \wedge b) = a \wedge b, \end{aligned}$$

and from this, \(a \wedge u \le b\) follows.

The second statement is the dual of (i).

For the proof of (iii) let us use (i) with \(u=a \wedge b'\), and then we get that

$$\begin{aligned} a \wedge b' \le c' \vee d \iff c \wedge (a \wedge b') = (c \wedge a) \wedge b' \le d. \end{aligned}$$

Then using (ii) with \(u=d\), we get

$$\begin{aligned} (c \wedge a) \wedge b' \le d \iff c \wedge a \le b \vee d, \end{aligned}$$

which proves (iii). \(\square \)

Helly’s theorem from convex geometry states that if we have \(k \ (>d)\) convex sets in \({\mathbb {R}}^d\), such that any \(d+1\) of them have a nonempty intersection, then the intersection of all k sets is nonempty as well. The following lemma says something similar for intervals in lattices (with \(d=1\)).

Lemma 4.6

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a lattice, \(c_i, d_i \in L\) (\(i = 1, \ldots , k\)). Then we have

$$\begin{aligned} \bigcap _{i=1}^k [c_i, d_i] \ne \emptyset \iff \forall i, j \in \{1, \ldots , k\}:c_i \le d_j. \end{aligned}$$

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a lattice, and \(c_i, d_i \in L\) (\(i = 1, \ldots , k\)). Then obviously,

$$\begin{aligned} \bigcap _{i=1}^k [c_i, d_i] = [c_1 \vee \dots \vee c_k, d_1 \wedge \dots \wedge d_k], \end{aligned}$$

which is nonempty if and only if \(c_1 \vee \dots \vee c_k \le d_1 \wedge \dots \wedge d_k\), which holds if and only if \(c_i \le d_j\) for all \(i,j \in \{1, \ldots ,k\}\). \(\square \)

The last step in the characterization of finite lattices having Property \({{\,\mathrm{(SDC)}\,}}\) is to show that Boolean lattices do indeed have Property \({{\,\mathrm{(SDC)}\,}}\). For proving this, we will use the equivalence of this property with the quantifier-eliminability for pp. formulas over \(C^\circ =[\wedge , \vee ]^\circ \) (see Theorem 3.6).

Theorem 4.7

If \(\mathbb {L}=(L, \wedge , \vee )\) is a finite Boolean lattice, then Property \({{\,\mathrm{(SDC)}\,}}\) holds for \(C=[\wedge , \vee ]\).

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite Boolean lattice, and let \(C=[\wedge , \vee ]\). Let us denote the complement of an element \(x \in \mathbb {L}\) by \(x'\). By Theorem 3.6, Property \({{\,\mathrm{(SDC)}\,}}\) holds for C if and only if any pp. formula over \(C^\circ \) is equivalent to a quantifier-free pp. formula. Let us consider a pp. formula with a single quantifier:

(4.3)

where \(\rho _j \in {(C^\circ })^{(r_j)}\), and \(z_i^{(j)} \ (j = 1, \ldots , t, \text { and } i=1, \ldots , r_j)\) are variables from the set \(\{x_1, \ldots , x_n, u\}\). We will show that \(\Phi \) is equivalent to a quantifier-free pp. formula, and thus (by iterating this argument) every pp. formula is equivalent to a quantifier-free pp. formula. By Lemma 4.4, we can rewrite \(\Phi \) to an equivalent formula

where \(p_i \in [\wedge ]\) and \(q_i \in [\vee ]\) (\(i = 1, \ldots , l\)). Let \(a_i\) denote the meet of all variables from \(\{x_1, \ldots , x_n\}\) appearing in \(p_i\), and let \(b_i\) denote the join of all variables from \(\{x_1, \ldots , x_n\}\) appearing in \(q_i\). Then we can distinguish four cases for the i-th inequality:

  1. (0)

    If u does not appear in the inequality, then the inequality is of the form \(a_i \le b_i\).

  2. (1)

    If u appears only on the left hand side of the inequality, then the inequality is of the form \(a_i \wedge u \le b_i\).

  3. (2)

    If u appears only on the right hand side of the inequality, then the inequality is of the form \(a_i \le b_i \vee u\).

  4. (3)

    If u appears on both sides of the inequality, then the inequality is of the form \(a_i \wedge u \le b_i \vee u\), which always holds, since \(a_i \wedge u \le u \le b_i \vee u\).

Let \(I_j\) denote the following set of indices:

$$\begin{aligned} I_j =\{i \mid \text {the inequality } p_i \le q_i \text { belongs to case (j)}\} \end{aligned}$$

for \(j=0, 1, 2, 3\). The only cases we have to investigate are case (1) and case (2) (since u does not appear in case (0) and in case (3) there are only trivial inequalities). By Lemma 4.5,

$$\begin{aligned}&\text {for } i \in I_1 \text { we have } a_i \wedge u \le b_i\Longleftrightarrow u \le a_i' \vee b_i \Longleftrightarrow u \in [0_\mathbb {L}, a_i' \vee b_i] =: [c_i, d_i]; \\&\text {for } i \in I_2 \text { we have } a_i \le b_i \vee u\Longleftrightarrow u \ge b_i' \wedge a_i\Longleftrightarrow u \in [a_i \wedge b_i', 1_\mathbb {L}]=:[c_i, d_i]. \end{aligned}$$

Then we have

$$\begin{aligned} \exists u \forall i \in I_1 \cup I_2:p_i \le q_i \iff \bigcap _{i \in I_1 \cup I_2} [c_i, d_i] \ne \emptyset \iff \forall i, j \in I_1 \cup I_2:c_i \le d_j \end{aligned}$$

by Lemma 4.6. Since u does not appear in the condition above, in principle, the quantifier has been eliminated. However, our formula still involves complements. Therefore, we use Lemma 4.5 to rewrite the formula. The only non-trivial case is if \(c_i \ne 0_\mathbb {L}\) and \(d_j \ne 1_\mathbb {L}\), that is, \(c_i = a_i \wedge b_i'\) and \(d_j= a_j' \vee b_j\) (\(i \in I_2, j \in I_1\)). In this case \(c_i \le d_j\) if and only if \(a_i \wedge a_j \le b_i \vee b_j\) by Lemma 4.5.

Summarizing the observations above, we have

which is equivalent to a quantifier-free pp. formula over \([\wedge , \vee ]\) (since for all \(x,y \in L\), we have \(x \le y\) if and only if \(x = x \wedge y\)). \(\square \)

We can summarize the results of this section in the following theorem, which is a corollary of Lemma 4.1, Theorems 4.3 and 4.7.

Theorem 4.8

A finite lattice has Property \({{\,\mathrm{(SDC)}\,}}\) if and only if it is a Boolean lattice.

This means that for any finite lattice \(\mathbb {L}=(L, \wedge , \vee )\), solution sets of systems of equations over \(\mathbb {L}\) can be characterized (via closure conditions) if and only if \(\mathbb {L}\) is a Boolean lattice.

5 Systems of equations over semilattices

Similarly to Section 4, in this section \(\mathbb {M}=(M, \wedge )\) denotes a finite semilattice with meet operation \(\wedge \) and least element \(0_\mathbb {M}\).

Lemma 5.1

Let \(\mathbb {M}=(M, \wedge )\) be a finite semilattice. If \(\mathbb {M}\) has no greatest element, then Property \({{\,\mathrm{(SDC)}\,}}\) does not hold for \(C=[\wedge ]\).

Proof

Let \(\mathbb {M}=(M, \wedge )\) be a finite semilattice with no greatest element, and let \(C=[\wedge ] \le {\mathcal {O}}_M\). The set

$$\begin{aligned} T&= \{(x,y) \mid \exists u \in L:x \wedge u = x \text { and } y \wedge u = y \} = \\&= \{(x,y) \mid \exists u \in L:x \le u \text { and } y \le u \}\subseteq M^2 \end{aligned}$$

is closed under \(C^*\) by Lemma 3.4. Similarly to Lemma 4.1, we will prove that T is not the solution set of any system of equations over C. Suppose that there exists a system of C-equations \({\mathcal {E}}\) such that \(T={{\,\mathrm{Sol}\,}}({\mathcal {E}})\). There are only three nontrivial 2-variable equations over C:

$$\begin{aligned} x=y,\quad x \wedge y = x,\quad x \wedge y = y. \end{aligned}$$

As in Lemma 4.1, we prove that none of these equations can appear in \({\mathcal {E}}\) by presenting counterexamples to them (see Table 1). Note that since \(\mathbb {M}\) is finite and it has no greatest element, there exist maximal elements \(a\ne b\) in \(\mathbb {M}\). Then we have that only trivial equations can appear in \({\mathcal {E}}\), thus \(T=M^2\). But this is a contradiction, since \((a, b) \notin T\). \(\square \)

Table 1 Counterexamples showing that these equations do not belong to \({\mathcal {E}}\)

If a finite semilattice \(\mathbb {M}=(M, \wedge )\) has a greatest element, then for all \((a, b) \in M^2\), the set \(H=\{x \in M \mid a \le x \text { and } b \le x\}\) is not empty. Since \(\mathbb {M}\) is a finite semilattice, it follows that \(\bigwedge H\) exists for all \((a, b) \in M^2\). This means that we can define a join operation \(\vee \) on M, such that \(\mathbb {L}=(L, \wedge , \vee )\) is a lattice (with \(L=M\)). Therefore, from now on it suffices to investigate lattices (but the clone we use for the equations is still \(C=[\wedge ]\)).

The following theorem shows that Property \({{\,\mathrm{(SDC)}\,}}\) does not hold for non-distributive lattices (regarded as semilattices), i.e., solution sets of systems of equations over a non-distributive lattice (as a semilattice) can not be characterized via closure conditions.

Remark 5.2

A meet semilattice \(\mathbb {M}\) is distributive if for any \(a, b_0, b_1 \in \mathbb {M}\), the inequality \(a \ge b_0 \wedge b_1\) implies that there exist \(a_0, a_1 \in \mathbb {M}\) such that \(a_0 \ge b_0\), \(a_1 \ge b_1\) and \(a=a_0 \wedge a_1\) (see Section 5.1 in Chapter II of [7]). From Lemma 184 of [7] it follows that a finite semilattice is distributive if and only if it is a semilattice reduct of a distributive lattice.

Theorem 5.3

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite lattice. If \(\mathbb {L}\) is not distributive, then Property \({{\,\mathrm{(SDC)}\,}}\) does not hold for \(C=[\wedge ]\).

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite lattice and let \(C=[\wedge ]\le {\mathcal {O}}_L\). Since \(\mathbb {L}\) is not distributive, we know that there exists a sublattice of \(\mathbb {L}\) isomorphic to either \(N_5\) or \(M_3\). Let us denote these two cases as (\(N_5\)) and (\(M_3\)), respectively. The figures and tables we use in this proof can be found in the Appendix. Let T be the set

$$\begin{aligned} T&= \{(x,y,z) \in L^3 \mid \exists u \in L:x \wedge y = u \wedge y \text { and } u \wedge x = x \text { and } u \wedge z = z \} \\&= \{(x,y,z) \in L^3 \mid \exists u \in L:x \wedge y = u \wedge y \text { and } u \ge x \text { and } u \ge z\}, \end{aligned}$$

which is closed under \(C^*\) by Lemma 3.4. As in Lemma 4.1, we will prove that T is not the solution set of any system of equations over C. Similarly to Lemma 4.1, we present counterexamples to nontrivial equations, the only difference is that here we prove that there can be only one nontrivial equation satisfied by T (see Tables 2 and 3 for case (\(N_5\)) and (\(M_3\)), respectively). We choose the elements ab and c as presented in Figure 3 for case (\(N_5\)), and in Figure 4 for case (\(M_3\)). (Note that an element u, chosen like on the figures, shows that in case (\(N_5\)) we have \((a, c, b), (b, a, c) \in T\), and in case (\(M_3\)) we have \((a, b, c), (a, c, b) \in T\).)

So now we have that in both cases the only nontrivial equation that T can satisfy is the equation \(y \wedge z = x \wedge y \wedge z\). One can verify that this equation holds on T: if \((x,y,z) \in T\), then we have

$$\begin{aligned} x \wedge y = u \wedge y \ge z \wedge y \implies x \wedge y \wedge z \ge y \wedge z, \end{aligned}$$

which implies that \(y \wedge z = x \wedge y \wedge z\). Therefore, we can conclude that the only nontrivial equation in \({{\,\mathrm{Eq}\,}}(T)\) is \(y \wedge z = x \wedge y \wedge z\). We will prove that T is not the solution set of any system of equations by presenting a tuple \((x_1, y_1, z_1) \in {{\,\mathrm{Sol}\,}}({{\,\mathrm{Eq}\,}}(T)) \setminus T\) (cf. Remark 2.4). Since there exists a sublattice of \(\mathbb {L}\) isomorphic to \(N_5\) or \(M_3\), there exists a tuple \((x_1, y_1, z_1)\) as shown in Figure 5, which satisfies \(y_1 \wedge z_1 = x_1 \wedge y_1 \wedge z_1\), thus \((x_1, y_1, z_1) \in {{\,\mathrm{Sol}\,}}({{\,\mathrm{Eq}\,}}(T))\). However, one can easily verify that \((x_1, y_1, z_1)\) does not belong to T. Indeed, suppose that \((x_1, y_1, z_1) \in T\), then there exists \(u \in L\) such that \(u \ge x_1\), \(u \ge z_1\) and \(x_1 \wedge y_1 = u \wedge y_1\). But then we have \(u \ge x_1 \vee z_1 > y_1\) (since \(N_5\) or \(M_3\) is a sublattice), therefore \(x_1 \wedge y_1 < u \wedge y_1 = y_1\) gives us a contradiction. Thus, \(T \ne {{\,\mathrm{Sol}\,}}({{\,\mathrm{Eq}\,}}(T))\), hence, by Remark 2.4, T is not the solution set of any system of equations over C. \(\square \)

Lemma 5.1 and Theorem 5.3 prove that if \(\mathbb {M}= (M, \wedge )\) has Property \({{\,\mathrm{(SDC)}\,}}\), then it is the semilattice reduct of a distributive lattice \(\mathbb {L}= (L, \wedge , \vee )\). To complete the characterization of finite semilattices with Property \({{\,\mathrm{(SDC)}\,}}\), we prove that the clone \([\wedge ]\) has Property \({{\,\mathrm{(SDC)}\,}}\) whenever \(\wedge \) is the meet operation of a finite distributive lattice.

Theorem 5.4

If \(\mathbb {L}=(L, \wedge , \vee )\) is a finite distributive lattice, then Property \({{\,\mathrm{(SDC)}\,}}\) holds for \(C=[\wedge ]\).

Proof

Let \(\mathbb {L}=(L, \wedge , \vee )\) be a finite distributive lattice and \(C=[\wedge ]\le {\mathcal {O}}_L\). Since \(\mathbb {L}\) is distributive, by Birkhoff’s representation theorem \(\mathbb {L}\) can be embedded into a Boolean lattice \(\mathbb {B}\), hence we may suppose without loss of generality that \(\mathbb {L}\) is already a sublattice of \(\mathbb {B}\). We can also assume that \(0_\mathbb {L}=0_\mathbb {B}\) and \(1_\mathbb {L}=1_\mathbb {B}\). Let us denote the complement of an element \(x \in \mathbb {B}\) by \(x'\). By Theorem 3.6, Property \({{\,\mathrm{(SDC)}\,}}\) holds for C if and only if any pp. formula over \(C^\circ \) is equivalent to a quantifier-free pp. formula. Similarly to the proof of Theorem 4.7, it suffices to consider pp. formulas with a single existential quantifier. Let

(5.1)

where \(\rho _j \in {(C^\circ })^{(r_j)}\), and \(z_i^{(j)} \ (j = 1, \ldots , t, \text { and } i=1, \ldots , r_j)\) are variables from the set \(\{x_1, \ldots , x_n, u\}\). We will show that \(\Phi \) is equivalent to a quantifier-free pp. formula.

Since for all \(a, b \in L\) we have \(a=b\) if and only if \(a \le b\) and \(b \le a\), we can rewrite \(\Phi \) to an equivalent formula

where \(p_i, q_i \in [\wedge ]\) (\(i=1, \ldots , l\)). Let \(a_i\) denote the meet of all variables from \(\{x_1, \ldots , x_n\}\) appearing in \(p_i\), and let \(b_i\) denote the meet of all variables from \(\{x_1, \ldots , x_n\}\) appearing in \(q_i\). Then we can distinguish four cases for the i-th inequality:

  1. (0)

    If u does not appear in the inequality, then the inequality is of the form \(a_i \le b_i\).

  2. (1)

    If u appears only on the left hand side of the inequality, then the inequality is of the form \(a_i \wedge u \le b_i\).

  3. (2)

    If u appears only on the right hand side of the inequality, then the inequality is of the form \(a_i \le b_i \wedge u\), which holds if and only if \(a_i \le b_i\) and \(a_i \le u\).

  4. (3)

    If u appears on both sides of the inequality, then the inequality is of the form \(a_i \wedge u \le b_i \wedge u\), which holds if and only if \(a_i \wedge u \le b_i\) and \(a_i \wedge u \le u\), that is, \(a_i \wedge u \le b_i\).

Let \(I_j\) denote the following set of indices:

$$\begin{aligned} I_j =\{i \mid \text {the inequality } p_i \le q_i \text { belongs to case (j)}\} \end{aligned}$$

for \(j=0, 1, 2, 3\). We investigate only cases (1), (2) and (3), since u does not appear in case (0). Moreover; in case (2), we only have to deal with the inequality \(a_i \le u\), since u does not appear in the inequality \(a_i \le b_i\). By Lemma 4.5,

$$\begin{aligned}&\text {for } i \in I_1 \text { we have } a_i \wedge u \le b_i\Longleftrightarrow u \le a_i' \vee b_i\Longleftrightarrow u \in [0_\mathbb {L}, a_i' \vee b_i] =: [c_i, d_i]; \\&\text {for } i \in I_2 \text { we have } a_i \le u\Longleftrightarrow u \in [a_i, 1_\mathbb {L}]=:[c_i, d_i]; \\&\text {for } i \in I_3 \text { we have } a_i \wedge u \le b_i\Longleftrightarrow u \le a_i' \vee b_i\Longleftrightarrow u \in [0_\mathbb {L}, a_i' \vee b_i] =: [c_i, d_i]. \end{aligned}$$

Then we have

$$\begin{aligned} \bigcap _{i \in I_1 \cup I_2 \cup I_3} [c_i, d_i] \ne \emptyset \iff \forall i, j \in I_1 \cup I_2 \cup I_3:c_i \le d_j \end{aligned}$$

by Lemma 4.6. Just as in the proof of Theorem 4.7, we apply Lemma 4.5 to eliminate complements and joins from the formula above. The only interesting case is if \(c_i \ne 0_\mathbb {L}\) and \(d_j \ne 1_\mathbb {L}\), that is, \(c_i = a_i\) and \(d_j= a_j' \vee b_j\) (\(i \in I_2, j \in I_1 \cup I_3\)). In this case \(c_i \le d_j\) if and only if \(a_i \le a_j' \vee b_j\), which holds if and only if \(a_i \wedge a_j \le b_j\) by Lemma 4.5 (with \(u=a_i\)).

Summarizing the observations above, we have

which is equivalent to a quantifier-free pp. formula over \([\wedge ]\) (since for all \(x,y \in L\), we have \(x \le y\) if and only if \(x = x \wedge y\)).\(\square \)

We can summarize the results of this section in the following theorem, which is a corollary of Lemma 5.1, and Theorems 5.3 and 5.4.

Theorem 5.5

A finite semilattice has Property \({{\,\mathrm{(SDC)}\,}}\) if and only if it is distributive.

This means that for any finite semilattice \(\mathbb {M}\), solution sets of systems of equations over \(\mathbb {M}\) can be characterized (via closure conditions) if and only if \(\mathbb {M}\) is a semilattice reduct of a distributive lattice (see Remark 5.2).

6 Concluding remarks

We have characterized finite lattices and semilattices having Property \({{\,\mathrm{(SDC)}\,}}\). As a natural continuation of these investigations, one could aim at describing all finite algebras (clones over finite sets) with Property \({{\,\mathrm{(SDC)}\,}}\).

Primitive positive clones seem to be of particular interest, for the following reason. For a primitive positive clone \(P\le {\mathcal {O}}_{A}\), let us consider the set \(C( P ) =\{ C\le {\mathcal {O}}_{A}:C^{*}=P \} \). The greatest element of this set is \(P^{*}\), since \(C^{*}=P\) implies that \(C\subseteq C^{**}=P^{*}\) and \(P^{*}\in C ( P ) \) follows from \(P^{**}=P\). If a clone \(C\in C(P)\) has Property \({{\,\mathrm{(SDC)}\,}}\), then every set \(T\subseteq A^{n}\) that is closed under \(C^{*}=P\) arises as the solution set of a system \({\mathcal {E}}\) of equations over C. Since \(C\subseteq P^{*}\), we can regard \({\mathcal {E}}\) as a system of equations over \(P^{*}\). Therefore, every set \(T\subseteq A^{n}\) that is closed under \(( P^{*}) ^{*}=P\) arises as the solution set of a system of equations over \(P^{*}\), i.e., \(P^{*}\) has Property \({{\,\mathrm{(SDC)}\,}}\). Thus if \(P^{*}\) does not satisfy Property \({{\,\mathrm{(SDC)}\,}}\), then no clone in C(P) can have Property \({{\,\mathrm{(SDC)}\,}}\). In other words, primitive positive clones have the “highest chance” for having Property \({{\,\mathrm{(SDC)}\,}}\).

Another topic worth further study is the relationship with homomorphism-homogeneity. It was proved in [9] that homomorphism-homogeneity is equivalent to a certain quantifier elimination property (but somewhat different from Theorem 3.6). Also, our results together with [4] imply that all finite lattices and semilattices with Property \({{\,\mathrm{(SDC)}\,}}\) are homomorphism-homogeneous, so it might be plausible that Property \({{\,\mathrm{(SDC)}\,}}\) implies homomorphism-homogeneity in general for finite algebras.