the ways completion of p-adic integers I have heard that there are two ways of constructing completion of p-adic numbers:  One gives an equivalence relation on a Cauchy sequence. Unbeknownst to me , the another way  is using inverse limit.....(★)
To begin with, according to the following lecture, the author defines profinite completion.

$G$ be a group and $\mathcal{I}$ be a collection of normal subgroup
$N \triangleleft G $ of finite index. Let's efine $N \le N'$ iff $N'
 \subset N$. Then, this makes directed poset. If $N \subset N'$, then
we have a surjective homomorphism $G/N' \to G/N$ and the inverse limit
$\underset{\longleftarrow}{\lim}G/N =:\hat{G} $ is called profinite
completion.

Here is my question: Is the above definition really related to the completion as we know?
For example, (This is also an example within the following lecture )

Example )  p-adic integer ${\mathbb{Z}}_p$ is a profinite completion of $\mathbb{Z}$. i.e, ${\mathbb{Z}}_p=\underset{\longleftarrow}{\lim}\mathbb{Z}/p^n
\mathbb{Z}$

In the sense of completion, it looks nonsense for me because, unlike $\mathbb{Q}$, $\mathbb{Z}$ is already a complete set. Thus, when comparing such an Example  to constructing $\mathbb{Q}_p$, I think that profinite completion is not totally related to the concept of completion. In other words, the completion of a ring is just an algebraic concept that is not related to the completion. Though, my clumsy conclusion conflicts with the description that I have heard, (★).
 A: Here is a completely (ha-ha) different way of describing the $p$-adic integers.  Start with the ring of formal power series $\mathbf Z[[x]]$.  Inside of here is the ideal $(x-p)$ of multiples of $x-p$.  Take the quotient ring $R = \mathbf Z[[x]]/(x-p)$, a purely algebraic construction.  This is isomorphic to the ring $\mathbf Z_p$!
The intuition here is that every $p$-adic integer is a power series in $p$ with coefficients in $\{0,1,\ldots,p-1\}$, so we could think about it as being a formal power series with restricted coefficients being evaluated at $p$.  In $\mathbf Z_p$ an infinite series $\sum_{n \geq 0} a_np^n$ with $a_n \in \mathbf Z$ and no further restrictions at all will converge since the $n$th term tends to $0$ in $\mathbf Z_p$.  Therefore numbers in $\mathbf Z_p$ might occur as a general integer power series evaluated at $p$ too.
Okay, define $\varphi \colon \mathbf Z[[x]] \to \mathbf Z_p$ by evaluation at $p$: $\varphi(f(x)) = f(p)$.  This sends a formal power series $\sum_{n \geq 0} a_nx^n$ to the $p$-adically convergent series $\sum_{n \geq 0} a_np^n$, where the numbers $a_n$ are arbitrary integers.  Properties of adding and multiplying convergent $p$-adic infinite series show $\varphi$ is a ring homomorphism.  And $\varphi$ is surjective because every $p$-adic integer has a standard $p$-adic expansion with digits in $\{0,\ldots,p-1\}$.
It remains to show the kernel of $\varphi$ is the multiples of $x-p$.
The containment $(x-p)\subset \ker \varphi$ is immediate from $x-p \in \ker \varphi$. To prove $\ker \varphi \subset (x-p)$, suppose $f(x) = \sum_{n \geq 0} a_nx^n$ is in $\ker \varphi$, so $f(p) = 0$ in $\mathbf Z_p$. Then $a_0 \equiv 0 \bmod p\mathbf Z_p$, so the integer $a_0$ has to be an ordinary multiple of $p$: $a_0 = pb_0$ for some $b_0 \in \mathbf Z$. Then
$$
0 = f(p) = a_0 + a_1p + a_2p^2 + \cdots \equiv a_0 + a_1p  \equiv pb_0 + a_1p \bmod p^2\mathbf Z_p,
$$
so $b_0 + a_1$ has to be an ordinary multiple of $p$: $b_0 + a_1 = pb_1$, so $a_1 = pb_1 - b_0$ for some integer $b_1$. Then show the condition $f(p) \equiv 0 \bmod p^3\mathbf Z_p$ implies $a_2 = pb_2 - p_1$ for some integer $b_2$. And so on: there is a sequence of integers $\{b_n\}$ such that
$$
a_0 = pb_0, \ \ a_n = pb_n - b_{n-1} 
$$
for $n \geq 1$. That makes
$$
f(x) = \sum_{n \geq 0} a_nx^n = pb_0 + \sum_{n \geq 1} (pb_n - b_{n-1})x^n = (p-x)\sum_{n \geq 0} b_nx^n,
$$
so $f(x) \in (x-p)$ in $\mathbf Z[[x]]$.  I did not use anything special about $p$ being a prime number.  If you've heard of $10$-adic integers, then $\mathbf Z_{10} \cong \mathbf Z[[x]]/(x-10)$.
Using the $x$-adic topology on $\mathbf Z[[x]]$, which makes $\mathbf Z[[x]]$ complete, the ring homomorphism $\varphi \colon \mathbf Z[[x]] \to \mathbf Z_p$ is continuous because the values at $p$ of all series in $x^k\mathbf Z[[x]]$ are very small for large enough $k$ (a group homomorphism of topological groups is continuous if and only if it is continuous at the identity), and continuity of $\varphi$ implies continuity of the induced mapping $\overline{\varphi} \colon \mathbf Z[[x]]/(x-p) \to \mathbf Z_p$ when using the quotient topology. This $\overline{\varphi}$ is also an open mapping (check first that $\varphi$ is an open mapping), so the bijection $\overline{\varphi}$ is a homeomorphism.  Thus $\overline{\varphi}$ identifies $\mathbf Z[[x]]/(x-p)$ with $\mathbf Z_p$ both algebraically and topologically.
A: $\varprojlim \Bbb{Z/p^nZ}$ is the ring of sequences $a_n\in \Bbb{Z/p^nZ}$ such that $a_n=a_m\bmod p^m$,
isomorphic to the ring of limits of sequences of integers such that $a_n=a_m\bmod p^m$ (if $\forall n,a_n=0\bmod p^n$ then $\lim a_n=0$ in this ring)
isomorphic to the ring of limits of sequences of integers that converge $\bmod p^m$ for all $m$ (if $\forall m,\lim a_n=0\bmod p^m$ then $\lim a_n=0$ in this ring)
Clearly isomorphic to the completion of $\Bbb{Z}$ for $|.|_p$.
