# The diameter of a compact set.

Let $(X,d)$ be a metric space and define the diameter of a set $A$ as follows:

$\operatorname{diam}A$ = $\sup\{d(x,y)\mathrel|x,y\in A \}$ if this quantity exists.

Show that if $A$ is compact, then there are $a_1,a_2 \in A$ such that $\operatorname{diam}A = d(a_1,a_2)$.

-
It's customary to take the supremum in the definition of the diameter in the non-negative extended real numbers. That way the diameter always exists. –  kahen Oct 7 '12 at 22:23

Approach №1. Consider continuous function $$d: A\times A\to\mathbb{R}: (a_1,a_2)\mapsto d(a_1,a_2)$$ defined on compact $A\times A$. Recall that each continuous function defined on compact attains its maximum.

Approach №2. Let $D=\mathrm{diam} (A)=\sup\{d(x,y):x,y\in A\}$, then from definition of $\sup$ it follows that there exist a sequence $\{(x_n,y_n):n\in\mathbb{N}\}\subset A\times A$, such that $D=\lim_{n\to\infty}d(x_n,y_n)$. Since $A\times A$ is compact we have convergent subsequence $\{(x_{n_k},y_{n_k}):k\in\mathbb{N}\}$ which converges to some $(a_1,a_2)\in A\times A$. Then we get $$\mathrm{diam}(A)=D=\lim\limits_{n\to\infty}d(x_n,y_n)=\lim\limits_{k\to\infty}d(x_{n_k},y_{n_k})=d\left(\lim\limits_{k\to\infty}x_{n_k},\lim\limits_{k\to\infty}y_{n_k}\right)=d(a_1,a_2)$$

-
Your second approach is again using continuity of $d$. –  Andres Caicedo Oct 7 '12 at 22:45
I think continuity of $d$ is not a thing one should argue. –  Norbert Oct 7 '12 at 22:48
1. $A$ is compact, therefore bounded, so $\operatorname{diam} A$ must exist. (Why can't $d(x, y)$ be arbitrarily large if $A$ is bounded?)
2. There is a sequence $x_n \in A$ and a sequence $y_n \in A$ such that $d(x_n, y_n) \to \operatorname{diam} A$. Explanation: If we assume that there are actually $x$ and $y$ with $\operatorname{diam} A = d(x, y)$ then this is obvious - take constant sequences. Otherwise, this follows from the definition of a supremum (fill in the details).
3. Since $A$ is compact, $x_n$ has a convergent subsequence. So does $y_n$.