# $U\cap K$ is compact in the subspace topology

If $$X,\tau$$ is a topological space and K is a closed subspace. If $$U$$ is a compact set of $$X,\tau$$ then $$U\cap K$$ is compact.

Attempted proof:

Since $$U$$ is compact there is a finite sub covering such that $$U\subset \bigcup_\limits{i=1}^{n}B_i$$ $$B_i\in \tau\forall 1\leqslant i\leqslant n$$

$$U\cap K\subset (\bigcup_\limits{i=1}^{n}B_i)\cap K=\bigcup_\limits{i=1}^{n}(B_i\cap K)$$

$$B_i\cap K$$ is open for the subspace topology for all $$i$$.

Hence $$\bigcup_\limits{i=1}^{n}(B_i\cap K)$$ is a finite sub covering of $$U\cap K$$ proving $$U\cap K$$ to be compact in the subspace topology.

Question:

Is my proof right? If not how should I correct it?

Let $$(O_\lambda)_{\lambda\in\Lambda}$$ be an open cover of $$U\cap K$$. Add to this cover the set $$U\cap K^\complement$$ (which is an open subset of $$U$$). Then you have an open cover of $$U$$. Since $$U$$ is compact, it has a finite subcover. The elements of this finite subcover which are distinct from $$U\cap K^\complement$$ form a finite subcover of $$U\cap K$$.