Definition. A metric $\rho$ on a set $X$ is an ultrametric if it satisfies the inequality $$ \rho(x, y) \leq \max \{\rho(x, z), \rho(z, y)\} $$ for all $x, y, z .$
Question. Let $\mathbb{Q}$ be the set of rational numbers and let $p$ be a prime number. We define a mapping $u$ from $\mathbb{Q} \times \mathbb{Q}$ to $\mathbb{R}$ as follows: $$ u(x, y)=\left\{\begin{array}{cc}{0} & {, \text { if } x=y} \\ {p^{-\alpha}} & {, \text { if } x \neq y}\end{array}\right. $$
where $y-x=\frac{p^{\alpha} m}{n}, m$ and $n$ are relatively prime integers not divisible by $p .$ Show that $u$ is an ultrametric.
My Answer. If $x \neq y$ then $u(x, y)=p^{-\alpha}$ where $y-x=p^{\alpha} \frac{m}{n}$, $m$ and $n$ are relatively prime integers not divisible by $p$.
Assume $u(x,z)=p^{-\gamma}$ where $z-x=p^\gamma \dfrac{c} {d}$, $c$ and $d$ are relatively prime integers not divisible by $p$, and
$u(z,y)=p^{-\beta}$ where $y-z=p^\beta \dfrac{a} {b}$, $a$ and $b$ are relatively prime integers not divisible by $p$.
WLOG we assume that $\beta < \gamma$, then
$$y-x=y-z+z-x=p^\beta \dfrac {a} {b} + p^{\gamma} \dfrac {c} {d}$$
$$ p^{\alpha} \frac{m}{n}=p^{\beta} \frac{a}{b}+p^{\gamma} \frac{c}{d} $$
$$ =p^\beta (\dfrac {a} {b} + p^{\gamma - \beta} \dfrac {c} {d}) $$
$$ p^\beta (\dfrac {ad+p^{\gamma - \beta}bc} {bd} ). $$
Consider $ad+p^{\gamma - \beta}bc=r$ and $bd=s$. So we can see that $r$ and $s$ are not divisible by $p$. Hence $\alpha=\beta$. Then since $\alpha=\beta < \gamma$, we get
$$p^{-\alpha}=p^{-\beta}<p^{-\gamma},$$
then $$u(x,y)=u(z,y)<u(x,z),$$
hence we can say that $$u(x, y) \leq \max \{u(x, z), u(z, y)\}.$$
Please, may you check my answer? May you give me a feedback for the answer? Thanks!