# Every closed subspace of a compact space is compact.. Why closed?

I'm reading proofs about a closed subspace of a compact space being compact, but in my mind I think i can prove it for far more than only closed subspaces. For example, $X$ being compact, then for every open cover of $X$ I can find a finite cover for $X$. Since the elements of this finite cover are opens in $X$, let's name them $U_{\alpha}$, when I take the intersection $U_{\alpha}\cap Y$, I have a finite cover for $Y$ made of open sets... Hmmm, so, what if I just do like this:

Suppose $A$ an open cover for $Y$, then for each $A_{\alpha}$, take $U_\alpha$ such that $A_\alpha\cap U_\alpha$ is open in $X$. I now must construct an open cover for $X$ with these things.. Hmmm, I think that in the case where $Y$ is closed, I can just make the union with the complementar, but in the other cases I'm not sure if the union of those things is gona give the entire $X$. Is this the reason why I must suppose a closed $Y$?

• If a (Hausdorff) set is not closed then it can't be compact (take a sequence not converging in the set, and draw countably many small opens balls around its elements) – reuns Nov 16 '16 at 18:25
• @user1952009: That’s true in Hausdorff spaces but not in general. – Brian M. Scott Nov 16 '16 at 18:26
• The answer to your last question is yes. If $Y$ is not closed, you may not be able to find an open cover of $X$ whose trace on $Y$ is the one with which you started. As an example, let $X=[0,1]$ and $Y=(0,1)$. Let $U_n=\left(\frac1n,1\right)$ for $n\in\Bbb Z^+$. Then $\{U_n:n\in\Bbb Z^+\}$ is an open cover of $Y$, but there is no way to find open $V_n$ in $[0,1]$ such that $V_n\cap Y=U_n$ for each $n\in\Bbb Z^+$ and $\{V_n:n\in\Bbb Z^+\}$ covers $X$. – Brian M. Scott Nov 16 '16 at 18:28

A counterexample is easy: $(-1,1)$ is not compact, because the open cover by the intervals $(-1 + 1/n,1 - 1/n)$ (for integer $n>0$) has no finite subcover; however $[-1,1]$ is compact.
Where is your attempt wrong? You have to start with an open cover for $Y$, not for $X$. Not every open cover for $Y$ is necessarily obtained by considering $U_\alpha\cap Y$, where the sets $U_\alpha$ form an open cover for $X$.
On the other hand, if $Y$ is closed in $X$, an open cover for $Y$ is always of that type, because you can consider $X\setminus Y$, which is open in $X$.