Prove compact subsets of metric spaces are closed
Note, this question is more of analyzing an incorrect proof of mine rather than supplying a correct proof.
My Attempted Proof
Suppose $X$ is a metric space. Let $A \subset X$ be a compact subset of $X$ and let $\{V_{\alpha}\}$ be an open cover of $A$. Then there are finitely many indices $\alpha_{i}$ such that $A \subset V_{\alpha_{1}} \cup \ ... \ \cup V_{\alpha_{n}}$.
Now let $x$ be a limit point of $A$. Assume $x \not\in A$. If $x \not\in A$ put $\delta = \inf \ \{\ d(x, y) \ | \ y \in A\}$. Take $\epsilon = \frac{\delta}{2}$, then $B_d(x, \epsilon) \cap A = \emptyset$ so that a neighbourhood of $x$ does not intersect $A$ asserting that $x$ cannot be a limit point of $A$, hence $x \in A$ so that $A$ is closed. $\square$.
Now there must be something critically wrong in my proof, as I don't even use the condition that $A$ is compact anywhere in the contradiction that I establish. The above proof would assert that every subset of a metric space is closed.
I think my error must be in the following argument : $\delta = \inf \ \{\ d(x, y) \ | \ y \in A\}$. For if we take $X = \mathbb{R}$ and $A = (0, 1) \subset \mathbb{R}$, then $\delta = 0$ if $x = 1$ or $x = 0$.
Am I correct in analyzing this aspect of my proof?