Definition of closed subscheme

Let $(X,\mathcal O_X)$ be a scheme. I'm using the following definition from Görtz-Wedhorn. A closed subscheme of $(X,\mathcal O_X)$ is a scheme $(Z,\mathcal O_Z)$, where $i\colon Z\hookrightarrow X$ is a closed subset of $X$, and for which there exists an ideal sheaf $\mathcal I\subset\mathcal O_X$ together with an isomorphism $\mathcal O_X/\mathcal I\cong i_*\mathcal O_Z$.

Elsewhere I've seen the definition that a closed subscheme is a scheme of the form $(Z,i^{-1}(\mathcal O_X/\mathcal I))$, where $Z\subset X$ is a closed subset and $\mathcal I\subset\mathcal O_X$ is an ideal sheaf.

It seems like these definitions are equivalent. Certainly the first implies the second, since $i^{-1}i_*\mathcal O_z=\mathcal O_Z$. How do I show the other implication?

Suppose you have a closed subscheme $(Z,\mathcal{O}_Z)$ according to the second definition. Let $\mathcal{J}$ be the ideal sheaf on $X$ defined by saying $f\in\mathcal{J}(U)$ iff for each $p\in U\cap Z$, $f_p\in\mathcal{I}_p$. That is, $\mathcal{J}$ consists of sections of $\mathcal{O}_X$ which are locally in $\mathcal{I}$ at every point of $Z$. We then have $i^{-1}(\mathcal{O}_X/\mathcal{J})\cong i^{-1}(\mathcal{O}_X/\mathcal{I})= \mathcal{O}_Z$ since $\mathcal{I}$ and $\mathcal{J}$ have the same stalks at points of $Z$, so $(Z,\mathcal{O}_Z)$ also satisfies the second definition with respect to $\mathcal{J}$. I claim that $(Z,\mathcal{O}_Z)$ satisfies the first definition with respect to $\mathcal{J}$.
The isomorphism $F:i^{-1}(\mathcal{O}_X/\mathcal{J})\to\mathcal{O}_Z$ induces a homomorphism $G:\mathcal{O}_X/\mathcal{J}\to i_*\mathcal{O}_Z$. We wish to show $G$ is an isomorphism. To prove this, we look at stalks. If $p\in Z$, then the stalk of $i_*\mathcal{O}_Z=i_*i^{-1}(\mathcal{O}_X/\mathcal{J})$ at $p$ is just the stalk of $\mathcal{O}_X/\mathcal{J}$ at $p$, so $G$ is an isomorphism on the stalks at $p$. If $p\in X\setminus Z$, then the stalk of $i_*\mathcal{O}_Z$ at $p$ is $0$, so it suffices to show the stalk of $\mathcal{O}_X/\mathcal{J}$ at $p$ is $0$. But this is immediate from the definition of $\mathcal{J}$: $\mathcal{J}$ is all of $\mathcal{O}_X$ on $X\setminus Z$, since the test for $f$ to be an element of $\mathcal{J}(U)$ is vacuous if $U$ is disjoint from $Z$.
Note that it is not necessarily true that $(Z,\mathcal{O}_Z)$ satisfies the first definition with respect to $\mathcal{I}$. For instance, if $Z=\emptyset$, then the second definition is satisfied for any ideal $\mathcal{I}$ at all, but the first definition can only be satisfied if $\mathcal{I}=\mathcal{O}_X$. More generally, the first definition can only be satisfied if $\mathcal{I}$ is all of $\mathcal{O}_X$ on $X\setminus Z$, but the second definition doesn't care what $\mathcal{I}$ is outside a neighborhood of $Z$.
• Thanks! I'm following you until the start of the 2nd paragraph. I guess $G$ is the composite $\mathcal O_X/\mathcal J\to i_*i^{-1}(\mathcal O_X/\mathcal J)\to i_*\mathcal O_Z$. I'm having trouble seeing what the first morphism does on stalks. – user363520 Jul 9 '17 at 20:10
• Let $\mathcal{F}$ be any sheaf on $X$. The stalk of $\mathcal{F}$ at a point $p\in Z$ is the direct limit of $\mathcal{F}(U)$ over open neighborhoods $U$ of $p$. The stalk of $i_*i^{-1}(\mathcal{F})$ at $p$ is the direct limit of $i_*i^{-1}(\mathcal{F})(U)=i^{-1}(\mathcal{F})(Z\cap U)$. But $i^{-1}(\mathcal{F})(Z\cap U)$ is just the direct limit of $\mathcal{F}(V)$ where $V$ ranges over open neighborhoods of $Z\cap U$. – Eric Wofsey Jul 9 '17 at 20:31
• So an element of the stalk of $i_*i^{-1}(\mathcal{F})$ is represented by an element of $\mathcal{F}(V)$ where $V$ is an arbitrarily small neighborhood of $Z\cap U$ where $U$ is an arbitrarily small neighborhood of $p$. As $U$ varies over all open neighborhoods of $p$, $V$ will vary over all open neighborhoods of $p$ as well, and so the stalk of $i_*i^{-1}(\mathcal{F})$ is the same as the stalk of $\mathcal{F}$, via the canonical map. – Eric Wofsey Jul 9 '17 at 20:34