Compare the following two results:



> 
> Thm A) Let $A$ be a commutative $C^\*$-algebra and let $X$ be its Gelfand spectrum. Gelfand duality says that there's a natural isometric $\*$-isomorphism from $A$ to $C(X)$, the $C^\*$-algebra of continuous functions on $X$.
> 
> 
> 



> 
> Thm B) Let $A$ be a commutative ring and $X=\operatorname{Spec}A$. There's a natural sheaf of rings $\mathscr{O}$ on $X$ such that $A=\Gamma(X,\mathscr{O})$.
> 
> 
> 


Both theorems are very close. **I wonder if it's possible to obtain theorem A as a particular case of theorem B, or a variant thereof.**



Is there a relation between Gelfand duality and the spectrum of a ring (with its Zariski topology)?
Yes, both Theorem A and Theorem B are special cases of a more general construction.


Denote by $R$ the category of commutative unital C\*-algebras or the category of commutative rings.
Denote by $R'$ the full subcategory of $R$ given by reduced objects in $R$, meaning the only nilpotent element is zero.
(All commutative unital C\*-algebras are reduced.)


Given an object $X∈R$, we can consider its poset $\def\Spec{\mathop{\sf Spec}}\Spec X$ of quotient objects (= subobjects in the opposite category) that belong to $R'$.


One can show that $\Spec X$ is a [locale](https://ncatlab.org/nlab/show/locale), the (localic) Zariski/Gelfand spectrum of $X$.
Furthermore, assuming the axiom of choice, this locale is [spatial](https://ncatlab.org/nlab/show/spatial+locale), so it corresponds to a topological space, namely, the traditional Zariski/Gelfand spectrum of $X$.


Given an open element $U$ of $\Spec X$ corresponding to a reduced quotient $X→Q$, its kernel $I⊂X$ is a radical ideal
and we can consider the localization $X[S^{-1}]∈R$,
defined using a universal property in the category $R$,
where $S=\{a∈X\mid I⊂\sqrt{(a)}\}$.


The assignment $$U↦X[S^{-1}]$$ defines a sheaf on $\Spec X$ valued in $R$.
This is precisely the structure sheaf of $\Spec X$
for both the Gelfand spectrum and the Zariski spectrum.


Of course, this construction is applicable to many other categories $R$:


* finitely presented entire functional calculus algebras, recovering the Stein duality for globally finitely presented Stein spaces (i.e., complex geometry).
* finitely generated germ-determined C^∞-rings, recovering the Dubuc duality for C^∞-loci (i.e., differential geometry);
* other dualities for algebraic geometry, such as formal schemes, etc.
* various versions of the above for derived geometry;
* Boolean algebras, recovering the Stone duality for compact totally disconnected Hausdorff spaces;
* complete Boolean algebras, recovering the Stonean duality for compact extremally disconnected Hausdorff spaces;
* localizable Boolean algebras, recovering the [Gelfand-type duality](https://mathoverflow.net/questions/23408/reference-for-the-gelfand-duality-theorem-for-commutative-von-neumann-algebras) for [compact strictly localizable enhanced measurable spaces](https://mathoverflow.net/questions/20740/is-there-an-introduction-to-probability-theory-from-a-structuralist-categorical/20820#20820).


