\part{Advanced}
\chapter{$p$-adic numbers}

$p$-adic numbers are numbers that were created as a necessity to study Diophanitine equations under prime moduli, similar to how complex numbers were created as a necessity to calculate roots of a cubic.

An elementary way to study Diophantine equations is to consider their behaviour under some moduli; since prime moduli have desirable algebraic properties (i.e they form a field)


From an elementary point fo view, It's often fruit to consider Diophantine equations on $\mathbb{Z} / p\mathbb{Z}$ to aid in its study on $\mathbb{Z}$.

However when trying to translate results to $\mathbf{Z}$, the fact that $\mathbb{Z} / p\mathbb{Z} \to \mathbb{Z}$ is not injective means that this analysis cannot distinguish a Diophantine equation's behaviour on integers of the same equivalce class.

A neat trick is then to consider a Diophantine equation's behaviour on all the prime power moduli simultaneously, so studying it on $\large\times^{\infty}_{k=1}\mathbb{Z} / p^{k}\mathbb{Z}$. $\mathbb{Z} / p^{k}\mathbb{Z}$.

The structures $\mathbb{Z} / p^k \mathbb{Z}$ don't form a field for $k >1$, but surprisingly $\large\times^{\infty}_{k=1}\mathbb{Z} / p^{k}\mathbb{Z}$. $\mathbb{Z} / p^{k}\mathbb{Z}$ manages to be a field! This means that every nonzero element has a multiplicative inverse (like how elements of $\mathbb{R}$ have reciprocals and how $\mathbb{Z} / p\mathbb{Z}$ have MMIs).

A result called \emph{Hensel's lemma} offers a link between solutions of lower prime power moduli to higher ones, and eventually can be used to prove this grand fact.



\begin{lemma}[Hensel's lemma]
Let $f(x_{k}) \equiv 0 \mod p^k$, if $ \gcd (p,f'(x_{k})) =1$, then there exists a $x_{k+1} = p^{k+1}m + a $ such that  $f(x_{k+1}) \equiv 0 \mod p^{k+1}$ and $ \frac{f(x_{k})}{p^k}+ mf'(x_{k})  \equiv 0 \mod p$.
\end{lemma}

Hensel's lemma is saying multiple things; it essentially asserts the existence of something called \emph{$p$-adic integers} and bounds them by a specific relationship.

\begin{definition}[$p$-adic integers]
Let $p$ be a prime number, a \emph{$p$-adic integer} is defined as a formal power series of the following form.
\[ r = \sum^{\infty}_{i=0} a_i p^i\]
where $a_i \in \{0,1, \hdots , p-1\}$
Let $\mathbb{Z}_p$ be the set of $p$-adic integers
\end{definition}


Can be thought of as an infinite sequence of moduli $r=(x_i)^{\infty}_{i=0}$ subject to $x_i \equiv x_j \mod p^i$ when $i < j$. Hensel's lemma e



\begin{definition}[$p$-adic numbers]
Let $p$ be a prime number, a \emph{$p$-adic number} is defined as a formal power series of the following form.
\[ r = \sum^{\infty}_{i=v} a_i p^i\]
where $a_i \in \{0,1, \hdots , p-1\}$ and $v \in \mathbb{Z}$
Let $\mathbb{Q}_p$ be the set of $p$-adic numbers
\end{definition}


