While looking up information on compact operators I came across these two conflicting posts.
- If a set is compact then it is closed
- Topology: Example of a compact set but its closure not compact
So the first link says that if a set $U$ is compact then it is closed. $U$ closed means $U = \overline{U}$ and hence $\overline{U}$ is compact. This seems to be in direct contradiction with the second post?
This is not a contradiction, because the main property is:
Indeed, we show that for every $x \in X \setminus K$, there is an open set $U$ such that $x \in U \subset X \setminus K$. Fix such an $x$.
As $X$ is Hausdorff ($T2$), for every $y \in K$, there are disjoint open sets $U_y,V_y$ such that $x \in U_y$ and $y \in V_y$. Now you can use the compactness of $K \subset \bigcup_{y \in K} V_y$, so that $$K \subset \bigcup_{y \in E} V_y$$ for some finite subset $E \subset K$.
Define $U = \bigcap_{y \in E} U_y$, which is an open set because $E$ is finite. You can finally show that $U$ satisfies the desired conditions. I leave it to!