The prime spectrum of a ring (associative, but not necessarily commutative or unital) is the set of prime ideals of the ring. For noncommutative rings however sometimes spectra of primitive ideal?s are more interesting.
Prime spectrum of a commutative unital ring extends canonically to a contravariant functor .
Prime spectrum of a commutative unital ring , has a natural Zariski topology ,which is usually given by the basis of topology consisting of the subsets where . Prime spectrum is usually assumed to be taken with the Zariski topology and in that case also called Zariski spectrum. The morphisms of the form , are continuous so spectrum becomes a functor .
The correspondence for all extends to a unique sheaf of commutative local rings on the Zariski topology on . The ringed space so constructed is also called the prime spectrum of the commutative ring . An affine scheme as a locally ringed space is any ringed space which is isomorphic to the prime spectrum of a commutative ring.
Any morphism of commutative rings also induces the comorphism of structure sheaves on spectra, hence a morphism in locally ringed spaces. This way one obtains a contravariant functor which is fully faithful (and its essential image is the strictly full subcategory whose objects are affine schemes).