Prove that in a metric space a compact subset is closed and bounded. If you cannot do it for a general metric space do it for \(\mathbb R^n\).
Solution
Let \((X,d)\) be a metric space and let \(K\subseteq X\) be compact.
1. The set \(K\) is bounded.
If \(K=\varnothing\), it is bounded trivially. Assume \(K\ne\varnothing\) and choose \(x_0\in X\). The family \[ \{B(x_0,n):n\in\mathbb N,\ n\ge1\} \] is an open cover of \(K\), since every distance \(d(x_0,x)\) is a finite real number. By compactness, finitely many of these balls cover \(K\). If \(N\) is the largest radius among that finite collection, then the balls are nested and \[ K\subseteq B(x_0,N). \] Hence \(K\) is bounded.
2. Fix \(x\in X\setminus K\).For every \(y\in K\), there are disjoint open neighborhoods \(U_y\) of \(y\) and \(V_y\) of \(x\).
Since \(x\ne y\), \[ r_y=\frac13d(x,y)>0. \] Set \[ U_y=B(y,r_y), \qquad V_y=B(x,r_y). \] If \(z\in U_y\cap V_y\), the triangle inequality would give \[ d(x,y) \le d(x,z)+d(z,y) <2r_y =\frac23d(x,y), \] a contradiction. Thus \[ U_y\cap V_y=\varnothing. \]
3. The point \(x\) has an open neighborhood disjoint from \(K\).
The sets \[ \{U_y:y\in K\} \] form an open cover of \(K\). By compactness, choose \[ y_1,\ldots,y_m\in K \] such that \[ K\subseteq U_{y_1}\cup\cdots\cup U_{y_m}. \] Set \[ V=V_{y_1}\cap\cdots\cap V_{y_m}. \] This is an open neighborhood of \(x\).
2. Therefore\[ V\cap K=\varnothing. \]
4. The set \(K\) is closed.
By 3, every point of \[ X\setminus K \] has an open neighborhood contained in \(X\setminus K\). Hence \(X\setminus K\) is open, so \(K\) is closed.
5. Therefore every compact subset of a metric space is closed and bounded.
Boundedness is 1 and closedness is 4.