# Coproduct of Free Monoids

## Theorem

Let $\mathbf {Mon}$ be the category of monoids.

Let $\map M A$ and $\map M B$ be free monoids on sets $A$ and $B$, respectively.

Let $A \sqcup B$ be the disjoint union of $A$ and $B$.

Then the free monoid $\map M {A \sqcup B}$ on $A \sqcup B$ is the coproduct of $\map M A$ and $\map M B$ in $\mathbf {Mon}$.

## Proof

By Coproduct is Unique, it suffices to verify that $\map M {A \sqcup B}$ is a coproduct for $\map M A$ and $\map M B$.

By the UMP of $\map M A$, $\map M B$ and $\map M {A \sqcup B}$, we have the following commutative diagram:

$\begin {xy} <0em, 5em>*+{N} = "N", <-5em,0em>*+{\map M A} = "MA", <0em,0em>*+{\map M {A \sqcup B} } = "MAB", <5em,0em>*+{\map M B} = "MB", <-5em,-5em>*+{A} = "A", <0em,-5em>*+{A \sqcup B} = "AB", <5em,-5em>*+{B} = "B", "A";"MA" **@{-} ?>*@{>} ?*!/_.8em/{i_A}, "B";"MB" **@{-} ?>*@{>} ?*!/^.8em/{i_B}, "AB";"MAB" **@{-} ?>*@{>} ?*!/_.8em/{i_{A \mathop \sqcup B} }, "A";"AB" **@{-} ?>*@{>} ?*!/^.8em/{i_1}, "B";"AB" **@{-} ?>*@{>} ?*!/_.8em/{i_2}, "MA";"MAB" **@{-} ?>*@{>} ?*!/_.8em/{j_1}, "MB";"MAB" **@{-} ?>*@{>} ?*!/^.8em/{j_2}, "MA";"N" **@{-} ?>*@{>} ?*!/_.8em/{\bar f}, "MB";"N" **@{-} ?>*@{>} ?*!/^.8em/{\bar g}, "MAB";"N" **@{--} ?>*@{>} ?*!/_.8em/{\bar h}, \end{xy}$

$j_1 = \overline {\paren {i_{A \mathop \sqcup B} \circ i_1} }$
$j_2 = \overline {\paren {i_{A \mathop \sqcup B} \circ i_2}}$
and $i_1$, $i_2$ are the injections for the coproduct.