# Is there a universal property of $\text{Spec}(-)$?

I've heard it been said that the construction of Spec$R$ is a canonical way of taking the ring $A$ and producing a locally ringed space with $A$ as the ring of global sections. This is certainly informal; but is it correct in some technical sense? If it was, we might expect to find $\text{Spec}(-):\text{Ring}^{op}\to\text{LRSpace}$ (or indeed $\text{Spec}(A)$) characterized by some universal property. So I wonder: is this so?

Sincerely, Eivind

-
Isn't the thing you're looking for simply the anti-equivalence between affine schemes and commutative rings, so it's hardly possible to get "more canonical"? If you don't want to restrict to affine schemes you still get an adjoint pair, so you have a universal property "for free". –  t.b. May 25 '11 at 20:27
I knew about that, but I'm thinking about $\text{Spec}$ as a functor $\text{Ring}^{op}\to\text{LRSpaces}$. This question may still be silly though :) –  Eivind Dahl May 25 '11 at 20:30
I clarified this assumption in the OP. –  Eivind Dahl May 25 '11 at 20:46
The functorial bijection (where ($X,\mathcal O_X$) denotes a locally ringed space which is not necessarily a scheme) $$Hom_{LRS}(X, Spec(A))=Hom_{Ring} (A,\Gamma(X,\mathcal O_X))$$
might be the universal property of $Spec(A)$ you are looking for .
In other words, there is a contravariant right adjunction between $\mathrm{Spec}\colon \mathcal{R}ing^{op}\to LRS$ and $\Gamma\colon LRS^{op}\to\mathcal{R}ing$ (global sections) –  Arturo Magidin May 25 '11 at 21:01