If a set is compact, then it must be closed. Let S be a subset of \mathbb{R}^n. Observe first the following: if a is a
limit point of S, then any finite collection C of open sets, such that each open set U\in C is disjoint from some
neighborhood V_U of a, fails to be a cover of S. Indeed, the intersection of the finite family of sets V_U is a neighborhood W of a in \mathbb{R}^n. Since a is a limit point of S, W must contain a point x in S. This x\in S is not covered by the family C, because every U in C is disjoint from V_U and hence disjoint from W, which contains x. If S is compact but not closed, then it has a limit point a\not\in S. Consider a collection C' consisting of an open neighborhood N(x) for each x\in S, chosen small enough to not intersect some neighborhood V_x of a. Then C' is an open cover of S, but any finite subcollection of C' has the form of C discussed previously, and thus cannot be an open subcover of S. This contradicts the compactness of S. Hence, every limit point of S is in S, so S is closed. The proof above applies with almost no change to showing that any compact subset S of a
Hausdorff topological space X is closed in X.
If a set is compact, then it is bounded. Let S be a compact set in \mathbb{R}^n, and U_x a ball of radius 1 centered at x\in\mathbb{R}^n. Then the set of all such balls centered at x\in S is clearly an open cover of S, since \cup_{x\in S} U_x contains all of S. Since S is compact, take a finite subcover of this cover. This subcover is the finite union of balls of radius 1. Consider all pairs of centers of these (finitely many) balls (of radius 1) and let M be the maximum of the distances between them. Then if C_p and C_q are the centers (respectively) of unit balls containing arbitrary p,q\in S, the
triangle inequality says: d(p, q)\le d(p, C_p) + d(C_p, C_q) + d(C_q, q)\le 1 + M + 1 = M + 2. So the diameter of S is bounded by M+2.
Lemma: A closed subset of a compact set is compact. Let K be a closed subset of a compact set T in \mathbb{R}^n and let C_K be an open cover of K. Then U=\mathbb{R}^n\setminus K is an open set and C_T = C_K \cup \{U\} is an open cover of T. Since T is compact, then C_T has a finite subcover C_T', that also covers the smaller set K. Since U does not contain any point of K, the set K is already covered by C_K' = C_T' \setminus \{U\} , that is a finite subcollection of the original collection C_K. It is thus possible to extract from any open cover C_K of K a finite subcover.
If a set is closed and bounded, then it is compact. If a set S in \mathbb{R}^n is bounded, then it can be enclosed within an n-box T_0 = [-a, a]^n where a>0. By the lemma above, it is enough to show that T_0 is compact. Assume, by way of contradiction, that T_0 is not compact. Then there exists an infinite open cover C of T_0 that does not admit any finite subcover. Through bisection of each of the sides of T_0, the box T_0 can be broken up into 2^n sub n-boxes, each of which has diameter equal to half the diameter of T_0. Then at least one of the 2^n sections of T_0 must require an infinite subcover of C, otherwise C itself would have a finite subcover, by uniting together the finite covers of the sections. Call this section T_1. Likewise, the sides of T_1 can be bisected, yielding 2^n sections of T_1, at least one of which must require an infinite subcover of C. Continuing in like manner yields a decreasing sequence of nested n-boxes: T_0 \supset T_1 \supset T_2 \supset \ldots \supset T_k \supset \ldots where the side length of T_k is (2a)/2^k, which tends to 0 as k tends to infinity. Let us define a sequence (x_k) such that each x_k is in T_k. This sequence is
Cauchy, so it must converge to some limit L. Since each T_k is closed, and for each k the sequence (x_k) is eventually always inside T_k, we see that L\in T_k for each k. Since C covers T_0, then it has some member U\in C such that L\in U. Since U is open, there is an n-ball B(L)\subseteq U. For large enough k, one has T_k\subseteq B(L)\subseteq U, but then the infinite number of members of C needed to cover T_k can be replaced by just one: U, a contradiction. Thus, T_0 is compact. Since S is closed and a subset of the compact set T_0, then S is also compact (see the lemma above). == Generalization of the Heine–Borel theorem ==