# Is it true that a disconnected metric space with infinitely many elements is not compact?

Let $(X,d)$ be a metric space with infinitely many elements. Suppose $X$ is disconnected. Then is it necessarily true that $X$ is not compact?

I come up with this question when I was thinking about the Lebesgue number lemma. If $X$ is disconnected, then there exist disjoint open sets $U$ and $V$ in $X$ such that $X=U\cup V$. For every $x\in U$, there is some open ball $B(x,\epsilon_x)$ such that $x\in B(x,\epsilon_x)\subset U$, and similarly for $V$. Then

$$\{B(x,\epsilon_x)\}_{x\in X}$$ is an open cover of $X$. Intuitively, as $x\in U$ gets closed to the "boundary" of $U$, the ball $B(x,\epsilon_x)$ would become smaller and smaller while still lies in $U$, and one can imagine $\epsilon_x\to0$ as $d(x,V)\to0$. Then I don't think the open cover $\{B(x,\epsilon_x)\}_{x\in X}$ would admit a Lebesgue number, so that $X$ may not be compact. On the other hand, if $X$ is connected, then any open cover $\{U_\lambda\}_{\lambda\in\Lambda}$ must “overlap”, so that if a ball $B(x,\epsilon_x)$ in some $U_\lambda$ becomes small enough, it might fall into another $U_{\lambda’}$.

So my questions are:

1. Can anyone prove the above conjecture?
2. I’m also interested to know some examples of disconnected metric space other than the discrete metric. Can someone provide such examples?
• $$K = \bigl\{ 2^{-n} : n \in \mathbb{N}\bigr\} \cup \{0\} \subset \mathbb{R}$$ is compact, infinite, and totally disconnected. – Daniel Fischer Dec 7 '16 at 13:47
• The Cantor set is another counterexample. – Lee Mosher Dec 7 '16 at 23:15
• $\beta\Bbb N$ is compact and even extremally disconnected: the closure of every open set is open. – Brian M. Scott Dec 7 '16 at 23:54
• the rationals and the irrationals (as subspaces of $\mathbb{R}$) are other non-connected metric spaces of interest. – Henno Brandsma Dec 8 '16 at 4:38

If $X$ is locally connected, then every connected component $C$ of $X$ is open (and closed). For any space $X$, the connected components form a disjoint cover of $X$ (every point is in a component, and two components are disoint, or their union would be striclty larger, contradicting their maximality). Clearly, a disjoint cover has no smaller subcover at all. So if $X$ is locally connected and compact, $X$ can only have finitely many components, as the cover of components is an open cover, so compactness applies to it. So the disconnectedness is "limited" for compact locally connected spaces. So no compact locally connected totally diconnected space exists, except finite discrete spaces.
The answer is no. For example, $\{1/n:n\in \Bbb N\} \cup \{0\}$ is disconnected but compact.
$$[0,1] \cup [2,3]$$ is metric, disconnected and has infinitely many elements.