# The Unapologetic Mathematician

## Direct sums of modules

We’ve covered direct sums in the case of abelian groups — that is, $\mathbb{Z}$-modules — but the concept extends to modules over arbitrary rings. This gives me a good chance to go back and clean up my coverage.

We build the direct sum of two $R$-modules $A$ and $B$ on the product $A\times B$ of the underlying sets. We define an abelian group structure by $(a,b)+(a',b')=(a+a',b+b')$, and an action of $R$ by $r\cdot(a,b)=(r\cdot a,r\cdot b)$.

Now, here’s the diagram:

The direct sum $A\oplus B$ of two left $R$-modules $A$ and $B$ comes equipped with four module homomorphisms. For $A$ we have the pair $\pi_A:A\oplus B\rightarrow A$ and $\iota_A:A\rightarrow A\oplus B$. These are defined as follows:

• $\pi_A(a,b)=a$
• $\iota_A(a)=(a,0)$

There is a similar pair with a similar definition for $B$. These homomorphisms satisfy the identities

• $\pi_A\circ\iota_A=1_A$
• $\pi_B\circ\iota_B=1_B$
• $\pi_A\circ\iota_B=0$
• $\pi_B\circ\iota_A=0$
• $\iota_A\circ\pi_A+\iota_B\circ\pi_B=1_{A\oplus B}$

where $1_M$ is the identity homomorphism on the module $M$, and ${}0$ is the homomorphism between two modules sending every element of the domain to the element ${}0$ in the codomain.

Now if we have any two homomorphisms $f_A$ and $f_B$ from a module $X$ to $A$ and $B$ respectively, then there is a unique homomorphism $f_A\oplus f_B:X\rightarrow A\oplus B$ making the two triangles on the top commute. That is, $\pi_A\circ f_A\oplus f_B=f_A$, and similarly for $f_B$. In fact, we can define $f_A\oplus f_B=\iota_A\circ f_A+\iota_B\circ f_B$, for then
$\pi_A\circ(\iota_A\circ f_A+\iota_B\circ f_B)=\pi_A\circ\iota_A\circ f_A+\pi_A\circ\iota_B\circ f_B=f_A$
and so on. Similarly, given two homomorphisms $g_A$ and $g_B$ from $A$ and $B$ to a module $Y$, then the homomorphism $g_A\circ\pi_A+g_B\circ\pi_B$ is the unique homomorphism making the lower two triangles commute.

The upshot of all this is that the direct sum $A\oplus B$ behaves like both the direct product and the free product of two groups, since it satisfies both universal properties. For any finite number of modules $A_i$ we can build the direct sum $\bigoplus\limits_{i=1}^nA_i$ and it also satisfies the analogous universal properties, and comes equipped with analogous injections and projections satisfying analogous relations to those above.

The upshot of all this is that the direct sum of a finite collection of $R$-modules behaves like both the direct product and the free product of groups. In fact, we can take that as the definition, derive the relations between the injections and projections, and use the above construction to show such a thing actually exists. On the other hand, we can take the relations between injections and projections as the definitions, use the construction to show existence, and derive the universal property from the relations as above.

For an infinite index set $\mathcal{I}$ the situation is a bit more complicated. Here we use the definition from the injections and projections with the specified relations. Then the underlying set of the infinite direct sum $\bigoplus\limits_{i\in\mathcal{I}}A_i$ is not the infinite cartesian product of the underlying sets. It’s actually the list of all such “$\mathcal{I}$-tuples” where all but a finite number of the entries are the ${}0$ elements of the respective modules. This only satisfies the universal property for the $\iota_i$ — the bottom of the diagram above. For the top we really do need the infinite direct product of the modules, which uses the whole infinite cartesian product of the underlying sets. However, for most purposes the direct sum is all we need, and the relations between the injections and the projections are the most useful part of this definition.