Open sets are the raw material of a topology. Closed sets are their mirror image, and they're the natural language for limits: a closed set is one you can't escape by taking limits. This page also builds the closure and interior of a set, and gets our first look at convergence without distances.
The definition is short, and it's defined entirely in terms of open sets.
Let $(X, \mathcal{T})$ be a topological space. A subset $A \subset X$ is said to be closed if the set $X \setminus A$ is open in $X$.
The word "closed" makes it sound like the opposite of "open." It isn't.
Sets are not doors. A set can be open, closed, both, or neither, and $\mathbb{R}$ is somehow both. Whoever named these was not thinking about doors.
In $\mathbb{R}$, which of $[0, 1]$, $(0, 1)$, $[0, 1)$, and $\mathbb{R}$ are closed?
$[0, 1]$ is closed: its complement $(-\infty, 0) \cup (1, \infty)$ is open. $(0, 1)$ is not closed: its complement $(-\infty, 0] \cup [1, \infty)$ has no room around $0$. $[0, 1)$ is not closed for the same reason at $1$ (and it isn't open either). $\mathbb{R}$ is closed because its complement $\emptyset$ is open, and $\mathbb{R}$ is also open.
Taking complements turns the three axioms for open sets into three facts about closed sets. Unions and intersections swap roles.
Let $(X, \mathcal{T})$ be a topological space. Then:
Proof. (1) $\emptyset$ and $X$ are closed because their complements, $X$ and $\emptyset$, are open.
(2) Given a collection of closed sets $\{D_\alpha\}_{\alpha \in J}$, De Morgan's law gives $$X \setminus \bigcap_{\alpha \in J} D_\alpha = \bigcup_{\alpha \in J} (X \setminus D_\alpha).$$ Each $X \setminus D_\alpha$ is open, so the right side is a union of open sets, which is open. Hence $\bigcap_\alpha D_\alpha$ is closed.
(3) If $E_1, \dots, E_n$ are closed, De Morgan's law gives $$X \setminus \bigcup_{i=1}^{n} E_i = \bigcap_{i=1}^{n} (X \setminus E_i),$$ a finite intersection of open sets, which is open. Hence $\bigcup_{i=1}^n E_i$ is closed. $\blacksquare$
Sort some subsets of $\mathbb{R}$ before going on. The explanations for each card use ideas from later in the page (accumulation points), so come back after reading if one doesn't make sense yet.
In a subspace, closed sets come from cutting down closed sets of the big space, exactly like open sets did.
Let $Y$ be a subspace of $X$. Then a set $A$ is closed in $Y$ if and only if it equals the intersection of a closed set of $X$ with $Y$.
Proof. Assume $A = D \cap Y$, where $D$ is closed in $X$. Then $X \setminus D$ is open in $X$, so $(X \setminus D) \cap Y$ is open in $Y$. But $(X \setminus D) \cap Y = Y \setminus A$. So $Y \setminus A$ is open in $Y$, and $A$ is closed in $Y$.
Conversely, assume $A$ is closed in $Y$. Then $Y \setminus A$ is open in $Y$, so there is an open set $U$ of $X$ with $Y \setminus A = U \cap Y$. The set $X \setminus U$ is closed in $X$, and $A = Y \cap (X \setminus U)$. $\blacksquare$
Same move as on the Subspace Topology page, where open sets of $Y$ were open sets of $X$ cut down to $Y$. Now closed sets work the same way.
Let $Y = [0, 1] \cup (2, 3)$, a subspace of $\mathbb{R}$. Is $[0, 1]$ open in $Y$? Closed in $Y$?
Both. $[0, 1] = Y \cap (-1, \frac{3}{2})$, so it is open in $Y$. And $[0, 1] = Y \cap [0, 1]$ with $[0, 1]$ closed in $\mathbb{R}$, so it is closed in $Y$. (Likewise $(2, 3)$ is both open and closed in $Y$.) A space that splits into two such pieces is called disconnected.
That "both open and closed" piece is exactly what the Connected Spaces page is built on. A space is connected when the only such sets are $\emptyset$ and the whole space.
Every set sits between a largest open set inside it and a smallest closed set around it.
Let $(X, \mathcal{T})$ be a topological space and $A \subset X$. The interior of $A$, denoted $\operatorname{int}(A)$, is the union of all open sets contained in $A$.
A union of open sets is open, so $\operatorname{int}(A)$ is the largest open set inside $A$. Flip everything for the closure.
Let $(X, \mathcal{T})$ be a topological space and $A \subset X$. The closure of $A$, denoted $\overline{A}$, is the intersection of all closed sets containing $A$.
An intersection of closed sets is closed, so $\overline{A}$ is the smallest closed set containing $A$. In particular, $A$ is closed if and only if $A = \overline{A}$. Two small definitions make closures much easier to compute.
Let $A$ and $B$ be arbitrary sets. We say $A$ intersects $B$ if $A \cap B \neq \emptyset$.
And a convenient word for "an open set around a point."
The set $U$ is a neighborhood of $x$ if $U$ is an open set containing $x$.
Now the closure can be tested one point at a time.
Let $(X, \mathcal{T})$ be a topological space, $A \subset X$, and let $\mathcal{B}$ be a basis for $\mathcal{T}$. Then:
Proof. (1) We prove the contrapositive in both directions. If $x \notin \overline{A}$, then $U = X \setminus \overline{A}$ is open (since $\overline{A}$ is closed) and is a neighborhood of $x$ that does not intersect $A$. Conversely, if some neighborhood $V$ of $x$ does not intersect $A$, then $X \setminus V$ is a closed set containing $A$, so by definition $\overline{A} \subset X \setminus V$. Hence $x \notin \overline{A}$.
(2) If every neighborhood of $x$ intersects $A$, then so does every basis element containing $x$, because basis elements are open. Conversely, suppose every basis element containing $x$ intersects $A$, and let $U$ be any neighborhood of $x$. There is $B \in \mathcal{B}$ with $x \in B \subset U$, and $B$ intersects $A$, so $U$ does too. $\blacksquare$
Here's the theorem in action on the real line.
In $\mathbb{R}$, find the closures of $(0, 1]$, $K = \{\frac{1}{n} : n \in \mathbb{Z}_+\}$, and $\mathbb{Q}$, and the interior of $\mathbb{Q}$.
$\overline{(0, 1]} = [0, 1]$: every interval around $0$ contains small positive numbers, and any point outside $[0, 1]$ has an interval around it missing $(0, 1]$.
$\overline{K} = K \cup \{0\}$: every interval $(-\varepsilon, \varepsilon)$ contains $\frac{1}{n}$ once $n > \frac{1}{\varepsilon}$, and every other point outside $K$ has an interval around it that misses $K$.
$\overline{\mathbb{Q}} = \mathbb{R}$, because every open interval contains a rational. And $\operatorname{int}(\mathbb{Q}) = \emptyset$, because every open interval contains an irrational.
The closure adds exactly the points that $A$ crowds up against. To make that precise, we want points where $A$ comes arbitrarily close without counting the point itself.
Let $(X, \mathcal{T})$ be a topological space, $A \subset X$, and $x \in X$. Then $x$ is an accumulation point of $A$ (also called a limit point) if every neighborhood of $x$ intersects $A$ in some point other than $x$ itself. Equivalently, $x \in \overline{A \setminus \{x\}}$.
The collection of all of them gets a symbol.
Let $(X, \mathcal{T})$ be a topological space and $A \subset X$. The set of all accumulation points of $A$ is called the derived set of $A$, denoted $A'$.
An accumulation point doesn't have to be in $A$ (like $0$ for $K$), and a point of $A$ doesn't have to be an accumulation point (like $\frac{1}{2}$ for $K$, which has a neighborhood containing no other point of $K$). Drag the point and its neighborhood around and watch the three sets.
In every preset, the red band was the purple set plus the green band. That's the theorem.
Let $(X, \mathcal{T})$ be a topological space and $A \subset X$. Then $$\overline{A} = A \cup A'.$$
Proof. Clearly $A \subset \overline{A}$. If $x \in A'$, then every neighborhood of $x$ intersects $A$, so $x \in \overline{A}$ by the previous theorem. Hence $A \cup A' \subset \overline{A}$. For the reverse inclusion, let $x \in \overline{A}$. If $x \in A$, we're done. If $x \notin A$, then every neighborhood of $x$ intersects $A$ (previous theorem), and since $x \notin A$, the intersection must happen at a point other than $x$. So $x \in A'$. Therefore $\overline{A} = A \cup A'$. $\blacksquare$
And this gives the most useful test for closedness.
A subset of a topological space is closed if and only if it contains all of its limit points.
Proof. The set $A$ is closed if and only if $A = \overline{A} = A \cup A'$, and $A \cup A' = A$ exactly when $A' \subset A$. $\blacksquare$
When you want to show a set is closed, you have two strategies: show the complement is open, or show the set contains all its limit points. Pick whichever is easier. For $K \cup \{0\}$, the limit-point route is a one-liner (its only limit point is $0$), while the complement route needs infinitely many intervals.
Sequences make sense in any topological space: replace "within $\varepsilon$" by "inside a neighborhood."
In an arbitrary topological space $X$, a sequence $x_1, x_2, \dots$ of points of $X$ converges to the point $x \in X$ provided that, corresponding to each neighborhood $U$ of $x$, there exists a positive integer $N$ such that $x_n \in U$ for all $n \ge N$.
In $\mathbb{R}$ this is the calculus definition, since the neighborhoods $(x - \varepsilon, x + \varepsilon)$ are enough to check. In stranger topologies, strange things happen.
In the finite complement topology, $\frac{1}{n}$ converges to $0$. And to $\pi$. And to $-7$. Exercise 4 below proves it.
The fix for limits that aren't unique is the Hausdorff condition. In a Hausdorff space every sequence has at most one limit.
The first two use the theorems about subspaces and products.
Show that if $D$ is closed in $E$ and $E$ is closed in $X$, then $D$ is closed in $X$.
Proof. Since $E \subset X$ is a subspace and $D$ is closed in $E$, the theorem on closed sets of subspaces gives a closed set $F \subset X$ with $D = E \cap F$. Since $E$ is also closed in $X$, $D$ is an intersection of two closed sets of $X$, so it is closed in $X$. $\blacksquare$
For the next one, draw the picture in $\mathbb{R}^2$ first.
Show that if $D$ is closed in $X$ and $E$ is closed in $Y$, then $D \times E$ is closed in $X \times Y$.
Proof. A point $(x, y)$ is outside $D \times E$ exactly when $x \notin D$ or $y \notin E$, so $$(X \times Y) \setminus (D \times E) = \big((X \setminus D) \times Y\big) \cup \big(X \times (Y \setminus E)\big).$$ Since $D$ and $E$ are closed, $X \setminus D$ and $Y \setminus E$ are open, so $(X \setminus D) \times Y$ and $X \times (Y \setminus E)$ are products of open sets, which are open in $X \times Y$. Their union is open, so $D \times E$ is closed. $\blacksquare$
A quick computation in a strange topology.
In the finite complement topology on $\mathbb{R}$, to what point or points does the sequence $x_n = \frac{1}{n}$ converge?
To every point of $\mathbb{R}$. Let $y \in \mathbb{R}$ and let $V$ be a neighborhood of $y$ in $(\mathbb{R}, \mathcal{T}_f)$. Then $\mathbb{R} \setminus V$ is finite. Since the terms $x_n = \frac{1}{n}$ are all distinct, only finitely many of them can lie in the finite set $\mathbb{R} \setminus V$, so there is $N$ with $x_n \in V$ for all $n \ge N$. Hence $x_n \to y$. Since $y$ was arbitrary, the sequence converges to every point of $\mathbb{R}$.
Three facts about closures that you'll use constantly.
Let $A$, $B$, and $A_\alpha$ denote subsets of $X$. Prove the following:
(a) Let $x \in \overline{A}$ and let $U$ be a neighborhood of $x$. Then $U \cap A \neq \emptyset$, and $A \subset B$, so $U \cap B \neq \emptyset$. Every neighborhood of $x$ intersects $B$, so $x \in \overline{B}$.
(b) Since $A \subset A \cup B$ and $B \subset A \cup B$, part (a) gives $\overline{A} \cup \overline{B} \subset \overline{A \cup B}$. Now suppose $x \notin \overline{A} \cup \overline{B}$. Then there are neighborhoods $U$ and $V$ of $x$ with $U \cap A = \emptyset$ and $V \cap B = \emptyset$. So $U \cap V$ is a neighborhood of $x$ with $(U \cap V) \cap (A \cup B) = \emptyset$, and $x \notin \overline{A \cup B}$. Hence $\overline{A \cup B} = \overline{A} \cup \overline{B}$.
(c) For each $\beta$, $A_\beta \subset \bigcup_\alpha A_\alpha$, so by part (a), $\overline{A_\beta} \subset \overline{\bigcup_\alpha A_\alpha}$. Taking the union over $\beta$ gives the inclusion. For a counterexample, let $\mathbb{Q} = \{q_1, q_2, \dots\}$ be a listing of the rationals in $\mathbb{R}$ and $A_n = \{q_n\}$. Each one-point set is closed, so $$\bigcup_{n=1}^{\infty} \overline{\{q_n\}} = \mathbb{Q}, \quad \text{but} \quad \overline{\bigcup_{n=1}^{\infty} \{q_n\}} = \overline{\mathbb{Q}} = \mathbb{R}. \; \blacksquare$$
Part (b) only works for finitely many sets, which is what part (c) is warning you about.
"The closure of a union is the union of the closures" is true for two sets (so for finitely many) and false for infinitely many. Same pattern as closed sets themselves: finite unions are safe, infinite ones are not.
This one is a real prelim problem. It describes a space built as an increasing union of pieces, where "open" is decided piece by piece.
Let $X$ be a topological space and let $X_1 \subset X_2 \subset X_3 \subset \dots$ be a nested sequence of subsets of $X$ such that $$X = \bigcup_{n=1}^{\infty} X_n.$$ Suppose that every $X_n$ has the subspace topology, and that a subset $U \subset X$ is open in $X$ if and only if $U \cap X_n$ is open in $X_n$ for all $n \in \mathbb{N}$. Suppose that every singleton in $X_n$ is closed in $X_n$, for all $n$. Let $A \subset X$, and suppose $A \cap X_n$ is a finite set for all $n \in \mathbb{N}$. Prove that $A$ is closed in $X$.
Proof. Fix $n$. The set $A \cap X_n$ is a finite union of singletons, each closed in $X_n$, so $A \cap X_n$ is closed in $X_n$ (finite unions of closed sets are closed). Therefore $$(X \setminus A) \cap X_n = X_n \setminus (A \cap X_n)$$ is open in $X_n$. This holds for every $n$, so by the hypothesis on $X$, the set $X \setminus A$ is open in $X$. Hence $A$ is closed in $X$. $\blacksquare$