Here and below, all the rings considered are commutative.
Affine space Let be an algebraically closed field. The affine space \bar X = \mathbb{A}^n_k is the algebraic variety of all points a=(a_1,\ldots,a_n) with coordinates in ; its coordinate ring is the polynomial ring R = k[x_1,\ldots,x_n]. The corresponding scheme X = \mathrm{Spec}(R) is a topological space with the Zariski topology, whose closed points are the maximal ideals \mathfrak{m}_a = (x_1-a_1,\ldots,x_n-a_n), the set of polynomials vanishing at a. The scheme also contains a non-closed point for each non-maximal prime ideal \mathfrak{p}\subset R , whose vanishing defines an irreducible subvariety \bar V=\bar V(\mathfrak{p})\subset \bar X; the topological closure of the scheme point \mathfrak{p} is the subscheme V(\mathfrak{p})=\{\mathfrak{q}\in X \ \ \text{with}\ \ \mathfrak{p}\subset\mathfrak{q}\}, specially including all the closed points of the subvariety, i.e. \mathfrak{m}_a with a\in \bar V, or equivalently \mathfrak{p}\subset\mathfrak{m}_a. The scheme X has a basis of open subsets given by the complements of hypersurfaces, U_f = X\setminus V(f) = \{\mathfrak{p}\in X\ \ \text{with}\ \ f\notin \mathfrak{p}\} for irreducible polynomials f\in R. This set is endowed with its coordinate ring of regular functions \mathcal{O}_X(U_f) = R[f^{-1}] = \left\{\tfrac{r}{f^m}\ \ \text{for}\ \ r\in R, \ m\in \mathbb{Z}_{\geq 0}\right\}. This induces a unique sheaf \mathcal{O}_X which gives the usual ring of rational functions regular on a given open set U. Each ring element r=r(x_1,\ldots,x_n)\in R, a polynomial function on \bar X, also defines a function on the points of the scheme X whose value at \mathfrak{p} lies in the quotient ring R/\mathfrak{p}, the
residue ring. We define r(\mathfrak{p}) as the image of r under the natural map R\to R/\mathfrak{p}. A maximal ideal \mathfrak{m}_a gives the
residue field k(\mathfrak{m}_a)=R/\mathfrak{m}_a\cong k, with the natural isomorphism x_i\mapsto a_i, so that r(\mathfrak{m}_a) corresponds to the original value r(a). The vanishing locus of a polynomial f = f(x_1,\ldots,x_n) is a
hypersurface subvariety \bar V(f) \subset \mathbb{A}^n_k, corresponding to the
principal ideal (f)\subset R. The corresponding scheme is V(f)=\operatorname{Spec}(R/(f)), a closed subscheme of affine space. For example, taking to be the complex or real numbers, the equation x^2=y^2(y+1) defines a
nodal cubic curve in the affine plane \mathbb{A}^2_k, corresponding to the scheme V = \operatorname{Spec} k[x,y]/(x^2-y^2(y+1)).
Spec of the integers The ring of integers \mathbb{Z} can be considered as the coordinate ring of the scheme Z = \operatorname{Spec}( \mathbb{Z} ) . The Zariski topology has closed points \mathfrak{m}_p = (p) , the principal ideals of the prime numbers p\in\mathbb{Z}; as well as the generic point \mathfrak{p}_0 = (0) , the zero ideal, whose
closure is the whole scheme. Closed sets are finite sets, and open sets are their complements, the cofinite sets; any infinite set of points is dense. The basis open set corresponding to the irreducible element p \in \mathbb{Z} is U_p = Z\smallsetminus\{ \mathfrak{m}_p \}, with coordinate ring \mathcal{O}_Z (U_p) = \mathbb{Z}[p^{-1}] = \{\tfrac{n}{p^m}\ \text{for}\ n\in\mathbb{Z}, \ m\geq 0\}. For the open set U = Z\smallsetminus\{\mathfrak{m}_{p_1},\ldots,\mathfrak{m}_{p_\ell}\}, this induces \mathcal{O}_Z (U) = \mathbb{Z}[p_1^{-1},\ldots,p_\ell^{-1}]. A number n\in \mathbb{Z} corresponds to a function on the scheme Z, a function whose value at \mathfrak{m}_p lies in the residue field k(\mathfrak{m}_p)=\mathbb{Z}/(p) = \mathbb{F}_p, the
finite field of integers modulo p
: the function is defined by n(\mathfrak{m}_p) = n \ \text{mod}\ p, and also n(\mathfrak{p}_0)=n in the generic residue ring \mathbb{Z}/(0) = \mathbb{Z}. The function n is determined by its values at the points \mathfrak{m}_p only, so we can think of n as a kind of "regular function" on the closed points, a very special type among the arbitrary functions f with f(\mathfrak{m}_p)\in \mathbb{F}_p. Note that the point \mathfrak{m}_p is the vanishing locus of the function n=p , the point where the value of p is equal to zero in the residue field. The field of "rational functions" on Z is the fraction field of the generic residue ring, k(\mathfrak{p}_0)=\operatorname{Frac}(\mathbb{Z}) = \mathbb{Q}. A fraction a/b has "poles" at the points \mathfrak{m}_p corresponding to prime divisors of the denominator. This also gives a geometric interpretation of
Bezout's lemma stating that if the integers n_1,\ldots, n_r have no common prime factor, then there are integers a_1,\ldots,a_r with a_1 n_1+\cdots + a_r n_r = 1. Geometrically, this is a version of the weak
Hilbert Nullstellensatz for the scheme Z: if the functions n_1,\ldots, n_r have no common vanishing points \mathfrak{m}_p in Z, then they generate the unit ideal (n_1,\ldots,n_r) = (1) in the coordinate ring \Z. Indeed, we may consider the terms \rho_i = a_i n_i as forming a kind of
partition of unity subordinate to the covering of Z by the open sets U_i = Z\smallsetminus V(n_i).
Affine line over the integers The affine space \mathbb{A}^1_{\mathbb{Z}} = \{a\ \text{for}\ a\in \mathbb{Z}\} is a variety with coordinate ring \mathbb{Z}[x], the polynomials with integer coefficients. The corresponding scheme is Y=\operatorname{Spec}(\mathbb{Z}[x]), whose points are all of the prime ideals \mathfrak{p}\subset \mathbb{Z}[x]. The closed points are maximal ideals of the form \mathfrak{m}=(p, f(x)), where p is a prime number, and f(x) is a non-constant polynomial with no integer factor and which is irreducible modulo p . Thus, we may picture Y as two-dimensional, with a "characteristic direction" measured by the coordinate p , and a "spatial direction" with coordinate x . File:SpecZx.png|alt=Spec Z[x]|center|376x376px A given prime number p defines a "vertical line", the subscheme V(p) of the prime ideal \mathfrak{p}=(p) : this contains \mathfrak{m}=(p, f(x)) for all f(x), the "characteristic p points" of the scheme. Fixing the x-coordinate, we have the "horizontal line" x=a , the subscheme V(x-a) of the prime ideal \mathfrak{p}=(x-a) . We also have the line V(bx-a) corresponding to the rational coordinate x=a/b , which does not intersect V(p) for those p which divide b . A higher degree "horizontal" subscheme like V(x^2+1) corresponds to x-values which are roots of x^2+1 , namely x=\pm \sqrt{-1} . This behaves differently under different p -coordinates. At p=5, we get two points x=\pm 2\ \text{mod}\ 5 , since (5,x^2+1)=(5,x-2)\cap(5,x+2) . At p=2, we get one
ramified double-point x=1\ \text{mod}\ 2 , since (2,x^2+1)=(2,(x-1)^2) . And at p=3, we get that \mathfrak{m}=(3, x^2+1) is a prime ideal corresponding to x=\pm \sqrt{-1} in an extension field of \mathbb{F}_3 ; since we cannot distinguish between these values (they are symmetric under the
Galois group), we should picture V(3, x^2+1) as two fused points. Overall, V(x^2+1) is a kind of fusion of two Galois-symmetric horizonal lines, a curve of degree 2. The residue field at \mathfrak{m}=(p, f(x)) is k(\mathfrak{m})=\Z[x]/\mathfrak{m} = \mathbb{F}_p[x]/(f(x))\cong \mathbb{F}_{p}(\alpha), a field extension of \mathbb{F}_p adjoining a root x=\alpha of f(x) ; this is a finite field with p^d elements, d=\operatorname{deg}(f) . A polynomial r(x)\in\Z[x] corresponds to a function on the scheme Y with values r(\mathfrak{m}) = r \ \mathrm{mod}\ \mathfrak{m}, that is r(\mathfrak{m}) = r(\alpha)\in \mathbb{F}_p(\alpha) . Again each r(x)\in\Z[x] is determined by its values r(\mathfrak{m}) at closed points; V(p) is the vanishing locus of the constant polynomial r(x)=p; and V(f(x)) contains the points in each characteristic p corresponding to Galois orbits of roots of f(x) in the algebraic closure \overline{\mathbb{F}}_p. The scheme Y is not
proper, so that pairs of curves may fail to
intersect with the expected multiplicity. This is a major obstacle to analyzing
Diophantine equations with
geometric tools.
Arakelov theory overcomes this obstacle by compactifying affine arithmetic schemes, adding points at infinity corresponding to
valuations.
Arithmetic surfaces If we consider a polynomial f \in \mathbb{Z}[x,y] then the affine scheme X = \operatorname{Spec}(\mathbb{Z}[x,y]/(f)) has a canonical morphism to \operatorname{Spec}\mathbb{Z} and is called an
arithmetic surface. The fibers X_p = X \times_{\operatorname{Spec}(\mathbb{Z})}\operatorname{Spec}(\mathbb{F}_p) are then algebraic curves over the finite fields \mathbb{F}_p. If f(x,y) = y^2 - x^3 + ax^2 + bx + c is an
elliptic curve, then the fibers over its discriminant locus, where \Delta_f = -4a^3c + a^2b^2 + 18abc - 4b^3 - 27c^2 = 0 \ \text{mod}\ p,are all singular schemes. For example, if p is a prime number and X = \operatorname{Spec} \frac{\mathbb{Z}[x,y]}{(y^2 - x^3 - p)} then its discriminant is -27p^2. This curve is singular over the prime numbers 3, p.
Non-affine schemes • For any commutative ring
R and natural number
n,
projective space \mathbb{P}^n_R can be constructed as a scheme by gluing
n + 1 copies of affine
n-space over
R along open subsets. This is the fundamental example that motivates going beyond affine schemes. The key advantage of projective space over affine space is that \mathbb{P}^n_R is
proper over
R; this is an algebro-geometric version of compactness. Indeed,
complex projective space \C\mathbb{P}^n is a compact space in the classical topology, whereas \C^n is not. • A
homogeneous polynomial f of positive degree in the polynomial ring determines a closed subscheme in projective space \mathbb{P}^n_R, called a
projective hypersurface. In terms of the
Proj construction, this subscheme can be written as \operatorname{Proj} R[x_0,\ldots,x_n]/(f). For example, the closed subscheme of \mathbb{P}^2_\Q is an
elliptic curve over the
rational numbers. • The
line with two origins (over a field
k) is the scheme defined by starting with two copies of the affine line over
k, and gluing together the two open subsets A1 − 0 by the identity map. This is a simple example of a non-separated scheme. In particular, it is not affine. • A simple reason to go beyond affine schemes is that an open subset of an affine scheme need not be affine. For example, let X=\mathbb{A}^n\smallsetminus\{0\}, say over the complex numbers \C; then
X is not affine for
n ≥ 2. (However, the affine line minus the origin is isomorphic to the affine scheme \mathrm{Spec}\,\C[x,x^{-1}]. To show
X is not affine, one computes that every regular function on
X extends to a regular function on \mathbb{A}^n when
n ≥ 2: this is analogous to
Hartogs's lemma in complex analysis, though easier to prove. That is, the inclusion f:X\to\mathbb{A}^n induces an isomorphism from O(\mathbb{A}^n)=\C[x_1,\ldots,x_n] to O(X). If
X were affine, it would follow that
f is an isomorphism, but
f is not surjective and hence not an isomorphism. Therefore, the scheme
X is not affine. • Let
k be a field. Then the scheme \operatorname{Spec}\left(\prod_{n=1}^\infty k\right) is an affine scheme whose underlying topological space is the
Stone–Čech compactification of the positive integers (with the discrete topology). In fact, the prime ideals of this ring are in one-to-one correspondence with the
ultrafilters on the positive integers, with the ideal \prod_{m \neq n} k corresponding to the principal ultrafilter associated to the positive integer
n. This topological space is
zero-dimensional, and in particular, each point is an
irreducible component. Since affine schemes are
quasi-compact, this is an example of a non-Noetherian quasi-compact scheme with infinitely many irreducible components. (By contrast, a
Noetherian scheme has only finitely many irreducible components.)
Examples of morphisms It is also fruitful to consider examples of morphisms as examples of schemes since they demonstrate their technical effectiveness for encapsulating many objects of study in algebraic and arithmetic geometry. ==Motivation for schemes==