Remark 66.12.4. Let $S$ be a scheme. Let $i : Z \to X$ be an immersion of algebraic spaces over $S$. Since $i$ is a monomorphism we may think of $|Z|$ as a subset of $|X|$; in the rest of this remark we do so. Let $\partial |Z|$ be the boundary of $|Z|$ in the topological space $|X|$. In a formula

$\partial |Z| = \overline{|Z|} \setminus |Z|.$

Let $\partial Z$ be the reduced closed subspace of $X$ with $|\partial Z| = \partial |Z|$ obtained by taking the reduced induced closed subspace structure, see Properties of Spaces, Definition 65.12.5. By construction we see that $|Z|$ is closed in $|X| \setminus |\partial Z| = |X \setminus \partial Z|$. Hence it is true that any immersion of algebraic spaces can be factored as a closed immersion followed by an open immersion (but not the other way in general, see Morphisms, Example 29.3.4).

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).