I'm in high school and self-studying analysis. I completed this proof for a problem in Rudin, but wanted some verification. Does this look correct?
Proof that every compact metric space $K$ has a countable base and is therefore separable:
Consider $p \in K$ with an arbitrary $\epsilon > 0.$ By the Archemedian Principle, there exists a natural number $n$ such that $\frac{1}{n} < \epsilon.$
Consider the open cover $$K \subset \bigcup_{i \in K} N_{\frac{1}{n}}(i).$$ Since $K$ is compact, there exists a finite subcover $$K \subset \bigcup_{i \in X_n} N_{\frac{1}{n}}(i),$$ where $X_n = \{x_{1_n}, x_{2_n}, x_{3_n}, ... x_{j_n}\} \subset K$ for some $j_n \in \mathbf{N}.$
Since $p \in K$, $p \in N_{\frac{1}{n}}(x_{i_n})$ for some $x_{i_n} \in X_n$.
This means that $d(p, x_{i_n}) \leq \frac{1}{n}$, which also implies that $x_{i_n} \in N_\frac{1}{n}(p) \subset N_{\epsilon}(p),$ so $x_{i_n} \in N_{\epsilon}(p).$
Since $x_{i_n}$ is a member of $X_n$, $N_{\epsilon}(p)$ thus intersects the finite subset $X_n$.
As the choices for $p \in K$ and $\epsilon$ were arbitrary, any neighborhood around every point in $K$ must intersect a countable subset $X$.
By definition of closure of a set, $K \subset$ cl$(X)$. This means that $X$ is dense in $K$ and thus forms a countable base.
Therefore $K$ is separable.