A proof of Zhil'tsov's theorem on decidability of equational theory of epigroups

Epigroups are semigroups equipped with an additional unary operation called pseudoinversion. Each finite semigroup can be considered as epigroup. We prove the following theorem announced by Zhil'tsov in 2000: the equational theory of the class of all epigroups coincides with the equational theory of the class of all finite epigroups and is decidable. We show that the theory is not finitely based but provide a transparent infinite basis for it.


Introduction
A semigroup S is called an epigroup if, for every element x ∈ S, some power of x belongs to a subgroup of S. The class of all epigroups includes all periodic semigroups (i.e., semigroups in which each element has an idempotent power), all completely regular semigroups (i.e., unions of groups), and many other important classes of semigroups.See Shevrin (1994a,b) and the survey Shevrin (2005) for more examples and an introduction to the structure theory of epigroups.
It is known that, for every element x of an epigroup S, there exists a unique maximal subgroup G x that contains all but finitely many powers of x.Let e x stand for the identity element of G x .Then it is known that xe x = e x x and that the product belongs to G x .The latter fact allows one to consider the inverse of xe x in the group G x ; we denote this inverse by x.This defines the unary operation x → x on each epigroup; we call this operation pseudoinversion.Thus, epigroups can be treated as unary semigroups, that is, as algebras with two operations: multiplication and pseudoinversion, and we shall adopt this meaning of the term 'epigroup' throughout.Let E stand for the class of all epigroups.
A systematic study of epigroups as unary semigroups was initiated by Lev Shevrin in Shevrin (1994aShevrin ( ,b, 2005)).In particular, Shevrin suggested to investigate the collection of all unary semigroup identities holding in all epigroups, that is, the equational theory of E as a class of unary semigroups (i) .The most fundamental questions about this theory are whether or not it is decidable and whether or not it is finitely axiomatizable.
Yet another motivation for studying unary identities of epigroups comes from the theory of finite semigroups.Every finite semigroup can be treated as an epigroup, and the unary operation of pseudoinversion is an implicit operation in the sense of Jan Reiterman Reiterman (1982), that is, it commutes with the homomorphisms between finite semigroups.Therefore, for each collection Σ of unary identities of epigroups, the class of all finite semigroups satisfying Σ is a pseudovariety.In fact, many important pseudovarieties can be defined by identities involving the operation of pseudoinversion (which within the realm of finite semigroups is usually denoted by x → x ω−1 ) or the operation x → x ω := xx; see Almeida (1995) for plentiful examples.
We denote by E f in the class of all finite epigroups.Along with E and E f in , among important classes of epigroups is the class A f in consisting of finite combinatorial (or aperiodic) semigroups.Recall that a semigroup is combinatorial if all its maximal subgroups are one-element.
At the end of the 1990s Ilya Zhil'tsov began to study the decidability problem for the equational theory of A f in (considered as a class of epigroups) along with a more general question.First results he obtained were published in Zhil'tsov (1999) and a full solution of the problem for A f in (found independently of Jon McCammond's solution in McCammond (2001)) was announced in Zhil'tsov (2000).The paper Zhil'tsov (2000) also contained similar results for the pseudovariety E f in .We collect these results in the following statement: Theorem 1 The equational theory of the class E coincides with the equational theory of the class E f in and is decidable.The theory is not finitely based but has the following infinite identity basis: x p ≈ x p for each prime p.
Very unfortunately, soon after the announcement Zhil'tsov (2000) had appeared, Zhil'tsov died in a tragic accident and left no implementation of the statements indicated in Zhil'tsov (2000).It took us considerable effort to reconstruct all necessary steps of the proof.In Sections 2 and 3 we follow Zhil'tsov's plan outlined in Zhil'tsov (2000) quite closely while in Section 4 we choose a somewhat different way.
In Section 2 we introduce Zhil'tsov's concept of a Z-unary word.He suggested to consider words with not just one but countably many additional unary operations.In Section 3, we consider normal forms for Z-unary words and prove two of Zhil'tsov's propositions.First, it is possible to algorithmically construct the normal form.Second, there is an algorithm that, for two Z-words in normal form, returns their longest common prefix [suffix].In particular, this means that there is an algorithm that decides whether the normal forms of given Z-unary words coincide.In Section 4 we consider epigroup terms as Z-unary words and show that an epigroup identity holds in each epigroup if and only if the normal form of the left-hand side of the identity coincides with the normal form of its right-hand side.
When the results forming this paper had already been obtained and the paper was being prepared for publication, the author learned about José Carlos Costa's preprint Costa (2013) also dealing with the equational theory of E f in ; later Costa's paper Costa (2014) was published.Let us briefly comment on the relation between Costa (2014) and the present paper.Both papers provide algorithms to decide the equational theory of E f in and bases for the theory.However, the two algorithms utilize essentially different approaches and their justifications come from different sources.The bases found in Costa (2014) and in the present paper are, of course, equivalent.

Basic definitions
We fix an alphabet A, that is, a non-empty set which elements are referred to as letters.As usual, by A + we denote the free semigroup over A, that is, the set of all non-empty words over A which are multiplied by concatenation.We extend A + to a larger algebra that we denote by Z(A) and call the free Z-unary semigroup over A, the elements of Z(A) being called Z-unary words over A. For this we fix a symbol ω and define the notions of a Z-unary word and of its height by simultaneous induction as follows: 1) the empty word is a Z-unary word of height −∞; 2) every letter from A is a Z-unary word of height 0; 3) for every integer q ∈ Z and every Z-unary word σ of height h, the expression (σ) ω+q is a Z-unary word of height h + 1; 4) for every pair σ 1 , σ 2 of Z-unary words of heights h 1 and respectively h 2 , the expression σ 1 σ 2 is a Z-unary word of height max{h 1 , h 2 }.
For example, the expression (x ω−4 yx ω+30 ) ω−1 xy ω is a Z-unary word over {x, y} of height 2. This example also illustrates three natural conventions that we adopt throughout: we omit parentheses in expressions like (σ) ω+q whenever σ is just a letter and take the liberty to write ω instead of ω + 0 and ω − q instead of ω + (−q) for q being a positive integer.
We denote the height of σ ∈ Z(A) by h(σ).It is easy to verify that every Z-unary word σ of height h + 1 with h ≥ 0 can be uniquely represented as where n ≥ 1, h(ρ i ) = h for all i = 1, . . ., n, and h(π i ) ≤ h for all i = 0, . . ., n.We call (1) the height representation of σ.
We say that a Z-unary word τ is a prefix and it is a power of σ if τ = σ n for some n ≥ 2. Likewise, Z-unary words of the form σ ω+q , where q is an integer, are called ω-powers of σ.Observe that the free Z-unary semigroup Z(A) considered as a semigroup is just the free monoid generated by A and all ω-powers.

Singular words
Consider the fully invariant congruence S on the free Z-unary semigroup Z(A) generated by the pairs where q runs over Z.By a singular word or, shortly, a sword we mean an S-class.The class corresponding to a given Zunary word σ is denoted by σ S .Notice that if σ is an ordinary word, that is, σ ∈ A + , then σ S = {σ}.The quotient algebra Z(A)/S of all swords is denoted by Sing(A).
Example 1 (Zhil'tsov) Consider the Z-unary word x(xyz) ω−5 xy(zx) ω+4 zz of height 1 and of length 5ω − 2. We can represent it by the following picture: Here the ω-powers (xyz) ω−5 and (zx) ω+4 are represented by the circles labeled xyz and zx with encircled numbers −5 and 4 respectively.Now we draw the analogous pictures for three further Z-unary words that belong to the same S-class.These pictures illustrate three basic transformations that one can perform on a Z-unary word without changing its S-class.
• One can "unwind" n copies of a circle to the left or the right side of the circle, simultaneously decreasing its encircled number by n -in Fig. 2 this transformation is applied to the circle labeled zx in Fig. 1 with n = 2.This corresponds to n applications of either (2) or (3) from left to right.
• One can "wind up" (if it is possible) n copies of a circle from the left or the right side of the circle, simultaneously increasing its encircled number by n -in Fig. 3 this transformation is applied to the circle labeled xyz in Fig. 2 with n = 1.This corresponds to n applications of either (2) or (3) from right to left.• One can "roll" a circle to the left (right) side if some suffix (resp.prefix) of the circle's label is written before (resp.after) the circle -in Fig. 4 this transformation is applied to the circle labeled zx in Fig. 3.This corresponds to an application of (4).
Thus, any sword can be considered as an ordinary word with some attached "singularities" (ω-powers that may contain further ω-powers etc.) that can move along the word.This explains our terminology.
We refer to the basic transformations illustrated in Example 1 as S-transformations.Each S-transformation involves a certain ω-power which we call the site of the transformation.Clearly, two Z-unary words belong to the same S-class if and only if one can obtain each of these words form the other by a suitable sequence of S-transformations.
Notice that, due to the definition of the congruence S, the following conditions hold for all Z-unary words σ, τ in the same S-class: • σ and τ have the same height; • σ and τ have the same length.Thus, we can well define the height and the length of a sword σ S as the height and respectively the length of σ.We can also speak about a height representation of a sword; observe, however, that in contrast to Z-unary words, a sword may have several height representations.
We say that a sword τ S is a prefix [suffix, factor] of a sword σ S if, for some Z-unary words τ , σ such that (τ ) S = τ S and (σ ) S = σ S , the Z-unary word τ is a prefix [resp.suffix, factor] of σ .In the same way, the notions of a power and of an ω-power extend to swords.
As we will see, the algebra Sing(A) considered as a semigroup inherits several important properties from the free semigroup.Of course, there are some differences too.For instance, each sword of height more than zero has infinitely many factors.Further, for every ordinary word w and every integer t such that 0 ≤ t ≤ |w|, there exists a prefix of w with length t.This is not true in general swords: for example, the sword ((x 2 ) ω ) S has no prefix of length ω.
Lemma 1 There is an algorithm that, given an arbitrary sword σ S and a polynomial f (ω) ∈ Z[w] such that the leading coefficient of |σ| − f (ω) is non-negative, decides whether σ S has a prefix of length f (ω).If the answer is positive, the algorithm constructs swords x S , y S such that σ S = x S y S and |x| = f (ω).
Proof: We induct on the height of σ.As we have noticed prior to the formulation of the lemma, its statement holds for ordinary words and hence for swords of height 0.
(If deg f (ω) < h + 1, then k = 0 and the above inequality takes the form |. (In the case where k = 0, we let g(ω) = f (ω).)Clearly, σ S has a prefix of length f (ω) if and only if the sword (π k ρ ω+q k+1 k+1 ) S has a prefix of length g(ω).First suppose that deg g(ω) < h + 1.Then it is possible to choose a positive integer m such that the leading coefficient of |π k ρ m k+1 | − g(ω) is non-negative, and we are in a position to apply the induction hypothesis to the sword (π k ρ m k+1 ) S and the polynomial g(ω) . If the answer is positive and It is easy to see that if the required prefix exists then it has the form (π k ρ ω+t k+1 η) S for some integer t ≤ q k+1 and some prefix η of the Z-unary word ρ k+1 .Since h(π k ) ≤ h and h(η) ≤ h, we conclude that, by the definition of the length, the leading coefficients of the polynomials |π k ρ ω+t k+1 η|, |π k ρ ω+q k+1 k+1 |, and g(ω) must coincide.If this holds, then we choose an integer s < q k+1 such that the leading coefficient of the polynomial g (ω) = |π k ρ ω+s k+1 | − g(ω) is nonnegative.Since deg g (ω) < h + 1, we can apply the induction hypothesis to the sword (ρ q k+1 −s k+1 ) S and the polynomial g (ω), obtaining either a negative answer or a decomposition (ρ 2. The set of all prefixes [suffixes] of a sword is linearly ordered by right [resp.left] division. Proof: Let us start with the proof of the cancelation property.Suppose that σ S τ S 1 = σ S τ S 2 .This implies (στ 1 ) S = (στ 2 ) S .Therefore there exists a sequence of Z-unary words στ 1 = η 1 , η 2 , . . ., η n = στ 2 such that for each i = 1, . . ., n − 1, the word η i+1 can be obtained from the word η i by one of the Stransformations: "unwinding", "winding up", or "rolling".We will construct two sequences of Z-unary words α 1 , . . ., α n and β 1 , . . ., β n with the following properties: (ii) for each i = 1, . . ., n − 1, one can pass from α i to α i+1 and from β i to β i+1 by a sequence of S-transformations; (iii) for each i = 1, . . ., n, the Z-unary word α i β i can be obtained from η i by applying only "unwinding" S-transformations.
This will imply the desired conclusion τ S 1 = τ S 2 .Indeed, by (i) and (ii), we have σ = α 1 S α n and τ 1 = β 1 S β n whence, in particular, |σ| = |α n |.By (iii), α n β n can be obtained from η n = στ 2 by "unwinding" S-transformations only.The definition of an "unwinding" S-transformation implies that if such a transformation is applied to a product of two Z-unary words, its site is contained in one of the factors.Thus, we conclude that α n β n = γδ, where γ and δ are obtained by some "unwinding" Stransformations from σ and τ 2 respectively.In particular, σ S γ and τ 2 S δ.
Thus, it remains to construct the sequences α 1 , . . ., α n and β 1 , . . ., β n satisfying (i)-(iii).We proceed by induction, using (i) as the induction basis.Suppose that the Z-unary words α i and β i have already been defined.If the S-transformation Φ applied to obtain η i+1 from η i is of the type "winding up", we let α i+1 = α i , β i+1 = β i .If Φ is of the type "unwinding", one of the two possibilities occur: either Φ is one of the S-transformations employed to convert η i into α i β i or not.In the former case we again let α i+1 = α i , β i+1 = β i .In the latter case, the site of Φ persists in α i β i and, as already mentioned, it is located within one of the factors α i or β i .If the site lies within α i , we let α i+1 be the result of applying Φ to α i and let β i+1 = β i ; otherwise we let α i+1 = α i and let β i+1 be the result of applying Φ to β i .Now let Φ be of the type "rolling".By symmetry, we may assume that Φ corresponds to an application of (4) from right to left, that is, the site (xy) ω+q of Φ is followed by x in η i and "rolls" to the right producing x(yx) ω+q in η i+1 .Since α i β i is obtained from η i by "unwinding" S-transformations, α i β i may contain several copies of the site of Φ-for illustration, if, say, η i = (z(xy) ω+q x) ω+r , then unwinding the external ω-power gives Z-unary words of the form (z(xy) ω+q x) s (z(xy) ω+q x) ω+r−s−t (z(xy) ω+q x) t , with s + t + 1 occurrences of the site.We apply Φ to all copies of (xy) ω+q x that occur within α i or β i .Besides that, it may happen that some copies of the site have undergone unwinding themselves, resulting in a Z-unary word of the form ξ = (xy) r (xy) ω+q−r−s (xy) s x.Whenever such a ξ lies entirely within α i or β i , we substitute it by x(yx) r (yx) ω+q−r−s (yx) s -clearly, this amounts to "rolling" of (xy) ω+q−r−s to the right.If ξ occurs on the junction of α i and β i , we can basically do the same except for the only case where (xy) r (xy) ω+q−r−s is a suffix of α i while (xy) s x is a prefix of β i because in this case we cannot "roll" (xy) ω+q−r−s to the right within α i .In this remaining case, when passing from α i to α i+1 , we substitute (xy) r (xy) ω+q−r−s by x(yx) r (yx) ω+q−r−s−1 y.This concludes the induction step.Now let us show that Sing(A) is J-trivial.Indeed, assume that some swords α S , β S are J-related.Then 0 and all these Z-unary words must be empty.Hence α S = β S .The J-triviality of the semigroup Sing(A) implies that the relations of right and left division are partial orders on Sing(A).We aim to show that their restrictions to the set of all prefixes [suffixes] of a fixed sword σ S are linear orders.By symmetry, it suffices to consider right division only.Thus, suppose that S has a prefix of length |τ 1 | that should be also a prefix of the sword (τ 2 ) S .Hence, using the algorithm of Lemma 1, we can find two swords x S and y S such that τ S 2 = x S y S and |x| = |τ 1 |.Since τ 1 ρ 1 S xyρ 2 , there exists a sequence of Z-unary words η 1 = τ 1 ρ 1 , η 2 , . . ., η n = xyρ 2 such that η i+1 can be obtained from η i by an application of a suitable S-transformation for each i = 1, . . ., n − 1.Now we follow the proof of the cancelation property above and construct two sequences of Z-unary words α 1 , . . ., α n and β 1 , . . ., β n such that (ii) for each i = 1, . . ., n − 1, one can pass from α i to α i+1 and from β i to β i+1 by a sequence of S-transformations; (iii) for each i = 1, . . ., n, the Z-unary word α i β i can be obtained from η i by applying only "unwinding" S-transformations.
Then the same argument as the one we have utilized in the proof of the cancelation property shows that 3 Normal swords

Overview
In this section we introduce a rewriting system that plays a key role for the decidability question.
Let R denote the rewriting system on the free Z-unary semigroup Z(A) consisting of the rules for all x ∈ Z(A), all r, q ∈ Z, and all n ≥ 2. Observe that all these rules are length-decreasing; the rule ( 7) is also height-decreasing while ( 5) and ( 6) do not change the height.The rewriting system R induces the "quotient" rewriting system R/S on the quotient semigroup Sing(A) = Z(A)/S as follows: α S R/S −→ β S if and only if there exist Z-unary words σ and τ such that α S = σ S , β S = τ S , and σ R −→ τ .By (R/S) * we denote the reflexive and transitive closure of R/S.
A normal sword (or an R/S-irreducible sword) is a sword α S such that there is no sword β S with α S R/S −→ β S .Observe that every factor of a normal sword is also normal.A sword α S is called fully normal if its square (α S ) 2 is normal.It is easy to see that then (α S ) n is normal for all n ≥ 2.
Any normal sword which is (R/S) * -related to a given sword σ S is said to be a normal form of σ S .We stress that at this point we claim no uniqueness nor confluence: a sword may have several normal forms.
Up to now, we have always tried to differentiate between a sword (i.e., an S-class) and a Z-unary word representing this S-class.In the sequel, in order to lighten the notation, we allow ourselves to omit the superscript S so that a sword, say, α S may be denoted by just α.
This definition of a normal sword implies that such a sword contains no factors of the forms x ω+r x ω+q , (x n ) ω+q , (x ω+r ) ω+q .Notice also that if a sword is fully normal, then it is obviously normal and cannot have the form x ω+m nor x ω+r yx ω+q .Clearly, all ordinary words are fully normal.
The main goal of this section is to prove the two following propositions.
Proposition 1 There exists an algorithm that, given a sword σ of height h, returns a normal form of σ.
Proposition 2 There exists an algorithm that, given two normal swords of height at most h, returns their longest common prefix.
We have included the parameter h in the formulations of Propositions 1 and 2 because we are going to prove these propositions, along with Lemmas 3-7 formulated below, by simultaneous induction on h.All these statements obviously hold for swords of height 0 (i.e., for ordinary words), and we will assume that they hold true for all swords of height h − 1.
We will also use the following corollary of Proposition 2: Corollary 1 There is an algorithm that checks whether or not two given normal swords are equal.

Periodic normal swords
We will need two auxiliary facts similar to well-known properties of ordinary words.Given a sword τ , a sword σ is called τ -periodic if σ is a power or an ω-power of τ .
Proof: By symmetry, we may assume that |σ| ≥ |τ |.Observe that since στ = τ σ, the sword τ is a prefix of σ by item 2 of Lemma 2. Therefore, there exists a sword σ such that σ = τ σ whence τ σ τ = στ = τ σ = τ 2 σ .Since τ 2 is a prefix of a normal sword, it is normal whence τ is fully normal.Further, by item 1 of Lemma 2, we can cancel τ in the equality τ σ τ = τ 2 σ , thus getting σ τ = τ σ .First consider the case h(σ) > h(τ ).Then h(σ ) > h(τ ) whence |σ | > |τ |.Arguing as in the preceding paragraph, we see that τ is a prefix of σ and there exists a sword σ of height h(σ) such that σ τ = τ σ , and so on.Therefore, for any positive integer m, the sword τ m is a prefix of the sword σ.It is clear this is only possible if σ has some ω-power of τ as a prefix.Therefore, we may assume that σ = τ ω+k σ 1 for some integer k and some sword σ 1 .
Hence h(σ 1 ) < h(σ).If σ 1 is not empty, we can apply the induction hypothesis to the swords σ 1 and τ whose height is strictly less than h.There exists a fully normal sword π such that both σ 1 and τ are π-periodic but then σ = τ ω+k σ 1 could not be normal, a contradiction again.Thus, σ 1 is empty, whence σ = τ ω+k is an ω-power of the fully normal sword τ and the first statement of the lemma holds true.
If 1 = 2 (in particular, if max{ 1 , 2 } = 1), the sword σ such that σ = τ σ = σ τ has height less than h, and this leads to the case just considered.We then obtain that there is a fully normal sword π such that τ = π ω+k and σ = π m for some integers k, m, and thus, σ = π ω+k+m .If 1 = 2 , we apply the induction hypothesis to the pair σ , τ to obtain the required property.
The second statement of the lemma trivially follows from the definition of a fully normal sword. 2 Lemma 4 Let x and y be fully normal swords.Suppose that |x| ≥ |y| and x 2 is a prefix [suffix] of some y-periodic sword.Then there exists a fully normal sword z such that x and y are powers of z.If, besides that, some ω-powers of x and y are prefixes [suffixes] of a normal sword, then x = y.
We see that x is not fully normal, a contradiction.If a power of y but no ω-power of y is a prefix of x, then there exist swords y 1 , y 2 and a prefix y 3 of y such that y 1 y 2 = y and x = (y 1 y 2 ) n1 y 1 = y 2 (y 1 y 2 ) n2 y 3 for some n 1 , n 2 ≥ 1.Since both y 1 y 2 and y 2 y 1 are prefixes of x and have the same length, we conclude that y 1 y 2 = y 2 y 1 .Since y is fully normal, by Lemma 3 we obtain that y 1 = z k1 , y 2 = z k2 for some k 1 , k 2 ≥ 1 and some fully normal sword z.Hence x and y are powers of z.
The second statement of the lemma immediately follows from the fact that, because of the rule (6), the only power of z that can occur as a factor in a normal sword is z itself.Hence, x = z and y = z. 2

Normalization
Our algorithm that constructs a normal form of an arbitrary sword will repeatedly invoke two procedures.
Recall that every sword of height h can be represented as π 0 ρ ω+q1 , where each of the swords π 0 , π 1 , . . ., π n , ρ 1 , . . ., ρ n has height less than h.Therefore it suffices to exhibit a procedure that produces a normal form for a given sword being an ω-power of a normal swords and a procedure that produces a normal form for the product of two given normal swords.
Actually, the situation demonstrated by the above example is generic.By the definition of a normal sword, it is clear that the product of two normal swords is not normal if and only if it has a factor of the form y ω+r y ω+q .Thus, the fact that σ 1 and σ 2 are normal while σ 1 σ 2 is not is equivalent to the existence of a sword y such that σ 1 has a suffix and σ 2 has a prefix that are ω-powers of y.Obviously, if such a sword y exists, it should be fully normal and by Lemma 4 it is unique.We refer to y as to the overlap between σ 1 and σ 2 .
Lemma 5 Let σ 1 , σ 2 be two normal swords of height no more than h.There exists an algorithm that decides whether the product σ 1 σ 2 is in normal form.If the product is not normal, the algorithm finds the overlap between σ 1 and σ 2 and constructs a normal form for the product.
Proof: First, we describe an algorithm that, given two normal swords σ 1 , σ 2 of height h, decides if they have an overlap of height h − 1, and in the case where the answer is positive, finds the overlap and constructs a normal form for σ 1 σ 2 .Since the algorithm will be repeatedly invoked in the rest of the proof, it is convenient to give it a name.So, let us call this algorithm TO (from "tall overlap").
We start with representing the given swords as where If σ 1 has a suffix that is an ω-power of some sword of height h − 1, then the suffix is of height h, and hence, it has to involve some ω-power of ρ 1 as a factor.Clearly, this is only possible if ρ 1 = π 1 ρ 1 for some sword ρ 1 , and we can decide whether or not the latter equality holds true by applying the algorithm of Proposition 2 to the swords π 1 and ρ 1 to find their longest common prefix and then deciding whether or not this prefix is equal to π 1 .If the answer is positive, we can rewrite the sword σ 1 (by "rolling" (π 1 ρ 1 ) ω+q1 to the right) as Similarly, if σ 2 has a prefix that is an ω-power of some sword of height h − 1, then the prefix is of height h and has some ω-power of ρ 2 as a factor.This is only possible if ρ 2 = ρ 2 π 2 for some sword ρ 2 , which can be verified by applying the "dual" of the algorithm of Proposition 2. If the answer is positive, we can rewrite the sword σ 2 (by "rolling" (ρ 2 π 2 ) ω+q2 to the left) as Now it remains to verify whether or not the swords ρ 1 π 1 and π 2 ρ 2 of height h − 1 are equal.If the answer is negative, σ 1 and σ 2 have no overlap of height h − 1.Otherwise, the sword y = ρ 1 π 1 = π 2 ρ 2 is the overlap of height h − 1 between σ 1 and σ 2 and σ 1 σ 2 = σ 1 π 1 y ω+q1 y ω+q2 π 2 σ 2 .Applying an R/Stransition of the form (5), we reduce it to the sword τ = σ 1 π 1 y ω+q1+q2 π 2 σ 2 .We are going to prove that τ is normal, and thus, it is a normal form for the product σ 1 σ 2 .Arguing by contradiction, assume that τ is not normal.Then there should be the overlap z, say, between either σ 1 π 1 and y ω+q1+q2 π 2 σ 2 or σ 1 π 1 y ω+q1+q2 and π 2 σ 2 .Since the height of τ is h, the height of z is at most h − 1 whence z contains no ω-power of y as a prefix nor as a suffix.Then Lemma 4 easily implies that z = y, but this leads to a contradiction: if σ 1 π 1 has an ω-power of y as a suffix, the sword σ 1 = σ 1 π 1 y ω+q1 could not be normal, and if π 2 σ 2 has an ω-power of y as a prefix, the same conclusion applies to the sword σ 2 = y ω+q2 π 2 σ 2 .Now assume that the algorithm TO has revealed that the swords σ 1 and σ 2 have no overlap of height h − 1.Then we have to check whether they have an overlap of lesser height.For this, we again represent the swords in the form (8) and apply the algorithm of Lemma 5 to the swords ρ 2 1 π 1 and π 2 ρ 2 2 , which are both of height less than h.If there is no overlap between ρ 2 1 π 1 and π 2 ρ 2 2 , then there also is no overlap of height less than h − 1 between σ 1 and σ 2 and the product σ 1 σ 2 is in normal form.Otherwise, the algorithm finds the overlap between ρ 2 1 π 1 and π 2 ρ 2 2 .Denoting the overlap by y, we can represent these swords as ρ 2 1 π 1 = σ 1 y ω+r1 and π 2 ρ 2 2 = y ω+r2 σ 2 for some r 1 , r 2 ∈ Z.Consider the sword θ = σ 1 ρ ω+q1−2 1 σ 1 y ω+r1+r2 σ 2 ρ ω+q2−2 2 σ 2 obtained from σ 1 σ 2 by an R/S-transition of the form (5). Clearly, to check whether θ is normal amounts to examining overlaps between the swords σ 1 ρ ω+q1−2 1 σ 1 and y ω+r1+r2 σ 2 ρ ω+q2−2 2 σ 2 or between the swords σ 1 ρ ω+q1−2 1 σ 1 y ω+r1+r2 and σ 2 ρ ω+q2−2 2 σ 2 .In contrast to the situation in the previous paragraph, here the overlaps may exist, and it appears to make sense to illustrate this phenomenon by an example.
Thus, consider the normal swords τ 1 = (x ω y) ω+1 x ω and τ 2 = (x ω y) ω−2 of height 2. They have no overlap of height 1, but do have the overlap of height 0, namely, x: this becomes obvious if we rewrite τ 2 as x ω y(x ω y) ω−3 .Applying an R/S-transition of the form (5) to the product τ 1 τ 2 , we obtain the sword (x ω y) ω+1 x ω y(x ω y) ω−3 , and we see that the swords (x ω y) ω+1 and x ω y(x ω y) ω−3 = (x ω y) ω−2 have the overlap x ω y, this time of height 1. Resolving the overlap with yet another transition of the form (5), we finally obtain the normal sword (x ω y) ω−1 as a normal form for τ 1 τ 2 .Observe that the above example illustrates not only the difficulty we encounter but also a way to overcome it: since the new overlap has height h(τ 1 ) − 1, it can be found by the algorithm TO.Mutatis mutandis, this idea works also in the general case.
We return to the proof.Recall that we have to decide if there are overlaps between σ 1 ρ ω+q1−2 First, we apply TO to decide if there are overlaps of height h − 1, and in the case where the answer is positive, to construct a normal form for the sword θ, which will be also a normal form for σ 1 σ 2 .Suppose that TO has found no overlaps of height h − 1.Then we apply the algorithm of Lemma 5 to the swords ρ 2 1 σ 1 and y ω+r1+r2 σ 2 ρ 2 2 or to the swords ρ 2 1 σ 1 y ω+r1+r2 and σ 2 ρ 2 2 , which are all of height less than h.If no overlaps are found, then there are no overlaps of height less than h − 1 between σ 1 ρ ω+q1−2 and the sword θ is normal.Suppose that the algorithm has found the overlap z, say, between ρ 2 1 σ 1 and y ω+r1+r2 σ 2 ρ 2 2 or between ρ 2 1 σ 1 y ω+p1+p2 and σ 2 ρ 2 2 .If z has no ω-power of y as a prefix nor as a suffix, then Lemma 4 implies that z = y, and this leads to a contradiction: if ρ 2 1 σ 1 has an ω-power of y as a suffix, the sword σ 1 = σ 1 ρ ω+q1−4 1 ρ 2 1 σ 1 y ω+r1 could not be normal, and if σ 2 ρ 2 2 has an ω-power of y as a prefix, the same conclusion applies to the sword σ 2 = y ω+r2 σ 2 ρ 2 2 ρ ω+q2−4 2 σ 2 .Thus, z has no ω-power of y as a prefix or as a suffix whence h(y) < h(z) < h − 1.Now we apply the same sequence of arguments to z, etc.Clearly, each step of the described process deals with some sword θ obtained from σ 1 σ 2 by a sequence of R/S-transitions and leads to exactly one of the three following results: 1. TO finds the overlap of height h − 1, resolves it in θ, and returns a normal form for σ 1 σ 2 .
2. TO finds no overlap of height h − 1, and the algorithm of Lemma 5 applied to suitable words of height less than h finds no overlap of height less than h − 1, and therefore, θ constitutes a normal form for σ 1 σ 2 .
3. TO finds no overlap of height h − 1, but the algorithm of Lemma 5 applied to suitable words of height less than h finds the overlap whose height is less than h − 1 but greater than the height of the overlap found in the previous step.In this case we resolve the overlap in θ and pass to the next step.
It is clear that the number of steps of our process does not exceed h, and therefore, it will eventually return a normal form for σ 1 σ 2 .It remains to analyze the situation where one of the swords σ 1 and σ 1 is of height less than h while the other has height h.(In the case where both h(σ 1 ) < h and h(σ 2 ) < h, the induction hypothesis applies immediately.)The argument is similar to that described above but simpler because there is no need to invoke the algorithm TO-one of the swords is of height less than h, no overlap of height h − 1 is possible.By symmetry, we may suppose that h(σ 1 ) < h and h(σ 2 ) = h.Then we can represent σ 2 as σ 2 = π 2 ρ ω+q2 2 σ 2 , where h(ρ 2 ) = h − 1, h(π 2 ) ≤ h − 1.We apply the algorithm of Lemma 5 to the swords σ 1 and π 2 ρ 2 2 , which are both of height less than h.If there is no overlap between σ 1 and π 2 ρ 2 2 , then there also is no overlap between σ 1 and σ 2 and the product σ 1 σ 2 is in normal form.Otherwise, the algorithm finds the overlap between σ 1 and π 2 ρ 2 2 .Denoting the overlap by y, we can represent these swords as σ 1 = σ 1 y ω+r1 and π 2 ρ 2 2 = y ω+r2 σ 2 for some r 1 , r 2 ∈ Z.Consider the sword θ = σ 1 y ω+r1+r2 σ 2 ρ ω+q2−2 2 σ 2 obtained from σ 1 σ 2 by an R/Stransition of the form (5). Clearly, to check whether θ is normal amounts to examining the overlaps between the swords σ 1 and y ω+r1+r2 σ 2 ρ ω+q2−2 2 σ 2 and between the swords σ 1 y ω+r1+r2 and σ 2 ρ ω+q2−2 2 σ 2 .For this, we apply the algorithm of Lemma 5 to two pairs of swords: σ 1 and y ω+r1+r2 σ 2 ρ 2 2 and respectively σ 1 y ω+r1+r2 and σ 2 ρ 2 2 , which swords are all of height less than h.If no overlaps have been discovered, the sword θ is normal and thus constitutes a normal form for the product σ 1 σ 2 .If the overlap z, say, has been found, then the same argument as above shows that h(z) > h(y).We apply the same arguments to z, etc.The described process will eventually stop since the height of overlaps increases on each step but cannot reach h − 1. 2 Now we study how to construct a normal form for the ω-power of a normal sword.
Lemma 6 Let ρ be a normal sword of height h − 1.There is an algorithm that reduces the sword ρ ω+q either to a normal sword of height less than h or to a sword of the form α and the sword β ω+t is normal.
Proof: Assume that ρ ω+q is not normal.This means that an R/S-transition can be applied to the sword.Depending on the form of the transition, one of the three following cases occurs: 1) ρ = x ω+m1 x x ω+m2 for some m 1 , m 2 ∈ Z and some non-empty x (the sword x cannot be empty since ρ is normal); 2) ρ = x n for some integer n ≥ 2; 3) ρ = x ω+m for some integer m.
We apply the algorithm of Lemma 7 to the normal sword ρ of height h − 1 to check whether one of the cases 2) or 3) occurs, and if it does, to find a corresponding fully normal sword x.We may additionally assume that x = y p for any integer p ≥ 2: in case 2) such an x is the sword of minimum length returned by the algorithm while in case 3) this holds automatically since ρ is normal.Then ρ ω+q can be reduced to x ω+nq in case 2) or to x ω+mq in case 3) and either of these two ω-powers is easily seen to be normal.
In the remaining case 1), the sword ρ must have a proper overlap with itself.We can check if this indeed happens by invoking the algorithm of Lemma 5 since the height of ρ is less than h.Moreover, if the overlap exists, it is unique and fully normal, and the algorithm finds it.Thus, assume that ρ = x ω+m1 0 x 0 x ω+m2 0 for some fully normal sword x 0 and some m 1 , m 2 ∈ Z. Then the sword ρ ω+q = (x ω+m1 It is normal because any R/S-transition applicable to ρ 1 could have been applied also to ρ while ρ is normal.If ρ ω+q−1 1 is normal, we are done as we can put α 1 = x ω+m1 0 x 0 , α 2 = x ω+m2 0 , and β = ρ 1 .Suppose that ρ ω+q−1 1 is not normal.Then one of the above cases 1)-3) takes place for ρ 1 .We already have seen how to handle case 2): we can reduce ρ ω+q−1 1 to its normal form being an ω-power of a fully normal word of height less than h.Substituting this normal form for ρ ω+q−1 1 in the sword x ω+m1 0 x 0 ρ ω+q−1 1 x ω+m2 0 produces a sword of the desired form α 1 β ω+t α 2 .In case 3) there is a fully normal sword x 1 of height less than h − 1 such that ρ 1 = x ω+ 1 for some integer .Then , and we can apply an R/Sreduction of the form (7) to obtain the sword x ω+m1 0 x 0 x ω+ (q−1) 1 x ω+m2 0 of height less than h.We can construct a normal form using of the latter sword using Proposition 1.
Finally, consider the situation where ρ 1 falls in case 1).Assume that for some 1 , 2 ∈ Z and some non-empty x 1 .If h(x 0 ) = h(x 1 ), then Lemma 4 implies x 0 = x 1 , and the sword x 0 has some ω-power of x 0 as a suffix.This would mean that the sword ρ = x ω+m1 0 x 0 x ω+m2 0 is not normal, a contradiction.If h(x 0 ) > h(x 1 ), then x 0 has a prefix of the form x ω+r1 1 while x 0 has a suffix of the form x ω+r2 1 , and this again contradicts the assumption that ρ is normal.Thus, we conclude that h(x ) < h(x 1 ).We proceed in the same way by reducing the sword ρ ω+q−1 The only situation where we cannot immediately normalize the sword ρ ω+q−2 2 is that where ρ 2 = x ω+k1 2 x 2 x ω+k2 2 for some k 1 , k 2 ∈ Z and some non-empty x 2 .In this situation, as the argument from the preceding paragraph shows, we must have h(x 1 ) < h(x 2 ).We then repeat the procedure, if necessary, until it eventually stops at some sword ρ s such that the sword ρ ω+q−s s can be reduced to a normal sword of the form β ω+t with h(β) < h.(Since the height of the overlaps x 0 , x 1 , x 2 , . . .increases on each step, the number of steps is upper bounded by h.) Then the original ω-power ρ ω+q is reduced to the sword α 1 β ω+t α 2 , where 2 Now we are in a position to prove Proposition 1. Recall that is claims the existence of an algorithm that, given a sword σ of height h, returns a normal form of σ.
By Lemma 6, each sword ρ ω+qi i can be effectively reduced to a sword of the form α i1 β ω+ri i α i2 where the sword β ω+ri i is normal of height h while the swords α i1 , α i2 have height at most h − 1 and again may be assumed to be normal by the induction hypothesis.Then σ reduces to the following product of normal factors: The algorithm of Lemma 5 allows us to construct a normal form for the product of two normal swords.
Clearly, applying this algorithm several times, we can construct a normal form for the product of any finite number of normal swords, and hence, a normal form for σ. 2

Longest common prefix
Here we prove Proposition 2. Recall that it claims the existence of an algorithm that, given two normal swords σ and δ, say, both of height at most h, returns their longest common prefix, which we denote by LCP (σ, δ).
Proof of Proposition 2: We fix a height representation of the sword σ with the minimum number of factors of height h and an analogous height representation of the sword δ.We are going to induct on the total number t of factors of height h in these two representations.If t = 0, then h(σ), h(δ) < h and the hypothesis of external induction (on h) applies.Consider the situation where one of the swords σ and δ has height less than h while the other has height h.For certainty, suppose that h(δ) < h(σ) = h and let π 0 ρ ω+q1 1 • • • ρ ω+qn n π n be the chosen height representation of the sword σ.Then LCP (σ, δ) = LCP (π 0 ρ k 1 , δ) where k is any integer large enough to ensure that |π 0 ρ k 1 | > |δ|.Since h(π 0 ρ k 1 ) < h, we can construct LCP (π 0 ρ k 1 , δ) using the external induction hypothesis.Therefore, we may assume that both σ and δ have height h.
Proof: If σ = x ω+q for some sword x and integer q, then |σ| = (ω + q)|x| whence the number −q must be a root of the polynomial |σ|.Thus, we can find all integer roots q 1 , . . ., q n of |σ| and for each i = 1, . . ., n, apply Lemma 1 to verify if σ has a prefix x i of length |σ|/(ω + q i ).If this is the case, it remains to verify whether x ω+qi i = σ, and this can be done in view of Corollary 1.Similarly, σ = x m for some sword x and integer m ≥ 2, then the number m divides all coefficients of the polynomial |σ|.Thus, we can find all common divisors m 1 , . . ., m k of the coefficients of |σ| such that m 1 , . . ., m k ≥ 2. Then for each j = 1, . . ., k, we apply Lemma 1 to check if σ has a prefix x j of length |σ|/m j , and if this is the case, we use Corollary 1 to verify whether x mj j = σ. 2 4 Proof of the theorem

Normal swords and epigroup identities
Recall that we consider epigroups as unary semigroups under the unary operation of pseudoinversion x → x.It is known Shevrin (2005) that the following identities hold in the class E of all epigroups: x x ) x p ≈ x p for each prime p. (13) We will often use also the identity xx ≈ xx that can be easily deduced from ( 9)-( 13).Indeed, Every unary semigroup term becomes a Z-unary word if one replaces every expression of the form x by x ω−1 .Conversely, every Z-unary word will be treated as an epigroup term in which expressions of the form x ω+q , q ∈ Z, are interpreted as follows: x ω+q = xx q+1 , if q is non-negative; x (−q) , otherwise.
Proposition 3 If Z-unary words σ, σ are S-related, then the identity σ ≈ σ holds in E.
Proposition 4 Let σ 1 and σ 2 be two swords and let α 1 and respectively α 2 be their normal forms.Then the identity σ 1 ≈ σ 2 holds in E if and only if so does the identity α 1 ≈ α 2 .
Proof: It is enough to show that if α is a normal form of a sword σ, then the identity σ ≈ α holds in E. For this, it clearly suffices to prove that E satisfies the identities for all q, r ∈ Z and all n ≥ 2 as these identities correspond to the reduction rules ( 5)-( 7) used in the normalization procedure.The proof of (17) splits in 4 cases depending on the signs of q and r.If q, r ≥ 0, we have If q, r < 0, the proof is straightforward since Assume that r ≥ 0 and q < 0. Then On the other hand, by the definition, we have Thus, we conclude that x ω+r x ω+q ≈ x ω+r+q .The case where r < 0 and q ≥ 0 is completely analogous.Before we proceed with proving (18), we notice that the identity x n ≈ x n holds in E for every positive integer n.For this, we induct on n.The claim is trivial for n = 1.If n > 1, represent n as n = kp, with p being prime.Then we have x k ≈ x k by the induction assumption whence Now, for each q ≥ 0, we have ≈ xx nq+1 = x ω+nq .
For q < 0, we have In order to verify (19), we first show that x ≈ x.Indeed, substituting x for x in (11), we get We use this to deduce yet another auxiliary identity, namely, x ω+r ≈ x ω−r for every integer r ∈ Z.If r > 0, we have x ω+r = xx r+1 (10) ≈ x 2 x r+2 (10) ≈ . . .Here we have repeatedly employed (17) in the final step.If r = 0, we have ≈ xx = x ω .
In the following statements and their proofs, whenever both constructions σ (k) and σ are used, we assume that they are produced from the same Z-unary word representing the sword σ.
Lemma 8 Let σ 1 , σ 2 be two normal swords.Suppose that σ Proof: Suppose that σ 1 = σ 2 .Let τ be the longest common prefix of σ 1 and σ 2 (it exists by Proposition 2).We write σ 1 and σ 2 as σ 1 = τ ρ 1 and σ 2 = τ ρ 2 for some swords ρ 1 and ρ 2 such that either one of them is empty while the other is not or they both are non-empty and start with different letters.Consider some Z-unary words α, β 1 , β 2 representing the swords τ, ρ 1 , ρ 2 respectively.Then, clearly, the Z-unary words αβ 1 and αβ 2 represent the swords σ 1 and respectively σ 2 .If the parameters and k are calculated from these representations, then we have σ 2 .Thus, the swords ρ 1 and ρ 2 that differ at their start should become equal when each ω in them is substituted with k.This is obviously not possible one of the swords is empty while the other is not since no ordinarization transform sends a non-empty sword to the empty word.Nor is it possible if ρ 1 and ρ 2 are non-empty and start with different letters because the starting letters of ρ 2 remain the same as the ones of ρ 1 and respectively ρ 2 .Thus, we arrive at a contradiction. 2 Recall that an ordinary word u is said to be periodic if u = v n for some word v and some n ≥ 2.
Lemma 9 Let σ be a normal sword.It is periodic if and only if the word σ (k) is periodic for every choice of a Z-unary word representing σ, every > d(σ) and every k such that k − − 2 > | σ|.
Proof: If σ is a power then so is σ (k) , and if σ is an ω-power, say, σ = τ ω+q , then σ (k) = τ (k) k+q , and conditions imposed on k guarantee that k +q ≥ 2. Conversely, suppose that an ordinarization of the sword σ is equal to v n for some word v and some n ≥ 2. Then a Z-unary word representing σ should decompose as α 1 • • • α n , where the ordinarization sends each factor α i , i = 1, . . ., n, to the word v.If the parameters and k are calculated from this representation of the sword σ and τ i is the normal sword represented by α i , i = 1, . . ., n, we have σ = τ 1 • • • τ n and τ (k) i = v for each i = 1, . . ., n.Since | τ i | ≤ | σ|, we can apply Lemma 8 to the swords τ i and obtain that they are all equal.Therefore σ is periodic. 2 A central concept in Guba's papers Guba (1993a,b) is the notion of the reduced form of a word relative to the Burnside variety B m,k .We are not going to reproduce here the original definition of this notion because it is quite involved (it is given by simultaneous induction on five other notions) and because, as the reader will see, we can easily bypass the definition by working with a sufficient condition for a word to be in the reduced form (see Lemma 10 below).First we reproduce a result which is crucial for our considerations; it constitutes the main point of the proof of Theorem 4.1 in Guba (1993a).
Theorem 4 Let m ≥ 3, k ≥ 1, and let u and v be words.The identity u ≈ v holds in the variety B m,k if and only if u and v have the same reduced forms relative to B m,k .