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
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:
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$.