Skip to content

Open and Closed Sets

In this lesson you’ll get fluent with open and closed sets, learn the dual axioms, meet limit points and the sequence criterion, and see why the four combinations of open and closed all actually occur.

Open sets are given by the topology. Closed sets are defined from them:

CC is closed if XCX\setminus C is open.

Applying De Morgan’s laws to the topology axioms gives the dual list, and the reversal of “arbitrary” and “finite” is the thing to remember:

Open setsClosed sets
\varnothing and XX are open\varnothing and XX are closed
arbitrary unions are openarbitrary intersections are closed
finite intersections are openfinite unions are closed

The counterexample for the closed side mirrors the open one:

n=1[1n, 1]=(0,1]\bigcup_{n=1}^{\infty}\left[\tfrac1n,\ 1\right] = (0,1]

Each set in the union is closed, and the union is not. So infinite unions of closed sets need not be closed, which is exactly dual to infinite intersections of open sets.

The figure tests seven subsets of R\mathbb{R} endpoint by endpoint. Reading off the results:

  • Open, not closed: (0,1)(0,1) and (0,1)(2,3)(0,1)\cup(2,3)
  • Closed, not open: [0,1][0,1] and {0}\{0\}
  • Both (clopen): \varnothing and R\mathbb{R}
  • Neither: [0,1)[0,1)

So “not open” carries no information about closedness. This is the single most common early error in the subject, and the half-open interval is the standing cure for it.

xx is a limit point of AA if every open set containing xx meets AA in some point other than xx itself.

Note that a limit point need not belong to AA, and a point of AA need not be a limit point of it. A point of AA that is not a limit point is called isolated.

The characterization that makes closedness workable:

AA is closed if and only if AA contains all of its limit points.

For example the limit points of (0,1)(0,1) are [0,1][0,1], so (0,1)(0,1) misses two of them and is not closed. The set {1/n:n1}\{1/n : n\ge1\} has exactly one limit point, 0, which it does not contain - adding it produces a closed set.

In a metric space there is a clean sequential test:

AA is closed if and only if every convergent sequence of points of AA has its limit in AA.

This is the version most people carry from real analysis, and it is exactly right there. In a general topological space the criterion is only one-directional: limits of sequences in AA do lie in the closure, but there are spaces where closure cannot be detected by sequences at all. Nets or filters are the general replacement.

So sequences are a metric tool. Keep the open-set definitions as primary and use sequences when a metric is available.

Three derived notions, taken up properly in lesson 7 but worth naming now:

  • Interior intA\operatorname{int}A - the largest open set inside AA
  • Closure Aˉ\bar A - the smallest closed set containing AA
  • Boundary A=AˉintA\partial A = \bar A\setminus\operatorname{int}A

Immediately: AA is open iff A=intAA = \operatorname{int}A, and closed iff A=AˉA = \bar A. A set is clopen precisely when its boundary is empty.

Openness depends on the ambient space. The interval [0,12)[0,\frac12) is not open in R\mathbb{R}, but it is open in the space [0,1][0,1] with the subspace topology. Openness is never a property of a set alone; it is a property of a set inside a space.

Openness depends on the topology. In the discrete topology on R\mathbb{R}, every set is open. In the trivial topology, only two are.

Infinite operations break things. Both counterexamples above are worth memorizing, since they are the boundary cases the axioms were designed around.

Example 1: Show [0,1)[0,1) is neither open nor closed in R\mathbb{R}.

Solution. Not open: any interval around 0 contains negative numbers, which are outside the set.

Not closed: its complement is (,0)[1,)(-\infty,0)\cup[1,\infty), and any interval around 1 contains points just below 1, which lie in [0,1)[0,1). So the complement is not open.

Answer: neither. ∎

Example 2: Find the limit points of A={1/n:nN}A = \{1/n : n\in\mathbb{N}\} in R\mathbb{R}.

Solution. Every interval around 0 contains 1/n1/n for large nn, so 0 is a limit point.

No other point qualifies. Each 1/n1/n has a small interval around it containing no other member of AA, so all points of AA are isolated.

limit points={0}\text{limit points} = \{0\}

Since 0A0\notin A, the set AA is not closed, while A{0}A\cup\{0\} is. ∎

Example 3: Show an infinite union of closed sets need not be closed.

Solution. Each [1n,1]\left[\frac1n,1\right] is closed, and

n=1[1n,1]=(0,1]\bigcup_{n=1}^{\infty}\left[\tfrac1n,1\right] = (0,1]

because every x(0,1]x\in(0,1] satisfies x1nx\ge\frac1n for some nn, while 0 never does. The result is not closed. ∎

This is the exact dual of the shrinking-open-intervals example, and together they justify both halves of the axioms.

Example 4: Which sets are closed in the cofinite topology on Z\mathbb{Z}?

Solution. Open sets are \varnothing and the cofinite sets, so complements of open sets are Z\mathbb{Z} and the finite sets.

closed sets={Z}{finite subsets}\text{closed sets} = \{\mathbb{Z}\}\cup\{\text{finite subsets}\}

So {5}\{5\} is closed, and {n:n0}\{n : n \ge 0\} is neither open nor closed, since it is infinite with infinite complement. ∎

Example 5: In the discrete topology, which sets are closed?

Solution. Every set is open, so every complement is open too, so every set is closed.

Answer: every subset is clopen. ∎

This makes the discrete space maximally disconnected, which is the content of lesson 8.

Example 6: Show Q\mathbb{Q} is neither open nor closed in R\mathbb{R}.

Solution. Not open: every interval around a rational contains irrationals, so no interval fits inside Q\mathbb{Q}.

Not closed: 2\sqrt2 is a limit point of Q\mathbb{Q}, since rationals are dense, and it is not rational.

Answer: neither. ∎

In fact Qˉ=R\bar{\mathbb{Q}} = \mathbb{R} and intQ=\operatorname{int}\mathbb{Q} = \varnothing, so Q=R\partial\mathbb{Q} = \mathbb{R}. A set can have all of R\mathbb{R} as its boundary, which is a good sign that boundary is not an intuitive notion.

Example 7: Is [0,12)[0,\frac12) open in the space [0,1][0,1]?

Solution. Yes. The subspace topology declares U[0,1]U\subseteq[0,1] open when U=V[0,1]U = V\cap[0,1] for some VV open in R\mathbb{R}. Take V=(12,12)V = (-\frac12,\frac12):

(12,12)[0,1]=[0,12)\left(-\tfrac12,\tfrac12\right)\cap[0,1] = \left[0,\tfrac12\right) open in [0,1]\text{open in } [0,1]

Openness is relative to the ambient space, and this example is the one to remember. The same set is not open in R\mathbb{R}.

Numerical tolerance. An open condition like xx0<ε|x - x_0| < \varepsilon is robust to small perturbations, while a closed condition such as an equality is not. Specifying feasible regions as open or closed determines whether a solver can hit the boundary.

Optimization feasibility. A maximum is guaranteed on a closed bounded region and can fail on an open one, which is why constraint sets in optimization are written with \le rather than <<. The theorem behind that choice is in lesson 10.

Control safety envelopes. Safe operating regions are specified as closed sets so that boundary states are included and provably safe, rather than being ambiguous limits.

Computational geometry. Point-in-polygon tests must decide boundary cases explicitly, which is a choice between the open and closed versions of a region. Inconsistent choices cause the classic cracks in rendered meshes.

Type theory and program analysis. Observable properties of programs correspond to open sets, because they can be confirmed in finite time; their negations generally cannot, which is why the open sets are not closed under complement.

Image segmentation. Morphological opening and closing operations are named after these notions and behave analogously, removing small protrusions or filling small gaps.

How is a closed set defined?
Closed sets are closed under which operations?
Which subset of ℝ is neither open nor closed?
What are the limit points of {1/n : n ∈ ℕ} in ℝ?
Which sets are closed in the cofinite topology on ℤ?
Why is ℚ neither open nor closed in ℝ?
Is [0, ½) open in the space [0, 1] with the subspace topology?
Why is the sequential criterion for closedness a metric tool rather than a general one?