Closed but not compact in a metric space

real-analysissolution-verification

Below is an exercise in the set of lecture notes I'm working through, but I believe it to be false. First, this is the definition of compact I'm working with.

A metric space $X$ is said to be compact if every sequence $\{x_n\}$ of points in $X$ has a convergent subsequence.

The exercise is then:

Let $X$ be compact, and let $V \subset X$ be a subset. Show that $V$ is compact if and only if it is closed.

I believe this result is false, but my counterexample doesn't use the above definition. In $\mathbb{R}^n$, compactness is equivalent to closed and bounded (by the Heine-Borel theorem). So take $\mathbb{R}$ with the Euclidean metric. Then $[0, \infty)$ is closed, but not bounded (above) and therefore not compact.

Have I done something wrong, or is this above result not true?

Best Answer

Note that your exercise is imposing the condition that the ambient space ($X$, or $\mathbb{R}$ in your example) is compact. As $\mathbb{R}$ is not compact, your example is not a counterexample for the exercise.