# The Heine-Borel theorem

The Heine-borel theorem states: A set $B$$\subset$$\mathbb{R}^n$ is compact $\Longleftrightarrow$ $B$ is closed and bounded.

In an exercise i need to prove that the $''\Longleftarrow''$ statement is not valid in some metric or topological spaces. My counterexample is this:

Take the metric space $(\mathbb{N},d)$ where $d$ is the discrete metric.

The open sets in this metric space are the sets of the form $B(x,\epsilon)$$= \left\{\begin{matrix} \{x\} & \epsilon < 1\\ X & \epsilon \geqslant 1 \end{matrix}\right. Then \mathbb{N} is bounded because \mathbb{N}$$\subset$ $B(m,2)$
$\forall m\in \mathbb{N}$ and it also closed in the discrete metric space

Now suppose that $\mathbb{N}$ is compact. The collection $C=\{B(m,1/2):m\in\mathbb{N}\}$ is an open cover of $\mathbb{N}$ so by our assumption there must be a finite subcover of $\mathbb{N}$ say $M=$$\{B(m_1,1/2),,,,B(m_j,1/2)\} where \mathbb{N}$$\subseteq$$\bigcup$$M$.

But from this argument and the fact that the elements of $M$ are singletons( from the definition of the open ball in the discrete metric space) we deduce that $\mathbb{N}$ is a finite set which is a contradiction.

Hence $\mathbb{N}$ is not compact.

Is this counterxample valid or am i missing something? If it valid i would appreciate a little help to construct another counterexample.

Pick any non-compact metric space $(X,d)$, e.g., any unbounded metric space like $\Bbb R,\Bbb Q$ and so on. Then, define a new metric $\bar{d}$ on $X$ by $\bar{d}(x,y)=d(x,y)$ if $d(x,y)<1$, $\bar{d}(x,y)=1$ otherwise.
It is a good exercise to show that the topology induced by $\bar{d}$ is the same as that induced by $d$, so that $(X,\bar{d})$ isn't compact.
But now $(X,\bar{d})$ is bounded and closed, which gives a counterexample to Heine-Borel.
It's a good exercise to try to come up with a non-discrete example. It's easier than you may think . . . (HINT: can you find a non-compact but bounded subspace of $\mathbb{R}$? That won't be closed, but what if we view it as a metric space in its own right?)