Why compact subsets (of metric spaces) are closed There is a proof of the above statement that I can't fully get my head around. It goes something like this.
Let $Y$ be a subset of a metric space $X$. $Y$ is closed iff $Y^c$ (complement of $Y$) is open (for if $x$ is a limit point of $Y$, every neighbourhood of $x$ contains a point of $Y$ different from $x$, so that $x$ is not an interior point of $Y^c$. Since $Y^c$ is open, ie. it contains all its interior points, if follows that $x\in Y$. It follows that $Y$ is closed.
Now let $p\in X, p\notin Y$ and let $q\in Y$. Let $V_q$ and $W_q$ be $\epsilon$-neighbourhoods (ie. open balls around) of $p$ and $q$, respectively, of radius less than $\frac{1}{2}d(p,q)$ (remember we are in a metric space). Since $Y$ is compact, there are finitely many pointds $q_{1:n}$ in $Y$ such that $Y\subset W_{q_1}\cup W_{q_2}\cup\ldots\cup W_{q_n}=W$.
Let $V=V_{q_1}\cap V_{q_2}\cap\ldots\cap V_{q_n}$ (intersection).
And here is where I am puzzled. Because if we say $V$ is nonempty then we could say $V$ is the neighbourhood of some new $p$ which does not intersect $W$. Hence $V\subset Y^c$, so that $p$ is an interior point of $Y^c$. Since $p$ was not fixed, it follows that $Y^c$ is open.
But: how can we be sure that $V$ is nonempty? Consider $X=\mathbb{R}$ and let $Y$ be the closed interval $[1,6]$. Let's say $q_1=2,p_1=0,q_2=5,p_2=7$. Let $B(x, r)$ denote an open ball centred at $x$ with radius $r$. Then we could have $W_{q_1}=B(2,1)=(1,3)$ (open interval $(1,3)$), $V_{q_1}=B(0,1)=(-1,1)$, $W_{q_2}=B(5,1)=(4,6)$ and $V_{q_2}=B(7,1)=(6,8)$. Off course we will need further $W$s to cover $Y$, but $V_{q_1}\cap V_{q_2}$ is already empty -> frustration! :) What am I missing?
Also, how would the proof fail if $Y=(1,6)$ (the open interval $(1,6)$)?
I've been thinking about it for a few days so any hints would be highly appreciated.
 A: Your mistake is in thinking that $p$ is not fixed: it is fixed. We let $p$ be an arbitrary point of $X\setminus Y$, and for each $q\in Y$ we get disjoint open sets $V_q$ and $W_q$ such that $p\in V_q$ and $q\in W_q$. We then look at the open cover $\{W_q:q\in Y\}$ of $Y$ and extract a finite subcover $\{W_{q_1},\ldots,W_{q_n}\}$. The sets $V_{q_1},\ldots,V_{q_n}$ are all open nbhds of the same point $p$ that we chose initially, so their intersection $V$ is an open nbhd of $p$, and it is certainly disjoint from $Y$. Thus, $p\notin\operatorname{cl}Y$. But $p$ was chosen arbitrarily: it was any point of $X\setminus Y$. The same argument works no matter which point of $X\setminus Y$ we chose, so no point of $X\setminus Y$ is in $\operatorname{cl}Y$, and that means that $Y$ is closed.
A: Here s a proof in another vein:
Let $K$ be a compact subset of a metric space $X$, and assume $p\notin K$. The function
$$f(x):={1\over d(p,x)}\qquad(x\in K)$$
is continuous, hence bounded on the compact set $K$. From $$d(p,x)\geq {1\over M}=:\epsilon\quad(x\in K)$$it follows that the $\epsilon$-neighborhood of $p$ does not intersect $K$. Since $p\notin K$ was arbitrary this proves that $K$ is closed.
