Real AnalysisMetric Spaces

Open and Closed Sets

A set is open when every point has a ball around it inside the set, and closed when it contains all its limit points; the closure adds the limit points.

Not started Jump to practice

In a metric space the open ball $B(p, r) = \{x : d(x, p) < r\}$ plays the role of an open interval. Open and closed sets describe, without any numbers, where limits can go.

Key idea

$U$ is open when every $p \in U$ has some $r > 0$ with $B(p, r) \subseteq U$. $E$ is closed when its complement is open; equivalently, whenever $x_n \in E$ and $x_n \to x$, the limit $x$ is in $E$. The closure $\overline{E}$ is $E$ together with all limits of sequences from $E$: the smallest closed set containing $E$.

Why it works

An open ball is open. Let $q \in B(p, r)$ and set $s = r - d(p, q) > 0$. If $d(x, q) < s$, then $d(x, p) \le d(x, q) + d(q, p) < s + d(p, q) = r$, so $B(q, s) \subseteq B(p, r)$. $\blacksquare$

Closed sets keep their limits. Suppose the complement of $E$ is open, $x_n \in E$ and $x_n \to x$. If $x \notin E$, some ball $B(x, r)$ misses $E$; but $x_n \in B(x, r)$ for large $n$, and $x_n \in E$. Contradiction, so $x \in E$. $\blacksquare$ In $\mathbb{R}$: $(0, 1)$ is open, $[0, 1]$ closed, $[0, 1)$ neither, and $\mathbb{R}$ and $\varnothing$ are both. Any union of open sets is open, but only finite intersections need be: $\bigcap_{n} \left(-\frac{1}{n}, \frac{1}{n}\right) = \{0\}$ is not open.

The open square $(0, 6)^{2}$ is open: from any point $p$ inside it, a ball fits. The largest radius is the distance from $p$ to the nearest side. Drag $p$ toward an edge and watch the room shrink to $0$, but never reach it.
The set $\left\{\frac{1}{n}\right\}$ is not closed: its terms pile up at $0$, which is not in the set (gold ring). Adding $0$ gives the closure.

Worked examples

Worked example: How much room

Find the largest $r$ such that $B\left(\frac{3}{2}, r\right) \subseteq (0, 2) \cup (3, 7)$ in $\mathbb{R}$.
  1. The point $\frac{3}{2}$ is in $(0, 2)$; its distances to the ends are $\frac{3}{2}$ and $\frac{1}{2}$.

Answer: $r = \frac{1}{2}$ (any larger ball sticks out past $2$).

Worked example: Closure and interior

For $E = [0, 2) \cup \{5\}$ in $\mathbb{R}$, find the closure and the interior (the largest open set inside $E$).
  1. Limits of sequences in $E$ fill in $2$; the isolated point $5$ stays.
  2. Interior points need a whole interval around them: $0$ and $5$ fail.

Answer: $\overline{E} = [0, 2] \cup \{5\}$; interior $= (0, 2)$.

Worked example: Neither

Is $\mathbb{Q}$ open or closed in $\mathbb{R}$?
  1. Every interval around a rational contains irrationals, so no ball fits: not open.
  2. Rationals converge to $\sqrt{2}$, which is not rational: not closed.

Answer: Neither. Its closure is $\mathbb{R}$, and its interior is empty.

Common mistake

"Not open" does not mean closed. Sets are not doors. $[0, 1)$ fails both tests: no ball around $0$ fits inside, and the sequence $1 - \frac{1}{n}$ in the set converges to $1$, outside it. Check each property on its own. Also, openness depends on the space: $[0, 1)$ is open as a subset of the metric space $[0, 1]$, since the ball of radius $\frac{1}{2}$ around $0$ there is $[0, \frac{1}{2})$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Jiří Lebl, Basic Analysis I: Introduction to Real Analysis, section 7.2 (open and closed sets)
  • William F. Trench, Introduction to Real Analysis (Trinity University), section 1.3 (the real line: open and closed sets)
@teddyrookbook GitHub