The Stacks project, tag 0H2N, at revision a04446e (28 July 2026). Official page: stacks.math.columbia.edu/tag/0H2N
The extensive criterion for closed immersions
In this section, we give a criterion for a morphism of schemes to be a closed immersion.
Lemma 37.81.1 (0H2P) official page ↗
A morphism \(f : X \to Y\) of affine schemes is a closed immersion if and only if for every injective ring map \(A \to B\) and commutative square \[\xymatrix{ \Spec(B) \ar[d] \ar[r] & X \ar[d]^f \\ \Spec(A) \ar[r] \ar@{..>}[ur] & Y }\] there exists a lift \(\Spec(A) \to X\) making the two triangles commute.
Proof. Let the morphism \(f\) be given by the ring map \(\phi : R \to S\). Then \(f\) is a closed immersion if and only if \(\phi\) is surjective.
First, we assume that \(\phi\) is surjective. Let \(\psi : A \to B\) be an injective ring map, and suppose we are given a commutative diagram \[\xymatrix{ R \ar[r]^\alpha \ar[d]^\phi & A \ar[d]^\psi \\ S \ar[r]^\beta \ar@{..>}[ur] & B }\] Then we define a lift \(S \to A\) by \(s \mapsto \alpha(r)\), where \(r \in R\) is such that \(\phi(r) = s\). This is well-defined because \(\psi\) is injective and the square commutes. Since taking the ring spectrum defines an anti-equivalence between commutative rings and affine schemes, the desired lifting property for \(f\) holds.
Next, we assume that \(\phi\) has lifts against all injective ring maps \(\psi: A \to B\). Note that \(\phi(R)\) is a subring of \(S\), so we obtain a commutative square \[\xymatrix{ R \ar[r] \ar[d]^\phi & \phi(R) \ar[d] \\ S \ar@{=}[r] \ar@{..>}[ur] & S }\] in which a lift \(S \to \phi(R)\) exists. Hence, the inclusion \(\phi(R) \to S\) must be an isomorphism, which shows that \(\phi\) is surjective, and we win.
Lemma 37.81.2 (0H2Q) official page ↗
Let \(X\) be a scheme. If the canonical morphism \(X \to \Spec(\Gamma(X, \mathcal{O}_X))\) of Schemes, Lemma 26.6.4 has a retraction, then \(X\) is an affine scheme.
Proof. Write \(S = \Spec(\Gamma(X, \mathcal{O}_X))\) and \(f : X \to S\) the morphism given in the lemma. Let \(s : S \to X\) be a retraction; so \(\text{id}_X = sf\). Then \(f s f = \text{id}_S f\). Since \(f\) induces an isomorphism \(\Gamma(S, \mathcal{O}_S) \to \Gamma(X, \mathcal{O}_X)\) this means that \(fs\) and \(\text{id}_S\) induce the same map on \(\Gamma(S, \mathcal{O}_S)\). Whence \(f s = \text{id}_S\) as \(S\) is affine. Hence \(f\) is an isomorphism and \(X\) is an affine scheme, as was to be shown.
Lemma 37.81.3 (0H2R) official page ↗
Let \(X\) be a scheme. Let \(f : X \to S = \Spec(\Gamma(X, \mathcal{O}_X))\) be the canonical morphism of Schemes, Lemma 26.6.4. The largest quasi-coherent \(\mathcal{O}_S\)-module contained in the kernel of \(f^\sharp : \mathcal{O}_S \to f_*\mathcal{O}_X\) is zero. If \(X\) is quasi-compact, then \(f^\sharp\) is injective. In particular, if \(X\) is quasi-compact, then \(f\) is a dominant morphism.
Proof. Let \(M \subset \Gamma(S, \mathcal{O}_S)\) be the submodule corresponding to the largest quasi-coherent \(\mathcal{O}_S\)-module contained in the kernel of \(f^\sharp\). Then any element \(a \in M\) is mapped to zero by \(f^\sharp\). However, \(f^\sharp(a)\) is the element of \[\Gamma(S, f_*\mathcal{O}_X) = \Gamma(X, \mathcal{O}_X) = \Gamma(S, \mathcal{O}_S)\] corresponding to \(a\) itself! Thus \(a = 0\). Hence \(M = 0\) which proves the first assertion. Note that this is equivalent to the morphism \(f : X \to S\) being scheme-theoretically surjective.
If \(X\) is quasi-compact, then \(\Ker(f^\sharp)\) is quasi-coherent by Morphisms, Lemma 29.6.3. Hence \(\Ker(f^\sharp) = 0\) and \(f^\sharp\) is injective. In this case, \(f\) is a dominant morphism by part (4) of Morphisms, Lemma 29.6.3.
Lemma 37.81.4 (0H2S) official page ↗
Let \(f: X \to Y\) be a quasi-compact morphism of schemes. Then \(f\) is a closed immersion if and only if for every injective ring map \(A \to B\) and commutative square \[\xymatrix{ \Spec(B) \ar[d] \ar[r] & X \ar[d]^f \\ \Spec(A) \ar[r] \ar@{..>}[ur] & Y }\] there exists a lift \(\Spec A \to X\) making the diagram commute.
Proof. Assume that \(f\) is a closed immersion. Let \(A \to B\) be an injective ring map and consider a commutative square \[\xymatrix{ \Spec(B) \ar[d] \ar[r] & X \ar[d]^f \\ \Spec(A) \ar[r] \ar@{..>}[ur] & Y }\] Then \(\Spec(A) \times_Y X \to \Spec(A)\) is a closed immersion and hence we get an ideal \(I \subset A\) and a commutative diagram \[\xymatrix{ \Spec(B) \ar[d] \ar[r] & \Spec(A/I) \ar[r] \ar[d] & X \ar[d]^f \\ \Spec(A) \ar[r] \ar@{..>}[ur] & \Spec(A) \ar[r] & Y }\] We obtain a lift by Lemma 37.81.1.
Assume that \(f\) has the lifting property stated in the lemma. To prove that \(f\) is a closed immersion is local on \(Y\), hence we may and do assume \(Y\) is affine. In particular, \(Y\) is quasi-compact and therefore \(X\) is quasi-compact. Hence there exists a finite affine open covering \(X = U_1 \cup \ldots \cup U_n\). The source of the morphism \[\pi : U = \coprod U_i \longrightarrow X\] is affine and the induced ring map \(\Gamma(X, \mathcal{O}_X) \to \Gamma(U, \mathcal{O}_U)\) is injective. By assumption, there exists a lift in the diagram \[\xymatrix{ U \ar[r]^\pi \ar[d] & X \ar[d]^f \\ \Spec(\Gamma(X, \mathcal{O}_X)) \ar[r]^-{f'} \ar@{..>}[ur]^h & Y }\] where \(f'\) is the morphism of affine schemes corresponding to the ring map \(\Gamma(Y, \mathcal{O}_Y) \to \Gamma(X, \mathcal{O}_X)\). It follows from the fact that \(\pi\) is an epimorphism that the morphism \(h\) is a retraction of the canonical morphism \(X \to \Spec(\Gamma(X, \mathcal{O}_X))\); details omitted. Hence \(X\) is affine by Lemma 37.81.2. By Lemma 37.81.1 we conclude that \(f\) is a closed immersion.