# An elementary question about gluing affine schemes

I can understand how $\mathbb{P}^1_{\mathbb{C}}$ is a union of two $\mathbb{A}^1_{\mathbb{C}}$ geometrically. But whenever I hear phrases like "One can obtain "$\operatorname{Proj}\mathbb{C}[x_0,x_1]$ by gluing $\operatorname{Spec}\mathbb{C}[x]$ and $\operatorname{Spec}\mathbb{C}[1/x]$ via the map $x\leftrightarrow 1/x$," I get a bit confused. I guess the problem is I don't understand exactly what "gluing" means in algebraic context. The aforementioned sentence seems to refer to the funtorial relationship between schemes and rings, but I don't see what that has to do with gluing.

-
Have you looked up the general gluing procedure? The sheaf consists of compatible sections (as always). – Martin Brandenburg Oct 21 '12 at 18:51

Notice that $\Bbb C[x]$ and $\Bbb C[1/x]$ can both be realised as subrings of $\Bbb C[x,1/x]$ by the natural injections. Also $\Bbb C[x,1/x]$ is the localization of $\Bbb C[x]$ at the element $x,$ but it is also the localiation of $\Bbb C[1/x]$ at the element $1/x.$ Importantly, the element that I've named $1/x\in\Bbb C[1/x]$ is actually sent to the inverse of the image of $x$ in the larger ring ("$x\leftrightarrow 1/x$").
Geometrically, this means that there are natural maps from $\operatorname{Spec}(\Bbb C[x,1/x])$ to $\Bbb A^1_x=\operatorname{Spec}(\Bbb C[x])$ and to $\Bbb A^1_{1/x}=\operatorname{Spec}(\Bbb C[1/x]),$ which are inclusions of an open subscheme. In the first case, it is $D(x)\subseteq\Bbb A^1_x$, and in the second case it is $D(1/x)\subseteq\Bbb A^1_{1/x}.$
The open subscheme $\operatorname{Spec}(\Bbb C[x,1/x])$ is the "same" in both cases, so geometrically it makes sense to identify, or "glue", these identical open subschemes, and consider $\Bbb A^1_x$ and $\Bbb A^1_{1/x}$ together as one scheme with their isomorphic open subschemes identified to give us $\Bbb P^1$.