The free monoid functor is fully faithful?
For every set $A$, there is a free monoid $A^*$ and a function $i_A : A \rightarrow A^*$, such that for all monoids $Z$ and functions $j : A \rightarrow Z$, there is a unique monoid morphism $j^* : A^* \rightarrow Z$, such that:
$$j^* \circ i_A = j$$
Consider the "free monoid functor" $F : \mathsf{Set} \rightarrow \mathsf{Mon}$. It maps a set $A$ to $A^*$ and a function $f : A\rightarrow B$ to $f^* : A^* \rightarrow B^*$.
I want to decide, whether $F$ is faithful, full or neither. I believe $F$ is full and faithful. In order to prove that, however, I apparently need, the fact that $i_A$ for every set $A$ is injective.
I want to use the UMP for that, but it is "weird" in the following sense: I have to somehow construct some arbitrary monoid structure on $A$, then we have:
$$id_A^* \circ i_A = id_A$$
So, in particular: $i_A$ is split mono and hence injective. It is weird, that I have to make such a non-canonical choice, so I wonder:
Is there a way to prove more "canonically", that $i_A$ in this case, is injective?
Now, that we know that:
Let $A,B$ be sets. Then the map $F_{A,B} : \mathsf{Set}(A,B) \rightarrow \mathsf{Mon}(A,B)$ has the inverse given by: $$\tilde{f} \mapsto id^*_B\circ \tilde{f}\circ i_A$$
One confirms this, again, by using the UMP. Therefore, $F$ is fully faithful.
Is my deduction correct?
(I also wonder, where I can look up simple facts like these, but I guess I'm going to ask another question for that later)
Solution 1:
To refute fullness, let $X$ be a one-element set and observe that the free monoid on it (which is isomorphic to $\mathbb N$ with the operation +) has lots of monoid-endomorphisms while $X$ has only one set-endomorphism. (Any other nonempty $X$ also gives a counterexample to fullness, but this one seems the simplest.)
To show that $i_A$ is always injective, you just need to check that, given any two distinct elements of $A$, they have distinct images under some set-map into the underlying set of a monoid. Then factor that map through $i_A$ to see that those two elements have distinct images under $A$.
Solution 2:
You don't have to construct a monoid structure on $A$, in fact in general you cannot. To see that $i_A$ is injective, you can explicitly describe the free monoid on $A$ and see that $i_A$ is indeed injective. Alternatively, let $x \neq y \in A$, consider the monoid $M = \mathbb{N} \times \mathbb{N}$. Let $j : A \to M$ be defined by: $$j(z) = \begin{cases} (1,0) & z = x \\ (0,1) & z = y \\ (0,0) & z \neq x, z \neq y \end{cases}$$
Then there exists a unique monoid morphism $j^* : A^* \to M$ such that $j^* \circ i_A = j$. You have $j(x) \neq j(y) \implies j^*(i_A(x)) \neq j^*(i_A(y)) \implies i_A(x) \neq i_A(y)$. Thus $i_A$ is injective, thus the functor is faithful.
On the other hand the free monoid functor is not full. Consider $A = \{x\}$ a singleton; then $A^* \cong \mathbb{N}$ with generator $1 \leftrightarrow x$. Then the map $x^n \mapsto x^{2n}$ is a morphism $A^* \to A^*$, but it's not the image of a map $A \to A$ under the free monoid functor (there is only one such map).
The flaw in your proof is that $(\operatorname{id}_B)^*$ is a map $B^* \to B^*$, not $B^* \to B$, so you do not get back a map $A \to B$ from $\tilde{f}$. Not that you get a map $\mathsf{Set}(A,B) \to \mathsf{Mon}(A^*, B^*)$ (this isn't what you wrote).