In this post I’d like to establish some basic properties of schemes and prove a really important theorem – the category of affine schemes is the categorical dual of the category of commutative rings!

Basic Technical Results

So, let’s begin:

Theorem: Let $R$ be a commutative ring and $X=\text{Spec}(R)$ the affine scheme obtained from $R$ (here I use $X$ to mean the ringed space with the sheaf of rings $\mathcal{O}_X$ hiding somewhere in the context!). Let $P\in X$ be any point (i.e. any prime ideal of $R$). Then the stalk $\mathcal{O}_{X, P}$ is isomorphic to the localisation $R_P$ by a unique isomorphism.

Proof: Recall that the stalk at $P$ is the colimit $\mathcal{O}_{X,P} = \text{colim}_{P\in U} \mathcal{O}_X (U)$ where $U$ runs over all open sets of $X$. Since we have a base for our topology consisting of the basic open sets $D(f)$, we may as well take the colimit over this instead:

$\mathcal{O}_{X,P} = \text{colim}_{P\in D(f)} \mathcal{O}_X(D(f))$

$= \text{colim}_{f\notin P} R_f$

Now for any $f\notin P$, there is a natural ring homomorphism $R_f \rightarrow R_P$ sending each element of the form $a/f^n \in R_f$ to itself in $R_P$; this is well-defined because every element of $R\backslash P$ is a unit in $R_P$. Clearly this is also compatible with the restriction maps, so by the universal property of the colimit there is a unique ring homomorphism $\mathcal{O}_{X,P} \rightarrow R_P$.

Let’s call this morphism $\phi$. Now every element of $R_P$ is of the form $a/f^n$ for some $a\in R$, $f\in R\backslash P$ and $f\in \mathbb{Z}$, and therefore $\phi$ is a surjection (because we can find this element in the localisation $R_f$ and then include it into the stalk). Now suppose that $a/f^n \in R_f$ is sent to $0\in R_P$; by definition of being zero in a localisation this means there exists $g\in R\backslash P$ such that $a g = 0\in R$. But then $a/f^n = 0 \in R_{f g}$, and thus its image in the stalk is zero. Hence $\ker \phi = \left\{0\right\}$, so $\phi$ is injective. Thus

$\mathcal{O}_{X,P} \cong R_P$

This establishes that the affine scheme $(X,\mathcal{O}_X)$ is not only a ringed topological space but a locally ringed space, which means that the stalks at each of its points are local rings.

Here’s a useful consequence of the previous result:

Lemma: Let $R$ be an integral domain with field of fractions $k = \text{Frac}(R)$, and let $x\in X = \text{Spec}(R)$ be the point of $X$ corresponding to the prime ideal $(0)$. Then $\mathcal{O}_{X,x} \cong k$. Furthermore, every nonempty open subset $U\subseteq X$ contains $x$ and the universal inclusions into the colimit $\mathcal{O}_X (U)\rightarrow \mathcal{O}_{X,x}$ are injective. Hence if $V\subseteq U$ then the restriction $\mathcal{O}_X(U) \rightarrow \mathcal{O}_X (V)$ is injective.

Proof: We have $\mathcal{O}_{X,x} \cong R_{(0)} \cong k$. For a principal open subset $U = D(f)$ we have $\mathcal{O}_X (U) = R_f \subseteq k$, so there is a natural injection $\mathcal{O}_X (U) \rightarrow k$. Now suppose that $U = \bigcup_{i\in I} D(f_i)$ is a general open subset of $X$ and suppose a section $s\in \mathcal{O}_X (U)$ is mapped to zero in $k$. Then using the diagram

we know the restriction of $s$ to each $D(f_i)$ is zero. Since $\mathcal{O}_X$ is a sheaf on $X$, the restriction $\mathcal{O}_X \vert_{U}$ is a sheaf on $U$ and hence the identity sheaf axiom implies $s = 0$ in $\mathcal{O}_X (U)$. Thus $\mathcal{O}_X (U)\rightarrow k$ is injective. The commutativity of the restrictions and inclusions into the stalk implies that each restriction map $\mathcal{O}_X (U)\rightarrow \mathcal{O}_X (V)$ is injective.

Now I want to tell you two more magical properties of my functor $\text{Spec}: \text{CRing} \rightarrow \text{Top}$ (we can forget about the ringed space structure for a moment).

Lemma: Let $\phi: A\rightarrow B$ be a ring homomorphism and $f: \text{Spec} (B) \rightarrow \text{Spec} A)$ the corresponding continuous map (which I wrote about in this post). Then:

1. If $\phi$ is surjective then $f$ induces a homeomorphism $\text{Spec}(B)\cong V(\ker \phi)\subseteq \text{Spec}(A)$.
2. If $\phi: A\rightarrow S^{-1} A$ is a localisation morphism then $f$ induces a homeomorphism from $\text{Spec}(S^{-1} A)$ onto the subspace

$Y =\left\{ P\in\text{Spec}(A): P\cap S = \varnothing\right\}$.

Proof:

(1): Since $B \cong A/\ker\phi$ as $\phi$ is surjective, the prime ideals of $B$ are in bijective correspondence with the prime ideals of $A/\ker\phi$, which are themselves in bijective correspondence with the prime ideals of $A$ containing $\ker\phi$. This establishes a bijection of sets $\text{Spec}(B) \cong V(\ker\phi)\subseteq \text{Spec}(A)$; since $f$ is continuous, this is a continuous bijection. Furthermore for an ideal $J\subseteq B$ we have

$f(V(J)) = \left\{P \in\text{Spec}(A): \phi(P)\supseteq J\right\}$

$= \left\{P\in\text{Spec}(A): P\supseteq \phi^{-1} (J)\right\}$

$= V(\phi^{-1} (J))$

This tells us that the image of a closed set under $f$ is closed, so $f$ is closed. Therefore $f$ is a homeomorphism.

(2): The prime ideals of $S^{-1} A$ are in bijection with the prime ideals of $A$ containing no elements of $S$ because all these elements become units in the localisation $S^{-1} A$. Thus $f$ establishes a continuous bijection from $\text{Spec}(S^{-1} A)$ to $Y$. Now let $J\subseteq S^{-1} A$ be an ideal; then

$f(V(J)) = V(\phi^{-1} (J))\cap Y$

Again this proves that $f$ is closed and so it is a homeomorphism.

We can use this to prove a useful lemma I really ought to have proved last time:

Lemma: Let $X = \text{Spec}(R)$ be an affine scheme and let $f\in R$. Then the open subset $Y = D(f)\subseteq X$ with the induced ringed space structure from $X$ is an affine scheme isomorphic to $\text{Spec}(R_f)$.

Proof: By the previous lemma there is an open immersion $i: Y\hookrightarrow X$ whose image is $D(f)$. Suppose $D(g)\subseteq D(f)$, and let $g'$ be the image of $g$ in $R_f$. Then we have

$\mathcal{O}_X (D(g)) = R_g \cong (R_f)_{g'} = \mathcal{O}_Y (D(g')) = i_* \mathcal{O}_Y (D(f))$

Now the $D(g)$‘s form a base of open subsets for $D(f)$; because we have well-defined restriction maps between these basic open sets, we see we obtain an isomorphism of sheaves

$\mathcal{O}_X \cong i_* \mathcal{O}_Y$

It’s easy to check that the resulting isomorphism of ringed spaces $(Y, \mathcal{O}_Y) \cong (D(f), \mathcal{O}_X \vert_{D(f)} )$ is local, giving an isomorphism of schemes.

The next lemma generalises this:

Lemma: Let $X$ be a scheme (not necessarily affine). Then for any open subset $U\subseteq X$ the ringed space $(U, \mathcal{O}_X \vert_U )$ is also a scheme.

Proof: Since $X$ is a scheme there exist open sets $U_i$, each isomorphic to an affine scheme, such that $X = \bigcup_i U_i$. Since the principal open sets form a basis for the topology on $X$, each intersection $U\cap U_i$ is a union of principal open sets. We’ve just seen each of these is isomorphic to an affine scheme, so it follows that $U$ is a scheme.

If $X$ is a scheme and $U\subseteq X$ is an open subset as above we call $U$ an open subscheme of $X$; if it turns out that $U$ is an affine scheme then (duh!) we call $U$ an affine open subscheme.

Generalised basic open sets

Now let’s generalise the notion of principal open subset; in the affine case $\text{Spec}(R)$, we took a ring element $f\in R$ and looked at the open set $D(f)$ of prime ideals not containing it. Now let’s apply our “reverse geometry” that I’ve alluded to before: we want to consider $f$ as a function on $\text{Spec}(R)$, and the open set $D(f)$ as the set of points on which its value is nonzero. To formalise this, for any prime ideal $\mathfrak{p}\in\text{Spec}(R)$ we set

$f(\mathfrak{p}) = f \pmod{ \mathfrak p}$

So the value of the “function” $f$ at the point $\mathfrak{p}$ is the value of $f$ in the quotient ring $R/\mathfrak{p}$. Clearly this isn’t a function in the usual sense because the rings it takes values in vary from point to point! But what makes sense – just about the only thing that does – is that we can talk about whether $f$ is zero at a point or not. And so on $D(f)$, we see that the “function” $f$ is never zero, so we consider this the subset on which the function is defined. Indeed, for any prime ideal $\mathfrak{p}\in D(f)$ we saw above that $\mathcal{O}_{X,\mathfrak{p}} \cong R_\mathfrak{p}$, so if $\mathfrak{p} \in D(f)$ then $f\notin \mathfrak{p}$ and hence the image of $f$ in $R_\mathfrak{p}$ is a unit. It is this fact we’ll use to generalise principal open sets.

We’ve now made a suitable definition of “scheme” built up from affine schemes. In the affine case we picked global sections $f \in R = \mathcal{O}_{\text{Spec}(R)} (\text{Spec}(R))$ to define our principal open subsets $D(f)$, but there’s no reason in the general nonaffine case that we can’t do the same for global sections $f\in \mathcal{O}_X (X)$. With this in mind, let’s make the following definition:

Definition: Let $X$ be a scheme and let $f\in \mathcal{O}_X (X)$ be a global section of the structure sheaf. We define a generalised principal open set $X_f$ to be

$X_f = \left\{x\in X: f_x \in \mathcal{O}_{X,x}^\times\right\}$

where $\mathcal{O}_{X,x}^\times$ is the group of units of the stalk $\mathcal{O}_{X,x}$.

We see that for an affine scheme $X = \text{Spec}(R)$ the ring of global sections $\mathcal{O}_X (X)$ is just $R$. Choosing $f\in R$ and defining $X_f$ as above just gives $X_f = D(f)$ because $f$ is a unit in all the stalks of elements in $D(f)$, and if $f$ is a unit in a stalk of the form $\mathcal{O}_{X,\mathfrak{p}}$ then $f\notin \mathfrak{p}$. So this definition really does generalise principal open sets.

Proposition: Let $X$ be a scheme and $f\in \mathcal{O}_X (X)$. Then $X_f$ is an open subset of $X$.

Proof: We’ll show that any point in $X_f$ is contained within an open neighbourhood contained in $X_f$. Take $x\in X_f$; then $f\in\mathcal{O}_{X,x}^\times$, so there exists an open neighbourhood $U \ni x$ and a section $g\in \mathcal{O}_X (U)$ with $f_x g_x = 1 \in\mathcal{O}_{X,x}$. But equality in the stalk means there is an open subset $V$ with $x\in V\subseteq U$ such that $(f g)\vert_{V} = 1\in\mathcal{O}_X (V)$. Hence $f\vert_V$ is a unit in $\mathcal{O}_X (V)$ and hence $f_y$ is a unit in the stalk $\mathcal{O}_{X,y}$ for any point $y\in V$. Thus $V\subseteq X_f$. Therefore every point of $X_f$ is an interior point, so $X_f$ is open.

We’ll now construct the inverse for (the image of) $f$ in $\mathcal{O}_X (X_f)$. By the construction above, for each $x\in X_f$ we have an open set $V_x \subseteq X_f$ and a section $g(x)\in \mathcal{O}_X (V_x)$ with $(f g(x))\vert_{V_x} = 1\in\mathcal{O}_X (V_x)$. Suppose that the two open sets $V_x$ and $V_y$ have nonempty intersection. Write $\rho^x : \mathcal{O}_X (V_x) \rightarrow \mathcal{O}_X (V_x \cap V_y)$ and $\rho^y : \mathcal{O}_X (V_y) \rightarrow \mathcal{O}_X (V_x \cap V_y)$ for the corresponding restriction maps. Then in $\mathcal{O}_X (V_x \cap V_y)$ we have equalities

$1 = \rho^x (1) = \rho^x ((f g(x))\vert_{V_x}) = (f g(x))\vert_{V_x \cap V_y} = f\vert_{V_x \cap V_y} g(x)\vert_{V_x\cap V_y}$

$1 = \rho^y (1) = \rho^y ((f g(y))\vert_{V_y}) = (f g(y))\vert_{V_x \cap V_y} = f\vert_{V_x \cap V_y} g(y)\vert_{V_x\cap V_y}$

Hence we have

$f\vert_{V_x \cap V_y} g(x) \vert_{V_x \cap V_y} = f\vert_{V_x \cap V_y} g(y) \vert_{V_x \cap V_y}$

Since $f\vert_{V_x \cap V_y}$ is a unit, we can multiply through by its inverse to obtain $\rho^x (g(x)) = \rho^y (g(y))$ All this was just a long-winded procedure to prove that the restrictions of the $g(x)$ sections agree on the overlaps between open sets $V_x$ and $V_y$. Therefore by the sheaf axiom all these sections glue together to give a unique section $g\in \mathcal{O}_X (X_f)$ such that $g\vert_{V_x} = g(x)$. We see that $f g = 1 \in\mathcal{O}_X (X_f)$, so we’ve constructed the inverse of $f$ in $\mathcal{O}_X (X_f)$.

Finally, note that since $X_f$ is open there is a restriction map $\rho^X_{X_f} :\mathcal{O}_X (X)\rightarrow \mathcal{O}_X (X_f)$ and we’ve seen this sends $f$ to a unit in $\mathcal{O}_X (X_f)$. Therefore it sends the multiplicative set

$S = \left\{1,f,f^2,\dots\right\}$

to units in $\mathcal{O}_X (X_f)$. By the universal property of localisation there is a unique ring homomorphism

$\phi: \mathcal{O}_X (X)_f = S^{-1} \mathcal{O}_X (X)\rightarrow \mathcal{O}_X (X_f)$

such that $\phi \circ L_f = \rho^{X}_{X_f}$, where $L_f : \mathcal{O}_X (X)\rightarrow \mathcal{O}_X (X)_f$ is the canonical localisation homomorphism.

We’ll see later that under certain “covering” conditions this homomorphism $\phi : \mathcal{O}_X (X)_f \rightarrow \mathcal{O}_X (X_f)$ is an isomorphism. For now, let’s press on with something more fundamental.

Morphisms of Schemes

morphism of schemes is just a morphism of locally ringed spaces; isomorphisms are defined similarly. A closed/open immersion of schemes is a closed/open immersion of ringed topological spaces. We’ll now show how we can construct scheme morphisms from our continuous maps $\text{Spec}(\phi)$ defined previously – i.e. how to make them work nicely with the ringed space structures to give morphisms of locally ringed spaces.

Theorem A: Let $\phi: A\rightarrow B$ be a ring homomorphism and write $f= \text{Spec}(\phi) : \text{Spec}(B)\rightarrow \text{Spec} (A)$ for the corresponding continuous map of spectra (this isn’t currently a morphism of locally ringed spaces). Then there exists a morphism of schemes

$(f, f^\#): \text{Spec}(B)\rightarrow \text{Spec}(A)$

such that $f^\# _{\text{Spec}(A)} = \phi$.

Proof: Let $X = \text{Spec}(B)$ and $Y = \text{Spec}(A)$. It is easy to check that for any $g\in A$ we have

$f^{-1} (D(g)) = D(\phi (g))$

Therefore this shows that $f_* \mathcal{O}_X (D(g)) = B_{\phi (g)}$. Define the ring homomorphism

$\psi: \mathcal{O}_Y (Y) \rightarrow f_* \mathcal{O}_X (D(g)) = B_{\phi(g)}$

$s \mapsto \phi(s)/1 \in B_{\phi (g)}$

Then $\phi$ sends every element of the multiplicative set $S = \left\{1,g,g^2,\dots\right\}$ to a unit in $B_{\phi(g)}$, and hence there exists a unique ring homomorphism

$f^{\#}_{D(g)} : \mathcal{O}_Y (D(g))\rightarrow f_* \mathcal{O}_X (D(g))$

such that $f^{\#}_{D(g)} \circ L_g = \psi$, where $L_g : \mathcal{O}_Y (Y)\rightarrow \mathcal{O}_Y(D(g))=A_g$ is the canonical localisation map. This is compatible with restrictions of basic open sets so it gives a morphism of sheaves on the base of open sets which extends to a unique morphism of sheaves on $Y$:

$f^{\#} : \mathcal{O}_Y \rightarrow f_* \mathcal{O}_X$

Moreover let $x = \mathfrak{q}\in X$ be a prime ideal of $B$. Then the morphism of stalks induced by $\phi$

$\mathcal{O}_{Y,f (x)} = A_{\phi^{-1}(\mathfrak{q})}\rightarrow B_\mathfrak{q} = \mathcal{O}_{X,x}$

is a local homomorphism equal to $f^{\#}_x$. Hence $(f,f^{\#})$ is a morphism of locally ringed topological spaces, and hence of schemes. Finally, we clearly have $f^{\#}_Y = \phi$. This concludes the proof

So any ring homomorphism $\phi$ induces a morphism of the affine schemes $(f,f^{\#})$ in the opposite direction, and the original ring homomorphism can be recovered as the component of $f^{\#}$ on global sections.

Therefore we can redefine our functor $\text{Spec}$ to be

$\text{Spec} : \text{CRing}^{\text{op}} \rightarrow \text{Sch}\subseteq \text{LocRingTop}$

where $\text{Sch}$ is the category of schemes and $\text{LocRingTop}$ is the category of locally ringed topological spaces. I’ll now prove the big theorem!

Lemma: Let $X, Y$ be two schemes and write $\text{Hom}_{\text{Sch}} (X,Y) = \text{Mor}(X,Y)$ for the set of scheme morphisms from $X$ to $X$. We write $\text{Hom}_{\text{CRing}} (A,B)$ for the set of ring homomorphisms from $A$ to $B$. Then for all schemes $Y$ there is a natural transformation

$\eta : \text{Mor}(-,Y) \implies \text{Hom}_{\text{CRing}} (\mathcal{O}_Y (Y), \mathcal{O}_{(-)} (-))$

where $\text{Mor}(-,Y)$ and $\text{Hom}_{\text{CRing}} (\mathcal{O}_Y (Y), \mathcal{O}_{(-)}(-))$ are functors $\text{Sch}^{\text{op}} \rightarrow \text{Set}$.

Proof: The functor $\text{Mor}(-,Y)$ is self-explanatory, but the functor $\text{Hom}_{\text{CRing}} (\mathcal{O}_Y (Y), \mathcal{O}_{(-)}(-))$ needs some clarification. It sends every scheme $X$ to the set of ring homomorphisms $\mathcal{O}_Y (Y)$ to $\mathcal{O}_X (X)$ on the rings of global sections, and every morphism of schemes

$(f,f^{\#}): X\rightarrow Z$

to the function $\text{Hom}(\mathcal{O}_Y (Y), \mathcal{O}_Z (Z)) \rightarrow \text{Hom}(\mathcal{O}_Y (Y), \mathcal{O}_X (X))$ given by

$(\phi: \mathcal{O}_Y (Y) \rightarrow \mathcal{O}_Z (Z))\mapsto (f^{\#}_Z \circ \phi : \mathcal{O}_Y (Y) \rightarrow f_* \mathcal{O}_X (Z) = \mathcal{O}_X (X))$

The component of $\eta$ at $X$ is

$\eta_X : \text{Mor}(X,Y)\rightarrow \text{Hom}_{\text{CRing}} (\mathcal{O}_Y (Y), \mathcal{O}_X(X))$

$(f:X\rightarrow Y) \mapsto (f^{\#}_Y : \mathcal{O}_Y (Y) \rightarrow \mathcal{O}_X(X))$

But then for a morphism of schemes $(f, f^{\#}): X\rightarrow Y$

$\eta_Z \circ \text{Mor}(Y,(f,f^{\#})) = \text{Hom}_{\text{CRing}} (\mathcal{O}_Y (Y), (f,f^{\#})) \circ \eta_X$

Hence $\eta$ is indeed natural.

BIG THEOREM: For any ring $R$ the natural transformation

$\eta : \text{Mor}(-,\text{Spec}(R)) \implies \text{Hom}_{\text{CRing}} (R, \mathcal{O}_{(-)} (-))$

is a natural isomorphism (here I’ve implicitly used that $R = \mathcal{O}_{\text{Spec}(R)} (\text{Spec}(R)$).

Proof: Proving that $\eta$ is a natural isomorphism amounts to proving that for any scheme $X$ the component $\eta_X$ is a bijection of sets (seeing as we’ve already proved it’s natural). To do this, we’ll construct an explicit inverse function $\epsilon_X$. To ease notation let $Y = \text{Spec}(R)$ and let $\phi : R\rightarrow \mathcal{O}_X (X)$ be a ring homomorphism. For any point $P \in X$ we let $\mathfrak{m}_P$ denote the unique maximal ideal in the local ring $\mathcal{O}_{X,P}$. Then the preimage of $\mathfrak{m}_P$ under the composition

$R\xrightarrow{\phi} \mathcal{O}_X (X) \xrightarrow{\rho_P} \mathcal{O}_{X,P}$

is a prime ideal of $R$, where $\rho_P$ is the restriction to the stalk. Hence we obtain a map of the underlying point sets

$\psi: \lvert X \rvert \rightarrow \lvert Y \rvert$

where $\lvert X \rvert$ is just the point set of $X$, considered without topology or ringed space structure. But in fact this map is also continuous with respect to the Zariski topology. To see this, take $f\in \mathcal{O}_Y (Y) = R$ and consider the principal basic open set $D(f)\subseteq Y$. We want to show that $\psi^{-1} (D(f))\subseteq X$ is open. We have

$\psi^{-1} (D(f)) = \left\{ x\in X: \psi (x) \in D(f)\right\}$

$= \left\{x\in X: f\notin \phi^{-1} (\rho_x^{-1}(\mathfrak{m}_x))\right\}$

$= \left\{x\in X: \phi(f)_x \notin \mathfrak{m}_x \right\}$

$= \left\{x\in X: \phi(f)_x \in \mathcal{O}_{X,x}^\times \right\}$

$= X_{\phi(f)}$

where $X_{\phi (f)}$ is one of our generalised basic open sets defined above, and is indeed open. Hence $\psi$ is a continuous map on the underlying topological spaces. We now need to define a morphism of sheaves.

For each basic open set $D(f)\subseteq Y$ define

$\psi^{\#}_{D(f)} : R_f = \mathcal{O}_Y (D(f)) \rightarrow \psi_* \mathcal{O}_X (D(f))$

as the composition

$R_f \rightarrow \mathcal{O}_X (X)_{\phi (f)} \rightarrow \mathcal{O}_X (\psi^{-1} (D(f)))$

where the first morphism is the obvious map obtained from $\phi : R\rightarrow \mathcal{O}_X (X)$ by localising and the second map is the canonical morphism $\mathcal{O}_X (X)_{\phi (f)} \rightarrow \mathcal{O}_X (X_{\phi (f)})$ which we proved the existence of above with regards to generalised basic open sets. We have a commutative diagram

from which it is clear that this defines a morphism of sheaves on the base (as we can do our “localise again” trick to deal with restrictions $D(g)\subseteq D(f)$) and thus by glueing these all together a uniquely defined morphism of sheaves

$\psi^\# : \mathcal{O}_Y \rightarrow \psi_* \mathcal{O}_X$

It is also clear from the above diagram that the induced homomorphism $\psi^{\#}_Y$ on global sections is equal to $\phi$. Now suppose that $\psi (P) = Q$. The diagram below commutes because it expresses that $\psi^\#$ is a sheaf morphism:

We want to show that $\psi^{\#}_Q (\mathfrak{m}_Q) \subseteq \mathfrak{m}_P$ which will prove that $\psi^{\#}_Q$ is a local homomorphism. To do this, let $f\in \mathfrak{m}_Q$ and BWOC suppose that $\psi^{\#}_Q (f)$ is a unit in $\mathcal{O}_{X,P}$. Let $S$ be the complement of $P$ in $\mathcal{O}_X (X)$ so that $S$ is multiplicative. Then $T = \phi^{-1} (S)\subseteq R$ is multiplicative and the image of $T$ in $R_Q$ must contain only units, because $\psi^{\#}_Q(T_Q) = S_P \subseteq \mathcal{O}_{X,P}^\times$ consists only of units (here I use $T_Q$ to mean the image of $T$ in $R_Q$). But $T$ contains an element which localises to $f$, which we assumed was not a unit in $R_Q$. This is a contradiction, and hence $\psi^{\#}_Q (\mathfrak{m}_Q)\subseteq \mathfrak{m}_P$. Thus $\psi^{\#}_Q$ is a local homomorphism.

Hence $(\psi, \psi^\#): X\rightarrow Y$ is a morphism of locally ringed spaces and hence of schemes. We therefore define the inverse $\epsilon_X$ to $\eta_X$ to be the function

$\phi \mapsto (\psi, \psi^\#)$

where $\left(\psi, \psi^{\#}\right)$ is constructed as above.

Now we just need to prove that $\eta_X$ and $\epsilon_X$ are mutually inverse. Theorem A above gives that

$\eta_X \circ \epsilon_X = \text{id}_{\text{Hom}(R,\mathcal{O}_X (X))}$

Starting with a morphism of schemes $(f,f^{\#}) : X\rightarrow \text{Spec}(R) = Y$ we can apply $\eta_X$ to get a ring homomorphism $f^{\#}_Y : R\rightarrow \mathcal{O}_X (X)$ on global sections. Applying $\epsilon_X$ then sends $f^{\#}_Y$ to the scheme morphism $(\psi, \psi^\#) : X\rightarrow Y$ with $\psi^\# = f^\#$ and

$\psi (x) = \left\{ r\in R: f^{\#}_{f(x)} (r_{f(x)}) \in \mathfrak{m}_x\right\}$

[This notation will freak you out if you don’t stop and think what’s what – remember, $f(x)\in \text{Spec}(R)$ so $f(x)$ is a prime ideal of $R$.] Clearly if $r \in f(x)$ then its image $r_{f(x)}$ in the localisation $R_{f(x)}$ is contained within $\mathfrak{m}_{f(x)}$ and so applying $f^{\#}_{f(x)}$ and recalling that it is a local homomorphism we obtain an element of $\mathfrak{m}_x$; this proves that $f(x)\subseteq \psi(x)$. Now take $r\in \psi(x)$; then $f^{\#}_{f(x)} (r_{f(x)}) \in \mathfrak{m}_x$ so $r_{f(x)}\in\mathfrak{m}_{f(x)}$ by locality. But then $r\in f(x)$, so $f(x) = \psi(x)$. This proves that

$\epsilon_X \circ \eta_X = \text{id}_{\text{Mor}(X,\text{Spec}(B))}$

Thus this gives us a natural isomorphism. This concludes the proof.

Translation: Restricting $X$ to an affine scheme, we see that the morphisms between two ring spectra are in natural bijection with the ring homomorphisms between the rings, with the direction of the arrows reversed. Therefore the category of affine schemes $\text{Sch}_\text{aff}$ is the categorical dual of the category of commutative rings $\text{CRing}$!!!

I think I’ll stop here. Next time I’ll derive some more technical properties of schemes and then try to draw some pretty pictures. After that, I’d like to look at an alternative – and more abstract – way of defining schemes via their functors of points.