# The commutativity of direct sums and tensor products

I am struggling with the proof of the commutativity of direct sums and tensor products of modules the professor gave us. Let $A$ be a ring, $M_i, N, P$ be $A$-modules, it goes as follows: he points out this isomorphism $$Hom_A((\oplus_{i}M_i)\otimes N, P) \cong Hom_A(\oplus_i M_i, Hom_A(N,P)) \cong \prod_i Hom_A(M_i, Hom_A(N,P)) \cong \prod_i Hom_A(M_i \otimes N, P) \cong Hom_A(\oplus_i (M_i \otimes N), P)$$

Then he says: taking first $P = (\oplus_i M_i) \otimes N$ and then $P = \oplus_i (M_i \otimes N)$ and considering the maps $\alpha, \beta$ respectively corresponding to the identity map of $(\oplus_i M_i) \otimes N$ and $\oplus_i (M_i \otimes N)$ we get the desired isomorphism. Sincerely I don't understand this last part, why the images of the identity maps should give me the isomorphism? A different proof I elaborated is the following: to say that $M$ is the direct sum of the $M_i$ means there exist maps $\varphi_i: M_i \rightarrow M$ such that $$0 \rightarrow Hom_A(M,N) \rightarrow \prod_i Hom_A(M_i,N) \rightarrow 0$$ is exact for all $A$-modules $N$, where the map is: $$\psi \mapsto \{ \psi \circ \varphi_i \}$$ Set $\varphi_i : M_i \otimes N \rightarrow (\oplus_i M_i) \otimes N$ as $\varphi_i = k_i \otimes id_N$ where $k_i : M_i \hookrightarrow \oplus_i M_i$. Then as previously observed: $$Hom_A((\oplus_{i}M_i)\otimes N, P) \cong Hom_A(\oplus_i M_i, Hom_A(N,P)) \cong \prod_i Hom_A(M_i, Hom_A(N,P)) \cong \prod_i Hom_A(M_i \otimes N, P)$$ and the map is exactly the one we need for the universal property of direct sum.

I would be grateful if you can tell me whether my proof is right or wrong and if you are able to explain me what I'm missing from the proof the professor gave us. Thank you!

• For further reading, the part of the proof you were stuck on is the essential ingredient in the proof of Yoneda's lemma, which could be applied here immediately prove the theorem given the chain of isomorphisms. – user14972 Jul 26 '17 at 21:46
• I'm sorry, but I don't understand how Yoneda''s lemma applies here. Could you explain more please? – Federico Jul 27 '17 at 6:44
• A typical application of the lemma is to infer that if you are given either $\hom(X, Z) \to \hom(Y, Z)$ or $\hom(Z, Y) \to \hom(Z, X)$ as a natural isomorphism in $Z$, then $X \cong Y$. (with an explicit construction of the isomorphism given basically by the trick you mention) – user14972 Jul 27 '17 at 8:57

For the part you were stuck on in the original proof, this is a typical application of Yoneda's lemma. In great generality, it says that the following two notions are equivalent:

• A morphism $f : X \to Y$
• A natural transformation $\theta_Z : \hom(Y, Z) \to \hom(X, Z)$

The equivalence is easy to give explicitly. Given $f$ you can always define an associated $\theta$ by

$$\theta_Z(g) = g \circ f$$

Conversely, from such a natural transformation, you can recover $f$ by plugging in a suitable choice of $g$ and $Z$, namely

$$\theta_Y(1_Y) = 1_Y \circ f = f$$

Proving the theorem is just checking that going back and forth between the two notions are inverses, which is a relatively straightforward calculation. The hard part of the theorem is having the right definition of "natural transformation" and simply knowing what to prove!