In geometry, topology, and related branches of mathematics, a **closed set** is a set whose complement is an open set.^{[1]}^{[2]} 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.
This should not be confused with a closed manifold.

By definition, a subset of a topological space is called ** closed** if its complement is an open subset of ; that is, if A set is closed in if and only if it is equal to its closure in 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.
Every subset is always contained in its (topological) closure in which is denoted by that is, if then Moreover, is a closed subset of if and only if

An alternative characterization of closed sets is available via sequences and nets. A subset of a topological space is closed in if and only if every limit of every net of elements of also belongs to 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 because whether or not a sequence or net converges in depends on what points are present in
A point in is said to be *close to* a subset if (or equivalently, if belongs to the closure of in the topological subspace meaning where is endowed with the subspace topology induced on it by ^{[note 1]}).
Because the closure of in is thus the set of all points in that are close to this terminology allows for a plain English description of closed subsets:

- a subset is closed if and only if it contains every point that is close to it.

In terms of net convergence, a point is close to a subset if and only if there exists some net (valued) in that converges to
If is a topological subspace of some other topological space in which case is called a *topological super-space* of then there *might* exist some point in that is close to (although not an element of ), which is how it is possible for a subset to be closed in but to *not* be closed in the "larger" surrounding super-space
If and if is *any* topological super-space of then is always a (potentially proper) subset of which denotes the closure of in indeed, even if is a closed subset of (which happens if and only if ), it is nevertheless still possible for to be a proper subset of However, is a closed subset of if and only if for some (or equivalently, for every) topological super-space of

Closed sets can also be used to characterize continuous functions: a map is continuous if and only if for every subset ; this can be reworded in plain English as: is continuous if and only if for every subset maps points that are close to to points that are close to Similarly, is continuous at a fixed given point if and only if whenever is close to a subset then is close to

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.

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 in an arbitrary Hausdorff space then will always be a closed subset of ; 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 is compact if and only if every collection of nonempty closed subsets of with empty intersection admits a finite subcollection with empty intersection.

A topological space is disconnected if there exist disjoint, nonempty, open subsets and of whose union is Furthermore, is totally disconnected if it has an open basis consisting of closed sets.

See also: Kuratowski closure axioms |

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. 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

- Any intersection of any family of closed sets is closed (this includes intersections of infinitely many closed sets)
- The union of
*finitely many*closed sets is closed. - The empty set is closed.
- The whole set is closed.

In fact, if given a set and a collection of subsets of such that the elements of have the properties listed above, then there exists a unique topology on such that the closed subsets of are exactly those sets that belong to The intersection property also allows one to define the closure of a set in a space which is defined as the smallest closed subset of that is a superset of Specifically, the closure of 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.

- The closed interval of real numbers is closed. (See
*Interval (mathematics)*for an explanation of the bracket and parenthesis set notation.) - The unit interval is closed in the metric space of real numbers, and the set of rational numbers between and (inclusive) is closed in the space of rational numbers, but is not closed in the real numbers.
- Some sets are neither open nor closed, for instance the half-open interval in the real numbers.
- Some sets are both open and closed and are called clopen sets.
- The ray is closed.
- The Cantor set is an unusual closed set in the sense that it consists entirely of boundary points and is nowhere dense.
- Singleton points (and thus finite sets) are closed in T
_{1}spaces and Hausdorff spaces. - The set of integers is an infinite and unbounded closed set in the real numbers.
- If is a function between topological spaces then is continuous if and only if preimages of closed sets in are closed in