I have encountered the ring of $p$-adic integers $\mathbb{Z}_p$ defined purely algebraically as the inverse limit of the rings $\mathbb{Z}/p^k\mathbb{Z}$ for $k\geq1$, and am curious to see if there is a neat way to show that this is a principal ideal domain using a purely algebraic argument i.e. without showing that the inverse limit is equivalent to the topological definition via completions.
I have managed to show from the inverse limit definition that $\mathbb{Z}_p$ is an integral domain, and must classify the ideals to show that they are all principal. So I must show that the only non-zero ideals are $(p^k)$ for $k\geq 0$.
If we let $J$ be an ideal in $\mathbb{Z}_p$ and $A=\{k\geq0:p^k\in J\}$, then clearly $A$ is either empty or $\mathbb{Z}_{\geq n}$ for some $n\geq 0$. It seems like it will be necessary to show that each non-zero $a\in\mathbb{Z}_p$ has the form $p^ku$ for unique $k\geq0$ and $u\in\mathbb{Z}_p^\times$. I have shown that the units are those 'sequences' $(a_k+p^k\mathbb{Z})$ where the first term is non-zero and have found an expression of the form $a=p^m(b_k+p^k\mathbb{Z})$ but I can't quite make $(b_k)$ satisfy $b_k-b_l\in p^k\mathbb{Z}$ for $k\leq l$.
Is there a neat way to prove that $\mathbb{Z}_p$ is a PID using the inverse limit definition?
First, let us note the following theorem:
Proof: Identify $a$ with a sequence $(a_0 \in \mathbb{Z} / (p^0), a_1 \in \mathbb{Z} / (p^1), a_2 \in \mathbb{Z} / (p^2), \ldots)$.
How can we figure out which $k$ to use? Let us note that if $p^k$ is a factor of $a$, then we can conclude from $p^k_k = 0$ that $a_k = 0$. And if $a = u p^k$ with $u$ a unit, then $a$ is a factor of $p^k$; thus, we can conclude from $p^k_j \neq 0$ that $a_j \neq 0$ for all $j > k$. Therefore, we should be looking for the largest $k$ such that $a_k = 0$.
Indeed, take the largest $k$ such that $a_k = 0$. I claim that we can write $a = u p^k$ for some $u \in \mathbb{Z}_p$.
How can we find such a $u$? Let us suppose such a $u$ exists, and then examine its properties. In particular, what can we say about $u_j$?
We first write $u_{j + k} = \pi_{j + k}(m)$, and $a_{j + k} = \pi_{j + k}(n)$. Note that since $a_k = 0$, we must have $n \equiv 0 \mod p^k$; therefore, write $n = r p^k$.
Now we have $u_{j + k} p^k = a_{j + k}$. So in particular, we have $m p^k = r p^k \mod p^{k + j}$. Equivalently, we have $m = r \mod p^j$. That is, $u_j = \pi_j(m) = \pi_j(r)$. So if such a $u$ exists, we know exactly how to compute it.
I now claim that for all $j$, there exists a unique $u_j \in \mathbb{Z} / (p^j)$ such that there is some $r \in \mathbb{Z}$ where $u_j = \pi_j(r)$ and $a_{j + k} = \pi_{j + k}(r p^k)$. We have already shown that we can find some $r \in \mathbb{Z}$ such that $a_{j + k} = \pi_{j + k}(r p^k)$ and write $u_j = \pi_j(r)$; existence is thus satisfied. Suppose we could find some $r'$ such that $\pi_{j + k} (r' p^k) = a_{j + k}$. Then we would have $\pi_{j + k}(r' p^k) = \pi_{j + k}(r p^k)$; that is, $r' p^k \equiv r p^k \mod p^{j + k}$; that is, $r' \equiv r \mod p^j$; that is, $\pi_j(r) = \pi_j(r')$.
So we have shown that our choices of $u_j$ are all well-defined. We must now show that $u \in \mathbb{Z}_p$.
To do this, consider an arbitrary $j$, and write $u_{j + 1} = \pi_{j + 1}(r)$ where $a_{j + k + 1} = \pi_{j + k + 1} (r p^k)$. Then we see that $a_{j + k} = \pi_{j + k} (r p^k)$, and therefore $u_j = \pi_j(r)$. This is enough to show that $u \in \mathbb{Z}_p$.
Finally, we must show that $a = u p^k$. Consider some $j \in \mathbb{N}$. Write $u_j = \pi_j(m)$ for some $m$ such that $a_{j + k} = \pi_{j + k}(m p^k)$. Then we see that $a_j = \pi_j(m p^k) = \pi_j(m) p^k = u p^k$.
Now I claim that $u_1 \neq 0$. For if we had $u_1 = 0$, then write $u_1 = \pi_1(m)$ such that $a_{k + 1} = \pi_{k + 1}(mp^k)$. Then $m \equiv 0 \mod p$, so $m p^k \equiv 0 \mod p^{k + 1}$ and thus $a_{k + 1} = 0$. But this is impossible by the definition of $k$.
Then write $u_1 = \pi_1(w)$ for some $w \in \mathbb{Z}$. Note that $w$ is not $0$ mod $p$; therefore, $w$ is coprime with $p$.
Then in particular, for all $j \in \mathbb{N}$, we can write $u_j = \pi_j(w + p \cdot r)$ for some $r \in \mathbb{Z}$. And $w + p \cdot r$ is coprime with $p$, hence coprime with $p_n$. Therefore, $u_j$ is a unit in $\mathbb{Z} / (p^j)$; let its inverse be $y_j$.
Consider the canonical map $f_n : \mathbb{Z} / (p^{n + 1}) \to \mathbb{Z} / (p^n)$. We must show that for all $n$, $f_n(y_{n + 1}) = y_n$. Indeed, we see that $1 = f_n(y_{n + 1} \cdot u_{n + 1}) = f_n(y_{n + 1}) \cdot f_n(u_{n + 1}) = f_n(y_{n + 1}) \cdot u_n$. So $f_n(y_{n + 1})$ is the multiplicative inverse of $u_n$; hence, it equals $y_n$.
Therefore, $y = (y_1, y_2, \ldots, ) \in \mathbb{Z}_p$. And we see that $y \cdot u = 1$. So $u$ is a unit. $\square$
From here, consider the function $f(a) = $ the unique $k$ such that we can write $a = u p^k$ for $u$ a unit. This function makes $\mathbb{Z}_p$ into a Euclidean domain, hence a PID.