In geometry, topology, and related branches of mathematics, a closed set is a set whose complement is an open set. In a topological space, a closed set can be defined as a set which contains all its limit points. In a complete metric space, a closed set is a set which is closed under the limit operation.
In a topological space, a set is closed if and only if it coincides with its closure. Equivalently, a set is closed if and only if it contains all of its limit points. Yet another equivalent definition is that a set is closed if and only if it contains all of its boundary points.
This is not to be confused with a closed manifold.
A closed set contains its own boundary. In other words, if you are "outside" a closed set, you may move a small amount in any direction and still stay outside the set. Note that this is also true if the boundary is the empty set, e.g. in the metric space of rational numbers, for the set of numbers of which the square is less than 2.
In fact, given a set X and a collection F of subsets of X that has these properties, then F will be the collection of closed sets for a unique topology on X. The intersection property also allows one to define the closure of a set A in a space X, which is defined as the smallest closed subset of X that is a superset of A. Specifically, the closure of A can be constructed as the intersection of all of these closed supersets.
The notion of closed set is defined above in terms of open sets, a concept that makes sense for topological spaces, as well as for other spaces that carry topological structures, such as metric spaces, differentiable manifolds, uniform spaces, and gauge spaces.
An alternative characterization of closed sets is available via sequences and nets. A subset A of a topological space X is closed in X if and only if every limit of every net of elements of A also belongs to A. In a first-countable space (such as a metric space), it is enough to consider only convergent sequences, instead of all nets. One value of this characterization is that it may be used as a definition in the context of convergence spaces, which are more general than topological spaces. Notice that this characterization also depends on the surrounding space X, because whether or not a sequence or net converges in X depends on what points are present in X.
Whether a set is closed depends on the space in which it is embedded. However, the compact Hausdorff spaces are "absolutely closed", in the sense that, if you embed a compact Hausdorff space K in an arbitrary Hausdorff space X, then K will always be a closed subset of X; the "surrounding space" does not matter here. Stone-?ech compactification, a process that turns a completely regular Hausdorff space into a compact Hausdorff space, may be described as adjoining limits of certain nonconvergent nets to the space.
Furthermore, every closed subset of a compact space is compact, and every compact subspace of a Hausdorff space is closed.
Closed sets also give a useful characterization of compactness: a topological space X is compact if and only if every collection of nonempty closed subsets of X with empty intersection admits a finite subcollection with empty intersection.
A topological space X is disconnected if there exist disjoint, nonempty, open subsets A and B of X whose union is X. Furthermore, X is totally disconnected if it has an open basis consisting of closed sets.