What is my misconception in this proof that a compact set is closed in a general metric space? I have found online a pdf file Compactness in Metric Spaces  that explains why a compact set is closed and bounded.One problem that I am facing however is that when the writer of the document proves that a compact set is closed I cannot understand how he reaches to his conclusion that is highlighted in the image below: What I mean is that I cannot understand why since we proved that $d(x_i,y)>\epsilon$ we conclude that $y$ does not belong in the open ball of radius $\epsilon_{x_i}$ about $x_i$. If $\epsilon =\max(\epsilon_{x_1},\epsilon_{x_2},...,\epsilon{x_n})$ it would seem reasonable to me but now it makes to me no sense.Can somebody explain to me what I have misunderstood or rephrase what the writer means? Thanks in advance.
 A: It is false: take $M = \mathbb{R}$, $K = \{0\}$ and $z = 1$. Then $\epsilon_0 =1$ and $\epsilon = \frac{1}{2}$. Take $y = \frac{3}{4}$. Then $y \in B_{\epsilon}(z)$ and $y \in B_{\epsilon_0}(0)$.
You can't take $\epsilon = \max(\epsilon_{x_1},...,\epsilon_{x_n})$, because take $M = \mathbb{R}$, $K=[-\frac{1}{2},\frac{1}{2}]$ and $x = 0$ and $z = 1$. Then $\frac{1}{2} \in B_{\epsilon}(z)\cap K$.
Take $\epsilon_{x} = \frac{1}{2}d(x,z)$ and $\epsilon = \min(\epsilon_{x_i})$. If $y \in B_{\epsilon}(z)\cap K$ then $d(x_i,y) < \epsilon_{x_i}$ for some $x_i$ and $d(y,z)< \epsilon$. Thus $2\epsilon_{x_i} = d(x_i,z) \leq d(x_i,y)+d(y,z) < \epsilon_{x_i} + \epsilon \leq 2\epsilon_{x_i}$, a contradiction.
A: You're right to complain. He needs the min to get the estimate $d(x_i,y)>\epsilon$ but then, as you said, the max to deduce that $d(x_i,y)>\epsilon_i$. I think this proof is not going to work.
The more standard proof is one step more complicated but simpler (because in this particular case, I believe we do not need to mess with the factors of $1/2$). For each $x\in K$, choose $\epsilon_x>0$ so that $B(x,\epsilon_x)\cap B(z,\epsilon_x) = \emptyset$. Take a finite set $x_1,\dots,x_n$ as in the proof so that $\{B(x_i,\epsilon_{x_i}): i=1,\dots,n\}$ covers $K$. Now take $\epsilon=\min(\epsilon_{x_1},\dots,\epsilon_{x_n})$ and let $V=B(z,\epsilon)$. The claim is that $V\subset G$. Namely, if $y\in V$ and $y\in K$, then $y\in B(x_i,\epsilon_{x_i})$ for some $i$, so
$y\in B(x_i,\epsilon_{x_i}) \cap B(z,\epsilon)$ and yet $B(x_i,\epsilon_{x_i}) \cap B(z,\epsilon)\subset B(x_i,\epsilon_{x_i}) \cap B(z,\epsilon_{x_i}) = \emptyset$.
EDIT: Just to add a small remark, this is really identical to @psl2Z's fix. My construction is of course taking $\epsilon_x\le d(x,z)/2$. I just thought of constructing $B(z,\epsilon)$ by intersecting the $B(z,\epsilon_{x_i})$. This sort of proof appears in more advanced point-set topology proofs later on.
