Nuances of the “compact set is closed” proof smart guys!
I am studying Mathematical Analysis by Rudin and got stuck with the proof “compact set is closed”. The particular thing that puzzles me is:
There is an intersection of a finite number of neighborhoods of q within 1/2d(p,q). I do not get why this intersection exists, or to put it differently, cannot be a null set, why it should necessarily contain elements. Or it does not distort the logic of the proof in general?
Thanks for any help in advance.
 A: I believe that this is a theorem where using the metric is more confusing than helpful.
The key point is that a metric space is Hausdorff. Suppose $C$ is a compact subset of the Hausdorff topological space $X$ and suppose $x\notin C$.
For each $y\in C$, choose an open set $U_y$ and an open set $V_x$ such that

*

*$y\in U_y$;

*$x\in V_y$;

*$U_y\cap V_y$.

This is guaranteed by the Hausdorff hypothesis.
Then $(U_y)_{y\in C}$ is an open cover of $C$ and therefore we have
$$
C\subseteq \bigcup_{k=1}^n U_{y_k}
$$
for some $y_1,y_2,\dots,y_n\in C$. Then
$$
V=\bigcap_{k=1}^n V_{y_k}
$$
is an open neighborhood of $x$ and $V\cap C=\emptyset$. Therefore $x\notin\bar{C}$ and so $C$ is closed.
What's the path with metric spaces? Our $U_y$ will be of the form $B(y,r_y)$ (open ball centered at $y$, with radius $r_y$) and $V_y=B(x,r_y)$, where you can take $r_y=d(x,y)/2$. By the triangle inequality, $B(y,r_y)\cap B(x,r_y)=\emptyset$.
One can choose the finite set $\{y_1,y_2,\dots,y_n\}$ as before and the point is that
$$
\bigcap_{k=1}^n B(x,r_{y_k})
$$
is not necessarily an open ball centered at $x$, but it surely contains one, for instance $B(x,r)$, where $r=\min\{r_{y_1},r_{y_2},\dots,r_{y_n}\}$. Then, as before, $B(x,r)\cap C=\emptyset$.
A: If $U_1, \dots, U_n$ are neighborhoods of $q$, there exists $r_1, \dots, r_n >0$ such that for all $k$ we have $B(q,r_k) \subset U_k$. Therefore,
$$
\bigcap_{k=1}^n B(q,r_k) \subset \bigcap_{k=1}^n U_k
$$
but $\bigcap_{k=1}^n B(q,r_k) = B(q,r)$ where $r = \displaystyle \min_{1 \leq k\leq n} r_k > 0$
so $\bigcap_{k=1}^n U_k$ is a neighborhood of $q$.
Does that answer your question?
A: Rudin is taking it for granted that $U_{q_i}= B_{r_i}(p) = \{x\in X| d(p,x)< r_i\}$ are neighborhoods centered at $p$[1] then any finite intersection $U_{q_1} \cap U_{q_2} \cap ... \cap U_{q_n}= B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)$ will itself be a neighborhood centered at $p$ with a radius equal to the least radius of $\{r_1,..., r_n\}$.  That is $ B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)=B_{\min r_i}(p)$ and that $B_{\min r_i}(p)$ is not empty because it contains $p$.
It's easy to prove this claim.
If $\{r_1,....,r_n\}$ are a finite set of strictly positive values then there exist some least element, call it $\min r$.
If $x \in B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)$ then $x \in B_{r_i}(p)$ for all $r_i$ and in particular $x \in B_{\min r}(p)$ so $B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)\subset B_{\min r}(p)$.
And if $x\in B_{\min r}(p)$ then $d(x,p)< \min r \le r_i$ for all $r_i$ so $x\in B_{r_i}(p)$ for all $B_{r_i}(p)$ so $x \in B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)$.  So $B_{\min r}(p) \subset B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)$.
So $B_{r_1}(p) \cap B_{r_2} (p)\cap .....\cap B_{r_n} (p)= B_{\min r}(p)$.
[1]Rudin defines "neighborhood" as an "open ball" with a center point $p$ and a radius $r_i$ and so the "neighborhood" at $p$ with radius, $r$, is $\{x\in X|d(x,p) < r\}$.
======
Rudin's actual proof is subtle.
Let $K$ be a compact set.  He proves $K$ is closed be proving $K^c$ is open.
He lets $p \not \in K$.
Now for any $q\in K$ then $d(q,p) > 0$ and we can find a radius $r_q < \frac 12d(q,p)$ and let $W_q = B_{r_q}(q)$.  If we do this for all $q\in K$ then $q \in W_q$ and so $K \subset \cup_{q\in K} W_q$.  So $\{W_q|q\in K\}$ is an open cover of $K$.
$K$ is compact so it has a finite subcover $W_{q_1},W_{q_2}...., W_{q_n}$ and $K \subset \cup W_{q_i} = W$.
For these finite number of points $q_i$ we can find $U_{q_i}$ that are neighborhoods of $p$ with radius $r_{q_i} < \frac 12 d(q_i, p)$.
Then the intersection of the $U_{q_i}$ is $B_{\min r_{q_i}} (p)$.  If $y\in K \subset W=\subset W_{q_i}$ then $y \in W_{q_j}$ for some $W_{q_j}$ sp $d(q_j,y) < r_j < \frac 12 d(q_j,p)$
But then $d(q_j,y) + d(y,p) \ge d(q_j, p)$ so $d(y,p) \ge d(q_j,p)-d(q_j,y) \ge d(q_j,p)-d(q_j,p)=\frac 12d(d_j,p) > r_j \ge \min r_{q_i}$.
So $y \not \in B_{\min r_{q_i}}(p)$ for any $y \in K$
Co $B_{\min r_{q_i}}(p) \subset K^c$.
So $K^c$ is open.
So $K$ is closed.
=====
