1 Introduction and preliminaries

Throughout this paper, we use the following notation. The symbol \(A\) stands for an arbitrary nonempty set. The set \(\{1, \ldots , n\}\) of the first \(n\) positive integers is denoted by \([{n}]\). Tuples are denoted by bold-face letters and their components by corresponding italic letters with subscripts; for example, \(\mathbf {a} = (a_1, \ldots , a_n) \in A^n\). If \(\mathbf {a} = (a_1, \ldots , a_n) \in A^n\) and \(\sigma \) is a permutation of \([{n}]\), then we write \(\mathbf {a} \sigma \) for the \(n\)-tuple \((a_{\sigma (1)}, \ldots , a_{\sigma (n)})\).

An operation on \(A\) is a map \(f :A^n \rightarrow A\), where \(n\) is a nonnegative integer, called the arity of \(f\). Two operations \(f :A^n \rightarrow A\) and \(g :A^m \rightarrow A\) commute, denoted \(f \perp g\), if

$$\begin{aligned}&g(f(a_{11}, \ldots , a_{1n}), \ldots , f(a_{m1}, \ldots , a_{mn}))\nonumber \\&\quad = f(g(a_{11}, \ldots , a_{m1}), \ldots , g(a_{1n}, \ldots , a_{mn})), \end{aligned}$$
(1.1)

for all \(a_{11}, \ldots , a_{mn} \in A\). An operation that commutes with itself is self-commuting. Clearly, every unary operation is self-commuting. An algebra \(\mathbf {A} = (A; F)\) is entropic if every pair of its fundamental operations commutes (in particular, each fundamental operation is self-commuting). Note that a groupoid \((A;\cdot )\) is entropic if it satisfies the identity

$$\begin{aligned} (xy)\cdot (zu)\approx (xz)\cdot (yu). \end{aligned}$$

According to Saminger-Platz et al. [15], “Commuting is an important property in any two-step information merging procedure, where the results should not depend on the order in which the single steps are performed.” The entropic property is widely present, for example, in aggregation theory or in decision-making problems.

The property of entropicity was first investigated as a generalization of the associative law for quasigroups (see Murdoch [11]). The first results concerning entropic semigroups go back to Tamura [16].

The notion of entropicity appears in literature under different names, among others: mediality, bi-commutativity, bisymmetry, abelianness, commutativity, and alternation.

We say that an algebra \((A; F)\) has the endomorphism closure property if for any \(f\in F\) and all endomorphisms \(\varphi _1, \ldots , \varphi _n \in {\text {End}}(A)\), the induced mapping \(f(\varphi _1,\ldots ,\varphi _n)\) is again an endomorphism. It is well known that there is an equivalence between the endomorphism closure property and the entropic law (see Evans [3, 4] and Klukovits [7]).

A weaker version of the entropic law is the so-called generalized entropic property. An algebra \(\mathbf {A} = (A; F)\) has the generalized entropic property if, for every \(n\)-ary \(f \in F\) and every \(m\)-ary \(g \in F\), there exist \(m\)-ary terms \(t_1, \ldots , t_n\) of \(\mathbf {A}\) such that \(\mathbf {A}\) satisfies the identity

$$\begin{aligned}&g(f(x_{11}, \ldots , x_{n1}), \ldots , f(x_{1m}, \ldots , x_{nm}))\nonumber \\&\quad \approx f(t_1(x_{11}, \ldots , x_{1m}), \ldots , t_n(x_{n1}, \ldots , x_{nm})). \end{aligned}$$
(1.2)

In particular, a groupoid \(\mathbf {A} = (A; \cdot )\) has the generalized entropic property if there are two binary terms \(t_1\) and \(t_2\) such that \(\mathbf {A}\) satisfies the identity

$$\begin{aligned} (xy) \cdot (zu) \approx t_1(x,z) \cdot t_2(y,u). \end{aligned}$$
(1.3)

The generalized entropic property is a special case of the rectangular generalized bisymmetry, which plays a key role in consistent aggregation and microeconomic models. Note also that the generalized entropic property is a natural generalization of the notion of normal subgroups in a group.

We say that an algebra \((A; F)\) has the subalgebra closure property if for any \(f\in F\) and all non-empty subalgebras \(A_1,\ldots ,A_n\in Sub(A)\), the complex product \(f(A_1,\ldots ,A_n)\) is also a subalgebra of \((A;F)\).

The equivalence of the generalized entropic property and the subalgebra closure property for a variety of groupoids was proved by Evans [3]. Adaricheva, Pilitowska and Stanovský [1] extended this result by showing that this equivalence actually holds for an arbitrary variety of algebras.

The classical property of associativity of binary operations can be generalized to operations of arbitrary arities as follows. An operation \(f :A^n \rightarrow A\) is associative if

$$\begin{aligned}&f(f(a_1, \ldots , a_n), a_{n+1}, \ldots , a_{2n-1})\\&=\cdots =f(a_1, \ldots , a_r, f(a_{r+1}, \ldots , a_{r+n}), a_{r+n+1}, \ldots , a_{2n-1})\\&= \cdots = f(a_1, \ldots , a_{n-1}, f(a_n, \ldots , a_{2n-1})), \end{aligned}$$

for all \(a_1, \ldots , a_{2n-1} \in A\). An algebra \((A; f)\) with one \(n\)-ary associative operation \(f\) is called an n-semigroup.

An \((n - 1)\)-tuple \((e_1, \ldots , e_{n-1}) \in A^{n-1}\) is neutral for an operation \(f :A^n \rightarrow A\), if

$$\begin{aligned}&f(a, e_{\sigma (1)}, \ldots , e_{\sigma (n-1)}) = \cdots = f(e_{\sigma (1)}, \ldots , e_{\sigma (r)}, a, e_{\sigma (r+1)}, \ldots , e_{\sigma (n-1)}) \\&= \cdots = f(e_{\sigma (1)}, \ldots , e_{\sigma (n-1)}, a) = a \end{aligned}$$

for every \(a \!\in \! A\) and any permutation \(\sigma \!\in \! S_{n-1}\). An element \(e\) is neutral for \(f :A^n \rightarrow A\) if the \((n - 1)\)-tuple \((e, \ldots , e)\) is neutral for \(f\).

An \(n\)-semigroup \((A;f)\) is called an n-group, if for every \(i \in [{n}]\) and for all \(a_1, \ldots , a_{i-1}, a_{i+1}, \ldots , a_n, c \in A\), there exists a unique \(b \in A\) such that \(f(a_1, \ldots , a_{i-1}, b, a_{i+1}, \ldots , a_n) = c\). A group is a \(2\)-group in this sense. We will refer to \(n\)-semigroups with a neutral element as n-monoids, and to \(n\)-semigroups with a neutral \((n - 1)\)-tuple as generalized n-monoids. A monoid is a \(2\)-monoid and a generalized \(2\)-monoid in this sense.

Let \(i, j \in [{n}]\) with \(i < j\). An operation \(f :A^n \rightarrow A\) is (i,j)-commutative if

$$\begin{aligned} f(a_1, \ldots , a_i, \ldots , a_j, \!\ldots , a_n) {=} f(a_1, \ldots , a_{i-1}, a_j, a_{i\!+\!1}, \ldots , a_{j-1}, a_i, a_{j+1}, \ldots , a_n\!) \end{aligned}$$

for all \(a_1, \ldots , a_n \in A\). A \((1,n)\)-commutative operation is called semiabelian. An operation \(f\) is totally symmetric (commutative), if for all permutations \(\sigma \) of \([{n}]\), we have \(f(\mathbf {a}) = f(\mathbf {a} \sigma )\) for all \(\mathbf {a} \in A^n\).

It is clear that a binary associative and commutative operation is self-commuting. This observation is also true for a more general case. Dörnte [2] (see also [5]) proved that any \(n\)-ary semiabelian and associative operation is self-commuting. (Dörnte stated this result for \(n\)-groups, but his proof works for \(n\)-semigroups.)

Theorem 1.1

([2]) A semiabelian \(n\)-semigroup is entropic.

But, of course, the converse is not true. Not every entropic \(n\)-semigroup is semiabelian. For example, an entropic semigroup need not be commutative. On the other hand, in \(n\)-semigroups with a neutral element, entropy (or, equivalently, generalized entropy) is equivalent to commutativity.

Moreover, Głazek and Gleichgewicht provided the following characterization of entropic \(n\)-groups.

Theorem 1.2

([5]) An \(n\)-group is semiabelian if and only if it is entropic.

As a consequence of results in [8], an analogue of the above is also true for \(n\)-monoids.

Corollary 1.3

An \(n\)-monoid is semiabelian if and only if it is entropic.

In fact we have even more.

Theorem 1.4

([8]) Let \((A;f)\) be an algebra with one \(n\)-ary operation that has a neutral \((n - 1)\)-tuple. Then \((A;f)\) is entropic (or equivalently has the generalized entropic property) if and only if it is a semiabelian generalized \(n\)-monoid.

These results give rise to an interesting problem: find necessary and sufficient conditions for an \(n\)-semigroup to be entropic (or to have the generalized entropic property). Are entropicity and the generalized entropic property equivalent for \(n\)-semigroups or for some classes of \(n\)-semigroups? While a definitive solution to this problem eludes us, this paper aims to shed some light on entropicity and the generalized entropic property in idempotent \(n\)-semigroups.

This paper is organised as follows. First, in Sect. 2, we provide an example of an \(n\)-semigroup that has the generalized entropic property but is not entropic, which shows that these two properties are not equivalent for \(n\)-semigroups in general. Then we analyse various classes of idempotent \(n\)-semigroups. In each case, entropicity and the generalized entropic property prove to be equivalent. These results support the conjecture stated in [1] that every idempotent algebra \((A; f)\) (with only one at least binary operation \(f\)) with the generalized entropic property is entropic. We start with Mal’cev \(n\)-semigroups in Sect. 3. The particular case of ternary Mal’cev semigroups is studied more carefully in Sect. 4, in which we provide a simple presentation of the free ternary Mal’cev semigroup on two generators and show that this free algebra is entropic and hence has the generalized entropic property. In Sect. 5, we discuss idempotent \(n\)-semigroups satisfying the identities \(f(x, \ldots , x, y) \approx f(y, x, \ldots , x) \approx f(x, y, x, \ldots , x)\) or \(f(x, \ldots , x, y) \approx f(y, x, \ldots , x) \approx f(x, \ldots , x, y, x)\) (these include associative weak near-unanimity operations), as well as associative \(k\)-edge operations. We conclude this paper with an analysis of idempotent \(n\)-semigroups derived from binary semigroups and semigroups satisfying the identity \(x \approx x^n\) for some \(n \ge 3\) (Sect. 6).

2 Nonequivalence of entropicity and generalized entropic property in \(n\)-semigroups

As we will see in Proposition 2.3, the generalized entropic property and entropicity are not equivalent in \(n\)-semigroups in general. But in some cases they are. For example, it was shown in [1] that if an idempotent semigroup (a band) has the generalized entropic property, then it is entropic.

For a positive integer \(n\), the transposition permutation (of order n) is the map \(\varepsilon _n :[{n}] \times [{n}] \rightarrow [{n}] \times [{n}]\), \((i,j) \mapsto (j,i)\). A permutation \(\sigma \) of \([{n}] \times [{n}]\) is called a shuffle-transposition if for each \((i,j) \in [{n}] \times [{n}]\), there exists \(k \in [{n}]\) such that \(\sigma (i,j) = (k,i)\). Transposition permutations are obviously shuffle-transpositions.

The map \(\beta :[{n}] \times [{n}] \rightarrow [{n^2}]\), \((i,j) \mapsto (i-1)n + j\), is a bijection. We will identify a permutation \(\sigma \) of \([{n}] \times [{n}]\) with the permutation \(\beta \circ \sigma \circ \beta ^{-1}\) of \([{n^2}]\). In particular, we call \(\beta \circ \varepsilon _n \circ \beta ^{-1}\) a transposition permutation, and we say that a permutation \(\sigma \) of \([{n^2}]\) is a shuffle-transposition if \(\beta ^{-1} \circ \sigma \circ \beta \) is a shuffle-transposition.

An operation \(f :A^n \rightarrow A\) is invariant under a permutation \(\sigma \) of \([{n}]\), if \(f(\mathbf {a}) = f(\mathbf {a} \sigma )\) for all \(\mathbf {a} \in A^n\).

Lemma 2.1

Let \(f :A^n \rightarrow A\). If the operation \(f' :A^{n^2} \rightarrow A\) given by

$$\begin{aligned} f'(a_1, \ldots , a_{n^2}) = f(f(a_1, \ldots , a_n), f(a_{n+1}, \ldots , a_{2n}), \ldots , f(a_{(n-1)n + 1}, \ldots , a_{n^2})) \end{aligned}$$

is invariant under a shuffle-transposition of \([{n^2}]\), then the algebra \((A;f)\) has the generalized entropic property.

Proof

Let \(\sigma \) be a shuffle-transposition of \([{n^2}]\) under which \(f'\) is invariant, and let \(\sigma ' = \beta ^{-1} \circ \sigma \circ \beta \). Then we have

$$\begin{aligned}&f(f(a_{11}, \ldots , a_{1n}), \ldots , f(a_{n1}, \ldots , a_{nn})) \\&\quad =f(f(a_{\sigma '(11)}, \ldots , a_{\sigma '(1n)}), \ldots , f(a_{\sigma '(n1)}, \ldots , a_{\sigma '(nn)})). \end{aligned}$$

Since \(\sigma '\) is a shuffle-transposition, we have that for each \(i \in [{n}]\),

$$\begin{aligned} f(a_{\sigma '(i1)}, \ldots , a_{\sigma '(in)}) = \tau _i(a_{1i}, \ldots , a_{ni}), \end{aligned}$$

where \(\tau _i\) is a suitably chosen term operation of \((A;f)\) (namely \(f\) with permuted variables). Hence,

$$\begin{aligned}&f(f(a_{11}, \ldots , a_{1n}), \ldots , f(a_{n1}, \ldots , a_{nn})) \\&\quad =f(\tau _1(a_{11}, \ldots , a_{n1}), \ldots , \tau _n(a_{1n}, \ldots , a_{nn})), \end{aligned}$$

and we conclude that \((A;f)\) has the generalized entropic property. \(\square \)

Lemma 2.2

For every \(n \ge 2\), there exists a shuffle-transposition \(\sigma \) of \([{n}] \times [{n}]\) such that the transposition permutation \(\varepsilon _n\) is not generated by \(\sigma \).

Proof

Let \(m\) be a natural number and let us denote by \(m \hbox { mod }n\) the unique element \(\ell \) of \([{n}]\) such that \(m \equiv \ell \pmod {n}\). Define \(\sigma :[{n}] \times [{n}] \rightarrow [{n}] \times [{n}]\) as \((i,j) \mapsto ((i + j) \hbox { mod }n,i)\). It is clear from the definition that \(\sigma \) is a shuffle-transposition.

We denote by \(F_k\) the numbers in the Fibonacci sequence: \(F_0 = 0\), \(F_1 = 1\), and \(F_k = F_{k-1} + F_{k-2}\) for every \(k \ge 2\). We claim that

$$\begin{aligned} \sigma ^k(i,j) = ((F_{k+1} i + F_k j) \hbox { mod }n, (F_k i + F_{k-1} j) \hbox { mod }n) \end{aligned}$$
(2.1)

for every \(k \ge 1\). We proceed by induction on \(k\). For \(k = 1\), equation (2.1) yields \(\sigma (i,j) = ((i + j) \hbox { mod }n, i \hbox { mod }n)\), which is true by the definition of \(\sigma \). Assume then that (2.1) holds for \(k = \ell \) for \(\ell \ge 1\). Then we have

$$\begin{aligned}&\sigma ^{\ell +1}(i,j) = \sigma (\sigma ^\ell (i,j)) = \sigma ((F_{\ell +1} i + F_\ell j) \hbox { mod }n, (F_\ell i + F_{\ell -1} j) \hbox { mod }n) \\&\!\! \quad =(((F_{\ell +1} i \!+\! F_\ell j) \hbox { mod }n \!+ (F_\ell i \!+ F_{\ell -1} j) \hbox { mod }n)(\hbox {mod } n), (F_{\ell +1} i \!+ F_\ell j) \hbox { mod }n) \\&\!\! \quad =(((F_{\ell +1} + F_{\ell }) i + (F_\ell + F_{\ell -1}) j) \hbox { mod }n, (F_{\ell +1} i + F_\ell j) \hbox { mod }n) \\&\!\! \quad = ((F_{\ell +2} i + F_{\ell +1} j) \hbox { mod }n, (F_{\ell +1} i + F_\ell j) \hbox { mod }n), \end{aligned}$$

as claimed.

We want to show that \(\sigma \) does not generate \(\varepsilon _n\), that is, \(\sigma ^k \ne \varepsilon _n\) for all \(k \ge 1\). Suppose, on the contrary, that there exists \(k \ge 1\) such that \(\sigma ^k = \varepsilon _n\). Then the congruences \(F_{k+1} i + F_k j \equiv j \pmod {n}\) and \(F_k i + F_{k-1} j \equiv i \pmod {n}\) hold identically for all \(i, j \in [{n}]\). Thus, we must have \(F_{k+1} \equiv 0 \pmod {n}\), \(F_k \equiv 1 \pmod {n}\), and \(F_{k-1} \equiv 0 \pmod {n}\). It follows that \(0 \equiv F_{k+1} = F_k + F_{k-1} \equiv 1 + 0 = 1 \pmod {n}\), a contradiction. \(\square \)

Proposition 2.3

For every integer \(n \ge 2\), there exists an \(n\)-semigroup that has the generalized entropic property but is not entropic.

Proof

Let \(n \ge 2\), denote by \([{n^2}]^*\) the free monoid over the alphabet \([{n^2}]\) and for \(w \in [{n^2}]^*\), denote by \(|{w}|\) the length of \(w\). Let \(W = \{w \in [{n^2}]^* : 1 \le |{w}| < n^2\}\), and let \(A = W \cup \{\top , \bot \}\). Let \(\mathbf {c} = (1, 2, \ldots , n^2)\), and let \(\sigma \) be a shuffle-transposition of \([{n^2}]\) that does not generate the transposition permutation \(\varepsilon _n\) (such a permutation \(\sigma \) exists by Lemma 2.2). Define the operation \(f :A^n \rightarrow A\) as follows:

$$\begin{aligned} f(w_1, \ldots , w_n) = {\left\{ \begin{array}{ll} w_1 \cdots w_n, &{} \text { if } w_1, \ldots , w_n \in W \,\text {and}\,|{w_1 \cdots w_n}| < n^2, \\ \top , &{} \text { if } w_1, \ldots , w_n \in W, |{w_1 \cdots w_n}| = n^2, \text { and} \\ &{} w_1 \cdots w_n = \mathbf {c} \sigma ^k \text { for some } k \in \mathbb {N}, \\ \bot , &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$

Let us verify first that \(f\) is associative. Let \(w_1, \ldots , w_{2n-1} \in A\). If \(w_1, \ldots , w_{2n-1} \in W\) and \(|{w_1 \cdots w_{2n-1}}| < n^2\), then for any \(i \in [{n}]\),

$$\begin{aligned}&f(w_1, \ldots , w_{i-1}, f(w_{i}, \ldots , w_{i+n-1}), w_{i+n}, \ldots , w_{2n-1}) \\&\quad =f(w_1, \ldots , w_{i-1}, w_i \cdots w_{i+n-1}, w_{i+n}, \ldots , w_{2n-1}) = w_1 \cdots w_{2n-1}. \end{aligned}$$

If \(w_1, \ldots , w_{2n-1} \in W\), \(|{w_1 \cdots w_{2n-1}}| = n^2\), and \(w_1 \cdots w_{2n-1} = \mathbf {c} \sigma ^k\) for some \(k \in \mathbb {N}\), then for any \(i \in [{n}]\),

$$\begin{aligned}&f(w_1, \ldots , w_{i-1}, f(w_{i}, \ldots , w_{i+n-1}), w_{i+n}, \ldots , w_{2n-1})\\&\quad =f(w_1, \ldots , w_{i-1}, w_i \cdots w_{i+n-1}, w_{i+n}, \ldots , w_{2n-1}) = \top . \end{aligned}$$

If \(w_1, \ldots , w_{2n-1} \in W\), \(|{w_1 \cdots w_{2n-1}}| = n^2\), and \(w_1 \cdots w_{2n-1} \ne \mathbf {c} \sigma ^k\) for all \(k \in \mathbb {N}\), then for any \(i \in [{n}]\),

$$\begin{aligned}&f(w_1, \ldots , w_{i-1}, f(w_{i}, \ldots , w_{i+n-1}), w_{i+n}, \ldots , w_{2n-1}) \\&\quad =f(w_1, \ldots , w_{i-1}, w_i \cdots w_{i+n-1}, w_{i+n}, \ldots , w_{2n-1}) = \bot . \end{aligned}$$

Otherwise we have that either \(w_1, \ldots , w_{2n-1} \in W\) and \(|{w_1 \cdots w_{2n-1}}| > n^2\), or \(w_\ell \in \{\top , \bot \}\) for some \(\ell \in [{2n-1}]\). In both cases it is easy to verify that for any \(i \in [{n}]\),

$$\begin{aligned} f(w_1, \ldots , w_{i-1}, f(w_{i}, \ldots , w_{i+n-1}), w_{i+n}, \ldots , w_{2n-1}) = \bot . \end{aligned}$$

We conclude that \((A;f)\) is an \(n\)-semigroup.

Next we need to show that the \(n\)-semigroup \((A;f)\) has the generalized entropic property. By Lemma 2.1, it suffices to show that the operation \(f' :A^{n^2} \rightarrow A\) given by

$$\begin{aligned} f'(a_1, \ldots , a_{n^2}) = f(f(a_1, \ldots , a_n), f(a_{n+1}, \ldots , a_{2n}), \ldots , f(a_{(n-1)n+1}, \ldots , a_{n^2})) \end{aligned}$$

is invariant under \(\sigma \). Let \(a_1, \ldots , a_{n^2} \in A\). If there exists an index \(i\) such that \(a_i\) is not a word over \([{n^2}]\) of length \(1\), then we clearly have that \(f'(a_1, \ldots , a_{n^2}) = \bot = f'(a_{\sigma (1)}, \ldots , a_{\sigma (n^2)})\). Thus, we can assume that for all \(i \in [{n^2}]\), \(a_i\) is a word over \([{n^2}]\) of length \(1\). Then \(f'(a_1, \ldots , a_{n^2}) = \top \) if and only if \(a_1 \cdots a_{n^2} = \mathbf {c} \sigma ^k\) for some \(k \in \mathbb {N}\); otherwise \(f'(a_1, \ldots , a_{n^2}) = \bot \). Since \(a_1 \cdots a_{n^2} = \mathbf {c} \sigma ^k\) if and only if \(a_{\sigma (1)} \cdots a_{\sigma (n^2)} = \mathbf {c} \sigma ^{k+1}\), we have that \(f'(a_1, \ldots , a_{n^2}) = f'(a_{\sigma (1)}, \ldots , a_{\sigma (n^2)})\) also in this case.

Finally, we need to verify that \(f\) is not entropic, i.e., the operation \(f'\) defined above is not invariant under the transposition permutation \(\varepsilon _n\). This is easy to see: since \(\varepsilon _n\) is not of the form \(\sigma ^k\) for any \(k \in \mathbb {N}\), we have that \(f'(\mathbf {c}) = \top \) and \(f'(\mathbf {c} \varepsilon _n) = \bot \). \(\square \)

3 Mal’cev \(n\)-semigroups

For \(n \ge 3\), let us denote by \(\mathcal {M}_n\) the variety of \(n\)-ary semigroups \((A; f)\) that satisfy the identities

$$\begin{aligned} f(x, y, \ldots , y) \approx x, \end{aligned}$$
(3.1)
$$\begin{aligned} f(y, \ldots , y, x) \approx x. \end{aligned}$$
(3.2)

It is easy to notice that the ternary term

$$\begin{aligned} p_f(x,y,z) := f(x,y,\ldots ,y,z) \end{aligned}$$
(3.3)

is a Mal’cev term. Hence, we refer to an operation \(f\) satisfying identities (3.1) and (3.2) as an n-ary Mal’cev operation, and \(\mathcal {M}_n\) is the variety of Mal’cev n-semigroups. Clearly, each variety \(\mathcal {M}_n\) is idempotent and congruence-permutable.

For \(i \in [{n}]\), an operation \(f :A^n \rightarrow A\) is i-cancellative if it satisfies the quasi-identity

$$\begin{aligned} f(x_1, \ldots , x_{i-1}, y, x_{i+1}, \ldots , x_n) = f(x_1, \ldots , x_{i-1}, z, x_{i+1}, \ldots , x_n) \implies y = z. \end{aligned}$$
(3.4)

The operation \(f\) is cancellative if it is \(i\)-cancellative for every \(i \in [{n}]\).

Lemma 3.1

Mal’cev \(n\)-semigroups are cancellative.

Proof

Let \(f\) be an \(n\)-ary Mal’cev operation. Let \(i \in [{n}]\), and let \(x_1, \ldots , x_n, y, z \in A\) be such that

$$\begin{aligned} f(x_1, \ldots , x_{i-1}, y, x_{i+1}, \ldots , x_n) = f(x_1, \ldots , x_{i-1}, z, x_{i+1}, \ldots , x_n). \end{aligned}$$
(3.5)

If \(i > 1\), then by (3.2), we may write

$$\begin{aligned} y = f(x_{i-1}, \ldots , x_{i-1}, y). \end{aligned}$$
(3.6)

If \(i > 2\), then by (3.1), we can substitute \(f(x_{i-1}, x_{i-2}, \ldots , x_{i-2})\) for the second-to-last occurrence of \(x_{i-1}\) on the right side of (3.6), and we obtain

$$\begin{aligned} y = f(x_{i-1}, \ldots , x_{i-1}, f(x_{i-1}, x_{i-2}, \ldots , x_{i-2}), x_{i-1}, y). \end{aligned}$$

Continuing in this fashion, for \(j = 2, \ldots , i-1\), we consecutively substitute \(f(x_{i-j}, x_{i-j-1}, \ldots , x_{i-j-1})\) for the second-to-last occurrence of \(x_{i-j}\) in the previous expression, and we obtain

$$\begin{aligned} y= & {} f(x_{i-1}, \ldots , x_{i-1}, f(x_{i-1}, x_{i-2}, \ldots , x_{i-2},\nonumber \\&f(\cdots f(x_3, x_2, \ldots , x_2, f(x_2, x_1, \ldots , x_1), x_2) \cdots ), x_{i-2}), x_{i-1}, y). \end{aligned}$$
(3.7)

Similarly, if \(i < n\), then by (3.1), we may write

$$\begin{aligned} y = f(y, x_{i+1}, \ldots , x_{i+1}). \end{aligned}$$
(3.8)

Continuing in this fashion, for \(j = 1, \ldots , n-i-1\), we consecutively substitute \(f(x_{i+j+1}, \ldots , x_{i+j+1}, x_{i+j})\) for the second occurrence of \(x_{i+j}\) in the previous expression, and we obtain

$$\begin{aligned} y= & {} f(y, x_{i+1}, f(x_{i+2}, f(\cdots f(x_{n-1}, f(x_n, \ldots , x_n, x_{n-1}), x_{n-1}, \ldots , x_{n-2}) \cdots ),\nonumber \\&x_{i+2}, \ldots , x_{i+2}, x_{i+1}), x_{i+1}, \ldots , x_{i+1}). \end{aligned}$$
(3.9)

If \(1 < i < n\), then we substitute the right side of (3.7) for the unique occurrence of \(y\) on the right side of (3.9). Applying the associative law, we arrive at a representation of \(y\) of the form

$$\begin{aligned} y = f(\cdots f(x_1, \ldots , x_{i-1}, y, x_{i+1}, \ldots , x_n)\cdots ). \end{aligned}$$
(3.10)

Repeating the same steps as above, but taking \(z\) in place of \(y\), we get

$$\begin{aligned} z = f(\cdots f(x_1, \ldots , x_{i-1}, z, x_{i+1}, \ldots , x_n)\cdots ). \end{aligned}$$
(3.11)

By (3.5), the right side of (3.10) is equal to the right side of (3.11), and we conclude that \(y = z\). \(\square \)

Lemma 3.2

Let \((A; f)\) be an idempotent \(n\)-semigroup. If \(f\) is \(i\)-cancellative and \(j\)-cancellative for some \(i, j \in [{n}]\) with \(i > 1\) and \(j < n\), then \((A; f) \in \mathcal {M}_n\).

Proof

By \(i\)-cancellativity (\(i > 1\)) we have

$$\begin{aligned}&f(\underbrace{x, \ldots , x}_{i-1}, y, \underbrace{x, \ldots , x}_{n-i}) =f(\underbrace{x, \ldots , x}_{i-2}, f(x,\ldots ,x),y, \underbrace{x, \ldots , x}_{n-i})\\&\quad =f(\underbrace{x, \ldots , x}_{i-1}, f(x,\ldots ,x,y), \underbrace{x, \ldots , x}_{n-i}) \; \implies \; y=f(x,\ldots ,x,y). \end{aligned}$$

We can show in a similar way that \(j\)-cancellativity (\(j < n\)) implies \(y = f(y,x,\ldots ,x)\). This completes the proof. \(\square \)

Proposition 3.3

Let \((A; f)\) be an idempotent \(n\)-semigroup. The following are equivalent:

(i):

\((A; f) \in \mathcal {M}_n\).

(ii):

\(f\) is cancellative.

(iii):

\(f\) is \(1\)-cancellative and \(n\)-cancellative.

(iv):

\(f\) is \(i\)-cancellative for some \(i \in \{2, \ldots , n-1\}\).

Proof

\(\hbox {(i)} \implies \hbox {(ii)}\) is Lemma 3.1. \(\hbox {(ii)} \implies \hbox {(iii)}\) and \(\hbox {(ii)} \implies \hbox {(iv)}\) are obvious. \(\hbox {(iii)} \implies \hbox {(i)}\) and \(\hbox {(iv)} \implies \hbox {(i)}\) follow from Lemma 3.2. \(\square \)

Theorem 3.4

For \(n \ge 3\), an \(n\)-ary semigroup \((A;f) \in \mathcal {M}_n\) has the generalized entropic property if and only if it is entropic.

Proof

Sufficiency is obvious. In order to prove necessity, assume there exist \(n\)-ary terms \(s_1\), ..., \(s_n\) such that the identity

$$\begin{aligned}&f(f(x_{11}, \ldots , x_{1n}), \ldots , f(x_{n1}, \ldots , x_{nn})) \approx \nonumber \\&\quad f(s_1(x_{11}, \ldots , x_{n1}), \ldots , s_n(x_{1n}, \ldots , x_{nn})) \end{aligned}$$
(3.12)

holds in \((A;f)\). Then for any \(i \in [{n}]\) and for any \(a, x_1, \ldots , x_n \in A\), we have by idempotence and associativity that

$$\begin{aligned}&f(\underbrace{a, \ldots , a}_{i-1}, s_i(x_1, \ldots , x_n), \underbrace{a, \ldots , a}_{n-i}) \\&= f(s_1(a, \ldots , a), \ldots , s_{i-1}(a, \ldots , a), s_i(x_1, \ldots , x_n), s_{i+1}(a, \ldots , a), \ldots , s_n(a, \ldots , a)) \\&\mathop {=}\limits ^{{{(3.12)}}} f(f(\underbrace{a, \ldots , a}_{i-1}, x_1, \underbrace{a, \ldots , a}_{n-i}), f(\underbrace{a, \ldots , a}_{i-1}, x_2, \underbrace{a, \ldots , a}_{n-i}), \ldots , f(\underbrace{a, \ldots , a}_{i-1}, x_n, \underbrace{a, \ldots , a}_{n-i})) \\&= f(\underbrace{a, \ldots , a}_{i-1}, f(f(x_1, a, \ldots , a), f(x_2, a, \ldots , a), \ldots , f(x_{n-1}, a, \ldots , a), x_n), \underbrace{a, \ldots , a}_{n-i}) \\&\mathop {=}\limits ^{{{(3.1)}}} f(\underbrace{a, \ldots , a}_{i-1}, f(x_1, \ldots , x_n), \underbrace{a, \ldots , a}_{n-i}). \end{aligned}$$

Since \((A;f)\) is cancellative by Lemma 3.1, it follows that \(s_i(x_1, \ldots , x_n) = f(x_1, \ldots , x_n)\). We conclude that \((A;f)\) is entropic. \(\square \)

By Dörnte’s Theorem 1.1, each semiabelian \(n\)-semigroup is entropic. The next theorem shows that for Mal’cev \(n\)-semigroups the converse is also true.

Theorem 3.5

An \(n\)-ary semigroup \((A;f) \in \mathcal {M}_n\) is entropic if and only if it is semiabelian.

Proof

By Theorem 1.1 we only have to prove that entropicity implies semiabelianness. Assume that an \(n\)-ary semigroup \((A;f) \in \mathcal {M}_n\) is entropic. Hence by idempotency, associativity and entropicity we have

$$\begin{aligned}&f(x, y_1, \ldots , y_{n-2}, z) \\&\quad \approx f(f(y_1,\ldots ,y_1,x), f(y_1,\ldots ,y_1), f(y_1,\ldots ,y_1,y_2), \ldots , f(y_1,\ldots ,y_1,y_{n-2}),\\&\qquad \,\,\, f(z,y_1,\ldots ,y_1)) \\&\quad \mathop {\approx }\limits ^{{{(1.1)}}} f(f(y_1,\ldots ,y_1,z), f(y_1,\ldots ,y_1), \ldots , f(y_1,\ldots ,y_1), f(x,y_1,\ldots ,y_{n-2},y_1)) \\&\quad \approx f(z, y_1, \ldots , y_1, f(x, y_1, \ldots , y_{n-2}, y_1)) \\&\quad \approx f(f(z, y_1, \ldots , y_1, x), y_1, \ldots , y_{n-2}, y_1) \\&\quad \approx f\!(f(z, y_1, \ldots , y_1, x), f\!(y_1, \ldots , y_1), f\!(y_2, y_1,\! \ldots , y_1), \ldots , f\!(y_{n{-}2}, y_1, \ldots , y_1),\\&\qquad \,\,\, f(y_1, \ldots , y_1)) \\&\quad \mathop {\approx }\limits ^{{{(1.1)}}} f\!(f(z, y_1, y_2, \ldots , y_{n-2}, y_1), f\!(y_1, \ldots , y_1), \ldots , f(y_1,\! \ldots , y_1), f(x, y_1, \ldots , y_1)) \\&\quad \approx f(f(z, y_1, y_2, \ldots , y_{n-2}, y_1), y_1, \ldots , y_1, x) \\&\quad \approx f(z, y_1, y_2, \ldots , y_{n-2}, f(y_1, \ldots , y_1, x)) \\&\quad \approx f(z, y_1, y_2, \ldots , y_{n-2}, x). \end{aligned}$$

This shows that \((A;f)\) is semiabelian. \(\square \)

Additionally, by well known results of Gumm and Smith (see, e.g. [10], Theorem 4.155]), we have

Theorem 3.6

Let \((A;f) \in \mathcal {M}_n\), and let \(p_f\) be as defined in equation (3.3). The following conditions are equivalent:

  1. (i)

    \((A;p_f)\) is entropic,

  2. (ii)

    \((A;f)\) is diagonally normal (i.e., the diagonal is a block of a congruence of the square \((A;f)\times (A;f)\)),

  3. (iii)

    \((A;f)\) is polynomially equivalent to a module over a ring.

In particular, by results of Romanowska and Smith [14], Corollary 6.3.2], we have the following characterization of entropic Mal’cev \(n\)-semigroups.

Corollary 3.7

Each entropic algebra \((A;f) \in \mathcal {M}_n\) is equivalent to an affine space (a full idempotent reduct of a module) over a commutative ring.

4 Ternary Mal’cev semigroups

The variety \(\mathcal {M}_3\) is the Mal’cev variety of ternary semigroups \((A;f)\) which satisfy the identities

$$\begin{aligned} f(x,y,y) \approx x, \end{aligned}$$
(4.1)
$$\begin{aligned} f(x,x,y) \approx y. \end{aligned}$$
(4.2)

Example 4.1

Let \((G; +, -, 0)\) be an abelian group. Define the ternary operation \(f\) on \(G\) by the rule

$$\begin{aligned} f(x,y,z) := x - y + z, \end{aligned}$$

for all \(x, y, z \in G\). Clearly, the algebra \((G; f)\) is a ternary semigroup and belongs to the variety \(\mathcal {M}_3\).

By associativity and (4.1) the following is true in any \((A;f) \in \mathcal {M}_3\):

$$\begin{aligned} f(f(x,y,z),z,u) \approx f(x,f(y,z,z),u) \approx f(x,y,u), \end{aligned}$$

and, similarly,

$$\begin{aligned} f(x,y,f(y,z,u)) \approx f(x,z,u). \end{aligned}$$

By Theorems 3.4, 3.5, 3.6, and Corollary 3.7 we immediately obtain the following characterization of entropicity for ternary Mal’cev semigroups.

Theorem 4.2

Let \((A;f) \in \mathcal {M}_3\). The following conditions are equivalent:

  1. (i)

    \((A;f)\) is entropic,

  2. (ii)

    \((A;f)\) has the generalized entropic property,

  3. (iii)

    \((A;f)\) is semiabelian,

  4. (iv)

    \((A;f)\) is diagonally normal,

  5. (v)

    \((A;f)\) is equivalent to an affine space over a commutative ring.

The free \(\mathcal {M}_3\)-algebra \(F_{\mathcal {M}_3}(\{x,y\})\) on two generators \(x\) and \(y\) has nice and simple structure. In order to present it, let us introduce the notation \(t_n\) for each odd integer \(n\) as follows:

Lemma 4.3

For every odd integer \(n\),

$$\begin{aligned} f(x, y, t_n) = f(t_n, y, x) = t_{n+2}, \end{aligned}$$
(4.3)
$$\begin{aligned} f(y, x, t_n) = f(t_n, x, y) = t_{n-2}. \end{aligned}$$
(4.4)

Proof

If \(n\) is positive, then \(f(x, y, t_n) = t_{n+2}\) by definition. The equality \(f(x, y, t_n) = t_{n+2}\) holds also for negative \(n\). Namely, \(f(x, y, t_{-1}) = f(x, y, y) = x = t_1\), and for odd and negative \(n\), we have

$$\begin{aligned} f(x, y, t_{n-2}) = f(x, y, f(y, x, t_n)) = f(f(x, y, y), x, t_n) = f(x, x, t_n) = t_n. \end{aligned}$$

We prove the equality \(f(t_n, y, x) = f(x, y, t_n)\) by induction. Obviously, \(f(t_1, y, x) = f(x, y, t_1)\). Assume that \(f(t_n, y, x) = f(x, y, t_n)\) holds for an odd and positive \(n\). Then

$$\begin{aligned} f(t_{n+2}, y, x) = f(f(x, y, t_n), y, x) = f(x, y, f(t_n, y, x)) = f(x, y, t_{n+2}). \end{aligned}$$

It is clear that \(f(t_{-1}, y, x) = f(y, y, x) = f(x, y, y) = f(x, y, t_{-1}).\) Assume that \(f(t_n, y, x) = f(x, y, t_n)\) holds for an odd and negative \(n\). Then

$$\begin{aligned}&f(t_{n-2}, y, x) = f(f(y, x, t_n), y, x) = f(y, x, f(t_n, y, x)) = f(y, x, f(x, y, t_n)) \\&= f(f(y, x, x), y, t_n) = f(y, y, t_n) = t_n = f(x, y, t_{n-2}). \end{aligned}$$

Equality (4.4) is proved in a similar way. \(\square \)

Proposition 4.4

For all odd integers \(p, q, r\),

$$\begin{aligned} f(t_p, t_q, t_r) = t_{p-q+r}. \end{aligned}$$

Proof

Observe first that for all odd integers \(p\), \(q\), \(r\),

$$\begin{aligned} f(t_p, t_q, t_r) \mathop {=}\limits ^{{{(4.3)}}} f(t_p, f(t_{q-2}, y, x), t_r) = f(t_p, t_{q-2}, f(y, x, t_r)) \mathop {=}\limits ^{{{(4.4)}}} f(t_p, t_{q-2}, t_{r-2}),\\ f(t_p, t_q, t_r) \mathop {=}\limits ^{{{(4.4)}}} f(t_p, f(t_{q+2}, x, y), t_r) = f(t_p, t_{q+2}, f(x, y, t_r)) \mathop {=}\limits ^{{{(4.3)}}} f(t_p, t_{q+2}, t_{r+2}). \end{aligned}$$

An easy inductive argument shows that \(f(t_p, t_q, t_r) = f(t_p, t_{q+m}, t_{r+m})\) for all odd integers \(p\), \(q\), \(r\) and any even \(m\). In particular, taking \(m := p - q\), we have

$$\begin{aligned} f(t_p, t_q, t_r) = f(t_p, t_{q + (p - q)}, t_{r + (p - q)}) = f(t_p, t_p, t_{p - q + r}) \mathop {=}\limits ^{{{(4.2)}}} t_{p - q + r}. \end{aligned}$$

\(\square \)

As an immediate consequence of Proposition 4.4 we have obtained a simple representation of the free ternary Mal’cev semigroup on two generators. Since the generators of the free algebra \(F_{\mathcal {M}_3}(\{x,y\})\) are \(t_1\) and \(t_{-1}\), it follows that every element of \(F_{\mathcal {M}_3}(\{x,y\})\) is equivalent to a term of the form \(t_n\) for some odd integer. Proposition 4.4 provides the computation rule that applies to this representation.

Theorem 4.5

The free ternary Mal’cev semigroup \(F_{\mathcal {M}_3}(\{x,y\})\) on two generators is isomorphic to the algebra \((2 \mathbb {Z} + 1; f)\), where \(2 \mathbb {Z} + 1\) denotes the set of odd integers and \(f(x, y, z) = x - y + z\).

Theorem 4.6

The free ternary Mal’cev semigroup \(F_{\mathcal {M}_3}(\{x,y\})\) on two generators is entropic.

Proof

It is clear from Theorem 4.5 that \(F_{\mathcal {M}_3}(\{x,y\})\) is isomorphic to a subreduct of the abelian group \((\mathbb {Z},+,-,0)\), so it is entropic. \(\square \)

5 \(n\)-Semigroups satisfying Mal’cev-like identities

We now investigate some further \(n\)-semigroups that satisfy identities resembling the identities (3.1) and (3.2) defining Mal’cev \(n\)-semigroups. These include associative weak near-unanimity operations and associative \(k\)-edge operations, which, as we will see, are trivial algebras and hence obviously entropic.

Proposition 5.1

Let \(f\) be an associative and idempotent operation that satisfies the identities

$$\begin{aligned}&f(x, \ldots , x, y) \approx f(y, x, \ldots , x) \approx f(x, y, x, \ldots , x) \end{aligned}$$
(5.1)

or

$$\begin{aligned} f(x, \ldots , x, y) \approx f(y, x, \ldots , x) \approx f(x, \ldots , x, y, x). \end{aligned}$$
(5.2)

Then \(f\) is totally symmetric.

Proof

Assume first that \(f\) is an associative and idempotent operation satisfying the identities (5.1). (The proof is similar in the case when \(f\) satisfies the identities (5.2).) For any \(i \in [{n-1}]\) and for all \(x_1, \ldots , x_n \in A\), we have

$$\begin{aligned}&f(x_1, \ldots , x_n) = f(x_1, \ldots , x_{i-1}, f(x_i, \ldots , x_i), f(x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, x_i, f(f(x_i, \ldots , x_i, x_{i+1}), x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&\mathop {=}\limits ^{{{(5.1)}}} f(x_1, \ldots , x_{i-1}, x_i, f(f(x_{i+1}, x_i, \ldots , x_i), x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, x_i, f(x_{i+1}, f(x_i, \ldots , x_i, x_{i+1}), x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&\mathop {=}\limits ^{{{(5.1)}}} f(x_1, \ldots , x_{i-1}, x_i, f(x_{i+1}, f(x_{i+1}, x_i, \ldots , x_i), x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&= \cdots \\&= f(x_1, \ldots , x_{i-1}, x_i, f(x_{i+1}, \ldots , x_{i+1}, f(x_{i+1}, x_i, \ldots , x_i)), x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, f(x_i, x_{i+1}, \ldots , x_{i+1}), f(x_{i+1}, x_i, \ldots , x_i), x_{i+2}, \ldots , x_n) \\&\mathop {=}\limits ^{{{(5.1)}}} f(x_1, \ldots , x_{i-1}, f(x_{i+1}, \ldots , x_{i+1}, x_i), f(x_{i+1}, x_i, \ldots , x_i), x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, f(x_{i+1}, \ldots , x_{i+1}, f(x_i, x_{i+1}, x_i, \ldots , x_i)), x_i, x_{i+2}, \ldots , x_n) \\&\mathop {=}\limits ^{{{(5.1)}}} f(x_1, \ldots , x_{i-1}, f(x_{i+1}, \ldots , x_{i+1}, f(x_{i+1}, x_i, x_i, \ldots , x_i)), x_i, x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, f(x_{i+1}, \ldots , x_{i+1}), f(x_i, \ldots , x_i), x_{i+2}, \ldots , x_n) \\&= f(x_1, \ldots , x_{i-1}, x_{i+1}, x_i, x_{i+2}, \ldots , x_n), \end{aligned}$$

that is, \(f\) is \((i, i+1)\)-commutative. Since the full symmetric group \(\Sigma _n\) is generated by the set of all adjacent transpositions \((i \;\; i+1)\), \(1 \le i \le n-1\), we conclude that \(f\) is totally symmetric. \(\square \)

An \(n\)-ary operation \(f\) is a weak near-unanimity operation if it is idempotent and satisfies the identities

$$\begin{aligned} f(y, x, \ldots , x) \approx f(x, y, x, \ldots , x) \approx \ldots \approx f(x, \ldots , x, y, x) \approx f(x, \ldots , x, y). \end{aligned}$$
(5.3)

Corollary 5.2

Every associative weak near-unanimity operation is totally symmetric.

It follows from Proposition 5.1 and Theorem 1.1 that every \(n\)-semigroup satisfying the identities (5.1) or (5.2) (in particular, every weak near-unanimity \(n\)-semigroup) is entropic and hence has the generalized entropic property.

We say that an \(n\)-semigroup \((A; f)\) is a left zero n-semigroup if it satisfies the identity \(f(x_1, \ldots , x_n) \approx x_1\), and we say that it is a right zero n-semigroup if it satisfies the identity \(f(x_1, \ldots , x_n) \approx x_n\).

It is clear that left or right zero \(n\)-semigroups are entropic.

Proposition 5.3

Let \((A; f)\) be an \(n\)-semigroup. If \((A; f)\) satisfies the identity \(f(x, \ldots , x, y) \approx x\), then \((A; f)\) is a left zero \(n\)-semigroup. If \((A; f)\) satisfies the identity \(f(y, x, \ldots , x) \approx x\), then \((A; f)\) is a right zero \(n\)-semigroup.

Proof

Assume that \((A; f)\) satisfies the identity \(f(x, \ldots , x, y) \approx x\). (The proof when \((A; f)\) satisfies the identity \(f(y, x, \ldots , x) \approx x\) is similar.) Since \(f\) is idempotent, we have \(f(x, \ldots , x, y) \approx f(x, \ldots , x)\). By associativity and idempotency, we have

$$\begin{aligned}&f(f(x, \ldots , x, y), y, \ldots , y) \approx f(f(x, \ldots , x, x), y, \ldots , y) \\&\approx f(x, f(x, \ldots , x, y), y, \ldots , y) \approx f(x, f(x, \ldots , x, x), y, \ldots , y) \\&\approx \cdots \approx f(x, \ldots , x, f(x, \ldots , x, y)) \approx f(x, \ldots , x, f(x, \ldots , x, x)) \approx x. \end{aligned}$$

Then for any \(i \in [{n-1}]\) we have

$$\begin{aligned}&f(x_1, \ldots , x_n) \approx f(x_1, \ldots , x_{i-1}, f(x_i, \ldots , x_i), f(x_{i+1} \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&\approx f(x_1, \ldots , x_i, f(f(x_i, \ldots , x_i, x_{i+1}), x_{i+1}, \ldots , x_{i+1}), x_{i+2}, \ldots , x_n) \\&\approx f(x_1, \ldots , x_{i-1}, x_i, x_i, x_{i+2}, \ldots , x_n). \end{aligned}$$

Consequently,

$$\begin{aligned}&f(x_1, \ldots , x_n) \approx f(x_1, x_1, x_3, \ldots , x_n) \approx f(x_1, x_1, x_1, x_4, \ldots , x_n) \\&\approx \cdots \approx f(x_1, \ldots , x_1, x_n) \approx f(x_1, \ldots , x_1, x_1) \approx x_1. \end{aligned}$$

\(\square \)

A \((k + 1)\)-ary operation \(f\) is called a k-edge operation if it satisfies the following identities:

$$\begin{aligned} \begin{array}{c} f(x, x, y, y, y, \ldots , y, y) \approx y, \\ f(x, y, x, y, y, \ldots , y, y) \approx y, \\ f(y, y, y, x, y, \ldots , y, y) \approx y, \\ f(y, y, y, y, x, \ldots , y, y) \approx y, \\ \vdots \\ f(y, y, y, y, y, \ldots , y, x) \approx y. \end{array} \end{aligned}$$

An algebra \((A; f)\) with an associative \(k\)-edge operation is trivial. (Since \((A; f)\) satisfies the identity \(f(y, \ldots , y, x) \approx y\), it follows from Proposition 5.3 that \((A; f)\) is a left zero \((k+1)\)-semigroup. Then \(x \approx f(x, x, y, \ldots , y) \approx y\).)

Similarly, the only \(n\)-semigroups with a near-unanimity operation are the trivial ones.

Denote by \(\pi _i\) the projection on the \(i\)-th coordinate.

Lemma 5.4

Let \(n \ge 2\), \(1\le j\le n\) and \((A; f)\) be an idempotent \(n\)-semigroup. If \((A; f)\) has the generalized entropic property for an arbitrary term \(t_1\) and for terms \(t_2 = \cdots = t_{n} = \pi _j\) or for terms \(t_1 = \cdots = t_{n-1} = \pi _j\) and for an arbitrary term \(t_n\), then \((A; f)\) is entropic.

Proof

Assume that the generalized entropic property holds for terms \(t_2 = \cdots = t_{n} = \pi _j\) and an arbitrary term \(t_1\). (The proof is similar for terms \(t_1 = \cdots = t_{n-1} = \pi _j\) and \(t_n\).) We have that the identity

$$\begin{aligned}&f(f(x_{11}, \ldots , x_{1n}), \ldots , f(x_{n1}, \ldots , x_{nn})) \\&\approx f(t_1(x_{11}, \ldots , x_{n1}), \ldots , t_{n-1}(x_{1(n-1)}, \ldots , x_{n(n-1)}),t_n(x_{1n}, \ldots , x_{nn})) \\&\approx f(t_1(x_{11}, \ldots , x_{n1}),x_{j2}, \ldots , x_{j(n-1)},x_{jn}) \end{aligned}$$

holds in \((A;f)\). It means that the value of \(f(f(x_{11}, \ldots , x_{1n}), \ldots , f(x_{n1}, \ldots , x_{nn}))\) does not depend on variables \(x_{12}, \!\ldots , x_{1n}, \!\ldots , x_{(j-1)2}, \ldots , x_{(j-1)n},x_{(j+1)2}, \ldots , x_{(j+1)n},\ldots , x_{n2}, \ldots , x_{nn}\). Hence by idempotency we have

$$\begin{aligned}&f(f(x_{11}, \ldots , x_{1n}),f(x_{21}, \ldots , x_{2n}), \ldots , f(x_{n1}, \ldots , x_{nn})) \nonumber \\&\approx f(f(x_{11}, \ldots , x_{11}), f(x_{21}, \ldots , x_{21}),\ldots , f(x_{(j-1)1},\ldots , x_{(j-1)1}),\nonumber \\&\quad \,\,\, f(x_{j1}, \ldots , x_{jn}),f(x_{(j+1)1}, \ldots , x_{(j+1)1}),\ldots , f(x_{n1}, \ldots , x_{n1}))\nonumber \\&\approx f(x_{11}, \ldots , x_{(j-1)1},f(x_{j1}, \ldots , x_{jn}),x_{(j+1)1}, \ldots , x_{n1}). \end{aligned}$$
(5.4)

In particular it implies for any \(1\le i\le n\), \(i\ne j\):

$$\begin{aligned}&f(a_{1}, \ldots , f(a_{i1},\ldots ,a_{in}),\ldots ,a_{j-1},a_{j},a_{j+1}, \ldots , a_{n})\nonumber \\&\approx f(a_{1}, \ldots ,a_{i1},\ldots ,a_{j-1},a_{j},a_{j+1}, \ldots , a_{n}). \end{aligned}$$
(5.5)

If \(j \ne n\), then we have

$$\begin{aligned}&f(x_1, \ldots , x_n) \approx f(f(f(x_1, \ldots , x_1), x_1, \ldots , x_1), x_2, \ldots , x_n) \\&\approx f(x_1, \ldots , x_1, f(x_1, \ldots , x_1), x_1, \ldots , x_1, f(x_1, x_2, \ldots , x_n)) \mathop {\approx }\limits ^{{{(5.5)}}} f(x_1, \ldots , x_1), \end{aligned}$$

i.e., \(f(x_1, \ldots , x_n)\) depends only on \(x_1\). In this case \(f\) is clearly entropic. If \(j = n\), then

$$\begin{aligned}&f(x_1, \ldots , x_n) \approx f(f(x_1, \ldots , x_1), x_2, \ldots , x_{n-1}, f(x_n, \ldots , x_n)) \\&\approx f(x_1, \ldots , x_1, f(x_1, x_1, x_2, \ldots , x_{n-1}), f(x_n, \ldots , x_n)) \\&\mathop {\approx }\limits ^{{{(5.5)}}} f(x_1, \ldots , x_1, x_n), \end{aligned}$$

i.e., \(f(x_1, \ldots , x_n)\) depends only on \(x_1\) and \(x_n\). This, together with associativity, implies that

$$\begin{aligned}&f(f(x_{11}, \ldots , x_{1n}), \ldots , f(x_{n1}, \ldots , x_{nn})) \\&\approx f(f(x_{11}, \ldots , x_{11}), \ldots , f(x_{11}, \ldots , x_{11}), f(x_{11}, \ldots , x_{11}, x_{nn})), \end{aligned}$$

i.e., \(f(f(x_{11}, \ldots , x_{1n}), \ldots , f(x_{n1}, \ldots , x_{nn}))\) depends only on \(x_{11}\) and \(x_{nn}\). It follows that \(f\) is entropic. \(\square \)

6 Idempotent \(n\)-semigroups derived from binary semigroups

Let \(f :A^n \rightarrow A\) be an arbitrary operation of arity \(n \ge 1\). For \(\ell \ge 0\), define the operation \(f^{(\ell )}\) of arity \(N(\ell ) := \ell (n - 1) + 1\) recursively as follows: \(f^{(0)} := {{\mathrm{id}}}_A\), and for \(\ell \ge 0\), let

$$\begin{aligned} f^{(\ell + 1)}(a_1, \ldots , a_{N(\ell + 1)}) = f^{(\ell )}(f(a_1, \ldots , a_n), a_{n + 1}, \ldots , a_{N(\ell + 1)}), \end{aligned}$$

for all \(a_1, \ldots , a_{N(\ell + 1)} \in A\). Note that \(f^{(1)} = f\). Note also that if \(*\) denotes the binary composition as in iterative algebras [9], we have that \(f^{(\ell + 1)} = f *f^{(\ell )}\) for all \(\ell \ge 0\). An algebra \((A; (f_i)_{i \in I})\) of type \(\tau = (n_i)_{i \in I}\) is the \(\tau \) -algebra derived from f, if for every \(i \in I\) there exists an integer \(\ell _i \ge 0\) such that \(n_i = N(\ell _i)\) and \(f_i = f^{(\ell _i)}\).

Recall that \(f \perp g\) denotes that two operations \(f :A^n \rightarrow A\) and \(g :A^m \rightarrow A\) commute (see Sect. 1).

Proposition 6.1

Let \(f :A^m \rightarrow A\) and \(g :A^n \rightarrow A\), and assume that \(f \perp g\). Then \(f^{(k)} \perp g^{(\ell )}\) for every \(k, \ell \ge 1\).

Proof

Recall that the centralizer \(\{x : x \perp h\}\) of a function \(h\) is a clone and that for every \(k \ge 0\), the function \(f^{(k)}\) is a member of the clone generated by \(f\). Therefore, the assumption \(f \perp g\) implies \(f^{(k)} \perp g\) for all \(k \ge 0\). Similarly, \(f^{(k)} \perp g\) implies that \(f^{(k)} \perp g^{(\ell )}\) for all \(\ell \ge 0\). \(\square \)

Let \(2 \le n \in \mathbb {N}\). We say that an \(n\)-semigroup \((S; f)\) is derived from a semigroup \((S; \cdot )\) if it is the \((n)\)-algebra derived from the binary, associative operation \(\cdot \). In the case when \(n = 2\), \((S; f) = (S; \cdot )\). For example, it was observed by Dörnte [2] that an \(n\)-semigroup derived from a group is an \(n\)-group. Of course, for \(n \ge 3\), there are \(n\)-semigroups which are not derived from any semigroup.

Let us denote by \(\mathcal {S}_n\) the variety of semigroups \((S;\cdot )\) which satisfy the identity

$$\begin{aligned} x^n\approx x. \end{aligned}$$
(6.1)

Note that an \(n\)-semigroup derived from a semigroup \((S; \cdot )\) is idempotent if and only if \((S; \cdot ) \in \mathcal {S}_n\).

Let \((S; f)\) be the \(n\)-semigroup derived from a semigroup \((S; \cdot )\). By Proposition 6.1 it is evident that if \((S; \cdot )\) is entropic then \((S; f)\) is entropic, too. We will show that for idempotent \(n\)-semigroups derived from semigroups, the converse is also true. In fact, we obtain even more: for such \(n\)-semigroups the generalized entropic property and entropicity are equivalent.

Theorem 6.2

Let \(n \ge 3\), let \((S; \cdot ) \in \mathcal {S}_n\), and let \((S; f)\) be the \(n\)-semigroup derived from \((S; \cdot )\). Then the following statements are equivalent:

(i):

\((S; f)\) is entropic;

(ii):

\((S; f)\) has the generalized entropic property;

(iii):

\((S; \cdot )\) is entropic;

(iv):

\((S; \cdot )\) has the generalized entropic property.

Proof

Implications \(\mathrm{(i)} \implies \mathrm{(ii)}\) and \(\mathrm{(iii)} \implies \mathrm{(iv)}\) are obvious. Implication \(\mathrm{(iii)} \implies \mathrm{(i)}\) holds by Proposition 6.1. We will complete the proof by proving two other implications as separate theorems in the remainder of this paper: implication \(\mathrm{(ii)} \implies \mathrm{(iii)}\) will be proved in Theorem 6.7, and implication \(\mathrm{(iv)} \implies \mathrm{(iii)}\) will be proved in Theorem 6.8. \(\square \)

Lemma 6.3

Let \((S;\cdot )\in \mathcal {S}_n\). Then \((S;\cdot )\) is entropic if and only if it satisfies the identity

$$\begin{aligned} abca \approx acba. \end{aligned}$$
(6.2)

Proof

It is clear that entropicity implies (6.2). Assume that (6.2) holds in \((S;\cdot )\). It is known (see e.g. [6]) that for any semigroup satisfying (6.2) it holds that for \(a, b, c, d \in S\),

$$\begin{aligned}&(abcd)^2 = (abcd)(abcd) = (ab(cd)a)bcd = a(cd)babcd = a(c(dba)bc)d = \\&a(cb(dba)c)d = acb(db(ac)d) = (acbd)(acbd) = (acbd)^2. \end{aligned}$$

Moreover,

$$\begin{aligned} (abcd)(acbd)= & {} ab(cdac)bd = (abca)(dcbd) \\= & {} a(cb)ad(cb)d = (acbd)(acbd) = (acbd)^2. \end{aligned}$$

Hence,

$$\begin{aligned}&abcd = (abcd)^n = ((abcd)^2)^{n/2} = ((acbd)^2)^{n/2} = (acbd)^n=acbd,&\!\!\text {if } n \text { is even,} \\&abcd = (abcd)((abcd)^2)^{(n-1)/2} = (abcd)(acbd)^{n-1} \\&= (abcd)(acbd)(acbd)^{n-2} = (acbd)^2(acbd)^{n-2} = (acbd)^n = acbd,&\!\!\text {if } n \text { is odd.} \end{aligned}$$

This completes the proof. \(\square \)

Note that if an \(n\)-semigroup \((S;f)\) is derived from a semigroup \((S;\cdot )\) then the generalized entropic property (1.2) takes the form

$$\begin{aligned} (x_{11} \ldots x_{n1}) \ldots (x_{1n} \ldots x_{nn}) \approx t_1(x_{11}, \ldots , x_{1n}) \ldots t_n(x_{n1}, \ldots , x_{nn}), \end{aligned}$$
(6.3)

for some \(n\)-ary terms \(t_1, \ldots , t_n\) of \((S;f)\).

In particular, if an \(n\)-semigroup \((S;f)\) is derived from a semigroup \((S;\cdot )\) then \((S;f)\) is entropic if it satisfies the following identity:

$$\begin{aligned} (x_{11} \ldots x_{n1}) \ldots (x_{1n} \ldots x_{nn}) \approx (x_{11} \ldots x_{1n}) \ldots (x_{n1} \ldots x_{nn}). \end{aligned}$$

Let \(E_S\) be the set of all idempotents in \((S;\cdot )\).

Lemma 6.4

Let \((S;f)\) be an idempotent \(n\)-semigroup derived from a semigroup \((S;\cdot )\in \mathcal {S}_n\) and let \((S;f)\) satisfy the generalized entropic property (6.3). Then for any \(a\in S\) and \(e \in E_S\),

$$\begin{aligned} t_1(e,a,e,\ldots ,e)e=eae=et_n(a,e,\ldots ,e). \end{aligned}$$
(6.4)

Proof

Let \(a \in S\) and \(e \in E_S\). By the idempotency of \(e\) and the generalized entropic property we obtain

$$\begin{aligned}&t_1(e, a, e, \ldots , e) e = t_1(e, a, e, \ldots , e) t_2(e, \ldots , e) \cdots t_n(e, \ldots , e) \\&\mathop {=}\limits ^{{{(6.3)}}} (\underbrace{e \cdots e}_{n})(a \underbrace{e \cdots e}_{n-1}) \underbrace{(\underbrace{e \cdots e}_{n}) \cdots (\underbrace{e \cdots e}_{n})}_{n-2} = eae = (\underbrace{e \cdots e}_{n-1} a) \underbrace{(\underbrace{e \cdots e}_{n}) \cdots (\underbrace{e \cdots e}_{n})}_{n-1} \\&\mathop {=}\limits ^{{{(6.3)}}} t_1(e, \ldots , e) \cdots t_{n-1}(e, \ldots , e) t_n(a, e, \ldots , e) = et_n(a, e, \ldots , e). \end{aligned}$$

\(\square \)

Lemma 6.5

Let \(n \ge 3\), \((S; f)\) be an idempotent \(n\)-semigroup derived from a semigroup \((S; \cdot ) \in \mathcal {S}_n\) and assume that \((S; f)\) has the generalized entropic property (6.3). Then for any \(a, b \in S\) and \(e \in E_S\),

$$\begin{aligned} eabe = ebeae. \end{aligned}$$
(6.5)

Proof

Let \(a, b \in S\) and \(e \in E_S\). By the idempotency of \(e\) and the generalized entropic property we have

$$\begin{aligned}&eabe = (\underbrace{e \cdots e}_{n-1} a)(b \underbrace{e \cdots e}_{n-1}) \underbrace{(\underbrace{e \cdots e}_{n}) \cdots (\underbrace{e \cdots e}_{n})}_{n-2} \\&= t_1(e, b, e, \ldots , e) t_2(e, \ldots , e) \ldots t_{n-1}(e, \ldots , e) t_n(a, e, \ldots , e) \\&= t_1(e, b, e, \ldots , e) e t_n(a, e, \ldots , e) \mathop {=}\limits ^{{{(6.4)}}} ebe t_n(a, e, \ldots , e) \mathop {=}\limits ^{{{(6.4)}}} ebeae. \end{aligned}$$

\(\square \)

Let \((S; \cdot ) \in \mathcal {S}_n\) and \(a \in S\). If \(n = 2\) then clearly \(a\) is idempotent. For \(n \ge 3\), obviously

$$\begin{aligned} a^{n-1} = a^n a^{n-2} = a^{n-1} a^{n-1}, \end{aligned}$$

which means that each element \(a^{n-1}\) is idempotent. Moreover, for any \(a \in S\)

$$\begin{aligned} f(a^{n-1}, \ldots , a^{n-1}, a) = a = f(a, a^{n-1}, \ldots , a^{n-1}). \end{aligned}$$

Hence, the following is easily observed.

Corollary 6.6

Let \((S; f)\) be an idempotent \(n\)-semigroup derived from a semigroup \((S; \cdot ) \in \mathcal {S}_n\). Then the following statements are equivalent:

  1. (i)

    \((S; f)\) is semiabelian;

  2. (ii)

    \((S; \cdot )\) is commutative;

  3. (iii)

    \((S; f)\) is totally symmetric.

Proof

\(\mathrm{(i)} \implies (ii)\) Let \((S;f)\) be a semiabelian \(n\)-semigroup. Then for any \(a, b \in S\) we have

$$\begin{aligned}&ab = a\underbrace{a^{n-1} \cdots a^{n-1}}_{n-2} b = f(a, a^{n-1}, \ldots , a^{n-1}, b) \\&= f(b, a^{n-1}, \ldots , a^{n-1}, a) = b \underbrace{a^{n-1} \cdots a^{n-1}}_{n-2} a = ba, \end{aligned}$$

which shows that \((S; \cdot )\) is commutative.

The implications \(\mathrm{(ii)} \implies \mathrm{(iii)}\) and \(\mathrm{(iii)} \implies \mathrm{(i)}\) are obvious. \(\square \)

Theorem 6.7

Let \(n \ge 3\), let \((S; f)\) be an idempotent \(n\)-semigroup derived from a semigroup \((S; \cdot ) \in \mathcal {S}_n\) and assume that \((S;f)\) has the generalized entropic property (6.3). Then \((S; \cdot )\) is entropic.

Proof

First note that for any \(a \in S\), the set

$$\begin{aligned} S_a := \{a^{n-1} s a^{n-1} : s \in S\} \end{aligned}$$

is a subsemigroup of \((S;\cdot )\) with identity element \(a^{n-1}\). Thus \((S_a;f)\) is a subalgebra of \((S;f)\) which contains the neutral \(a^{n-1}\). By Theorem 1.4 and Corollary 6.6, for any \(a \in S\), \((S_a;\cdot )\) is commutative. Hence, by Lemma 6.5, for any \(a, b, c \in S\), we have

$$\begin{aligned}&a^{n-1} bc a^{n-1} \mathop {=}\limits ^{{{(6.5)}}} a^{n-1} c a^{n-1} b a^{n-1} = a^{n-1} c a^{n-1} a^{n-1} b a^{n-1} \\&= a^{n-1} b a^{n-1} a^{n-1} c a^{n-1} = a^{n-1} b a^{n-1} c a^{n-1} \mathop {=}\limits ^{{{(6.5)}}} a^{n-1} c b a^{n-1}. \end{aligned}$$

Consequently, for any \(a, b, c \in S\),

$$\begin{aligned} abca = acba. \end{aligned}$$

By Lemma 6.3, this shows that \((S;\cdot )\) is entropic. \(\square \)

It follows from a classification of varieties of bands (idempotent semigroups) that the generalized entropic property and entropicity are equivalent in idempotent semigroups (for a direct proof see [1], Proposition 3.11]). This result may by expanded to any semigroup \((S;\cdot )\in \mathcal {S}_n\).

Theorem 6.8

Let \((S;\cdot ) \in \mathcal {S}_n\). Then \((S;\cdot )\) has the generalized entropic property if and only if it is entropic.

Proof

First note that the idempotents of an arbitrary semigroup \((S;\cdot )\) having the generalized entropic property form a normal (entropic) band. For, let \(E_S\) be the set of all idempotent elements of \((S;\cdot )\) and let \(t_1\) and \(t_2\) be terms with which \((S;\cdot )\) satisfies identity (1.3). Let \(e, f \in E_S\). Then

$$\begin{aligned} (ef)(ef) \mathop {=}\limits ^{{{(1.3)}}} t_1(e,e) t_2(f,f) = ef, \end{aligned}$$

which shows that \(ef \in E_S\), i.e., \(E_S\) is a subsemigroup. It then follows from [1], Proposition 3.11] that \(E_S\) is entropic; in other words, \(E_S\) is a normal band.

From now on, assume that \((S;\cdot )\) is a member of the variety \(\mathcal {S}_n\) having the generalized entropic property. We have that \((S;\cdot )\) is a completely regular semigroup, with the unary operation \({}^{-1} :S \rightarrow S; \;\; a \mapsto a^{-1} := a^{n-2}\), hence \((S;\cdot )\) is orthodox. (Recall that a regular semigroup is called orthodox if its idempotents form a subsemigroup.)

A completely regular semigroup whose idempotents form a normal band is a normal band of groups ([12], Theorem 4.1, Corollary 4.3]). It thus follows from [13], Theorem 3.2] that \((S;\cdot )\) is a subdirect product of a band \(B\) and a semilattice \(L\) of groups. By the definition of subdirect product, \(B\) and \(L\) are homomorphic images of \(S\), so \(B\) and \(L\) satisfy every identity satisfied by \(S\); hence \(B\) and \(L\) have the generalized entropic property.

We have seen in the first paragraph of this proof that every band with the generalized entropic property is normal. It was shown in [1], Proposition 4.7] that every group with the generalized entropic property is abelian. Hence we conclude that \((S;\cdot )\) is a subdirect product of a normal band and a semilattice of abelian groups. Since semilattices of abelian groups are commutative and hence entropic, the semigroup \((S;\cdot )\) is entropic. \(\square \)