Notation Let $X$ be a set. $M(X)$ will denote the free monoid on $X$. $U$ will be the forgetful functor from the category of monoids to the category of sets. Then $M(X)$ has the universal property
- for every monoid $N$ and for every function $f:X\to UN$, there exists a unique monoid homomorphism $\hat{f}:M(X)\to N$ such that $U(\hat{f})\circ i_X=f$
where $i_X:X\to UM(X)$ is the "inclusion" of $X$ in $M(X)$. I am trying to prove that:
- If $h:M\to N$ is a monomorphism in the category of monoid and monoid homomorphisms, then $U(h)$ is an injective function.
So let $h:M\to N$ be monic. Let $x,y\in M$ be such that $h(x)=h(y)$. I want to prove that $x=y$. I can consider $x$ and $y$ as functions $1\to M$ form the one-element set $1$ to $M$. So we have $h\circ x=h\circ y$ by assumption. I can't cancel $h$ on the left because $x$ and $y$ are not monoid homomorphisms, just functions. So I use the free monoid on $1$, denoted $M(1)$. I know there are monoid homomorphisms $\hat{x},\hat{y}:M(1)\to M$ such that $U(\hat{x})\circ i=x$ and $U(\hat{y})\circ i=y$. I would like to deduce that $\hat{x}=\hat{y}$, hence that $x=y$ by universality of $M(1)$. To do that, I need $h\circ \hat{x}=h\circ\hat{y}$, which I don't know how to prove:
May you give some help please?
You do know that $$U(h\hat{x})i = U(h)U(\hat{x})i = U(h)x = U(h)y = U(h\hat{y})i$$ though. The universal property of $M(1)$ hence yields (apply it to the function $f=U(h)x=U(h)y$) that $h\hat{x}=h\hat{y}$ and as $h$ is mono we find $\hat{x}=\hat{y}$, hence $x=\hat{x}i=\hat{y}i=y$.