Closed immersions are stable under base change

Fact: $X, Y$ are schemes over $S$, if $U\subset X$ is an open subset and if the product $X\times _S Y$ exists then $p_1 ^{-1}(U)= U\times _S X$ .

Let $f:Z \rightarrow X$ is a closed immersion. equivalently there is an open affine covering $\{U_i\}$, $U_i=Spec(A_i)$ of $X$, such that $f^{-1}(U_i)=Spec(A_i/I_i)$ for some $I_i$ ideal of $A_i$.

Let $g: Y\rightarrow X$ is a morphism . To show $p_2: Z\times _X Y \rightarrow Y$ is a closed immersion. $\require{AMScd} \begin{CD} Z\times _X Y @>>> Y \\ @VVV @VVV \\ Z @>>> X \end{CD}$

We can choose an open affine covering $\{Spec(B_i)\}$ of $Y$ such that $g(Spec (B_i))\subset (Spec(A_i))$ .

By the Fact above, $p_2^{-1}(Spec (B_i))= (Spec (B_i))\times_X Z $

$= (Spec (B_i))\times_{Spec (A_i)} Spec (A_i/I_i) $

( because $g(Spec(B_i))\subset Spec (A_i)$ and $f^{-1}(Spec(A_i))= Spec(A_i/I_i)$)

$=Spec(B_i\otimes_{A_i} A_i/I_i)$

$=Spec(B_i/I_i B_i)$ (becasue $M/IM\cong M\otimes_{A}A/I$)

Therefore $p_2$ is a closed immersion.


This is not an optimal solution, but if you didn't know that closed immersions can be checked affine locally (like I didn't), then this would be something you can do: check each condition for a closed immersion separately.

Let $X = \operatorname{Spec} R$, $X' = \operatorname{Spec} A$, and $Y = \operatorname{Spec} B$ be affine. Then, we know that in the diagram $$\require{AMScd} \begin{CD} B \otimes_R A @<<< A\\ @AAA @AAA \\ B @<<< R \end{CD}$$ $R \to B$ being surjective implies $A \to B \otimes_R A$ is surjective by the right exactness of the tensor product.

Now what we want to do is to use the same idea to show the surjectivity of the map $f^{\prime\#}$ on structure sheaves, and to do so you can check surjectivity on stalks. Thus, by using small enough open neighborhoods you can assume $X,X',Y$ are affine and using the notation above, you want to show $A_P \to (B \otimes_R A)_P$ is surjective for each $P \in \operatorname{Spec} A$, where you consider $B \otimes_R A$ as an $A$-module. Now the thing was that I decided to localize the diagram above at the prime $P$: you're right that I was wrong to put my prime $P$ in $\operatorname{Spec} R$ instead of $\operatorname{Spec} A$.

Instead, you can get the same conclusion by noticing $(B \otimes_R A)_P = B \otimes_R A \otimes_A A_P = B \otimes_R A_P$, so we want to show $A_P \to B \otimes_R A_P$ is surjective. But $R \to B$ is surjective since it is locally surjective by assumption that $Y \to X$ is a closed immersion, so right exactness works again.

Now, the question is how you get the topological part of being a closed immersion. The proof above combined with Exercise 2.18(c) shows we have a homeomorphism with a closed subset of $X'$ when assuming $X,X',Y$ are affine. You can then play the whole gluing game like in the construction of the fiber product to deduce that for arbitrary $X,X',Y$ you have this topological property.

In hindsight, this is not a good way to go!

EDIT: I was requested to flesh out the topological part of the proof. Recall the setup: want to show that in the diagram $$\begin{CD} Y \times_X X' @>f'>> X'\\ @VVV @VV{g}V \\ Y @>f>> X \end{CD}$$ that if $f$ is a closed immersion, then $f'$ is a closed immersion. The proof above shows that $f^{\prime\#}$ is indeed surjective at each stalk, and so we must show $f'$ induces a homeomorphism between $Y \times_X X'$ and a closed subset of $X'$. I think the hard part is proving we can reduce to the case when $X,X',Y$ are affine, so I will be doing this below. We follow EGAI, Cor. 4.2.4 and Prop. 4.3.1. Note that the new edition has another proof.

We first note that closed immersions are local on target. The property on stalks is trivially local on target; the property "a morphism $f\colon Y \to X$ induces a homeomorphism between $Y$ and a closed subset of $X$" is local on target as well. For, suppose $\{X_\lambda\}$ is a cover of $X$ and $Y_\lambda := f^{-1}(X_\lambda)$, such that $Y_\lambda \to X_\lambda$ induces a homeomorphism between $Y_\lambda$ and $f(Y_\lambda)$ a closed subset of $X_\lambda$. By hypothesis, if $y \in Y$, every neighborhood of $y$ is mapped to a neighborhood of $f(y)$, and $f$ is injective. So, it remains to show that $f(Y)$ is actually closed in $X$. But it suffices to show $f(Y) \cap X_\lambda$ is closed in $X_\lambda$ for every $\lambda$; but this is trivial since $f(Y) \cap X_\lambda = f(Y_\lambda)$ is closed in $X_\lambda$.

Now back to the claim at hand. We first reduce to the case where $X$ is affine. First let $\{X_\lambda\}$ be an affine cover of $X$, and let $Y_\lambda := f^{-1}(X_\lambda)$ and $X'_\lambda := g^{-1}(X_\lambda)$. The restriction $f\rvert_{Y_\lambda}\colon Y_\lambda \to X_\lambda$ is closed immersion, hence if the proposition holds for $X$ affine, then $Y_\lambda \times_{X_\lambda} X'_\lambda \to X'_\lambda$ is a closed immersion. Now by Thm. 3.3, Step 7, the $Y_\lambda \times_{X_\lambda} X'_\lambda$ are canonically isomorphic to $Y \times_X X'_\lambda$; the morphism $Y_\lambda \times_{X_\lambda} X'_\lambda \to X'_\lambda$ is the same as the restriction of $f'$ to $Y \times_X X'_\lambda$ ; since the $X'_\lambda$ form a cover of $X'$, we have that $f'$ is a closed immersion assuming the proposition holds for $X$ affine by the fact that closed immersions are local on target.

Now we further reduce to the case where $X'$ is affine as well; note that $X$ affine implies $Y$ is affine since it is a closed subscheme of $X$ by Exercise 3.11(b). But if $\{X'_\mu\}$ is an affine open cover of $X'$, then $Y \times_X X'_\mu \to X'_\mu$ is a closed immersion by the affine case we wanted to reduce to, hence $Y \times_X X' \to X'$ is a closed immersion since closed immersions are local on target.