Prove or counterexample: A closed and totally bounded set $A$ in a metric space must be compact.

I think for some time and now I agree that the statement is false. But I cannot prove or disprove the statement.

I know that compact $\Leftrightarrow$ complete+totally bounded, and also "bounded and totally bounded are the same in $\Bbb R^n$".

So I aim to find a not complete metric space which is closed and totally bounded. Could someone please help? If such an example exists, may I please ask for finding one in $\Bbb R^n$ (or other easy examples are also appreciate).

If the statement is correct, may I please ask for a proof?

• $\Bbb Q \cap [0,1]$ in $\Bbb R$? – BigbearZzz Jul 16 '17 at 13:48
• Should be $\mathbb{Q}\cap[0,1]$ in $\mathbb{Q}$. This set isn't closed in $\mathbb{R}$. – Przemek Jul 16 '17 at 13:58
• More generally, any set $A$ is closed in $A$, so to have a counterexample you only have to consider a set $A$ that is totally bounded but not compact : for example, any closed set in $\mathbb{R}^n$ that is not bounded is a counterexample. – tristan Jul 16 '17 at 14:05
• @Przemek I intended to mean "in the subspace topology wrt $\Bbb R$" but yes, you are right, my wording was bad. – BigbearZzz Jul 16 '17 at 14:21
• @tristan So may I take $(0,1]$ in $((0,1],d_{\Bbb R})$ where $d_{\Bbb R}$ is the standard norm in $\Bbb R$ as a counterexample? I think this set is totally bounded, $(0,1]$ in $((0,1],d_{\Bbb R})$ is closed, but it is not compact. (For instance, the sequence $\frac{1}{n}$ in this space has no convergent sequence.) – PropositionX Jul 16 '17 at 23:38

Here's something you should try to prove:

If $A$ is a closed subset of a complete metric space $(X,d),$ then letting $d'$ be the restriction of $d$ to $A\times A,$ we have that $(A,d')$ is a complete metric space.

It isn't too tricky. Consequently, a closed, totally bounded subset of a complete metric space will be compact, so if you're looking for counterexamples, you shouldn't look in euclidean spaces or other complete metric spaces.

The comments give a nice example of a closed, totally bounded subset of $\Bbb Q$ that does the trick, though.

Statement in your question is correct if you replace "metric space" by "$\mathbb{R}^n$" and this is precisely content of the Heine-Borel theorem.

If you want $Y=\overline Y\subset X$ where $Y$ is totally bounded but not compact, then, as pointed out in the Answer by Cameron Buie, $d$ cannot be a complete metric on $X.$ So in particular we cannot have $X=\mathbb R^n$ with the usual metric.

However we may take $Y=X$ if $d$ is an incomplete metric on $X$ and $(X,d)$ is a totally bounded metric space. For example let $X$ be the real interval $(0,1)$ with $d(u,v)=|u-v|.$