Definition:Free Monoid

Definition
Let $S$ be a set.

A free monoid over $S$ is a monoid $M \left({S}\right)$ together with a mapping $i: S \to M \left({S}\right)$, subject to:


 * For all monoids $N$, for all mappings $f: S \to N$, there is a unique monoid homomorphism $\bar f: M \left({S}\right) \to N$, such that:


 * $\bar f \circ i = f$

Category-Theoretic Formulation
Let $\mathbf{Mon}$ be the category of monoids, and let $\mathbf{Set}$ be the category of sets.

Let $\left\vert{\cdot}\right\vert$ be the underlying set functor on $\mathbf{Mon}$.

Let $M \in \mathbf{Mon}_0$ be a monoid, and let $i: S \to \left\vert{M}\right\vert$ be a mapping.

Then $\left({M, i}\right)$ is said to be a free monoid over $S$ if for all $N \in \mathbf{Mon}_0$ and $f: S \to \left\vert{N}\right\vert \in \mathbf{Set}_1$, a unique $\bar f \in \mathbf{Mon}_1$ makes the following diagram commute:


 * $\begin{xy}

<0em,4em>*{\mathbf{Mon} :}, <0em,1em>*{\mathbf{Set} :},

<4em,4em>*+{M} = "M", <8em,4em>*+{N} = "N", "M";"N" **@{.} ?>*@{>} ?*!/_1em/{\bar f},

<4em,1em>*+{\left\vert{M}\right\vert} = "MM", <8em,1em>*+{\left\vert{N}\right\vert} = "NN", <4em,-3em>*+{S} = "S",

"MM";"NN" **@{-} ?>*@{>} ?*!/_1em/{\left\vert{\bar f}\right\vert}, "S";"MM" **@{-} ?>*@{>} ?*!/_1em/{i}, "S";"NN" **@{-} ?>*@{>} ?*!/^1em/{f} \end{xy}$