For any family of modules, there is a construction analogous to the Cartesian product in that produces a single module characterized by a universal property. Let's first recall the Cartesian product construction in .
The Cartesian product of sets
One of the first constructions on sets that most of us learn is probably the Cartesian product of a pair of sets. The way this is usually taught is as follows. For each pair of sets one can construct a new set, denoted and called the Cartesian product of and , whose elements consist of all ordered pairs with and . The set also comes equipped with two "canonical projection" maps and , defined by sending a pair to or , respectively.
This construction is also "universal" in the following sense: any set equipped with set maps and "factors uniquely" through ; i.e., there exists a unique map such that and . We can represent this in the following diagram:
There is nothing special about sets here, though, other than the specific construction of the set . We can attempt to replicate this situation in any category, starting with a pair of objects in a category and asking whether there exists an object with arrows and with the analogous "universal property". In some categories the answer is "Yes!", in which case that object is (usually) called the product of and and (usually) denoted or .
My personal beef with ordered pairs
Call me a curmudgeon, but I don't like introducing new types of objects such as "ordered pairs" or "formal sums", no matter how intuitive and reasonable they might at first seem. In most cases, these new types of objects "break" or become ambiguous when pushed hard enough.
For example, an ordered pair might seem reasonable. So might an ordered triple, or ordered -uple. But what about an ordered -tuple? Is that just a sequence? What if I want an "ordered -tuple", where is the set of complex numbers? The complex numbers aren't linearly ordered, so we can't even pretend to think of that as a sequence.
When pushed to this extreme, it becomes clear that for an arbitrary set an "ordered -tuple" should really just be a set map from to whatever set contains the elements we want in our "-tuple". This kind of thinking can allow us to reframe "ordered pairs" and "ordered -tuples" strictly in terms of arrows in preexisting categories. For example, an ordered pair of sets is really a functor , where is the discrete category on the two-element set . The Cartesian product can then be constructed as the set of set maps which satisfy and , where is any set containing all of the elements of and (guaranteed to exist in our chosen "universe" by the axiomatic properties of the universe).
Besides allowing us to consider families of objects indexed by arbitrary sets (and hence products over such families), this way of thinking also aligns with the general philosophy of category theory: "It's all about the arrows." Every statement should be in terms of arrows. Every construction should be in terms of arrows. Every proof should be in terms of arrows. It might not always be easy to follow this philosophy, but I'm willing to try.
The direct product of two modules
Moving to the category , we can easily recreate the construction of the Cartesian product. For simplicity, let's first handle the case of the product of two -modules and allow ourselves to use the ordered pair notation (despite my misgivings).
So, suppose and are two -modules. Let denote the -module whose elements are pairs with and , with component-wise addition and scaling. In other words, the operation is defined by
and the left -action is defined by . (One can verify that this operation and -action do indeed define an -module structure on .)
We have two "projection" module morphisms , which send a pair to , for .
We claim that this data satisfies the "usual universal property" for a product, in that it is universal among all such modules equipped with morphisms to and . More precisely, for each module and pair of module morphisms and there is a unique module morphism such that the diagram below commutates:
In fact, we can be completely explicit. Suppose, for the moment, such a morphism existed. We can now use the above diagram to reverse engineer a formula for this map. Fix any element and consider the mysterious image . This must be represented as for some and (presumably which each depend on .) Looking at the above diagram, we see that we can "recover" using the projection . More explicitly, our mystery first component satisfies
Similarly, we can deduce that . We've now discovered that our map must be given by . This proves the uniqueness of a morphism . As for existence, now we need only confirm that the map we discovered, namely is indeed an -module morphism (which is easy).
The -module , together with its projection morphisms, is called the direct product of and . Categorically, it is simply the product of and in the category . As such, I will usually drop the word "direct" and just call it the product of and .
Products in related categories
Observe that, as an abelian group, is the usual direct product of abelian groups; similarly, as a set, is the usual Cartesian product of sets. More precisely, let and denote the usual forgetful functors. Then and . It is sometimes said that these two forgetful functors preserve binary products, or something along those lines.
The direct product of an arbitrary collection of modules
Now let's go completely general. Suppose is a family of -modules indexed by some set . Following the pattern we've established, the (direct) product of this family is an -module, denoted , together with module morphisms for every , universal among all such data.
As an abelian group, this is the usual direct product of the corresponding abelian groups; as a set, it is the usual Cartesian product of the corresponding sets. Following our earlier thoughts on how the notion of an "ordered -tuple" for a general set should really be replaced by set maps from (with some conditions), we construct the direct product as follows.
The set of elements of is the collection of all set maps such that for every , where is any set containing all of the elements of all . The additive operation and -action are then once again defined "component-wise", which is now more accurately described as "on outputs"; e.g., , where the right-hand side indicates the action of on the -module . In other words, for each we can think of as the value of the -component of the element .
The finite case can be seen as a special case of this general construction by considering the set and associating each -tuple with to a function on with for each .
If you don't like this convoluted construction, have no fear: the construction is only really required to establish the existence of a module with the desired universal property. All properties of that module can be deduced (sometimes easily, sometimes with great effort) from the universal property itself.
Collections of objects via functors
We can give a categorical reinterpretation of a family of objects in a category indexed by some set . Let be the discrete category associated to the set . Then each functor is equivalent to the specification of an object in for every element . More precisely, the object function of is exactly a function from to the set of objects of . (Since is discrete, the arrow function of is completely determined, namely as simply the assignment .)