Prove that is a metric Hello I have problems with this exercise
In $\mathbb{Z}$ define $\rho_2 (m, n) = 0$ if $m = n$ and $\rho_2 (m, n) = 2^{- d}$, where $d$ is the greatest power of $2$ that divides $m-n \neq 0$. Prove that $\rho_2$ is a metric in $\mathbb{Z}$
Thanks
 A: In order to prove that $\;\rho_2\;$ is a metric in $\;\mathbb{Z}\;,\;$ we have to prove the following claims:
$1)\;\;\rho_2(m,n)\ge0\;$ for all $\;m,n\in\mathbb{Z}\;,$
$2)\;\;\rho_2(m,n)=0\iff m=n\;,$
$3)\;\;\rho_2(m,n)=\rho_2(n,m)\;$ for all $\;m,n\in\mathbb{Z}\;,$
$4)\;\;\rho_2(m,p)\le\rho_2(m,n)+\rho_2(n,p)\;$ for all $\;m,n,p\in\mathbb{Z}\;.$
We are going to prove $1), 2), 3)$ and $4).$
Proof of 1) :
If $\;m=n\;,\;$ then $\;\rho_2(m,n)=0\ge0\;.$
If $\;m\ne n\;,\;$ then $\;\rho_2(m,n)=2^{-d}>0\;$ where $\;d\;$ is the greatest exponent of the power of $\;2\;$ that divides $\;m-n\ne0\;.$
In any case it results that $\;\rho_2(m,n)\ge0\;.$
Proof of 2) :
If $\;\rho_2(m,n)=0\;,\;$ then $\;m=n\;,\;$ otherwise it would result that $\;\rho_2(m,n)=2^{-d}\ne0\;.$
If $\;m=n\;,\;$ then $\;\rho_2(m,n)=0\;.$
Proof of 3) :
If $\;m=n\;,\;$ then $\;\rho_2(m,n)=0=\rho_2(n,m)\;.$
If $\;m\ne n\;,\;$ then $\;\rho_2(m,n)=2^{-d}=\rho_2(n,m)\;$ where $\;d\;$ is the greatest exponent of the power of $\;2\;$ that divides $\;m-n\ne0\;\;($consequently it is also the greatest exponent of the power of $\;2\;$ that divides $\;n-m\ne0)\;.$
Proof of 4) :
If $\;m=n\;,\;$ then $\;\rho_2(m,p)=\rho_2(n,p)\le\rho_2(m,n)+\rho_2(n,p)\;.$
If $\;m=p\;,\;$ then $\;\rho_2(m,p)=0\le\rho_2(m,n)+\rho_2(n,p)\;.$
If $\;n=p\;,\;$ then $\;\rho_2(m,p)=\rho_2(m,n)\le\rho_2(m,n)+\rho_2(n,p)\;.$
If $\;m\ne n\;,\;m\ne p\;$ and $\;n\ne p\;,\;$ let $\;d\;,e\;,f\;$ be the greatest exponents of the powers of $\;2\;$ such that:
$m-n=2^da\;$ where $\;a\in\mathbb{Z}\;(a$ is odd$)\;,$
$m-p=2^eb\;$ where $\;b\in\mathbb{Z}\;(b$ is odd$)\;,$
$n-p=2^fc\;$ where $\;c\in\mathbb{Z}\;(c$ is odd$)\;.$
Since $\;m-p=(m-n)+(n-p)\;,\;$ it follows that
$m-p=2^da+2^fc\;.\quad\color{blue}{(*)}$
There are two possibilities:
I) $\;d\le f$
II) $\;d>f$
If $\;d\le f\;,\;$ then $\;m-p=2^d\left(a+2^{f-d}c\right)$.
But $\;e\;$ is the greatest exponent of the power of $\;2\;$ that divides $\;m-p\;,\;$ hence $\;e\ge d\;,\;$ consequently,
$2^e\ge2^d\;.$
Moreover,
$\rho_2(m,p)=2^{-e}\le2^{-d}=\rho_2(m,n)\le\rho_2(m,n)+\rho_2(n,p)\;.$
If $\;d>f\;,\;$ wen can proceed analogously in order to prove that $\;\rho_2(m,p)\le\rho_2(m,n)+\rho_2(n,p)\;.$
A: I will only prove the triangle inequality since the other properties of metric are pretty obvious. Let $x,y,z \in \mathbb{Z}$ with $x\neq y \neq z$. Let $n_1$, $n_2$, $n_3$ be the greatest natural numbers such that $2^{n_1}|(x-y)$, $2^{n_2}|(x-z)$ and $2^{n_3}|(z-y)$.
We have that
$$2^{\min\{n_2,n_3\}}|(x-z)+(z-y)=x-y$$
and by the maximality of $n_1$ we get $\min\{n_2,n_3\} \leq n_1$ and therefore
$2^{-n_1} \leq 2^{-\min\{n_2,n_3\}} = \max\{2^{-n_2},2^{-n_3}\}$ which implies that $\rho_2(x,y) \leq \max\{\rho_2(x, z),\rho_2(z,y)\}$. This of course implies that the triangle inequality is satisfied and that $\rho_2$ is not only a metric but also an ultrametric!
I will leave the details for you to fill them (what happens when $x=y$ for example).
A: $2)\;\;\rho_2(m,n)=0\iff m=n\;,$ ( For definition)

*

*For $m \neq $ $n$
$\rho_2 (m,n) = 2^{-d} =\displaystyle\frac{1}{2^d} > 0 $
$ 3)\;\;\rho_2(m,n)= 2^{-d} = \rho_2(n,m)\; $ Is correct ?
I don't know how to prove the triangular inequality
Thanks
