Consequently, is a locally ringed space. If R is an integral domain, with field of fractions K, then we can describe the ring Γ(U,OX) more concretely as follows. We say that an element f in K is regular at a point P in X if it can be represented as a fraction f = a/b with b not in P. Note that this agrees with the notion of a regular function in algebraic geometry. Using this definition, we can describe Γ(U,OX) as precisely the set of elements of K which are regular at every point P in U. Functorial perspective It is useful to use the language of category theory and observe that is a functor. Every ring homomorphism induces a continuous map (since the preimage of any prime ideal in is a prime ideal in ). In this way, can be seen as a contravariant functor from the category of commutative rings to the category of topological spaces. Moreover, for every prime the homomorphism descends to homomorphisms of local rings. Thus even defines a contravariant functor from the category of commutative rings to the category of locally ringed spaces. In fact it is the universal such functor hence can be used to define the functor up to natural isomorphism. The functor yields a contravariant equivalence between the category of commutative rings and the category of affine schemes; each of these categories is often thought of as the opposite category of the other. Motivation from algebraic geometry Following on from the example, in algebraic geometry one studies algebraic sets, i.e. subsets of Kn (where K is an algebraically closed field) that are defined as the common zeros of a set of polynomials in n variables. If A is such an algebraic set, one considers the commutative ring R of all polynomial functions A → K. The maximal ideals of R correspond to the points of A (because K is algebraically closed), and the prime ideals of R correspond to the subvarieties of A (an algebraic set is called irreducible or a variety if it cannot be written as the union of two proper algebraic subsets). The spectrum of R therefore consists of the points of A together with elements for all subvarieties of A. The points of A are closed in the spectrum, while the elements corresponding to subvarieties have a closure consisting of all their points and subvarieties. If