Inducing homomorphisms on localizations of rings/modules I'm trying to work out Exercise 2.6 in Commutative Algebra by Eisenbud, which asks to prove the Chinese Remainder Theorem for commutative rings.

Exercise: Let $R$ be a commutative ring, and let $I_1,\ldots,I_d$ be pairwise comaximal ideals. Prove that $R/\left(\bigcap_{k=1}^d I_k\right) \simeq \prod_{k=1}^d R/I_k$, via the map $\varphi: R\rightarrow \prod R/I_k$ given by $r \mapsto (r+I_1,\ldots,r+I_d)$.

The kernel of $\varphi$ is precisely $\bigcap_{k=1}^d I_k$, so the goal of the argument is to show that $\varphi$ is surjective. Eisenbud hints to use his Corollary 2.9, which states the following.

Lemma: Let $\varphi:M\rightarrow N$ be an $R$-module homomorphism. Then $\varphi$ is surjective if and only if the induced map $\varphi_{\mathfrak{m}} : M_{\mathfrak{m}} \rightarrow N_\mathfrak{m}$ is surjective for every maximal ideal $\mathfrak{m}$ of $R$.

(Specifically, the map $\varphi_\mathfrak{m}$ is given by $m/u \mapsto \varphi(m)/u$.)
I have a few problems with this.


*

*The lemma is a statement about module homomorphisms, but the $\varphi$ appearing in the Chinese Remainder
Theorem is not a module homomorphism (it's a ring homomorphism). I tried to change the lemma to work for ring homomorphisms, but ran into the following problem.

*Even if $\varphi:R\rightarrow S$ is a ring homomorphism, how does
$\varphi_\mathfrak{m} : R_\mathfrak{m} \rightarrow S_\mathfrak{m}$
make sense? I get that you can localize $R$ at a maximal ideals, but
what does "$S_\mathfrak{m}$" mean when $\mathfrak{m}$ is a maximal ideal of $R$? (Note this post, which actually gives the failure of the lemma for ring homomorphisms -- except in that context we localize $S$ at a prime ideal of $S$, and then localize $R$ at the preimage of that prime ideal.)


Regarding the second remark above, I was thinking that one could view $S$ as an $R$-module by $rs:=\varphi(r)s$, and then consider $S_\mathfrak{m}$ as a localization of an $R$-module by a maximal ideal. But then in order for $\varphi_\mathfrak{m}:R_\mathfrak{m}\rightarrow S_\mathfrak{m}$ to be a ring homomorphism, one has to decide how $S_\mathfrak{m}$ is a ring and then define how to induce a ring homomorphism on localization. This seems like a lot for Eisenbud to sweep under the rug when he says to use the Lemma to solve the exercise. So as far as I understand, the above lemma isn't even relevant to the exercise.
Am I missing something here? Is there a clever way to indirectly apply the lemma?
 A: Note that the ring $R$, and each of the rings $R/I_k$, is also an $R$-module. It is easy to check that the map $\varphi$ is an $R$-module homomorphism.
By the definition of "comaximal", any given maximal ideal $M\subset R$ will contain at most one $I_k$. 
For any given maximal ideal $M\subset R$ and any $I_k$, we have $(R/I_k)_M\cong R_M/(I_k)_M$ because localization commutes with taking quotients. If $M$ contains $I_k$, then $(I_k)_M\neq R_M$, whereas if $M$ does not contain $I_k$, we have $(I_k)_M=R_M$ because $I_k\cap (R\setminus M)\neq\varnothing$.
In either case, we see that the localized map $$\small\varphi_M:R_M\to \left(\prod R/I_k\right)_M\cong \prod R_M/(I_k)_M\cong \begin{cases}
R_M/(I_k)_M &\text{if $I_k$ is contained in $M$,}\\
0 & \text{if none of the $I_k$'s are contained in $M$}
\end{cases}$$
is just a quotient map from the ring $R_M$, hence surjective.
(I leave it to you to check that the composition of $\varphi_M$ with all of these isomorphisms actually does result in the quotient map $R_M\to R_M/(I_k)_M$.)
P.S. This is actually the first time I've seen this approach to proving the map in the Chinese remainder theorem is surjective. I like it a lot, though there are proofs which don't need any localization. Consider the approach taken in Atiyah-Macdonald:

  

