Lemma 37.79.2. Let $X$ be a scheme. If the canonical morphism $X \to \mathop{\mathrm{Spec}}(\Gamma (X, \mathcal{O}_ X))$ of Schemes, Lemma 26.6.4 has a retraction, then $X$ is an affine scheme.

Proof. Write $S = \mathop{\mathrm{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. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).