Distance between compact sets in a metric space. 
Let $K_1$ and $K_2$ be two disjoint compact sets in a metric space $(X,d).$ Show that $$a = \inf_{x_1 \in K_1, x_2 \in K_2} d(x_1, x_2) > 0.$$
  Moreover, show that there are $x \in K_1$ and $y \in K_2$ such that $a = d(x,y)$.

For the first part, suppose to the contrary that $\inf d(x_1, x_2) = 0$. Then $\epsilon$ is not a lower bound, so $d(x_1, x_2) < \epsilon$ for all $\epsilon > 0$. Since $K_1$ and $K_2$ are compact subsets of a metric space, they are closed and bounded. So, then $B(x_1, \epsilon) \cap K_2 \neq \emptyset$. Thus, $x_1$ is an adherent point to $K_2$. Since $K_2$ is closed, this means $x_1 \in K_2$, a contradiction.
I'm stuck on the moreover part. I tried supposing to the contrary that $d(x,y) > a$, but I did not get far. 

By the definition of an infimum, you can find a sequence of pairs $((x_1^n,x_2^n))_{n \ge 1}$ in $K_1 \times K_2$ such that $d(x_1^n,x_2^n) \le a+\frac{1}{n}$ for each $n \ge 1$. Since we are in a metric space, you can use sequential compactness to take subsequences of each sequence and find respective limits $x_1 \in K_1$ and $x_2 \in K_2$. Using the triangle inequality, we have for any $\delta>0$,
$$d(x_1,x_2) \le d(x_1,x_1^n) + d(x_1^n,x_2^n) + d(x_2^n,x_2) \le \delta + a + \frac{1}{n} + \delta,$$
for all sufficiently large $n$. Thus $d(x_1,x_2)=a$.

Proving the "moreover" part allows you to prove the first part of the question immediately, since if $a=0$, then $x_1=x_2 \in K_1 \cap K_2$, a contradiction. By the way, I don't think your proof of the first part is correct.
