$\mathbb{A}^{2}$ not isomorphic to affine space minus the origin

It is enough to show that $X=\mathbb A^2_k\setminus \lbrace 0\rbrace$ is not affine since $\mathbb A^2_k \:$ is affine.

First proof of non-affineness
The key point is that the restriction map $\Gamma(\mathbb A^2_k,\mathcal O_{\mathbb A^2_k})=k[T_1,T_2] \to \Gamma(X,\mathcal O_X )$ is bijective.
This is the analogue of the Hartogs phenomenon in several complex variables and in algebraic geometry results from the fact that for a normal ring $A$ we have $A=\cap_{\mathfrak p} A_{\mathfrak p}$, where the intersection is over primes of height $1$.

Now if $X$ were affine we would have the canonical isomorphism of schemes
$X\stackrel {\cong}{\to} Spec(\Gamma(X,\mathcal O_X ))=Spec (k[T_1,T_2])=\mathbb A^2_k$
which is false since the origin of $\mathbb A^2_k$ is not in $X$.

Edit: Second proof of non-affineness
Consider the open covering $\mathcal U$ of $X$ by the two open affine subsets $U_1=D(T_1)$ and $U_2=D(T_2)$, i.e. those open subsets determined by $T_1\neq0$ and $T_2\neq0$.
The covering is a Leray covering for $\mathcal O$ (acyclic opens with acyclic intersection), since $U_1, U_2$ and $U_1\cap U_2$ are affine.
Hence by Leray's theorem we have $H^1(X,\mathcal O)=\check {H}^1(\mathcal U,\mathcal O)$ and thus $H^1(X,\mathcal O)$ is the cohomology of the complex $\Gamma(U_1,\mathcal O)\times \Gamma(U_2,\mathcal O)\to \Gamma(U_1\cap U_2,\mathcal O)\to 0$ where the non-trivial map is $$k[T_1,T_1^{-1},T_2]\times k[T_1,T_2,T_2^{-1}] \to k[T_1,T_1^{-1},T_2,T_2^{-1}]:(f,g)\mapsto g-f$$

Thus $H^1(X,\mathcal O)=\oplus _{i,j\lt 0} \;\; k \cdot T^{i}T^{j}$, an infinite-dimensional $k$-vector space, in sharp contrast to Serre's theorem stating that positive dimensional cohomology groups of coherent sheaves on affine schemes are zero.

Other Edit: Third proof of non-affineness
If $k=\mathbb C $ let us show that $X$ is not affine by proving that its underlying holomorphic manifold $X_{hol}$ is not Stein.
Indeed suppose it were and consider the discrete closed subset $D=\lbrace (1/n,0): n=1,2,3,...\rbrace\subset X$.
Since $D$ is a $0$-dimensional submanifold the restriction map $\Gamma(X_{hol}, \mathcal O_{X_{hol}})\to \Gamma(D, \mathcal O_D)$ would be surjective.
On the other hand, by Hartogs's theorem the restriction map $\Gamma(\mathbb C^2,\mathcal O_{\mathbb C^2}) \to \Gamma(X_{hol},\mathcal O_{X_{hol}}) $ is also surjective so that by composition we would conclude if $X_{hol}$ were Stein to the surjectivity of the restriction map $$ \Gamma(\mathbb C^2,\mathcal O_{\mathbb C^2}) \to \Gamma(D, \mathcal O_D): f\mapsto f_0=f\mid D $$

But this is clearly false because a holomorphic function $f_0:D\to \mathbb C$ is an arbitrary function, and if $f_0$ is not bounded [ for example $f_0(1/n,0)=n$ ] it cannot be the restriction of a holomorphic function $f:\mathbb C^2\to \mathbb C$.


I'll call your punctured plane $X$, as Georges does. As he says, the key is to prove a Hartogs lemma for the inclusion $X \to \mathbf A^2$. What follows is (I think) a special case of the result in commutative algebra that he mentions.

Let $f$ be a regular function on $X$. Then $X - Z(x)$ is affine, isomorphic to $Z(xz - 1) \subset \mathbf A^3$, and hence the restriction of $f$ to this open set of agrees with $g(x, y)/x^n$ for some $g \in k[x, y]$ and $n \geq 0$. Similarly, $f$ restricted to $X - Z(y)$ looks like $h(x, y)/y^m$.

Now, regular functions on $\mathbf A^2$ correspond exactly to elements of $k[x, y]$, and you have two such elements \[ y^mg(x, y) \quad \text{and} \quad x^nh(x, y) \] which agree on the dense subset $\mathbf A^2 - Z(xy)$. Can you argue that, after putting some conditions on $g, h, n, m$, we must have $n = m = 0$ and $f = g$?


One of the two is an affine variety while the other isn't.