This note proves the Heine–Borel theorem: a subset of is compact exactly when it is closed and bounded. It then deduces that a continuous real function on a nonempty compact set attains its maximum and minimum, so that optimization over a closed bounded set, such as the unit sphere in the worked example below, always has a solution.
Fix an integer and the Euclidean norm on . A set is bounded if it lies in some finite-radius ball, closed if its complement is open, and compact if every cover by open subsets of has a finite subcover. We use real completeness, including the nested closed interval property.
Heine–Borel in finite-dimensional Euclidean space
Theorem. A set is compact if and only if it is closed and bounded. The empty set satisfies all three properties.
Compact implies bounded. The open balls , an integer, cover . A finite subcover puts inside the largest of these balls.
Compact implies closed. Suppose and . The balls , , cover . Choose a finite subcover with centers and set . If lies in the ball centered at , the triangle inequality gives . Hence misses , so the complement is open.
Closed and bounded implies compact. Let nonempty be closed and bounded. Enclose it in a closed cube with . Suppose an open cover of has no finite subcover. Divide each coordinate interval into two closed halves. The resulting closed subcubes cover . At least one subcube has intersection with that is not finitely coverable by the given family; otherwise the finite union of the finite subcovers would cover . Select such a subcube and repeat. This produces nested closed cubes with side length and not finitely coverable, hence nonempty.
For each coordinate, the nested interval property gives a common coordinate value. Together these give . Every pair of points in has distance at most , so the intersection contains only . Choose . Then . A closed set contains such a limit: if were in its open complement, a ball around would eventually contain outside , a contradiction. Thus .
One member of the cover contains , and openness gives for some . For sufficiently large , every point of is within of , so alone covers . This contradicts the selection of . Therefore every open cover has a finite subcover. The number is finite; replacing it by infinitely many subpieces would invalidate this argument.
Proof X-ray
Four hypotheses, four separate jobs in the cube proof
Each hypothesis enters the proof of “closed and bounded implies compact” at exactly one place. Boundedness supplies the starting cube ; without it there is nothing to halve. Finiteness of the dimension makes each halving produce only pieces, so that “finitely coverable pieces would give a finitely coverable whole” is a statement about a finite union. Completeness, through nested intervals, produces the point . Closedness puts in , so that some member of the cover contains it. The contradiction then comes from openness of that one member: a ball around inside swallows all sufficiently small cubes , which were chosen precisely because no finite subfamily could cover them.
History of an idea
A covering argument before a covering theorem
The double name records a convention, not priority. MacTutor's biography of Eduard Heine summarizes Pierre Dugac's study of how the theorem emerged. The covering idea was first used implicitly, inside proofs that a continuous function on a closed bounded interval is uniformly continuous. Dirichlet proved that statement in lectures of 1862 (published in 1904) before Heine proved it in 1872, and Dugac shows that Dirichlet used a covering and a finite subcovering more explicitly than Heine did; Weierstrass and Pincherle also used the idea. Borel formulated the theorem for countable coverings in 1895, and Lebesgue and Schönflies extended it to arbitrary coverings, Lebesgue in 1898 (published in 1904) and Schönflies in 1900. Dugac's account adds further names and priority disputes. MacTutor's Borel biography quotes Collingwood's judgment that the name Heine–Borel was attached to Borel's covering theorem "quite inappropriately".
The mathematical shift is what matters for this note. The finite-subcover step began as a device inside one proof about an interval; it was isolated, freed from countability, and became the definition of compactness used above. The cube-halving proof then converts that definition into the familiar test "closed and bounded" in .
Continuous images and extreme values
Theorem. If is compact and is continuous relative to , then is compact. In particular, a continuous on nonempty compact is bounded and attains its maximum and minimum.
Proof. An open cover of pulls back to relatively open sets , with open in . These cover , so finitely many suffice. Their corresponding cover , proving compactness. For scalar , the image is nonempty, closed and bounded by the theorem already proved in dimension one. Let . For each , the definition of supremum supplies with . Then , and closedness places in the image. Thus the maximum is attained. Applying the same argument to gives the minimum. This proves existence, not a formula for the maximizing input.
Worked example: the sphere needed for the real spectral theorem. The sphere is nonempty because it contains , and it is bounded. The reverse triangle inequality proves norm continuity, so is closed as the inverse image of the closed set . Heine–Borel makes it compact. For a real matrix , the polynomial is continuous, so its restriction to the sphere attains both extrema. Symmetry of is not needed for this existence claim; it is needed in the subsequent spectral argument and the gradient formula .
Worked example 12.4.1
(A linear function on a closed diamond)
Let and . The function is continuous, so is closed, by the same inverse-image argument used for the sphere above. It is bounded, since , and nonempty. By Heine–Borel it is compact, and the extreme value theorem guarantees that attains a maximum and a minimum on .
To find them, estimate for :
Equality throughout requires and . Hence the maximum is and the minimum is , and these are the only points of attainment. The theorem told us that a search for the extremes would succeed; the inequality located them.
Worked example 12.4.2
(A non-diagonal quadratic form on the unit circle)
Let and write with . By the sphere example above, attains both extremes on the unit circle. Expanding,
Since , the value lies in . The value requires , which together with gives , so . The value requires , so and .
The extreme values and are the eigenvalues of , and the maximizing and minimizing points are unit eigenvectors: and . This is the pattern the spectral argument exploits once existence on the sphere is known.
Worked example 12.4.3
(A nearest point exists in a closed set)
Let and . The distance function is continuous by the reverse triangle inequality, and is compact, so a nearest point exists. For we have and , hence
with equality only at . The nearest point is and the distance is .
Compactness of the set itself is not essential for this conclusion. If is closed and nonempty but unbounded, pick any and put . Then is closed, bounded and nonempty, hence compact, so the distance attains a minimum on it. Every point of outside that ball is farther than from , so this minimum is the minimum over all of . Heine–Borel is applied to a bounded piece that is certain to contain the answer.
Exercises
P01. Explain why the compactness assertion fails for the open unit ball even though that ball is bounded.
P02. Which step of the cube proof fails if is not closed? Give an example.
P03. For on the unit circle, find the extreme values of and every point where equality holds. Distinguish the existence theorem from the calculation.
Full solutions
P01. The open unit ball is not closed: lies in it for and converges to outside it. A compact set would be closed by the proved necessity, so the ball is not compact. Boundedness alone is insufficient.
P02. The limit of may be outside , at a point , so no member of the cover need contain . Explicitly take , the cover for integers , and the nested closed intervals for integers . These open intervals cover , but any finite collection has a positive smallest left endpoint and therefore fails to cover . The intervals have common point zero, which is outside ; consequently no member of the cover contains . This is exactly where the closed-set proof can fail.
P03. Writing with gives . The minimum is two, attained exactly at , and the maximum is five, attained exactly at . Compactness and continuity guarantee that extrema exist; the displayed identity determines their values and all equality cases.
Further practice
Quick check
(Is compact?)
Check boundedness and closedness separately, using Heine–Borel.
Solution · Answer
is bounded, since it lies in the closed disc of radius . It is not closed: the points belong to for every integer and converge to , which is not in . A compact set is closed, so is not compact.
Quick check
(The continuous function has no maximum on . Which hypothesis of the extreme value theorem fails?)
Decide whether is closed, then test boundedness with a sequence in .
Solution · Answer
is closed, being the inverse image of under the continuous function , and it is nonempty. It is not bounded: and for every positive integer , so is unbounded above on . Boundedness fails, hence compactness fails, and the theorem does not apply.
Quick check
(Show that is compact, and find the maximum of on together with every point where it is attained.)
Compare with the weighted sum in the definition of .
Solution · Answer
is the inverse image of under a continuous polynomial, so it is closed. Since , it lies in the closed ball of radius , so it is bounded; it contains . By Heine–Borel, is compact, and attains a maximum. On , , so , with equality only when . The maximum is , attained only at .