Coproduct

In category theory, the coproduct, or categorical sum, is a construction which includes as examples the disjoint union of sets and of topological spaces, the free product of groups, and the direct sum of modules and vector spaces. The coproduct of a family of objects is essentially the "least specific" object to which each object in the family admits a morphism. It is the category-theoretic dual notion to the categorical product, which means the definition is the same as the product but with all arrows reversed. Despite this seemingly innocuous change in the name and notation, coproducts can be and typically are dramatically different from products.
Definition.
Let "C" be a category and let "X"1 and "X"2 be objects of "C". An object is called the coproduct of "X"1 and "X"2, written "X"1 ∐ "X"2 or "X"1 ⊕ "X"2, or sometimes simply "X"1 + "X"2, if there exist morphisms "i"1 : "X"1 → "X"1 ∐ "X"2 and "i"2 : "X"2 → "X"1 ∐ "X"2 satisfying the following universal property: for any object "Y" and any morphisms "f"1 : "X"1 → Y and "f"2 : "X"2 → Y, there exists a unique morphism "f" : "X"1 ∐ "X"2 → "Y" such that "f"1 = "f" ∘ "i"1 and "f"2 = "f" ∘ "i"2. That is, the following diagram commutes:
The unique arrow "f" making this diagram commute may be denoted "f"1 ∐ "f"2, "f"1 ⊕ "f"2, "f"1 + "f"2 or ["f"1, "f"2]. The morphisms "i"1 and "i"2 are called "canonical injections", although they need not be injections or even monic.
The definition of a coproduct can be extended to an arbitrary family of objects indexed by a set "J". The coproduct of the family {"Xj" : "j" ∈ "J"} is an object "X" together with a collection of morphisms "ij" : "Xj" → "X" such that, for any object "Y" and any collection of morphisms "fj" : "Xj" → "Y", there exists a unique morphism "f" from "X" to "Y" such that "fj" = "f" ∘ "ij". That is, the following diagram commutes for each "j" in "J":
The coproduct "X" of the family {"Xj"} is often denoted formula_1 or formula_2
Sometimes the morphism "f: X → Y" may be denoted formula_3 to indicate its dependence on the individual "f""j"s.
Examples.
The coproduct in the category of sets is simply the disjoint union with the maps "ij" being the inclusion maps. Unlike direct products, coproducts in other categories are not all obviously based on the notion for sets, because unions don't behave well with respect to preserving operations (e.g. the union of two groups need not be a group), and so coproducts in different categories can be dramatically different from each other. For example, the coproduct in the category of groups, called the free product, is quite complicated. On the other hand, in the category of abelian groups (and equally for vector spaces), the coproduct, called the direct sum, consists of the elements of the direct product which have only finitely many nonzero terms. (It therefore coincides exactly with the direct product in the case of finitely many factors.)
Given a commutative ring "R", the coproduct in the category of commutative "R"-algebras is the tensor product. In the category of (noncommutative) "R"-algebras, the coproduct is a quotient of the tensor algebra (see free product of associative algebras).
In the case of topological spaces coproducts are disjoint unions with their disjoint union topologies. That is, it is a disjoint union of the underlying sets, and the open sets are sets "open in each of the spaces", in a rather evident sense. In the category of pointed spaces, fundamental in homotopy theory, the coproduct is the wedge sum (which amounts to joining a collection of spaces with base points at a common base point).
Despite all this dissimilarity, there is still, at the heart of the whole thing, a disjoint union: the direct sum of abelian groups is the group generated by the "almost" disjoint union (disjoint union of all nonzero elements, together with a common zero), similarly for vector spaces: the space spanned by the "almost" disjoint union; the free product for groups is generated by the set of all letters from a similar "almost disjoint" union where no two elements from different sets are allowed to commute.
The coproduct of a poset category is the join operation.
Discussion.
The coproduct construction given above is actually a special case of a colimit in category theory. The coproduct in a category formula_4 can be defined as the colimit of any functor from a discrete category formula_5 into formula_4. Not every family formula_7 will have a coproduct in general, but if it does, then the coproduct is unique in a strong sense: if formula_8 and formula_9 are two coproducts of the family formula_7, then (by the definition of coproducts) there exists a unique isomorphism formula_11 such that formula_12 for each formula_13.
As with any universal property, the coproduct can be understood as a universal morphism. Let formula_14 be the diagonal functor which assigns to each object formula_15 the ordered pair formula_16 and to each morphism formula_17 the pair formula_18. Then the coproduct formula_19 in formula_4 is given by a universal morphism to the functor formula_21 from the object formula_22 in formula_23.
The coproduct indexed by the empty set (that is, an "empty coproduct") is the same as an initial object in formula_4.
If formula_5 is a set such that all coproducts for families indexed with formula_5 exist, then it is possible to choose the products in a compatible fashion so that the coproduct turns into a functor formula_27. The coproduct of the family formula_7 is then often denoted by 
and the maps formula_30 are known as the natural injections.
Letting formula_31 denote the set of all morphisms from formula_32 to formula_33 in formula_4 (that is, a hom-set in formula_4), we have a natural isomorphism 
given by the bijection which maps every tuple of morphisms
(a product in Set, the category of sets, which is the Cartesian product, so it is a tuple of morphisms) to the morphism
That this map is a surjection follows from the commutativity of the diagram: any morphism formula_39 is the coproduct of the tuple 
That it is an injection follows from the universal construction which stipulates the uniqueness of such maps. The naturality of the isomorphism is also a consequence of the diagram. Thus the contravariant hom-functor changes coproducts into products. Stated another way, the hom-functor, viewed as a functor from the opposite category formula_41 to Set is continuous; it preserves limits (a coproduct in formula_4 is a product in formula_41).
If formula_5 is a finite set, say formula_45, then the coproduct of objects formula_46 is often denoted by formula_47. Suppose all finite coproducts exist in "C", coproduct functors have been chosen as above, and 0 denotes the initial object of "C" corresponding to the empty coproduct. We then have natural isomorphisms
These properties are formally similar to those of a commutative monoid; a category with finite coproducts is an example of a symmetric monoidal category.
If the category has a zero object formula_51, then we have a unique morphism formula_52 (since formula_51 is terminal) and thus a morphism formula_54. Since formula_51 is also initial, we have a canonical isomorphism formula_56 as in the preceding paragraph. We thus have morphisms formula_57 and formula_58, by which we infer a canonical morphism formula_59. This may be extended by induction to a canonical morphism from any finite coproduct to the corresponding product. This morphism need not in general be an isomorphism; in Grp it is a proper epimorphism while in Set* (the category of pointed sets) it is a proper monomorphism. In any preadditive category, this morphism is an isomorphism and the corresponding object is known as the biproduct. A category with all finite biproducts is known as a semiadditive category.
If all families of objects indexed by formula_5 have coproducts in formula_4, then the coproduct comprises a functor formula_27. Note that, like the product, this functor is "covariant".