# Image of the map induced on spectra

Apologize in advance if this is a bit trivial but I am stuck on the following:

Prove that for $\varphi : R \to S$ a map between commutative rings, the prime $\mathfrak{p}$ is in the image of the induced map $\mathrm{Spec}(S) \to \mathrm{Spec}(R)$ iff $\mathfrak{p} = \varphi^{-1}(\mathfrak{p}S)$.

For instance if $\varphi : \mathbf{Q} \to \mathbf{Q} \times \mathbf{Q}$ is the map $a \mapsto (a, a)$, clearly $\mathfrak{p} = (0)$ is the unique prime ideal of $\mathbf{Q}$ and its extension $\{(0, 0)\}$ (whose contraction is $\mathfrak{p}$) is not prime (since $(1,0)(0,1) = (0,0)$).

My question: if in general $\mathfrak{p}S$ is not a choice for an element in the fiber of $\mathfrak{p}$, then what should I do? I'm surely missing something easy.

• This is proposition 3.16 in Atiyah-MacDonald. Dec 6 '14 at 20:19
• @user26857 That $pS$ is not a choice for $q$. Dec 6 '14 at 20:43

"$\Rightarrow$" If $p=P^c$, then $p^{ec}=P^{cec}=P^c=p$ (see Atiyah and Macdonald, Proposition 1.17).
"$\Leftarrow$" You know that $p=p^{ec}$. Localize everything at $p$ and thus can assume that $p$ is maximal. Take any prime ideal $P$ containing $pB$. Then $p=p^{ec}\subseteq P^c$, hence equality.
The fiber of $\mathrm{Spec}(S) \to \mathrm{Spec}(R)$ at $\mathfrak{p}$ is $\mathrm{Spec}(S \otimes_R Q(R/\mathfrak{p}))$. Therefore:
$\mathfrak{p}$ has a preimage $\Longleftrightarrow S \otimes_R Q(R/\mathfrak{p}) \neq 0\\ \Longleftrightarrow (R \setminus \mathfrak{p})^{-1} (S/\mathfrak{p}S) \neq 0\\ \Longleftrightarrow \forall r \in R \setminus \mathfrak{p} (\phi(r) \cdot 1 \neq 0 \in S/\mathfrak{p}S)\\\Longleftrightarrow \forall r \in R (\phi(r) \in \mathfrak{p} S \Rightarrow r \in \mathfrak{p})\\\Longleftrightarrow \phi^{-1}(\mathfrak{p} S) \subseteq \mathfrak{p}\\ \Longleftrightarrow \phi^{-1}(\mathfrak{p} S) = \mathfrak{p}$