Rationals are repeating p-adics

I’ve been amusing myself with {p}-adic arithmetic lately: I’ve never really got to know it until now.

We are all familiar with the fact that every {q\in\mathbf{Q}} gets represented in {\mathbf{R}} as a repeating decimal, or whatever your favourite base is. (Here I count terminating decimals as decimals which eventually repeat {000...}.) The converse is of course true as well: repeating decimals are rationals.

Is this true in {\mathbf{Q}_p} as well? That is, are the rationals precisely those {p}-adics which are eventually repeating (in the other direction, of course)? One direction, that repeating {p}-adics are rational, is pretty obvious: if {a\in p^{-t}\mathbf{Z}} and {b\in\mathbf{Z}} then

\displaystyle  a + b p^r + b p^{r+s} + b p^{r+2s} + \cdots = a + b \frac{p^r}{1 - p^s}

is rational. What about the converse?

The converse seems trickier. How again did we do it in {\mathbf{R}}? I don’t even remember: it’s one of those things that we know so fundamentally (until very recently, {\mathbf{Q}} was almost defined in my brain as the reals which eventually repeat) that we forget how to prove it.

Who cares how to prove it? It is true, and it says, in base {p}, that if {q\in\mathbf{Q}} then there exists {a\in p^{-t}\mathbf{Z}} and {b\in\mathbf{Z}} such that

\displaystyle  q = a + b p^r + b p^{r-s} + b p^{r-2s} + \cdots = a + b \frac{p^r}{1 - p^{-s}}.

But hey, this implies that

\displaystyle  q = a - b \frac{p^{r+s}}{1 - p^s},

which we already know is a repeating {p}-adic.

Inducing a Haar measure from a quotient

Suppose that {G} is a locally compact group and that {H} is a closed subgroup with an {H}-left-invariant regular Borel measure {\mu_H} such that {G/H} possesses a {G}-left-invariant regular Borel measure {\mu_{G/H}}. For instance, {G = \mathbf{R}}, {H=\mathbf{Z}}, and {G/H= S^1}. The following is how you then induce a Haar measure on {G}. (Technically, it’s easier to construct Haar measure on compact groups, so this extends that construction slightly.)

For {f\in C_c(G)}, define {T_H(f) : G\rightarrow \mathbf{C}} by

\displaystyle  T_H(f)(x) = \int_H f(xh) d\mu_H.

Let {K=\text{supp}f}. Then {f(xh)}, as a function of {h} is supported on {x^{-1} K}, so the above integral is finite. Moreover, if {x,y\in U} and {U} is compact, then

\displaystyle  |T_H(f)(x) - T_H(f)(y)| = \left| \int_H (f(xh)-f(yh))d\mu_H\right| \leq \mu_H(H\cap U^{-1} K) \sup_h |f(xh)-f(yh)|.

Because a continuous function on a compact set is uniformly continuous (in the sense that there exists a neighbourhood {V} of {e} such that {gh^{-1} \in V} implies {|f(g)-f(h)| <\epsilon}), {T_H(f)} is continous. Since {T_H(f)} is {H}-right-invariant, {T_H(f)} descends to a continuous function {\hat{T}_H(f)} defined on {G/H}. Moreover, if {q} is the quotient map {G\rightarrow G/H}, then {\hat{T}_H(f)} is supported on {q(K)}, so {\hat{T}_H:C_c(G)\rightarrow C_c(G/H)}. Finally, define {\lambda: C_c(G)\rightarrow \mathbf{C}} by

\displaystyle  \lambda(f) = \int_{G/H} \hat{T}_H(f) d\mu_{G/H}.

This linear functional {\lambda} is positive (in the sense that {f\geq0} implies {\lambda(f)\geq0}), so the Riesz representation theorem guarantees the existence of a regular Borel measure {\mu_G} on {G} such that

\displaystyle  \lambda(f) = \int_G f d\mu_G

for all {f\in C_c(G)}. It is now a simple matter to check that {\mu_G} is {G}-left-invariant.