1 Introduction

We assume that the reader is familiar with the basic notions of the general theory of algebraic systems, better known as “Universal algebra”. See, e.g., [7, 10, 22] for background.

Maltsev conditions are a central concept in universal algebra and they characterize many important properties of varieties, including congruence distributivity and modularity. The exact definition of a Maltsev condition is not relevant here, since we will always deal with specific examples. The classical Maltsev conditions for congruence distributivity and modularity each involve a variable number of terms, called after Jónsson and Day, respectively. A relatively easy argument by Day [5] shows that a variety with Jónsson terms \(t_0,\ldots , t_n\) has Day terms \(u_0,\ldots , u _{2n-1} .\) Shortly after the proof of his theorem, Day himself asked whether the result is optimal. To the best of our knowledge, the problem has not been solved before. Theorem 3.2 shows that Day’s Theorem is optimal when n is even.

Our results here are not limited to the relationship between Jónsson and Day terms. After the original characterization by Day [5], other Maltsev conditions have been found for congruence modularity. The conditions involving Gumm terms [7, 9, 10] and variations [6, 13, 14] will be explicitly recalled and studied here. Again, each of the above conditions involves a variable number of terms. Since the conditions are equivalent, there is a connection between the number of terms, similar to the connection mentioned above between Jónsson and Day terms. In Corollary 7.4 we show that, for every even \(n \ge 4,\) the existence of Gumm terms \(t_0,\ldots , t_n\) implies the existence of Day terms \(u_0,\ldots , u _{2n-2} \) and that the value \(2n-2\) is the best possible. The converse problem asked in [15] of finding the optimal number of Gumm terms which can be constructed from a given sequence of Day terms is still shrouded in darkness.

During the last decade, several further conditions equivalent to congruence distributivity have also been discovered [13, 16]. Directed Jónsson terms, as introduced in [13], will be recalled in Definition 2.1. In Theorem 6.2(ii) we find the best bounds for the number of Jónsson terms which can be obtained from a sequence of directed Jónsson terms. Again, the reverse direction is still open, and probably much more difficult. In [13] directed Gumm terms are also introduced. See Definition 7.5. Directed terms have proved to be very interesting and useful [13, 14, 16]. In Theorem 7.6 we extend the above results to a symmetric version of directed Gumm terms.

As hinted in the above paragraphs, our techniques are quite general and go far beyond the proof that Day’s Theorem is sharp. In fact, we have also results about congruence identities which are much weaker than congruence modularity; see Theorems 5.4 and 6.2(iii).

In detail, the paper is divided as follows. In Section 2 we recall some basic notions about congruence distributive and congruence modular varieties; in particular, we recall Jónsson and Day terms with some variations. We stress the useful fact that many conditions can be translated in the form of a congruence identity [25]. In Section 3 we formally state our theorems about Day’s problem, with some hints to the proofs. In Section 4 we present our main constructions. We find general conditions ensuring that a certain subset B of some product of algebras is the universe for some subalgebra. Such conditions do not necessarily involve congruence distributivity and find applications in different contexts. In Section 5 the constructions from Section 4 are put together in order to show that Day’s result is optimal for n even. Sections 6 and 7 deal, respectively, with directed and Gumm terms. Sections 6 and 7 rely heavily on Sections 4 and 5, but are largely independent one from another. Section 8 is reserved for additional remarks and problems.

The present paper has been extracted from the longer unpublished note [21] (with a different title). Realizing that [21] is excessively long for publication in a journal, we have selected here some relevant parts. In a few cases, in [21] the reader might find generalizations or extensions of the results proved here.

2 A review of congruence distributive and modular varieties

In this section we fix notation and terminology. The reader familiar with universal algebra might skip a large part of the present section and turn back only when needed. We just point out that the notions of reversed Day terms at the end of Definition 2.7 and of m-reversed modularity in Definition 2.9 are possibly new. Such notions will play a key role in the proof of Theorem 3.2.

Since our main concern are terms and equations, in what follows we shall be somewhat informal and say that a sequence of terms satisfies some set of equations to mean that some variety under consideration, or some algebra, have such a sequence of terms and that the equations are satisfied in the variety or in the algebra. When no confusion is possible, we shall speak of, say, Jónsson terms, instead of using the more precise expression sequence of Jónsson terms. If the terms are actually operations of the algebra or of the variety under consideration, we will sometimes say that the algebra or the variety has Jónsson operations, to mean that the operations satisfy the corresponding equations.

2.1 Aspects of congruence distributivity

For later use, we insert the definitions of Jónsson, alvin and directed Jónsson terms in a quite general framework.

Definition 2.1

Fix some natural number n and suppose that \(t_0,\ldots , t_n\) is a sequence of 3-ary terms. For most of the paper, all the sequences of 3-ary terms under consideration will satisfy all the following basic equations

$$\begin{aligned} \begin{aligned} x&\approx t_0(x,y,z), \quad t_{n}(x,y,z)\approx z,\\ x&\approx t_h(x,y, x), \quad \text {for } 0 \le h \le n, \end{aligned} \end{aligned}$$
(B)

as well as some appropriate equations from the following list

figure a
figure b
figure c

We now define precisely the relevant conditions.

(Jónsson terms) The sequence \(t_0,\ldots , t_n\) is a sequence of Jónsson terms [11] for some variety, or even for a single algebra, if the sequence satisfies the equations (B) and

$$\begin{aligned} \text { equation M0for }h\text { even, equation (M1) for }h\text { odd, }0 \le h < n. \end{aligned}$$
(J)

If \(t_0, t_1, t_2\) is a sequence of Jónsson terms, then \(t_1\) is a majority term.

(Alvin terms) If we exchange the roles of even and odd indices in the equational conditions defining Jónsson terms, we get a sequence of alvin terms. In detail, a sequence \(t_0,\ldots , t_n\) is a sequence of alvin terms [22] if the sequence satisfies the equations (B) and

$$\begin{aligned} \text { equation (M1) for }h\text { even, equation (M0) for }h \text { odd}, 0 \le h < n. \end{aligned}$$
(A)

If \(t_0, t_1, t_2\) is a sequence of alvin terms, then \(t_1\) is a Pixley term for arithmeticity.

To the best of our knowledge, alvin terms first appeared in [22, Theorem 4.144], under the nonstandard name “Jónsson terms”. They were subsequently named the “alvin variant” in [8, p. 62]. The two notions are clearly equivalent if one is not concerned with the exact lengths of sequences, but turn out to be distinct if n is kept fixed [8]. The expression ALVIN, possibly an acronym, has been informally used to refer to the book [22] since at least 2007.

(Directed Jónsson terms) Finally, if we always use (M\(^{\rightarrow }\)), we get a sequence of directed Jónsson terms. In detail, a sequence of directed Jónsson terms [13, 27] is a sequence which satisfies (B), as well as (M\(^{\rightarrow }\)), for all h\(0 \le h < n.\) In the case of directed terms there is no distinction between even and odd h’s.

A sequence \(t_0, t_1, t_2\) is a sequence of directed Jónsson terms if and only if it is a sequence of Jónsson terms. On the other hand, we will see that the notions provide distinct conditions for larger n’s.

Notice that if some algebra \({\textbf{A}}\) has, say, Jónsson terms \(t_0,\ldots , t_n,\) then the variety \({\mathcal {V}}\) generated by \({\textbf{A}}\) has Jónsson terms \(t_0,\ldots , t_n.\) Thus the above notions are actually notions about varieties. However, in certain cases, as a matter of terminology, it will be convenient to deal with algebras.

Theorem 2.2

[11, 13, 22]. For every variety \({\mathcal {V}},\) the following conditions are equivalent.

  1. (i)

    \({\mathcal {V}}\) is congruence distributive.

  2. (ii)

    \({\mathcal {V}}\) has a sequence of Jónsson terms.

  3. (iii)

    \({\mathcal {V}}\) has a sequence of alvin terms.

  4. (iv)

    \({\mathcal {V}}\) has a sequence of directed Jónsson terms.

The equivalence of (i) and (ii) is due to Jónsson [11]. The equivalence of (ii) and (iii) is easy and almost immediate (compare the proof of (ii) \(\Leftrightarrow \) (iii) in Theorem 2.8). Anyway, the equivalence of (i) and (iii) appears explicitly in [22]. The equivalence of (ii) and (iv) is proved in [13].

For a given congruence distributive variety, the lengths of the shortest sequences given by (ii)–(iv) above might be different [8]. Hence it is interesting to classify varieties according to such lengths, both in the case of congruence distributivity, as well as in parallel situations. See, e.g., [5, 8, 11, 13, 15, 18, 20].

Definition 2.3

A variety or an algebra is n-distributive (n-alvin, n-directed-distributive) if it has a sequence \(t_0,\ldots , t_n\) of Jónsson (alvin, directed Jónsson) terms.

Remark 2.4

(Counting conventions). Note that each of the conditions in Definition 2.3 actually involves \(n+1\) terms, including the two projections \(t_0\) and \(t_n,\) so that the number of nontrivial terms is \(n-1.\) This aspect might ingenerate terminological confusion and the present author apologizes, since in previous works he has not always been consistent. The reader consulting the literature is advised to check notation and definitions carefully. For example, the condition (DJ(n)) from [13] involves exactly n nontrivial directed Jónsson terms and corresponds to being \(n+1\)-directed distributive in the terminology used in the present paper. On the other hand, the terminology concerning “undirected” n-distributivity is quite consolidated and here it is extremely convenient to maintain a strict parallel with this convention.

Of course, the terms \(t_0\) and \(t_n\) in Definition 2.1 are projections, hence it makes no substantial difference whether they are listed or not in the above conditions. However, here it is notationally convenient to include them, since, otherwise, say in the case of the Jónsson condition, we should have divided the definition into two cases, asking for \(t_{n-1}(x,z,z)\approx z\) for n even, and for \(t_{n-1}(x,x,z)\approx z\) for n odd. Considering the terms \(t_0\) and \(t_n,\) instead, we can fix equations (B) once and for all, independently of the kind of terms we are dealing with and, in particular, independently from the parity of n.

We have insisted on this otherwise marginal aspect since we will have frequent occasion to shift the indices of the terms in use, hence particular care is needed in numbering and labeling.

By the way, there is a deeper reason showing that the above counting terminology is necessarily conventional. Using arguments from [24] it can be shown that every idempotent Maltsev condition can be expressed by conditions involving a single term. In this situation the varying quantity is the number of arguments, not the number of terms.

Remark 2.5

It is frequently convenient to translate the above notions in terms of congruence identities. For \(\beta \) and \(\gamma \) congruences, let \(\beta \circ \gamma \circ {{\mathop {\dots }\limits ^{k}}} \) denote the relation \( \beta \circ \gamma \circ \beta \circ \gamma \circ \dots \) with k factors, that is, \(k-1\) occurrences of \( \circ .\) If we know that, say, k is even, then, according to convenience, we write \(\beta \circ \gamma \circ {{\mathop {\dots }\limits ^{k}}} \circ \gamma \) to make clear that \(\gamma \) is the last factor. It is also convenient to consider the extreme cases, so that \( \beta \circ \gamma \circ {{\mathop {\dots }\limits ^{1}}} = \beta \) and \( \beta \circ \gamma \circ {{\mathop {\dots }\limits ^{0}}} = 0,\) where 0 is the minimal congruence in the algebra under consideration.

In congruence identities we use juxtaposition to denote intersection of binary relations.

Under the above notation, within a variety, each condition on the left in the following table is equivalent to the condition on the right.

$$\begin{aligned}&n\text { -distributive }{} & {} \alpha ( \beta \circ \gamma ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{n}}}\\&n\text { -alvin }{} & {} \alpha ( \beta \circ \gamma ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{n}}} \end{aligned}$$

The equivalence of the above conditions is well-known [23, 26]. In the specific case at hand, as well as in similar situations described below, the proof is simple and direct, see, e.g., [12, 16, 20, 25] for further comments. Note that the conditions are equivalent only within a variety; indeed, the conditions on the right are locally weaker. If some algebra \({\textbf{A}}\) satisfies one of the conditions on the right, it is not even necessarily the case that \({\textbf{Con}} ({\textbf{A}})\) is distributive, let alone the request that \({\textbf{A}}\) generates a congruence distributive variety.

We have stated the above conditions in the form of inclusions, but notice that an inclusion \(X \subseteq Y\) is (set-theoretically) equivalent to the identity \(X=XY,\) hence we are free to use the expression “identity”. Recall that juxtaposition denotes intersection.

There seems to be no immediate directly provable condition equivalent to the existence of directed Jónsson terms and which can be expressed in terms of congruence identities. Nevertheless, directed terms are involved in the study of relation identities, see [16, Section 3] and [17, Section 3].

Remark 2.6

Expressing Maltsev conditions in terms of congruence identities as in Remark 2.5 is particularly useful.

(a) For example, from the above characterizations we immediately obtain the well-known fact that, for n odd, n-distributive and n-alvin are equivalent conditions; just take converses and exchange \(\beta \) and \(\gamma .\) When dealing with the conditions involving terms, one obtains the equivalence by reversing both the order of variables and of terms [8, Proposition 7.1(1)], but this seems intuitively less clear.

(b) As another example, arguing in terms of congruence identities it is immediate to see that n-distributive implies \(n{+}1\)-alvin, and symmetrically that n-alvin implies \(n{+}1\)-distributive. To prove, say, the former statement, just notice that \(\alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{n}}} \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{n+1}}} .\)

See also Remarks 2.105.5 and 7.3 for related observations. In fact, in Theorems 4.54.84.13, and 5.4 we shall deal with congruence identities and then we shall use Remark 2.5 and the corresponding Remark 2.10 about congruence modularity in order to translate the basic results in terms of distributivity and modularity levels. For example, this technique applies to Theorems 5.16.1(i), 6.2 and 7.6(ii), as well as to the main results in [18].

2.2 Aspects of congruence modularity

Now for A. Day’s characterization of congruence modularity.

Definition 2.7

A sequence of Day terms [5] for some variety, or even for a single algebra, is a sequence \(u_0,\ldots , u_m,\) for some m,  of 4-ary terms satisfying

$$\begin{aligned} x&\approx u_k(x,y,y,x), \qquad \text {for } 0 \le k \le m, \end{aligned}$$
(D0)
$$\begin{aligned} x&\approx u_0(x,y,z,w), \end{aligned}$$
(D1)
$$\begin{aligned} u_k(x,x,w,w)&\approx u_{k+1}(x,x,w,w), \quad \text {for even }k, 0 \le k< m,\nonumber \\ u_k(x,y,y,w)&\approx u_{k+1}(x,y,y,w), \quad \text {for odd }k, 0 \le k < m, \end{aligned}$$
(D2)
$$\begin{aligned} u_{m}(x,y,z,w)&\approx w. \end{aligned}$$
(D3)

If we exchange the role of even and odd indices in (D2) we get a sequence of reversed Day terms.

Theorem 2.8

[5]. For every variety \({\mathcal {V}},\) the following conditions are equivalent.

  1. (i)

    \({\mathcal {V}}\) is congruence modular.

  2. (ii)

    \({\mathcal {V}}\) has a sequence of Day terms.

  3. (iii)

    \({\mathcal {V}}\) has a sequence of reversed Day terms.

Proof

The equivalence of (i) and (ii) is due to Day [5].

If \(u_0,\ldots , u_m\) is a sequence of Day terms (reversed Day terms), then we get a sequence \(u'_0,\ldots , u'_{m+1}\) of reversed Day terms (Day terms) by taking \(u'_0\) to be the projection onto the first coordinate and \(u'_{k+1} = u_k,\) for \(k \ge 0.\) Hence (ii) and (iii) are equivalent. Alternatively, one can apply the second statement in Remark 2.11. \(\square \)

Definition 2.9

A variety or an algebra is m-modular (m-reversed-modular) if it has a sequence \(u_0,\ldots , u_m\) of Day (reversed Day) terms.

Remark 2.10

Day’s condition, too, can be translated in terms of congruence identities. Within a variety, each condition on the left in the following table is equivalent to the condition on the right.

$$\begin{aligned}&m\text {-modular }{} & {} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{m}}}\\&m\text {-reversed-modular }{} & {} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{m}}} \end{aligned}$$

The above congruence identities explain the reason for our choice of the expression “reversed modularity”.

Arguing as in Remark 2.6 we get the facts stated in the following remark. As far as the second statement is concerned, compare also the proof of the equivalence of (ii) and (iii) in Theorem 2.8.

Remark 2.11

If m is even, then m-modularity and m-reversed-modularity are equivalent notions. For every \(m>0,\) \(m{-}1\)-modularity implies m-reversed-modularity; moreover, \(m{-}1\)-reversed-modularity implies m-modularity.

In [21, Corollary 9.13] we show that the statements in Remark 2.11 cannot be improved for \(m \ge 4.\)

Another characterization of congruence modular varieties has been subsequently discovered by Gumm [9, 10]. We will discuss Gumm terms and generalizations in Section 7.

3 Statements of the main results and some hints to the proofs

The following theorem already appeared in [5], in the same paper where the first Maltsev characterization of congruence modularity has been presented.

Theorem 3.1

(Day [5, Theorem on p. 172]). If \(n>0,\) then every n-distributive variety is \(2n{-}1\)-modular.

We will recall Day’s argument in the proof of Corollary 5.3(i) and variations on it appear in Theorem 6.1(ii) and Lemma 5.2. The latter merges the original Day’s argument with some ideas from [15], used in [15] in a different context.

Among other, in the present paper we show that Day’s Theorem is the best possible result for n even.

Theorem 3.2

If \(n>0\) and n is even,  then there is a locally finite n-distributive variety which is not \(2n{-}2\)-modular.

Theorem 3.2 is a special case of Theorem 5.1(i). The reader interested only in a quick tour towards the proof of Theorem 3.2 might go directly to Section 4, turning back to Section 2 only if necessary to check notation and terminology. A large part of Section 4 is not necessary for the proof of Theorem 3.2, either. A quick route to the proof of Theorem 5.1(i) goes through Construction 4.2 and Theorems 4.34.5 and 4.13(i).

We mentioned in [20] that if \(n>1\) and n is odd, then Day’s Theorem can be improved (at least) by 1. We expect that the result cannot be improved further. See Lemma 5.2 for a proof of the improvement and Corollary 7.4(i) for a related result.

Let us now comment a bit about the proof of Theorem 3.2. We have recalled Jónsson and Day terms in Section 2, as well as their “reversed” analogues in which the equational conditions for even and odd indices are exchanged. Recall Definitions 2.12.32.7 and 2.9. We have results also for the reversed conditions; actually, the use of the reversed conditions seems fundamental in our arguments. The proof of Theorem 3.2 proceeds through a simultaneous induction which deals alternatively with

  1. (a)

    distributivity in combination with reversed modularity, and

  2. (b)

    alvin in combination with modularity.

In the next theorem we state our main results about the reversed conditions.

Theorem 3.3

Suppose that \(n \ge 4\) and n is even.

  1. (i)

    Every n-alvin variety is \(2n{-}3\)-reversed-modular.

  2. (ii)

    There is a locally finite n-alvin variety which is not \(2n{-}3\)-modular.

Theorem 3.3 follows from Lemma 5.2(a) and Theorem 5.1(ii). Note that the conclusions in Theorems 3.1 and 3.2 deal with \(2n-1\) and \(2n-2,\) while Theorem 3.3 deals with the different parameter \(2n-3.\)

The bounds in Theorems 3.1 and 3.3 are shown to be optimal by constructing appropriate counterexamples by induction. In each case, the induction at step n uses the counterexample constructed for \(n-2\) in the parallel theorem. We will prove a slight improvement of Theorem 3.2, to the effect that, for \(n \ge 2\) and n even, there is an n-distributive variety which is not \(2n{-}1\)-reversed-modular. Then the induction proceeds as follows: from an \(n{-}2\)-alvin not \(2n{-}7\)-modular variety we construct an n-distributive variety which is not \(2n{-}1\)-reversed-modular. In the other case, from an \(n{-}2\)-distributive variety which is not \(2n{-}5\)-reversed-modular we construct an n-alvin not \(2n{-}3\)-modular variety. Notice that the shift in the modularity level is 6 in the former case and 2 in the latter case. On average, we get a shift by 8 each time n is increased by 4,  in agreement with the statements of the results.

As mentioned in the introduction, we have also results relative to directed and Gumm terms; we refer the reader to Theorems 6.1, 6.27.6 and Corollary 7.4.

4 The main constructions

Remark 4.1

When dealing with some Maltsev condition \({\mathfrak {M}},\) it can always be assumed, by an unessential expansion, that the terms given by \({\mathfrak {M}}\) are operations of the algebras under consideration. Actually, here it will always be no loss of generality to assume that algebras have no other operation. Indeed, here we are always concerned with the failure of congruence identities in the language \(\{ \cap , \circ \}.\) If \(\alpha \) is a congruence on some algebra \({\textbf{A}},\) then \(\alpha \) remains a congruence on any reduct of \({\textbf{A}}.\) Moreover, intersection and composition do not depend on the algebraic structure of \({\textbf{A}},\) hence if some congruence \(\{ \cap , \circ \}\)-identity fails in \({\textbf{A}},\) then the identity fails in any reduct of \({\textbf{A}}.\)

Hence we shall mainly deal with algebras and varieties having only ternary operations, generally satisfying some condition from Definition 2.1. This assumption will simplify arguments and notation.

4.1 Constructing subalgebras

The relevant point in the following constructions is to find some appropriate subalgebra B of a product of four algebras. The arguments showing that such a B is indeed a subalgebra use really weak hypotheses, so we present them in generality. The main advantage of this abstract treatment is that the method works uniformly for Jónsson, directed and Gumm terms.

Construction 4.2

Fix some natural number \(n \ge 3.\) In what follows the number n will always be explicitly declared in all the relevant places, hence we will not indicate it in the following notation.

(A) Premises. We suppose that \({\textbf{A}}_1,\) \({\textbf{A}}_2,\) \({\textbf{A}}_3\) and \({\textbf{A}}_4\) are algebras with only the ternary operations \(t_1^{{\textbf{A}}_j},\) \(t_2^{{\textbf{A}}_j},\ldots , t_{n-1} ^{{\textbf{A}}_j} ,\) \(j=1,2,3,4.\) Here and in similar situations we shall omit the j-indexed superscripts when there is no danger of confusion. We further suppose that the first three algebras have a special element \(0_j \in A_j,\) for \(j=1,2,3.\) Again, we shall usually omit the subscripts. It is not necessary to assume that there is some constant symbol which is interpreted as the \(0_j\)’s, it is enough to assume the existence of such elements.

We require that, for \(j=1,2,3,\) the following identities hold in \({\textbf{A}}_j,\) for all \(x,y,z \in A_j\):

$$\begin{aligned} 0 =t_h(0,y,z), \quad&\text { for }h=1,\ldots , n-2, \end{aligned}$$
(4.1)
$$\begin{aligned} t_h(x,y,0) =0, \quad&\text { for }h=2,\ldots , n-1. \end{aligned}$$
(4.2)

The algebra \({\textbf{A}}_4,\) instead, is supposed to satisfy:

$$\begin{aligned}&t_1\text { is the projection onto the first coordinate, } \end{aligned}$$
(4.3)
$$\begin{aligned}&t_{n-1}\text { is the projection onto the third coordinate, } \end{aligned}$$
(4.4)
$$\begin{aligned}&x=t _h(x,y,x), \quad \text {for }h=2,\ldots , n-2\text { and all }x,y \in A_4. \end{aligned}$$
(4.5)

(B) A useful subalgebra. We shall use the above identities in order to show that a certain subset B of \({\textbf{E}} = {\textbf{A}}_1 \times {\textbf{A}}_2 \times {\textbf{A}}_3 \times {\textbf{A}}_4 \) is the domain for a subalgebra. Let a and d be two arbitrary but fixed elements of \(A_4.\) Let \(B=B(a,d)\) be the set of those elements of E which have (at least) one of the following forms:

$$\begin{aligned} \begin{gathered} \text {Type I} \\ (\frac{\ }{\ }, 0, \frac{\ }{\ }, a) \end{gathered} \qquad \qquad \begin{gathered} \text {Type II} \\ (0, 0, \frac{\ }{\ }, \frac{\ }{\ }), \end{gathered} \qquad \qquad \begin{gathered} \text {Type III} \\ (0, \frac{\ }{\ }, \frac{\ }{\ }, d) \end{gathered} \qquad \qquad \begin{gathered} \text {Type IV} \\ (\frac{\ }{\ }, \frac{\ }{\ }, 0, \frac{\ }{\ }) \end{gathered} \end{aligned}$$

where places denoted by \(-\) can be filled with arbitrary elements from the appropriate algebra.

Theorem 4.3

Under the assumptions and the definitions in Construction 4.2, the set B is the universe for a subalgebra \({\textbf{B}}\) of \({\textbf{E}}.\)

Proof

The set B is closed under \(t_1,\) since if \(x \in E\) has one of the types I–IV, then \(t_1(x,y,z)\) has the same type, because of equation (4.1). In case of types I and III we need also (4.3).

Symmetrically, B is closed under \(t_{n-1}.\) In this case, \(t_{n-1}(x,y,z)\) has the same type of z and we are using (4.2) and (4.4).

Now let \(h \in \{ 2,\ldots , n-2 \} \) and \(x,y,z \in B.\)

If x has type II or IV, then \(t_h(x,y,z)\) has the same type of x,  again by (4.1).

Suppose that x has type I. We shall divide the argument into cases, considering the possible types of z. If z has type I, too, then \(t_h(x,y,z)\) has type I, by (4.1) and (4.5). We need (4.5) to ensure that the fourth component is a. If z has type II or IV, then \(t_h(x,y,z)\) has the same type of z,  by (4.2). Finally, if z has type III, then \(t_h(x,y,z)\) has type II. Indeed, the second component is 0 by (4.1), since x has type I, and the first component is 0 by (4.2), since z has type III.

The case in which x has type III is treated in a symmetrical way.

We have shown that B is closed with respect to \(t_1, t_2, \ldots , t_{n-1},\) hence B is the universe for a subalgebra of \({\textbf{E}}.\) Notice that we have not used the assumption that \(y \in B.\) \(\square \)

4.2 Counterexamples with Jónsson terms

Definition 4.4

Fix some natural number \(n \ge 3.\) For every lattice \({\textbf{L}},\) let \({\textbf{L}}^r\) be the following term-reduct of \({\textbf{L}}.\) The operations of \({\textbf{L}}^r\) are

$$\begin{aligned} t_1(x,y,z)= & {} x(y+z), \quad t_2(x,y,z) = xz, \quad t_3(x,y,z) = xz, \quad \dots , \quad \nonumber \\{} & {} \qquad \dots , \quad t_{n-2}(x,y,z) = xz, \quad t_{n-1}(x,y,z) = z(y+x), \end{aligned}$$
(4.6)

where juxtaposition and \(+\) denote the lattice operations. Note that if n is even and \(t_0,\) \(t_n\) are the projections onto the first, respectively, the third coordinate, then \(t_0, t_1,\ldots , t_n\) is a sequence of Jónsson terms in \({\textbf{L}}^r.\) Moreover, \(t_0, t_1,\ldots , t_n\) is a sequence of directed Jónsson terms, no matter the parity of n.

Essentially, all our results hold for arbitrary lattices, but all the constructions we shall perform involve only distributive lattices. Henceforth we shall always assume to deal with distributive lattices: this has the advantage of furnishing locally finite varieties. If \(k \ge 1,\) we define the lattice \({\textbf{C}}_{k}\) to be the k-element chain with underlying set \(C_{k} = \{0,\ldots , k-1 \} ,\) with the standard ordering and the standard lattice operations \(\min \) and \(\max .\) In particular, \({\textbf{C}}_{k}^r\) denotes the reduct, as above, of \({\textbf{C}}_{k}.\) Notice that, for every k,  the algebra \({\textbf{C}}_{k}^r\) satisfies the conditions (4.1) and (4.2) in Construction 4.2.

Recall the notational conventions introduced in Remark 2.5, in particular, recall that in congruence identities juxtaposition denotes intersection.

Theorem 4.5

Let \(n \ge 3.\) Assume that the algebra \({\textbf{A}}_4\) has exactly \(n-1\) ternary operations \(t_1,\ldots , t_{n-1} \) and satisfies conditions (4.3)–(4.5).

  1. (i)

    If the congruence identity

    $$\begin{aligned} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{r}}} \circ \alpha \beta \end{aligned}$$

    fails in \({\textbf{A}}_4,\) for some odd r,  then the congruence identity

    $$\begin{aligned} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{r+6}}} \circ \alpha \gamma \end{aligned}$$

    fails in some subalgebra of \( {\textbf{C}}_{4}^r \times {\textbf{C}}_{4}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 .\)

  2. (ii)

    More generally,  if the identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \chi (\alpha , \beta ,\gamma )\) fails in \({\textbf{A}}_4,\) for some \( \{ \circ , \cap \} \)-term \(\chi ,\) then the congruence identity

    $$\begin{aligned} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \gamma \circ \alpha \beta \circ \gamma \circ \chi (\alpha , \beta , \gamma ) \circ \gamma \circ \alpha \beta \circ \gamma \end{aligned}$$
    (4.7)

    fails in some subalgebra of \( {\textbf{C}}_{4}^r \times {\textbf{C}}_{4}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 .\)

Proof

Clause (i) is immediate from (ii), taking \(\chi ( \alpha , \beta , \gamma ) = \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{r}}} \circ \alpha \beta ,\) since \( \alpha \gamma \circ \alpha \beta \circ \alpha \gamma \subseteq \gamma \circ \alpha \beta \circ \gamma .\)

To prove (ii), let \(\tilde{\alpha },\) \(\tilde{\beta }\) and \(\tilde{\gamma }\) be congruences on \({\textbf{A}}_4\) witnessing the failure of \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \chi (\alpha , \beta ,\gamma ).\) Thus there are elements \(a,d \in A_4\) such that \((a,d) \in \tilde{\alpha }( \tilde{\beta } \circ \tilde{\alpha } \tilde{\gamma } \circ \tilde{\beta } )\) and \( (a,d) \not \in \chi (\tilde{\alpha }, \tilde{\beta },\tilde{\gamma } ) .\) Take \({\textbf{A}}_1={\textbf{A}}_2= {\textbf{C}}_{4}^r\) and \({\textbf{A}}_3 = {\textbf{C}}_{2}^r\) in Construction 4.2 and let \({\textbf{B}} = {\textbf{B}}(a,d).\) We now consider two congruences on \({\textbf{C}}_{4}^r\) and then construct appropriate congruences on \({\textbf{B}}.\) Let \(\beta ^*\) be the congruence on the lattice \({\textbf{C}}_4\) whose blocks are \(\{ 0,1\}\) and \(\{ 2,3 \}\) and let \( \gamma ^*\) be the congruence on \({\textbf{C}}_4\) whose blocks are \(\{ 0 \},\) \(\{ 1,2 \}\) and \(\{ 3 \}.\) Since \( \beta ^*\) and \( \gamma ^*\) are congruences on \({\textbf{C}}_4,\) they are also congruences on its term-reduct \({\textbf{C}}_{4}^r.\) Let 0 and 1 denote, respectively, the smallest and the largest congruence on any algebra under consideration. The congruence \( \beta ^* \times \beta ^* \times 1 \times \tilde{\beta } \) of \( {\textbf{C}}_{4}^r \times {\textbf{C}}_{4}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 \) induces a congruence \(\beta \) on the subalgebra \({\textbf{B}}.\) Similarly, \( \gamma ^* \times \gamma ^* \times 0 \times \tilde{\gamma } \) induces a congruence \(\gamma \) on \({\textbf{B}}.\) Finally, let \(\alpha \) be induced on \({\textbf{B}}\) by \( 1 \times 1 \times 0 \times \tilde{\alpha }.\)

Since \((a,d) \in \tilde{\alpha } ( \tilde{\beta } \circ \tilde{\alpha } \tilde{\gamma } \circ \tilde{\beta } ),\) we have \(a \mathrel {\tilde{\alpha }} d \) and there are \(b,c \in A_4\) such that \(a \mathrel { \tilde{\beta }} b \mathrel { \tilde{\alpha } \tilde{\gamma } } c \mathrel { \tilde{\beta } } d .\) Consider the following elements of B:

$$\begin{aligned} c_0 =(3,0,1, a), \quad c_1 =(2,1,0, b), \quad c_{2} = (1,2,0,c), \quad c_{3} = (0,3,1, d). \end{aligned}$$

To see that the above elements are actually in B,  we need to recall the definition of B from Construction 4.2(B). For the reader’s convenience we report here the definition: B is the set of the elements having one of the following forms:

$$\begin{aligned} \begin{gathered} \text {Type I} \\ (\frac{\ }{\ }, 0, \frac{\ }{\ }, a) \end{gathered} \qquad \qquad \begin{gathered} \text {Type II} \\ (0, 0, \frac{\ }{\ }, \frac{\ }{\ }), \end{gathered} \qquad \qquad \begin{gathered} \text {Type III} \\ (0, \frac{\ }{\ }, \frac{\ }{\ }, d) \end{gathered} \qquad \qquad \begin{gathered} \text {Type IV} \\ (\frac{\ }{\ }, \frac{\ }{\ }, 0, \frac{\ }{\ }) \end{gathered} \end{aligned}$$

Thus \(c_0, c_1,c_2, c_3 \in B ,\) since \(c_0\) has type I, \(c_1\) and \(c_2\) have type IV and \(c_3\) has type III. Moreover, \(c_0 \mathrel \alpha c_3\) and \(c_0 \mathrel \beta c_1 \mathrel { \alpha \gamma } c_2 \mathrel { \beta } c_3,\) thus \((c_0,c_3) \in \alpha ( \beta \circ \alpha \gamma \circ \beta ).\) We will show that \((c_0,c_3)\) does not belong to the right-hand side of (4.7). Otherwise, there are elements \(g,h \in B\) such that \((c_0, g) \in \gamma \circ \alpha \beta \circ \gamma ,\) \( (g,h) \in \chi (\alpha , \beta , \gamma ) \) and \((h,c_3) \in \gamma \circ \alpha \beta \circ \gamma .\) Then \( c_0 \mathrel { \gamma } g_1 \mathrel { \alpha \beta } g_2 \mathrel { \gamma } g ,\) for certain elements \(g_1\) and \(g_2.\) By the \(\gamma \)-equivalence of \(c_0\) and \(g_1,\) the first component of \(g_1\) is 3 and the third component of \(g_1\) is 1. By the \( \alpha \)-equivalence of \(g_1\) and \(g_2,\) the third component of \(g_2\) is 1. By the \( \beta \)-equivalence of \(g_1\) and \(g_2,\) the first component of \(g_2\) is either 3 or 2. Similarly, the third component of g is 1,  hence g does not have type IV. The first component of g ranges between 1 and 3,  in particular it is not 0. Since the first component of g is not 0,  g belongs to B and g does not have type IV, necessarily g has type I,  hence the fourth component of g is a.

Symmetrically, one can show that the fourth component of h is d. Recalling the definitions of \(\alpha ,\) \(\beta \) and \(\gamma \) and since \((g,h) \in \chi (\alpha , \beta , \gamma ) \) and \(\chi \) is a \(\{ \circ , \cap \}\)-term, we obtain \((a,d) \in \chi (\tilde{\alpha }, \tilde{\beta },\tilde{\gamma } ) ,\) a contradiction. \(\square \)

Remark 4.6

(a) Notice that the element \(g_1\) from the proof of Theorem 4.5(ii) must have type I, hence the fourth component of \(g_1\) is a,  so we actually have \(g_1=c_0.\)

(b) Using similar arguments, we have that, under the assumptions in Theorem 4.5(ii) and its proof, the following identities fail in \({\textbf{B}}\)

$$\begin{aligned} \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \phi \circ \chi (\alpha , \beta , \gamma ) \circ \psi \end{aligned}$$

where each of \(\phi \) and \(\psi \) can be taken to be either \(\alpha ( \gamma \circ \beta \circ \gamma ),\) \( \gamma \circ \alpha ( \beta \circ \gamma ),\) \(\alpha ( \gamma \circ \beta ) \circ \gamma ,\) or \( \gamma \circ \alpha \beta \circ \gamma .\)

Remark 4.7

As usual, let \(t_0\) and \(t_n\) denote the projections onto the first and the third coordinate. Suppose that \(t_0, t_1,\ldots , t_{n-1}, t_n \) is a sequence of Jónsson (resp., directed Jónsson) terms in the algebra \({\textbf{A}}_4\) in the assumptions of Theorem 4.5. If n is even, the algebra \({\textbf{B}}\) obtained in the proof is n-distributive (resp., n-directed distributive, no matter the parity of n). Indeed, \(t_0, t_1,\ldots , t_{n-1}, t_n \) is a sequence of Jónsson and directed Jónsson terms in both \( {\textbf{C}}_{2}^r\) and \( {\textbf{C}}_{4}^r.\) Hence \(t_0,\ldots , t_n \) is a sequence of Jónsson (resp., directed Jónsson) terms in \( {\textbf{C}}_{4}^r \times {\textbf{C}}_{4}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 ,\) as well as in any subalgebra.

4.3 Bounds for \( \alpha ( \beta \circ \gamma )\)

The present subsection is not necessary for the proof of Theorem 3.2.

Theorem 4.8

Let \(n \ge 3.\) Assume that the algebra \({\textbf{A}}_4\) has exactly \(n-1\) ternary operations \(t_1,\ldots , t_{n-1} \) and satisfies conditions (4.3)–(4.5).

  1. (i)

    If the congruence identity \(\alpha ( \beta \circ \gamma ) \subseteq \alpha { \gamma } \circ \alpha { \beta } \circ {{\mathop {\dots }\limits ^{r}}} \circ \alpha { \beta } \) fails in \({\textbf{A}}_4,\) for some even r,  then the congruence identity \(\alpha ( \beta \circ \gamma ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{r+4}}} \circ \alpha \beta \) fails in some subalgebra of \( {\textbf{C}}_{3}^r \times {\textbf{C}}_{3}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 .\)

  2. (ii)

    More generally,  for every \( \{ \circ , \cap \} \)-term \(\chi ,\) if the identity \(\alpha ( \beta \circ \gamma ) \subseteq \chi (\alpha , \beta , \gamma ) \) fails in \({\textbf{A}}_4,\) then the identity \(\alpha ( \beta \circ \gamma ) \subseteq \alpha (\gamma \circ \beta ) \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha (\gamma \circ \beta )\) fails in some subalgebra of \( {\textbf{C}}_{3}^r \times {\textbf{C}}_{3}^r \times {\textbf{C}}_{2}^r \times {\textbf{A}}_4 .\)

Proof

(i) is immediate from the special case \(\chi ( \alpha , \beta , \gamma ) = \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{r}}} \circ \alpha \beta \) of (ii), so let us prove (ii).

Under the assumptions in (ii), there are congruences \(\tilde{\alpha }, \tilde{\beta }, \tilde{\gamma }\) of \({\textbf{A}}_4\) and elements \(a,d \in A_4\) such that \( (a,d) \in \tilde{\alpha }( \tilde{\beta } \circ \tilde{\gamma } )\) and \((a,d) \not \in \chi (\tilde{\alpha }, \tilde{\beta },\tilde{\gamma }).\) Choose such a pair (ad),  take \({\textbf{A}}_1={\textbf{A}}_2= {\textbf{C}}_{3}^r\) and \({\textbf{A}}_3 = {\textbf{C}}_{2}^r\) in Construction 4.2 and let \({\textbf{B}} = {\textbf{B}}(a,d).\) Let \(\beta ^*\) be the congruence on \({\textbf{C}}_3\) whose blocks are \(\{ 0\}\) and \(\{ 1,2 \}\) and let \( \gamma ^*\) be the congruence on \({\textbf{C}}_3\) whose blocks are \(\{ 0,1 \}\) and \(\{ 2 \}.\) Let \(\beta ,\) \(\gamma \) and \(\alpha \) be the congruences on \({\textbf{B}}\) induced, respectively, by \( \beta ^* \times \gamma ^* \times 1 \times \tilde{\beta } ,\) \( \gamma ^* \times \beta ^* \times 1 \times \tilde{\gamma } \) and \( 1 \times 1 \times 0 \times \tilde{\alpha }.\) Notice a difference with respect to the proof of Theorem 4.5: here the first two components of \(\beta \) are distinct, and the same for \(\gamma .\) Also, the third component of \(\gamma \) is changed. Consider the following elements of B:

$$\begin{aligned} c_0 =(2,0,1, a), \qquad c_1 =(1,1,0, b), \qquad c_{2} = (0,2,1,d), \end{aligned}$$

of types, respectively, I, IV and III, where b is an element witnessing \((a,d) \in \tilde{\beta } \circ \tilde{\gamma } ,\) thus \((c_0, c_2) \in \alpha ( \beta \circ \gamma ).\)

We will show that \((c_0,c_2)\) does not belong to \(\alpha (\gamma \circ \beta ) \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha (\gamma \circ \beta ).\) Otherwise, there are elements \(g,h \in B\) such that \((c_0, g) \in \alpha ( \gamma \circ \beta ),\) \( (g,h) \in \chi ( \alpha , \beta , \gamma ) \) and \((h,c_2) \in \alpha ( \gamma \circ \beta ).\) Thus \(c_0 \mathrel \alpha g \) and \( c_0 \mathrel { \gamma } g_1 \mathrel { \beta } g ,\) for some \(g_1 \) in B. By \(\gamma \)-equivalence, the first component of \(g_1\) is 2 and, by \(\beta \)-equivalence, the first component of g is either 1 or 2. By \(\alpha \)-equivalence, the third component of g is 1 and since its first component is not 0,  g has type I, thus its fourth component is a. Symmetrically, one can show that the fourth component of h is d. From \( (g,h) \in \chi ( \alpha , \beta , \gamma ) \) we obtain \((a,d) \in \chi (\tilde{\alpha }, \tilde{\beta },\tilde{\gamma }),\) a contradiction. \(\square \)

Proposition 4.9

Under the assumptions and the notation from Theorem 4.8(ii) and its proof,  let \({\textbf{B}}'\) be the subalgebra of \({\textbf{B}}\) generated by \(c_0,\) \(c_1\) and \(c_2.\) Then the identity \(\alpha ( \beta \circ \gamma ) \subseteq \gamma \circ \alpha \beta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \gamma \circ \beta \) fails in \({\textbf{B}}'.\)

Proof

We first show that \(c_0\) is the only element in \({\textbf{B}}'\) having 2 as the first component. Any element of \(B'\) has the form \(t(c_0, c_1, c_2),\) for some ternary term t. Suppose by contradiction that in \(B'\) there is some element \(c^* \ne c_0\) such that the first component of \(c^*\) is 2. Thus \(c^* =t(c_0, c_1, c_2),\) for some term t. Choose \(c^*\) and t in such a way that t has minimal complexity, hence \(t(x,y,z) \approx t_i (r_1(x,y,z) , r_2(x,y,z) , r_3(x,y,z) ),\) for some \(i < n\) and ternary terms \(r_1,\) \(r_2\) and \(r_3\) such that each of \(r_1(c_0, c_1, c_2),\) \(r_2(c_0, c_1, c_2)\) and \(r_3(c_0, c_1, c_2)\) is either equal to \(c_0,\) or has the first component different from 2.

If \(2 \le i \le n-2,\) then \(t_i(x,y,z) \approx xz\) on the first three components. Since 2 is the first component of \(c^* =t(c_0, c_1, c_2)= t_i(r_1(c_0, c_1, c_2), r_2(c_0, c_1, c_2), r_3(c_0, c_1, c_2)),\) we get that 2 is the first component of both \(r_1(c_0, c_1, c_2) \) and \(r_3(c_0, c_1, c_2).\) By minimality of t\(c_0 =r_1(c_0, c_1, c_2) \) and \(c_0 = r_3(c_0, c_1, c_2),\) hence \(c^*\) and \(c_0\) coincide on the first three components. But then \(c^*,\) being in B,  must have type I, so \(c^*\) and \(c_0\) coincide also on the fourth component, hence \(c^*= c_0.\)

If \(i=1 ,\) then \(t_1(x,y,z) \approx x(y+z)\) on the first three components. Since 2 is the first component of \(c^* =t(c_0, c_1, c_2)= t_1(r_1(c_0, c_1, c_2), r_2(c_0, c_1, c_2), r_3(c_0, c_1, c_2)),\) we get that 2 is the first component of \(r_1(c_0, c_1, c_2) \) and of at least one between \(r_2(c_0, c_1, c_2)\) and \(r_3(c_0, c_1, c_2).\) Again by minimality of t,  we get that \(c_0 =r_1(c_0, c_1, c_2) \) and either \(c_0 =r_2(c_0, c_1, c_2)\) or \(c_0 =r_3(c_0, c_1, c_2).\) In both cases, \(c^*\) and \(c_0\) coincide on the first three components and, arguing as above, \(c^*= c_0.\) The case \(i=n-1\) is similar.

In each case we obtain \(c^*= c_0,\) a contradiction, thus \(c_0\) is the only element in \({\textbf{B}}'\) having 2 as the first component.

Suppose that the assumptions in Condition (ii) in Theorem 4.8 hold. Let \(\alpha ,\) \(\beta \) and \(\gamma \) be the congruences induced on \({\textbf{B}}'\) by the congruences with the same name in the proof of Theorem 4.8. If g is an element of \( B'\) such that \((c_0, g) \in \gamma \circ \alpha \beta ,\) then \(c_0 \mathrel { \gamma } g_1 \mathrel { \alpha \beta } g ,\) for some \(g_1 \in B',\) but \(\gamma \)-equivalence implies that the first component of \(g_1\) is 2,  thus \(c_0=g_1,\) by the above paragraphs. By \(\beta \)-equivalence, the first component of g is not 0 and, by \(\alpha \)-equivalence, the third component of g is 1,  hence g gas type I. Now the final argument in the proof of Theorem 4.8 applies. \(\square \)

Definition 4.10

Baker [1] introduced and studied the variety generated by term-reducts of lattices in which the only basic operation is \(t_{{\mathcal {B}}}(x,y,z) = x(y+z).\) We shall denote Baker’s variety by \({\mathcal {B}}.\) As we mentioned in Definition 4.4, here it is convenient to deal with distributive lattices, hence we shall usually consider the variety \({\mathcal {B}}^d\) defined like Baker’s, but considering only reducts of distributive lattices. In different terminology, \({\mathcal {B}}^d\) is the variety of distributive (dual) nearlattices, when considered as ternary algebras [2, 4].

Notice that, for each \(n \ge 3,\) Baker’s variety is term-equivalent to the variety generated by the algebras \({\textbf{L}}^r\) considered in Definition 4.4. Indeed, if \(t_i(x,y,z)=xz\) in (4.6), then \(t_i\) can be expressed as \(t_i(x,y,z) = t_{{\mathcal {B}}}(x,z,z) = x(z+z).\) However, the exact types of algebras will be highly relevant in our arguments.

Congruence identities valid in Baker’s variety have been intensively studied in [19]. The failure of the identity \(\alpha ( \beta \circ \gamma ) \subseteq \gamma \circ \alpha \beta \circ \alpha \gamma \circ \beta \) in the next proposition does not follow from results in [19].

Proposition 4.11

Neither \({\mathcal {B}},\) nor \({\mathcal {B}}^d,\) nor the variety \({\mathcal{N}\mathcal{L}}\) of nearlattices are 5-reversed-modular.

Moreover,  the congruence identities \(\alpha ( \beta \circ \gamma ) \subseteq \alpha ( \gamma \circ \beta ) \circ \alpha ( \gamma \circ \beta )\) and \(\alpha ( \beta \circ \gamma ) \subseteq \gamma \circ \alpha \beta \circ \alpha \gamma \circ \beta \) fail in \({\mathcal {B}},\) \({\mathcal {B}}^d\) and \({\mathcal{N}\mathcal{L}}.\)

In particular, neither \({\mathcal {B}},\) nor \({\mathcal {B}}^d\) nor \({\mathcal{N}\mathcal{L}}\) are 4-alvin.

Proof

Let \(n=3.\) Consider only the first three components in Construction 4.2 and in the proofs of Theorems 4.34.5 and 4.8. Or, more formally, rather than reformulating everything, take \({\textbf{A}}_4\) as a 1-element algebra everywhere. By the comment shortly after Definition 4.10, all the mentioned constructions furnish algebras which are term-equivalent to algebras in \({\mathcal {B}}^d,\) hence satisfying the same congruence identities.

Construct an algebra \({\textbf{B}}\) and elements \(c_0,\ldots , c_3\) as in the proof of Theorem 4.5(ii), either disregarding the fourth component, or taking some fixed element (the only element in \(A_4\)) at the fourth place. With the corresponding definitions of \(\alpha ,\) \(\beta \) and \(\gamma \) from the proof of Theorem 4.5(ii), in the present situation we need no further assumption to get \((c_0,c_3) \in \alpha ( \beta \circ \alpha \gamma \circ \beta ).\) Put in another way, since here we are assuming \(a=d,\) we automatically obtain \( (a,d) \in \tilde{\alpha } ( \tilde{\beta } \circ \tilde{ \alpha }\tilde{\gamma } \circ \tilde{\beta } ).\) We shall show that \({\textbf{B}}\) is not 5-reversed-modular. If, by contradiction, \({\textbf{B}}\) is 5-reversed-modular, then \((c_0,c_3) \in \alpha \gamma \circ \alpha \beta \circ \alpha \gamma \circ \alpha \beta \circ \alpha \gamma ,\) a fortiori, \((c_0,c_3) \in \alpha ( \gamma \circ \beta \circ \gamma ) \circ \alpha ( \gamma \circ \beta \circ \gamma ).\) Thus there is some element \(g \in B\) such that \((c_0,g) \in \alpha ( \gamma \circ \beta \circ \gamma )\) and \((g, c_3) \in \alpha ( \gamma \circ \beta \circ \gamma ).\) The proof of Theorem 4.5 shows that the first component of g is not 0 and that g has type I. The symmetric argument shows that g has type III, a contradiction, since the first component of any element of type III is 0. Notice that here g plays at the same time the role of both g and h from the proof of Theorem 4.5. The fact that \({\textbf{B}}^d\) is not 5-reversed-modular is also a consequence of the last equation in [19, Proposition 2.3], taking \(n=3\) there.

The proof that the identities in the second statement fail is obtained by a similar variation on the proofs of Theorem 4.8(ii) and of Proposition 4.9, taking, again, \({\textbf{A}}_4\) as a 1-element algebra everywhere. Another proof that \(\alpha ( \beta \circ \gamma ) \subseteq \alpha ( \gamma \circ \beta ) \circ \alpha ( \gamma \circ \beta )\) fails in \({\textbf{B}}^d\) follows from the case \(n=2\) in the penultimate identity in [19, Proposition 2.3].

The final statement is then immediate from the fact that \(\alpha \gamma \circ \alpha \beta \subseteq \alpha ( \gamma \circ \beta ).\) \(\square \)

4.4 Counterexamples with alvin terms

Operations of Boolean algebras will be denoted by juxtaposition, \(+\) and \('.\) Let \({\textbf{2}} = \{ 0,1 \} \) be the 2-element Boolean algebra with largest element 1 and smallest element 0. Let \({\textbf{4}} = \{ 0,1, 1', 2 \} \) be the 4-element Boolean algebra with largest element 2 and smallest element 0. We have chosen such a labeling to maintain the analogy with the preceding subsections; thus, for example, \({\textbf{C}}_3 = \{ 0,1,2 \} \) is a sublattice of the lattice-reduct of \({\textbf{4}}.\) The labeling is admittedly nonstandard, but we shall make no use of the interpretation of the constants in Boolean algebras, hence no notational issue arises.

Definition 4.12

Fix some natural number \(n \ge 3.\)

For a Boolean algebra \({\textbf{A}},\) let \({\textbf{A}}^r\) denote the term-reduct with operations

$$\begin{aligned} t_1(x,y,z)= & {} x(y'+z), \qquad t_2(x,y,z) = xz, \qquad t_3(x,y,z) = xz, \qquad \dots ,\\{} & {} \qquad \dots , \qquad t_{n-2}(x,y,z) = xz, \qquad t_{n-1}(x,y,z) = z(y'+x). \end{aligned}$$

If n is even and \(t_0,\) \(t_n\) are the projections onto the first, respectively, the third coordinate, then \(t_0, t_1,\ldots , t_n\) is a sequence of alvin terms in \({\textbf{A}}^r.\) Notice that \({\textbf{A}}^r\) satisfies conditions (4.1)–(4.2) in Construction 4.2.

Theorem 4.13

Let \(n \ge 3.\) Assume that the algebra \({\textbf{A}}_4\) has exactly \(n-1\) ternary operations \(t_1,\ldots , t_{n-1} \) and satisfies conditions (4.3)–(4.5).

  1. (i)

    If the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{r}}} \) fails in \({\textbf{A}}_4,\) for some r,  then the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{r+2}}} \) fails in some subalgebra of \( {\textbf{4}}^r \times {\textbf{4}}^r \times {\textbf{2}}^r \times {\textbf{A}}_4 .\)

Moreover,  for every \( \{ \circ , \cap \} \)-term \(\chi \) and every choice of \(\delta = \beta \) or \( \delta = \gamma \) and of \(\varepsilon = \beta \) or \(\varepsilon = \gamma ,\) the following hold.

  1. (ii)

    If the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \chi (\alpha , \beta , \gamma ) \) fails in \({\textbf{A}}_4,\) then the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \delta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \varepsilon \) fails in some subalgebra of \( {\textbf{4}}^r \times {\textbf{4}}^r \times {\textbf{2}}^r \times {\textbf{A}}_4 .\)

  2. (iii)

    If the congruence identity \(\alpha ( \beta \circ \gamma ) \subseteq \chi (\alpha , \beta , \gamma ) \) fails in \({\textbf{A}}_4,\) then the congruence identity \(\alpha ( \beta \circ \gamma ) \subseteq \alpha \delta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \varepsilon \) fails in some subalgebra of \( {\textbf{4}}^r \times {\textbf{4}}^r \times {\textbf{2}}^r \times {\textbf{A}}_4 .\)

Proof

As usual by now, (i) is a special case of (ii). Take \(\chi ( \alpha , \beta , \gamma ) = \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{r}}} ,\) \(\delta = \beta \) and \(\varepsilon = \gamma \) if r is even, \(\varepsilon = \beta \) if r is odd.

To prove (ii), suppose that \(\tilde{\alpha },\) \(\tilde{\beta }\) and \(\tilde{\gamma }\) are congruences on \({\textbf{A}}_4\) and ad are elements of \( A_4\) such that \((a,d) \in \tilde{\alpha }( \tilde{\beta } \circ \tilde{\alpha } \tilde{\gamma } \circ \tilde{\beta } )\) and \( (a,d) \not \in \chi (\tilde{\alpha }, \tilde{\beta }, \tilde{\gamma }) .\) Let \(\beta ^*\) be the congruence on \({\textbf{4}}\) whose blocks are \(\{ 1,2 \}\) and \(\{ 0, 1' \}.\) Let \( \gamma ^*\) be the congruence on \({\textbf{4}}\) whose blocks are \(\{ 0,1 \}\) and \(\{ 1', 2 \}.\) Since \(\beta ^*\) and \(\gamma ^*\) are congruences on the Boolean algebra \({\textbf{4}},\) they are also congruences on the reduct \({\textbf{4}}^r.\) Apply Construction 4.2 with \({\textbf{A}}_1={\textbf{A}}_2= {\textbf{4}}^r\) and \({\textbf{A}}_3 = {\textbf{2}}^r.\) Let \(\beta ,\) \(\gamma \) and \(\alpha \) be the congruences on \({\textbf{B}} = {\textbf{B}}(a,d)\) induced, respectively, by \( \beta ^* \times \beta ^* \times 1 \times \tilde{\beta } ,\) \( \gamma ^* \times \gamma ^* \times 1 \times \tilde{\gamma } \) and \( 1 \times 1 \times 0 \times \tilde{\alpha }.\) Since \((a,d) \in \tilde{\alpha }( \tilde{\beta } \circ \tilde{\alpha } \tilde{\gamma } \circ \tilde{\beta } ),\) we get that \(a \mathrel {\tilde{\alpha }} d ,\) and there are \(b,c \in A_4\) such that \(a \mathrel { \tilde{\beta }} b \mathrel { \tilde{\alpha } \tilde{\gamma } } c \mathrel { \tilde{\beta } } d .\) Consider the following elements of B:

$$\begin{aligned} c_0 =(2,0,1, a), \quad c_1 =(1,0,0, b), \quad c_{2} = (0,1,0,c), \quad c_{3} = (0,2,1, d). \end{aligned}$$

As in the proof of Theorem 4.5, \(c_0\) has type I, \(c_1\) and \(c_2\) have type IV and \(c_3\) has type III, thus they belong to B. Moreover, \(c_0 \mathrel \alpha c_3\) and \(c_0 \mathrel \beta c_1 \mathrel { \alpha \gamma } c_2 \mathrel { \beta } c_3,\) hence \((c_0,c_3) \in \alpha ( \beta \circ \alpha \gamma \circ \beta ).\)

Whatever the choice of \(\delta \) and \(\varepsilon ,\) assume by contradiction that \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \delta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \varepsilon ,\) thus \((c_0,c_3) \in \alpha \delta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \varepsilon ,\) hence \(c_0 \mathrel { \alpha \delta } g ,\) \((g,h ) \in \chi ( \alpha , \beta , \gamma ) \) and \(h \mathrel { \alpha \varepsilon } c_3 ,\) for certain elements gh of \({\textbf{B}}.\)

Since the first component of \(c_0\) is 2 and \(c_0 \mathrel { \delta } g ,\) we have that, whatever the choice of \(\delta ,\) be it \( \beta \) or \( \gamma ,\) the first component of g is not 0. By \(\alpha \)-connection of \(c_0\) and g,  the third component of g is 1,  hence g has type I, so the fourth component of g is a. Symmetrically, one can show that the fourth component of h is d. Since \((g,h ) \in \chi ( \alpha , \beta , \gamma ) ,\) we get \((a,d) \in \chi (\tilde{\alpha }, \tilde{\beta }, \tilde{\gamma }) ,\) a contradiction.

To prove (iii), we use an argument resembling the proof of Theorem 4.8. Suppose that \( (a,d) \in \tilde{\alpha }( \tilde{\beta } \circ \tilde{\gamma } )\) and \((a,d) \not \in \chi (\tilde{\alpha }, \tilde{\beta }, \tilde{\gamma }) .\) As above, let \(\beta ^*\) be the congruence on \({\textbf{4}}^r\) whose blocks are \(\{ 1,2 \}\) and \(\{ 0, 1' \}\) and let \( \gamma ^*\) be the congruence on \({\textbf{4}}^r\) whose blocks are \(\{ 0,1 \}\) and \(\{ 1', 2 \}.\) In this case, let \(\beta ,\) \(\gamma \) and \(\alpha \) be the congruences on \({\textbf{B}} = {\textbf{B}}(a,d)\) induced, respectively, by \( \beta ^* \times \gamma ^* \times 1 \times \tilde{\beta } ,\) \( \gamma ^* \times \beta ^* \times 1 \times \tilde{\gamma } \) and \( 1 \times 1 \times 0 \times \tilde{\alpha }.\) If b is such that \( a \mathrel { \tilde{\beta } } b \mathrel { \tilde{\gamma } } d,\) consider the following elements of B:

$$\begin{aligned} c_0 =(2,0,1, a), \qquad c_1 =(1,1,0, b), \qquad c_{2} = (0,2,1,d), \end{aligned}$$

thus \((c_0, c_2) \in \alpha ( \beta \circ \gamma ).\) If \( (c_0, c_2) \in \alpha \delta \circ \chi ( \alpha , \beta , \gamma ) \circ \alpha \varepsilon ,\) this relation is witnessed by appropriate elements g and h and, arguing as in (ii), the fourth components of g and h are, respectively a and d. But then \((a,d) \in \chi (\tilde{\alpha }, \tilde{\beta }, \tilde{\gamma }) ,\) a contradiction. \(\square \)

Remark 4.14

In the notation from the proof of Theorem 4.13, both in case (ii) and in case (iii), if we let \(e_1=(1,0,1,a),\) \(e_1^* = (1',0,1,a),\) we see that \(\{ c_0, e_1\}\) is an \( \alpha \beta \)-block in B and \(\{ c_0, e_1^*\}\) is an \( \alpha \gamma \)-block in B. This will probably be useful in different situations.

5 Day’s Theorem is optimal for n even

Theorem 5.1

Suppose that \(n \ge 2\) and n is even.

  1. (i)

    There is a locally finite n-distributive variety that is not \(2n{-}1\)-reversed-modular, in particular, not \(2n{-}2\)-modular.

  2. (ii)

    There is a locally finite n-alvin variety that is not \(2n{-}3\)-modular.

Proof

If some variety \({\mathcal {V}}\) is not \(2n{-}1\)-reversed-modular, then \({\mathcal {V}}\) is not \(2n{-}2\)-modular, by Remark 2.11.

The proof of the hard parts of the theorem proceeds by simultaneous induction on n. We first consider the base cases.

The variety of distributive lattices is 2-distributive and not 3-reversed-modular. Indeed, under the equivalence given by Remark 2.10, 3-reversed-modularity reads \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ \alpha \gamma \) and this identity implies 3-permutability: just take \(\alpha =1,\) the largest congruence. The variety of distributive lattices is not 3-permutable, hence it is not 3-reversed-modular.

The variety of Boolean algebras is locally finite, 2-alvin and not 1-modular. Notice that a 1-modular variety is a trivial variety having only 1-element algebras. Thus the basis of the induction is true.

Suppose that \(n \ge 4\) and that the theorem is true for \(n-2.\) By the inductive hypothesis and Remark 2.10, there exist an \(n {-} 2\)-alvin variety \({\mathcal {V}}\) and an algebra \({\textbf{D}} \in {\mathcal {V}}\) with congruences \(\alpha ,\) \(\beta \) and \(\gamma \) such that the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{2n-7}}} \circ \alpha \beta \) fails in \({\textbf{D}}.\) Since \({\textbf{D}} \) belongs to an \(n{-}2\)-alvin variety, \({\textbf{D}} \) has \(n-2\) alvin terms. By Remark 4.1, we may assume that these terms are actually operations of \({\textbf{D}} \) and that \({\textbf{D}} \) has no other operation.

If the alvin operations of \({\textbf{D}}\) are \(s_0,\ldots , s_{n-2},\) relabel the operations as \(t_1,\ldots , t_{n-1}\) and let \({\textbf{A}}_4 \) be the corresponding algebra in the renamed language. Considering the first projection as \(t_0\) and the third projection as \(t_n,\) \({\textbf{A}}_4\) is n-distributive. Applying Theorem 4.5(i) with \(r=2n-7,\) we get that \(2n{-}1\)-reversed-modularity fails in the resulting algebra \({\textbf{B}}.\) By Remark 4.7, \({\textbf{B}}\) is n-distributive, hence generates an n-distributive variety.

In the parallel situation, again by the inductive hypothesis and Remark 2.10, there exist an \(n {-} 2\)-distributive variety \({\mathcal {V}}\) and an algebra \({\textbf{D}} \in {\mathcal {V}}\) such that the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{2n-5}}} \circ \alpha \gamma \) fails in \({\textbf{D}}.\) Again by Remark 4.1, we can suppose that \({\textbf{D}}\) has only the Jónsson operations. Relabeling the operations as in the previous paragraph, we obtain an n-alvin algebra \({\textbf{A}}_4.\) By Theorem 4.13(i) with \(r=2n-5\) and a remark analogous to Remark 4.7, there is an n-alvin algebra \({\textbf{B}}\) (which generates an n-alvin variety) in which \(2n{-}3\)-modularity fails.

The induction step is thus complete. In order to conclude the proof of the theorem it is enough to show that the above varieties can be taken to be locally finite. The varieties considered in the basis of the induction are locally finite; at each induction step, \({\textbf{B}}\) can be taken to belong to the join of two locally finite varieties, hence to a locally finite variety. \(\square \)

Lemma 5.2

  1. (a)

    If \(n \ge 4\) and n is even,  then every n-alvin variety is \(2n{-}3\)-reversed-modular.

  2. (b)

    If \(n \ge 2,\) then every n-alvin variety is \(2n{-}2\)-modular. In particular,  if n is odd,  then every n-distributive variety is \(2n{-}2\)-modular.

Proof

Part (a) is a special case of [20, Proposition 6.4] with \(n-2\) in place of n there. For the reader’s convenience, we present a direct proof along the lines of Day’s argument, by applying two times a trick in the proof of [15, Theorem 1 (3) \(\rightarrow \) (1)], both with respect to the term \(t_{1}\) and to the term \(t_{n-1}.\)

Given alvin terms \(t_0,\ldots , t_{n},\) we obtain the following terms \(u_0,\ldots , u_{2n-3}\) satisfying the reversed form of the conditions in Definition 2.7. The terms \(u_0,\ldots , u_{2n-3}\) below are considered as 4-ary terms depending on the variables xyzw in that order. The term \(u_0\) is constantly x and the term \(u_{2n-3}\) is constantly w. The remaining terms are defined in the following table, where we omit commas for lack of space and the index i varies from 0 to \( \frac{n-4}{2} .\)

$$\begin{aligned} u_1&=t_1(x y z)&u_2&=t_2(x y w)&u_3&=t_2(x z w)&u_4&=t_3(x z w) \\ u_5&=t_3(x y w)&u_6&=t_4(x y w)&u_7&=t_4(x z w){} & {} \dots \\ u_{4i{+}1}&=t_{2i{+}1}(x y w)&u_{4i{{+}}2}&=t_{2i{+}2}(x y w)&u_{4i{{+}}3}&=t_{2i{+}2}(x z w)&u_{4i{+}4}&=t_{2i{+}3}(x z w) \\&\dots&u_{2n-10}\hspace{-1 pt}&= t_{n{-}4}(x y w)&u_{2n{-}9}&= t_{n{-}4}(x z w)&u_{2n{-}8}&= t_{n{-}3}(x z w) \\ u_{2n{-}7}&= t_{n{-}3}(x y w)&u_{2n{-}6}&= t_{n{-}2}(x y w)&u_{2n{-}5}&= t_{n{-}2}(x z w)&u_{2n{-}4}&= t_{n{-}1}(y z w) \end{aligned}$$

Notice the different arguments of \(t_{1}\) and of \(t_{n-1}\) with respect to the other terms in the corresponding columns. If \(n=4,\) we consider only the first line, taking \( u_{4} = t_{3}(y z w).\) Notice that the indices in the last two lines follow the same pattern of the preceding lines, taking, respectively, \(i= \frac{n-6}{2} \) and \(i= \frac{n-4}{2} .\) We can do this since n is assumed to be even.

The fact that \(u_0,\ldots , u_{2n}\) satisfy the equations in Definition 2.7 with the conditions for even and odd indices exchanged is easy and is proved as in [5, p. 172–173]. The only different computations are \(u_{0} (x,y,y,w)\approx x\approx t_{0}(x,y,y)\approx t_{1}(x,y,y)\approx u_{1} (x,y,y,w) \) and \(u_{1} (x,x,w,w) \approx t_1(x,x,w)\approx t_2(x,x,w)\approx u_{2} (x,x,w,w).\) Note that, in order to perform the above computations, it is fundamental to deal with the alvin and the reversed Day conditions! Symmetrically, \( u_{2n-5} (x,x,w,w)\approx t_{n-2}(x,w,w) \approx t_{n-1}(x,w,w) \approx u_{2n-4} (x,x,w,w)\) and \(u_{2n-4} (x,y,y,w)\approx t_{n-1}(y,y, w) \approx t_{n}(y,y,w) \approx w \approx u_{2n-3} (x,y,y,w).\) Note that here it is fundamental to have n even! Note also that we have not used the equations \(x\approx t_1(x,y,x)\) and \(t_{n-1}(x,y,x) \approx x\) in the above computations.

The case n even in (b) follows from (a) and Remark 2.11. The case n odd in (b) is proved in a similar way, with no “special trick” concerning \(t_{n-1},\) namely, taking \( u_{2n{-}4} = t_{n{-}1}(x, y, w) \) and \( u_{2n{-}3} = t_{n{-}1}(x, z, w) .\) We get that every n-alvin variety is \(2n{-}2\)-reversed modular, but this is equivalent to \(2n{-}2\)-modular, by Remark 2.11. The argument appears in the proof of [15, Theorem 1 (3) \(\rightarrow \) (1)], though the authors use it in connection with Gumm terms, not explicitly in connection with Day’s problem. The last statement follows from the fact that if n is odd, then n-alvin and n-distributive are equivalent conditions, by Remark 2.6(a). \(\square \)

Corollary 5.3

Suppose that \(n \ge 2\) and n is even.

  1. (i)

    Every n-distributive variety is \(2n{-}1\)-modular.

  2. (ii)

    Every n-alvin variety is \(2n{-}2\)-modular.

  3. (iii)

    Every 2-alvin variety is 2-reversed-modular. If \(n \ge 4,\) then every n-alvin variety is \(2n{-}3\)-reversed-modular.

  4. (iv)

    All the above results are sharp :  for every even \(n \ge 2\) there are an n-distributive variety which is not \(2n{-}2\)-modular and an n-alvin variety which is not \(2n{-}3\)-modular,  in particular,  by Remark 2.11, not \(2n{-}4\)-reversed-modular. The variety of Boolean algebras is 2-alvin and not 1-reversed-modular.

Proof

As already mentioned, (i) is due to Day [5] and the assumption that n is even is not necessary in (i). The proof is slightly simpler than the proof of Lemma 5.2. This time the chain of terms is given by

$$\begin{aligned} u_1&= t_1(x, y, w),&u_2&= t_1(x, z, w),&u_3&= t_2(x, z, w),&u_4&= t_2(x, y, w),\\ u_5&= t_3(x, y, w),&u_6&= t_3(x, z, w),&\dots \end{aligned}$$

and there are no special variations.

(ii) is a special case of Lemma 5.2(b).

(iii) As mentioned in Definition 2.1, 2-alvin is arithmeticity. In particular, by distributivity (hence modularity) and permutability, we get both 2-modularity and 2-reversed-modularity. If \(n \ge 4,\) we get that every n-alvin variety \({\mathcal {V}}\) is \(2n{-}3\)-reversed-modular from Lemma 5.2(a).

The nontrivial parts in (iv) are given by Theorem 5.1. \(\square \)

The arguments in the proof of Theorem 5.1, together with Theorems 4.8(ii), 4.13 and Proposition 4.9, allow us to present other congruence identities which are not always satisfied in n-distributive and n-alvin varieties. Let \( {{\mathop {\dots }\limits ^{ \ell }}} \circ \gamma \circ \beta \) denote \( \gamma \circ \beta \circ {{\mathop {\dots }\limits ^{ \ell }}} \circ \beta \) if \(\ell \) is even and \( \beta \circ \gamma \circ {{\mathop {\dots }\limits ^{ \ell }}} \circ \beta \) if \(\ell \) is odd. If R is a binary relation and k is a natural number, let \(R^k = R \circ R \circ {{\mathop {\dots }\limits ^{k}}} \circ R.\)

Theorem 5.4

Suppose that \(n \ge 2,\) n is even and let \(\ell = \frac{n}{2} .\)

  1. (i)

    There is a locally finite n-distributive variety in which the following congruence identities fail : 

    $$\begin{aligned} \alpha ( \beta \circ \gamma )&\subseteq ( \alpha ( \gamma \circ \beta ))^\ell , \end{aligned}$$
    (5.1)
    $$\begin{aligned} \alpha ( \beta \circ \gamma )&\subseteq ( \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{ \ell }}} ) \circ ( {{\mathop {\dots }\limits ^{ \ell }}} \circ \alpha \gamma \circ \beta ). \end{aligned}$$
    (5.2)
  2. (ii)

    If \(n \ge 4,\) then there is a locally finite n-alvin variety in which the following congruence identities fail : 

    $$\begin{aligned} \alpha ( \beta \circ \gamma )&\subseteq \alpha \beta \circ ( \alpha ( \gamma \circ \beta ))^{\ell -1} \circ \alpha \gamma ,\end{aligned}$$
    (5.3)
    $$\begin{aligned} \alpha ( \beta \circ \gamma )&\subseteq (\alpha \beta \circ \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{ \ell }}} ) \circ ( {{\mathop {\dots }\limits ^{ \ell }}} \circ \alpha \gamma \circ \beta \circ \alpha \gamma ). \end{aligned}$$
    (5.4)

Proof

The case \(n=2\) in (i) is witnessed by the variety of distributive lattices. Recall that, by convention, \( \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{1}}}= \gamma .\)

The case \(n=4\) in (i) is witnessed by Baker’s variety \({\mathcal {B}}^d,\) as proved in Proposition 4.11.

The rest of the proof proceeds by simultaneous induction as in the proof of Theorem 5.1. Note that here we necessarily skip the case \(n=2\) in (ii), since 2-alvin is arithmeticity and \(\alpha ( \beta \circ \gamma ) \subseteq \alpha \beta \circ \alpha \gamma \) holds in arithmetical varieties. This is the reason why we need consider the case \(n=4\) in (i) in the basis of the induction.

Suppose that \(n \ge 4\) and that (i) holds for \(n-2.\) Thus there is an \(n{-}2\)-distributive variety in which, say, \(\alpha ( \beta \circ \gamma ) \subseteq ( \alpha ( \gamma \circ \beta ))^{\ell -1}\) fails, as witnessed by some algebra \({\textbf{D}}.\) Use the arguments in the proof of Theorem 5.1, in particular, obtain an algebra \({\textbf{A}}_4\) by relabeling the operations of \({\textbf{D}}.\) Taking \(\delta = \beta ,\) \(\varepsilon = \gamma \) and \(\chi =( \alpha ( \gamma \circ \beta ))^{\ell -1}\) in Theorem 4.13(iii) and using Remark 4.7 we obtain an n-alvin algebra in which \(\alpha ( \beta \circ \gamma ) \subseteq \alpha \beta \circ ( \alpha ( \gamma \circ \beta ))^{\ell -1} \circ \alpha \gamma \) fails. Thus (ii) holds for n.

Suppose that \(n \ge 6\) and that (ii) holds for \(n-2.\) Thus there is an \(n {-} 2\)-alvin variety \({\mathcal {V}}\) in which \(\alpha ( \beta \circ \gamma ) \subseteq \alpha \beta \circ ( \alpha ( \gamma \circ \beta ))^{\ell -2} \circ \alpha \gamma \) fails. Taking \( \chi = \alpha \beta \circ ( \alpha ( \gamma \circ \beta ))^{\ell -2} \circ \alpha \gamma \) in Theorem 4.8(ii), by the arguments usual by now, we get an n-distributive algebra in which \(\alpha ( \beta \circ \gamma ) \subseteq \alpha ( \gamma \circ \beta ) \circ \alpha \beta \circ ( \alpha ( \gamma \circ \beta ))^{\ell -2} \circ \alpha \gamma \circ \alpha ( \gamma \circ \beta ) \) fails. Thus the identity (5.1) fails for \(\ell ,\) since, for congruences, \(\alpha ( \gamma \circ \beta ) \circ \alpha \beta = \alpha ( \gamma \circ \beta ) \) and \(\alpha \gamma \circ \alpha ( \gamma \circ \beta ) = \alpha ( \gamma \circ \beta ) .\) On the other hand, if (5.4) fails in \({\mathcal {V}}\) for \(\ell -1,\) we get an n-distributive algebra in which (5.2) fails using Proposition 4.9. \(\square \)

Since \( \alpha \gamma \circ \alpha \beta \subseteq \alpha ( \gamma \circ \beta ),\) we get that the variety constructed in Theorem 5.4(i) is n-distributive and not n-alvin. Similarly, the variety constructed in Theorem 5.4(ii) is n-alvin and not n-distributive. Thus we get another proof of [8, Proposition 7.1(5)].

Remark 5.5

As in Remarks 2.5 and 2.10, within a variety, the identities (5.1)–(5.4) are equivalent to the existence of certain terms. For example, identity (5.1) (resp., (5.3)) is equivalent to a weaker form of the alvin (Jónsson) condition in which the equations \(t_h(x,y,x)\approx x\) are assumed only for even (odd) h. In Section 7 we shall consider other sequences of terms for which some identities from (B) in Definition 2.1 are not assumed. See Definition 7.1.

For \(\ell >1\) the identities (5.3) and (5.4) do not imply congruence modularity, and for \(\ell >2\) the identities (5.1) and (5.2) do not imply congruence modularity. This can be shown using Polin variety. See [21, Remark 10.11].

6 Optimal bounds for varieties with directed terms

The assumption that n is even is not necessary in the following theorem. Recall that our counting conventions are different from [13], as far as directed Jónsson terms are concerned. Cf. Remark 2.4.

Theorem 6.1

  1. (i)

    For every \(n \ge 2,\) there is a locally finite n-directed-distributive variety which is not \(2n{-}1\)-reversed-modular,  hence,  by Remark 2.11, not \(2n{-}2\)-modular.

  2. (ii)

    Every n-directed-distributive variety is \(2n{-}1\)-modular. More generally,  every n-directed-distributive variety satisfies \(\alpha ( \beta \circ \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{2n-1}}} \circ \alpha \beta .\)

Proof

(i) We first consider the cases \(n=2\) and \(n=3.\)

A counterexample in the case \(n=2\) is given by the variety of distributive lattices. Indeed, a ternary majority term \(t_1\) provides a sequence \(t_0,t_1,t_2\) of directed Jónsson terms, where \(t_0 \) and \( t_2\) are projections. As we have remarked in the proof of Theorem 5.1, the variety of distributive lattices is not 3-reversed-modular.

To deal with the case \(n=3,\) consider Baker’s variety \({\mathcal {B}}^d\) recalled in Definition 4.10. As noted in [16, p. 11], Baker’s variety has a sequence \(d_0, d_1,d_2,d_3\) of directed Jónsson terms (including the two projections), that is, \({\mathcal {B}}^d\) is 3-directed-distributive in the present terminology. In fact, directed Jónsson terms for \({\mathcal {B}}^d\) are given by the two projections together with the terms \(t_1\) and \(t_2\) from Definition 4.4 in the case \(n=3.\) By Proposition 4.11, Baker’s variety is not 5-reversed-modular.

The rest of the proof of (i) proceeds by induction on n. Suppose that \(n \ge 4\) and that the theorem holds for \(n-2.\) By the inductive hypothesis, there is an \(n{-}2\)-directed-distributive variety \({\mathcal {W}}\) in which \(2n{-}5\)-reversed-modularity fails. By Remark 2.10, there is some algebra \({\textbf{D}} \in {\mathcal {W}}\) such that the congruence identity \(\alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{2n-5}}} \circ \alpha \gamma \) fails in \({\textbf{D}} ,\) a fortiori, \( {\alpha }( {\beta } \circ {\alpha } {\gamma } \circ {\beta } ) \subseteq {\alpha } {\beta } \circ {\alpha } {\gamma } \circ {{\mathop {\dots }\limits ^{2n-7}}} \circ {\alpha } {\beta } \) fails. Relabeling the operations as in the proof of Theorem 5.1, taking \(r= 2n-7\) in Theorem 4.5(i) and using Remark 4.7, we obtain an n-directed-distributive algebra in which \(2n{-}1\)-reversed-modularity fails.

(ii) The first statement is the special case \(n=k,\) \(\ell =3,\) \(T= \alpha \gamma \) in the last displayed identity in [16, Proposition 3.1]. The stronger statement is obtained by taking \(T= \gamma ,\) instead. Alternatively, (ii) can be proved in a way similar to Day’s Theorem (see the proofs of Lemma 5.2 and of Corollary 5.3(i)), using the terms

$$\begin{aligned} u_1 = t_1(x y w), \ \ \ u_2 =t_1(x z w), \ \ \ u_3= t_2(x y w), \ \ \ u_4 = t_2(x z w), \ \ \ u_5 =t_3(x y w), \dots \end{aligned}$$

\(\square \)

Theorem 6.2

  1. (i)

    If \(n \ge 2\) and n is even,  then there is a locally finite n-distributive not \(n{-}1\)-directed-distributive variety.

  2. (ii)

    For every \(n \ge 2,\) there is a locally finite n-directed-distributive variety which is not \(2n{-}2\)-alvin,  hence not \(2n{-}3\)-distributive.

  3. (iii)

    More generally,  for every \(n \ge 2,\) there is a locally finite n-directed-distributive variety in which the congruence identity \(\alpha ( \beta \circ \gamma ) \subseteq ( \alpha ( \gamma \circ \beta ))^{n-1}\) fails.

Proof

(i) By Theorem 5.1(i), for every even \(n \ge 2,\) there is a locally finite n-distributive variety \({\mathcal {V}}\) which is not \(2n{-}2\)-modular. By Theorem 6.1(ii) every \(n{-}1\)-directed-distributive variety is \(2n{-}3\)-modular, in particular, \(2n{-}2\)-modular. Thus \({\mathcal {V}}\) is not \(n{-}1\)-directed-distributive.

The first part in (ii) follows from (iii) and Remark 2.5, since \(\alpha \gamma \circ \alpha \beta \subseteq \alpha ( \gamma \circ \beta ).\) By Remark 2.6(b), if some variety \({\mathcal {V}}\) is not \(2n{-}2\)-alvin, then \({\mathcal {V}}\) is not \(2n{-}3\)-distributive. Hence it is enough to prove (iii).

(iii) The identity \(\alpha ( \beta \circ \gamma ) \subseteq \alpha ( \gamma \circ \beta )\) fails in the variety of distributive lattices, since otherwise, by taking \( \alpha =1\) (the largest congruence in the algebra under consideration), we would get congruence permutability; however, distributive lattices are not congruence permutable.

By Proposition 4.11, the identity \(\alpha ( \beta \circ \gamma ) \subseteq ( \alpha ( \gamma \circ \beta ))^{2}\) fails in the variety \({\mathcal {B}}^d.\) As recalled in the proof of Theorem 6.1, \({\mathcal {B}}^d\) is 3-directed-distributive and locally finite.

So far, we have proved the cases \(n=2\) and \(n=3\) of (iii). The rest of the proof is by induction on n. Suppose that \(n \ge 4\) and that (iii) is true for \(n-2,\) thus there exists some \(n{-}2\)-directed-distributive algebra in which \(\alpha ( \beta \circ \gamma ) \subseteq ( \alpha ( \gamma \circ \beta ))^{n-3}\) fails. As usual by now, relabeling the operations, then using Remark 4.7 and Theorem 4.8(ii) with \(\chi = ( \alpha ( \gamma \circ \beta ))^{n-3},\) we obtain an n-directed-distributive algebra in which the identity \( \alpha ( \beta \circ \gamma ) \subseteq ( \alpha ( \gamma \circ \beta ))^{n-1}\) fails. \(\square \)

Remark 6.3

(a) In [13, Observation 1.2] it is shown that, in the present terminology, every n-directed-distributive variety is \(2n{-}2\)-distributive. Recall from Remark 2.4 that our counting convention is slightly different in comparison with [13]. Theorem 6.2(ii) shows that the result from [13, Observation 1.2] is optimal.

(b) In the other direction, in [13] it is shown that every n-distributive variety is k(n)-directed-distributive, for some k(n). The k(n) obtained from the proof in [13] depends only on n,  not on the variety, but is quite large. On the other hand, the only inferior bound we know is given by Theorem 6.2(i), namely, \(k(n) \ge n,\) for n even. Concerning small values of n,  it is straightforward that a variety is 2-distributive if and only if it is 2-directed-distributive. A direct proof that every 3-distributive variety is 3-directed-distributive appears in [17, p. 10]. In the next proposition we prove the corresponding result for \(n=4.\) It is likely that these results follow already from the arguments in [13].

Notice that, on the other hand, by Theorem 6.2(ii), there is a 3-directed-distributive not 3-distributive variety and there is a 4-directed-distributive not 5-distributive variety.

Proposition 6.4

Every 4-distributive variety is 4-directed-distributive.

Proof

From terms \(t_0,\ldots , t_4\) satisfying Jónsson’s equations we obtain directed Jónsson terms \(s_0,\ldots , s_4\) as follows:

$$\begin{aligned} s_1(x,y,z)&= t_1(t_1(x,y,z),t_3(x,x,y),t_3(x,x,z)),\\ s_2(x,y,z)&= t_2(t_2(x,z,z),t_2(x,y,z),t_2(x,x,z)),\\ s_3(x,y,z)&= t_3(t_1(x,z,z),t_1(y,z,z),t_3(x,y,z)), \end{aligned}$$

taking, of course, \(s_0\) and \(s_4\) to be the suitable projections. \(\square \)

Hence, so far, we cannot exclude the possibility that, for every n,  every n-distributive variety is n-directed-distributive. Were this true, it would be a quite astonishing result.

7 Gumm, directed Gumm and defective alvin terms

We now discuss Gumm terms and some variants. Though we do not need the result, we mention that all the variations of Gumm terms considered in the present section are equivalent to congruence modularity. See Theorem 7.7.

Definition 7.1

(a) Gumm terms [9, 10] are defined like alvin terms, except that the condition \(x\approx t_1(x,y,x)\) from (B) is not assumed. More formally, for \(\ell \le n,\) it is convenient to consider the following reduced set (B\(^{\widehat{\ell }}\)) of equations:

figure d

In the above situation we will say that the sequence of terms \(t_0,\ldots , t_n\) is defective at place \(\ell .\) A more general study of “defective” (in the above sense) conditions appears in Kazda and Valeriote [14]. Defective conditions in the present terminology correspond to dashed lines in paths in the terminology from [14]. See the comment shortly after Definition 7.5.

Under the above notation, a sequence of Gumm terms is a sequence satisfying (B\(^{\widehat{1}}),\) as well as (A) from Definition 2.1.

With the above definition, if \(t_0, t_1, t_2\) is a sequence of Gumm terms, then \(t_1\) is a Maltsev term for permutability. Recall that we are not exactly assuming Jónsson Condition (J), but the alvin variant (A) in which the equational conditions for even and odd indices are exchanged.

(b) If n is even and in the definition of Gumm terms we discard also the equation \(x\approx t_{n-1}(x, y, x)\) we get a sequence of doubly defective alvin terms, or defective Gumm terms [6, 20]. More formally, and with the obvious extension of the above convention, a sequence of defective Gumm terms is a sequence satisfying (B\(^{\widehat{1}, \widehat{n-1}})\) and (A). The assumption that n is even is necessary; if n is odd we get a condition holding in every algebra. See Remark 7.3(b).

(c) As in Definition 2.3, a variety or an algebra is said to be n-Gumm (defective n-Gumm) if it has a sequence \(t_0,\ldots , t_n\) of Gumm (defective Gumm) terms.

Remark 7.2

Conventions about Gumm terms are not uniform in the literature. Many authors, including Gumm himself, define Gumm terms in a slightly different fashion, by discarding the equation \(x\approx t_{n-1}(x, y, x),\) instead. The definition we have adopted has the advantage of providing a finer way of counting the number of terms: compare [16, p. 12]. To the best of our knowledge, this formulation of the Gumm condition is due to [15, 25]. We refer to [20, Remark 4.2] for a more complete discussion.

Remark 7.3

(a) As in Remark 2.5, within a variety, each condition on the left in the following table is equivalent to the condition on the right.

$$\begin{aligned} \begin{array}{cl} n\text {-Gumm} &{} \alpha ( \beta { \hspace{1pt} \circ \hspace{1pt} } \gamma ) \subseteq \alpha (\gamma { \hspace{1pt} \circ \hspace{1pt} } \beta ) { \hspace{1pt} \circ \hspace{1pt} } (\alpha \gamma { \hspace{1pt} \circ \hspace{1pt} } \alpha \beta { \hspace{1pt} \circ \hspace{1pt} } {{\mathop {\dots }\limits ^{n-2}}} ) \\ \text {defective }n\text {-Gumm} &{} \alpha ( \beta { \hspace{1pt} \circ \hspace{1pt} } \gamma ) \subseteq \alpha (\gamma { \hspace{1pt} \circ \hspace{1pt} } \beta ) { \hspace{1pt} \circ \hspace{1pt} } (\alpha \gamma { \hspace{1pt} \circ \hspace{1pt} } \alpha \beta { \hspace{1pt} \circ \hspace{1pt} } {{\mathop {\dots }\limits ^{n-4}}} { \hspace{1pt} \circ \hspace{1pt} } \alpha \beta ) \circ \alpha ( \gamma { \hspace{1pt} \circ \hspace{1pt} } \beta ), \end{array} \end{aligned}$$

where in the first line we are assuming \(n \ge 2\) and in the second line we are assuming n even and \(n \ge 4.\)

(b) As another example of applications of congruence identities, one sees immediately, arguing as in (a), that if n is odd and \(n > 1,\) then being defective n-Gumm is a trivial condition holding in every algebra. Indeed, the condition is equivalent to the trivially true identities \(\alpha ( \beta \circ \gamma ) \subseteq \alpha ( \gamma \circ \beta \circ \gamma ),\) for \(n=3,\) and \(\alpha ( \beta \circ \gamma ) \subseteq \alpha (\gamma \circ \beta ) \circ (\alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{n-4}}} \circ \alpha \gamma ) \circ \alpha ( \beta \circ \gamma ) ,\) for larger n’s. It requires a bit of ingenuity to see that the conditions are trivial, when expressed in function of terms. Take \(t_{n-1}\) to be the projection onto the second coordinate and all the terms before \(t_{n-1}\) as the projection onto the first coordinate. Recall that here n is odd and that we are considering a “defective” alvin condition, namely, we are assuming (A) from Definition 2.1, rather than (J).

See [13, p. 205] and [14, Subsection 3.3.1] for related remarks.

Corollary 7.4

  1. (i)

    If \(n \ge 4\) and n is even,  then all n-Gumm varieties and all defective n-Gumm varieties are \(2n{-}3\)-reversed-modular,  in particular,  \(2n{-}2\)-modular.

  2. (ii)

    The result is optimal :  for every even \(n \ge 2\) there is a defective n-Gumm locally finite variety,  in particular,  n-Gumm,  which is not \(2n{-}3\)-modular.

Proof

An n-Gumm variety is, in particular, defective n-Gumm. For n even, the proof of Lemma 5.2(a) shows that a defective n-Gumm variety is \(2n{-}3\)-reversed-modular, since the equations \(x\approx t_1(x,y,x)\) and \(t_{n-1}(x,y,x) \approx x\) have not been used in the proof.

To prove (ii), recall that in Theorem 5.1(ii) an n-alvin not \(2n{-}3\)-modular variety \({\mathcal {V}}\) has been constructed. In particular, \({\mathcal {V}}\) is a defective n-Gumm variety.

\(\square \)

We now discuss some “directed” versions of Gumm terms.

Definition 7.5

(a) [13] If \(n\ge 2,\) a sequence \(t_0, t_1,\ldots , t_{n-2}, q\) of ternary terms is a sequence of directed Gumm terms if the following equations are satisfied:

$$\begin{aligned} x&\approx t_h(x,y,x),{} & {} \text {for }0 \le h \le n-2, \end{aligned}$$
(DG0)
$$\begin{aligned} x&\approx t_0(x,y,z), \end{aligned}$$
(DG1)
$$\begin{aligned} t_h(x,z,z)&\approx t_{h+1}(x,x,z),{} & {} \text {for }0 \le h < n-2, \end{aligned}$$
(DG2)
$$\begin{aligned} t_{n-2}(x,z,z)&\approx q(x,z,z),{} & {} q(x,x,z)\approx z. \end{aligned}$$
(DG3)

Note that if \(n=2\) in the above definition, then q is a Maltsev term for permutability. Thus, for \(n=2,\) the existence of directed Gumm terms is equivalent to the existence of Gumm terms (and equivalent to congruence permutability). Note the parallel situation with respect to Jónsson terms and directed Jónsson terms, which give equivalent conditions in the case \(n=2,\) as we mentioned in Definition 2.1.

(b) If \(n\ge 4,\) a sequence \(p, t_2,\ldots , t_{n-2}, q\) of ternary terms is a sequence of two-headed directed Gumm terms if the following equations are satisfied:

$$\begin{aligned} x&\approx t_h(x,y,x),{} & {} \text {for }2 \le h \le n-2, \end{aligned}$$
(THG0)
$$\begin{aligned} x&\approx p(x,z,z),{} & {} p(x,x,z)\approx t_2(x,x,z), \end{aligned}$$
(THG1)
$$\begin{aligned} \quad t_h(x,z,z)&\approx t_{h+1}(x,x,z),{} & {} \text {for }2 \le h < n-2, \end{aligned}$$
(THG2)
$$\begin{aligned} t_{n-2}(x,z,z)&\approx q(x,z,z),{} & {} q(x,x,z)\approx z. \end{aligned}$$
(THG3)

(c) If in (b) above we also require that the terms p and q satisfy the equations \(x\approx p(x,y,x) \) and \(x\approx q(x,y,x) \) we get a sequence of directed terms with two alvin heads. If an algebra or a variety has a sequence of such terms, we say that it is n-directed with alvin heads. Of course, in the situation described here in (c), the terms p and q can be safely relabeled as \(t_1\) and \(t_{n-1}.\)

Note that being 4-directed with alvin heads is the same as being 4-alvin.

In the formalism from [14], two-headed directed Gumm terms correspond to a pattern path with forward solid edges everywhere, except for two dashed backwards edges on the outer ends. The case of directed terms with alvin heads is similar, but in this case all the edges are solid.

Theorem 7.6

Suppose that \(n \ge 4.\)

  1. (i)

    If some variety \({\mathcal {V}}\) has two-headed directed Gumm terms \(p, t_2,\ldots , t_{n-2}, q,\) then \({\mathcal {V}}\) is \(2n{-}3\)-reversed-modular,  hence \(2n{-}2\)-modular. In particular,  this applies to any variety which is n-directed with alvin heads.

  2. (ii)

    There is a locally finite variety \({\mathcal {V}}\) which has two-headed directed Gumm terms \(p, t_2,\ldots , t_{n-2}, q,\) but is not \(2n{-}3\)-modular,  hence (i) is the best possible result. A variety \({\mathcal {V}}\) as above can be chosen to be n-directed with alvin heads.

Proof

The proof of (i) is obtained by merging the arguments in the proofs of Lemma 5.2 and of Theorem 6.1(ii), namely, defining the terms \(u_1\) and \(u_{2n{-}4}\) as in the proof of Lemma 5.2 and the remaining terms as in the proof of Theorem 6.1(ii) In detail, define

$$\begin{aligned} u_1=p(x,y,z), \quad u_2=t_2(x,y,w), \quad u_3=t_2(x,z,w), \quad u_4=t_3(x,y,w), \ \ldots \end{aligned}$$

and symmetrically for \(\ldots ,u_{2n{-}5}, u_{2n{-}4}.\)

(ii) By Theorem 6.1(i), there is an \(n{-}2\)-directed-distributive variety \({\mathcal {W}}\) which is not \(2n{-}5\)-reversed-modular. By Remark 2.10, there is some algebra \({\textbf{D}} \in {\mathcal {W}}\) such that the congruence identity \( \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \gamma \circ \alpha \beta \circ {{\mathop {\dots }\limits ^{2n-5}}} \circ \alpha \gamma \) fails in \({\textbf{D}}.\) As in the proof of Theorem 5.1, assume that \({\textbf{D}}\) has only the directed Jónsson operations and define an algebra \({\textbf{A}}_4\) by relabeling the operations of \({\textbf{D}}.\) The proof of Theorem 4.13(i) provides an algebra \({\textbf{B}}\) belonging to a variety \({\mathcal {V}}\) with two-headed directed Gumm terms \(p, t_2,\ldots , t_{n-2}, q,\) by the analogue of Remark 4.7. Actually, the equations \(x\approx p(x,y,x) \) and \(x\approx q(x,y,x) \) hold in \({\mathcal {V}},\) hence we get a variety which is n-directed with alvin heads. By Theorem 4.13(i), the identity \( \alpha ( \beta \circ \alpha \gamma \circ \beta ) \subseteq \alpha \beta \circ \alpha \gamma \circ {{\mathop {\dots }\limits ^{2n-3}}} \circ \alpha \beta \) fails in \({\textbf{B}},\) thus \({\mathcal {V}}\) is not \(2n{-}3\)-modular. \(\square \)

As promised, we now check that all the conditions considered in the present section are equivalent to congruence modularity.

Theorem 7.7

[6, 9, 10, 13]. For every variety \({\mathcal {V}},\) the following conditions are equivalent.

  1. (i)

    \({\mathcal {V}}\) is congruence modular.

  2. (ii)

    \({\mathcal {V}}\) has a sequence of Gumm terms.

  3. (iii)

    \({\mathcal {V}}\) has a sequence \(t_1,\ldots , t_n\) of defective Gumm terms,  for some even n.

  4. (iv)

    \({\mathcal {V}}\) has a sequence of directed Gumm terms.

  5. (v)

    \({\mathcal {V}}\) has a sequence of two-headed directed Gumm terms.

Proof

The equivalence of (i) and (ii) is due to Gumm [9, 10]. The equivalence of (i) and (iii) appears in [6, Theorem 3.12]. In any case, (ii) \(\Rightarrow \) (iii) is obvious, and we mentioned in Corollary 7.4(a) that (iii) implies congruence modularity (the case \(n=2\) is obvious). The equivalence of (ii) and (iv) is proved in [13]. By adding one more term, a projection, as \(s_0,\) and taking \(s_{i+1}=t_i,\) it is obvious that (iv) implies (v). Compare the proof of Theorem 2.8. If \(n=2\) in Definition 7.5(a), just add the projection two times. It follows from Theorem 7.6(i) that (v) implies congruence modularity. \(\square \)

8 Further remarks

Remark 8.1

The constructions in the previous sections suggest the following definitions. An algebra or a variety is specular n-distributive (specular n-alvin, specular n-directed-distributive) if it has a sequence \(t_0,\ldots , t_n\) of terms satisfying the Jónsson (alvin, directed Jónsson) equations from Definition 2.1, as well as

$$\begin{aligned} t_{n-i}(z,y,x) \approx t_i(x,y,z), \quad \text {for }0 \le i \le \frac{n}{2}, \end{aligned}$$
(S)

equivalently, for all indices i with \(0 \le i \le n .\)

It is easy to see that in all the preceding arguments and in each case the algebras and the varieties we have constructed have terms (or can be chosen to have terms) \(t_0,\ldots , t_n\) which satisfy the equations (S). Indeed, all the algebras in the base steps have specular terms and the constructions proceed in a specular way, hence all the outcomes turn out to be specular. Hence, in the case when the index n is even, for every form of distributivity under consideration, and for arbitrary n in the case of directed distributivity, our results turn out to be essentially the same if we impose the above condition of specularity.

In a parallel situation, Chicco [3] has studied specular conditions connected with n-permutability, again showing that the examples of specular varieties abound in that context, too. The above comments suggest that it is interesting to study Maltsev conditions given by terms satisfying partial forms of symmetry.

Problem 8.2

Is there some useful analogue of Construction 4.2 which deals with 4-ary terms?

Problem 8.3

Let the Day-to-Gumm function DG be defined by setting DG(r) to be the smallest n such that every r-modular variety is n-Gumm. In the present terminology, Lakser, Taylor and Tschantz [15] proved that DG(r)\(\le r^2{-}r{+}1.\) They asked the problem whether the result is optimal. In some special cases, for example when r is odd, the value can be slightly improved, but we know no significant improvement.

It can be checked [21] that, for every even \(n \ge 2,\) there is a variety \({\mathcal {V}}_n^c\) which can be taken as a simultaneous counterexample in the proofs of Theorems 6.1(i) and 6.2(ii). Thus \({\mathcal {V}}_n^c\) is n-directed-distributive, hence \(2n{-}1\)-modular. On the other hand, \({\mathcal {V}}_n^c\) is congruence distributive and not \(2n{-}2\)-alvin, hence not \(2n{-}2\)-Gumm, by [18, Theorem 4]. Thus, for \(r \ge 3,\) r odd, DG(r)\(\ge r.\) This provides a lower bound for DG(r), but a large gap remains between the lower bound r and the upper bound \(r^2{-}r{+}1.\)

It seems that Lakser, Taylor and Tschantz’ problem is the most important problem left open by the present work.