TITLE: Set-theoretical description of the free product?
QUESTION [5 upvotes]: There is something in the definition of the free product of two groups that annoys me, and it's this "word" thing:

If $G$ and $H$ are groups, a word in $G$ and $H$ is a product of the form
$$
    s_1 s_2 \dots s_m,
$$
where each $s_i$ is either an element of $G$ or an element of $H$. 

So what is this "word" guy? Does it come out of the blue? Does it come from some sort of new operation that I can perform with the two sets $G$ and $H$ -in addition to the well-known ones of union, intersection, Cartesian product...?
Fortunatelly, I think there is nothing new under the sun of set operations: it's easy to realise that words can be identified with elements of some Cartesian product (see below):
$$
(s_1, s_2, \dots , s_m )  \ .
$$
And Cartesian product is a well-established set-theoretical operation.
So I tried to translate the rest of Wikipedia's definition 

Such a word may be reduced using the following operations:
Remove an instance of the identity element (of either $G$ or $H$).
  Replace a pair of the form $g_1g_2$ by its product in $G$, or a pair $h_1h_2$ by its product in $H$.
Every reduced word is an alternating product of elements of $G$ and elements of $H$, e.g.
$$
 g_1 h_1 g_2 h_2 \dots g_r h_r.
 $$
The free product $G ∗ H$ is the group whose elements are the reduced words in $G$ and $H$, under the operation of concatenation followed by reduction.

in an elementary set setting. First, consider the set of "unreduced" tuples of elements of $G$ and $H$
$$
U =  G \sqcup H \sqcup (G\times G) \times (G\times H) \sqcup (H\times G) \sqcup (H\times H) \sqcup (G\times G \times G) \sqcup \dots 
$$
More concisely:

EDIT:
I think the following formula may be less messier than the one I wrote previously:
$$
U = \bigsqcup_{r \geq 1} (S_1 \times \cdots \times S_r),
$$
where $S_i = G$ or $S_i = H$.

So, elements of $U$ are ordered tuples (unreduced ones)
$$
(s_1, s_2, \dots , s_m),
$$
where each $s_i$ is either an element of $G$ or an element of $H$.
The product of two unreduced tuples is defined by concatenation
$$
(s_1, \dots , s_m) \cdot (t_1,  \dots , t_n) = (s_1, \dots , s_m, t_1 , \dots , t_n) \ .
$$
Now, consider the following equivalence relation in the set of unreduced tuples $U$:
$$
(s_1, s_2, \dots , s_{i-1}, 1, s_{i+1}, \dots , s_n) \sim (s_1, s_2, \dots, s_{i-1}, s_i, \dots , s_n) \ ,
$$
where $1$ is either the unit element of $G$ or the one of $H$. And
$$
(s_1, s_2, \dots , s_i,s_{i+1}, \dots , s_r) \sim (s_1, s_2, \dots , s_is_{i+1}, \dots , s_r )
$$
whenever two adjacent $s_i, s_{i+1} \in G$ or $s_i, s_{i+1} \in H$ at the same time. 
If you want, you may call the equivalence class of a tuple under this equivalence relation a reduced tuple. So every reduced tuple is an alternating one, 
$$
(g_1, h_1, \dots , g_r , h_r) \ ,
$$
with $g_i \in G$ and $h_i \in H$ for all $i = 1, \dots , r$.
Define the free product of $G$ and $H$ as the quotient:
$$
G*H = U/\sim \ .
$$
Finally, one verifies that concatenation is well-defined on unreduced tuples and gives $G*H$ a group structure.
After performing this elementary exercise I understand perfectly well why nobody defines the free product in this way, but I still wanted to ask:

Is this correct?
Is it written somewhere?

REPLY [8 votes]: You can see essentially the same construction in two different ways in George Bergman's An Invitation to General Algebra and Universal Constructions in Chapter 2 (link is to a postscript file) for the free group. 
First, you define "the set of all terms in the elements of the set $X$ under the formal group operations $\mu$, $i$, $e$" to mean a set which is given with functions symb${}_T\colon X\to T$, $\mu_T\colon T^2\to T$, $i_T\colon T\to T$, and $e_T\colon T^0\to T$, such that each of these maps is one-to-one, their images are disjoint, and $T$ is the union of the images, and $T$ is generated by symb${}_T(X)$ under the operations $\mu_T$, $i_T$, and $e_T$. Such a set exists (it can be constructed inductively with enough care; given in Chapter 1 of the same notes). Then one defines an apropriate equivalence relation $\sim$ on $T$; the set $T/\sim$ gives the underlying set of the free group, and one defines the operations in the free group via representatives in the natural way. Bergman labels this "the logician's approach" (section 2.2). 
An alternative construction ("the classical construction", section 2.4) gives "free groups as groups of words". Again, you start with a set $X$, and let $T$ be the set of all group-theoretic terms of $X$; identify $X$ with its image under symb, and one defines a subset $T_{red}$ of "reduced terms" (defining what this means appropriately) and then defining operations $\otimes$, ${}^{(-)}$, and $e_T$ on this set to make it into a group. Proving it is a group can be done either in the straightforward but tedious way, or by using "van der Waerden's trick" (embed the set $T_{red}$ into a group of permutations, and check that the operations you defined correspond to the operations in the image, so that "group"-ness gets inherited). 
To get the free product, you let $X$ be the disjoint union of the underlying sets of $G$ and $H$, and either adds to the equivalence relation (in the "logician's approach"), or restricts the definition of "reduced words" (in the "classical approach"), in essentially the way you did.