In the branch of mathematics known as topology, the **specialization** (or **canonical**) **preorder** is a natural preorder on the set of the points of a topological space. For most spaces that are considered in practice, namely for all those that satisfy the T_{0} separation axiom, this preorder is even a partial order (called the **specialization order**). On the other hand, for T_{1} spaces the order becomes trivial and is of little interest.

The specialization order is often considered in applications in computer science, where T_{0} spaces occur in denotational semantics. The specialization order is also important for identifying suitable topologies on partially ordered sets, as is done in order theory.

Consider any topological space *X*. The **specialization preorder** ≤ on *X* relates two points of *X* when one lies in the closure of the other. However, various authors disagree on which 'direction' the order should go. What is agreed^{[citation needed]} is that if

*x*is contained in cl{*y*},

(where cl{*y*} denotes the closure of the singleton set {*y*}, i.e. the intersection of all closed sets containing {*y*}), we say that *x* is a **specialization** of *y* and that *y* is a **generalization** of *x*; this is commonly written *y ⤳ x*.

Unfortunately, the property "*x* is a specialization of *y*" is alternatively written as "*x* ≤ *y*" and as "*y* ≤ *x*" by various authors (see, respectively, ^{[1]} and ^{[2]}).

Both definitions have intuitive justifications: in the case of the former, we have

*x*≤*y*if and only if cl{*x*} ⊆ cl{*y*}.

However, in the case where our space *X* is the prime spectrum *Spec R* of a commutative ring *R* (which is the motivational situation in applications related to algebraic geometry), then under our second definition of the order, we have

*y*≤*x*if and only if*y*⊆*x*as prime ideals of the ring*R*.

For the sake of consistency, for the remainder of this article we will take the first definition, that "*x* is a specialization of *y*" be written as *x* ≤ *y*. We then see,

*x*≤*y*if and only if*x*is contained in all closed sets that contain*y*.*x*≤*y*if and only if*y*is contained in all open sets that contain*x*.

These restatements help to explain why one speaks of a "specialization": *y* is more general than *x*, since it is contained in more open sets. This is particularly intuitive if one views closed sets as properties that a point *x* may or may not have. The more closed sets contain a point, the more properties the point has, and the more special it is. The usage is consistent with the classical logical notions of genus and species; and also with the traditional use of generic points in algebraic geometry, in which closed points are the most specific, while a generic point of a space is one contained in every nonempty open subset. Specialization as an idea is applied also in valuation theory.

The intuition of upper elements being more specific is typically found in domain theory, a branch of order theory that has ample applications in computer science.

Let *X* be a topological space and let ≤ be the specialization preorder on *X*. Every open set is an upper set with respect to ≤ and every closed set is a lower set. The converses are not generally true. In fact, a topological space is an Alexandrov-discrete space if and only if every upper set is also open (or equivalently every lower set is also closed).

Let *A* be a subset of *X*. The smallest upper set containing *A* is denoted ↑*A*
and the smallest lower set containing *A* is denoted ↓*A*. In case *A* = {*x*} is a singleton one uses the notation ↑*x* and ↓*x*. For *x* ∈ *X* one has:

- ↑
*x*= {*y*∈*X*:*x*≤*y*} = ∩{open sets containing*x*}. - ↓
*x*= {*y*∈*X*:*y*≤*x*} = ∩{closed sets containing*x*} = cl{*x*}.

The lower set ↓*x* is always closed; however, the upper set ↑*x* need not be open or closed. The closed points of a topological space *X* are precisely the minimal elements of *X* with respect to ≤.

- In the Sierpinski space {0,1} with open sets {∅, {1}, {0,1)) the specialization order is the natural one (0 ≤ 0, 0 ≤ 1, and 1 ≤ 1).
- If
*p*,*q*are elements of Spec(*R*) (the spectrum of a commutative ring*R*) then*p*≤*q*if and only if*q*⊆*p*(as prime ideals). Thus the closed points of Spec(*R*) are precisely the maximal ideals.

As suggested by the name, the specialization preorder is a preorder, i.e. it is reflexive and transitive.

The equivalence relation determined by the specialization preorder is just that of topological indistinguishability. That is, *x* and *y* are topologically indistinguishable if and only if *x* ≤ *y* and *y* ≤ *x*. Therefore, the antisymmetry of ≤ is precisely the T_{0} separation axiom: if *x* and *y* are indistinguishable then *x* = *y*. In this case it is justified to speak of the **specialization order**.

On the other hand, the symmetry of the specialization preorder is equivalent to the R_{0} separation axiom: *x* ≤ *y* if and only if *x* and *y* are topologically indistinguishable. It follows that if the underlying topology is T_{1}, then the specialization order is discrete, i.e. one has *x* ≤ *y* if and only if *x* = *y*. Hence, the specialization order is of little interest for T_{1} topologies, especially for all Hausdorff spaces.

Any continuous function between two topological spaces is monotone with respect to the specialization preorders of these spaces: implies The converse, however, is not true in general. In the language of category theory, we then have a functor from the category of topological spaces to the category of preordered sets that assigns a topological space its specialization preorder. This functor has a left adjoint, which places the Alexandrov topology on a preordered set.

There are spaces that are more specific than T_{0} spaces for which this order is interesting: the sober spaces. Their relationship to the specialization order is more subtle:

For any sober space *X* with specialization order ≤, we have

- (
*X*, ≤) is a directed complete partial order, i.e. every directed subset*S*of (*X*, ≤) has a supremum sup*S*, - for every directed subset
*S*of (*X*, ≤) and every open set*O*, if sup*S*is in*O*, then*S*and*O*have non-empty intersection.

One may describe the second property by saying that open sets are *inaccessible by directed suprema*. A topology is **order consistent** with respect to a certain order ≤ if it induces ≤ as its specialization order and it has the above property of inaccessibility with respect to (existing) suprema of directed sets in ≤.

The specialization order yields a tool to obtain a preorder from every topology. It is natural to ask for the converse too: Is every preorder obtained as a specialization preorder of some topology?

Indeed, the answer to this question is positive and there are in general many topologies on a set *X* that induce a given order ≤ as their specialization order. The Alexandroff topology of the order ≤ plays a special role: it is the finest topology that induces ≤. The other extreme, the coarsest topology that induces ≤, is the upper topology, the least topology within which all complements of sets ↓*x* (for some *x* in *X*) are open.

There are also interesting topologies in between these two extremes. The finest sober topology that is order consistent in the above sense for a given order ≤ is the Scott topology. The upper topology however is still the coarsest sober order-consistent topology. In fact, its open sets are even inaccessible by *any* suprema. Hence any sober space with specialization order ≤ is finer than the upper topology and coarser than the Scott topology. Yet, such a space may fail to exist, that is, there exist partial orders for which there is no sober order-consistent topology. Especially, the Scott topology is not necessarily sober.