When does the tensor product distribute over an infinite direct product? It is well known that the tensor product of $R$-modules over some ring $R$ does not, in general, distribute over infinite direct products, an obvious example being $\mathbb Z_p \otimes_\mathbb Z \mathbb Q \neq 0$. I also know that a sufficient condition for the tensor product to distribute is this.
What other sufficient conditions are there? For instance, it would seem intuitive that $\mathbb Q \otimes_\mathbb Z \prod_\mathbb N \mathbb Z \cong \prod_\mathbb N \mathbb Q$. But is it?
 A: 
For instance, it would seem intuitive that $\mathbb Q \otimes_\mathbb Z \prod_\mathbb N \mathbb Z \cong \prod_\mathbb N \mathbb Q$. But is it?

It is not. The natural map from the LHS to the RHS fails to be surjective; its image is the subgroup of $\prod \mathbb{Q}$ consisting of those sequences whose terms have a common denominator, and hence does not include, for example, $\prod \frac{1}{n}$. 
In general, for modules over a commutative ring $k$, the tensor product $M \otimes_k (-)$ preserves infinite products if $M$ is finitely presented projective. I had thought at some point about whether it suffices for $M$ just to be finitely presented, but I don't remember what the conclusion was off the top of my head. 
A: Here is a general criterion.  (All tensor products in this answer are over $R$.)

Theorem: Let $R$ be a ring and let $M$ be a right $R$-module.  Then the following are equivalent.

*

*The functor $M\otimes -$ preserves products: that is, for every family $(A_i)$ of left $R$-modules, the canonical map $M\otimes\prod A_i\to \prod M\otimes A_i$ is an isomorphism.


*$M$ is finitely presented.

Proof:  First, suppose $M$ has a finite presentation $$R^m\to R^n\to M\to 0$$ and let $(A_i)$ be any family of left $R$-modules.  We then get a commutative diagram
$$\require{AMScd}
\begin{CD}
R^m\otimes \prod A_i @>>> R^n\otimes \prod A_i @>>> M\otimes \prod A_i @>>> 0\\
@VV{}V @VV{}V @VV{}V \\
\prod R^m\otimes A_i @>>> \prod R^n\otimes A_i @>>> \prod M\otimes A_i @>>> 0
\end{CD}$$ whose rows are exact.  Now note that $R^m\otimes \prod A_i\cong (\prod A_i)^m$ and $\prod R^m\otimes A_i\cong \prod A_i^m$, and our vertical map between them is easily seen to be the canonical isomorphism which interchanges the products.  So the left vertical map is an isomorphism and similarly so is the middle vertical map.  By the five lemma, it follows that the right vertical map is an isomorphism, and thus $M\otimes -$ preserves products.
Conversely, suppose $M\otimes-$ preserves products.  In particular, then, the canonical map $$\varphi: M\otimes R^M\to M^M$$ is an isomorphism.  Considering the identity map $id:M\to M$ as an element of the product $M^M$, we have $$id=\varphi(\sum m_i \otimes f_i)$$ for some finite collection of elements $m_i\in M$ and $f_i:M\to R$.  Evaluating both sides of this equation at an element $m\in M$ we find $$m=\sum m_if_i(m).$$  Thus every element of $M$ is a linear combination of the elements $m_i$, so $M$ is finitely generated.
Now  let $$0\to K\to F\to M\to 0$$ be a presentation of $M$ with $F$ a finitely generated free module.  To conclude $M$ is finitely presented, we must show that $K$ is finitely generated.  Now let $(A_i)$ be any family of flat left $R$-modules and consider the commutative diagram
$$\require{AMScd}
\begin{CD}
K\otimes \prod A_i @>>> F\otimes \prod A_i @>>> M\otimes \prod A_i @>>> 0\\
@VV{}V @VV{}V @VV{}V \\
\prod K\otimes A_i @>{\alpha}>> \prod F\otimes A_i @>>> \prod M\otimes A_i @>>> 0
\end{CD}$$
which again has exact rows.  The right vertical map is an isomorphism by hypothesis and the middle vertical map is an isomorphism since $F$ is finitely generated and free.  Moreover, the map $\alpha$ is injective since the $A_i$ are flat.  A simple diagram chase now shows that the left vertical map is surjective.
Thus the canonical map $K\otimes \prod A_i\to \prod K\otimes A_i$ is surjective for any family of flat modules $(A_i)$.  In particular, the canonical map $K\otimes R^K\to K^K$ is surjective, which we have seen above implies that $K$ is finitely generated.

By similar arguments, you can show that the canonical map $M\otimes \prod A_i\to\prod M\otimes A_i$ is always a surjection iff $M$ is finitely generated.  Indeed, the forward direction is already contained in the forward direction of the proof above, and the reverse direction is similar to the proof of the reverse direction above.
