[II, Corollary 1.3.2, EGA]

Lemma 29.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 27.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 26.19.2 we see that $f$ is quasi-compact. By Schemes, Lemma 26.21.6 we see the morphism $f$ is quasi-separated. Hence by Schemes, Lemma 26.24.1 the sheaf $\mathcal{A} = f_*\mathcal{O}_ X$ is a quasi-coherent sheaf of $\mathcal{O}_ S$-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 27.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 27.4.6 we see that the inverse image of every affine open is affine, and hence the morphism is affine by definition.
$\square$

## Comments (4)

Comment #2717 by Johan on

Comment #2845 by Johan on

Comment #5910 by Simon Schirren on

Comment #6109 by Johan on

There are also: