#jsDisabledContent { display:none; } My Account |  Register |  Help

# Monoid

Article Id: WHEBN0000019652
Reproduction Date:

 Title: Monoid Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Monoid

In abstract algebra, a branch of mathematics, a monoid is an algebraic structure with a single associative binary operation and an identity element. Monoids are studied in semigroup theory as they are semigroups with identity. Monoids occur in several branches of mathematics; for instance, they can be regarded as categories with a single object. Thus, they capture the idea of function composition within a set. Monoids are also commonly used in computer science, both in its foundational aspects and in practical programming. The set of strings built from a given set of characters is a free monoid. Thalgebra)|magma]] with associativity and identity. The identity element of a monoid is unique.[1] A monoid in which each element has an inverse is a group.

Depending on the context, the symbol for the binary operation may be omitted, so that the operation is denoted by juxtaposition; for example, the monoid axioms may be written (ab)c = a(bc) and ea=ae=a. This notation does not imply that it is numbers being multiplied.

## Monoid structures

### Submonoids

A submonoid of a monoid (M, •) is a subset N of M that is closed under the monoid operation and contains the identity element e of M.[2][3] Symbolically, N is a submonoid of M if NM, xyN whenever x, yN, and eN. N is thus a monoid under the binary operation inherited from M.

### Generators

A subset S of M is said to be a generator of M if M is the smallest set containing S that is closed under the monoid operation, or equivalently M is the result of applying the finitary closure operator to S. If there is a generator of M that has finite cardinality, then M is said to be finitely generated. Not every set S will generate a monoid, as the generated structure may lack an identity element.

### Commutative monoid

A monoid whose operation is commutative is called a commutative monoid (or, less commonly, an abelian monoid). Commutative monoids are often written additively. Any commutative monoid is endowed with its algebraic preordering ≤, defined by xy if there exists z such that x + z = y.[4] An order-unit of a commutative monoid M is an element u of M such that for any element x of M, there exists a positive integer n such that xnu. This is often used in case M is the positive cone of a partially ordered abelian group G, in which case we say that u is an order-unit of G.

### Partially commutative monoid

A monoid for which the operation is commutative for some, but not all elements is a trace monoid; trace monoids commonly occur in the theory of concurrent computation.

## Examples

• The natural numbers, N, form a commutative monoid under addition (identity element zero), or multiplication (identity element one). A submonoid of N under addition is called a numerical monoid.
• The positive integers, N ∖ {0}, form a commutative monoid under multiplication (identity element one).
• Given a set A, all subsets of A form a commutative monoid under intersection operation (identity element is A itself).
• Given a set A, all subsets of A form a commutative monoid under union operation (identity element is the empty set).
• Generalizing the previous example, every bounded semilattice is an idempotent commutative monoid.
• In particular, any bounded lattice can be endowed with both a meet- and a join- monoid structure. The identity elements are the lattice's top and its bottom, respectively. Being lattices, Heyting algebras and Boolean algebras are endowed with these monoid structures.
• Every singleton set {x} closed under a binary operation • forms the trivial (one-element) monoid, which is also the trivial group.
• Every group is a monoid and every abelian group a commutative monoid.
• Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining es = s = se for all sS. This conversion of any semigroup to the monoid is done by the free functor between the category of semigroups and the category of monoids.[5]
• Thus, an idempotent monoid (sometimes known as find-first) may be formed by adjoining an identity element e to the left zero semigroup over a set S. The opposite monoid (sometimes called find-last) is formed from the right zero semigroup over S.
• Adjoin an identity e to the left-zero semigroup with two elements {lt; gt}. Then the resulting idempotent monoid {lt; e; gt} models the lexicographical order of a sequence given the orders of its elements, with e representing equality.
• The elements of any unital ring, with addition or multiplication as the operation.
• The set of all finite strings over some fixed alphabet Σ forms a monoid with string concatenation as the operation. The empty string serves as the identity element. This monoid is denoted Σ and is called the free monoid over Σ.
• Given any monoid M, the opposite monoid Mop has the same carrier set and identity element as M, and its operation is defined by xop y = yx. Any commutative monoid is the opposite monoid of itself.
• Given two sets M and N endowed with monoid structure (or, in general, any finite number of monoids, M1, ..., Mk), their is also a monoid (respectively, ). The associative operation and the identity element are defined pairwise.Jacobson (2009), p. 35 * Fix a monoid ''M''. The set of all functions from a given set to ''M'' is also a monoid. The identity element is a mapping any value to the identity of ''M''; the associative operation is defined . * Fix a monoid ''M'' with the operation • and identity element ''e'', and consider its ''P''(''M'') consisting of all s of ''M''. A binary operation for such subsets can be defined by . This turns ''P''(''M'') into a monoid with identity element {''e''}. In the same way the power set of a group ''G'' is a monoid under the . * Let ''S'' be a set. The set of all functions forms a monoid under . The identity is just the . It is also called the '''''' of ''S''. If ''S'' is finite with ''n'' elements, the monoid of functions on ''S'' is finite with ''n''''n'' elements. * Generalizing the previous example, let ''C'' be a and ''X'' an object in ''C''. The set of all s of ''X'', denoted End''C''(''X''), forms a monoid under composition of s. For more on the relationship between category theory and monoids see below. * The set of of s with the just s between single object categories. So this construction gives an between the '''Mon''' and a full subcategory of the category of (small) categories '''Cat'''. Similarly, the is equivalent to another full subcategory of '''Cat'''. In this sense, category theory can be thought of as an extension of the concept of a monoid. Many definitions and theorems about monoids can be generalised to small categories with more than one object. For example, a quotient of a category with one object is just a quotient monoid. Monoids, just like other algebraic structures, also form their own category, '''Mon''', whose objects are monoids and whose morphisms are monoid homomorphisms. There is also a notion of which is an abstract definition of what is a monoid in a category. A monoid object in '''''' is just a monoid. == Monoids in computer science == In computer science, many can be endowed with a monoid structure. In a common pattern, a of elements of a monoid is "" or "accumulated" to produce a final value. For instance, many iterative algorithms need to update some kind of "running total" at each iteration; this pattern may be elegantly expressed by a monoid operation. Alternatively, the associativity of monoid operations en=v_n\}. Thus, for example,

\langle p,q\,\vert\; pq=1\rangle

is the equational presentation for the bicyclic monoid, and

\langle a,b \,\vert\; aba=baa, bba=bab\rangle

is the plactic monoid of degree 2 (it has infinite order). Elements of this plactic monoid may be written as a^ib^j(ba)^k for integers i, j, k, as the relations show that ba commutes with both a and b.

## Relation to category theory

 Totality* Associativity Identity Divisibility Group-like structures. The entries say whether the property is required. No Yes No No No No Yes Yes No No No Yes Yes Yes No Yes No No No No Yes No No Yes No Yes No Yes Yes No Yes Yes No No No Yes Yes Yes No No Yes Yes Yes Yes No Yes Yes Yes Yes Yes *Closure, which is used in many sources, is an equivalent axiom to totality, though defined differently.

Monoids can be viewed as a special class of categories. Indeed, the axioms required of a monoid operation are exactly those required of morphism composition when restricted to the set of all morphisms whose source and target is a given object.[9] That is,

A monoid is, essentially, the same thing as a category with a single object.

More precisely, given a monoid (M, •), one can construct a small category with only one object and whose morphisms are the elements of M. The composition of morphisms is given by the monoid operation •.

Likewise, monoid homomorphisms are sures that the operation can be parallelized by employing a prefix sum or similar algorithm, in order to utilize multiple cores or processors efficiently.

Given a sequence of values of type M with identity element \varepsilon and associative operation *, the fold operation is defined as follows:

\mathrm{fold}: M^{*} \rarr M = l \mapsto \begin{cases} \varepsilon & \mbox{if } l = \mathrm{nil} \\ m * \mathrm{fold} \, l' & \mbox{if } l = \mathrm{cons} \, m \, l' \end{cases}

In addition, any data structure can be 'folded' in a similar way, given a serialization of its elements. For instance, the result of "folding" a binary tree might differ depending on pre-order vs. post-order tree traversal.

## Complete monoids

A complete monoid is a commutative monoid equipped with an infinitary sum operation \Sigma_I for any index set I such that:[10][11][12][13]

\sum_{i \in \emptyset}{m_i} =0;\quad \sum_{i \in \{j\}}{m_i} = m_j;\quad \sum_{i \in \{j, k\}}{m_i} = m_j+m_k \quad \textrm{for}\; j\neq k

and

\sum_{j \in J} In , a branch of , a '''monoid''' is an with a single and an . Monoids are studied in theory as they are semigroups with identity. Monoids occur in several branches of mathematics; for instance, they can be regarded as with a single . Thus, they capture the idea of within a set. Monoids are also commonly used in , both in its foundational aspects and in practical programming. The set of built from a given set of is a . The and are used in describing , whereas s and s provide a foundation for and . Some of the more important results in the study of monoids are the and the . The history of monoids, as well as a discussion of additional general properties, are found in the article on s. == Definition == Suppose that ''S'' is a and • is some , then ''S'' with • is a '''monoid''' if it satisfies the following two axioms: ;Associativity: For all ''a'', ''b'' and ''c'' in ''S'', the equation holds. ;Identity element: There exists an element ''e'' in ''S'' such that for every element ''a'' in ''S'', the equations hold. In other words, a monoid is a with an . It can also be thought of as a with associativity and identity. The identity element of a monoid is unique.If both ''e''1 and ''e''2 satisfy the above equations, then ''e''1 = ''e''1 • ''e''2 = ''e''2. A monoid in which each element has an is a . Depending on the context, the symbol for the binary operation may be omitted, so that the operation is denoted by juxtaposition; for example, the monoid axioms may be written $\left(ab\right)c = a\left(bc\right)$ and ea=ae=a. This notation does not imply that it is numbers being multiplied.

## Monoid structures

### Submonoids

A submonoid of a monoid (M, •) is a subset N of M that is closed under the monoid operation and contains the identity element e of M.[14][15] Symbolically, N is a submonoid of M if NM, xyN whenever x, yN, and eN. N is thus a monoid under the binary operation inherited from M.

### Generators

A subset S of M is said to be a generator of M if M is the smallest set containing S that is closed under the monoid operation, or equivalently M is the result of applying the finitary closure operator to S. If there is a generator of M that has finite cardinality, then M is said to be finitely generated. Not every set S will generate a monoid, as the generated structure may lack an identity element.

### Commutative monoid

A monoid whose operation is commutative is called a commutative monoid (or, less commonly, an abelian monoid). Commutative monoids are often written additively. Any commutative monoid is endowed with its algebraic preordering ≤, defined by xy if there exists z such that x + z = y.[16] An order-unit of a commutative monoid M is an element u of M such that for any element x of M, there exists a positive integer n such that xnu. This is often used in case M is the positive cone of a partially ordered abelian group G, in which case we say that u is an order-unit of G.

### Partially commutative monoid

A monoid for which the operation is commutative for some, but not all elements is a trace monoid; trace monoids commonly occur in the theory of concurrent computation.

## Examples

• The natural numbers, N, form a commutative monoid under addition (identity element zero), or multiplication (identity element one). A submonoid of N under addition is called a numerical monoid.
• The positive integers, N ∖ {0}, form a commutative monoid under multiplication (identity element one).
• Given a set A, all subsets of A form a commutative monoid under intersection operation (identity element is A itself).
• Given a set A, all subsets of A form a commutative monoid under union operation (identity element is the empty set).
• Generalizing the previous example, every bounded semilattice is an idempotent commutative monoid.
• In particular, any bounded lattice can be endowed with both a meet- and a [[Join and meet|join==Taxonavigation==

## Selected references

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.

Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.