A locally ringed space is a pair (X,OX)(X,\mathcal O_X) consisting of a XX and a of commutative rings OX\mathcal O_X such that every OX,x\mathcal O_{X,x} is a . The sheaf OX\mathcal O_X is called the .

The unique maximal ideal in OX,x\mathcal O_{X,x} distinguishes functions that vanish at xx from those locally invertible near xx. This extra condition makes points and local algebra interact correctly.

For example, if AA is a commutative ring, then (SpecA,OSpecA)(\operatorname{Spec}A,\mathcal O_{\operatorname{Spec}A}) is locally ringed because the stalk at a prime ideal p\mathfrak p is the local ring ApA_{\mathfrak p}. Such examples are precisely the .