Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 36 Β· Compactness

Compact Spaces and Open Covers

Learn what compactness means: open covers, finite subcovers, and why (0,1] is not compact while [0,1] is. Includes runnable cover experiments.

Some spaces are "small" in a way that has nothing to do with length. The closed interval [0, 1] has finite length, but so does (0, 1], and yet the two behave very differently when you ask whether a continuous function on them must have a largest value. Compactness is the idea that captures this difference. It is one of the most useful properties in all of topology and analysis.

In this lesson you will meet the definition through open covers, see why it is stated with "finite subcover", and test it on examples by code. The definition looks odd at first. Take your time with the examples; they are the best way to feel why it is the right one.

Open covers

A cover of a set A is a family of sets whose union contains A. It is an open cover if every set in the family is open. A subcover is a smaller family, taken from the original one, that still covers A.

For example, the sets U_n = (1/n, 2) for n = 1, 2, 3, ... form an open cover of (0, 1] inside the real line. Every point x with 0 < x ≀ 1 lies in U_n as soon as 1/n < x.

A cover is a family of sets, not a list of points. "Finite subcover" means you may keep only finitely many of the sets.

The definition of compactness

A topological space X is compact if every open cover of X has a finite subcover. In symbols: whenever X = βˆͺ U_i with every U_i open, there are finitely many indices i_1, ..., i_k with X = U_{i_1} βˆͺ ... βˆͺ U_{i_k}.

A subset A of a space is compact when it is compact as a space with the subspace topology. Equivalently, every cover of A by open sets of the big space has a finite subcover.

To show a space is not compact you need one bad open cover: a cover from which no finite selection still covers. To show it is compact you must handle every open cover, so you need a general argument.

Finite sets are compact

If X = {x_1, ..., x_n} is finite and covers it, pick one U_i containing each x_j. That is at most n sets, so a finite subcover exists. Every finite space is compact, whatever its topology.

Why (0, 1] is not compact

Use the cover U_n = (1/n, 2) from above. Take any finite subfamily U_{n_1}, ..., U_{n_k} and let N be the largest index. Because the sets are nested, their union is just (1/N, 2). The point 1/(N+1) lies in (0, 1] but not in (1/N, 2). So no finite subfamily covers (0, 1].

Python Why (0, 1] fails: the finite subfamilies always miss a point

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the second half. For the closed interval [0, 1], the point 0 has to be inside some open set of the cover, and that set contains a whole neighborhood of 0. That neighborhood swallows all the "infinitely many remaining" sets at once. This is the heart of why [0, 1] is compact.

Finding a finite subcover by greed

When a space is compact, a finite subcover exists. For intervals on the line you can even build one with a simple greedy rule: start at the left end, repeatedly choose the interval that contains the current uncovered point and reaches furthest right.

Python A greedy search for a finite subcover of [0, 1]

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The code uses the fact that the right end of an open interval is not covered by that interval, so the next point to cover is exactly that endpoint. That is also why we need the endpoint to be inside some other open set.

Compactness is not about size

Compactness depends on the topology as well as the points:

  • Any finite space is compact.
  • The real line ℝ is not compact: the cover (-n, n) has no finite subcover.
  • The set β„€ of integers with the usual topology is not compact, because the single-point open sets cover it and every finite subfamily misses points.
  • A set with the indiscrete topology (only βˆ… and X open) is always compact, even if it is infinite.
  • An infinite set with the discrete topology is never compact.

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. Which statement is the definition of a compact space X?

    Compactness means that from any open cover you can pick finitely many sets that still cover X. Closed and bounded is a theorem for subsets of Euclidean space, not the definition.
  2. 2. Which open cover shows that (0, 1] is not compact?

    The sets (1/n, 2) are nested and each misses the points near 0, so any finite subfamily misses 1/(N+1). The other families are either finite or do not cover (0, 1].
  3. 3. A set X has the discrete topology. When is X compact?

    The one-point sets form an open cover. A finite subcover exists only if X is finite.
  4. 4. Why does a finite subcover of [0, 1] exist for the cover (1/n, 2) plus (-0.1, 0.1)?

    The extra set contains 0 and everything within 0.1. The remaining points of [0, 1] are covered by finitely many of the sets (1/n, 2).

Summary

  • A cover is a family of sets whose union contains the set; it is open if each member is open.
  • A space is compact if every open cover has a finite subcover.
  • Disproving compactness needs one bad cover; proving it needs an argument for all covers.
  • (0, 1], ℝ and infinite discrete spaces are not compact; finite spaces and [0, 1] are.
  • Compactness depends on the topology, not only on how big the set looks.

Next: Compactness in Euclidean Space