Separated sets

In topology and related branches of mathematics, separated sets are pairs of subsets of a given topological space that are related to each other in a certain way. The notion of when two sets are separated or not is important both to the notion of connected spaces (and their connected components) as well as to the separation axioms for topological spaces.
Separated sets should not be confused with separated spaces (defined below), which are somewhat related but aren't the same thing. And separable spaces are a completely different topological concept.
Contents 
Definitions
There are various versions of the concept. The terms are defined below, where X is a topological space.
First, two subsets A and B of X are disjoint if their intersection is the empty set. This property has nothing to do with topology as such, but only set theory; we include it here because it is the weakest in the sequence of different notions. For more on disjointness in general, see Disjoint sets.
A and B are separated in X if each is disjoint from the other's closure. The closures themselves don't have to be disjoint from each other; for example, the intervals [0,1) and (1,2] are separated in the real line R, even though the point 1 belongs to both of their closures. Note that any two separated sets automatically must be disjoint.
A and B are separated by neighbourhoods if there are a neighbourhood U of A and a neighbourhood V of B such that U and V are disjoint. (Sometimes you will see the requirement that U and V be open neighbourhoods, but this makes no difference in the end.) For the example of A = [0,1) and B = (1,2], you could take U = (1,1) and V = (1,3). Note that if any two sets are separated by neighbourhoods, then certainly they are separated.
A and B are separated by closed neighbourhoods if there are a closed neighbourhood U of A and a closed neighbourhood V of B such that U and V are disjoint. Our examples, [0,1) and (1,2], are not separated by closed neighbourhoods. You could make either U or V closed by including the point 1 in it, but you can't make them both closed while keeping them disjoint. Note that if any two sets are separated by closed neighbourhoods, then certainly they are separated by neighbourhoods.
A and B are separated by a function if there exists a continuous function f from the space X to the real line R such that f(A) = {0} and f(B) = {1}. (Sometimes you will see the unit interval [0,1] used in place of R in this definition, but it makes no difference in the end.) In our example, [0,1) and (1,2] are not separated by a function, because there is no way to continuously define f at the point 1. Note that if any two sets are separated by a function, then they are also separated by closed neighbourhoods; the neighbourhoods can be given in terms of the preimage of f as U := f^{1}[e,e] and V := f^{1}[1e,1+e], as long as e is a positive real number less than 1/2.
A and B are precisely separated by a function if there exists a continuous function f from X to R such that f^{1}(0) = A and f^{1}(1) = B. (Again, you may also see the unit interval in place of R, and again it makes no difference.) Note that if any two sets are precisely separated by a function, then certainly they are separated by a function. Since {0} and {1} are closed in R, only closed sets are capable of being precisely separated by a function; but just because two sets are closed and separated by a function does not mean that they are automatically precisely separated by a function (even a different function).
Relation to separation axioms and separated spaces
The separation axioms are various conditions that are sometimes imposed upon topological spaces which can be described in terms of the various types of separated sets. As an example, we will define the T_{2} axiom, which is the condition imposed on separated spaces. Specifically, a topological space is separated if, given any two distinct points x and y, the singleton sets {x} and {y} are separated by neighbourhoods.
Separated spaces are also called Hausdorff spaces or T_{2} spaces. Further discussion of separated spaces may be found in the article Hausdorff space. General discussion of the various separation axioms is in the article Separation axiom.
Relation to connected spaces
Given a topological space X, it is sometimes useful to consider whether it is possible for a subset A to be separated from its complement. This is certainly true if A is either the empty set or the entire space X, but there may be other possibilities. A topological space X is connected if these are the only two possibilities. Conversely, if a nonempty subset A is separated from its own complement, and if the only subset of A to share this property is the empty set, then A is an openconnected component of X. (In the degenerate case where X is itself the empty set {}, authorities differ on whether {} is connected and whether {} is an openconnected component of itself.)
For more on connected spaces, see Connected space.
Relation to topologically distinguishable points
Given a topological space X, two points x and y are topologically distinguishable if there exists an open set that one point belongs to but the other point does not. If x and y are topologically distinguishable, then the singleton sets {x} and {y} must be disjoint. On the other hand, if the singletons {x} and {y} are separated, then the points x and y must be topologically distinguishable. Thus for singletons, topological distinguishability is a condition in between disjointness and separatedness.
For more about topologically distinguishable points, see Topological distinguishability.