# Show that $\exists a\in A; b\in B$ such that $d(a,b)=d(A,B)$

Let $A,B$ be two compact subsets of $X$ where $(X,d)$ is a metric space.

1.Show that $\exists a\in A; b\in B$ such that $d(a,b)=d(A,B)$

where $d(A,B)=\sup\{d(a,b):a \in A;b\in B\}$

2.Show that $\exists a\in A$ such that $d(a,B)=d(A,B)$

3.Show that $\exists a,b\in A$ such that $d(a,b)=diam (A)$ where $diam(A)=\sup\{d(a,b):a ,b\in A\}$

I can compute for 2 by considering the function $f:X\to \mathbb R$ by $f(x)=d(x,B)$ and then considering its restriction to the set $A$ which is compact and hence the function $f$ will attain its bounds.So there exists $a\in A$ such that $f(a)=d(A,B)\implies d(a,B)=d(A,B)$

Is this correct?

Similarly I can proceed for $3$

But I can't do it for 1 .Any help on how to consider the continuous function

• To be completely pedantic, you're missing something from your statement. $A,B$ must be nonempty. :) – user223391 May 15 '15 at 6:04

Consider the metric space $(A \times B, D)$, where $D$ is the metric on $A\times B$ defined by $$D((x,y),(a,b)) := d(x,a) + d(y,b)$$

The function $f : (A \times B,D) \to \Bbb R$ given by $f(a,b) = d(a,b)$, for all $(a,b) \in A \times B$, is continuous. For

$$|f(x,y) - f(a,b)| \le D((x,y),(a,b))$$

for all $x,a\in A$ and $y,b\in B$. Since $f$ is a continuous map from a compact metric space, it attains it's supremum, i.e., there exists $(a_0,b_0) \in A \times B$ such that $$f(a_0,b_0) = \sup\{f(a,b): (a,b)\in A \times B\}.$$ That is, $d(a_0,b_0) = d(A,B)$.

• will the problem hold only if $A\times B$ is given this metric ;if I take product metric? – Learnmore May 15 '15 at 7:09
• @learnmore: You could choose a different metric, e.g. $D'((x,y),(a,b)) = \max\{d(x,a),d(y,b)\}$ will do. The point is to use an appropriate metric on $A \times B$ so that $f$ will be continuous (as a map between metric spaces). Then you can invoke the extreme value theorem to finish the proof. – kobe May 15 '15 at 13:17
• the problem is if I use your metric then it becomes easy to show continuity;i cant show continuity for product metric;any help – Learnmore May 15 '15 at 14:37
• is the problem independent of the metric used? – Learnmore May 15 '15 at 14:37
• @learnmore, you're misunderstanding. You do not have to show that $f$ is continuous with respect to any metric. The problem was to show that there exists $a \in A, b\in B$ such that $d(a,b) = d(A,B)$. So certainly this problem depends on the metric $d$. You say that if you use my metric, then it becomes easy to show continuity -- this is why I used this method. – kobe May 15 '15 at 14:43