This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

In mathematics, and more precisely in semigroup theory, a variety of finite semigroups is a class of semigroups having some nice algebraic properties. Those classes can be defined in two distinct ways, using either algebraic notions or topological notions. Varieties of finite monoids, varieties of finite ordered semigroups and varieties of finite ordered monoids are defined similarly.
This notion is very similar to the general notion of variety in universal algebra.
Definition
Two equivalent definitions are now given.
Algebraic definition
A variety V of finite (ordered) semigroups is a class of finite (ordered) semigroups that:
 is closed under division.
 is closed under taking finite Cartesian products.
The first condition is equivalent to stating that V is closed under taking subsemigroups and under taking quotients. The second property implies that the empty product—that is, the trivial semigroup of one element—belongs to each variety. Hence a variety is necessarily nonempty.
A variety of finite (ordered) monoids is a variety of finite (ordered) semigroups whose elements are monoids. That is, it is a class of (ordered) monoids satisfying the two conditions stated above.
Topological definition
In order to give the topological definition of a variety of finite semigroups, some other definitions related to profinite words are needed.
Let A be an arbitrary finite alphabet. Let A^{+} be its free semigroup. Then let be the set of profinite words over A. Given a semigroup morphism , let be the unique continuous extension of to .
A profinite identity is a pair u and v of profinite words. A semigroup S is said to satisfy the profinite identity u = v if, for each semigroup morphism , the equality holds.
A variety of finite semigroups is the class of finite semigroups satisfying a set of profinite identities P.
A variety of finite monoids is defined like a variety of finite semigroups, with the difference that one should consider monoid morphisms instead of semigroup morphisms .
A variety of finite ordered semigroups/monoids is also given by a similar definition, with the difference that one should consider morphisms of ordered semigroups/monoids.
Examples
A few examples of classes of semigroups are given. The first examples uses finite identities—that is, profinite identities whose two words are finite words. The next example uses profinite identities. The last one is an example of a class that is not a variety.
More examples are given in the article Special classes of semigroups.
Using finite identities
 The most trivial example is the variety S of all finite semigroups. This variety is defined by the empty set of profinite equalities. It is trivial to see that this class of finite semigroups is closed under subsemigroups, finite products, and quotients.
 The second most trivial example is the variety 1 containing only the trivial semigroup. This variety is defined by the set of profinite equalities {x = y}. Intuitively, this equality states that all elements of the semigroup are equal. This class is trivially closed under subsemigroups, finite products, and quotients.
 The variety Com of commutative finite semigroups is defined by the profinite equality xy = yx. Intuitively, this equality states that each pair of elements of the semigroup commutes.
 The variety of idempotent finite semigroups is defined by the profinite equality xx = x.
More generally, given a profinite word u and a letter x, the profinite equality ux = xu states that the set of possible images of u contains only elements of the centralizer. Similarly, ux = x states that the set of possible images of u contains only left identities. Finally ux = u states that the set of possible images of u is composed of left zeros.
Using profinite identities
Examples using profinite words that are not finite are now given.
Given a profinite word, x, let denote . Hence, given a semigroup morphism , is the only idempotent power of . Thus, in profinite equalities, represents an arbitrary idempotent.
The class G of finite groups is a variety of finite semigroups. Note that a finite group can be defined as a finite semigroup, with a unique idempotent, which in addition is a left and right identity. Once those two properties are translated in terms of profinite equality, one can see that the variety G is defined by the set of profinite equalities
Classes that are not varieties
Note that the class of finite monoids is not a variety of finite semigroups. Indeed, this class is not closed under subsemigroups. To see this, take any finite semigroup S that is not a monoid. It is a subsemigroup of the monoid S^{1} formed by adjoining an identity element.
Reiterman's theorem
Reiterman's theorem states that the two definitions above are equivalent. A scheme of the proof is now given.
Given a variety V of semigroups as in the algebraic definition, one can choose the set P of profinite identities to be the set of profinite identities satisfied by every semigroup of V.
Reciprocally, given a profinite identity u = v, one can remark that the class of semigroups satisfying this profinite identity is closed under subsemigroups, quotients, and finite products. Thus this class is a variety of finite semigroups. Furthermore, varieties are closed under arbitrary intersection, thus, given an arbitrary set P of profinite identities u^{i} = v^{i}, the class of semigroups satisfying P is the intersection of the class of semigroups satisfying all of those profinite identities. That is, it is an intersection of varieties of finite semigroups, and this a variety of finite semigroups.
Comparison with the notion of variety of universal algebra
The definition of a variety of finite semigroups is inspired by the notion of a variety of universal algebras. We recall the definition of a variety in universal algebra. Such a variety is, equivalently:
 a class of structures, closed under homomorphic images, subalgebras and (direct) products.
 a class of structures satisfying a set of identities.
The main differences between the two notions of variety are now given. In this section "variety of (arbitrary) semigroups" means "the class of semigroups as a variety of universal algebra over the vocabulary of one binary operator". It follows from the definitions of those two kind of varieties that, for any variety V of (arbitrary) semigroups, the class of finite semigroups of V is a variety of finite semigroups.
We first give an example of a variety of finite semigroups that is not similar to any subvariety of the variety of (arbitrary) semigroups. We then give the difference between the two definition using identities. Finally, we give the difference between the algebraic definitions.
As shown above, the class of finite groups is a variety of finite semigroups. However, the class of groups is not a subvariety of the variety of (arbitrary) semigroups. Indeed, is a monoid that is an infinite group. However, its submonoid is not a group. Since the class of (arbitrary) groups contains a semigroup and does not contain one of its subsemigroups, it is not a variety. The main difference between the finite case and the infinite case, when groups are considered, is that a submonoid of a finite group is a finite group. While infinite groups are not closed under taking submonoids.
The class of finite groups is a variety of finite semigroups, while it is not a subvariety of the variety of (arbitrary) semigroups. Thus, Reiterman's theorem shows that this class can be defined using profinite identities. And Birkhoff's HSP theorem shows that this class can not be defined using identities (of finite words). This illustrates why the definition of a variety of finite semigroups uses the notion of profinite words and not the notion of identities.
We now consider the algebraic definitions of varieties. Requiring that varieties are closed under arbitrary direct products implies that a variety is either trivial or contains infinite structures. In order to restrict varieties to contain only finite structures, the definition of variety of finite semigroups uses the notion of finite product instead of notion of arbitrary direct product.
References
 Pin, JeanÉric (20161130). Mathematical Foundations of Automata Theory (PDF). pp. 141–160.
 Pin, JeanÉric (1986). Varieties of formal language. New York: Plenum Publishing Corp.
 Eilenberg, S (1976). Automata, languages, and machines. New york: Harcourt Brace Jovanovich Publishers. pp. chapters "Depth decomposition theorem” and “Complexity of semigroups and morphisms”.
 Almeida, J (1994). Finite semigroups and universal algebra. Rivere Edge, NJ: World Scientific Publishing Co. Inc.