Prove that a compact metric space is complete. I'm reading Intro to Topology by Mendelson.
I'm in the section titled "Compact Metric Spaces".
The problem is in the title.
My attempt at the proof is as follows:
Let $\{a_n\}_{n=1}^\infty$ be a Cauchy sequence in $X$. We will show that $\{a_n\}_{n=1}^\infty$ converges to a point in $X$. Consider the set $S=\{a_n:n\in\mathbb{N}\}$. Then there are two cases to consider, $S$ finite and $S$ infinite. If $S$ is finite then there exists some $N\in\mathbb{N}$ such that $a_n=a$ for some $a\in S$ and so $\{a_n\}_{n=1}^\infty\to a$. Suppose now that $S$ is infinite. Then $S$ has at least one accumulation point in $X$, call it $a$. Thus, the neighborhood $B(a;\frac{1}{n})$ contains a point $a_n\in S$ and $\lim\limits_{n\to\infty} a_n=a$.
My concern with this proof is no where did I use the fact that the sequence was Cauchy, other than supposing it was. I know this is a flaw in my proof since I have to use the hypothesis some where. 
I was also considering looking at the $\text{sup} S$, but I'm not sure how to go about using that fact or whether or not that's the right approach.
Thanks for any help or feedback!
 A: In the cases you handle you only can construct a subsequence of the original sequence that converges to some $a$. In the case where $S$ is finite, so finitely many values $a_n$ occur, we can conclude (pigeon hole principle) that there exists $a \in S$ and infinitely many $n$ (say all $n \in M \subset \mathbb{N}$ that have $a_n = a$. This gives us a constant subsequence (all with value $a$) and thus trivially a convergent subsequence. But not yet convergence of the whole sequence (without using Cauchy).
Also, when $S$ is infinite, it has some limit point $a$, and then again all you can do
at first is construct a subsequence of $a_n$ that converges to $a$: pick $n_1$ such that $d(a_{n_1}, a) < 1$, and having picked $n_1 < n_2 < \ldots < n_k$ such that $d(a_{n_i}, a) < \frac{1}{i}$ for all $i \le k$, we then pick $n_{k+1} > n_k$ such that $d(a_{n_{k+1}}, a) < \frac{1}{k+1}$, which can be done as there infinitely many points of the sequence in any open ball around $a$. And then $a_{n_m} \to a$ as $m \to \infty$.
Now where Cauchy is used is in the lemma: let $a_n$ be a Cauchy sequence in $(X,d)$ and let $a_{n_k}$ be a subsequence that converges to some $a \in X$. Then $a_n$ converges to $a$ as well.
Proof: let $\epsilon>0$. Pick $N \in \mathbb{N}$ such that for all $n,m \ge N$ we have 
$d(a_n, a_m) < \frac{\epsilon}{2}$, by Cauchyness. Also, pick $k$ such that $n_k > N$ and
$d(a_{n_k}, a) < \frac{\epsilon}{2}$, by convergence of the subsequence to $a$.
Now for any $n \ge N$: $d(a_n, a) \le d(a_n, a_{n_k}) + d(a_{n_k}, a) < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon$. So having found $N$ for all $\epsilon>0$, $a_n \to a$ as $n \to \infty$, as required.
A: Any sequence of points in a compact metric space has a convergent subsequence. We know that a sequence that has a convergent subsequence is in fact convergent. So this easily shows us that a compact metric space is complete. 
