# Showing the set-theoretic image is contained in the scheme theoretic image.

$\newcommand{\Spec}{\operatorname{Spec}}$I'm looking at the proof of Corollary $8.3.5$ in Vakil's FOAG, which is to show that under certain conditions, the closure of the set-theoretic image of a scheme morphism $\pi:X\to Y$ is the scheme-theoretic image. The first step in this is to see, of course, that the set-theoretic image is indeed contained in the scheme-theoretic image. Vakil asks the reader to check this, so it must not be too complicated, but I'm having trouble proving it.

The scheme-theoretic image is described as follows: for a closed subscheme $i:Z\hookrightarrow Y$, we say the image of $X$ lies in $Z$ if $\mathscr J_{Z/Y}\to\mathscr O_Y\to\pi_*\mathscr O_X$ is exact, where $\mathscr J_{Z/Y}$ is the sheaf of ideals induced by $Z$. We get the scheme-theoretic image by taking the intersection over all such $Z$.

So all we need to show is that if we have such a $Z$, and $p\in X$, then $\pi(p)\in Z$. If we choose an affine open set $\Spec B$ containing $\pi(p)$, then by definition of $X$ lying in $Z$, we have

$$\mathscr J_{Z/Y}(\Spec B)=\ker(B\to\mathscr O_X(\pi^{-1}\Spec B))$$

If we let $I(B)=\mathscr J_{Z/Y}(\Spec B)$, then we note that $Z=\cup \Spec B/I(B)$ as $\Spec B$ runs over all affine open subsets of $Y$, so we just need to show that if $\pi(p)$ corresponds to the prime ideal $\mathfrak q$ of $B$, then $\mathfrak q\supseteq I(B)$.

I feel this should just be an unraveling of definitions, but I'm not seeing it. Can anybody help?

First of all, vakil defines that the image of $X$ lies in $Z$ if the composition $\mathscr{I}_{Z/Y}\to \mathscr{O}_Y\to\pi_*\mathscr{O}_X$ is zero, not that it's exact.
Now, if we take $p\in X$ and let $\text{Spec}B$ be an open affine subset of $Y$ that contains $\pi(p)$. Then we have that the composition $$\mathscr{I}_{Z/Y}(\text{Spec}B)\overset{g}\to \mathscr{O}_Y(\text{Spec}B)\overset{f}\to\pi_*\mathscr{O}_X(\text{Spec}B) \quad (*)$$ is zero. In particular, $\text{Im}g \subseteq \ker f$ and so the prime ideal in $\mathscr{O}_Y(\text{Spec}B)$ that corresponds to $\pi(p)$ contains $\text{Im}g$. However, from the definition of closed embeddings, we have that the following is exact $$0\to\mathscr{I}_{Z/Y}(\text{Spec}B)\overset{g}\to \mathscr{O}_Y(\text{Spec}B)\overset{h}\to i_*\mathscr{O}_Z(\text{Spec}B)\to 0$$ and so $\text{Im}g = \ker h.$ But now we are done, since the points of $Z\cap\text{Spec} B$ correspond to the prime ideals that contain $\ker h=\text{Im}h$ but by $(*)$, the prime ideal in $\mathscr{O}_Y(\text{Spec}B)$ that corresponds to $\pi(p)$ is such a prime ideal.