# Direct proof of compactness of $\mathbb{Z}_p$

Let $\mathbb{Z}_{p}$ be completion of $\mathbb{Z}$ with respect to $p-$norms. Actually I know that $\mathbb{Z}_{p}$ is bijective to Cantor set, which is compact, therefore by homeomorphism, it is also compact.

However, Is there any direct proof of the compactness of $\mathbb{Z}_{p}$? What I mean "direct" proof here is that we can only use definition of compactness, i.e., every open cover has finite subcover.

What I tried to do to show compactness is that, if $\cup_{i}^{\infty}O_{i}$ is open cover, then it contain $\cup_{x \in \mathbb{Z}_p} B_{r_x}(x)$ for each $r_{x}>0$. Now I want to pick some balls using totally boundedness, but I don't know how to expand this argument.

If for some $k\in\mathbb N$ each of the finitely many $p^{-k}$-balls allows a finite subcover, we can join these together to onbtain a finite subcover of the whole space. So assume that for each $k$ there exists a ball $B_{p^{-k}}(x_k)$ that does not allow a finite subcover. By this very condition, we may choose $x_{k+1}$ so that it is in $B_{p^{-k}}(x_k)$. Then the sequencce $(x_k)_{k=1}^\infty$ is Cauchy, hence has a limit $x$, which is in each $B_{p^{-k}}(x_k)$. Pick $i$ with $x\in O_i$. Then $O_i$ contains a ball $B_{p^{-k}}(x)$ and hence also $B_{p^{-k}}(x_k)$, so this ball does allow a finte subcover - contradiction!
Here's a direct proof of the sequential compactness of $\mathbb{Z}_p$, i.e. that every sequence in $\mathbb{Z}_p$ has a convergent subsequence. Suppose $(x_n)$ is a sequence in $\mathbb{Z}_p$. Recall that each $x \in \mathbb{Z}_p$ has a unique representation as $$x = a_0 + a_1 p + a_2 p^2 + \cdots$$ with $a_i \in \{0,1, \ldots, p-1\}$. I will refer to $a_i$ as the $p^i$ coefficient. Since the sequence has infinitely many terms, there must be a value $b_0 \in \{0,1, \ldots, p-1\}$ that is the $1$-coefficient of infinitely many terms of the sequence, i.e. $x_n \equiv b_0 \pmod{p}$ for infinitely many $n$. Choose any such $n_0$ and let $x_{n_0}$ be the first term in our subsequence. Now the set $S_0 := \{n \in \mathbb{N} : x_n \equiv b_0 \pmod{p}\}$ is infinite by construction, so there must be a value $b_1 \in \{0,1, \ldots, p-1\}$ that is the $p$-coefficient of infinitely many $x_n$ with $n \in S_0$, i.e. $x_n \equiv b_0 + b_1 p \mod{p^2}$ for infinitely many $n \in S_0$. Choose any such $n_1$ and let $x_{n_1}$ be the next term in our subsequence.
You can repeat the above procedure to recursively define a subsequence $(x_{n_i})$ that converges to $x := \sum_{n =0}^\infty b_n p^n$ since $|x_{n_i} - x|_p \leq \frac{1}{p^{i+1}}$ for each $i$.