[II, Corollary 1.3.2, EGA]

Lemma 28.11.3. Let $f : X \to S$ be a morphism of schemes. The following are equivalent

The morphism $f$ is affine.

There exists an affine open covering $S = \bigcup W_ j$ such that each $f^{-1}(W_ j)$ is affine.

There exists a quasi-coherent sheaf of $\mathcal{O}_ S$-algebras $\mathcal{A}$ and an isomorphism $X \cong \underline{\mathop{\mathrm{Spec}}}_ S(\mathcal{A})$ of schemes over $S$. See Constructions, Section 26.4 for notation.

Moreover, in this case $X = \underline{\mathop{\mathrm{Spec}}}_ S(f_*\mathcal{O}_ X)$.

**Proof.**
It is obvious that (1) implies (2).

Assume $S = \bigcup _{j \in J} W_ j$ is an affine open covering such that each $f^{-1}(W_ j)$ is affine. By Schemes, Lemma 25.19.2 we see that $f$ is quasi-compact. By Schemes, Lemma 25.21.6 we see the morphism $f$ is quasi-separated. Hence by Schemes, Lemma 25.24.1 the sheaf $\mathcal{A} = f_*\mathcal{O}_ X$ is a quasi-coherent sheaf of $\mathcal{O}_ X$-algebras. Thus we have the scheme $g : Y = \underline{\mathop{\mathrm{Spec}}}_ S(\mathcal{A}) \to S$ over $S$. The identity map $\text{id} : \mathcal{A} = f_*\mathcal{O}_ X \to f_*\mathcal{O}_ X$ provides, via the definition of the relative spectrum, a morphism $can : X \to Y$ over $S$, see Constructions, Lemma 26.4.7. By assumption and the lemma just cited the restriction $can|_{f^{-1}(W_ j)} : f^{-1}(W_ j) \to g^{-1}(W_ j)$ is an isomorphism. Thus $can$ is an isomorphism. We have shown that (2) implies (3).

Assume (3). By Constructions, Lemma 26.4.6 we see that the inverse image of every affine open is affine, and hence the morphism is affine by definition.
$\square$

## Comments (2)

Comment #2717 by Johan on

Comment #2845 by Johan on

There are also: