In mathematics, a **ringed space** is a family of (commutative) rings parametrized by open subsets of a topological space together with ring homomorphisms that play roles of restrictions. Precisely, it is a topological space equipped with a **sheaf of rings** called a **structure sheaf**. It is an abstraction of the concept of the rings of continuous (scalar-valued) functions on open subsets.

Among ringed spaces, especially important and prominent is a **locally ringed space**: a ringed space in which the analogy between the stalk at a point and the ring of germs of functions at a point is valid.

Ringed spaces appear in analysis as well as complex algebraic geometry and the scheme theory of algebraic geometry.

**Note**: In the definition of a ringed space, most expositions tend to restrict the rings to be commutative rings, including Hartshorne and Wikipedia. "Éléments de géométrie algébrique", on the other hand, does not impose the commutativity assumption, although the book mostly considers the commutative case.^{[1]}

A **ringed space** is a topological space * together with a sheaf of rings on . The sheaf is called the ***structure sheaf** of .

A **locally ringed space** is a ringed space such that all stalks of are local rings (i.e. they have unique maximal ideals). Note that it is *not* required that be a local ring for every open set *;* in fact, this is almost never the case.

An arbitrary topological space * can be considered a locally ringed space by taking ** to be the sheaf of real-valued (or complex-valued) continuous functions on open subsets of **. The stalk at a point can be thought of as the set of all germs of continuous functions at **; this is a local ring with the unique maximal ideal consisting of those germs whose value at ** is .
*

If * is a manifold with some extra structure, we can also take the sheaf of differentiable, or complex-analytic functions. Both of these give rise to locally ringed spaces.
*

If * is an algebraic variety carrying the Zariski topology, we can define a locally ringed space by taking to be the ring of rational mappings defined on the Zariski-open set ** that do not blow up (become infinite) within . The important generalization of this example is that of the spectrum of any commutative ring; these spectra are also locally ringed spaces. Schemes are locally ringed spaces obtained by "gluing together" spectra of commutative rings.
*

A morphism from to is a pair , where is a continuous map between the underlying topological spaces, and is a morphism from the structure sheaf of to the direct image of the structure sheaf of *X*. In other words, a morphism from to is given by the following data:

- a continuous map
- a family of ring homomorphisms for every open set of which commute with the restriction maps. That is, if are two open subsets of , then the following diagram must commute (the vertical maps are the restriction homomorphisms):

There is an additional requirement for morphisms between *locally* ringed spaces:

- the ring homomorphisms induced by between the stalks of
*and the stalks of**must be**local homomorphisms*, i.e. for every*the maximal ideal of the local ring (stalk) at is mapped into the maximal ideal of the local ring at**.*

Two morphisms can be composed to form a new morphism, and we obtain the category of ringed spaces and the category of locally ringed spaces. Isomorphisms in these categories are defined as usual.

See also: Zariski tangent space |

Locally ringed spaces have just enough structure to allow the meaningful definition of tangent spaces. Let * be locally ringed space with structure sheaf **; we want to define the tangent space at the point **. Take the local ring (stalk) at the point , with maximal ideal . Then is a field and is a vector space over that field (the cotangent space). The tangent space is defined as the dual of this vector space.
*

The idea is the following: a tangent vector at * should tell you how to "differentiate" "functions" at **, i.e. the elements of **. Now it is enough to know how to differentiate functions whose value at ** is zero, since all other functions differ from these only by a constant, and we know how to differentiate constants. So we only need to consider **. Furthermore, if two functions are given with value zero at **, then their product has derivative 0 at **, by the product rule. So we only need to know how to assign "numbers" to the elements of , and this is what the dual space does.
*

Main article: Sheaf of modules |

Given a locally ringed space , certain sheaves of modules on * occur in the applications, the **-modules. To define them, consider a sheaf **F* of abelian groups on *. If **F*(*U*) is a module over the ring * for every open set ** in **, and the restriction maps are compatible with the module structure, then we call an **-module. In this case, the stalk of ** at ** will be a module over the local ring (stalk) **, for every **.
*

A morphism between two such *-modules is a morphism of sheaves which is compatible with the given module structures. The category of **-modules over a fixed locally ringed space is an abelian category.
*

An important subcategory of the category of *-modules is the category of **quasi-coherent sheaves* on *. A sheaf of **-modules is called quasi-coherent if it is, locally, isomorphic to the cokernel of a map between free **-modules. A **coherent* sheaf * is a quasi-coherent sheaf which is, locally, of finite type and for every open subset ** of ** the kernel of any morphism from a free **-modules of finite rank to ** is also of finite type.
*