# Let $E \subseteq \mathbb{R}^n$ be compact. Let $D = sup\{d(x, y) : x, y ∈ E\}$. Prove that there exists $x_0, y_0$ in $E$ such that $d(x_0, y_0) = D$.

Let $E$ be a compact subset of $\mathbb{R}^n$. Let $D = sup\{d(x, y) : x, y ∈ E\}$ (the diameter of $E$). Prove that there exists $x_0$ and $y_0$ in $E$ such that $d(x_0, y_0) = D$.

My first thought whenever I see compact is either to suppose that there is a finite subcover for an open cover or to notice that every sequence in $E$ has a convergent subsequence to a value in $E$. In this case, I think that the convergent subsequence makes more sense.

I want to say that there is a sequence $\{x_n\}_{n \in \mathbb{N}} \subseteq E$ such that it has a convergent subsequence to $x_0$ and that then $x_0 \in E$ but I'm not sure that is valid.

**Edit: In $\mathbb{R}^n$, compact sets are always closed and bounded. Thus, I believe that I can just use the fact that $E$ is closed to prove that these $x_0,y_0 \in E$. I'm just not sure how to word that.

The function $$d:E\times E\to \Bbb{R}, (x,y)\to d(x,y)$$ is continuous. Since $E$ is compact we have that $E\times E$ is compact. So $d$ must achieve its maximum.

I just solved this problem without using any deeper knowledge in topology. I guess you saw this problem from Prof. Ross's book, "Elementary Analysis: The Theory of Calculus", 2nd Edition.

Here's the proof, but somehow I feel there's a pitfall about the $S(x)$ without reason. So if anyone could help making it more strict I would very appreciate. I think the procedure of the proof is somehow obscure. so please I'll explain the "idea" behind that following proof here. The idea is, we decomposite the set $D$ as a union of sets in which one point $x \in E$ is fixed, and the other point $y$ is taken from $E$. We try to prove that at least one of these sets having the same supremum as the $\sup D$, then we can build a sequence of points $(x_n) \in E$ so that $(x_n)$ converges to a point $x_0 \in \mathbb{R}^n$. Since $E$ is compact, it's closed and bounded and contains every limit of the convergent sequence whose elements are in $E$, then we are done.

Notation:

$d(x,y)$ means the distance function.

$(s_n)$ means a sequence.

Proof:

If $D$ is a finite set, it's trivial that there exists $x,y \in E$ such that $d(x,y) = \sup D = \max D$. Let's consider the condition where $D$ is an infinite set. From the definition of $D$ we can tell that

$D = \cup_{x \in E} S(x)$

where $S(x)$ is a "function" of $x \in E$, defined as:

$S(x) = \{d(x,y): y \in E\}$

Since $S(x) \subseteq D$ for all $x \in E$, $\sup S(x) \leq \sup D$ and there is at least one $x_0 \in E$ such that $\sup S(x_0) = \sup D$. [1]

If that $S(x_0)$ is finite, because $x_0 \in E$, $\sup S(x_0) = \max S(x_0) = \sup D$ and $S(x_0) = \{ d(x_0, y) : y \in E \}$, we have $x_0, y \in E$ such that $d(x_0,y) = \sup D$.

If $S(x_0)$ is infinite, then $S(x_0)$ is bounded, because $\inf S_0 \geq 0$ and $\sup S_0 = \sup D$. Hence, there exists a monotonic sequence $(d_n)$ converging to $\sup S_0 = \sup D$. [2]

Let $(p_n)$ be a sequence that $(p_n \in E : d(x_0, p_n) = d_n)$. As $d_n$ converges to $\sup S_0 = \sup D$, $(p_n)$ converges to a point $p_0$. [3] Since $(p_n) \in E$, $E$ is compact (so it's closed), then $E$ contains all limts of the sequences whose elements are in $E$. Therefore, we proved that there exists $x_0, p_0 \in E$ such that $d(x_0, p_0) = \sup D$.

Some Details

[1] Otherwise, for every $x \in E$, $\sup \{d(x,y) : y\in E\} \neq \sup{D}$ and $D = \{d(x,y) : x,y \in E \}$ we reach a contradiction.

[2] See Prof. Ross's book, Page 72 Bolzano-Weierstrass Theorem and Theorem 10.2.

[3] Since $(d_n)$ converges to $\sup D$, for any $\sigma > 0$, there exists a $N$ such that $n > N \implies |d_n - \sup D| < \sigma$, i.e. $\sup D - \sigma < d_n < \sup D + \sigma$. Because $d_n = d(p_n, x_0)$, and only $x_0, p_n \in S(x_0)$, there is a $p_0 \in \mathbb{R}^n$ such that $d(x_0, p_0) = \sup D$ and $d(x_0, p_n) + d(p_n,p_0) = d(x_0, p_0)$. Then, because $d(p_n,p_0) = d(x_0, p_0) - d(x_0, p_n) = \sup D - d_n$, so for any $\sigma_1 > 0$, there exists $N_1 \in \mathbb{N}$ such that $n > N_1 \implies |\sup D - d_n| = |d(p_n,p_0)| = d(p_n,p_0) < \sigma_1$, hence $(p_n)$ converges to $p_0$.