# A compact subset question

If $B$ is a compact subset of a metric space, how do you show that there exist points $x$ and $y$ such that the distance between them is equal to the diameter of $B$. Don’t know how to proceed. Any suggestions will be appreciated.

First show the distance function $d: X \times X \to \mathbb{R}$ is continuous (where $X$ is the space $B$ lives in). Then by definition of the diameter of $B$, there exists sequence $(x_n), (y_n)$ such that $d(x_n, y_n) \to \text{diam}(B)$. Then apply sequential compactness of $B$.

by definition, the diameter $diam$ of $B$ is defined as $diam = \text{sup}_{x,y \in B}d(x,y)$. Now choose a sequence $(a_k,b_k)$ in $B$ converging to $diam$. Using compactness implies that the limit lies in $B$.

B×B is compact. d:B×B -> R is continuous.
d(B×B) = { d(x,y) : (x,y) in B×B } is compact.
Compact sets of reals include a minimum and a maximum value.

The metric $d : X \times X \to \mathbb{R}$ is a continuous function. Its restriction to $B \times B$ is a real continuous funtion defined on a compact set.

Therefore, it attains its minimum $(x_0, y_0) \in B \times B$.

Hence, $$d(x_0, y_0) = \min_{(x,y) \in B\times B} d(x,y) = \operatorname{diam} B$$

• How do you show that d is continuous? – John Mitchell Apr 4 '18 at 3:19
• @JohnMitchell The product space $X \times X$ can be equipped with the metric $d_1((x,y), (x', y'))= d(x,x') + d(y,y')$. For $(x,y), (x',y') \in X \times X$ we have $$|d(x,y) - d(x', y')| \le |d(x,y) - d(x, y')| + |d(x,y') - d(x', y')| \le d(y,y') + d(x,x') = d_1((x,y), (x', y'))$$ so $d$ is uniformly continuous on $X \times X$. – mechanodroid Apr 5 '18 at 19:38