Exercise: Show that $d(x,y)= \left|\frac{1}{x} - \frac{1}{y}\right|$ defines a metric on $(0,\infty)$.
What I've tried: I need to check the following properties
- i) $0\leq d(x,y)<\infty,$ for all $x,y\in(0,\infty)$.
- ii) $d(x,y)=0$ if and only if $x=y$
- iii) $d(x,y)=d(y,x),$ for all $x,y\in(0,\infty)$.
- iv) $d(x,z)\leq d(x,y) + d(y,z)$ for all $x,y,z\in(0,\infty)$.
I think I was able to solve the first three properties
i): If $\dfrac{1}{x} - \dfrac{1}{y}$ is positive then $d(x,y)$ is positive, if $\dfrac{1}{x} - \dfrac{1}{y}$ is negative then $d(x,y) = \left|\dfrac{1}{x} - \dfrac{1}{y}\right|$ is positive, so $d(x,y)\geq 0$. Since $x,y\in(0,\infty)$ we have that $\left|\dfrac{1}{x} - \dfrac{1}{y}\right|\in(0,\infty)$.
ii): If $x = y$ then $d(x,y) = 0$, if $x\neq y$ then $\dfrac{1}{x} \neq \dfrac{1}{y}$ and $d(x,y) \neq 0$.
iii): If $\left|\dfrac{1}{x} - \dfrac{1}{y}\right|^2 = \left|\dfrac{1}{y} - \dfrac{1}{x}\right|^2$ then $\left|\dfrac{1}{x} - \dfrac{1}{y}\right| = \left|\dfrac{1}{y} - \dfrac{1}{x}\right|$. I know that $\left|\dfrac{1}{x} - \dfrac{1}{y}\right|^2 = 1/x^2 - 2/xy + 1/y^2 = \left|\dfrac{1}{y} - \dfrac{1}{x}\right|^2,$ hence $\left|\dfrac{1}{x} - \dfrac{1}{y}\right| = \left|\dfrac{1}{y} - \dfrac{1}{x}\right|^2$ and $d(x,y) = d(y,x)$.
I don't know how I should show that the fourth property holds!
Question: How do I show that $\left|\dfrac{1}{x} - \dfrac{1}{y}\right|\leq \left|\dfrac{1}{x} - \dfrac{1}{z}\right| + \left|\dfrac{1}{z} - \dfrac{1}{y}\right|$, or equivalently, that $d(x,y) \leq d(x,z) + d(z,y)$?
Thanks!
You just apply the triangle inequality: for any three real numbers $a$, $b$, and $c$,$$|a-b|\leqslant|a-c|+|c-b|.$$