$p$-adic metric This is a question from Robert Strichartz: the way of analysis, page 385. 
He defines a $p$-adic metric on $\mathbb{Z}$ as follows. $p$ is a fixed prime. For any integer $z$, we have $z = \pm \sum_{j=0}^N a_j p^j$. $$|z|_p = p^{-k}$$
where $k$ is the smallest integer such that $a_k \neq 0$. 
(a) Show that $d(x, y) = |x - y|_p$ is a metric. 
(b) Show that $d(x, z) \leq \max\left(d(x, y), d(y, z) \right)$
My understanding:
First, I am assuming $x - y$ should be an integer. Second, from what he wrote, it does not follow that $|0|_p = 0$ so I am going to assume that.
Any hints about how to start proving the triangle inequality? The answer to part (b) implies the triangle inequality only if I can solve part (b) without using the fact that $d$ is a metric. 

 A: Note.  If $z = \pm \sum_{j=0}^N a_j p^j$, then $k$ is the first $a_k\ne 0$ if and only if $k$ is the highest power of $p$ so that $p|z$.
Keeping that in mind.  If $k$ is the highest power that divides $x-y$ and $j$ is the highest power that divides $y-z$.  If $k \ne j$ and $\min(k,j) < m \le \max(k,j)$ then $p^{m}$ will divide one of $x-y$ or $y-z$ but not the other so $p^m|(x-y)+(y-z) = x-z$.  
In that case the highest power that divides $x-z$ is $\min(k,j)$ and $|x-z| = p^{-\min(k,j)}= \max(p^{-k},p^{-j}) = \max(|x-y|_p, |y-z|_p)$.
If on the other hand if $k = j$ then the maximum power that divides $(x-y)+(y-z)=x-z$ is $\ge k = j$ and $|x-z| \le |x-y|_p = |y-z|_p$ so 
So $d(x,z) \le \max(d(x,y), d(y,z))$ and thus 
$d(x,z) \le \max(d(x,y),d(y,z)) + \min(d(x,y), d(y,z)) = d(x,y) + d(y,z)$.
So that proves the triangle inequality.
And it proves b).
(It's okay to use b) to prove a) but.....)
A: First observation is that $|z|_p = p^{-k}$ $\iff$ $k$ is the highest power of $p$ such that $p^k | z$. 
Second observation is that if $p^k | z$ then $p^n | z$ for all $0 \leq n \leq k$. 
Now consider $x, y, z \in \mathbb{Z}$. Let $|x - y|_p = p^{-k}$ and $|y - z|_p = p^{-j}$. Then, let $m = \min(k, j)$ so that $p^m | (x - y)$ and $p^m | (y - z)$ $\implies $ $p^m | (x - z)$ because $x - z = (x - y) + (y - z)$. 
Hence, the highest power of $p$, call it $l$, such that $p^l | (x - z)$ satisfies $l \geq \min(k, j)$. Hence, 
    \begin{align*}
    |x - z|_p = p^{-l} &\leq p^{-\min(k, j)} \\
    &= \max(p^{-k}, p^{-j})\\
    &= \max(|x - y|_p, \max(|y - z|_p))\\
    &\leq |x - y|_p + |y - z|_p
\end{align*} 
A: For the triangle inequality let $a,b,c \in \mathbb{Z}$. We need to show
$$
\frac{1}{e^{\nu_p(a-c)}} \le \frac{1}{e^{\nu_p(a-b)}} + \frac{1}{e^{\nu_p(b-c)}}$$
and note that we can write
$$a-c=(a-b)+(b-c).$$
Here $e^x$ denotes the $\text{exp}(x)$ function.
