Slicker construction of the free product of groups
Solution 1:
Three constructions.
1. The existence of $\coprod_i G_i$ means that the functor $\prod_i \hom(G_i,-) : \mathsf{Grp} \to \mathsf{Set}$ is representable, which is an easy application of Freyd's Representability Criterion (see Mac Lane's book, V.6). In fact, $\mathsf{Grp}$ is complete, the functor preserves limits (because it is a limit of such functors), so that we only have to check the Solution Set Condition: Given a group $H$ equipped with homomorphisms $G_i \to H$, let $H' \leq H$ be the subgroup generated by all the images. Then $|H'| \leq \aleph_0 \sum_i |G_i|$. Hence, up to isomorphism, there is only a set of such $H'$. QED
2. If you already know that free groups exist (which is also an easy application of Freyd's Adjoint Functor Theorem): Let us denote with $U(-)$ the underlying set of a group (this distinction is important!), and with $F(-)$ the free group on a set (hence $F$ is left adjoint to $U$). Consider the free group on the disjoint union (i.e. coproduct) of the underlying sets, $F(\coprod_i U(G_i))$. For every $j$ we have a map of sets $\iota_j : U(G_j) \to U(F(\coprod_i U(G_i)))$. It doesn't lift to a homomorphism $G_j \to F(\coprod_i U(G_i))$. So let's just force this by modding out the corresponding relations: Consider the smallest normal subgroup of $F(\coprod_i U(G_i))$ containing $\iota_j(xy)^{-1} \iota_j(x) \iota_j(y)$ for all $j$ and $x,y \in U(G_j)$. The quotient by that subgroup is a coproduct $\coprod_i G_i$.
3. You write:
Suppose we define $ \ast_{i \in I} G_i$ to be the group given by the presentation $\langle \coprod_{i \in I} S_i | \coprod_{i \in I} R_i \rangle$ where, for each $i \in I$, $\langle S_i | R_i \rangle$ is a presentation for $G_i$. How can we show that this is indeed a coproduct? Specifically, how can we describe the canonical injections?
Notice that this is basically the same as the second construction I gave above. It's a little bit more general, though.
Recall what a group presentation really is: $\langle S|R \rangle$ is the group satisfying the following universal property: A homomorphism on $\langle S|R \rangle$ is just a map on $S$ which satisfies the relations in $R$. For example, a homomorphism on $\langle x : x^n=1 \rangle$ is just an $n$-torsion element.
Hence, a homomorphism on $\langle \coprod_i S_i | \coprod_i R_i \rangle$ (to some group) is a map on $\coprod_i S_i$ which satisfies the relations in $\coprod_i R_i$. But (by the universal property of $\coprod$ in $\mathsf{Set}$) this is the same as a family of maps on the $S_i$ which satisfy the relations in $R_i$. These correspond to homomorphisms on $\langle S_i | R_i \rangle$. Thus, $\langle \coprod_i S_i | \coprod_i R_i \rangle$ satisfies the universal property of $\coprod_i \langle S_i | R_i \rangle$.
The proof also shows what the coproduct inclusion $\langle S_j | R_j \rangle \to \coprod_i \langle S_i | R_i \rangle$ is: It maps a generator in $S_j$ to the corresponding generator in $\coprod_i S_i$.
Remark: All these three proofs work for arbitrary algebraic structures, as well as for arbitrary colimits. Hence, every algebraic category is cocomplete.
Element structure.
Many of the readers may think: "Ok all this abstract nonsense makes it possible to construct coproducts of groups rather easily, but in order to actually prove something, we often need the structure of the elements. It is better to define the set of reduced words directly and then endow it with a group structure!" First of all, it is a pain in the ass to verify the group axioms directly, since the multiplication is defined by cases. Secondly, the universal property actually makes it possible to derive the element structure:
Let $G' \leq \coprod_i G_i$ be the subgroup generated by the images of all coproduct inclusions $\iota_i : G_i \to \coprod_i G_i$. The inclusions $G_i \to G'$ induce a homomorphism $\coprod_i G_i \to G'$, and clearly $\coprod_i G_i \to G' \to \coprod_i G_i$ is the identity. Hence, $G' \to \coprod_i G_i$ is surjective, i.e. $G:=\coprod_i G_i$ is generated by the images of all $\iota_i$. It follows that every element of $G$ has the form $\iota_{i_1}(g_{i_1}) \cdot \dotsc \iota_{i_n}(g_{i_n})$. We may assume that $i_k \neq i_{k+1}$ (otherwise collect them) and that $g_{i_k} \neq 1$ (otherwise leave it out). Since there is no other simplification in sight, our guess is that this decomposition is unique.
So let us define the set $S$ of (formal) reduced words as all $(g_{i_1},\dotsc,g_{i_n})$, where $i_k$ are indices (which belong to the data) with $i_k \neq i_{k+1}$ and $g_j \in G_j$. This includes the empty word $(~)$. Note that each $G_i$ acts on $S$ via
$g (g_{i_1},\dotsc,g_{i_n}) := \left\{\begin{array}{ll} (g_{i_1},\dotsc,g_{i_n}) & g=1 \\ (g g_{i_1},\dotsc,g_{i_n}) & g \neq 1, g g_{i_1} \neq 1, i = i_1 \\ (g_{i_2},\dotsc,g_{i_n}) & g \neq 1, g g_{i_1}=1, i = i_1 \\ (g,g_{i_1},\dotsc,g_{i_n}) & g \neq 1, i \neq i_1\end{array}\right.$
Unfortunately the property $(gh)s=g(hs)$ still needs some calculation. The actions correspond to homomorphisms $G_i \to \mathrm{Sym}(S)$, which by the universal property induce a homomorphism $G \to \mathrm{Sym}(S)$, so that $G$ acts on $S$. For a reduced element $g = \iota_{i_1}(g_{i_1}) \cdot \dotsc \iota_{i_n}(g_{i_n})$ we have $g(~) = (g_{i_1},\dotsc,g_{i_n})$. Thus, the decomposition is unique.