monoid
A monoid is an algebraic structure consisting of a set M equipped with an associative binary operation and an identity element. Formally, it is a pair (M, ⋅) where ⋅: M × M → M is closed and associative, and there exists an element e ∈ M such that e ⋅ a = a ⋅ e = a for all a ∈ M. If every element has an inverse, the monoid is a group; if inverses are not required, it remains a monoid.
Common examples include the natural numbers under addition with 0 as the identity, the natural numbers under
Submonoids are nonempty subsets that are closed under the operation and contain the identity. A monoid homomorphism
Monoids are foundational in algebra and computer science, where they model concatenation, endomorphisms, and program semantics.