Definition 4. A monoid is a set \(M\) with a binary operation \(\left( a, b \right) \mapsto a \circ b\) such that the following two axioms hold:
- Associativity: \(\left( a \circ b \right) \circ c = a \circ \left( b \circ c \right)\) for all \(a, b, c \in M\).
- Identity: There is an identity element \(e \in M\) such that \(e \circ a = a \circ e = a\) for all \(a \in M\).
A monoid is a commutative monoid if, in addition to 1. and 2., the following axiom also holds:
- Commutativity: \(a \circ b = b \circ a\) for all \(a, b \in M\).
- Since \(\circ\) is a binary operation, the resulting element, \(a \circ b\) is always in \(M\) for all \(a , b \in M\). We say that \(M\) is closed under \(\circ\) or that \(\circ\) is closed on \(M\).
- For simplicity, we usually refer to the set \(M\) as the monoid with the associated operation being implicit. We use this convention for other algebraic structures as well, even when there are multiple operations associated with the structure.
- We usually refer to the identity element as the identity.