If $\operatorname{Spec} A=\operatorname{Spec} B$, then $A$ is isomorphic to $B$

affine-schemesalgebraic-geometryschemes

Proposition II.$3.2$ in Hartshorne
Regarding to this question,
I wonder why $\operatorname{Spec} A=\operatorname{Spec} B$, then $A$ is isomorphic to $B$.

To be more precise,


Let $A,B$ are rings, and suppose the schemes $\operatorname{Spec} A$ and $\operatorname{Spec} B$ are
isomorphic as schemes. Then, I want to show $A$ and $B$ are isomorphic as
rings.


Of course, if we see $\operatorname{Spec} A$ and $\operatorname{Spec} B$ as just a set of prime ideals, then
we cannot say $A$ and $B$ are isomorphic as rings. For example, a pair of another fields is an example.
Thank you.

Best Answer

I would avoid saying that things are "equal", but rather that they are isomorphic via a named isomorphism $\newcommand{\Spec}{\operatorname{Spec}}\phi\colon\Spec A\to\Spec B$. If you consider the corresponding map on structure sheaves, and take global sections, you get the morphism $\phi^\#\colon B \to A$. By assumption, $\phi$ has a bilateral inverse, which yields a bilateral inverse to $\phi^\#$.

Regarding your example concerning the spectra of two fields, it is misleading probably because you use a statement of the form "$\Spec k= \Spec k'$", parsing it as an equality of sets. If you instead say that $\Spec k \stackrel{\sim}\to \Spec k'$, via a scheme morphism $(\phi,\phi^\#)$ which admits an inverse, then your issue is resolved.

Motto: «Equality evil, isomorphism good».