In what generality is the natural map $\operatorname{Hom}_R(L,M)\otimes S\to\operatorname{Hom}_{R\otimes S}(L\otimes S,M\otimes S)$ an isomorphism?

Let $k$ be a commutative ring, $R$ and $S$ commutative $k$-algebras. Let $L$ and $M$ be $R$-modules. Consider the natural map $$\operatorname{Hom}_R(L,M)\otimes_k S \to \operatorname{Hom}_{R \otimes_k S}(L\otimes_k S, M \otimes_k S).$$

In what generality is this map an isomorphism?

Note: This question is reposted from math.SE. The partial answer here appears to show that it suffices to assume $S$ is free as a $k$-module, and either $S$ is finite over $k$ or $L$ is finitely generated as an $R$-module. It also seems to state that if $S$ is free but not finite over $k$, and $L$ is free but not finite over $R$, and $M$ is "reasonable" (e.g., $M=R$), then the morphism fails to be an isomorphism. But it is unsatisfying that the entire analysis (for providing both counterexamples and hypotheses) relies on the assumption that $S$ is free over $k$.

Edit: The following reduction is suggested by a-fortiori: the term on the left is equal to $$\operatorname{Hom}_R(L,M) \otimes_R (R \otimes_k S),$$ and the term on the right is equal to $$\operatorname{Hom}_{R \otimes_k S}(L \otimes_R (R \otimes_k S), M \otimes_R (R \otimes_k S)).$$ Thus, writing $T = R \otimes_k S$, we find that the morphism in question is $$\operatorname{Hom}_R(L, M) \otimes_R T \to \operatorname{Hom}_T(L \otimes_R T, M \otimes_R T).$$ Replacing $T$ by $S$, we see that we have reduced the original question to the case $k = R$, and consequently, $S = R \otimes_k S$. (I found a-fortiori's explanation overly succinct, but I think I've overcompensated.)

• It is true if $L$ is finitely presented as $R$-module (I don't think finitely generated is enough) and $S$ is flat as $R$-module. – Torsten Ekedahl Aug 3 '11 at 16:42
• replacing $k$ and $S$ by $R$ and $R\otimes_k S$, respectively, we may assume $k=R$ – user2035 Aug 3 '11 at 17:10
• Dear Charles, after the reduction to the case $k=R$ suggested by a-fortiori, Proposition 7 in Bourbaki's Algèbre II.5.3 gives some more information. Namely, the canonical morphism in question is a monomorphism if $S$ is projective as an $R$-module, and it is an isomorphism if one of the $R$-modules $S$ and $L$ is projective and finitely generated. – Fred Rohrer Aug 4 '11 at 3:28
• After reducing to the case suggested by a-fortiori, you can find a proof for Torsten's remark in Matsumura's Commutative Ring Theory, on page 52, Theorem 7.11. – Mahdi Majidi-Zolbanin Aug 4 '11 at 12:59
• The Bourbaki condition also happens to be the same one used to derive the trace map in general. – Harry Gindi Feb 9 '12 at 12:00

We may as well work on the local case. Suppose $R=k$ local and $S=R/m$, $m$ is the maximal ideal of $R$. I will also assume $L,M$ finitely generated. Then the LHS is $S^{\mu(Hom_R(L,M))}$ while the RHS is $S^{\mu(L)\mu(M)}$. So if your map is an isomorphism, one must have:
$${\mu(Hom_R(L,M))} = {\mu(L)\mu(M)} \ \ \ (*)$$ Here $\mu(L)$ is the number of generators of $L$. This rarely happens unless $L$ is free. If $L$ is not, even freeness of $M$ is not enough. For example, if $M=R$ and $ann_R(L)$ contains a non-zerodivisor on $R$ (e.g, if $R$ is a domain and $L$ any torsion module), then the LHS of $(*)$ is $0$, while the RHS is $\mu(L)$.
In summary, together with the comments: if $R\otimes_kS$ is not flat over $R$, then I think $L$ must be projective for this to be true in any reasonable generality. May be your situation is more specific, if so can you tell us what you want to be true ?
EDIT: in fact, the above analysis suggests the following class of counter examples: Let $k=R$, $L = R/(x)$ where $x$ is $R$-regular and $M=R$. Then the LHS of your original map is $0$, while the RHS is $Hom_S(S/(x), S) \cong 0:_{S} x$. If $x$ is not $S$-regular then the RHS is not $0$.
• I really think that this answer, together with the comments, more or less gives me what I'm looking for--an idea of what (reasonably general) hypotheses make it work ($S$ flat over $k$ and $L$ finitely presented), together with an analysis of why you won't get good results without these hypotheses (in particular, if $S$ is not flat over $k$--a case which has not been addressed until now). – Charles Staats Aug 4 '11 at 15:41
• Incidentally, "$S$ flat over $k$ and $L$ finitely presented" does cover the case that initially inspired the question. – Charles Staats Aug 4 '11 at 15:41