Coproducts exist in the category of groups

For the proof that coproducts of groups exist, see also any book on combinatorial group theory, but I also recommend that this notion is seen in the context of the category of groupoids admirably described in the downloadable book Categories and Groupoids.

The point is that a disjoint union $D= \sqcup_i G_i$ of groups is naturally a groupoid; and for any groupoid $G$ with object set $X$ and function $f: X \to Y$ there is a groupoid $U_f(G)$ with object set $Y$ and satisfying a nice universal property. In particular, if $Y$ is a singleton, we get the universal group $U(G)$ of the groupoid. In particular, $U(D)$ is the coproduct of the groups $G_i$.

A fact related to homotopy theory and the fundamental group of the circle is that if $\mathcal I$ is the groupoid with two objects $0,1$ and only two nonidentity morphisms, $\iota: 0 \to 1$ and $\iota^{-1}: 1 \to 0$ then $U(\mathcal I)$ is the group $\mathbb Z$ of integers!

If you take a disjoint union $D$ of copies of $\mathcal I$, indexed by a set $S$, say, and then take $U(D)$, you get the free group on the set $S$.


Let $A,B$ be groups, then $C$ (with homomorphisms $i_a : A \to C$, $i_b : B \to C$) is the coproduct if given any $C'$ with group homomorphisms $a:A \to C'$, $b:B \to C'$ there exists a unique map $i : C \to C'$ such that $a = i \circ i_a$ and $b = i \circ i_b$. That's just taking the general definition of a coproduct and writing it out with "groups" instead of "objects" and "group homomorphisms" instead of "morphisms" so we haven't done anything yet.

Now I claim that if we let $C$ be the free product of groups $A \star B$ (which always exists) and $i_a,i_b$ the inclusion maps then this is the coproduct. Recall that the free product of groups is the set of words made from the alphabet $A \cup B$, reducing when possible. (example: in $\{T,F\}\star \mathbb R^\times$ the elements $T\cdot \sqrt 2 \cdot \sqrt 2\cdot F\cdot 3\cdot T$ and $T\cdot 2\cdot T\cdot \tfrac{1}{2}\cdot 6\cdot F\cdot F$ are equal but $T3F$ is not equal to $3TF$).

To prove this assume some $C'$ with maps $a,b$ as before, we need to provide a unique $i : C \to C'$ that satisfies the equations. Given that all we really have to go with is the definition of free product and the use of the maps $a,b$, if you think about how to do this for a while you might come up with the following idea.

Map $T\cdot \sqrt 2 \cdot \sqrt 2\cdot F\cdot 3\cdot T \in C$ to $a(T)\cdot b(\sqrt 2 \cdot \sqrt 2)\cdot a(F)\cdot b(3)\cdot a(T) \in \mathbb C'$. Defining this map formally would be a bit of a nightmare notationally so we'll just call it $i$ and it does satisfy the properties $a = i \circ i_a$, $b = i \circ i_b$ because if you take a word $w$ from $A$ (resp. $B$) and apply it to the RHS of the equation you get $a(w)$ (resp. $b(w)$) which is the same as the LHS.

To show uniqueness suppose there was some map $i'$ with the same properties. Since $i'$ is a group homomorphism given words $w_a \in A$ and $w_b \in B$ $$i'(i_a(w_a) \cdot i_b(w_b)) = a(w_a) \cdot b(w_b)$$ it should be obvious how to prove $i' = i$ by induction on the number of times an element of $C$ changes from words in $A$ to words in $B$ but actually writing it out wouldn't give any further insight.