# Regular monomorphisms of schemes

In the category of schemes, the equalizer of two morphisms $f,g : X \to Y$ is always a locally closed immersion into $X$ (since this is just $X \times_{Y \times Y} Y$ and $\Delta : Y \to Y \times Y$ is a locally closed immersion). What about the converse, is every locally closed immersion some equalizer? In other words, is every locally closed subscheme the locus where two maps agree?

Certaily every open immersion $U \to X$ is an equalizer, namely of the two maps $X \to X \cup_U X$. For closed immersions $Z \to X$, a similar construction works: The pushout $X \cup_Z X$ exists also in this case, see here, and is constructed locally, so that it is enough to remark that $A \to A/I$ is the coequalizer of the two maps $A \times_{A/I} A \to A$ in the category of rings. I general we have a composition of a closed immersion followed by an open immersion, but I'm not sure if we can do the same construction.

-
What happens if you combine the two constructions like this? If $U$ is open in $X$ and $Z=U\cap W$ is closed in $U$, where $W$ is closed in $X$, then first make $X\cup_Z U$ and $U\cup_Z X$ (which are open in $X\cup_WX$), then glue them along $U\cup_Z U$ which is open in both of them. I haven't checked that this makes sense. – Tom Goodwillie Jun 3 '11 at 13:27
Which scheme structure do you chooce on $Z$? / The pushouts $X \cup_Z U, U \cup_Z X$ do not have to exist. – Martin Brandenburg Jun 3 '11 at 14:22
I'm not an algebraic geometer, I'm just guessing. You said "in general we have a composition of a closed immersion followed by an open immersion", so I thought that if $Z$ is locally closed in $X$ then that makes $Z$ a closed subscheme of an open subscheme $U$ of $X$. – Tom Goodwillie Jun 3 '11 at 15:35
Let $V$ be the complement of $W$ in $X$. Couldn't you make the pushout $X\cup_ZU$ by gluing together $V$ and $U\cup_ZU$ along the common open subscheme $V\cap U$ (which is also the complement of $Z$ in $U$, so can be identified with the complement of (the second copy of) $U$ in $U\cup_ZU$)? Maybe I'm missing some subtle point. – Tom Goodwillie Jun 3 '11 at 16:02
The answer by Laurent Moret-Bailly indicates that your idea is correct if we have the stronger assumption that $Z \to X$ is an open immersion $Z \to W$ followed by an closed immersion $W \to X$; then we can also factor it as a closed immersion $Z \to U$ followed by an open immersion $U \to X$ (all this is trivial in the category of topological spaces, where also the converse is correct, but in the category of schemes extra care has to be taken). – Martin Brandenburg Jun 5 '11 at 16:51

Not quite an answer, but too long for a comment. Combining the two (open/closed) gluing constructions, we can conclude that if $Z$ is an open subscheme of a closed subscheme $W$ of $X$, then it is an equalizer: this is Tom's first comment. Now my point is that not every locally closed subscheme is of this form.
Here is an example, which I see as a potential counterexample for Martin's question. Let $k$ be a field. Put $X=\mathrm{Spec}\,k[(T_n)_{n\in\mathbb{N}_{>0}}]$ and let $U$ be the complement of the origin $x$. For each $n>0$, let $Z_n\subset U$ be the $n$-th infinitesimal neighborhood of the "$n$-th basis vector" $e_n$. Put $Z=\bigcup_n Z_n$. This is a closed subscheme of $U$ (isomorphic as a scheme to $\coprod_n Z_n$) since if you invert $X_n$ you just get $Z_n$. But $Z$ is scheme-theoretically dense in $X$: if $f$ is a nonzero polynomial of degree $d$, its order of vanishing at $e_n$ cannot exceed $d$, hence the zero scheme of $f$ does not contain any $Z_{n}$ with $n>d$. So, the only closed subscheme of $X$ containing $Z$ is $X$, in which $Z$ is not open.
Remark: this implies that if $\mathcal{I}\subset \mathcal{O}_U$ is the ideal sheaf of $Z$, and $j:U\to X$ is the inclusion, then $j_\ast\mathcal{I}$ is not quasicoherent. In fact, the above argument applied to rational functions instead of polynomials shows that the stalk $(j_\ast\mathcal{I})_x$ is zero.
This resembles example 20.2.10 in the Stacks Project. Let's call a morphism, which is an open immersion followed by a closed immersion, a p-immersion. Every p-immersion is an immersion, resulting in a pullback square (therefore "p"). a) Every equalizer is an immersion. b) Every p-immersion is an equalizer (if Tom's proof is correct, see my questions above). c) Not every immersion is a p-immersion. d) Now we may ask: Is every equalizer a p-immersion? Since p-immersions are stable under pullbacks, this is equivalent to: d') Is the diagonal $X \to X \times X$ always a p-immersion? – Martin Brandenburg Jun 5 '11 at 17:17