Lemma 86.9.2. Let $S$ be a scheme. If $X$ is an affine formal algebraic space over $S$, then the diagonal morphism $\Delta : X \to X \times _ S X$ is representable and a closed immersion.

Proof. Suppose given $U \to X$ and $V \to X$ where $U, V$ are schemes over $S$. Let us show that $U \times _ X V$ is representable. Write $X = \mathop{\mathrm{colim}}\nolimits X_\lambda$ as in Definition 86.9.1. The discussion above shows that Zariski locally on $U$ and $V$ the morphisms factors through some $X_\lambda$. In this case $U \times _ X V = U \times _{X_\lambda } V$ which is a scheme. Thus the diagonal is representable, see Spaces, Lemma 64.5.10. Given $(a, b) : W \to X \times _ S X$ where $W$ is a scheme over $S$ consider the map $X \times _{\Delta , X \times _ S X, (a, b)} W \to W$. As before locally on $W$ the morphisms $a$ and $b$ map into the affine scheme $X_\lambda$ for some $\lambda$ and then we get the morphism $X_\lambda \times _{\Delta _\lambda , X_\lambda \times _ S X_\lambda , (a, b)} W \to W$. This is the base change of $\Delta _\lambda : X_\lambda \to X_\lambda \times _ S X_\lambda$ which is a closed immersion as $X_\lambda \to S$ is separated (because $X_\lambda$ is affine). Thus $X \to X \times _ S X$ is a closed immersion. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).