See here for definitions.
Kechris, p. 26
(B) Exercise (4.23). Let be metric space with . Show that for nonempty ,
Thus, for all , there exists , such that implies .
That is, .
Let . Now, choose such that implies .
Now, choose a sequence in , such that , in the following way: For ,
, for some . Pick any such that .
Then , so .
Assume . Let . Since
and since is compact, hence closed, .
some such that , and .
Therefore, . Therefore .
Therefore , which is a contradiction.
(i) and (ii) show that .
To show that the converse fails, consider the real numbers with the trivial metric.
Let , which is clearly compact. Then