# Closed set

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. This should not be confused with closed manifold.
Sets that are both open and closed and are called clopen sets.

## Definition

Given a topological space $(X,\tau )$, the following statements are equivalent:
* a set $A\subseteq X$ is closed in $X.$
* $A^{c}=X\setminus A$ is an open subset of $(X,\tau )$; that is, $A^{c}\in \tau .$
* $A$ is equal to its closure in $X.$
* $A$ contains all of its limit points.
* $A$ contains all of its boundary points.
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.$ A point $x$ in $X$ is said to be close to a subset $A\subseteq X$ if $x\in \operatorname {cl} _{X}A$ (or equivalently, if $x$ belongs to the closure of $A$ in the topological subspace $A\cup \{x\},$ meaning $x\in \operatorname {cl} _{A\cup \{x\}}A$ where $A\cup \{x\}$ is endowed with the subspace topology induced on it by $X$).
Because the closure of $A$ in $X$ is thus the set of all points in $X$ that are close to $A,$ 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 $x\in X$ is close to a subset $A$ if and only if there exists some net (valued) in $A$ that converges to $x.$ If $X$ is a topological subspace of some other topological space $Y,$ in which case $Y$ is called a topological super-space of $X,$ then there might exist some point in $Y\setminus X$ that is close to $A$ (although not an element of $X$), which is how it is possible for a subset $A\subseteq X$ to be closed in $X$ but to not be closed in the "larger" surrounding super-space $Y.$ If $A\subseteq X$ and if $Y$ is any topological super-space of $X$ then $A$ is always a (potentially proper) subset of $\operatorname {cl} _{Y}A,$ which denotes the closure of $A$ in $Y;$ indeed, even if $A$ is a closed subset of $X$ (which happens if and only if $A=\operatorname {cl} _{X}A$), it is nevertheless still possible for $A$ to be a proper subset of $\operatorname {cl} _{Y}A.$ However, $A$ is a closed subset of $X$ if and only if $A=X\cap \operatorname {cl} _{Y}A$ for some (or equivalently, for every) topological super-space $Y$ of $X.$
Closed sets can also be used to characterize continuous functions: a map $f:X\to Y$ is continuous if and only if $f\left(\operatorname {cl} _{X}A\right)\subseteq \operatorname {cl} _{Y}(f(A))$ for every subset $A\subseteq X$; this can be reworded in plain English as: $f$ is continuous if and only if for every subset $A\subseteq X,$ $f$ maps points that are close to $A$ to points that are close to $f(A).$ Similarly, $f$ is continuous at a fixed given point $x\in X$ if and only if whenever $x$ is close to a subset $A\subseteq X,$ then $f(x)$ is close to $f(A).$

## More about closed sets

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 $D$ in an arbitrary Hausdorff space $X,$ then $D$ 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.

## Properties

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 $2.$
* 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 $X$ and a collection $\mathbb {F} \neq \varnothing$ of subsets of $X$ such that the elements of $\mathbb {F}$ have the properties listed above, then there exists a unique topology $\tau$ on $X$ such that the closed subsets of $(X,\tau )$ are exactly those sets that belong to $\mathbb {F} .$ 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 $X$ 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.

## Examples

* The closed interval $[a,b]$ of real numbers is closed. (See Interval (mathematics) for an explanation of the bracket and parenthesis set notation.)
* The unit interval $[0,1]$ is closed in the metric space of real numbers, and the set $[0,1]\cap \mathbb {Q}$ of rational numbers between $0$ and $1$ (inclusive) is closed in the space of rational numbers, but $[0,1]\cap \mathbb {Q}$ is not closed in the real numbers.
* Some sets are neither open nor closed, for instance the half-open interval $[0,1)$ in the real numbers.
* The ray $[1,+\infty )$ 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 $\mathbb {Z}$ is an infinite and unbounded closed set in the real numbers.
* If $f:X\to Y$ is a function between topological spaces then $f$ is continuous if and only if preimages of closed sets in $Y$ are closed in $X.$