# Showing the $p$-adic absolute value on $\mathbb{Q}$ is an ultrametric

Let $p$ be a prime number. Define the p-adic absolute value function $|\cdot|_{p}$ on $\mathbb{Q}$:

$|x|_{p}=\left\{ \begin{array}{ll} 0 & \text{if }x=0\\ p^{-k} & \text{if }x=p^{k}\frac{m}{n}\text{ and }\gcd(p,mn)=1\end{array}\right.$

where $m,n\in\mathbb{Z\setminus}\{0\}$ and $p\nmid m$ and $p\nmid n$. Show that for $x,y\in\mathbb{Q}$,

$|x+y|_p \leq max\left\{ |x|_{p},|y|_{p}\right\}$

How do I express $|x+y|_p$?

-

If $x$ or $y$ are equal to $0$, then the inequality is easy.
Assume $xy\neq 0$. Write $x = p^a\frac{r}{s}$ and $y=p^b\frac{t}{u}$, where $\gcd(p,rstu)=1$, and $a$ and $b$ are integers; that is, $|x|_p = p^{-a}$, $|y|_p = p^{-b}$.
Assume, without loss of generality, that $a\leq b$. Then $b-a\geq 0$, and \begin{align*} x+y &= p^a\frac{r}{s} + p^b\frac{t}{u}\\ &= p^a\left(\frac{r}{s} + p^{b-a}\frac{t}{u}\right)\\ &= p^a\left(\frac{ru + p^{b-a}ts}{su}\right). \end{align*} Can you take it from here? You'll have two cases, depending on whether $a\lt b$ or $a=b$.
Suppose that $x = p^{k_x}\frac{m_x}{n_x}$ and $y = p^{k_y}\frac{m_y}{n_y}$; then $x+y = p^{k_x}\frac{m_x}{n_x} + p^{k_y}\frac{m_y}{n_y}$. Suppose that $k_x \le k_y$; then $x+y = p^{k_x}\left(\frac{m_x}{n_x} + p^{k_y-k_x}\frac{m_y}{n_y} \right) = p^{k_x}\frac{m_xn_y+p^{k_y-k_x}m_yn_x}{n_xn_y}$. Does the denominator of that fraction have $p$ as a factor? If not, what can you conclude about the number of factors of $p$ in $x+y$?