Definition · applies to sets and spaces

High school (subsets of $\reals^n$)

Consider a set of points in the plane or in space. The set is compact if it is closed and bounded.

Caveat. “Closed and bounded” is equivalent to compact in $\reals^n$ (the Heine–Borel theorem), but not in general. The closed unit ball of an infinite-dimensional Hilbert space is closed and bounded, but not compact.
Undergraduate (metric spaces)

Consider a set $K$ in a metric space. The set $K$ is compact if

  1. $K$ is complete: every Cauchy sequence of points of $K$ converges to a point of $K$, and
  2. $K$ is totally bounded: for every $\varepsilon > 0$, finitely many balls of radius $\varepsilon$ cover $K$.
Caveat. In a general topological space, there is no distance, so “complete” and “totally bounded” have no meaning; compactness is defined with open covers instead.
Graduate (topological spaces)

Consider a set $K$ in a topological space, and the open covers of $K$: collections of open sets whose union contains $K$. The set $K$ is compact if every open cover of $K$ has a finite subcover.

Examples

Examples

Non-examples
Things that may be mistaken for examples of this term.

  • ✗ $\nats$ High school
    $\nats$ is not compact, because it is not bounded.
  • ✗ $(0, 1)$ High school
    $(0, 1)$ is not compact, because it is not closed: the sequence $1/n$ has no limit in $(0, 1)$.
  • $\rationals$ is not compact, because it is not bounded.
  • The set of real numbers, $\reals$, is not compact, because the sequence $1, 2, 3, \dots$ has no convergent subsequence.
  • The closed unit ball of $\ell^2$ is not compact, even though it is closed and bounded, because the standard basis vectors have no convergent subsequence.

Properties

  • In a metric space, a set is compact if and only if it is sequentially compact: every sequence in the set has a subsequence that converges to a point of the set. In a general topological space, neither property implies the other.
  • In a metric space, the definitions agree: a set is complete and totally bounded if and only if every open cover of the set has a finite subcover. In $\reals^n$, both are equivalent to being closed and bounded.
  • A continuous image of a compact set is compact. In particular, a continuous real-valued function on a nonempty compact set attains a maximum and a minimum (the extreme value theorem).
  • A closed subset of a compact set is compact, and a compact subset of a Hausdorff space is closed.

All definitions · All distinctions · All examples · Notation