On definability in some lattices of semigroup varieties

An identity of the form x1 · · ·xn ≈ x1πx2π · · ·xnπ where π is a non-trivial permutation on the set {1, . . . , n} is called a permutation identity. If u ≈ v is a permutation identity, then (u ≈ v) [respectively r(u ≈ v)] is the maximal length of the common prefix [suffix] of the words u and v. A variety that satisfies a permutation identity is called permutative. If V is a permutative variety, then = (V ) [respectively r = r(V )] is the least [respectively r] such that V satisfies a permutation identity τ with (τ) = [respectively r(τ ) = r]. A variety that consists of nil-semigroups is called a nil-variety. If Σ is a set of identities, then varΣ denotes the variety of semigroups defined by Σ . If V is a variety, then L(V ) denotes the lattice of all subvarieties of V . For , r ≥ 0 and n > 1 let B ,r,n denote the set that consists of n! identities of the form t1 · · · t x1x2 · · ·xnz1 · · · zr ≈ t1 · · · t x1πx2π · · ·xnπz1 · · · zr , where π is a permutation on the set {1, . . . , n}. We prove that for each permutative nilvariety V and each ≥ (V ) and r ≥ r(V ) there exists n > 1 such that V is definable by a first-order formula in L(varBl,r,n) if = r or V is definable up to duality in L(varB ,r,n) if = r .


Introduction
A subset A of a lattice L, ∨, ∧ is called definable in L if there exists a first-order formula Φ(x) with one free variablex in the language of lattice operations ∨ and ∧ that defines A in L, that is, Φ(x) is true if and only ifx ∈ A. An element a ∈ L is called definable in L if the set {a} is definable in L.
In [13,22], Tarski and McKenzie raised problems of first-order definability in lattices of varieties of algebras. In a series of papers [5][6][7][8], Ježek solved the most general problems in this area for the lattice L T of all varieties of algebras of any given type T . He proved that each finitely generated and each finitely based variety is definable in L T up to the obvious, syntactically defined automorphisms, and consequently, L T has no other automorphisms. He also proved that the set of all finitely generated varieties, the set of all one-based varieties, and the set of all finitely based varieties are definable in L T .
The results in [5][6][7][8] do not imply that the same would be true for the lattice of subvarieties of a given variety, but they suggest that the same technique could be used in the cases when the variety is defined by linear identities. Recall that an identity u ≈ v is called linear if each variable occurs once in u and once in v.
If Σ is a set of identities, then var Σ denotes the variety defined by Σ. If V is a variety, then L(V) denotes the lattice of all subvarieties of V. Ježek  In [11], Ježek and McKenzie adapting the approach used in [5][6][7][8] proved that several important sets of semigroup varieties such as the sets of all finitely generated, locally finite and finitely based varieties are definable in SEM. Moreover, they proved that each finitely generated and each finitely based locally finite variety is individually definable up to duality (i.e. up to inverting the order of occurrence of letters in defining identities). They conjectured that the local finiteness assumption in the last quoted result may be omitted and that, in consequence, the lattice SEM has no nontrivial automorphisms except duality, but this conjecture still remains unproven.
In [12], Kisielewicz adapting the approach used in [11] proved that many sets and individual varieties are definable in COM. However, he discovered that there exist nontrivial automorphisms of COM. In [2], the first-named author of the present paper completed the study of first-order definability in COM. He obtained complete descriptions of the set of definable varieties and of the group of automorphisms of COM, which turned out to be an uncountable Boolean group.
In [9,10], Ježek obtained definability for some broad classes of varieties in GCOM and conjectured that the lattice GCOM has no nontrivial automorphisms.
It seems that having both the associativity and the commutativity identities in B makes the study of definability in lattices of the form L(var B) much easier than having only associativity (SEM) or only commutativity (GCOM). The commutativity identity xy ≈ yx is the strongest type of a permutation identity, i.e. a linear identity that is non-trivial modulo x(yz) ≈ (xy)z. In [3], the first-named author took the next step up from the case of COM to a more difficult case when the set B contains the associativity identity and some permutation identities.
For the rest of the article we consider only subvarieties of SEM. An identity u ≈ v is called balanced if each variable occurs the same number of times in u and v. If u ≈ v is a balanced identity, then (u ≈ v) [respectively r(u ≈ v)] is the maximal length of the common prefix [suffix] of the words u and v. A variety that satisfies a permutation identity is called permutative. If V is a permutative variety, then = (V) [respectively r = r(V)] is the least [respectively r] such that V satisfies a permutation identity τ with (τ ) = [respectively r(τ ) = r]. For each k ≥ 0, a variety V is called k-permutative if (τ ) ≤ k and r(τ ) ≤ k. (In view of Lemma 11.2 this definition is equivalent to the definition of a k-permutative variety given in [17].) For each k ≥ 0 the set P(k) of all k-permutative varieties forms a sublattice of the lattice of all permutative varieties P. It is easy to see that the lattice P(0) contains COM and for each k ≥ 0 we have that P(k) ⊂ P(k + 1). Since every permutative variety is k-permutative for some k = 0, 1, . . . , c, the lattice P is the union of all the lattices P(k), k = 0, 1, . . . , c.
Let δ : V → V δ denote the duality automorphism of SEM. We say that a lattice L of semigroup varieties is self-dual if L δ = L. If L is a self-dual sublattice of SEM then we say that a variety V ∈ L is semi-definable in L if the set {V, V δ } is definable in L. In [3], the first-named author proved that each 0-permutative variety is semidefinable in P(0) and consequently, the lattice P(0) has no nontrivial automorphisms except δ.
For , r ≥ 0 and n > 1 let B ,r,n denote the set that consists of n! identities of the form t 1 · · · t x 1 x 2 · · · x n z 1 · · · z r ≈ t 1 · · · t x 1π x 2π · · · x nπ z 1 · · · z r , where π is a permutation on the set {1, . . . , n}. It follows from a result of Putcha and Yaqub [16] (see Lemma 11.2) that for each permutative variety V and each pair of numbers ( , r) with ≥ (V) and r ≥ r(V) one can find n > 1 such that V ∈ L(var B ,r,n ). In particular, each 0-permutative variety is contained in L(var B 0,0,n ) for some n > 1. The most difficult part of proving [3,Theorem 10.9] that each 0-permutative variety is semi-definable in P(0) was proving that each 0-permutative variety is semi-definable in L(var B 0,0,n ) for some n big enough.
If u is a word and x is a variable that does not occur in u, then the pair of identities ux ≈ xu ≈ u is usually written as u ≈ 0 and is referred to as a 0-reduced identity. A semigroup [respectively variety] that satisfies a 0-reduced identity is called a nilsemigroup [nil-variety]. It has been observed by many authors that solving a certain problem for nil-varieties in a given class of varieties is often crucial to solving the problem for the whole class. In this article, we prove (Theorem 11.1) that for each permutative nil-variety V and each ≥ (V) and r ≥ r(V) there exists n > 1 such that V is definable in L(var B ,r,n ) if = r or V is semi-definable in L(var B ,r,n ) if = r. A variety that can be defined by 0-reduced identities only is called 0-reduced variety. A nil-variety is called b0-reduced if whenever it satisfies an unbalanced identity u ≈ v, it also satisfies the identity u ≈ 0 (and consequently, v ≈ 0). If m > 0 and d > 0, then C m,d denotes the cyclic monoid a | a m = a m+d . If d > 0, then C 0,d denotes the cyclic group of order d. Note that C 1,1 is the two-element semilattice and C 0,1 is the trivial group.
Let I denote an ideal of SEM that contains var{xy ≈ yx}. It follows from [12] and [25] that for each m ≥ 0 and d > 0 the variety var C m,d is definable in I (see Lemmas 2.2 and 2.3). It has been proved in [25] that the class of all nil-varieties is definable in SEM. The same arguments can be used to show that the class of all nilvarieties in I is definable in I (see Lemma 2.4). By using an idea from [3], a result from [23] and some functions on varieties, we prove (Proposition 4.1) that a nilvariety V is b0-reduced if and only if for each prime d > 1, the variety V ∨ var C 0,d is a cover of the variety V. This implies (Theorem 4.1) that the set of all b0-reduced varieties in I is definable in I. This statement plays a similar role in our article as Theorem 1.11 in [11]. That theorem says that the set of all 0-reduced varieties is definable in SEM.
Let B denote a set of balanced identities that contains a permutation identity. By using an idea from [3, Sect. 9] and a construction from [11] we prove (Proposition 8.2) that a b0-reduced variety V ∈ L(var B) has exactly one cover in the class of all nil-varieties in L(var B) if and only if V = var{u ≈ 0, B} for some word u. This implies (Theorem 8.1) that the set of all varieties of the form var{u ≈ 0, B} is definable in L(var B).
An identity u ≈ v is called regular if each variable that occurs in u also occurs in v and visa versa. In Sect. 5, with each set of regular identities B we associate a quasi-order on the free semigroup by saying that v ≤ B u if and only if var{v ≈ 0, B} |= u ≈ 0. It is easy to see that the set of all varieties of the form var{u ≈ 0, B} ordered under inclusion can be identified with the set F ∞ /⇔ B of equivalence classes of words ordered under ≤ B . We call these equivalence classes word patterns modulo B because the set F ∞ /⇔ x≈x is precisely the ordered set of word patterns considered in [11,Sect. 2].
Based on the proof of [3,Theorem 9.3], we show (Corollaries 6.1 and 6.2) that for each , r ≥ 0 and n > 1 each word pattern is semi-definable in F ∞ /⇔ B ,r,n if = r and is definable in F ∞ /⇔ B ,r,n if = r. Corollaries 6.1, 6.2 and Theorem 8.1 imply (Theorem 9.1) that for each , r ≥ 0 and n > 1, each variety of the form var{u ≈ 0, B ,r,n } is semi-definable in L(var B ,r,n ) if = r and is definable in L(var B ,r,n ) if = r.
In Sect. 10, we consider varieties of the form var{u ≈ v, B ,r,n } where u ≈ v is a regular identity such that the words u and v are either equivalent or incomparable in the order ≤ B ,r,n and their lengths are shorter than n + + r. By translating and generalizing methods used in [2,3,12] we prove (Theorems 10.1 and 10.2) that each variety of this form is semi-definable in L(var B ,r,n ) if = r and definable in L(var B ,r,n ) if = r.
Using Theorems 10.1, 10.2, 11.1 and the result of Volkov [28] (see Lemma 11.4) that each 0-permutative variety is a join of a nil-variety and a variety generated by a cyclic monoid (or group), we reprove [3,Theorem 10.9] that says that each 0-permutative variety is semi-definable in P(0) (see Corollary 11.1). As another consequence of Theorem 11.1 we show (Corollary 11.2) that for each 0 ≤ k ≤ 2, every k-permutative nil-variety is semi-definable in the lattice P(k) of all k-permutative varieties.

Some definable varieties and classes of varieties in I
In this section we consider definability in a sublattice I of SEM that contains var{xy ≈ yx} and also contains L(V) whenever V ∈ I. In particular, I can be L(var B) for some set of balanced identities B, or the lattice of all k-permutative varieties P(k) for some k ≥ 0 or the lattice of all permutative varieties P.
Let ZM denote the variety var{xy ≈ 0} of all semigroups with zero multiplication and SL denote the variety of all semilattices var C 1,1 . Let A denote the set {var C 0,d | d is prime} of all varieties of Abelian groups of prime exponents.
It is well-known (see [1], for example) that the set A ∪ {SL, ZM} is the set of all atoms in COM and that I may contain some of the two additional atoms of SEM, namely LZ = var{xy ≈ x} and RZ = var{xy ≈ y}.
The following lemma is proved in [12, Proposition 3.1].
Lemma 2.1 [12] The set A of all group atoms is definable in COM.
Proposition 1.4 in [25] contains a simple explanation of how to tell apart a variety in A from SL and from ZM in SEM. The same explanation can be used to distinguish each variety in A from SL and from ZM in COM. According to [25,Proposition 1.4], for each prime d > 1 the variety var C 0,d is a proper subvariety of some commutative chain variety. The variety ZM is also a proper subvariety of some commutative chain variety, but SL is not properly contained in any chain variety. Also according to [29], the variety ZM is neutral in SEM (and, therefore, in COM) but the variety var C 0,d is not neutral in COM for any d > 1 [18,19].
The next lemma follows from Propositions 4.1 and 4.2 in [12].

Lemma 2.2
For each m ≥ 0 and d > 0, the variety var C m,d is definable in COM.
Corollary 4.8 in [25] contains an explicit first-order formula that defines the variety var C m,d for each 0 ≤ m ≤ ∞ and 0 < d ≤ ∞ in SEM. The same formula can be used to define var C m,d in COM (see [26]).
It is well known that the variety of all commutative semigroups is definable in I as the minimal variety in I that contains all group atoms. This gives us the following lemma.

Lemma 2.3
The variety of all commutative semigroups and the lattice of all commutative varieties COM are definable in I.
The article [25] contains simple formulas that define many other well-known semigroup varieties and classes of varieties in SEM. The same formulas can be used to define these varieties and classes in I.

Lemma 2.4
If N is the class of all nil-varieties in SEM, then the class I ∩ N of all nil-varieties in I is definable in I.

Proof
Here are the two parts of the defining sentence of Vernikov [25,Theorem 2.2] formulated for I. 1. The variety of all semigroups with zero multiplication ZM is the only neutral atom in I that is a proper subvariety of some chain variety.
2. I ∩ N is the class of all varieties in I that do not contain any atoms of I but ZM. (An explanation of this part can be found in [21] for instance).
The details on this defining sentence can be found in [25].
The next lemma follows from [12,Theorem 4.3] and can be proved exactly like [25,Proposition 1.7].

Lemma 2.6
The variety var{x 1 x 2 · · · x n ≈ 0} is definable in I for each n > 0.
Proof Here is the defining sentence of Vernikov [25, Theorem 3.1] formulated for I: the variety var{x 1 x 2 · · · x n ≈ 0} is the largest nil-variety in I that contains N n but does not contain N n+1 .
According to [25,Proposition 6.2], So, we have the following lemma.

Lemma 2.7
If I contains var B 0,0,n for some n > 1, then the variety var B 0,0,n is definable in I.
Lemma 2.7 generalizes [3, Corollary 8.2] that says that for each n > 1 the variety var B 0,0,n is definable in P(0). If x is a variable and τ is an identity, then d(x, τ ) denotes the difference between the numbers of occurrences of x in two sides of τ . If d(x, τ ) = 0, then variable x is called balanced in τ , otherwise x is called unbalanced.

Functions on varieties and sets of identities
Let m(τ ) denote the least number of times an unbalanced variable occurs in one side of τ and d(τ ) denote the greatest common divisor of d(x, τ ) among all variables x in τ . If τ is a balanced identity, then we set m(τ ) := ∞ and d(τ ) := ∞.  The following lemma can be easily verified.
If x is a variable and u is a word, then occ u (x) denotes the number of occurrences of x in u. If occ u (x) > 0, then we say that the word u contains x. If occ u (x) = 1, then we say that the variable x is linear in u. The set of all variables contained in u is called the content of u (written Cont(u)). Recall that an identity u ≈ v is called regular if Cont(u) = Cont(v), otherwise it is called irregular. If u is a word, then |u| denotes the length of u and | Cont(u)| denotes the number of distinct variables in u. Obviously, | Cont(u)| ≤ |u| and | Cont(u)| = |u| if and only if each variable in Cont(u) is linear.
The next lemma will be used sometimes without a reference.  (iii) Follows from part (i) and Definition 3.2.
Let Σ be a set of balanced identities. If each identity in Σ is trivial, we set (Σ) = r(Σ) = ∞. If Σ contains a non-trivial identity, then (Σ) [respectively r(Σ)] is the least (τ ) [respectively r(τ )] among all identities in Σ. Proof If Σ u ≈ v, then (u ≈ v) ≥ = (Σ) because the set Σ does not contain any identities capable of changing the prefix of u of length . Similarly, r(u ≈ v) ≥ r(Σ).
Recall that a variety that satisfies an identity of the form x t ≈ x t+d is called periodic. The following proposition refines Proposition 1 in [17].
Proof Conditions (i)-(iv) are equivalent by Proposition 1 in [17]. Since Condition (v) obviously implies Condition (iv), it is left to establish the implication (iv) → (v). Let V be a periodic variety and k be the minimal number such that V |= x t ≈ x t+k for some t > 0. By the definition of the function d(V) we have that k is a multiple of Claim V |= x p ≈ x p+c for some p > 0 and some c > 0 such that c is not a multiple of k.
Proof of Claim Since d(V) = d, the variety V satisfies some identity τ such that for some variable x we have that c = d(x, τ ) and c is not a multiple of k. If x is the only variable in τ , then we are done.
Suppose now that the identity τ contains some variables other than x. Let γ = γ (x, y) be the identity obtained from τ by equalizing all variables other than x. If r = d(y, γ ) is a multiple of k, then the identities x t ≈ x t+k and γ imply an identity of the form x p y q ≈ x p+c y q which in turn implies the desired identity.
Suppose now that r = d(y, γ ) is not a multiple of k. If c + r (may be c − r or r − c depending on the situation) is not a multiple of k then we can equalize x and y and obtain the desired identity.
If c + r (or c − r or r − c) is a multiple of k, then we substitute y → yy and denote the resulting identity by δ = δ(x, y). Now we have that d(x, δ) = c, d(y, δ) = 2r and r is not a multiple of k. If we equalize x and y in δ then we obtain the desired identity. The claim is proved. Now the identities x t ≈ x t+k and x p ≈ x p+c imply the identity x t ≈ x t +k+c for t = max(t, p). This identity together with the identity x t ≈ x t+k implies an identity x t ≈ x t +k for some k < k. This contradicts to the minimality of k. Therefore, k = d.

Definability of the set of all b0-reduced varieties in I
Recall that a nil-variety is called b0-reduced if whenever it satisfies an unbalanced identity u ≈ v, it also satisfies the identity u ≈ 0 (and consequently, v ≈ 0).

Lemma 4.1
If V is a b0-reduced variety, then for each prime d > 1, the variety V ∨ var C 0,d is a cover of the variety V.
Since the group C 0,d is commutative, the variety V ∨ var C 0,d satisfies all balanced identities of V. Therefore, the variety V also satisfies all balanced identities of V.
If d(V ) = d, then by Definition 3.1, the variety V contains the cyclic group C 0,d .
If d(V ) = 1, then by Proposition 3.1 we have that V |= x p ≈ x p+1 for some p > 0. Let a ≈ 0 be some 0-reduced identity satisfied by V. Then V ∨ var C 0,d satisfies a ≈ ax d ≈ x d a for some variable x that does not occur in the word a. Since V ⊆ V ∨ var C 0,d , the variety V also satisfies a ≈ ax d ≈ x d a. Now the identities a ≈ ax d ≈ x d a imply a ≈ ax kd ≈ x kd a for some k > 0 such that kd ≥ p. The latter identities together with x p ≈ x p+1 imply a ≈ ax kd ≈ ax kd+1 ≈ ax and similarly, a ≈ xa. Therefore, V |= a ≈ 0. Since the variety V is b0-reduced and V satisfies all balanced and all 0-reduced identities of V, the variety V coincides with V. Therefore, the variety V ∨ var C 0,d is a cover of the variety V.
If V is a variety then Nil(V) denotes the set of all nil-semigroups contained in V. If the variety V satisfies an identity of the form x t ≈ x t+d , then it is easy to verify that Nil(V) is a subvariety of V that can be defined within V by the identity x t ≈ 0. In this case, Nil(V) is, obviously, the greatest nil-subvariety of V.

Corollary 4.1 If a nil-variety
Proof If the variety V is not b0-reduced, then V satisfies some unbalanced identity u ≈ v and does not satisfy the identity u ≈ 0. If d > d(u ≈ v), then var C 0,d does not satisfy the identity u ≈ v. Since the variety V ∨ var C 0,d is periodic, the set N = Nil(V ∨ var C 0,d ) is a subvariety of V ∨ var C 0,d . By Lemma 4.2, the variety V is a proper subvariety of N . Now N , in turn, is a proper subvariety of V ∨ var C 0,d because for d > 1 the cyclic group C 0,d is not a nil-semigroup. Therefore, the variety V ∨ var C 0,d is not a cover of V.  Theorem 4.1 Let I be a sublattice of SEM that contains var{xy ≈ yx} and also contains L(V) whenever V ∈ I. Then the set of all b0-reduced varieties in I is definable in I. In particular, the set of all b0-reduced varieties is definable in SEM and the set of all commutative b0-reduced varieties is definable in COM.

A quasi-order on the free semigroup modulo B
By F ∞ we denote the free semigroup over a countably infinite alphabet, i.e. the semigroup of words under concatenation. If B is a set of regular identities and v and u are words, then we define v ≤ B u if and only if var{v ≈ 0, B} |= u ≈ 0. If the set B contains only trivial identities, then instead of ≤ B we simply write ≤. The relation ≤ on the free semigroup is well-known and can be defined as follows: if u, v ∈ F ∞ , then v ≤ u if and only if u = aΘ(v)b for some possibly empty words a and b and some substitution Θ.
It is easy to see that the relation ≤ B is reflexive and transitive, i.e. it is a quasiorder on the free semigroup F ∞ . If u ≤ B v ≤ B u, then we write u ⇔ B v. If u is a word, then the class of all words equivalent to u modulo ⇔ B is denoted by [u] ⇔ B . Let F ∞ /⇔ B denote the set of all classes [u] ⇔ B ordered by ≤ B . Following [11], the elements of the ordered set F ∞ /⇔ B will be called word patterns modulo B.
It is easy to see that each substitution (i.e. an endomorphism of the free semigroup) is a composition of the following three types of elementary substitutions: If B is a set of identities, then ∼ B denotes the fully invariant congruence on the free semigroup corresponding to B. The next two lemmas establish the connections between the quasi-orders ≤ B and ≤.

Lemma 5.2
If B is a set of regular identities, then the following are equivalent: If v ≤ B u, then there exists a sequence of words u 1 , . . . , u n such that one can derive u ≈ 0 from {v ≈ 0, B} as follows:

Lemma 5.3
If B is a set of balanced identities, then: Since the identities u ≈ u and v ≈ v are balanced, all the words u, u , v and v have the same length. Therefore, u = p(v) for some substitution p that maps variables to variables. Suppose that for some distinct variables x and y with occ v (x) > 0 and occ v (y) > 0 we have that p(x) = p(y) = z. But then In view of Lemma 5.1, this contradicts the fact that u ≤ v . Therefore, the substitution p is a renaming of variables. ( for some possibly empty word ab and a substitution Θ. If the word ab is empty and Θ is a renaming of variables, then by part (i) we have that u ⇔ B v. Since the words v and u are not equivalent modulo ⇔ B , we have that v < u . Now suppose that there is a word u such that u ∼ B u and v < u . Then by So, we may assume that |u| = |v| and consequently |u| = |v| = |u | . Since v < u and |v| = |u | we have that u = Θ(v) for some substitution Θ that maps variables to variables such that Θ is not a renaming of variables. So, u ∼ B Θ(v). If we assume that u ⇔ B v then by part (i) we would have that u ∼ B p(v) for some renaming of variables p. Thus the identity Θ(v) ≈ p(v) would be balanced which is not the case. Therefore, v < B u.
The following lemma is needed only to justify Theorem 6.1 and sometimes will be used without a reference.

Lemma 5.4 If B is a set of balanced identities with (B) > 0, then:
(i) the words x 2 y 1 · · · y k and y 1 · · · y k x 2 are not equivalent modulo ⇔ B for any k > 0; (ii) the words x k y and yx k are not equivalent modulo ⇔ B for any k > 0; (iii) the words y 1 · · · y j x k+2 t 1 · · · t p and y 1 · · · y j +1 x k+1 t 1 · · · t p are not equivalent modulo ⇔ B for any k ≥ 0.
for some renaming of variables p. Since x is the only non-linear variable in both words, this can only happen if B x 2 y 1 · · · y k ≈ y 1 · · · y k x 2 which is impossible in view of Lemma 3.4.
(ii) Similar to the proof of (i).
(iii) If y 1 · · · y j x k+2 t 1 · · · t p ⇔ B y 1 · · · y j +1 x k+1 t 1 · · · t p then by Lemma 5.3(i) we have that y 1 · · · y j x k+2 t 1 · · · t p ∼ B q(y 1 · · · y j +1 x k+1 t 1 · · · t p ) for some renaming of variables q. Since x is the only non-linear variable in both words and occurs different number of times in each of the word, this is impossible in view of Lemma 3.3(iii).
Proof (i) can be justified by a simple argument of McKenzie contained in the proof of Theorem 4.3 in [12].
Therefore, for each word u the class [u] ⇔ xy≈yx is a union of equivalence classes modulo ⇔ B . If B is set of balanced identities and u is a word, then S u,B denotes the set of all classes [v] ⇔ B contained in the class [u] ⇔ xy≈yx .

Lemma 6.2 If B is a set of balanced identities, then for each word
Proof By Lemma 6.1, for each word u there is a first-order formula that defines the pattern [u] ⇔ xy≈yx in the ordered set F ∞ /⇔ xy≈yx . Since for every two words v and If B is a set of regular identities, then the set F ∞ /⇔ B ordered by ≤ B can be identified with the set of all varieties of the form var{u ≈ 0, B} ordered under inclusion.
Proof Part (i) follows from Lemma 6.2 and the fact that for each k > 0, the sets S x k ,B and S x 1 ···x k ,B are singletons.
(ii) The set S x 2 y,B contains at most three varieties, namely var{x 2 y ≈ 0, B}, var{yx 2 ≈ 0, B} and var{xyx ≈ 0, B}. If the variety var{xyx ≈ 0, B} is different from var{yx 2 ≈ 0, B} and var{x 2 y ≈ 0, B}, then it can be told apart from the other two by saying that it does not contain var{x 2 ≈ 0, B}.
The next theorem generalizes [11, Proposition 2.8] and we prove it by repeating the arguments used to prove Theorem 9.3 in [3].
Proof Without loss of generality, we may assume that = (B) > 0. We regard word patterns as varieties of the form var{u ≈ 0, B} ordered under inclusion. In view of Lemma 6.2, we only need to show how to distinguish between the varieties in the set S u,B for each word u.
Claim 1 For each k ≥ 0, the varieties var x 2 y 1 · · · y k ≈ 0, B and var y 1 · · · y k x 2 ≈ 0, B Proof of Claim 1 In view of Lemma 6.3, we may assume that k > 1. Since > 0, the varieties var{x 2 y 1 · · · y k ≈ 0, B} and var{y 1 · · · y k x 2 ≈ 0, B} are different from each other. As in [3], we tell apart the variety var{x 2 y 1 · · · y k ≈ 0, B} from all other varieties in S x 2 y 1 ···y k ,B by saying that it is a cover of the variety var{x 2 y 1 · · · y k−1 ≈ 0, B} but does not contain var{yx 2 ≈ 0, B}. Dually, we tell apart the variety var{y 1 · · · y k x 2 ≈ 0, B} from all other varieties in S x 2 y 1 ···y k ,B by saying that it is a cover of var{y 1 · · · y k−1 x 2 ≈ 0, B} but does not contain var{x 2 y ≈ 0, B}. So, by induction, the varieties var{x 2 y 1 · · · y k ≈ 0, B} and var{y 1 · · · y k x 2 ≈ 0, B} are definable in F ∞ /⇔ B . Claim 1 is proved.
Proof of Claim 2 In view of Lemma 6.3, we may assume that k ≥ 3. As in [3], we tell apart the variety var{x k y ≈ 0, B} from all other varieties in S x k y,B by saying that it contains var{x 2 y 1 · · · y k−1 ≈ 0, B} and var{x k ≈ 0, B} but does not contain var{y 1 · · · y k−1 x 2 ≈ 0, B}. Claim 2 is proved by induction and duality.

Proof of Claim 3
In view of the previous claims, we assume that k ≥ 3 and p ≥ 2. As in [3], we tell apart the variety var{x k y 1 · · · y p ≈ 0, B} from all other varieties in S x k y 1 ···y p ,B by saying that it contains var{x k y 1 · · · y p−1 ≈ 0, B} but does not contain var{yx k ≈ 0, B}. Claim 3 is proved by induction and duality.

Claim 4 For each
Proof of Claim 4 In view of the previous claims, we assume that k ≥ 3, p > 1 and j > 1. As in [3], we tell apart the variety var{y 1 · · · y p x k z 1 · · · z j ≈ 0, B} from all other varieties in S y 1 ···y p x k z 1 ···z j ,B by saying that it contains both var{y 1 · · · y p x k ≈ 0, B} and var{x k z 1 · · · z j ≈ 0, B}. Claim 4 is proved by induction.
Proof of Claim 5 As in [3], we tell apart the variety V j,k,p from all other varieties in S y 1 ···y j xz 1 ···z k xt 1 ···t p ,B by saying that V j,k,p is contained in the variety var{y 1 · · · y j x k+2 t 1 · · · t p ≈ 0, B} but in neither var{y 1 · · · y j +1 x k+1 t 1 · · · t p ≈ 0, B} nor var{y 1 · · · y j x k+1 t 1 · · · t p+1 ≈ 0, B}. Claim 5 is proved by induction. Now let u = x 1 · · · x k be an arbitrary non-linear word. The final argument in [3] is that we can tell apart the variety var{u ≈ 0, B} from all other varieties in S u,B by saying that for each i, If u is a word, then u δ denotes the dual of u, i.e. the word u written backward. The map δ : u → u δ induces the duality map on sets of identities. We say that a set Extending the definition from [11] to arbitrary self-dual sets B of regular identities, we say that a pattern Proof For every word u the arguments used to prove Lemma 6.4 and Theorem 6.1 can be easily translated into a first-order formula Φ u (x,ȳ) that turns into a true statement if and only ifx = For example, Φ x 2 y 1 y 2 (x,ȳ) is the following formula: Here Cov(x,ȳ) is the formula that says thatx is a cover ofȳ and Φ x 2 y (x) is the formula in Lemma 6.3 that defines the set By induction, Φ x 2 y 1 y 2 y 3 (x,ȳ) is the following formula: The defining sentences used in Claims 2-5 can be translated into first-order formulas with two free variables in a similar way. Proof For each word u we denote the pattern [u] ⇔B ,r,n simply by [u]. Without loss of generality, we may assume that < r. In view of Theorem 6.1 we only need to prove that the word pattern [yx 2 ] is definable in F ∞ /⇔ B ,r,n .
To simplify the notation, we define some abbreviations for the elements [u] ∈ S m = S x 2 y 1 y 2 ···y m ,B ,r,n when m ≥ + n + r − 2. If there are i < letters before the first occurrence of x in u and j < letters before the second occurrence of x, then we denote [u] = L i L j . If there are i < letters before the first occurrence of x in u, at least letters before and at least r letters after the second occurrence of x, then we denote [u] = L i M. If there are i < letters before the first occurrence of x in u and j < r letters after the second occurrence of x, then we denote [u] = L i R j . If there are at least letters before the first occurrence of x in u and at least r letters after the second occurrence of x, then we denote [u] = MM. If there are at least letters before, at least r letters after the first occurrence of x and i < r letters after the second occurrence of x in u, then we denote [u] = MR j . If there are i < r letters after the first occurrence of x in u and j < r letters after the second occurrence of x, Observe that if m ≥ + n + r − 2, then the number of patterns in the set S m does not depends on m and is equal to ( − 1)/2 + r(r − 1)/2 + ( + 1)(r + 1). If r = 1 then for each m ≥ l + n + r − 2 the set S m has only two patterns MM and MR 0 . If = 0 and r > 1, then there are three types of word patterns in S m , namely MM, MR j and R i R j . If = 1, then there are five types of patterns in S m , namely L i M, L i R j , MM, MR j , and R i R j . If > 1, then there are six types of elements in S m , namely L i L j , L i M, L i R j , MM, MR j , and R i R j .
For k = + n + r − 2 we consider a graph G whose vertices are the word patterns that belong to S k .
This word pattern is R 1 R 0 ∈ S k−1 . But since r ≥ 2 and + n > 2, for MR 0 , there are at least two distinct patterns in S k−1 with this property: the one that ends with xyx and the one that ends with xyzx. Therefore, Proof If one of the conditions (i) or (ii) holds, then clearly, var If we cannot derive the identity u ≈ v from R, then we also need to use some identities from A. Let u i be the first place in this derivation where we use some identity Following [11], with each pair of possibly equal words a and b with Cont(a) = Cont(b) we associate two semigroup varieties: Cont(a)) .
Here P (Cont(a)) is the group of all permutations of Cont(a).
Since all identities in set C ∪ B are regular, we must use some identity from set A in this derivation. Therefore, this derivation contains a word V k such that V k > a or V k > b. Let 1 < k < n be the least number with this property and suppose that V k > a. So, we can consider another derivation of a ≈ 0: This new derivation has a property that for each i = 1, 2, . . . , k − 1 the word V i is neither greater than a nor greater than b. This means that either only identities from C are used in this derivation or a ∼ B V k . Let j be the maximal number such that we apply an identity from C to V j or j = 1. Then V j = p(c) for some c ∈ {a, b} and some renaming of variables p. Since V j ∼ B V k we have that p(c) ∼ B V k . Then by Lemma 5.3 we have that V k ⇔ B c. If c = a then we obtain a contradiction with the fact that V k > a. If c = b = a then we obtain a contradiction with the fact that a and b are incomparable modulo B in the order ≤ B . Thus, the variety V + a,b ∧ var B does not satisfy a ≈ 0. Similarly, one can show that the variety V + a,b ∧ var B does not satisfy b ≈ 0. (ii) If U > B a, then by Lemma 5.3 one can find a word W such that U ∼ B W and W > a. Therefore, If U i is the first place in this derivation where we use some identity τ / ∈ B, then two cases are possible: Case 1: τ is u ≈ 0 where u > c for some c ∈ {a, b}. Then U i ≥ u > c and by Lemma 5.3 we have that V > B c.
Case 2: τ is a ≈ p(b) for some permutation p of Cont(a) = Cont(b). Then U i = AΘ(a)B for some word AB and substitution Θ. If the word AB is empty and Θ is a renaming of variables, then U i = Θ(a). But then V + a,b ∧ var B |= Θ(a) ≈ 0 which contradicts part (i). So, we can assume that the word AB is not empty or Θ is not a renaming of variables, whence U i > a. Then by Lemma 5.3 we have that V > B a.
. This case is similar to Case 2 and the conclusion is that V > B b.
Proof (i) If a contains more than two variables, then the set {a ≈ p(a) | p ∈ P (Cont(a))} contains a non-trivial identity that cannot be derived from {v ≈ 0 | v > a}.
(ii) The first inclusion is strict because the variety V + a,b ∧ var B does not satisfy a ≈ 0 by Lemma 7.2. The last inclusion is strict because the variety V − a,b ∧ var B is periodic.
If B is a set of identities, then an identity τ is called non-trivial modulo B if τ does not follow from B. If B contains only balanced identities we consider two types of identities u ≈ v.
Type 1: u ∼ B p(c) for some c ∈ {a, b} and some permutation p of Cont(a) and v ∼ B q(c) for some d ∈ {a, b} and some permutation q of Cont(a).
Then by Lemma 7.1, u ≥ B u and v ≥ B v where u > c for some c ∈ {a, b} and v > d for some d ∈ {a, b}. Thus, by Lemma 5.3 we have that u > B c and v > B d. Therefore, the identity u ≈ v is of Type 2.
(ii) Let u ≈ v be a non-trivial modulo B identity of V ⊇ V + a,b ∧ var B. If u or v is incomparable neither with a nor with b modulo B, then u ≈ v is trivial modulo B. If u > B c for some c ∈ {a, b}, then by Lemma 7.2 we have that v > B d for some d ∈ {a, b}. In this case the identity u ≈ v is of Type 2. If the identity u ≈ v is irregular, then say, v contains some variable x but u does not. If we replace x by a, then we obtain an identity u ≈ w such that w > a. Then in view of Lemma 7.2, we have that u > B a. This takes us to the previous case. If the identity u ≈ v is regular and u ⇔ B v, then the identity u ≈ v is of Type 1 by Lemma 5.3. Proof If V + a,b ∧ var B |= τ , then by Lemma 7.4 the identity τ has either Type 1 or Type 2. If τ is of Type 1, then τ follows from {p(a) ≈ q(b) | p, q ∈ P (Cont(a))}. If u ≈ v is of Type 2, then by Lemma 5.3 we have that u ∼ B u and u > c. So,

Lemma 7.6 Let B be a set of balanced identities and let a and b be two words with
Cont(a) = Cont(b) that are either equal or incomparable modulo B in the order ≤ B . Then the variety V + a,b ∧ var B is a cover of the variety var{a ≈ 0, b ≈ 0, B}. In particular, the variety V + a is a cover of the variety var{a ≈ 0}.
Since the variety V contains var{a ≈ 0, b ≈ 0, B}, Lemma 7.1 implies that u ≥ B c for some c ∈ {a, b} and v ≥ B d for some d ∈ {a, b}. In view of Lemma 7.5, two essentially different cases are possible.
Case 1: u > B c for some c ∈ {a, b} and v ∼ B p(a) for some renaming of vari- Case 2: u ∼ B p(a) for some renaming of variables p and v ∼ B q(c) for some c ∈ {a, b} and some renaming of variables q such that the identity u ≈ v is irregular. Without loss of generality, V satisfies p(a) ≈ v such that v contains some letter x that does not occur in p(a). If we replace x by a, we obtain an identity The next technical lemma is needed only to justify Corollary 7.1.

Lemma 7.7 Let B be a set of balanced identities and let a and b be two words with
Since the variety V contains var{a ≈ 0, b ≈ 0, B}, Lemma 7.1 implies that u ≥ B c for some c ∈ {a, b} and v ≥ B d for some d ∈ {a, b}. In view of Lemma 7.5, two essentially different cases are possible.
Case 1: u > B c for some c ∈ {a, b} and v ∼ B p(a) for some renaming of variables p. By Lemma 5.3 one can find a word w such that u ∼ B w and w > c. Therefore, V |= w ≈ p(a). Since w > c and V ⊆ V − a,b ∧ var B we have that V |= w ≈ 0. So, the variety V satisfies the identity p(a) ≈ 0 and consequently a ≈ 0.
Case 2: u ∼ B p(a) for some renaming of variables p and v ∼ B q(c) for some c ∈ {a, b} and some renaming of variables q such that the identity u ≈ v is irregular. Without loss of generality, V satisfies p(a) ≈ v such that v contains some letter x that does not occur in p(a). If we replace x by a, we obtain an identity p(a) ≈ v such that v > a. Since v > a and V ⊆ V − a,b ∧ var B, we have that V |= v ≈ 0. So, the variety V satisfies the identity p(a) ≈ 0 and consequently a ≈ 0.
If we consider cases symmetric to Case 1 and Case 2, then we obtain that V |= b ≈ 0.
The next lemma follows from Lemma 1.3(iii) in [27].  can find a word w such that u ∼ B w and w > a. Therefore, V |= w ≈ p(a). Since w > a we have that w > p(a). Since V is a permutative nil-variety, by Lemma 7.8, the variety V satisfies the identity p(a) ≈ 0 and consequently a ≈ 0.
Case 2: u ∼ B p(a) and v ∼ B q(a) for some renamings of variables p and q such that the identity u ≈ v is irregular. Without loss of generality, V satisfies p(a) ≈ v such that v contains some letter x that does not occur in p(a). If we replace x by p(a), we obtain an identity p(a) ≈ v such that v > p(a). Since V is a permutative nilvariety, by Lemma 7.8, the variety V satisfies the identity p(a) ≈ 0 and consequently a ≈ 0.

Corollary 7.2 Let B be a set of balanced identities that contains a permutation identity and let a be a word. Then the variety V +
a ∧ var B is the only cover of the variety var{a ≈ 0, B} in the lattice L(var B) ∩ N.

The set of varieties of the form var{u ≈ 0, B} is definable in L(varB)
If A is a set of 0-reduced identities and B is a set of regular identities, then we say that A is reduced modulo B if every two words a and b with {a ≈ 0, b ≈ 0} ⊆ A are incomparable in the order ≤ B . (ii) → (iii). Let us show that one can find A ⊆ A such that A is reduced modulo B and var(A ∪ B) = var(A ∪ B). The following argument is a modification of the argument of Martynova [14]. For each n > 0, let A n denote the set of all identities u ≈ 0 in A such that |u| ≤ n. Since for each n > 0 the set A n is finite, we can reduce A n modulo B to A n by throwing away extra identities of length n. Since set B contains only balanced identities, no derivation of any 0-reduced identity a ≈ 0 uses any 0-reduced identity b ≈ 0 with |b| > |a|. So, the set A = n>0 A n is reduced modulo B. Evidently, var(A ∪ B) = var(A ∪ B).
(iii) → (iv) follows from Proposition 4.1 in [20] that says that each set of balanced and 0-reduced identities is equivalent to its irreducible subset.
(ii) → (i). Let u ≈ v be an unbalanced identity of V. Consider a derivation of u ≈ v from A ∪ B: In view of Lemma 3.3(iii) we cannot derive u ≈ v only from B. Let u i be the first place in this derivation where we use some identity in A. Then V |= u ≈ u i ≈ 0. Therefore, the variety V is b0-reduced.
Recall that a variety that can be defined by 0-reduced identities only is called a 0-reduced variety. Obviously, each 0-reduced variety is also a b0-reduced variety. By a result of Ježek [4], there are 0-reduced varieties with infinite irredundant identity bases. In contrast, Proposition 8.1 and a result by Perkins [15] imply the following.  [15], every variety in L(var B) ∩ N is finitely based. Therefore, there are no infinite descending chains between V 1 and V = var(A ∪ B) or between V 2 and V. Thus, V has both a cover contained in V 1 and a cover contained in V 2 ; these two covers cannot coincide since V 1 ∧ V 2 = V. We conclude that V must have at least two covers in L(var B) ∩ N. Proof (i) The variety V + a ∧ var(B ∪ C) is a cover of var{a ≈ 0, B ∪ C} by Lemma 7.6. Therefore, var{a ≈ 0, B ∪ C} = var{a ≈ 0, B} ∧ V + a ∧ var(B ∪ C). The variety V + a ∧ var(B ∪ C) is not contained in var{a ≈ 0, B} because it does not satisfy a ≈ 0.

Lemma 8.2 Let B be a set of balanced identities and let A be a set of 0-reduced identities that is reduced modulo B and contains at least two identities. Then
(ii) Using a similar argument as in Lemma 8.2(ii), one can show that there is a cover of var{a ≈ 0, B ∪ C} under var{a ≈ 0, B} as well as a cover under V + a ∧ var(B ∪ C), and these two covers cannot coincide. To avoid a contradiction, we must assume that A contains exactly one identity, i.e. V = var{u ≈ 0, B ∪ C} for some word u. If the set C contains some identity that does not follow from B ∪ {a ≈ 0}, then by Lemma 8.3, the variety V must have at least two covers in L(var B) ∩ N. We conclude that V = var{u ≈ 0, B}.

Some definable and semi-definable varieties and sets of varieties in L(varB)
If B is a set of balanced identities, then a b0-reduced variety V ∈ L(var B) is called B-0-reduced if every balanced identity of V follows from B. Since every balanced identity follows from xy ≈ yx, the set of all {xy ≈ yx}-0-reduced varieties coincides with the set of all commutative b0-reduced varieties. The set of all {x ≈ x}-0-reduced varieties obviously coincides with the set of all 0-reduced varieties.
It is proved in [11] and reproved in [24,29] that the set of all 0-reduced varieties is definable in SEM. Corollary 2.12 in [24] (reproduced as [25, Theorem 2.3]) and Proposition 2.2 in [18] define the set of all 0-reduced varieties and the set of all commutative b0-reduced varieties as follows.  The following definition is essentially the definition of semi-definability in [11] extended to arbitrary self-dual sets of regular identities. Definition 9.1 Let B be a self-dual set of regular identities and V ∈ L(var B). We say that V is definable in L(var B) up to var{x 2 y ≈ 0, B} if there exists a first-order formula Φ V (x,ȳ) that turns into a true statement on L(var B) if and only ifx = V andȳ = var{x 2 y ≈ 0, B}, or elsex = V δ andȳ = var{yx 2 ≈ 0, B}. Proof Let Φ u (x,ȳ) and Φ v (x,ȳ) be the formulas that define the varieties V and U in L(var B) up to var{x 2 y ≈ 0, B}. Then the formula

turns into a true statement on L(var B) if and only ifx
For the rest of this article we focus on definability in L(var B), where B = B ,r,n for some , r ≥ 0 and n ≥ 2. But each result on definability in this section and in the next section holds true for an arbitrary set of balanced identities B that satisfies the following conditions: (i) B contains a permutation identity.
(ii) Each word pattern modulo B is definable (or semi-definable) in F ∞ /⇔ B . In particular, in view of Corollary 6.1, each statement on definability up to var{x 2 y ≈ 0, B} in Sects. 9 and 10 holds true if B is an arbitrary self-dual set of balanced identities with (B) = r(B) > 0 that contains a permutation identity. Proof (i) First, we assume that V = var{u ≈ 0, B} for some word u. By Corollaries 6.1 and 8.1 the variety V is definable in L(var B) up to var{x 2 y ≈ 0, B}. Now if V is an arbitrary B-0-reduced variety, then by Lemma 8.1, we have that V = var(A∪B) for some finite set of 0-reduced identities A. The rest follows from Lemma 9.2.
(ii) follows from Corollaries 6.2, 8.1 and Lemma 8.1 in a similar manner.
Theorem 9.1 implies the following partial answer to Question 9.1. Proof If V ⊆ var{x m ≈ 0, B}, then V = var(A ∪ B) for some set of 0-reduced identities A. In view of Proposition 8.1 we may assume that the set A is reduced modulo B. By the result of Perkins [15], the number of identities in A is bounded by a computable function of , r, n and m.  Sub(B, a, b).
The following theorem is a translation of Theorems 5.1 and 5.4 in [12].  Sub(B, a, b), , by Lemma 7.4 the variety V 2 satisfies only identities of Type 2. Since V = V 1 ∧ V 2 and no identity of Type 1 can be derived from the identities of Type 2 and B, the variety V 1 must satisfy all identities of Type 1 that are satisfied by V, i.e. V 1 ⊆ V. Therefore, V 1 = V. Now we assume that a variety V satisfies this formula. Since V ⊇ V + a,b ∧ var B, by Lemma 7.4 the variety V satisfies only identities of Types 1 and 2. So, we have that where T 1 is a finite set of identities of Type 1 and T 2 is a finite set of identities of Type 2.
Since the variety var B does not satisfy the rest of the formula, we conclude that the set T 1 ∪ T 2 is not empty. Since for non-empty T 2 the variety var(B ∪ T 2 ) does not satisfy the rest of the formula, we conclude that the set T 1 is not empty. Now the goal is to show that set T 2 is empty. If set T 2 is not-empty, then V = var(B ∪ T 1 ) ∧ var(B ∪ T 2 ) and the variety V does not satisfy the rest of the formula for V 1 = var(B ∪ T 1 ) and V 2 = var(B ∪ T 2 ). To avoid the contradiction, we must assume that the set T 2 is empty. Therefore, V = var(B ∪ T 1 ) ∈ Sub(B, a, b).
The rest follows from Corollary 9.2. Proof Since |u| < |B|, the lattice Sub(B, u) is anti-isomorphic to the lattice of all subgroups of the symmetric group S k . We use the fact that, for every k > 1, each subgroup of S k , which is not cyclic of prime power order, has at least two incomparable subgroups. Therefore the set Sub pp (B, u) is defined in Sub(B, u) as the set of all varieties V ∈ Sub(B, u) such that there are no varieties V 1 and V 2 in Sub(B, u) satisfying V ≤ V 1 ∧ V 2 and neither V 1 ⊆ V 2 nor V 2 ⊆ V 1 . The rest follows from Theorem 9.2.
Recall (see Sect. 5) that there are two types of elementary substitutions that rename variables and we agreed to use the term renaming of variables to refer to a one-toone renaming of variables. If x and y are two distinct variables then E x=y denotes the elementary substitution that renames y by x and is identical on all other variables.   (p m (u)) for some m > 0. If E s=t (p (u)) ≈ W follows from u ≈ p(u) in one step, then without any loss we can assume that E s=t (p (u)) = Θ(u) and W = Θ(p(u)). Since |E s=t (p (u))| = |u|, the substitution Θ is a composition of some length-preserving elementary substitutions. Without any loss, we have that Θ = E s=t q for some renaming of variables q invariant on Cont(u). Therefore, we have that E s=t (p (u)) = E s=t q(u) and, consequently, p = q. So, W = p +1 (u) is of the required form.
(ii) Clearly, for any > 0 and m > 0 the words E s=t (p (u)) and E s=t (p m (u)) have the same content. Suppose that E s=t (p (u)) ≤ B E s=t (p m (u)). Since |E s=t (p l (u))| = |E s=t (p m (u))| < |B|, this can only happen if E s=t (p m (u)) = Θ(E s=t (p (u))) where Θ is a composition of renamings and equalizings of variables. But since Cont(E s=t (p (u))) = Cont(E s=t (p(u))), the substitution Θ can only be a renaming of variables. Thus, the words E s=t (p (u)) and E s=t (p m (u)) are either equivalent or incomparable in the order ≤ B . (i) E s=t (q(u)) = p(E x=y (u)); (ii) q = p, p(y) = t and p(x) = s.
Proof (i) → (ii). Both words E s=t (q(u)) and p(E x=y (u)) are obtained from u by renaming variables in u. Since the word E s=t (p(u)) does not contain t and the word p(E x=y (u)) does not contain p(y), we must have that p(y) = t. The variables x and y are the only variables in u that receive that same name p(x) in p(E x=y (u)). Since E s=t (q(u)) = p(E x=y (u)), the same variables are identified (as s) in E s=t (q(u)). Therefore p(x) = s.
If a variable z is different from y, then q(z) stands in the same positions in E s=t (q(u)) as z does in u. Since the variable p(z) stands in the same positions in p(E x=y (u)) as z does in u, we have that q(z) = p(z). Since both renamings p and q are one-to one and invariant on Cont(u), we also have that q(y) = p(y) = t. Since the renamings p and q coincide on all variables in Cont(u), we have that q = p.
Let B be a set of balanced identities, u a word, and p a permutation of Cont(u) of prime power order. Then for each distinct x, y ∈ Cont(u) we define set V (B, u, p, x, y) as the set of all varieties var{u ≈ q(u), B} ∈ Sub pp (B, u) such that q (x) = p(x) and q (y) = p(y) for some > 0. Obviously, var{u ≈ p(u), B} ∈ V (B, u, p, x, y) ⊆ Sub pp (B, u).

Lemma 10.4
Let B = B ,r,n for some , r ≥ 0 and n > 1, let u be a word such that |u| < |B| and let p be a permutation of Cont(u) of a prime power order. If = r [respectively = r], then for each distinct x, y ∈ Cont(u) the set V (B, u, p, x, y) is definable up to var{x 2 y ≈ 0, B} [respectively definable] in L(var B) as the set of all varieties V ∈ Sub pp (B, u) such that V is contained in some variety that belongs to the set Sub(B, E s=t (u), E s=t (p(u))) where s = p(x) and t = p(y).
Proof Suppose that V = var{u = q(u), B} ∈ Sub pp (B, u) such that q (x) = p(x) and q (y) = p(y) for some > 0. Since V |= v ≈ q (v), the variety V also satisfies E s=t (u) ≈ E s=t (q (u)) for s = p(x) and t = p(y).
Therefore, in view of Lemma 10.3, the variety V satisfies So, V is contained in a variety that lies in the set Sub(B, E s=t (v), E s=t (p(u))).
is contained in some variety that belongs to the set Sub(B, E s=t (v), E s=t (p(u))) where s = p(x) and t = p(y), then V satisfies the identity E s=t (u) ≈ τ (E s=t (p(u))) for some renaming of variables τ invariant on Cont(u) \ t. Then by Lemmas 10.2 and 10.3 we have that τ (E s=t (p(u))) = τp(E x=y (u)) = E s=t (q (u)) for some > 0. Now by Lemma 10.3 we have that q = τp, q (x) = s and q (y) = t. Therefore, V belongs to the set V (B, u, p, x, y).
The rest follows from Theorem 9.2 and Lemmas 10.1 and 10.2.
If B is a set of balanced identities, u is a word and p is a permutation, then we denote V p = var{u ≈ p(u), B}. If V p ∈ Sub pp (B, u), then Sub pp (V p ) denotes the set of all varieties V q ∈ Sub pp (B, u) that satisfy the following condition: Obviously, for each x = y we have that V p ∈ Sub pp (V p ) ⊆ V (B, u, p, x, y) ⊆ Sub pp (B, u). Proof Suppose that V τ ∈ Sub pp (V p ). Take x = y ∈ Cont(u) and some permutation q such that q(x) = s and q(y) = t.
If V τ ∈ V (B, u, q, x, y), then for some > 0 we have that τ (x, y) = (s, t). Since V τ ∈ Sub pp (V p ), one can find an m such that p m (x, y) = (s, t). Therefore, V p ∈ V (B, u, q, x, y). V (B, u, q, x, y), then for some > 0 we have that p (x, y) = (s, t). Since V τ ∈ Sub pp (V p ), one can find an m such that τ m (x, y) = (s, t). Therefore, V τ ∈ V (B, u, q, x, y). Now suppose that variety V τ ∈ Sub pp (B, u) satisfies Condition ( * * ). In order to prove that V τ ∈ Sub pp (V p ) we take x = y and s = t.
If one can find an > 0 such that p (x, y) = (s, t), then V p ∈ V (B, u, p , x, y) and by Condition ( * * ) we have that V τ ∈ V (B, u, p , x, y). Therefore, one can find an m > 0 such that τ m (x, y) = (s, t).
Conversely, if one can find an m > 0 such that τ m (x, y) = (s, t), then V τ m ∈ V (B, u, τ m , x, y) and by Condition ( * * ) we have that V p ∈ V (B, u, τ m , x, y). Therefore, one can find an > 0 such that p (x, y) = (s, t).
The rest follows from Lemma 10.4. Assume that | Cont(u)| = k > 1. Let Sub pp denote the set of all cyclic subgroups of S k of prime power orders. Then the variety V p corresponds to the cyclic subgroup p ∈ Sub pp . Instead of the set Sub pp (V p ) we consider the corresponding set P (p) that consists of all permutations q ∈ Sub pp that satisfy the following condition: ( †) for each i = j and s = t, there exists an > 0 such that p (i, j ) = (s, t) if and only if one can find an m > 0 such that q m (i, j ) = (s, t).
The task of proving that the variety V p is the only variety in the set Sub pp (V p ) is equivalent to the task of proving that P (p) = p . In each of the following lemmas we narrow the set of possible members of P (p).
Let Z 1 , . . . , Z be the orbits of the fixed permutation p.

Lemma 10.6
If q ⊂ P (p), then the orbits of q are exactly Z 1 , . . . , Z .
Proof If the orbits of q are not the same as the orbits of p, then there are i = s that belong to the same orbit of p but do not belong to the same orbit of q (or visa versa). This means that p r (i) = s for some r but there is no m > 0 such that q m (i) = s. Therefore, Condition ( †) is violated.
The next restriction concerns the cyclic structure of the permutation q. Let c 1 · · · c be the cyclic decomposition of our fixed permutation p, where c i is a cyclic permutation of Z i .
Now, it follows from Lemma 10.9 that P (p) = p and Theorem 10.1 is proved for the case when the order of p is a prime power. Otherwise, the order of permutation p is n 1 n 2 · · · n k where for each 1 ≤ i ≤ k the number n i is a prime power. In this case the variety V p = var{u ≈ p(u), B} is definable up to var{x 2 y ≈ 0, B} [respectively definable] in L(var B) by the formula V p = V n 1 ∩ · · · ∩ V n k and Lemma 9.2. This completes the proof of Theorem 10.1. Proof If a variety satisfies both u ≈ v and v ≈ q(v), then, obviously, it satisfies u ≈ q(u). Hence, the variety V = var{u ≈ v, B} satisfies the proposed formula.
Assume that V = var{v ≈ p(u), B} for some permutation p of Cont(u) and for every transposition q of Cont(v) the variety var{u ≈ q(u), B} contains the variety V ∧ var{v ≈ q(v), B}. We have to show that p is the identity permutation. Suppose, to the contrary, that p(x) = y for some x = y. Let z ∈ Cont(v)\{x, y} and take q = T x,z . Denote V 1 = V ∧ var{v ≈ T x,z (v), B} = var{v ≈ p(u), v ≈ T x,z (v), B}. Since the words u and v are shorter than |B| and incomparable in the order ≤ B , we have that [v] V 1 = {v, p(u), T x,z (v), T x,z p(u)}. By the assumption, V 1 ⊆ [u ≈ T x,z (u), B. Therefore, V 1 satisfies the identity u ≈ T x,z (u) and also the identity p(u) ≈ pT x,z (u).
Since the words u and v are incomparable in the order ≤ B , the word pT x,z (u) must coincide with either p(u) or T x,z p(u). If pT x,z (u) = p(u) then p(x) = p(z), which contradicts the fact that p is a permutation. If pT x,z (u) = T x,z p(u), then p(u) = T x,z pT x,z (u). But then T x,z pT x,z (z) = p(x) = y = p(z), a contradiction. Therefore, p is the identity permutation. Since z / ∈ {x, y}, we have | Cont(uz)| = | Cont(vz)| = 3. Since the words u and v are incomparable in the order ≤ B , the words uz and vz are also incomparable. Hence, by Lemma 10.11, the variety var{uz ≈ vz, B} is semi-definable in L(var B). Moreover, uz ≈ vz is, obviously, a consequence of u ≈ v, and is not a consequence of u ≈ T x,y (v). Therefore, V ⊂ var{uz ≈ vz, B} and var{u ≈ T x,y (v), B} ⊂ var{uz ≈ vz, B}. Thus, both V and var{u ≈ T x,y (v), B} are definable up to var{x 2 y ≈ 0, B} [respectively definable] in L(var B).

Definability of permutative nil-varieties in L(varB ,r,n )
It is easy to see that every identity u ≈ v falls into one of the following four categories.
Case 1: u ≈ v is irregular. Case 2: u ≈ v is regular and u < v. Case 3: v = p(u) for some permutation p of Cont(u). Case 4: u ≈ v is regular and u and v are incomparable in the order ≤. An identity as in Case 3 is called substitutive and an identity as in Case 4 is called parallel. Lemma 11.1 Let B be a self-dual set of regular identities and V ∈ L(var B). If the variety V is definable in L(var B) up to var{x 2 y ≈ 0, B}, then V is semi-definable in L(var B).
Proof Let Φ V (x,ȳ) be a first-order formula in two free variables that turns into a true statement on L(var B) if and only ifx = V andȳ = var{x 2 y ≈ 0, B}, or elsē x = V δ andȳ = var{yx 2 ≈ 0, B}. Then formula ∃ȳΦ V (x,ȳ) defines the set {V, V δ } in L(var B).
Proof (ii) Without loss of generality, we may assume that the identities τ 1 and τ 2 are written in different variables. Since (τ 1 ) = , we have that t 1 t 2 · · · t u ≈ t 1 t 2 · · · t u such that the words u and u begin with different variables. Since r(τ 1 ) = r, we have that vz 1 z 2 · · · z r ≈ v z 1 z 2 · · · z r such that the words v and v end with different variables. These two identities imply the identity t 1 t 2 · · · t uvz 1 z 2 · · · z r ≈ t 1 t 2 · · · t u v z 1 z 2 · · · z r .
By the result of Putcha and Yaqub (part (i)) the identity uv ≈ u v implies all identities in B 0,0,n for some n > 1. Therefore, by using the identity (1) we can derive all identities in B ,r,n . (iii) Follows immediately from part (ii) and the definition of the functions = (V) and r = r(V). Theorem 11.1 For each permutative nil-variety V and each ≥ (V) and r ≥ r(V) there exists n > 1 such that V is definable in L(var B ,r,n ) if = r or V is semidefinable in L(var B ,r,n ) if = r.
Proof If V is a permutative nil-variety, then by a result of Perkins [15], we have that V = var Σ for some finite set of identities Σ . Let n be bigger than the lengths of all identities in Σ . By Lemma 11.2, for each ≥ (V) and r ≥ r(V) we have that V |= B ,r,n . Therefore, we may assume that Σ contains the set of identities B ,r,n . Obviously, in a nil-variety, every irregular identity u ≈ v is equivalent to the pair of identities u ≈ 0 and v ≈ 0. By Lemma 7.8, every identity u ≈ v as in Case 2 is also equivalent to u ≈ 0 and v ≈ 0. Therefore, we may assume that in addition to B ,r,n the set Σ also contains only 0-reduced identities, substitutive identities and parallel identities. Theorems 9.1, 10.1 and 10.2 and Lemmas 9.2 and 11.1 imply that V is definable in L(var B ,r,n ) if = r and semi-definable in L(var B ,r,n ) if = r. Lemma 11.3 If u ≈ v is a regular identity such that u < v then |u| < |v|.
Proof Since u ≤ v, we have that v = aΘ(u)b for some possibly empty words a and b and some substitution Θ. If one of the words a or b is not empty or the value of Θ on one of the variables is not a one-letter word, then the word v is longer than u. So, we may assume that both words a and b are empty and that substitution Θ maps the variables to one-letter words. Since the identity u ≈ v is regular, the substitution Θ maps the variables in u to some variables in Cont(u) = Cont(v). If any two variables are identified, then the identity u ≈ v is irregular. The remaining case is that u = p(v) for some permutation p of Cont(u) = Cont(v) which contradicts the fact that u < v.
The next lemma follows from Lemma 2 and the proof of Proposition 1 in [28].
Here are the arguments of Vernikov that show that the set {LZ(2), RZ(2)} is definable in I.
So, the variety var{tx ≈ ty} = LZ ∨ ZM is semi-definable in I. Now the variety LZ(2) = var{t 1 t 2 ≈ t 1 t 2 x} is the only cover of the variety var{tx ≈ ty} with the following properties.
1. LZ (2) does not contain any atoms of I but LZ and ZM.

Lemma 11.6
For each k ≥ 0, n > 1 and each , r with 0 ≤ , r ≤ min(k, 2) the set {var B ,r,n , var B r, ,n } is definable in the lattice P(k) of all k-permutative varieties.
Proof In view of Lemma 2.7 we may assume that k > 0. It is easy to check that var B ,r,n = var B 0,0,n+l+r ∨ LZ( ) ∨ RZ(r). In view of Lemmas 2.7 and 11.5, the set {var B ,r,n , var B r, ,n } is definable in P(k).
The difficulty of extending Lemma 11.6 to arbitrary , r with 0 ≤ , r ≤ k lies in extending Lemma 11.5 to k > 2.
Theorem 11.1 and Lemma 11.6 imply the following.