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