Why is $\mathbb{A}^2$ isomorphic to $\operatorname{Spec}k[x,y]$ as ringed spaces Suppose that $k$ is an algebraically closed field, and let $\mathbb{A}^2$ denote the affine $2$-space $k^2$.
An affine scheme is defined to be a locally ringed space $(X, \mathcal{O}_X )$ which is isomorphic (as locally ringed spaces) to the spectrum of some ring. 
Then is $\mathbb{A}^2$ an affine scheme? Is it isomorphic (as locally ringed spaces) to the spectrum of the polynomial ring $k[x,y]$?
Let $\mathbb{A}^2_k = \operatorname{Spec}k[x,y]$, and $\phi: \mathbb{A}^2 \rightarrow \mathbb{A}^2_k, (a,b) \mapsto \langle x-a, y-b \rangle$, then $\phi$ injects $\mathbb{A}^2$ to the set of maximal ideals of $k[x,y]$, i.e., the set of closed points of $\mathbb{A}^2_k$. I see that $0$, as a prime ideal of $k[x,y]$, is also a point in $\mathbb{A}^2_k$, but it does not lie in $\phi(\mathbb{A}^2)$. The Krull dimension of $k[x,y]$ is $2$, so beside $0$ and maximal ideals, there is still another kind of prime ideals in $k[x,y]$. In fact, any irreducible polynomial $f(x,y) \in k[x,y]$ generates a prime ideal $\langle f(x,y) \rangle$. In a word, $\phi$ is not surjective. Can it still be the map of topological spaces in the isomorphism of ringed spaces? The definition for such isomorphism says that the map of topological spaces should be a homeomorphism. Can a non-surjective map be a homeomorphism? Or, is there any other way to define the map?
Thank you very much.
Edited: I neglected the condition of $k$ being algebraically closed, and I thought the denotation $\mathbb{A}^2$ is generally known. I add these in the front. Sorry for the misunderstanding :)
 A: Let us define $\mathbb  A^2_k=Spec (k[x,y])$. Your notation $\mathbb A^2$ is not standard in algebraic geometry and I think you just mean $k^2$, which I will use henceforth.  
There is indeed a set theoretic injective map  $\phi:k^2\to \mathbb A^2_k: (a,b)\mapsto \langle x-a,x-b\rangle $, just as you wrote.
The image of $\phi $ consists of the $k$-rational points of $\mathbb  A^2_k$: these are the points corresponding to ideals ${\mathfrak m}\subset A$ such that the natural morphism of $k$-algebras $k\to A/{\mathfrak m}$ is surjective.
These rational points are closed ( in other words these ${\mathfrak m}$ are maximal) but, unless $k$ is algebraically closed, there are other closed points in $\mathbb  A^2_k$.
 For example in $\mathbb  A^2_\mathbb Q$, the maximal ideal $M=\langle x^2-2,y\rangle \subset k[x,y]$ yields a closed point which is not rational (according to a theorem proved 25 centuries ago, albeit not in the language of scheme theory).   
To sum up, the image of $\phi $ is never surjective and misses many points of $\mathbb  A^2_k$:
i) The closed but not rational points (if $k$ is not algebraically closed).
ii) The height one points corresponding to nonzero prime ideals which are not maximal .
iii) The generic point corresponding to the zero ideal.
A: I assume by $\mathbb{A}^2$ you mean the "classical" affine plane over $k$. This can't be homeomorphic to the underlying topological space of the scheme $\mathbb{A}_k^2=\mathrm{Spec}(k[x,y])$ because the latter has a non-closed "generic" point for each irreducible closed subset. When $k$ is algebraically closed (in which case all the maximal ideals of $k[x,y]$ are of the form $(x-a,y-b)$ for $a,b\in k$), the topological space $\mathbb{A}^2$ is homeomorphic to the set of closed points of $\mathbb{A}_k^2$. Basically the scheme $\mathbb{A}_k^2$ is obtained from $\mathbb{A}^2$ by throwing in a generic point for each irreducible closed subset. A detailed explanation of this (making things precise, at least for $k$ algebraically closed) can be found in the second chapter of Hartshorne. Specifically, see Proposition 2.6, where a fully faithful functor from "classical varieties" over $k$ to $k$-schemes is constructed. 
