Coproduct of free monoids.

From an “abstract nonsense” point of view, this follows from the fact that the underlying set functor $\mathbf{U}$, from monoids to sets, and the free monoid functor $\mathbf{M}$ from sets to monoids, are adjoints of each other. That is, for any set $A$ and any monoid $M$, we have a natural bijection $$\mathscr{S}\!\mathit{et}(A,\mathbf{U}(M)) \longleftrightarrow \mathscr{M}\!\mathit{onoid}(\mathbf{M}(A),M).$$ We say $\mathbf{U}$ is the right adjoint and $\mathbf{M}$ is the left adjoint of the pair. It is a theorem of Category Theory that left adjoints respect all colimits and right adjoins respect all limits.

Explicitly, for the case at hand, the disjoint union is the coproduct of sets, so for any sets $A,B,C$, we know that $$\mathscr{S}\!\mathit{et}(A+B,C) \cong \mathscr{S}\!\mathit{et}(A,C)\times \mathscr{S}\!\mathit{et}(B,C)$$ because the universal property of the disjoint union is that maps from the disjoint union correspond to pairs of maps from the constituents.

Likewise, for any monoids $M$, $N$, $P$, if $M\amalg N$ is their coproduct as monoids, $$\mathscr{M}\!\mathit{onoid}(M\amalg N,P) \cong \mathscr{M}\!\mathit{onoid}(M,P)\times\mathscr{M}\!\mathit{onoid}(N,P).$$

So we have that $$\begin{align*} \mathscr{M}\!\mathit{onoid}(\mathbf{M}(A+B),N) &\cong \mathscr{S}\!\mathit{et}(A+B,\mathbf{U}(N))\\ &\cong \mathscr{S}\!\mathit{et}(A,\mathbf{U}(N))\times \mathscr{S}\!\mathit{et}(B,\mathbf{U}(N))\\ &\cong \mathscr{M}\!\mathit{onoid}(\mathbf{M}(A),N)\times \mathscr{M}\!\mathit{onoid}(\mathbf{M}(B),N)\\ &\cong \mathscr{M}\!\mathit{onoid}(\mathbf{M}(A)\amalg\mathbf{M}(B),N). \end{align*}$$

More generally, as I mentioned, this follows because the coproduct is a colimit, and left adjoints respect colimits, and right adjoints respect limits. Symmetrically, the underlying set of the product is the product of the underlying sets; the underlying set of an inverse limit is the inverse limit of underlying sets, while the free monoid of a direct limit is the direct limit of the free monoids. Etc.


The ingredients required for this proof are

  • the functions $\eta_A:A\to M(A)$, $\eta_B:B\to M(B)$, and $\eta_{A\sqcup B}:A\sqcup B\to M(A\sqcup B)$;

  • the functions $i_A:A\to A\sqcup B$ and $i_B:B\to A\sqcup B$;

  • the monoid morphisms $a:M(A)\to N$ and $b:M(B)\to N$.

Other maps will be constructed through the universal properties in the relevant categories. (I am not comfortable using the notation $A+B$ for the coproduct of two sets $A$ and $B$. In my notation, $A\sqcup B$ is the coproduct.) The same proof works if $\mathbf{Monoids}$ is replaced by any concrete category that admits all free objects and coproducts (or at least, that the sets $A$, $B$, and $A\sqcup B$ are bases of some free objects $M(A)$, $M(B)$, and $M(A\sqcup B)$ in the target category).

We have two functions $a\circ\eta_A: A\to N$ and $b\circ\eta_B:B\to N$. By the universality of coproduct in $\mathbf{Sets}$, $a$ and $b$ uniquely induce $\gamma:A\sqcup B\to N$. That is, $$a\circ\eta_A = \gamma\circ i_A\text{ and }b\circ\eta_B=\gamma\circ i_B\,.$$

By the universality of free objects in $\mathbf{Monoids}$, we have a unique monoid morphism $c:M(A\sqcup B)\to N$ through which $\gamma$ factors. In other words, $$\gamma=c\circ\eta_{A\sqcup B}\,.$$ It remains to show that $c$ makes the diagram commutative.

We have a function $\eta_{A\sqcup B}\circ i_A:A\to M(A\sqcup B)$, which induces a unique monoid morphism $\iota_A:M(A)\to M(A\sqcup B)$ by the universality of free objects in $\mathbf{Monoids}$. That is, $$\iota_A\circ \eta_A=\eta_{A\sqcup B}\circ i_A\,.$$ Similarly, we have a unique monoid morphism $\iota_B:M(B)\to M(A\sqcup B)$. Likewise, $$\iota_B\circ \eta_B=\eta_{A\sqcup B}\circ i_B\,.$$

Consequently, $$(c\circ \eta_{A\sqcup B})\circ i_A=c\circ\left(\eta_{A\sqcup B}\circ i_A\right)=c\circ (\iota_A\circ\eta_A)=(c\circ \iota_A)\circ \eta_A\,.$$ However, $$(c\circ \eta_{A\sqcup B})\circ i_A=\gamma\circ i_A=a\circ \eta_A\,.$$ Thus, $\eta_A$ is an equilizer of the diagram $$A\underset{\eta_A}{\to} M(A)\underset{a}{\overset{c\circ \iota_A}{\rightrightarrows}}N\,.$$ Using the universality of free objects in $\mathbf{Monoids}$, we conclude that $$c\circ\iota_A=a\,.$$ Similarly, $$c\circ\iota_B=b\,.$$ Therefore, $M(A\sqcup B)$ together with $\iota_A:M(A)\to M(A\sqcup B)$ and $\iota_B:M(B)\to M(A\sqcup B)$ is the coproduct of $M(A)$ and $M(B)$.