Hartshorne at the end of page 76 of his Algebraic Geometry book gives an example of a scheme which is not an affine scheme. The scheme is constructed by gluing two affine lines together along their maximal ideals obtained by removing a point P. There's also a figure accompanying the example:

___________:_________

Can someone please explain how to show that this is not an affine scheme?

2 Answers
2

Call $X $ your scheme over the field $k$, $P_1$ and $P_2$ the two special closed points, $A_1$and $A_2$ their respective open complements and $A_{12}=A_1\cap A_2$, so that $A_i\simeq \mathbb A^1_k$ and $A_{12}\simeq\mathbb G_m$, all affine schemes.
Here are some (not independent) proofs that $X$ is not affine.

Proof 1
The point $(P_1,P_2)\in X \times X $ is in the closure of the diagonal $\Delta_X\subset X \times X $, but $(P_1,P_2)\notin \Delta_X$ . So $\Delta_X$ is not closed, hence $X$ is not separated and a fortiori not affine

Proof 2
The images of the restriction map $\Gamma(A_i,\mathcal O_X)=k[T] \to \Gamma(A_{12},\mathcal O_X)=k[T,T^{-1}]$ are both
$k[T]$, and together do not generate $ k[T,T^{-1}]$. However, in an affine scheme (or more generally in a separated scheme) the ring of regular sections on the intersection of two open affines is generated by the images of the regular sections on the two opens.

Proof 3
The two open immersions $\iota_j:\mathbb A^1_k \to X$ with respective image $A_j\subset X$ coincide on the open subscheme $\mathbb G_m\subset \mathbb A^1_k$ but are nevertheless distinct. This couldn't happen if $X$ were affine (or just separated).

Proof 5
The Čech complex above proves that $\Gamma(X,\mathcal O_X)=k[T]$ so that the restriction to the strictly smaller open affine subscheme $A_1\subsetneq X$ is bijective: $res: \Gamma(X,\mathcal O_X)\stackrel {\simeq}{\to} \Gamma(A_1,\mathcal O_X)$.
This cannot happen for an affine scheme $X$.
[In categorical language: $\Gamma$ is an anti-equivalence from the category of affine schemes to that of rings]

Proof 6
Every global function $P(T)\in \Gamma(X,\mathcal O_X)=k[T]$ (see Proof 5) takes the exact same value at $P_1$ and $P_2$, namely $P(0)\in \kappa(P_1)=\kappa (P_2)=k$.
In contrast given two closed points in an affine scheme , there exists a global regular function vanishing at the first one but not at the second.

My friend Otto Forster once told me that he had seen in an old German book on group theory the sentence "Um den Satz zu erhärten, geben wir einen zweiten Beweis", which translates as: "To harden the theorem, we give a second proof". Logicians tell me that they are not convinced of the hardening. Pity, that
–
Georges ElencwajgFeb 4 '12 at 13:19

Compute the ring $R$ of globally defined regular functions. If the scheme were affine, then there would be a bijective correspondence between closed points of the scheme and maximal ideals of $R$, given by taking a closed point to the ideal of functions that vanish at that point. But the two points represented by the colon in your diagram give the same ideal of $R$, so this "correspondence" is not injective. Therefore, the scheme is not affine.