Closed immersion criterion for affine schemes (source code)

= Closed immersion criterion for affine schemes
{title2=$\operatorname{Spec}B\hookrightarrow\operatorname{Spec}A\iff A\twoheadrightarrow B$}

A surjective <ring homomorphism> $A\to B=A/I$ identifies the <spectrum of a ring> $B$ with the closed subset $V(I)$ and induces a surjective map of structure sheaves. Conversely, the <direct image sheaf> of $\mathcal O_{\operatorname{Spec}B}$ under an affine morphism is the sheaf associated with the $A$-module $B$: its sections on $D(a)$ are $B_{\phi(a)}$. The cokernel of the structure-sheaf map is therefore associated with the module cokernel of $A\to B$. If the sheaf map is surjective, all localizations of that cokernel vanish and the module cokernel is zero. This proves the converse without assuming global sections preserve arbitrary sheaf surjections.