Why are closed balls in the $p$-adic topology compact? I was skimming through some of this paper Measurable Dynamics and Simple $p$-adic Polynomials out of curiosity. 
A few pages in, the author claims that closed balls are both open and compact sets in the $p$-adic topology on $\mathbb{Q}_p$. I have not been able to verify this, and would like to understand it before proceeding further. 
For clarity, let a closed ball $B(x,r)=\{y\in\mathbb{Q}_p:|x-y|_p\leq p^{-r}\}$. Then why is $B(x,r)$ both open and compact in the $p$-adic topology?
I have been able to show that since $\mathbb{Q}_p$ has a non-Archimedian absolute value, then any point inside the ball can be taken to be the center, and from that, that any two closed balls $B(x,r)$ and $B(y,s)$  are either disjoint or one is contained in the other.
Thanks!
 A: It's probably easiest to show sequential compactness... that every sequence of points ion the ball has a convergent subsequence (This is equivalent to compactness for metric spaces).
This can be done very much as you would show using decimal expansions that every sequence of real numbers between 0 and 1 has a convergent subsequence, using Cantor diagonalization for example.
A: It’s sufficient to look at balls centred at $0$. It’s easiest to see if you represent the $p$-adic rationals in the form $$x = \sum_{k\ge k_0}x_kp^k,$$ where the $x_k$ are the $p$-adic digits of $x$, so that $$B(0,r) = \left\{\sum_{k\ge r} x_kp^k:\forall k\bigg(x_k\in\{0,1,\dots,p-1\}\bigg)\right\}.$$
Now let $D = \{0,1,\dots,p-1\}$, and give $D$ the discrete topology; I claim that $B(0,r)$, as a subspace of $\mathbb{Q}_p$, is homeomorphic to the product space $D^\omega$, which is of course compact. (In fact it’s a Cantor set.) The homeomorphism is the obvious one: $$h:D^\omega\to B(0,r):\langle x_k:k\in\omega\rangle\mapsto \sum_{k\ge r}x_{k-r}p^k.$$
Clearly $h$ is a bijection: $$h^{-1}:B(0,r)\to D^\omega:x=\sum_{k\ge r}x_kp^k\mapsto \langle x_{k+r}:k\in\omega\rangle\;.$$
$B(0,r)$ has a base of clopen sets of the form $B(x,s)$, where $x\in B(0,r)$ and $s\ge r$. Fix such a $B(x,s)$, with $x=\sum_{k\ge r}x_kp^k$. If $y=\sum_{k\ge r}y_kp^k\in B(0,r)$, then $|x-y|_p = p^{-m}$, where $m=\min\{k\ge r:x_k\ne y_k\}$, so $y \in B(x,s)$ iff $m\ge s$. In other words, $$B(x,s) = \bigg\{y\in B(0,r):\min\{k\ge r:y_k\ne x_k\}\ge s\bigg\},$$ and therefore $$h^{-1}[B(x,s)] = \bigg\{\langle y_{k+r}:k\in\omega\rangle:(\forall k<s-r) \big[y_{k+r}=x_{k+r}\big]\bigg\},$$ which is a basic open set in the product $D^\omega$. Thus, $h$ is a continuous bijection. The sets of the form $h^{-1}[B(x,s)]$ are a base for $D^\omega$, so the same calculation shows that $h^{-1}$ is continuous and hence that $h$ is a homeomorphism.
