6. Topology of the Real Line

Compact Sets

Compact Sets on the Real Line

students, imagine trying to pack a travel bag 🧳. If the bag is too small, some items will not fit, no matter how carefully you arrange them. In real analysis, a compact set is a collection of points that behaves like a bag that is “small enough” in a precise mathematical sense. Compact sets are important because they let us prove strong results about continuous functions, limits, and extrema.

In this lesson, you will learn:

  • what compact sets mean in the topology of the real line,
  • how to recognize compact sets on $\mathbb{R}$,
  • why compactness matters for real analysis,
  • and how compact sets connect to open sets, closed sets, and limit points.

By the end, students, you should be able to explain the key ideas, apply the main test for compactness on the real line, and use examples to support your reasoning.

What Does Compact Mean?

In topology, a set is called compact if every open cover of the set has a finite subcover.

That sounds technical, so let’s unpack it step by step.

An open cover of a set $K$ is a collection of open sets whose union contains $K$. In other words, every point of $K$ lies inside at least one open set from the collection.

A finite subcover means we can choose only finitely many of those open sets and still cover all of $K$.

So compactness says: whenever you cover the set with open sets, you can always get the job done using only finitely many of them. This is a very strong property.

Example of the idea

Consider the interval $[0,1]$. You might cover it using infinitely many open intervals, such as

$$

$\left($-$\frac{1}{2}$,$\frac{1}{2}$$\right)$,$\left($-$\frac{1}{4}$,$\frac{3}{4}$$\right)$,$\left($-$\frac{1}{8}$,$\frac{7}{8}$$\right)$,$\dots$

$$

This is an open cover of $[0,1]$. But to verify compactness, we ask whether we can select only finitely many of these intervals and still cover all of $[0,1]$. In this example, yes, because one of the later intervals already covers the whole set. Compactness is about this kind of finite control 👍

Compact Sets on the Real Line

On the real line $\mathbb{R}$, there is a famous and very useful theorem:

A set $K \subseteq \mathbb{R}$ is compact if and only if it is closed and bounded.

This is often called the Heine–Borel Theorem.

Let’s break this down.

Bounded

A set $K$ is bounded if there exists a real number $M > 0$ such that every point $x \in K$ satisfies

$$

$|x| \le M.$

$$

That means the set fits inside some large interval like $[-M,M]$.

For example:

  • $[0,2]$ is bounded,
  • $(0,2)$ is bounded,
  • $\mathbb{R}$ is not bounded.

Closed

A set is closed if it contains all of its limit points.

A limit point of a set is a point where points of the set cluster arbitrarily closely. For example, the point $1$ is a limit point of $(0,1)$, even though $1$ is not in $(0,1)$.

Because $(0,1)$ misses the limit points $0$ and $1$, it is not closed. But $[0,1]$ includes them, so it is closed.

Main takeaway

For subsets of $\mathbb{R}$:

$$

K \text{ is compact } $\iff$ K \text{ is closed and bounded.}

$$

This is one of the most important facts in the topology of the real line.

Why Closed and Bounded Matters

The closed-and-bounded test makes compactness much easier to check in $\mathbb{R}$ than the general open-cover definition.

Example 1: A compact set

The interval $[2,5]$ is closed and bounded. Therefore, it is compact.

This means any open cover of $[2,5]$ has a finite subcover.

For instance, if a family of open intervals covers every point from $2$ to $5$, then finitely many of those intervals already cover the whole interval.

Example 2: Not compact because it is not closed

The interval $(2,5)$ is bounded, but it is not closed because it does not contain the limit points $2$ and $5$.

Therefore, $(2,5)$ is not compact.

Example 3: Not compact because it is not bounded

The set $[0,\infty)$ is closed, but it is not bounded.

So $[0,\infty)$ is not compact.

This shows that both parts are necessary.

Compactness and Limit Points

Compactness is closely related to limit points, which are central in real analysis.

A set in $\mathbb{R}$ is closed if it contains all its limit points, but compactness goes further: it combines closedness with boundedness.

Why is this important? Because a compact set cannot “stretch off to infinity,” and it cannot “leave out” boundary points that sequences or clusters are trying to reach.

Sequence viewpoint

In $\mathbb{R}$, compactness can also be described using sequences. A set $K$ is compact if every sequence in $K$ has a convergent subsequence whose limit lies in $K$.

This is called sequential compactness.

For real analysis, this is extremely useful. Suppose you have a sequence of values in a compact set, like a sequence inside $[0,1]$. Even if the whole sequence does not converge, you can always extract a convergent subsequence that stays inside the set.

Real-world analogy

Think of a group of students standing in a hallway of fixed length 📏. If the hallway is finite and closed at both ends, then students cannot drift off forever. There will always be clusters and accumulation behavior that can be studied carefully. Compactness gives mathematicians a similar kind of control.

A Key Result: Continuous Functions on Compact Sets

One of the most powerful reasons compact sets matter is this theorem:

If $f$ is continuous on a compact set $K \subseteq \mathbb{R}$, then $f$ is bounded and attains both a maximum and a minimum on $K$.

That means there exist points $x_{\min}, x_{\max} \in K$ such that

$$

f(x_{$\min$}) \le f(x) \le f(x_{$\max$}) \quad \text{for all } x $\in$ K.

$$

This is called the Extreme Value Theorem.

Why this matters

In applications, you often want to know the highest or lowest value of a quantity. If the input values live in a compact set and the rule is continuous, then the maximum and minimum are guaranteed to exist.

Example

Let

$$

$f(x)=x^2$

$$

on the compact set $[-1,2]$.

Because $f$ is continuous and $[-1,2]$ is compact, $f$ has a maximum and minimum on that interval.

We can check:

  • the minimum is $f(0)=0$,
  • the maximum is $f(2)=4$.

This is a simple example, but the theorem works for much more complicated continuous functions too.

How to Prove a Set Is Compact on the Real Line

When working in $\mathbb{R}$, the most practical method is to use the Heine–Borel Theorem.

To prove a set $K$ is compact:

  1. show $K$ is bounded,
  2. show $K$ is closed.

Example: A union of intervals

Consider

$$

$K=[-3,-1]\cup[2,4].$

$$

This set is bounded because all its points lie between $-3$ and $4$.

It is closed because it is a union of closed sets, and finite unions of closed sets are closed.

So $K$ is compact.

Example: A set with a missing endpoint

Consider

$$

$K=(0,1]\cup\{3\}.$

$$

This set is bounded, but it is not closed because it does not contain the limit point $0$.

Therefore, $K$ is not compact.

Compact Sets in the Bigger Picture

Compact sets fit into the broader study of topology on $\mathbb{R}$ in a natural way.

  • Open sets help describe neighborhoods and local behavior.
  • Closed sets help control limit points.
  • Compact sets give global control over the whole set.

This is why compactness appears in many major theorems of real analysis.

For example, compactness helps prove:

  • boundedness of continuous functions,
  • existence of maxima and minima,
  • convergence properties of sequences,
  • and many results about uniform behavior.

So compactness is like a bridge between local ideas, such as being near a point, and global ideas, such as controlling an entire set.

Conclusion

students, compact sets are one of the most important ideas in the topology of the real line. The official definition uses open covers, but on $\mathbb{R}$ the Heine–Borel Theorem gives a much easier test: a set is compact exactly when it is closed and bounded.

Compactness matters because it guarantees powerful results, especially for continuous functions. On compact sets, continuous functions are nicely behaved: they are bounded and they attain their maximum and minimum values. Compactness also connects strongly to limit points and sequences, making it a central tool in real analysis.

If you remember one sentence from this lesson, let it be this: in $\mathbb{R}$, compact sets are the sets that are both closed and bounded, and that simple condition unlocks many deep results ✨

Study Notes

  • A set is compact if every open cover has a finite subcover.
  • In $\mathbb{R}$, the Heine–Borel Theorem says:

$$

K \text{ is compact } $\iff$ K \text{ is closed and bounded}.

$$

  • A set is bounded if all its points lie inside some interval $[-M,M]$.
  • A set is closed if it contains all of its limit points.
  • Examples of compact sets in $\mathbb{R}$ include $[0,1]$, $[-3,4]$, and $[-1,0]\cup[2,5]$.
  • Examples of non-compact sets include $(0,1)$, $\mathbb{R}$, and $[0,\infty)$.
  • Compactness is important because continuous functions on compact sets are bounded and attain maximum and minimum values.
  • Compactness connects open sets, closed sets, limit points, and sequences in the topology of the real line.

Practice Quiz

5 questions to test your understanding