Ring of $p$-adic integers $\mathbb Z_p$

Your displayed equation is wrong. The power series should start with non-negative powers of $p$, i.e. the sum should start at 0 instead of an arbitrary integer $n$.

Intuitively, the two definitions are the same because both say that a $p$-adic integer is a compatible choice of residues modulo higher and higher powers of $p$. First, there are $p$ choices for a residue modulo $p$. Once you have made your choice (which is given by $a_0$ in your second definition), you have $p$ possible choices for the residue modulo $p^2$. There are of course $p^2$ choices for this residue altogether, but only $p$ of those will be compatible with the first choice you have made, i.e. will reduce to $a_0$ modulo $p$. This second choice is given by $a_0+pa_1$ in your second definition. You keep going in this way, fixing a residue modulo $p^3$, $p^4$, etc. Every time, there are only $p$ possible new choices that will be compatible with the ones you have already made. If this was the ordinary integers, your sequence $a_i$ would stabilise at 0 at some point, but in the $p$-adics you are allowed to keep going forever.

To sum it up, the isomorphism between the two rings takes an infinite sequence $\sum_{i=0}^\infty a_ip^i$ and sends it to the inverse system $$\left(\sum_{i=0}^n a_ip^i\in \mathbb{Z}/p^n\mathbb{Z}\right)_n,$$ with $\phi_n$ given by reduction-mod-$p^n$ maps. It is completely trivial (and you should do it, not look it up!) to check that this is indeed a ring isomorphism.


You could try to prove that $\left\{ \sum_{i=0}^\infty a_i p^i \mid a_i \in\{ 0,1,...,p-1 \} \right\}$, together with all the natural maps $\pi_n$ to each of the $\mathbb Z/p^n \mathbb Z$, satisfies the universal property of an inverse limit.

That is, suppose you have any commutative ring $B$ with ring homomorphisms $q_n \colon B \to \mathbb Z/p^n \mathbb Z$ satisfying $\phi_n \circ q_n = q_{n-1}$, show there exists a unique ring homomorphism $\psi \colon B \to \left\{ \sum_{i=0}^\infty a_i p^i \mid a_i \in\{ 0,1,...,p-1 \} \right\}$ with $q_n = \pi_n \circ \psi$.