Why an affine morphism is separated

algebraic-geometrygeneral-topologyschemes

I'm working on the basic property of affine morphism that they are all separated.
The proof on stacks project uses this lemma but I want to find a direct method.
Here is my attempting:
for an affine morphism $f:X\rightarrow Y$ of schemes, cover $Y$ with open affines $V_i$, and put $U_i=f^{-1}(V_i)$ which is an open affine covering of $X$ . Now we can naturally factor the diagonal morphism as $X\rightarrow\coprod U_i \rightarrow \coprod U_i \times_{V_i}U_i \rightarrow X\times _Y X$. But I can't figure out why the last morphism is closed immersion(is it?).
And does anyone have a brief proof in other ways?

Best Answer

Cover $Y$ with affine opens $\def\Spec{\operatorname{Spec}}\Spec B$: then $$f^{-1}(\Spec B)\times_Y f^{-1}(\Spec B) = f^{-1}(\Spec B)\times_{\Spec B} f^{-1}(\Spec B)=\Spec A\times_{\Spec B}\Spec A$$ cover $X\times_Y X$. Since a morphism of affine schemes is separated, we have that $\Delta_{X/Y}: X\to X\times_Y X$ is locally a closed immersion on each of these sets. As the condition of being a closed immersion is affine-local on the target, we see that $\Delta_{X/Y}:X\to X\times_Y X$ is a closed immersion and thus $X\to Y$ is separated.

Related Question