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?



explanation on a scheme which is not affine scheme
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 4**  

The cohomology vector space $H^1(X,\mathcal O\_X)$ is infinite dimensional, whereas the cohomology of a coherent sheaf on an affine scheme vanishes in positive degree.  

In detail, consider the covering $\mathcal U=\lbrace A\_1,A\_2\rbrace$ of $X$. It is a Leray covering because $A\_1,A\_2,A\_{12}$ are affine hence acyclic, for the coherent sheaf $\mathcal O\_X$ (cf. Proof 2) . Thus Čech cohomology computes genuine cohomology.  

The Čech complex is the linear map $$C^0=\Gamma(A\_1,\mathcal O\_X)\times \Gamma(A\_2,\mathcal O\_X)=k[T]\times k[T]\stackrel {d^0}{\to} C^1=\Gamma(A\_{12},\mathcal O^\*\_X)=k[T,T^{-1}]\to 0$$ 
given by $$d^0(P(T),Q(T)) =Q(T)-P(T) $$.  

Hence we get $H^1(X,\mathcal O\_X)=k[T,T^{-1}]/k[T]$ 


**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. 


