# Closed subset of compact set

Consider the following statement: Any closed subset of a compact set is compact. A standard way to prove this statement goes like this:

Suppose $$K$$ is a compact set in the metric space $$E$$. Let $$S\subseteq K$$ be any closed set. Let $$(U_i)_{i\in I}$$ be any open cover of $$S$$. Then $$(U_i)_{i\in I}$$ and $$S^c$$ forms an open cover of $$K$$. It has a finite subcover since $$K$$ is compact. Then $$S$$ can be covered by finitely many $$U_i$$s.

I'm a bit confused by the proof. In particular I don't know if "closed" and "open" in the proof are relative to $$K$$ or $$E$$. I assume that the statement is saying that the subset $$S$$ is closed relative to $$K$$. Then $$S^c$$ is open relative to $$K$$. It's not necessarily open in $$E$$. Why can we conclude that $$(U_i)_{i\in I} \cup \{S^c\}$$ is an open cover of $$K$$?

Another question would be is compactness a relative concept (That is, if $$S\subseteq K$$ is compact in the entire metric space $$E$$, is it compact in the subspace $$K$$)?

There are a few equivalent definitions to a subset $$K\subseteq E$$ being compact:
$$1$$. If $$K=\bigcup\limits_{i\in I}U_i$$ where $$U_i$$ are open subsets of $$K$$ then this cover must have a finite subcover.
$$2$$. If $$K\subseteq\bigcup\limits_{i\in I}U_i$$ where $$U_i$$ are open subsets of $$E$$ then this cover must have a finite subcover.
The proof that these two conditions are equivalent is straightforward from the definitions, you should try to prove it. In particular, the first condition shows that $$K$$ being compact depends only on the topology on $$K$$ as a subspace of $$E$$. Now, if $$S\subseteq K$$ then the topologies on $$S$$ induced from $$E$$ and from $$K$$ are the same, and so $$S$$ being compact in $$K$$ is equivalent to $$S$$ being compact in $$E$$. (and both are simply equivalent to $$S$$ being compact as a topological space) That answers your second question.
As for the first question, note that in a metric space, compact subsets are closed. So $$K$$ is closed in $$E$$, and therefore, $$S\subseteq K$$ is closed in $$K$$ if and only if it is closed in $$E$$. So you can choose how to think of $$S$$. The important thing is just to be consistent when you continue the proof. If you think of $$S$$ as being closed in $$E$$ then you should take the $$U_i$$ as open subsets of $$E$$, and the complement $$S^c$$ is also with respect to $$E$$. If that is your choice then here you work with the second definition that I gave for compactness.