TITLE: Help understand canonical isomorphism in localization (tensor products)
QUESTION [8 upvotes]: Let $M,N$ be $A$-modules and let $P$ be a prime ideal.
Can someone please explain why the following isomorphism holds?
$$(M \otimes_{A} N)_{P} \cong M_{P} \otimes_{A_{P}} N_{P}$$
Here's what I tried:
Consider the map $f: M_{P} \times N_{P} \rightarrow (M \otimes_{A} N)_{P}$ given by $$(m/s,n/s') \mapsto (m \otimes n)/(ss')$$ Since this is bilinear, the universal property induces a map $g: (M_{P} \otimes_{A_{P}} N_{P}) \rightarrow (M \otimes_{A} N)_{P}$  given by $$g(m/s \otimes m'/s') = (m \otimes n)/(ss')$$ 
Is it true that this map is actually an isomorphism?

REPLY [6 votes]: @user6495 Since I cannot leave comments, I will clarify the question you asked (I hope Matt E does not mind). The point is that the tensor product is commutative and associative. Therefore, we can write $(A_p\otimes_A M)\otimes_{A_p} (A_p\otimes_A N)\cong (M\otimes_A (A_p\otimes_{A_p} A_p))\otimes_A N\cong (M\otimes_A A_p)\otimes_A N\cong (A_p\otimes_A M)\otimes_A N$. The associativity of the tensor product used here is in the general sense of bimodules; $A_p$ is an $(A,A_p)$-bimodule.