Proving if $|a|_p=1$ then $a$ is invertible in $\mathbb{Z}_p$ I decided to take a look $p$-adic integers. I am trying to show that
$$a \in \mathbb{Z}_p \text{ is invertible if and only if } |a|_p=1$$
where
$$|x|_p= \left\{
  \begin{array}{ll}
   p^{-n} & \mbox{if } x\neq0 \\
   0 & \mbox{if } x=0
  \end{array}
 \right.$$
where $n=\min\{ m \geq 0 : x_n\neq0\}$ and 
$$x=x_0+x_1p+x_2p^2+\cdots.$$
The "forward" direction is very easy. I am having trouble going backwards. What I have been trying to do is construct the inverse of $a$ and tentatively I am calling the inverse of $a$ as $b=b_0+b_1p+\cdots.$ I have that $b_0=a_0^{-1}$, obviously, and as $|a|_p=1$ it follows $a_0\neq0$ so it has an inverse modulo $p$, which was needed. My goal is to show:
$$\text{For all $m\geq0,$ } 1=\left[\left(\sum_{i=0}^m a_ip^i\right)\left(\sum_{i=0}^m b_ip^i\right)\right]     \mod{p^{m+1}} \qquad \text{(1)}$$
I am doing this on my own and have been having some trouble formulating (to me at least) good sounding ways to express what I need to prove, in terms of lemmas and things to establish $(1)$.
Roughly, I have been trying to show: $Lemma$. Given $b_0,b_1,\cdots,b_k \in \{0,1,\cdots,(p-1)\}$ which satisfy
$$1=\left[\left(\sum_{i=0}^k a_ip^i\right)\left(\sum_{i=0}^k b_ip^i\right)\right]     \mod{p^{k+1}} \qquad\text{(2)}$$
I can find a $b_{k+1}$ which makes the following statement true:
$$1=\left[\left(\sum_{i=0}^{k+1} a_ip^i\right)\left(\sum_{i=0}^{k+1} b_ip^i\right)\right]     \mod{p^{k+2}}\qquad\text{(3)}$$
This is what I have been working with and finding a $b_1$ was not difficult, I chose $b_1 \in \{0,1,\cdots,(p-1)\}$ with $b_1 \equiv -a_1a_0^{-2}\mod p$, which I found to be equivalent to kind of case of $k=0$ for the Lemma. I was trying to do this by induction but I've found kind of a mess and there is a statement I need to be true that I am guessing it not generally true, namely that $g\equiv1\mod p^k$ means $g\equiv1\mod p^{k+1}$, at least that would help me out. I don't think this is true at all in general as there is the counterexample of $126\equiv1\mod 5^3$ but $126\equiv 126\not\equiv 1 \mod 5^4$. Maybe there are more conditions that need to be put on this $g$. Anyways, is there another way I can go about doing this?
Sorry for the long typing, it may or may not help to give an idea of what I am trying to do etc..Thank you
 A: It's not necessary to compute the actual digits of the inverse, only to show it exists. Your method of argument though becomes important when dealing with Hensel's lemma in the near future.
Since $p\nmid x$ it's clear that $x$ is invertible mod $p^k$ for each $k\ge0$. Let $a_k$ be a sequence of integers which are inverses for $x$ mod $p^k$. Can you show $(a_k)$ is a Cauchy sequence? This implies that it converges to some $a\in{\bf Z}_p$, and you can subsequently show that $ax=1$ in ${\bf Z}_p$. Hints:


*

*$|x|_p=1\implies |a_n-a_m|_p=|a_nx-a_mx|_p$

*$a_nx\equiv 1\equiv a_mx$ mod $p^n$ when $n\le m$

*$ax\equiv a_kx\equiv 1$ mod $p^k$


If you want, you can show that $a_n\equiv a_m\bmod p^n$ when $n\le m$; this shows that the "digits" of $a_n$ are only being added to; the "initial segments" of digits are never altered.
I am assuming you have constructed ${\bf Z}_p$ as the inverse limit of ${\bf Z}/p^n{\bf Z}$, or as ${\bf Z}[T]/(T-p)$, both routes quickly yielding permission for unique $p$-adic expansions of all $p$-adic integers and continuous ring quotient maps ${\bf Z}_p\to{\bf Z}/p^k{\bf Z}$ for all $k\ge0$.
Since ${\bf Z}_p$ is an integral domain, it has a fraction field, denoted ${\bf Q}_p$. It can be seen that the relation $|a/b|_p=|a|_p/|b|_p$ allows the $p$-adic valuation to be extended to all of ${\bf Q}_p$. From there we may show that ${\bf Q}_p\cong{\bf Z}_p[p^{-1}]$ so all $p$-adic numbers have $p$-adic expansions. Alternatively, we could have defined ${\bf Q}_p$ to be the metric completion of $\bf Q$ with respect to the $p$-adic metric.
If we have ${\bf Q}_p$ available as a valued field, the proof is much quicker: $|x|_p=1$ implies $|x^{-1}|_p=1$ implies $x^{-1}\in{\bf Z}_p$ implies $x$ is invertible in ${\bf Z}_p$.
A: It seems to me that you can construct the inverse of
$$x=x_0+x_1p+x_2p^2+\cdots$$
by using the usual method of (multiplicatively) inverting a power series, where the algebra is carried out mod $p$. In the book "Tables of Integrals, Series, and Products" by Gradshteyn and Ryzhik (1980 Academic Press), there is a formula for division of one power series by another which, when specialized to the numerator being simply $1$, gives the reciprocal of a series $\sum_{k=0}^{\infty} a_kx^k$ as $(1/a_0)\sum_{k=0}^\infty c_kx^k$ where for $n>0$
$$c_n+\frac{1}{a_0}\sum_{k=1}^nc_{n-k}a_k.$$
(I'm pretty sure $c_0=1$ in this, though that wasn't stated in the reference.)
This allows successive determination of the coefficients of the inverse. 
There is an interesting explicit formula for $c_n$ which (in this case where the numerator series is $1$) gives the value of $c_n$ in terms of a multiple of a band matrix. Let $M$ denote the $n \times n$ band matrix having 0's above the superdiagonal, and the numbers $a_0,a_1,\cdots a_n$ as band constants for respectively the superdiagonal, the main diagonal, the subdiagonal, etc. until the last term $a_n$ appears in the lower left of $M$ (a diagonal of length 1). Then the formula is
$$c_n=\frac{(-1)^n}{a_0^n}|M|,$$where the bars on $M$ mean determinant.
Since this expression seems to hold for inverting formal polynomials over any field, it should work in the $p$ adic case. [Of course your $x_k$ are here the $a_k$ and your $p^k$ become the $x^k$ in the series inversion formula.]
NOTE: I now agree with a comment by user1 that this method doesn't work well to give the inverse. For one thing there is the matter of carrying in the p adics, so that even using the integer $|M|$ in a given digit would involve spilling it over to the next higher sequence of powers of $p$; one would start at the low end for this and it would be tedious. The presence of negative signs may also be a problem. Finally the division by $a_0^n$ would entail getting that reciprocal as a p adic and multiplying through.
For these reasons I'll likely delete this answer, unless someone thinks it can be rescued somehow.
Another comment by anon gives exactly what is happening here. The above method does give a representation of the inverse, but not the canonical one in which the digits are in $\{0,1,...,p-1\}$. What the power series inverse gives, after the variable is replaced by $p$, is a series whose coefficients are ordinary (integer) fractions, which does represent an inverse but is very inconvenient to put into the canonical form.
