---- > [!definition] Definition. ([[monoid]]) > A **monoid** is a [[semigroup]] $(M, \cdot)$ with an identity element. > > A monoid $(M, \cdot)$ is essentially the same thing as a [[category|small category]] with only one object $M$. The morphisms $\text{Hom}(M,M)$ in this category are just elements $m$ of $M$; composition of morphisms is given by the monoid operation $\cdot$. (You can view each $m$ as a function $M \to M$.) > > A **monoid homomorphism** $f: M \to N$ is a map preserving the [[binary operation]] and [[identity]]: $f(x y)=f(x) f(y) \text{ and } f(e_{M})=e_{N}.$ > > Monoids are objects of [[category]] $\mathsf{Mon}$, whose morphisms are monoid homomorphisms. ^definition > [!note] Remark. > There are two different types of [[category]] at play here: >- Every [[monoid]] $M$ is itself a (small) one-object [[category]] >- Monoids together with monoid homomorphisms form the [[category]] $\mathsf{Mon}$ > A [[covariant functor|functor]] $\mathscr{F}$ between monoids $M$ and $N$ is determined by where it sends morphisms $m$.[^1] Functoriality says $\mathscr{F}(e_{M})=e_{N} \text{ and }\mathscr{F}(m n)=\mathscr{F}(m)\mathscr{F}(n)$ which is just the definition of a monoid homomorphism. Thus, *a functor between monoids is precisely a morphism in $\mathsf{Mon}$*. > ^note [^1]: Since the categories each only have one object. > [!basicexample] > - $\mathbb{N} \cup \{ 0 \}$ forms a monoid under addition. > - A [[group]] is a [[monoid]] in which every element has an inverse (i.e., every morphism is an [[isomorphism]] — in fact, an [[automorphism]] since there is only one object). ^basic-example ---- #### ---- #### References > [!backlink] > ```dataview > TABLE rows.file.link as "Further Reading" > FROM [[]] > FLATTEN file.tags as Tag > WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom" > GROUP BY Tag > ``` > [!frontlink] > ```dataview > TABLE rows.file.link as "Further Reading" > FROM outgoing([[]]) > FLATTEN file.tags as Tag > WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom" > GROUP BY Tag > ```