Suppose $K\subset Y\subset X$, where $X$ is a metric space. Want to show "$K$ is compact relative to $Y$" implies "$K$ is compact relative to $X$."
My proof: Say $K$ is compact relative to $Y$. Say we have an open cover $\{G_\alpha\}$ of $K$ in $X$. Then, $G_\alpha=X\cap B_\alpha$, where $B_\alpha$ is some open set in $Y$.
Since $K\subset \cup B_\alpha \subset \cup G_\alpha$, $K$ being compact in $Y$ implies $K\subset \cup_{i=1}^{n} B_{\alpha_i}$. So, $K\subset \cup_{i=1}^{n} (X\cap B_{\alpha_i})$. Therefore, $K\subset\cup_{i=1}^{n} G_{\alpha_i}$.
I know this is basics, but I am new to analysis. Could someone verify my proof? If something goes wrong, could you give me a hint on how to correct it? Thanks!
The proof is wrong. It is not true that any open subset $G$ of $X$ can be written as $X\cap B$, where $B$ is an open subset of $Y$. Just take a $G$ such that $G\varsubsetneq Y$.
Take an open cover $(G_\lambda)_{\lambda\in\Lambda}$ of $K$ in $X$. Then $K\subset\bigcup_{\lambda\in\Lambda}G_\lambda$. And, since $K\subset Y$, $K\subset\bigcup_{\lambda\in\Lambda}(G_\lambda\cap Y)$. But $(G_\lambda\cap Y)_{\lambda\in\Lambda}$ is an open cover of $K$ in $Y$. Since $K$ is compact relative to $Y$, there's a finite set $F\subset\Lambda$ such that $K\subset\bigcup_{\lambda\in F}(G_\lambda\cap Y)$. In particular, $K\subset\bigcup_{\lambda\in F}G_\lambda$.