In topology and related branches of mathematics, a closed set is a set whose complement is an open set. In a metric space, such as in real analysis, a closed set can be defined as a set which contains all its limit points. Thus a closed set is a set which is closed under the limit operation.
Contents 
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.
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 and you "wiggle" a little bit, you will 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.
Any intersection of closed sets is closed (including intersections of infinitely many closed sets), and any union of finitely many closed sets is closed. In particular, the empty set and the whole space are closed. 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.
Sets that can be constructed as the union of countably many closed sets are denoted F_{σ} sets. These sets need not be closed.
In point set topology, a set A is closed if it contains all its boundary points.
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 firstcountable space (such as a metric space), it is enough to consider only convergent sequences, instead of all nets. One value of this characterisation 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 characterisation 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.
We have seen twice that whether a set is closed is relative depends on the space in which it is embedded. However, the compact Hausdorff spaces are "absolutely closed" in a certain sense. To be precise, 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. In fact, this property characterizes the compact Hausdorff spaces. 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.
