[proofplan]
We use the injectivity criterion for flatness: an $R$-module $F$ is flat if, for every injective $R$-[linear map](/page/Linear%20Map) $u: M \to N$, the induced map $u \otimes_R \operatorname{id}_F: M \otimes_R F \to N \otimes_R F$ is injective. Since $F$ is free, we identify it with a [direct sum](/page/Direct%20Sum) of copies of $R$. Tensoring with that direct sum identifies $M \otimes_R F$ with a direct sum of copies of $M$, and under this identification $u \otimes_R \operatorname{id}_F$ becomes the componentwise direct sum of copies of $u$. A componentwise direct sum of injective maps is injective, so tensoring with $F$ preserves injections.
[/proofplan]
[step:Identify the free module with a direct sum of copies of $R$]
Let $F$ be a free $R$-module. Choose a basis $(e_i)_{i \in I}$ of $F$, where $I$ is an index set. By [citetheorem:10013], the map
\begin{align*}
\Phi: \bigoplus_{i \in I} R \to F
\end{align*}
defined by
\begin{align*}
\Phi((r_i)_{i \in I}) = \sum_{i \in I} r_i e_i
\end{align*}
is an $R$-module isomorphism, where the sum is finite because $(r_i)_{i \in I}$ has finite support.
Thus it is enough to prove that $\bigoplus_{i \in I} R$ is flat, since flatness is preserved under $R$-module isomorphism. Indeed, if $\theta: F \to F'$ is an $R$-module isomorphism, then for every $R$-module $M$ the induced map
\begin{align*}
\operatorname{id}_M \otimes_R \theta: M \otimes_R F \to M \otimes_R F'
\end{align*}
is an $R$-module isomorphism, so injectivity of tensor maps is unchanged after replacing $F$ by an isomorphic module.
[/step]
[step:Construct the tensor-direct-sum identification]
Let $M$ be an $R$-module. Define
\begin{align*}
\alpha_M: M \otimes_R \left(\bigoplus_{i \in I} R\right) \to \bigoplus_{i \in I} M
\end{align*}
to be the $R$-linear map determined on pure tensors by
\begin{align*}
\alpha_M\left(m \otimes_R (r_i)_{i \in I}\right) = (r_i m)_{i \in I}.
\end{align*}
This is well-defined because $(r_i)_{i \in I}$ has finite support, so $(r_i m)_{i \in I}$ is an element of $\bigoplus_{i \in I} M$.
For each $j \in I$, let $\varepsilon_j \in \bigoplus_{i \in I} R$ denote the element whose $j$-th coordinate is $1_R$ and whose other coordinates are $0_R$. Define
\begin{align*}
\beta_M: \bigoplus_{i \in I} M \to M \otimes_R \left(\bigoplus_{i \in I} R\right)
\end{align*}
by
\begin{align*}
\beta_M((m_i)_{i \in I}) = \sum_{i \in I} m_i \otimes_R \varepsilon_i,
\end{align*}
where the sum is finite because $(m_i)_{i \in I}$ has finite support.
For $(m_i)_{i \in I} \in \bigoplus_{i \in I} M$, we have
\begin{align*}
(\alpha_M \circ \beta_M)((m_i)_{i \in I}) = (m_i)_{i \in I}.
\end{align*}
For a pure tensor $m \otimes_R (r_i)_{i \in I}$, we compute
\begin{align*}
(\beta_M \circ \alpha_M)\left(m \otimes_R (r_i)_{i \in I}\right) = \sum_{i \in I} r_i m \otimes_R \varepsilon_i.
\end{align*}
By the balancing relation in the [tensor product](/page/Tensor%20Product),
\begin{align*}
r_i m \otimes_R \varepsilon_i = m \otimes_R r_i \varepsilon_i.
\end{align*}
Since $(r_i)_{i \in I} = \sum_{i \in I} r_i \varepsilon_i$ in $\bigoplus_{i \in I} R$, additivity in the second tensor factor gives
\begin{align*}
\sum_{i \in I} r_i m \otimes_R \varepsilon_i = m \otimes_R (r_i)_{i \in I}.
\end{align*}
Thus $\beta_M \circ \alpha_M$ is the identity on pure tensors, hence on all of $M \otimes_R \bigl(\bigoplus_{i \in I} R\bigr)$. Therefore $\alpha_M$ is an $R$-module isomorphism with inverse $\beta_M$.
[/step]
[step:Show tensoring with the free module sends injections to injections]
Let
\begin{align*}
u: M \to N
\end{align*}
be an injective $R$-[module homomorphism](/page/Module%20Homomorphism). Under the isomorphisms $\alpha_M$ and $\alpha_N$ constructed above, the tensor map
\begin{align*}
u \otimes_R \operatorname{id}_{\bigoplus_{i \in I} R}: M \otimes_R \left(\bigoplus_{i \in I} R\right) \to N \otimes_R \left(\bigoplus_{i \in I} R\right)
\end{align*}
corresponds to the componentwise direct sum map
\begin{align*}
\bigoplus_{i \in I} u: \bigoplus_{i \in I} M \to \bigoplus_{i \in I} N
\end{align*}
defined by
\begin{align*}
\left(\bigoplus_{i \in I} u\right)((m_i)_{i \in I}) = (u(m_i))_{i \in I}.
\end{align*}
Indeed, for every pure tensor $m \otimes_R (r_i)_{i \in I}$,
\begin{align*}
\alpha_N\left((u \otimes_R \operatorname{id})(m \otimes_R (r_i)_{i \in I})\right) = (r_i u(m))_{i \in I},
\end{align*}
while
\begin{align*}
\left(\bigoplus_{i \in I} u\right)\left(\alpha_M(m \otimes_R (r_i)_{i \in I})\right) = (u(r_i m))_{i \in I}.
\end{align*}
Since $u$ is $R$-linear, $u(r_i m) = r_i u(m)$ for every $i \in I$, so the two expressions agree.
Now suppose $(m_i)_{i \in I} \in \bigoplus_{i \in I} M$ lies in the kernel of $\bigoplus_{i \in I} u$. Then
\begin{align*}
u(m_i) = 0
\end{align*}
for every $i \in I$. Since $u$ is injective, $m_i = 0$ for every $i \in I$. Hence $(m_i)_{i \in I} = 0$, so $\bigoplus_{i \in I} u$ is injective. Because $\alpha_M$ and $\alpha_N$ are isomorphisms, $u \otimes_R \operatorname{id}_{\bigoplus_{i \in I} R}$ is injective.
[guided]
We must prove that tensoring with the [free module](/page/Free%20Module) preserves injections. Let
\begin{align*}
u: M \to N
\end{align*}
be an injective $R$-module homomorphism. The previous step gives natural $R$-module isomorphisms
\begin{align*}
\alpha_M: M \otimes_R \left(\bigoplus_{i \in I} R\right) \to \bigoplus_{i \in I} M
\end{align*}
and
\begin{align*}
\alpha_N: N \otimes_R \left(\bigoplus_{i \in I} R\right) \to \bigoplus_{i \in I} N.
\end{align*}
The point of these isomorphisms is that they turn the tensor map into a map whose injectivity can be checked coordinate by coordinate.
The tensor map is
\begin{align*}
u \otimes_R \operatorname{id}_{\bigoplus_{i \in I} R}: M \otimes_R \left(\bigoplus_{i \in I} R\right) \to N \otimes_R \left(\bigoplus_{i \in I} R\right).
\end{align*}
Under $\alpha_M$ and $\alpha_N$, this map corresponds to
\begin{align*}
\bigoplus_{i \in I} u: \bigoplus_{i \in I} M \to \bigoplus_{i \in I} N,
\end{align*}
where
\begin{align*}
\left(\bigoplus_{i \in I} u\right)((m_i)_{i \in I}) = (u(m_i))_{i \in I}.
\end{align*}
We verify this correspondence on pure tensors, which is enough because pure tensors generate the tensor product as an $R$-module. For $m \in M$ and $(r_i)_{i \in I} \in \bigoplus_{i \in I} R$, the route through the tensor map gives
\begin{align*}
\alpha_N\left((u \otimes_R \operatorname{id})(m \otimes_R (r_i)_{i \in I})\right) = \alpha_N(u(m) \otimes_R (r_i)_{i \in I}) = (r_i u(m))_{i \in I}.
\end{align*}
The route through the direct sum map gives
\begin{align*}
\left(\bigoplus_{i \in I} u\right)\left(\alpha_M(m \otimes_R (r_i)_{i \in I})\right) = \left(\bigoplus_{i \in I} u\right)((r_i m)_{i \in I}) = (u(r_i m))_{i \in I}.
\end{align*}
Since $u$ is $R$-linear, $u(r_i m) = r_i u(m)$ for every $i \in I$, so the two routes agree.
It remains to prove that $\bigoplus_{i \in I} u$ is injective. Let $(m_i)_{i \in I} \in \bigoplus_{i \in I} M$ satisfy
\begin{align*}
\left(\bigoplus_{i \in I} u\right)((m_i)_{i \in I}) = 0.
\end{align*}
This means exactly that
\begin{align*}
u(m_i) = 0
\end{align*}
for every $i \in I$. Because $u$ is injective, each equality $u(m_i)=0$ implies $m_i=0$. Hence every coordinate of $(m_i)_{i \in I}$ is zero, so $(m_i)_{i \in I}=0$. Therefore $\bigoplus_{i \in I} u$ is injective.
Finally, an isomorphic conjugate of an injective map is injective. Since $\alpha_M$ and $\alpha_N$ are isomorphisms and $\bigoplus_{i \in I} u$ is injective, the tensor map
\begin{align*}
u \otimes_R \operatorname{id}_{\bigoplus_{i \in I} R}
\end{align*}
is injective.
[/guided]
[/step]
[step:Conclude flatness of the original free module]
We have shown that, for every injective $R$-module homomorphism $u: M \to N$, the induced map
\begin{align*}
u \otimes_R \operatorname{id}_{\bigoplus_{i \in I} R}: M \otimes_R \left(\bigoplus_{i \in I} R\right) \to N \otimes_R \left(\bigoplus_{i \in I} R\right)
\end{align*}
is injective. Hence $\bigoplus_{i \in I} R$ is flat by the injectivity criterion for flatness.
Since $F$ is isomorphic to $\bigoplus_{i \in I} R$, and flatness is invariant under $R$-module isomorphism, $F$ is flat. Therefore every free $R$-module is flat.
[/step]