Skip to content

Open and Closed Sets

In this lesson you’ll learn what open and closed mean on the real line, why they are not opposites, what a limit point is, and how closedness relates to sequences. This vocabulary is what the next lesson’s compactness result is stated in.

For aRa \in \mathbb{R} and δ>0\delta > 0, the δ\delta-neighbourhood of aa is

(aδ,a+δ)={x:xa<δ}(a-\delta, a+\delta) = \{x : |x - a| < \delta\}

Everything in this lesson is phrased in terms of these. “Near aa” always means “inside some neighbourhood of aa.”

URU \subseteq \mathbb{R} is open if for every aUa \in U there is δ>0\delta > 0 with (aδ,a+δ)U(a-\delta, a+\delta) \subseteq U.

Every point of an open set has room to wiggle: you can move a little in either direction and stay inside.

(0,1)(0,1) is open. Given a(0,1)a \in (0,1), take δ=min(a,1a)\delta = \min(a, 1-a), the distance to the nearer end. Note δ\delta depends on aa and shrinks as you approach an endpoint - but it’s always positive, which is all that’s required.

[0,1][0,1] is not open, because the point 0 has no room: every neighbourhood of 0 contains negative numbers.

Properties: arbitrary unions of open sets are open, and finite intersections of open sets are open. Infinite intersections can fail, and the standard example is

n=1(1n,1n)={0}\bigcap_{n=1}^\infty \left(-\frac1n, \frac1n\right) = \{0\}

a single point, which is not open. The word “finite” is load-bearing.

FF is closed if FcF^c is open.

The most important thing here: open and closed are not opposites.

  • (0,1)(0,1) is open, not closed.
  • [0,1][0,1] is closed, not open.
  • [0,1)[0,1) is neither.
  • R\mathbb{R} and \emptyset are both.

“Not open” does not mean closed. Sets called both open and closed are sometimes called clopen, and on the real line only R\mathbb{R} and \emptyset are - a fact equivalent to R\mathbb{R} being connected.

aa is a limit point of SS if every neighbourhood of aa contains a point of SS other than aa itself.

The exclusion matters. Without it every point of SS would trivially qualify.

For S=(0,1)S = (0,1) the limit points are all of [0,1][0,1]. Both endpoints are limit points despite not belonging to SS - that’s the whole point of the notion.

For S={1,12,13,}S = \{1, \frac12, \frac13, \dots\}, the only limit point is 0. Each 1n\frac1n is isolated: a small enough neighbourhood catches no other member of SS.

A point of SS that is not a limit point is isolated. The set Z\mathbb{Z} consists entirely of isolated points and has no limit points at all, which makes it closed.

This is the version you’ll actually use.

FF is closed     \iff whenever xnFx_n \in F and xnxx_n \to x, we have xFx \in F.

A closed set contains the limits of its own convergent sequences. Closedness is closure under taking limits, which is where the name comes from.

That immediately explains why (0,1)(0,1) is not closed: 1n(0,1)\frac1n \in (0,1) and 1n0(0,1)\frac1n \to 0 \notin (0,1). The set leaks a limit.

It also explains why closedness keeps appearing as a hypothesis. Any argument that constructs a point as a limit needs the limit to stay in the set, and closed is exactly that guarantee.

The closure Sˉ\bar S is SS together with all its limit points. It is the smallest closed set containing SS.

(0,1)=[0,1]\overline{(0,1)} = [0,1]. And Q=R\overline{\mathbb{Q}} = \mathbb{R}, because every real is a limit of rationals - the density result from the completeness lesson, restated topologically.

SS is closed exactly when S=SˉS = \bar S.

The Cantor set is built by removing middle thirds from [0,1][0,1] forever. What remains is closed, contains no interval at all, is uncountable, and has total length 0.

It’s worth knowing that such an object exists, because it is the standing reminder that “closed” and “small” and “big” are independent properties. Intuition built on intervals does not survive here.

Example 1: Prove (2,5)(2, 5) is open.

Solution. Let a(2,5)a \in (2,5), so 2<a<52 < a < 5. Take

δ=min(a2,5a)>0\delta = \min(a - 2, 5 - a) > 0

If xa<δ|x - a| < \delta then x>aδa(a2)=2x > a - \delta \ge a - (a-2) = 2 and x<a+δa+(5a)=5x < a + \delta \le a + (5-a) = 5, so x(2,5)x \in (2,5). ∎

δ\delta is the distance to the nearer endpoint, and it depends on aa. Points near an end get a small δ\delta; that’s fine, since positivity is all that’s needed.

Example 2: Prove [0,1][0,1] is closed, two ways.

Solution 1 (complement). [0,1]c=(,0)(1,)[0,1]^c = (-\infty, 0) \cup (1,\infty), a union of two open intervals, hence open. So [0,1][0,1] is closed. ∎

Solution 2 (sequences). Let xn[0,1]x_n \in [0,1] with xnxx_n \to x. Since xn0x_n \ge 0 for all nn, the order limit theorem gives x0x \ge 0. Likewise xn1x_n \le 1 gives x1x \le 1. So x[0,1]x \in [0,1]. ∎

The second proof is where the order limit theorem earns its place: weak inequalities survive limits, which is exactly what closedness of a closed interval needs.

Example 3: Show [0,1)[0,1) is neither open nor closed.

Solution. Not open. The point 0 has no room: every (δ,δ)(-\delta, \delta) contains negative numbers not in the set.

Not closed. The sequence xn=11nx_n = 1 - \frac1n lies in [0,1)[0,1) and converges to 1, which is not in the set.

Neither.

Example 4: Find the limit points of S={1n:nN}S = \{\frac1n : n \in \mathbb{N}\}.

Solution. 0 is a limit point. Any neighbourhood (δ,δ)(-\delta,\delta) contains 1n\frac1n for n>1δn > \frac1\delta, by the Archimedean property, and those points differ from 0.

No point of SS is a limit point. For a fixed 1n\frac1n, the nearest other elements are 1n1\frac{1}{n-1} and 1n+1\frac{1}{n+1}, at positive distance, so a small enough neighbourhood isolates it.

No other point. Any aS{0}a \notin S \cup \{0\} has positive distance to the set.

So the only limit point is 0, and Sˉ=S{0}\bar S = S \cup \{0\}. Since 0S0 \notin S, SS is not closed; adding 0 makes it closed.

Example 5: An infinite intersection of open sets.

Solution. Let Un=(1n,1n)U_n = \left(-\frac1n, \frac1n\right), each open.

Their intersection is {0}\{0\}: clearly 00 is in every UnU_n, and any x0x \ne 0 fails to be in UnU_n once 1n<x\frac1n < |x|, which happens by the Archimedean property.

{0}\{0\} is not open - no neighbourhood of 0 is contained in a single point. So infinite intersections of open sets need not be open, which is why the axiom says finite.

Dually, infinite unions of closed sets need not be closed: n[1n,1]=(0,1]\bigcup_n \left[\frac1n, 1\right] = (0,1].

Example 6: Is Q\mathbb{Q} open, closed, or neither?

Solution. Not open. Every neighbourhood of a rational contains irrationals, since the irrationals are dense. So no rational has room to wiggle inside Q\mathbb{Q}.

Not closed. The truncations of 2\sqrt2 are rationals converging to 2Q\sqrt2 \notin \mathbb{Q}.

Neither. And Qˉ=R\bar{\mathbb{Q}} = \mathbb{R}: the closure of the rationals is everything.

Q\mathbb{Q} is a good stress test, because it is dense yet contains no interval, and it fails both definitions for different reasons.

Example 7: Is Z\mathbb{Z} closed?

Solution. Yes. Zc\mathbb{Z}^c is the union of the open intervals (n,n+1)(n, n+1) over all integers nn, and a union of open sets is open. So Z\mathbb{Z} is closed.

By sequences: a convergent sequence of integers must eventually be constant, since distinct integers are at least 1 apart, so its limit is that integer and lies in Z\mathbb{Z}.

Z\mathbb{Z} has no limit points at all. Having no limit points makes closedness automatic, since there is nothing to fail to contain.

Feasible regions in optimization. A constraint g(x)0g(x) \le 0 defines a closed set; g(x)<0g(x) < 0 defines an open one. This is not pedantry: closedness is exactly what lets you conclude an optimum is attained rather than merely approached, which is why solvers care whether a constraint is strict.

Numerical tolerance and stability. Open sets are where small perturbations are safe. A parameter sitting strictly inside a stability region has room to wiggle; one on the boundary does not, and the difference is open versus closed.

Image processing. Morphological operations, opening and closing, take their names directly from this topology, and boundary detection is computing the difference between a set and its interior.

Machine learning decision boundaries. A classifier’s decision regions are typically open, with the boundary a measure-zero set where the label is ambiguous. Points near the boundary are exactly those with little wiggle room, which is why they are the ones adversarial examples target.

Control theory. A system is robustly stable when its parameters lie in the interior of the stability region, since manufacturing tolerance moves them slightly. Designing to the boundary is designing to fail.

Domain of definition. A function’s natural domain is often open, such as ln\ln on (0,)(0,\infty), and open domains are exactly where you can differentiate, since a derivative needs limits from both sides.

What does it mean for U to be open?
Which interval is neither open nor closed?
What is the sequential characterization of a closed set?
What are the limit points of S = {1/n : n ∈ ℕ}?
Why must intersections of open sets be restricted to finitely many?
Is ℚ open, closed, both, or neither?