Direct sum of finitely-many non-abelian groups
Solution 1:
Let me elaborate on Tsemo Aristide's anwser that the direct sum of abelian groups should be replaced by the so-called free product for non-abelian groups.
When we want to compare a construction from the theory of abelian groups with the situation of general groups, we first need a way of comparing the class of abelian groups with the class of groups in general. The usual way of doing this is to use categories. A category is just a collection of objects, together with special 'maps' between them (note that I'm glossing over a whole lot of details here, but the Wikipedia page on categories has a lot of information). For instance, there is the category of groups (with group homomorphisms as maps), the category of $\mathbb{R}$-vector spaces (with linear maps), the category of sets (with no restriction on the maps), etc.
In our case, we want to compare the category of groups with the category of abelian groups, and somehow transfer the notion of a direct sum from the latter to the former. To do that, we first need to express the direct sum in the language of categories, i.e. just refering to objects (abelian groups) and maps (group homomorphisms), and in particular without refering to elements of the groups involved. That may seem close to impossible at first glance, but it can be done using the following trick.
First, we notice that if $(A_i)_{i\in I}$ is any collection of abeliqn groups, then for any other abelian group $B$ there is a very natural (set-theoretic) bijection $$\textrm{Hom}(\oplus_{i \in I} A_i, B) \to \prod_{i \in I}\textrm{Hom}(A_i, B),$$ where $\oplus_{i \in I} A_i$ is the direct sum of the $A_i$ (you should at this point take the time to write down which map this is, and convince yourself that this map is indeed bijective). In words, this says that a homomorphism from $\oplus_{i \in I} A_i$ to $B$ and a collection of morphisms from every $A_i$ to $B$ are 'the same thing'. In fact, it turns out that the direct sum is unique with this property: if $A$ is any abelian group such that for any abelian group $B$ we get a natural bijection like above, then $A$ is isomorphic to $\oplus_{i \in I} A_i$. So this gives us precisely a characterisation of the direct product in terms of just the groups and the homomorphisms.
Now that we know what a direct sum looks like in the category of abelian groups, we can try doing the same for general groups. So given a collection $(G_i)_{i \in I}$ of not necessarily abelian groups, we want to find a group $G$ with the property that for any group $H$, there is a natural bijection $$\textrm{Hom}(G, H) \to \prod_{i \in I}\textrm{Hom}(G_i, H).$$ Based on the abelian case, we might expect that this group $G$ should be the direct product of the $G_i$, or perhaps the subset of the direct product $G_i$ of sequences with only finitely many non-identity components, but unfortunately these groups do not satisfy the above condition (you should verify this by finding some explicit examples of sets $I$ and groups $G_i$ and $H$ for which we do not have a bijection like above). The group that does satisfy the condition is the one called the free product of the $G_i$. This group is formed by considering finite words, where the letters are taken from all the sets $G_i$, and we may simplify words by multiplying two adjecent letters if they come from the same $G_i$, and we may remove any identity elements from the words (see the wiki page for a more precise definition). It is a nice exercise to show that in the case that all the $G_i$ are abelian, the direct sum of the $G_i$ is isomorphic to the abelianization of the free product, so the free product is indeed a generalization of the direct sum.
So we see that the 'correct' translation of the direct sum concept to general groups leads to free products, instead of cartesian products or subsets thereof. In other words, there is not a problem with considering 'direct sums' of non-abelian groups per se, but to preserve the properties that the direct sum has in the abelian case, we need to consider the free product instead of a direct sum.
Solution 2:
There are three interesting ways (that I know of) to combine a family $G_i$ of not-necessarily-abelian groups:
- the direct product $\prod_i G_i$,
- the direct sum $\bigoplus_i G_i$ (which agrees with the direct product for finitely many $G_i$ but not infinitely many), and
- the free product $\coprod_i G_i$ (the categorical coproduct, which agrees with neither of the above constructions).
Of these, the direct sum does not appear as a special case of a general categorical construction: the direct product is the categorical product, while the free product is the categorical coproduct. So the direct sum is in some sense the least natural of the three. I don't know of any applications of the direct sum of infinitely many not-necessarily-abelian groups.
Solution 3:
The " sum" here is the amalgamated sum, it is the pushout in the category of groups. In particular the "direct sum" is the free product