## An arbitrary direct sum of modules is flat if and only if each direct summand is flat

Let $R$ be a ring with 1 and let $\{A_i\}_I$ be a family of (right, unital) $R$-modules. Prove that $\bigoplus_I A_i$ is flat if and only if each $A_i$ is flat.

We begin with a lemma.

Lemma: Let $\{\varphi_i : A_i \rightarrow B_i\}_I$ be a family of (unital) $R$-module homomorphisms. Then $\Phi : \bigoplus_I A_i \rightarrow \bigoplus_I B_i$ given by $\Phi(a_i) = (\varphi_i(a_i))$ is injective if and only if each $\varphi_i$ is injective. Proof: Suppose $\Phi$ is injective. If $\varphi_k(a) = \varphi_k(b)$, and letting $\iota_k$ denote the inclusion $A_k \rightarrow \bigoplus_I A_i$ or $B_k \rightarrow \bigoplus_I B_i$, then $\Phi(\iota_k(a)) = \Phi(\iota_k(b))$, so that $a = b$. Thus each $\varphi_k$ is injective. Conversely, suppose each $\varphi_k$ is injective; then if $\Phi(a_i) = \Phi(b_i)$, we have $\varphi_i(a_i) = \varphi_i(b_i)$ for each $i$, so that $a_i = b_i$ for each $i$. So $(a_i) = (b_i)$, and thus $\Phi$ is injective. $\square$

Suppose each $A_i$ is flat. Now let $L$ and $M$ be left unital $R$-modules and let $\theta : L \rightarrow M$ be a module homomorphism. Since each $A_i$ is flat, $1_i \otimes \theta : A_i \otimes_R L \rightarrow A_i \otimes_R M$ is injective. Using the lemma, $\Theta = \bigoplus_I (1_i \otimes \theta) : \bigoplus_I (A_i \otimes L) \rightarrow \bigoplus_I (A_i \otimes M)$ is injective. In this previous exercise, we constructed group isomorphisms $\Phi : (\bigoplus_I A_i) \otimes_R L \rightarrow \bigoplus_I (A_i \otimes_R L)$ and $\Psi : \bigoplus_I (A_i \otimes_R L) \rightarrow (\bigoplus_I A_i) \otimes_R M$. We claim that $\Psi \circ \Theta \circ \Phi = 1 \otimes \theta$. To that end, note that $(\Psi \circ \Theta \circ \Phi)((a_i) \otimes \ell) = (\Psi \circ \Theta)((a_i \otimes \ell))$ $= \Psi((a_i \otimes \theta(\ell)))$ $= (\sum a_i) \otimes \theta(\ell)$ $= (1 \otimes \theta)((a_i) \otimes \ell)$, as desired. Thus $1 \otimes \theta : (\bigoplus_I A_i) \otimes_R L \rightarrow (\bigoplus_I A_i) \otimes_R M$ is injective, and so $\bigoplus_I A_i$ is flat.

Conversely, suppose $\bigoplus_I A_i$ is flat. Let $L$ and $R$ be (unital, left) $R$-modules and $\theta : L \rightarrow M$ a module homomorphism. Note that $\Theta = 1 \otimes \theta : (\bigoplus_I A_i) \otimes_R L \rightarrow (\bigoplus_I A_i) \otimes_R M$ is injective. Recall the homomorphisms $\Phi$ and $\Psi$ from the previous paragraph; $\Psi^{-1} \circ \Theta \circ \Phi^{-1}$ is an injective module homomorphism mapping $\bigoplus_I (A_i \otimes_R L)$ to $\bigoplus_I (A_i \otimes_R M)$, and in fact $(\Psi^{-1} \circ \Theta \circ \Phi^{-1})((a_i \otimes \ell_i)) = (\Psi^{-1} \circ \Theta)(\sum \iota_i(a_i) \otimes \ell_i)$ $= \Psi^{-1}(\sum \iota_i(a_i) \otimes \theta(\ell_i))$ $= (a_i \otimes \theta(\ell_i))$ $= ((1_i \otimes \theta)(a_i \otimes \ell_i))$. By the lemma, each $1_i \otimes \theta$ is injective, so that each $A_i$ is flat.