Category of affine schemes (source code)

= Category of affine schemes
{title2=$\mathbf{AffSch}\simeq\mathbf{CRing}^{\mathrm{op}}$}

The <category of affine schemes> has <affine schemes> as objects and <morphisms of schemes> as arrows. The contravariant <functor> $A\mapsto\operatorname{Spec}A$ gives an equivalence
$$
\mathbf{AffSch}\simeq\mathbf{CRing}^{\mathrm{op}}
$$
with the opposite of the <category of commutative rings>. Precisely, every <ring homomorphism> $A\to B$ corresponds to a unique map $\operatorname{Spec}B\to\operatorname{Spec}A$, and every <morphism of schemes> between <affine schemes> arises this way.<The Stacks project>[Schemes, section Affine schemes, equivalence with commutative rings]{ref}

For example, $k[t]\to k[x]$, $t\mapsto x^2$, induces the squaring map of affine lines. A map from $\operatorname{Spec}k$ to $\operatorname{Spec}A$ instead corresponds to a $k$-algebra map $A\to k$, expressing a rational point. A <Cartesian product> of affine $k$-<schemes> corresponds to a <tensor product of commutative algebras>: $\operatorname{Spec}A\times_{\operatorname{Spec}k}\operatorname{Spec}B\cong\operatorname{Spec}(A\otimes_kB)$. Reversing arrows explains why geometric products become algebraic coproducts.