Solution (source code)

= Solution

Set $C=N/\varphi(M)$. The natural map $N_P\to C_P$ is onto. Its kernel is the image of $\varphi_P$: a fraction $n/s$ maps to zero precisely when $tn\in\varphi(M)$ for some $t\notin P$. If $tn=\varphi(m)$, then $n/s=\varphi_P(m/(ts))$. This proves the localized <cokernel> identity directly:
$$
\operatorname{coker}(\varphi_P)\cong C_P.
$$
Thus $\varphi_P$ is a <surjection> for every $P$ exactly when $C_P=0$ for every $P$. Part (i) makes this equivalent to $C=0$, or to $\varphi$ being a <surjection>. Hence \b[surjectivity is detected at all prime <localizations>], and again maximal <ideals> alone would suffice.