Real Analysis · Undergraduate

Open, Closed and Compact Sets in ℝ

Quick answer

A set of real numbers is open when every point has a small interval around it inside the set, and closed when it contains all its limit points. The interval (0, 1) is open, [0, 1] is closed, and (0, 1] is neither. A set is compact when every sequence in it has a subsequence converging to a point of the set. By the Heine–Borel theorem, the compact sets in ℝ are exactly the closed and bounded ones, and a continuous function on a compact set reaches a maximum and a minimum.

What you'll learn

  • Decide whether a set of reals is open, closed, both or neither
  • Find limit points of a set
  • Use the Heine–Borel theorem to identify compact sets
  • Apply the extreme value theorem on a compact set

Room around every point

A set U⊆RU \subseteq \mathbb{R} is open if every xx in UU has some ε>0\varepsilon > 0 with (x−ε,x+ε)⊆U(x - \varepsilon, x + \varepsilon) \subseteq U.

A number pp is a limit point of AA if every interval around pp contains a point of AA other than pp. A set is closed if it contains all its limit points, which is the same as its complement being open.

A set KK is compact if every sequence in KK has a subsequence that converges to a point of KK.

SetOpen?Closed?Compact?
(0,1)(0, 1)yesnono
[0,1][0, 1]noyesyes
(0,1](0, 1]nonono
[0,∞)[0, \infty)noyesno
{1,12,13,…}∪{0}\{1, \tfrac{1}{2}, \tfrac{1}{3}, \ldots\} \cup \{0\}noyesyes

Why closed and bounded means compact

Take a sequence in a closed, bounded set KK. Being bounded, it has a convergent subsequence by the Bolzano–Weierstrass theorem, which follows from the monotone convergence theorem. Its limit is a limit point of KK, or a point of KK already. Since KK is closed, the limit lies in KK, so KK is compact. Without boundedness, 1,2,3,…1, 2, 3, \ldots has no convergent subsequence; without closedness, 1n\tfrac{1}{n} in (0,1](0, 1] converges to 00, outside the set.

Worked examples

Common mistakes

Practice problems

  1. Find the largest ε\varepsilon with (0.3−ε,0.3+ε)⊆(0,1)(0.3 - \varepsilon, 0.3 + \varepsilon) \subseteq (0, 1).

    Answer

    0.30.3

    Full solution

    min⁡(0.3,0.7)=0.3\min(0.3, 0.7) = 0.3.

  2. Find the largest ε\varepsilon with (0.9−ε,0.9+ε)⊆(0,1)(0.9 - \varepsilon, 0.9 + \varepsilon) \subseteq (0, 1).

    Answer

    0.10.1

    Full solution

    min⁡(0.9,0.1)=0.1\min(0.9, 0.1) = 0.1.

  3. Is [0,∞)[0, \infty) closed?

    Answer

    Yes

    Full solution

    Its complement (−∞,0)(-\infty, 0) is open.

  4. Of the sets [0,1][0, 1], (0,1)(0, 1), [0,∞)[0, \infty) and {0,1,2}\{0, 1, 2\}, how many are compact?

    Answer

    22

    Full solution

    [0,1][0, 1] and {0,1,2}\{0, 1, 2\} are closed and bounded; (0,1)(0, 1) is not closed and [0,∞)[0, \infty) is not bounded.

  5. Find the limit point of {1n:n≥1}\{\tfrac{1}{n} : n \ge 1\} that is not in the set.

    Answer

    00

    Full solution

    Every interval around 00 contains 1n\tfrac{1}{n} for large nn.

  6. Find sup⁡(0,1)\sup (0, 1).

    Answer

    11

    Full solution

    11 is an upper bound, and no smaller number is. It is not in the set, so (0,1)(0, 1) has no maximum.

  7. Find the maximum of f(x)=x(1−x)f(x) = x(1 - x) on [0,1][0, 1].

    Answer

    14\tfrac{1}{4}

    Full solution

    It occurs at x=12x = \tfrac{1}{2}.

  8. A student says (0,1](0, 1] is compact because it is bounded. Is (0,1](0, 1] compact?

    Answer

    No

    Full solution

    The sequence 1n\tfrac{1}{n} in (0,1](0, 1] converges to 00, so no subsequence has a limit in the set.

Frequently asked questions

What is an open set?

A set U where every point x has some ε > 0 with (x − ε, x + ε) inside U.

What is a closed set?

A set that contains all its limit points. Equivalently, its complement is open.

Can a set be both open and closed, or neither?

Yes. ℝ and ∅ are both. Intervals like (0, 1] are neither.

What does the Heine–Borel theorem say?

A subset of ℝ is compact if and only if it is closed and bounded.

Why does compactness matter?

A continuous function on a compact set attains a maximum and a minimum there.

What to learn next