Equationally defined classes of semigroups

We apply, in the context of semigroups, the main theorem from the authors’ paper “Algebras defined by equations” (Higgins and Jackson in J Algebra 555:131–156, 2020) that an elementary class C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathscr {C}}$$\end{document} of algebras which is closed under the taking of direct products and homomorphic images is defined by systems of equations. We prove a dual to the Birkhoff theorem in that if the class is also closed under the taking of containing semigroups, some basis of equations of C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathscr {C}}$$\end{document} is free of the ∀\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\forall $$\end{document} quantifier. We also observe the decidability of the class of equation systems satisfied by semigroups, via a link to systems of rationally constrained equations on free semigroups. Examples are given of EHP-classes for which neither (∀⋯)(∃⋯)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(\forall \cdots )(\exists \cdots )$$\end{document} equation systems nor (∃⋯)(∀⋯)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(\exists \cdots )(\forall \cdots )$$\end{document} systems suffice.


Introduction
A theorem of universal algebra and model theory is proved in [7] that is particularly pertinent to the study of semigroups.The theorem clarifies why it is so often the case that classes of algebras which are closed under the taking of arbitrary direct products (P) and homomorphic images (H), but not necessarily subalgebras (S), may be defined by a set of equation-like sentences.The members of these bases are referred to in [7] as equation systems and generally involve simultaneous equations, meaning that the equations are not assumed to be independent in that a symbol may occur in more than one equation.More formally, a semigroup equation system is a quantified conjunction of equalities between semigroup words (elements of a free semigroup).Thus in comparison with the more familiar theory of varieties and equational logic, we allow both ∀ and ∃ as quantifiers at the front of the sentence and we allow the logical connective of conjunction ∧ ("and").
These equations are simultaneous and indeed both the parameter a and the variable x feature in each.Together they capture the property that each element has an inverse with which it commutes, which is one definition of completely regular semigroups.However, we shall show that this class may be defined by a single quantified equation (without conjunction), and in more than one way.
Classes defined by equation systems in this fashion are referred to as {E, H, P }classes or simply EHP -classes, with the E symbol standing for the taking of elementary substructures, H for homomorphic images and P for direct products.An elementary class (or first order class) is one defined by a collection of first order formulae: the quantifiers refer to elements of algebras, hence "elementary", in contrast with second order logic where we may quantify over relations.The inclusion of the class operator E is necessary to capture equivalence with definability by equation systems, but the reader will not need familiarity with the definition of elementary substructures in this article, because we always proceed by finding equation systems that capture the classes we explore.It is not currently known if closure under the operator EHP is enough to ensure closure under the set of operators {E, H, P }.
For relevant background and notation on universal algebra see [1], [2] (Chapter V there also serves as a useful first introduction to model theoretic notions for those wanting to delve further), while [3], [6] and [8] are texts covering semigroup facts and terminology.
In the following theorem, closure under taking elementary substructures is subsumed by the assumption that C is an elementary class (all elementary classes are closed under the taking of elementary substructures).The theorem was inspired by the observation that so many of the fundamental classes of algebraic semigroups are EHP-classes, but are not varieties, which is to say the class is not closed under the taking of subsemigroups, and so cannot be defined by semigroup identities.Indeed since equation systems are examples of first order sentences, a class defined by the satisfaction of a set of equations is automatically an elementary class and the initial condition of the theorem is, in the (easy) forward direction, redundant.
In Section 2 we highlight examples showing just how rich is EHP theory in the context of semigroups.Many extensively studied semigroup classes are captured through our approach, in many cases by a single equation.We verify this in cases where the equational bases differ from those given in [7].
An EHP-class C that is closed under the taking of all embeddings (and not only elementary embeddings) is a variety in which case, by Birkhoff's theorem, the equations defining C may be taken to be identities, which is to say the equations do not involve the quantifier ∃.It is natural then to consider a kind of dual to the Birkhoff theorem for EHP-classes C defined by equations that are free from the quantifier ∀.Clearly such a class is closed under the taking of containing algebras.In Section 3 we prove the converse does indeed hold for the class of semigroups.
In Theorem 1.1, the number of alternations between the ∀ symbol, which qualifies parameters, (denoted by lower case letters from the beginning of the alphabet a, b, c, . . .), and the ∃ symbol, which qualifies variables, (denoted typically by x, y, z) is finite but unbounded in length.In Section 4 we give examples of EHP-classes which have no basis comprised of equations of the form

Classical semigroup collections as EHP-classes
2.1.Classes of regular semigroups.We begin with six examples that highlight how easily important classes of regular semigroups may be characterised by a single equation.Moreover the proofs of this are simple but elegant exercises in semigroup theory.In particular we see in Proposition 2.1 how the classes in question may be characterised by small adjustments to the equation that defines regularity.(2) Reg : (∀a)(∃x) : a = axa. (3) LG Proof.The equation ( 2) may be satisfied in any regular semigroup S by taking x ∈ V (a).Conversely, if x satisfies (2), then xax ∈ V (a).
For equation ( 3), let S be a left group and let a, b ∈ S. Since S is left simple, there exists y ∈ S such that a = yb.By regularity there exists z ∈ S such that a = aza, whence a = azyb.Putting x = zy gives a = axb, as required.
Conversely suppose that a = axb is solvable in a semigroup S. Putting b = a gives a = axa is solvable so that S is regular.Moreover a = axb implies that a ≤ L b, and since a, b are arbitrary it follows that a L b. Therefore S is left simple and regular and so S is a left group.The left-right dual argument shows that RG is defined by the equation a = bxa in like manner.
For equation ( 4), if G is a group then for given a, b ∈ G there is a unique solution to (4), that being x = b −1 ab −1 .
Conversely, let S be a semigroup in which (4) is solvable.The equation implies that H a ≤ H b .By interchanging a and b we obtain the reverse inequality, whence S consists of a single H -class, and is therefore a group.
For equation ( 5): from the equation, it follows that a H a 2 , from which we infer that every H -class is a group, whence S is a union of groups, which is to say that S is completely regular.
Conversely, let S be a completely regular semigroup.Let a ∈ S and put x = b 3 , where b is the inverse of a in the group H a .Then ab = ba is the identity element of H a and so in accord with (5).Finally, let S be a semigroup that satisfies (6).By putting b = a we see that (6) implies (5), so that S is completely regular.For any a, b ∈ S, (6) implies that J a ≤ J J b , and by role reversal of a and b, the reverse inequality follows so that that J a = J b .Therefore S is a simple completely regular semigroup, which is to say that S is completely simple.
Conversely let S be a completely simple semigroup and take a, b ∈ S. Then we have a R ab L b R ba L a.By Green's Lemma, the mapping ρ ba : H a → H a whereby xρ ba = xba is a bijection, as is the the mapping λ ab : H a → H a whereby xλ ab = abx.It follows that φ = λ ab ρ ba = ρ ba λ ab : H a → H a is also a bijection, whereupon there exists a unique x ∈ H a such that xλ ab ρ ba = abxba = a, thereby proving that S satisfies equation (6).
Other classes of regular semigroups may be defined by an equation system consisting of (2) together with one more equation.For instance, Example 2.1(iii) of [7] shows that Semilattices of groups (SG) is the EHP-class of regular semigroups defined by the additional equation: (7) (∀ a, b)(∃ y) : ab = bya.
Some standard properties used in the description of classes of semigroups may be expressed by equations, and that allows for abbreviation.For example, that a certain product u of some parameters and variables is idempotent we write as u ∈ E, or if v is an inverse of u we write v ∈ V (u).Properties defined by Green's relations are generally not intrinsically equational within the class of semigroups but may become so in the presence of the regularity equation (2).However the respective properties of being G -simple for any of the five Green's relations G defines an EHP-class, except for the case of D. In general, bisimple semigroups are not closed under the taking of direct products.Within Reg, the condition u H v is expressible through equations in S, with similar comments applying to L , R, J , and indeed D. In particular, the class of regular bisimple semigroups is defined by the regularity equation together with the equational relationships (∀a, b)(∃x) : a R x L b.This class is however not a variety as, by a theorem of Preston, any semigroup may be embedded in a regular bisimple monoid [6,Corollary 1.2.15].
The property of u belonging to a subgroup, which we write as u ∈ G, is also equational: The ascending chain of the three important classes of I (Inverse semigroups), O (Orthodox semigroups), and ES, (Idempotent-solid semigroups), which are those regular semigroups whose idempotent generated subsemigroup is a union of groups, may be defined in a uniform fashion that is conveniently displayed if we adjoin two redundant equation types to the definition of regularity: (8) reg: We include two further classes within this sequence.For the first, we have the Right Inverse semigroups introduced by Venkatesan [13] as regular semigroups in which each L -class contains a unique idempotent (for that reason, they are also known as L -unipotent semigroups).The class RI of Right inverse semigroups is given six further characterisations in [13, Theorem 2.1], one of which is the class of all regular semigroups S for which ef e = f e for any idempotents e, f in S. It follows that I ⊆ RI ⊆ O.It also is the case that RI is an EHP class, and the argument for closure under homomorphisms is given in Theorem 3 of [13].
The second inclusion in the chain is the class CN of Conventional semigroups of Masat [12]: a regular semigroup S is conventional if aea ′ is idempotent for all (a, a ′ ) ∈ V (S) and e ∈ E(S).Equivalently, by [ which is idempotent.It follows by [12,Lemma 2.2] that we have an equational basis for Conventional semigroups.
The equational bases in Propositions 2.1 and 2.2 are not unique.The bases given by equations ( 9), (11), and (13) of Proposition 2.2 correspond to bases for these classes when considered as e-varieties in the sense of Hall [5].These are classes of regular semigroups that are HP -closed, and also closed under the taking of regular subsemigroups.Indeed any e-variety (of regular semigroups) is an EHPclass of regular semigroups, and so e-varieties may be defined without the need to introduce a unary operation that selects arbitrary inverses.The only semigroup operation involved is the natural operation of semigroup multiplication.However, not all EHP-classes consisting of regular semigroups are e-varieties (see [7,Theorem 5.1]).In common with e-varieties however is the property that if C is an EHP-class of regular semigroups then the class C loc of all semigroups S whose local subsemigroups eSe lie in C (e ∈ E(S)) is also an EHP-class (see [7,Theorem 5.5]).
The abstraction of the idea of e-varieties involves taking an EHP-class of algebras N , which are labelled nice, and then considering classes C of nice algebras that are HP -closed and closed under the taking of nice subalgebras.Since the nice algebras are defined by first order formulae (equation systems), it follows that C will be closed under the taking of elementary subalgebras, and so C will automatically be another EHP-class.There could however, as in the case of regular semigroups, be EHPclasses of nice algebras that were not closed under the taking of nice subalgebras.If we declare the class of all algebras to be nice, then the corresponding class of evarieties coincides with varieties in the usual sense of algebras defined by identities (∃-free equation systems).
We sometimes write these equations as x = 1, and similarly we write x = 0 to abbreviate the equations that ensure the existence of a zero element in a semigroup.The point to note here however is that the order of the existential quantifiers in ( 14) is (∃ . . .)( ∀ . . .), which is the reverse of all our previous examples.Indeed M cannot be represented by equations of the type (∀ . . .)(∃ . . . ) because any class that has such a basis is closed under the taking of the union of an ascending chain of algebras from the class, and the class M lacks this property.We will investigate this facet of the theory further in our final section.
A natural exercise then is to exchange the order of the quantifiers of the examples of Section 2.1.This will necessarily result in a more restricted class to that defined by the original equation system.Exchanging the order of the quantifiers in equation (2) defines the class B of all semigroups that possess a universal pre-inverse element: We note that for any S ∈ B, the J -class J x is maximal.Conversely any band B with a maximal J -class J = J x belongs to B. To see this observe that since B is a semilattice of rectangular bands, it follows that for any a ∈ B, ax The following is a simple reformulation of the condition defined by (15).

Lemma 2.3. A semigroup S ∈ B if and only if
for all a ∈ S, which in turn is equivalent to the condition that xa ∈ L a ∩ E(S) for all a ∈ S.
Proposition 2.4.Suppose that S ∈ B, let E denote E(S), and let x denote a fixed choice for satisfying (15).Then (i) x ∈ E, S satisfies the identity a 2 = a 3 , and S = E 2 .
(ii) In S, D = J , and H is the equality relation.
(iii) Let J = J x .Then J is the maximum J -class of S, the principal factor J ∪ {0} = S/(S − J) ∈ B, and Proof.(i) Taking a = x in (15) we get x = x 3 .For any a we have (ii) That D = J follows from the satisfaction of a 2 = a 3 , as this equality of Green's relations is true in any periodic semigroup; indeed it is true of any groupbound semigroup (see [4,Theorem 1.2.20]).
Let D be any (regular) D-class of S. In any subgroup G of S, the equation a 2 = a 3 implies that a = e, the identity element of G, and so S has trivial subgroups.It follows that every group H -class, and hence every H -class of S is trivial, which is to say that S is a combinatorial (i.e.H -trivial) semigroup.
(iii) Since J a ≤ J x it follows that J = J x is the maximum J -class of S (where x represents any solution to (15)).Since EHP-classes are closed under the taking of homomorphisms, the principal factor J ∪ {0} also belongs to B, and any solution to (15) in S is also a solution to (15) in J ∪ {0}.Suppose that x R a in S, and hence in S/(S − J) also.Then since x ∈ E, it follows that a = xa.But then a = axa = a 2 , so that a ∈ E. Dually if x L a then a is also idempotent.We conclude that Condition (16) holds.
Remark 2.5.It is possible for a semigroup S to satisfy all three conditions of Proposition 2.4 yet for S not to belong to B. For example take the six-element semigroup A 1  2 , which is the Rees matrix 0-simple semigroup with adjoined identity element 1, given by M 0 [{e}, 2, 2; P ] 1 , where {e} is a one-element group and e e e 0 .
Taking x = 1, we see that each of (i), (ii), and (iii) is satisfied.However A 1 2 ∈ B: taking a = 1 we see that we must take x = 1 in order to satisfy the condition of Proposition 2.4.However with x = 1, for the single non-idempotent element a = (e; 2, 2) of A 1 2 , we have ax = xa = a ∈ E(S), contrary to Lemma 2.3.We next consider the more restricted equational system V ⊆ B, consisting of all semigroups that possess a universal inverse element: Let S ∈ V, and so Proposition 2.4 applies.In particular S is a regular periodic combinatorial semigroup.Moreover, (17) implies that S is bisimple, and since any periodic bisimple semigroup is completely simple (Corollary 2.56 of [3]), we conclude that S is completely simple.However, a completely simple combinatorial semigroup is none other than a rectangular band, which certainly satisfies (17).Indeed this gives the following curious formulation of the property of the existence of a universal inverse.Proposition 2.6.For any semigroup S either ∩ a∈S V (a) = ∅ or ∩ a∈S V (a) = S, the latter occurring if and only if S is a rectangular band.

2.3.
Applying the EHP theorem.The previous section also serves to introduce a strategy for applying the EHP theorem.The general approach is to systematically list semigroup equations and identify the corresponding semigroup classes.As an example that leads to a new result, we go by way of the following EHP class.
Proposition 2.7.The following are equivalent for a semigroup S: (i) S satisfies Proof.(i) ⇒ (ii).It follows immediately from (18) that a R a 2 .(ii) ⇒(i).Since a R a 2 , there exists y ∈ S 1 such that a = a 2 y.If y ∈ S we may take x = y in order satisfy (18), otherwise put x = a.
(ii) ⇔ (iii).Clearly (iii)⇒ (ii).For the converse direction take (a, b) ∈ R in S. Then since a R a 2 and R is a left congruence we get a R a 2 R ab, and so R a is a subsemigroup of S.
Corollary 2.8.The following are equivalent for a semigroup S: (ii) S satisfies a R a 2 for all a ∈ S and each R-class contains an idempotent.
(iii) S is regular and each R-class of S is a subsemigroup of S.
Proof.Since equation ( 19) clearly implies both regularity and equation ( 18), it follows from Proposition 2.7 that (i) implies (iii), while (iii) certainly implies (ii).Finally, given (ii), for any a ∈ S there exists there exists y ∈ S 1 such that a = a 2 y.Moreover, there exists an idempotent e ∈ R a , whence there exists z ∈ S such that az = a 2 yz = e.Then since ea = a we have that x = yz ∈ S satisfies a = a 2 xa.
Definition 2.9.We (temporarily) define the EHP-classes of right regular and left regular semigroups, C r and C l respectively by the equation systems: The proof of our next theorem was first generated through use of the software package Prover 9 [10].It is the equational nature of EHP theory, which is based on the first order language, that allows computational access to theorems of this nature.Although that proof was not long, some steps seemed unmotivated and so we present a modified version, where the steps are more natural.In common with the Prover 9 argument, our proof still has two layers of what we might call nesting, as we choose elements that act on the right to return squares to their roots.Proof.It follows from Proposition 2.7 and its left-right dual that any completely regular semigroup is both right regular and left regular.By symmetry, in order to prove the converse it is enough to deal with the case where S ∈ C r , and by the left-right dual of Proposition 2.7, it is enough to show that a L a 2 for an arbitrary a ∈ S.
Choose and fix two members a ′ , a R ∈ S such that a = aa ′ a and a = a 2 a R and put Then r has three properties relevant to our purpose, (21) Moreover a 2 r = a implies a 2 r 2 = ar and since (22) shows that ar is idempotent we infer: (23) We next deduce that a = ara as follows: = ara 2 r (by definition of r R ) = ara (by ( 21)).
Now ra L a 2 as ra = a R a ′ a 2 (by ( 20)), and from (21), a 2 ra = a 2 .Since a = ara we then have a L ra L a 2 , which completes the proof.
Reformulating Theorem 2.10 in the terms of Corollary 2.8 yields the following result which, to our knowledge, is not in the literature.
Corollary 2.11.The following are equivalent for a regular semigroup S: (i) each R-class is a subsemigroup of S; (ii) each L -class is a subsemigroup of S; (iii) S is completely regular.
The equivalence of (i) and (ii) in Corollary 2.11 does not hold if we drop the assumption that S is regular: for example the Baer-Levi semigroup S, which is the semigroup of all injective mappings α on a countably infinite set X such that X \ Xα is infinite, is right simple, L -trivial and idempotent-free, so that α L α 2 is never true [4, Lemma 8.3 and Ex.8.1.1].
Corollary 2.11 may also be proved by a semantic argument that exploits properties of regular semigroups, as we next show.This complements the syntactic approach of the proof of Theorem 2.10.However, as stand alone proofs, the lengths of the two arguments are similar.Lemma 2.12.An inverse semigroup S has the property that a R a 2 (resp.a L a 2 ) for all a ∈ S if and only if S is a semilattice of groups.
Proof.For the forward implication, take a ∈ S. From the given condition it follows that a −1 = a −2 x for some x ∈ S. Then (a −1 ) −1 = (a −2 x) −1 , which is to say a = x −1 a 2 , from which it follows that a L a 2 .Since a R a 2 is given we have a H a 2 for all a ∈ S, so that S is both a union of groups and an inverse semigroup, whence S is a semilattice of groups.The converse implication is immediate.The dual statement is also immediate by symmetry.
We show that (i) implies (iii) in Corollary 2.11.Let a ∈ S and consider the principal factor P = J a ∪ {0}.Since S is regular and P is a quotient of the principal ideal of a (also regular), we have that P is also regular.It follows that R S a = R P a , and R a is a subsemigroup of P .Suppose further that P is completely 0-simple.Then since a R a 2 it follows that a H a 2 .In this case J a is a completely simple subsemigroup of S.
Otherwise P is a 0-simple semigroup that is not completely 0-simple, in which case J a contains a copy of the bicyclic semigroup I = x, y : xy = e for any choice of idempotent e ∈ J a [3, Theorem 2.54] or [6,Theorem 1.3.6].But then I is an inverse semigroup whose R-classes are subsemigroups of I, whence by Lemma 2.12, I is a semilattice of groups, which contradicts that I is the bicyclic semigroup (which is infinite, bisimple, and H -trivial).It follows that this case does not arise and so S is indeed completely regular.
We may also show that for any S ∈ C r , if for a given a ∈ S we have a = a 2 xa, then a = axa 2 (with the dual statement equally valid).This also follows once we have established that C r = CR for in those circumstances we have a L axa and R a ≥ R axa , whence it follows that axa H a, as D a is a completely simple semigroup.Moreover e = axa is the identity of the group H a for e is idempotent: e 2 = (axa)(axa) = ax(a 2 xa) = axa = e.Therefore a = ea = axa 2 , as claimed.
Theorem 2.10 also yields another pair of EHP bases for completely simple semigroups.Proof.We have by Proposition 2.1 that (i) and (iv) are equivalent.Clearly (i) implies (ii) as given a = abxba we have a = abya, where y = xb.Similarly (i) implies (iii).By symmetry it is enough now to prove that (ii) implies (iv).By taking b = a in (ii) we see that S satisfies a = a 2 xa, whence by Theorem 2.10, S is completely regular.It also follows from (ii) that S has only one J -class, whence S is completely simple.

The EHP theorem
3.1.Outline of proof of Theorem 1.1.The proof of Theorem 1.1 in the forward direction is simple for it is clear that if a class of algebras C is defined by an equation system then this property is preserved under the taking of homomorphic images and arbitrary direct products.Moreover, such a class C is automatically an elementary class as C is defined in the first order language.The converse direction however is a consequence of Lyndon's positivity theorem, which states that for an elementary class closed under taking surjective homomorphic images, a sentence is equivalent to a positive sentence (one free of negations).Thus we may assume that our class of algebras C such that C ⊆ HP (C) is the class of models of a set Σ of positive sentences.There is no loss of generality to assume that all quantifiers are at the front of the positive sentences.The remaining task then is to show that disjunctions in each ρ ∈ Σ may be removed.
Consider a sentence ρ ∈ Σ.We may express the equation systems of ρ as a finite conjunction of disjunctions, 1≤i≤m γ i , where each γ i is a finite disjunction: , and each α i,j is an atomic formula involving some subset of the full set of parameters and variables of ρ.Suppose that for some i, r i ≥ 2 (1 ≤ i ≤ m).We show that the conjunct γ i may be replaced by some α i,j and the resulting reduced sentence is equivalent to ρ for any elementary class C that is closed under HP .Repeating this for each conjunct γ i will see us arrive at the desired -free sentence.The quantifiers remain unchanged throughout.
In view of this, we suppress the symbol i and use the corresponding symbols r = r i , γ = γ i , and α j = α i,j .Let ρ j be the result of replacing γ in ρ by α j .Note that ρ j ⊢ ρ so that the class of models satisfied by (Σ ∪ ρ j ) \ ρ is a subclass of C. We wish to show that for some j the reverse containment holds.Assume by way of contradiction that this is not the case.Then for each j (1 ≤ j ≤ r) there exists a model M j ∈ C such that ρ j fails in M j .Put M = Π r j=1 M j ∈ C and so M |= γ. (This stage of the argument only requires that C is closed under the taking of finitary direct products.However since C is an elementary class, C is closed under the taking of ultraproducts; C being closed under finitary direct products and ultraproducts then implies that C is in fact closed under the taking of arbitrary direct products.) The nature of the argument may be illustrated in the simplest case where ρ has only one pair of existential quantifiers, for instance, let us say that each α j has a single equation: α j : (∀a j )(∃x j ) : u j (a j , x j ) = v j (a j , x j ), where a j and x j are the respective vectors of parameters and variables of the equation u j = v j .Since M j |= α j it follows that for M j , ∃a j such that ∀x j u j (a j , x j ) = v j (a j , x j ).Since M |= γ we may select ã = (a 1 , . . ., a j , . . ., a r ) as our parameter choices for M and there exists a corresponding choice of variables x = (x 1 , . . ., x j , . . ., x r ) such that for some j, u j (ã, x) = v j (ã, x).However, taking the projection of this last equation onto the jth component then yields the contradiction that u j (a j , x j ) = v j (a j , x j ).
In general however, an equation system ρ ∈ Σ may have any finite number of alternations of existential quantifiers.Since satisfaction for such a sentence is defined recursively on the string of quantifiers, the above argument needs to be taken by induction on the number of quantifiers through the stages outlined in the previous discussion.This technical argument however does not require any additional facet to the proof strategy presented in the previous paragraph.The complete argument is given in [7, Theorem 3.1].

3.2.
The dual variety theorem for semigroups.An EHP-class C defined without the use of the ∃ quantifier is a variety, and in particular the class is closed under the taking of subalgebras.(Birkhoff's theorem says that a class of algebras C is defined by a countable list of identities if and only if C is closed under the operator HSP .)On the other hand, if the class is defined without the use of the ∀ symbol then the class is closed under the taking of superalgebras, meaning that if A ∈ C and A ≤ B, where B is an algebra in the defining signature of the algebra class under consideration, then B ∈ C also.
Here we prove the converse for the class of Semigroups: if an EHP-class C is closed under the taking of superalgebras it follows that C may be defined by equations of the type

Definition 3.1. An equation system is called existential if it is has no instances of the ∀ quantifier. An EHP-class is called existential if it has a basis of existential equation systems.
In the model theory literature what we call here an existential equation system is known as a primitive positive sentence.First let us suppose that C is an EHP-class that is closed under the taking of containing algebras.Suppose that A is an algebra containing a trivial (one-element) subalgebra, T .Then as T ∈ C we have that A ∈ C by the containment property.It follows that if our algebra is of a type where every algebra contains a one-element algebra, such as Monoids or Groups, then C is the EHP class of all algebras of the type under consideration.Moreover, in this context all algebras satisfy all existential equation systems.It follows that the converse is trivially true as a class closed under the taking of containing algebras and a class defined by a basis of existential equation systems are both necessarily equal to the class of all algebras.
However, within the class of Semigroups, there are (infinite) semigroups that are idempotent-free, and so the previous observation does not apply.For example the equation (∃x) : x = x 2 defines the EHP-class of all semigroups that contain an idempotent.This is a proper class of semigroups that is contained in every existentially defined EHP-class of semigroups.

Theorem 3.2. An EHP-class of semigroups C is existential if and only if C is closed under the taking of containing semigroups. Equivalently, C is closed under the taking of codomains of homomorphisms.
Before we embark on the main proof we observe the equivalence with the second sentence.Suppose that the EHP-class C is closed under the taking of containing semigroups and let S ∈ C with α : S → T a homomorphism.Since C is closed under the taking of homomorphisms, Sα ∈ C, and since Sα ≤ T it then follows that T ∈ C. Conversely suppose that C is closed under the taking of codomains of homomorphisms and suppose that S ≤ T .We take α : S → T to be the identity mapping on S with codomain T , whence by the given condition T ∈ C.
Most of the remainder of the section is devoted to the proof of Theorem 3.2, which is completed after some preliminary lemmas and discussion.The main challenge of the proof is facilitating a kind of quantifier elimination, achieved using the free product construction.For any semigroup S, we consider the free product F * S of S with the free semigroup F = F A on a countably infinite alphabet A = {A 1 , A 2 , . . .}.
Consider an arbitrary equation system ε satisfied by F * S: a quantified system p 1 = q 1 ∧ • • • ∧ p ℓ = q ℓ .As ε is satisfied, for every evaluation of the parameters (universally quantified variables in ε) in F * S, we may find witnesses to the existentially quantified variables, with the choice of each witness being made on the basis of prior quantified variables.As the parameters can be chosen without restriction, we are going to adopt the strategy that each parameter is chosen to be a free generator from the set A that has not appeared within the evaluation of any variable quantified before it: we refer to this as the free dependency condition.Thus if we have ∀a 1 ∃x 1 ∀a 2 , we choose a 1 to be A 1 and if we have chosen the witness x 1 to evaluate as A 2 A 1 sA 5 for some s ∈ S, then we will choose a 2 to take the value A 3 (or any other free generator except for those already in use: A 1 , A 2 , A 5 in the example).Without loss of generality however, it is clear that we may rename the free generators so that each parameter a i is assigned the free generator A i : in the example just given we could rename A 2 and A 3 and choose the witness A 3 A 1 sA 5 for x 1 and then choose a 2 → A 2 .We refer to this as an instance of a canonical evaluation of parameters, and we say that F * S satisfies ε under the canonical evaluation of parameters to mean that witnesses to the existential variables can be made to achieve equality p 1 = q 1 , . . ., p ℓ = q ℓ under the evaluation (and satisfying the free dependency condition).The following lemma holds in any variety within any signature of algebras, replacing "free semigroup" with a relatively free algebra in the variety.We use U to denote a semigroup instead of S to match later usage of the lemma.Lemma 3.3.Let ε be an equation system with parameters a 1 , . . ., a p and U be a semigroup.Let F = F A be the denumerably generated free semigroup with free generators A = {A 1 , A 2 , . . .}.If F * U satisfies ε under the canonical parameter evaluation, then U satisfies ε.
Proof.Every function φ : A → U extends to a retraction from F * U onto the subsemigroup U .We have witnesses X 1 , . . ., X q ∈ F * U for the canonical evaluation of parameters a 1 , . . ., a p as A 1 , . . ., A p satisfying the free dependency condition.Let γ be any evaluation of the parameters of ε in U , and let φ : A → U be φ(A i ) := γ(a i ).We may extend φ to a retraction onto U , and use witnesses φ(X 1 ), . . ., φ(X q ) in U to verify satisfaction of ε.
Note that the free dependency condition is used only at the final step of this proof: if x i is (existentially) quantified prior to (the universally quantified) a j , we should have that the choice of φ(X i ) can yield satisfaction of ε for all subsequent evaluations of a j .But if X i contained an occurrence of A j , then the value of φ(X i ) would in general depend on the evaluation γ(a j ) = φ(A j ) of a j .
Every element of F * S may be written uniquely in the form f 1 s 1 f 2 . . .s k−1 f k , where each f i is an element of F A , each s i is an element of S and f 1 and possibly f k could be empty (though note that if k = 1, then this expression is simply f 1 and then f 1 cannot be empty).We refer to this as the normal form for an element of F * S. If z 1 . . .z p is an arbitrary semigroup word (possibly with repeats in the sequence of letters z 1 , . . ., z p ), then under any evaluation of the letters {z 1 , . . ., z p } into F * S, the word z 1 . . .z p gives rise to a product of normal forms Depending on the value of k i , and on whether f i,1 or f i,ki are empty, the product in (24) may give rise to sequences of consecutive instances of elements of S; a maximal block of consecutive elements of S that arises from such a product will be called an S-run.So for example, if letters z 1 , z 2 , z 3 , z 4 are evaluated in F * S as A 1 s 1 , s 2 A 2 s 1 A 3 s 3 , s 2 and s 1 A 1 respectively, then the word z 1 z 2 z 3 z 4 evaluates as , and we have S-runs s 1 s 2 , s 1 and s 3 s 2 s 1 .These of course collapse to individual elements of S in the reduction of (24) to normal form, but we are interested in the uncollapsed form.For each S-run we may also create an abstract run, which is a matching semigroup word in the alphabet {x s | s ∈ S} of variables indexed by elements of S; so the S-run s 3 s 2 s 1 becomes x s3 x s2 x s1 .
If F * S satisfies an equation system ε under the canonical evaluation of parameters, then the chosen witnesses in F * S will provide a collection of equalities between S-runs.More precisely, each equality in ε produces an equality in F * S of the form where S 1 , . . ., S ki−1 and T 1 , . . ., T ℓi−1 are S-runs.As this is an equality holding in the free product, it follows that k i = ℓ i and that S 1 = T 1 , . . ., S ki−1 = T ki−1 in S (and that f i = g i are identical as words in A + , or empty).For such a choice c of witnesses to the canonical evaluation, let ε c denote the existential equation systems consisting of the conjunction of the equalities arising from the resulting abstract S-runs, across the witnessing evaluations of all the equalities As an example, consider the equation system and consider a semigroup S in which the canonical evaluation of a 1 , a 2 into F * S has choices for x 1 , x 2 , x 3 satisfying the free dependency condition that lead to satisfaction of the equalities: an example might be X 1 := s 1 A 1 , X 2 := A 2 s 1 and X 3 = s 2 .(Note that as x 1 is quantified prior to a 2 the free dependency condition requires that the word X 1 should not involve A 2 , because the value of x 1 should not in general depend on the choice of a 2 .)In this hypothetical scenario, we have and ).From the first equality we find that s 1 = s 1 and s 1 s 2 = s 2 s 1 .From the second equality we find that s 2 = s 2 s 2 .Then for this choice c we obtain ε c as Obviously the equality x s1 = x s1 here is redundant and could be removed.One can further see that s 1 could be replaced by s 2 in this sentence, so that ε c is logically equivalent to (∃x) x = x 2 .Lemma 3.4.Let ε be an equation system satisfied by F * S, under the canonical parameter evaluation for some semigroup S. Then for any choice c of witnesses in F * S to the satisfaction of the equalities in ε we have S |= ε c and ε c ⊢ ε within the class of semigroups.
Proof.Fix a choice c of witnesses, x i → X i ∈ F * S. The construction of ε c from this choice trivially ensures that S |= ε c , which proves the first claim.Now assume that U is any semigroup satisfying ε c ; we show that U |= ε.We may find witnesses to the canonical evaluation of parameters in F * U , as the witnesses to satisfaction of ε c in U provide the required U -runs to match those from S in the satisfaction of ε in F * S under the canonical parameter evaluation: note that these will not violate the free dependency condition for existential witnesses, as they only provide the required U -runs, with any free parameters chosen in the evaluation of a variable x i following whatever was done in S for the choice c (which satisfied the free dependency condition).Then Lemma 3.3 shows that U satisfies ε.
Referring to the example given prior to Lemma 3.4, where ε c was logically equivalent to (∃x) x = x 2 , the statement ε c ⊢ ε in Lemma 3.4 is asserting that any semigroup containing an idempotent will satisfy For a given equation system ε and any S for which F * S satisfies ε under the canonical parameter evaluation, the maximal length of any S-run is bounded by the maximal number of consecutively adjacent existential variables within a word occurring in ε.Thus there is an upper bound ℓ on the number of S-runs of length more than 1 that appear in ε c (independent of S and c).Because equalities between S-runs of length 1 are trivial (they yield equalities x s = x s for some s ∈ S), the number of nontrivial conjuncts within ε c is at most ℓ also, so that up to logical equivalence, there are only finitely many different existential equation systems of the form ε c , with the number determined by the structure of the sentence ε only.We let H(ε) denote this (finite) set of existential sentences.The case of H(ε) = ∅ is possible, and corresponds to the situation where there are no nontrivial S-runs in any canonical evaluation, for any S.In this situation, note that ε is trivially equivalent to the equation system ε ′ obtained by including in ε the conjunct x = x, where x is a new (existentially quantified) variable.Because any element of F * S will satisfy x = x, we have the same witnesses as previously for ε (which by assumption all avoided any S-runs), along with an arbitrary witness for x.Thus H(ε ′ ) = {(∃x) : x = x}, so that we may let ε c denote the equation system (∃x) : x = x.
Proof of Theorem 3.2.Clearly an existential class is closed under the taking of containing semigroups.Conversely let us suppose that C is an EHP-class of semigroups that is closed under the operation of taking containing semigroups.
Let B be the existential class with EHP basis E ′ , which is the set of all existential equation systems that are satisfied by all members of C. Clearly C ⊆ B, and indeed B is the smallest existential class that contains C. Our task is to prove the reverse containment.
Let E be a set of equation systems characterising C and consider any ε ∈ E. We will show that there is an equation of the form ε c that can replace ε.Repeated application, across all members of E leads to a subset of E ′ , which will complete the proof.
As a first step we need to show that there is an equation of the form ε c that holds on all members of C. We may assume that H(ε) is not empty.Assume for contradiction that for each ε c ∈ H(ε) there is S c ∈ C that fails ε c .As C is closed under taking direct products we have that T := εc∈H(ε) S c ∈ C and then as C is closed under taking containing semigroups we have that F * T |= ε.But then T |= ε c for some choice of witnesses to the canonical parameter evaluation.But then all quotients of T satisfy ε c , contradicting the assumption that S c fails ε c .
Thus for every ε ∈ E there is an existential equation system of the form ε c such that ε c ∈ E ′ .By Lemma 3.4 we have that ε c ⊢ ε, so that ε c can replace ε in E.
The existential equations that are satisfied by every semigroup are explicitly identified in [7,Corollary 6.7].To conclude this section we note that this may be extended, at least at the level of an algorithmic solution to arbitrary equation systems.Satisfying equations in F * S by canonical parameter evaluation is somewhat reminiscent of solving equations in free semigroups, a problem originally solved by Makanin [11], and of continued interest and development.The connection turns out to be genuine, and a strong form of Makanin's algorithm can be used to show that it is decidable to determine if an equation system holds in the variety of all semigroups.
Theorem 3.5.The class of equation systems satisfied in the class of all semigroups is decidable.
Proof.As we now explain, Theorem 3.5 is a direct corollary of Makanin's celebrated solution [11] to solvability of equations over free semigroups, as extended to allow for rational constraints (see Chapter 12 of [9]).In the context of Makanin's algorithm, a system of equations on the free semigroup consists of a finite set of equalities ε between words in alphabet {A 1 , A 2 , . . .} ∪ {X 1 , X 2 , . . .} and we are asked whether there is a satisfying evaluation of the variables X i in the free semigroup A + (where A = {A 1 , A 2 , . . .} as before).In the absence of any constraint on the choice of the X i , this coincides with what we called the canonical parameter evaluation of the generators A 1 , A 2 , . . .(as themselves) in the equation system (∀A 1 , . . ., A n )(∃X 1 , . . ., X m )ε (for suitable n, m determined by the variables that appear in ε).Lothaire [9, §12.1.8]details an extension of Makanin's algorithm to allow for the variables X 1 , X 2 , . . . to be constrained by rational languages λ 1 , λ 2 , . . .over the alphabet A. This enables us to additionally enforce the free dependency condition for an equation system ε: constrain each variable X i to lie in the rational language λ i excluding letters in A that are quantified in ε to the right of the existential quantification of X i .Satisfaction of this constrained instance of the equation problem coincides in definition precisely with satisfaction of ε under the canonical parameter evaluation with free dependency condition holding.But this latter property is equivalent to unconditional satisfaction of the equation system ε: for the nontrivial direction, use the universal mapping property of A + with respect to itself (or alternatively use Lemma 3.4, using the fact that A + * A + ∼ = A + ).Thus the extension of Makanin's algorithm in [9, §12.1.8]can be used to decide satisfaction of arbitrary equation systems on A + .
Finally, the equation systems true on A + (with A a denumerable alphabet) are precisely those in the class of all semigroups.One direction of this claim follows trivially from the fact that A + is a semigroup.For the other direction, use the universal mapping property for A + with respect to any other semigroup S to find that if ε is satisfied by A + (under canonical parameter evaluation, with free dependency), then it is satisfied by S.

EHP-classes requiring both types of quantifier alternation
An open question in this new theory of EHP-classes is: For any n, does there exist an EHP-class C such that in any basis for C, n alternations of the existential quantifiers ∀ and ∃ are necessary in at least one equation of the basis?Example 2.3(iii) of [7] is the EHP-class C defined by: (∃y)(∀a)(∃x, z) : a = xyz, which is the class of semigroups S that have a maximum J -class J such that S/(S − J) is not a null semigroup.It is proved there that C cannot be defined by equations systems exclusively of the type The strategy for proving this type of result is two-fold.To show that (∀ . . .)(∃ . . . ) quantification is not possible we find a chain of semigroups S 1 ⊆ S 2 ⊆ . . ., with each S n ∈ C, such that the semigroup union S = ∪ ∞ n=1 S n ∈ C. It follows from this that C cannot be captured by an equation system based on a (∀ . . .)(∃ . . . ) quantification as that would imply that S ∈ C as well.(This phenomenon we have already observed in Section 2 in the context of the EHP-class of Monoids.) Next we wish to show that definition by a (∃ . . .)(∀ . . . ) quantification for C is also impossible.This is done by identifying a semigroup chain S 1 ⊆ S 2 ⊆ . . ., where no member of the chain lies in C, yet their union S = ∪ ∞ n=1 S n is a semigroup in C. Given that S ∈ C, if C possessed a quantification of the form (∃ . . .)(∀ . . .), it would follow that S n ∈ C for all sufficiently large n.
We are working with the class of Semigroups throughout and all quantifications are assumed to take place in some arbitrary semigroup S. Letters at the front (resp.end) of the alphabet a, b, c, (resp.x, y, z) denote parameters (resp.variables) in a given equation, typically written e : p = q.Proof.We prove the claim by applying the strategy we have just outlined.Let F A be the free semigroup on the infinite set of generators A = {a 1 , a 2 , . . ., x 1 , x 2 , . . .}.
Denote the finite subset {a 1 , . . ., a n , x 1 , . . ., x n } of A by A n .Let ρ be the congruence on F A generated by ρ 0 = {(b i x j , x j b i ) : where b i ∈ {a i , x i }, i ≤ j}, and put S = F A /ρ. Let S n ≤ S, where S n = a 1 ρ, . . ., a n ρ, x 1 ρ, . . ., x n ρ .In the following argument we suppress the symbol ρ and write a ∈ S n , b ∈ S and such like to stand for aρ ∈ S n , bρ ∈ S.
Thus we have a semigroup chain Observe that S n ∈ C as for any a, b ∈ S n we put x = x n and note that axb = abx as x n commutes with each member of A n .However we now show that S ∈ C. Put a = a 1 and let x ∈ S. Then x ∈ S n for some n.Put b = a n+1 and consider axb = a 1 xa n+1 .Since a n+1 commutes only with x j where j ≥ n + 1, we infer that any word w ∈ F A such that a 1 xa n+1 = w in S has the form w = w 1 a n+1 where w 1 is the result of a permutation of the letters of a 1 x.In particular a 1 xa n+1 = a 1 a n+1 x in S. Hence S does not satisfy the equation system (26).Therefore C cannot be defined by equations using only (∀ . . .)(∃ . . . ) quantification.
Next we wish to show that definition by a (∃ . . .)(∀ . . . ) quantification for C is also impossible.This is done by identifying a semigroup chain S 1 ≤ S 2 ≤ • • • , where no member of the chain lies in C, yet their union S = ∪ ∞ n=1 S n is a semigroup in C. The existence of such a chain together with the chain of the previous paragraph establishes our claim.
Let F n be the free semigroup on A n = {a 1 , . . ., a n , x 1 , . . ., x n } (n ≥ 1) and let F A denote the free semigroup on A= ∪ ∞ n=1 A n .Let ρ be the congruence on F A generated by ρ 0 where ρ 0 = {(ax n+1 b, abx n+1 ), n ≥ 1, a ∈ F n , b ∈ F A } and put S = F A /ρ. Then S ∈ C for let us take any aρ ∈ S. Then a ∈ F n for some n ≥ 1.Take x = x n+1 and let bρ ∈ S. Then (ax n+1 b, abx n+1 ) ∈ ρ 0 , so that in S we have axb = abx, and therefore S ∈ C. Now define S n = {aρ : a ∈ F n }.Then S n ≤ S and we have the semigroup chain S 1 ≤ S 2 ≤ • • • ≤ S n ≤ S n+1 ≤ • • • , with S being the union of this chain.Now take a = a n and consider aρ, xρ, bρ ∈ S n .Then aρxρbρ = (a n xb)ρ.Since a n ∈ F m for any m < n, the only ρ 0 pairs involving a word with initial letter a n contain some letter x n+m ∈ A n (m ≥ 1).Hence a n xb = a n bx in S n , for any b that is not a power of x, from which we infer that S n does not satisfy the equation system (26).We conclude that S n ∈ C for all n ≥ 1 but, as we have witnessed, S ∈ C.
We therefore conclude that C cannot be defined by a basis of equation systems of the type

Theorem 1 . 1 .
[7, Theorem 3.1]  An elementary class C equals the class of models of some family of equation systems if and only if C is closed under taking homomorphic images of direct products.If the elementary class is the model class of a single sentence, then it is a class of models of a single equation system.

Proposition 2 . 1 .
The classes of Regular semigroups (Reg), Left groups (LG), Right groups (RG), Groups (G), Completely regular semigroups (CR), and Completely simple semigroups (CS) are the EHP-classes of semigroups defined by the following equations.
[12,a is that CN is closed under the taking of homomorphisms[12,  Lemma 3.1].Since CN is clearly closed under direct products and is an elementary class, it follows that CN is an EHP-class.With the symbols a, b, u, v satisfying the equations of reg, we may define each these five classes by means of one additional equation (to be included within the scope of the quantification of reg).The following proposition is [7, Theorem 5.2], extended by the inclusion of RI and CN .Proof.The cases of I, O and ES are given in[7, Theorem 5.2].The proof for CN is indicative of the approach, and we omit the very similar argument for RI.Recall that reg includes the conditions u ∈ V (a 2 ) and b ∈ V (b 2 ) so that aua and bvb are idempotents.Thus any conventional semigroup satisfies the given equation system because of the eEe ⊆ E condition of[12, Lemma 2.2].Conversely if S satisfies the equations then S is regular and for any two idempotents a and b we have: