The notion of direct sum, or weak direct product, is a concept from algebra that actually makes sense in any category with zero morphisms (that is, any category enriched over the closed monoidal category of pointed sets), as long as the needed (co)limits exist.
As basic and familiar example is the direct sum of two vector spaces and over some field, or, more generally of two modules over some ring. Generally, for a set and an -indexed family of vector space or modules, their direct sum is the collection of formal linear combinations of elements in each of the . This may in part motivate the terminology: an element in a direct sum is a sum of elements, at least in these cases.
This generalises in two distinct ways, which we call direct sums and weak direct products. In many cases (as in the example above), these coincide, but not always. Also in many cases, direct sums will be the same as coproducts. In any case, finitary weak direct products are the same as products but the infinitary versions are (almost always) different.
The name ‘weak direct product’ comes from the concept of direct product in algebra for a product in a concrete category that is created by the forgetful functor; the weak direct product will be a subobject of the direct product (and the entire direct product in finitary cases). But here we will not restrict ourselves to the context of such a concrete category.
The term ‘direct sum’ comes from the finitary biproduct (simultaneously product and coproduct) in additive categories. The additive character of these biproducts extends in the infinitary case (where biproducts generally no longer appear) to the coproduct rather than to the product. Even when the direct sum is not the same as the coproduct, it still retains some of this flavour.
In the classical examples of , the direct sum and weak direct product are the same. However, the general definitions below distinguish them in some cases, and we use the terms ‘direct sum’ and ‘weak direct product’ to best evoke the ‘like a coproduct’ and ‘part of a product’ senses.
We now define both the direct sum and weak direct product of this family. The will be called the direct summands or (weak) direct factors.
where is the zero morphism from to .
The direct sum over the family is the image
of the morphism .
In constructive mathematics, the definition of requires that the index set have decidable equality, which is the case in most applications of interest. An arbitrary index set will still work if is enriched over the category of sets and partial functions; this may be embedded as a full subcategory of the category of pointed sets, and the embedding is an equivalence of categories if and only if the law of excluded middle holds. But the usual examples of are not (constructively) so enriched. Fortunately, the usual examples of have decidable equality.
Here we consider the finitary products
as varies over the finite subsets of the index set . (In constructive mathematics, use ‘finitely indexed’ or ‘Kuratowski finite’ here … although if has decidable equality, as is the case in the usual examples, then every finitely indexed subset of is actually finite in the strictest sense.)
where , given by
If it exists, the weak direct product is defined to be the directed colimit of this direct system.
In the categories Grp or Ab of (abelian) groups, the direct sum and weak direct product agree. For finitely many objects, it is the same as the direct product, which is the product in both categories.
So in Ab the direct sum is the object equipped with a collection of morphisms
there is a unique homomorphism such that for all .
In these examples, the direct sum can also be described in more elementary terms as a subgroup of the direct product:
where ‘’ means ‘for all but finitely many’. This makes it clear that the direct sum equals the direct product when there are only finitely many objects involved.
In the category of pointed sets, the direct sum and weak direct product are different. The weak direct product is still given as a pointed subset of the direct product as above. The direct sum, on the other hand, is the same as the wedge sum, which is the same as the coproduct in this category. Even for pointed sets, this is different from the weak direct product (which is, as always, the same as the product for finitely many objects).
In the category of Banach spaces (with short linear maps), the direct sum is the direct sum, while the weak direct product is the direct sum. (There is in fact a range of direct sums for , although I don't know what if any universal properties they all satisfy.) In this case, the direct sum is the same as the coproduct, while the weak direct product is the same as the product even for infinitely many objects. See direct sum of Banach spaces.