When discussing compactness, is it necessary to specify the metric space? My textbook has this question. "Show that (0,1] is not compact by finding an open cover with no finite subcover."
It did not explicitly specify the metric space, so I started wondering, what if we aren't working in the reals?  When talking about compactness, is it necessary to specify the metric space that we are working in (as it is when discussing openness of sets), or is the metric space in which the set is embedded irrelevant?
 A: If you think about it a bit more, I think you'll realise that there is no difference between thinking about it as a subset, or a space in its own right.  You seem to be mixing up two definitions of compactness (which nevertheless agree in simple cases), so let me give the answer twice, once for each definition:


*

*$(0,1]$ is not sequentially compact, because the sequence $\{\frac{1}{n}\}_{n \in \mathbb{Z}}$ has no accumulation point in $(0,1]$.

*$(0,1]$ is not compact, because the open cover $\{(\frac 1n,1]\}_{n\in\mathbb{Z}}$ has no finite sub-cover.  Note that these sets are open in $(0,1]$, but not in $\mathbb{R}$.  Nevertheless, they are the intersection of $(0,1]$ with open sets of $\mathbb{R}$; say, $\{(\frac 1n,2)\}$.  This is why there is no difference - the open sets of $(0,1]$ considered as a space in its own right are precisely its intersections with open sets of $\mathbb{R}$.
A: No. Consider for example the open cover of $[0,1)$ given by $A_n=[0,1-\frac{1}{n})$ fr $n\in \mathbb{N}$. It doesn't admit any subcover.
In fact, a subspace of $X$ is compact if, and only if it is compact as a space in the subspace topology (by definition). Thus the Heine-Borel theorem tells you that a subspace $Y$ of $\mathbb{R}^n$ is compact if, and only if it is bounded and closed in $\mathbb{R}$. Also notice that this is not true for general metric spaces.

To answer to the modified post:
It is very important to specify the metric when working in infinite-dimensional spaces. In finite dimensional spaces you can show that any two metrics induce the same topology.
A: Let me be a bit more cautious about your question "is it necessary to specify the metric space?" because there could be an ambiguity here. As you know, a metric space consists of a set $X$ and a metric (or distance) function $d$. So there are (at least) two ways you could change a metric space: One is to replace the set $X$ by a subset $Y$, while leaving the distance function unchanged (or, more precisely, restricting it to the new, smaller set).  That is, your new metric space has, in comparison to the original $X$, lost some points, but the distances between surviving points are unchanged. As the other answers have explained, this change does not affect compactness. In particular, $(0,1]$ is not compact, regardless of whether you consider compactness in $\mathbb R$ or in $(0,1]$ or in $[0,1]$, etc., as long as you don't change the definition of distance between points in $(0,1]$.
But you can also change a metric space by leaving the set $X$ as it is but replacing $d$ by a different distance function.  This sort of change can turn compact spaces into non-compact ones and vice versa.  For example, the set $\{0\}\cup\{1/n:n\text{ a positive integer}\}$ is compact with the usual metric, but if you modify the metric by setting $d(0,1/n)=1+(1/n)$ for every $n$, then you lose compactness.
So the answer to your question "is it necessary to specify the metric space" (in connection with compactness) is that it's not necessary to specify the underlying set of the metric space (as long as it includes the set $Z$ whose compactness you're asking about), but it is necessary to specify the distance function, at least for the points in $Z$.
A: See, even though we have different equivalent definitions in metric spaces for compactness, the definition which is applicable on any topological spaces is that of the existence of finite subcover for any open cover. So it's very important to specify the topological space since we have to consider open covers which require us to know which are the open sets. Also note that we don't need to know the bigger space(as in the above case our space is a sitting inside R). We just need to know the open sets. So in that sense I think compactness is a global property as in the case of completeness/connectedness.
Also it's very important that the very first definition for compactness will be that of 'Compact Topological Spaces' not 'Compact Subsets of a Topo Space'! & that equivalent definition/characterization for subsets of R known as Heine Borel theorem is not applicable to general topological spaces even if it 'looks' like subsets of R!
