Prove certain properties of the function $d_p(a,b)=p^{-v_p(a-b)}$ I was ill and didn't manage to attend a few classes on number theory. Now, I'm struggling to prove a theorem that was presented during the lectures I didn't addend and intentionally ,,left as an exercise'' by the lecturer:

define function $d_p:\mathbb{Z}\times\mathbb{Z}\rightarrow \mathbb{R}$ such that $d_p(a,b)=p^{-v_p(a-b)}$, where $v_p$ is the $p$-adic exponent of $a - b$. Prove that the following properties are true:

*

*$d_p(a,b)=0\Leftrightarrow a-b=0$

*$d_p(a,b)\ge 0$

*$d_p(a,c)\le d_p(a,b)+d_p(b,c)$

*$d_p(a,b)=d_p(b,a)$

I'm sorry to say the only thing I thought of was writing numbers $a$ and $b$ in the following form: $a=p^{\alpha}\frac{m}{n}$ and $b=p^{\beta}\frac{z}{x}$. Then, I guess, we have:
$$ a-b=p^{\alpha}\left(\frac{m}{n}-p^{\beta-\alpha}\frac{z}{x}\right)$$
but I don't know if it's of any use in proving any of the four properties.
I'm not looking for a complete solution - I know you guys don't want to do all the work for me, but could somebody drop me at least some hint?

Let me address the properties in order. Note that you must also note that you're taking the convention that $p^{-\infty} = 0$, since $v_p(0) = \infty$ (if you have left $v_p(0)$ undefined, you'll need to separately define $d(a,a) = 0$ for any $a$). Here are some leading questions/suggestions that should help you out. Below, I'll say "$p$ divides $n$ $m$ times" to mean that $n = p^m n'$, where $(n',p) = 1$; in other words, I'm saying that $v_p(n) = m$.


*

*You essentially want to show that $v_p(x) = \infty$ if and only if $x = 0$. If $n$ is a nonzero number, can $p$ divide $n$ infinitely many times?

*Can $p^x$ be negative for any real value of $x$? What if "$x = -\infty$"?

*I would recommend proving something stronger: that $d_p(a,c)\leq \max(d_p(a,b),d_p(b,c))$. Translate this into a statement about the $v_p$'s: you should find that you want to show $v_p(a-c)\geq\min(v_p(a-b),v_p(b-c))$. Now, set $a - b = x$, $b - c = y$. Then this statement is equivalent to $$v_p(x + y)\geq\min(v_p(x), v_p(y)).$$ Since $x$ and $y$ are integers, you can write $x = p^{v_p(x)} x'$, $y = p^{v_p(y)} y'$ for some $x',y'\in\Bbb Z$ relatively prime to $p$. Now, consider how many times $p$ can divide their sum. First suppose that $v_p(x)\geq v_p(y)$ without loss of generality, and then use your thought above.

*You know that $v_p(n)$ is the number of times $p$ divides $n$. How many times does $p$ divide $-n$?

