# Difference between products and coproducts.

I am struggling with understanding the difference between products and coproducts in category theory.

For the category of abelian groups what part of the universal property of coproduct implies the finitely many non-zero terms? Why couldn't the product satisfy the U.P. of coproducts and vice-versa (for the finite case I know it is in fact the same but not for the infinite case).

For the case of the category of sets I can see the diference. The direct sum is disjoint union and can't be the product because there aren't canonical injections, while in groups there is one by just considering every other element the identity.

Thank you :)

While it is true that given $$\{G_i\}_{i \in I}$$ you have inclusion maps $$G_i \to \prod_{i \in I} G_i$$, the product $$\prod_{i \in I} G_i$$ does not satisfy the universal property of the coproduct if $$I$$ is infinite.

From a conceptual point of view, a map $$F: \bigoplus G_i \to G$$ coming from maps $$f_i : G_i \to G$$ is just $$F((g_i)_i) = \sum_{i} f_i(g_i)$$ where we only sum over the indexes $$i \in I$$ with $$g_i \neq 0$$. However, if we try to do the same with a direct product, we would have to deal with infinite sum more or less which does not work in this context.

For example, take $$G_i = \mathbb{Z}$$ with $$I = \mathbb{Z}$$ and the identity map $$G_i \to \mathbb{Z}$$. If $$\prod_{i \in I} G_i$$ where a coproduct, then there would exist a map $$t: \prod_{i \in I} G_i \to \mathbb{Z}$$ which restricts to the identity on every $$G_i$$.

If $$\sigma : I \to I$$ is any permutation, then the induced map $$T_\sigma : \prod_{i \in I} G_i \to \prod_{i \in I} G_i$$ coming from the identity maps $$G_i \to G_{\sigma(i)}$$ leaves $$t$$ invariant, i.e. $$t \circ T_\sigma = t$$.

Now, take $$g = (\dots,1,1,1,\dots) \in \prod_{i \in I} G_i$$ and note that $$g = (\dots,0,1,0,1,\dots) + (\dots,1,0,1,0,\dots)$$. As one of these summands is obtained from the other by a shift, it follows that $$t$$ takes the same value on both of them. So $$t(g)$$ is divisible by $$2$$. With similar reasoning, you find that $$t(g)$$ is divisible by any positive integer (write $$g$$ as a sum of $$n$$ elements, with $$n-1$$ zeroes followed by $$1$$ and shift $$n-1$$ times). Consequently, we have $$t(g) = 0$$. However, the same method works if we replace $$g$$ by $$h = (\dots,1,1,0,1,1,\dots)$$ where we have replaced a $$1$$ at one index with a $$0$$ (the permutations we need to use here are again shifts so to speak only we need them to jump over the position with the zero in it). Thus $$t(h) = 0$$ as well, but then $$1 = t(g-h) = 0$$ gives a contradiction.

In addition to Matthias's very nice and explicit proof that the product cannot work as a coproduct, here is another important fact about coproducts for any algebraic structure (abelian groups, groups, rings, semigroups, etc). I will state it for abelian groups, but will only use universal properties and the notion of "subgroup generated", so that you can see it easily generalizes.

Let $$\{G_j\}_{j\in J}$$ be a family of abelian groups. Let $$C$$ be an abelian group, and $$\iota_j\colon G_j\to C$$ be a family of morphisms. If $$(C,\{\iota_j\}_{j\in J})$$ is a coproduct for the family, then $$C=\langle \iota_j(G) \mid j\in J\rangle$$. That is, $$C$$ is generated, as an abelian group, by the images of the $$G_j$$ under the canonical morphisms into the coproduct.

Proof. Let $$D=\langle \iota_j(G)\mid j\in J\rangle$$. The correstrictions $$f_j\colon G_j\to D$$ (with $$f_j(g)=\iota_j(g)$$ for each $$g\in G_j$$) are a family of morphisms from the $$G_j$$ to $$D$$, so by the universal property of the coproduct, they induce a (unique) morphism $$F\colon C\to D$$ such that $$F\circ \iota_j=f_j$$ for each $$j\in J$$.

Consider now the map $$I\circ F\colon C\to C$$, where $$I\colon D\to C$$ is the canonical inclusion of the subgroup $$D$$ to $$C$$. Note that $$I\circ f_j = \iota_j$$ for each $$j$$. We have that for all $$j$$, $$\mathrm{id}_C\circ \iota_j = \iota_j = I\circ f_j = I\circ (F\circ \iota_j) = (I\circ F)\circ \iota_j.$$ The morphisms $$\iota_j\colon G_j\to C$$ induce, by the universal property of $$C$$, a unique morphism $$\phi\colon C\to C$$ such that $$\phi\circ\iota_j = \iota_j$$. This morphism is clearly $$\mathrm{id}_C$$. But we just saw that the map $$I\circ F$$ also satisfies this condition. Thus, we conclude that $$I\circ F=\mathrm{id}_C$$.

Since the composition $$I\circ F$$ is bijective, it follows that the map $$I$$ is surjective; but $$I$$ is the inclusion $$D\hookrightarrow C$$. Thus, we conclude that $$D=C$$, as required. $$\Box$$

So now when we consider the product $$\prod_{j\in J}G_j$$ and the embeddings $$\iota_j\colon G_j \to \prod_{j\in J}G_j$$, we see that if $$J$$ is infinite and infinitely many of the $$G_j$$ are nontrivial, then we cannot have a coproduct: the images of the $$G_j$$ do not generate the whole product, and hence the whole product cannot be the coproduct of the family.