MAT257Y1/Unit 2
Unit 2 · Analysis II

Compactness

The single most useful property a set can have. Its definition — every open cover has a finite subcover — looks strange until you see what it does: it turns infinitely many local statements into one global statement. Nearly every existence theorem this year runs through it.

By the end you can
Why it matters & where it comes from
Why it exists

Local information is easy to get and hard to use. Compactness is the hypothesis that lets you take a property holding near every point and conclude it holds uniformly on the whole set. Uniform continuity, attainment of maxima, and partitions of unity are all this move.

In the real world

Optimisation over a compact feasible region is guaranteed to have a solution, which is why constraints matter as much as objectives. Numerical methods converge on compact domains and can wander off on non-compact ones. Existence of equilibria in economics is a fixed point theorem on a compact convex set.

Story & open questions

Heine and Borel's theorem was assembled between 1872 and 1895, and the modern open-cover definition took until Alexandroff and Urysohn in 1929. That slow arrival is a hint: it is not the obvious definition, it is the one that turned out to work. In infinite dimensions closed and bounded stops implying compact, which reshapes all of functional analysis.

The definition

Definition

An open cover of $K\subseteq\mathbb{R}^n$ is a family $\{U_\alpha\}$ of open sets with $K\subseteq\bigcup_\alpha U_\alpha$. The set $K$ is compact if every open cover of $K$ has a finite subcover: finitely many $U_{\alpha_1},\dots,U_{\alpha_m}$ already cover $K$.

Example Why $(0,1)$ fails
Cover $(0,1)$ by $U_n=\left(\tfrac1n,1\right)$ for $n\ge2$. Every point of $(0,1)$ is in some $U_n$, so this is an open cover.
Any finite subfamily has a largest $n$, and then $U_n=\left(\tfrac1n,1\right)$ misses everything in $\left(0,\tfrac1n\right]$. No finite subcover exists, so $(0,1)$ is not compact.
The obstruction is the missing endpoint $0$: the set is bounded but not closed.
Example Why $\mathbb{R}$ fails

Cover $\mathbb{R}$ by $(-n,n)$ for $n\in\mathbb{N}$. A finite subfamily has a largest $n$ and misses everything beyond. Here the obstruction is unboundedness.

The definition is about all covers, not one. To prove compactness you must handle an arbitrary cover, which is why direct proofs are hard and Heine–Borel is worth so much. To disprove it you need only exhibit one bad cover, as above.

Heine–Borel

Theorem Compact implies closed and bounded

This direction holds in any metric space.

Bounded: cover $K$ by the balls $B_m(0)$ for $m\in\mathbb{N}$. A finite subcover has a largest $m$, so $K\subseteq B_m(0)$.
Closed: let $x\notin K$. For each $y\in K$ take disjoint balls around $y$ and $x$, of radius $\|x-y\|/2$. These balls about the $y$ cover $K$; a finite subcover has finitely many companion balls about $x$, and their intersection is a ball about $x$ missing $K$. So the complement is open. ∎
Theorem Heine–Borel

In $\mathbb{R}^n$, a set is compact if and only if it is closed and bounded.

Proof Bisection on a box
First take $K=[a,b]$ a closed interval, and suppose an open cover $\mathcal{U}$ has no finite subcover. Bisect: at least one half also has no finite subcover. Repeat, getting nested intervals $I_k$ of length $(b-a)/2^k$, none finitely coverable.
By nested intervals there is a point $x$ in every $I_k$. Some $U\in\mathcal{U}$ contains $x$, and since $U$ is open it contains a ball about $x$ — which contains $I_k$ once $2^{-k}(b-a)$ is small enough. So $I_k$ is covered by the single set $U$, contradicting that it had no finite subcover.
For a closed box in $\mathbb{R}^n$ the same bisection works with $2^n$ sub-boxes at each stage. For a general closed bounded $K$, put it inside a box $B$; given a cover of $K$, add the open set $\mathbb{R}^n\setminus K$ to get a cover of $B$, extract a finite subcover, and discard that extra set. ∎
This is special to finite dimensions

In an infinite-dimensional normed space the closed unit ball is closed and bounded but never compact. The sequence of standard basis vectors satisfies $\|e_i-e_j\|=\sqrt2$ for $i\ne j$, so it has no convergent subsequence. Heine–Borel is a theorem about $\mathbb{R}^n$, not a tautology.

Sequential compactness

Definition

$K$ is sequentially compact if every sequence in $K$ has a subsequence converging to a point of $K$.

Theorem The two agree in $\mathbb{R}^n$

For $K\subseteq\mathbb{R}^n$, compact and sequentially compact are equivalent. Both are equivalent to closed and bounded.

Closed and bounded ⇒ sequentially compact: boundedness gives a convergent subsequence by Bolzano–Weierstrass applied one coordinate at a time; closedness keeps the limit in $K$.
Sequentially compact ⇒ closed and bounded: if unbounded, pick $x_k$ with $\|x_k\|>k$, which has no convergent subsequence. If not closed, take a sequence converging to a limit outside $K$; every subsequence has the same limit. ∎
Theorem Closed subsets of compact sets

If $K$ is compact and $F\subseteq K$ is closed, then $F$ is compact.

Given an open cover of $F$, add $\mathbb{R}^n\setminus F$ to obtain an open cover of $K$. Extract a finite subcover and drop the added set; what remains still covers $F$.

Example Compactness is intrinsic

$[0,1]$ is compact whether viewed inside $\mathbb{R}$ or inside $\mathbb{R}^2$ as a segment. Open and closed are relative to an ambient space; compactness is not, because a cover by relatively open sets can always be traded for one by ambient open sets.

Common pitfalls

• Proving compactness by exhibiting one cover with a finite subcover. The definition quantifies over all covers.
• Quoting "closed and bounded implies compact" outside $\mathbb{R}^n$. It is exactly what fails in infinite dimensions.
• Forgetting that continuous images are compact but preimages need not be. $\sin$ maps the non-compact $\mathbb{R}$ into the compact $[-1,1]$.
• Assuming an infinite intersection of compact sets could be empty. A nested family of nonempty compact sets always has a common point.

Practice

Original problems written for this guide in the style of Spivak and Munkres exercises. Write a full solution before opening the answer.

Practice 1 · Classify

Is $\{(x,y):x^2+y^2\le1,\ y>0\}$ compact?

Answer
No. It is bounded but not closed: points on the segment $y=0$, $|x|<1$ are limit points not in the set.
Practice 2 · Bad cover

Exhibit an open cover of $[0,1)$ with no finite subcover.

Answer
$U_n=\left(-1,1-\tfrac1n \right)$ for $n\ge2$. Any finite subfamily has a largest $n$ and misses $\left[1-\tfrac1n,1\right)$.
Practice 3 · Finite sets

Prove every finite set is compact.

Solution
Given a cover, choose one member containing each of the finitely many points. That is a finite subcover. No topology needed.
Practice 4 · Union and intersection

Are finite unions and arbitrary intersections of compact sets compact?

Solution
Both yes in $\mathbb{R}^n$. A finite union of closed bounded sets is closed and bounded. An arbitrary intersection of compact sets is closed, and contained in any one of them, hence bounded.
Practice 5 · Nested compacts

If $K_1\supseteq K_2\supseteq\cdots$ are nonempty compact sets, show $\bigcap_kK_k\ne\emptyset$.

Solution
Pick $x_k\in K_k$. All lie in $K_1$, so a subsequence converges to some $x\in K_1$. For each $m$, the tail from index $m$ lies in the closed set $K_m$, so $x\in K_m$. Hence $x$ is in every $K_m$.
Practice 6 · Distance is attained

For compact $K$ and a point $p\notin K$, show there is a nearest point of $K$ to $p$.

Solution
$x\mapsto\|x-p\|$ is continuous on $K$, and a continuous real function on a compact set attains its minimum (Unit 3). The minimiser is a nearest point; it need not be unique.
Practice 7 · Not compact in a function space

Show the closed unit ball of the space of bounded sequences is not compact.

Solution
The standard basis vectors $e_i$ all have norm $1$ and satisfy $\|e_i-e_j\|=1$ for $i\ne j$ in the sup norm. No subsequence is Cauchy, so none converges — the ball is closed and bounded but not sequentially compact.
Practice 8 · Compactness of a graph

If $f:[0,1]\to\mathbb{R}$ is continuous, is its graph compact in $\mathbb{R}^2$?

Solution
Yes. The graph is the image of the compact $[0,1]$ under the continuous map $x\mapsto(x,f(x))$, and continuous images of compact sets are compact (Unit 3).

Expanded topic checklist

Course coverage. This unit is part of the complete MAT257Y1 topic map. It should cover the following items before you move on:

Textbook/source alignment

Use the current UofT MAT257Y1 calendar topics as the coverage spine, and pair lecture notes with Spivak's Calculus on Manifolds or Munkres' Analysis on Manifolds. The exact assigned textbook should still be checked against the instructor syllabus.

Core theorem map

Compact gives closed and bounded always; the converse is Heine–Borel and needs $\mathbb{R}^n$. Sequential compactness is the equivalent form that is easiest to apply. Unit 3 spends the whole page cashing these in.

Study routine. When a proof needs "finitely many", look for a compactness hypothesis — that is almost always where the finiteness is coming from.

Deep practice extensions

Use these after the main practice set. They are designed to force definition-level reasoning, theorem selection, and mixed application rather than routine calculation only.

Extension 1 · The definition

State compactness in terms of covers.

Guide
Every collection of open sets whose union contains the set has a finite subcollection whose union still contains it.
Extension 2 · Which direction is general

Which half of Heine–Borel holds in any metric space?

Guide
Compact implies closed and bounded. The converse is what needs $\mathbb{R}^n$.
Extension 3 · Standard counterexample

Name a closed bounded set that is not compact.

Guide
The closed unit ball of any infinite-dimensional normed space, for instance bounded sequences under the sup norm.
Extension 4 · Why bisection works

What makes the bisection proof terminate?

Guide
The nested intervals shrink to a point, and that point sits inside some open set of the cover, which then swallows an entire late-stage interval — contradicting that no finite subfamily covered it.