---
tag: ZE780BQS42
kind: statement
role: theorem
name: Anti-equivalence of affine schemes and rings
msc: [14A15, 18F20]
uses: [B3V3XJ2W8G, JXRKH6P1Z4, 0VTH8KPCG2, 28NQ0KRHD3, DAMK8XE1FR, K7A04ZBD92, FB45BHHA2J]
about: [B3V3XJ2W8G]
sources:
  - url: https://en.wikipedia.org/wiki/Spectrum_of_a_ring
---

## Statement

Let $A$ and $B$ be commutative rings with identity.

1. The natural map $A \to \mathcal{O}_{\operatorname{Spec} A}(\operatorname{Spec} A)$ is a ring isomorphism.
2. The map that sends a [[ring homomorphism|0VTH8KPCG2]] $\varphi \colon A \to B$ to the induced [[morphism of schemes|JXRKH6P1Z4]] $\operatorname{Spec} B \to \operatorname{Spec} A$ is a bijection
$$\Hom_{\mathrm{Ring}}(A, B) \to \Hom_{\mathrm{Sch}}(\operatorname{Spec} B, \operatorname{Spec} A).$$
Its inverse sends a morphism $(f, f^\#)$ to its map on global sections $A \to B$.

Consequently, the [[functor|28NQ0KRHD3]] $\operatorname{Spec}$ is an [[equivalence|K7A04ZBD92]] from the [[opposite category|DAMK8XE1FR]] of commutative rings to the category of [[affine schemes|B3V3XJ2W8G]].
A quasi-inverse is $X \mapsto \mathcal{O}_X(X)$.

## Remarks

Part 1 is a gluing argument: a global section is given locally by fractions $a_i / f_i^{n_i}$ on basic open sets $D(f_i)$ that cover $\operatorname{Spec} A$.
Since the $f_i$ then generate the unit ideal, these fractions glue to a single element of $A$.
For part 2, the stalk maps of a morphism must be local.
This forces $f(\mathfrak{q})$ to be the preimage of $\mathfrak{q}$ under the map on global sections.
Then the sheaf map is determined on each $D(g)$ by localizing.
Example: for a field $k$, the morphisms $\operatorname{Spec} k \to \operatorname{Spec} k[x]$ over $k$ correspond to $k$-algebra maps $k[x] \to k$, that is, to the elements $a \in k$, the $k$-points of the line.
The locality condition is needed.
Let $R$ be a discrete valuation ring with fraction field $K$.
Send the point of $\operatorname{Spec} K$ to the closed point of $\operatorname{Spec} R$, with the inclusion $R \to K$ on sections.
This is a morphism of ringed spaces, but it is not the morphism induced by $R \to K$, which hits the generic point.

## Explanations

### L1 human

Affine schemes and commutative rings carry the same information, with arrows turned around.
A map of spaces $\operatorname{Spec} B \to \operatorname{Spec} A$ is the same thing as a map of rings $A \to B$, which pulls functions back.
So every question about affine schemes can be translated into algebra, and every ring can be thought of as a space.

### L2 human

This is the reason the [[spectrum of a ring|FB45BHHA2J]] is the right local model for algebraic geometry.
It extends to all schemes: for any scheme $X$, morphisms $X \to \operatorname{Spec} A$ correspond to ring maps $A \to \mathcal{O}_X(X)$.
It is used constantly.
For example, it shows that the fiber product of affine schemes is the spectrum of a tensor product.
It also lets one describe a scheme through its functor of points on rings.
