0

Given that $X$ is a set of all positive real numbers and let $x,y\in X$. $d (x,y) = \lvert \ln (y/x)\rvert$. Prove that $(X, d)$ is a metric space.

I am stuck with proving that this satisfies the triangle inequality.

Alexander
  • 107
  • You can see this intuitively by noting that this is just the positive difference in the logs of the points. Since $\log x$ grows as $x$ grows, this is definitely a valid metric on the set of positive real points. – Allawonder Mar 01 '20 at 14:56

2 Answers2

2

$$\left\lvert\ln\frac xy\right\rvert=\left\lvert \ln\left(\frac xz\cdot\frac zy\right)\right\rvert=\left\lvert \ln\frac xz+\ln\frac zy\right\rvert\le\left\lvert \ln\frac xz\right\rvert+\left\lvert\ln\frac zy\right\rvert$$

2

If we have $d(x, y) \equiv |\ln(y/x)|$, we can first of all simplify this to: $$ d(x, y) \equiv |\ln(y/x)| = |\ln(y) - \ln(x)| $$

For the triangle inequality, we need to prove that $\forall x, y, z \in \mathbb R^+, d(x, z) \leq d(x, y) + d(y, z)$. We proceed as:

\begin{align*} &\forall x, y, z \in \mathbb R^+ \\ &~d(x, z) = |\ln(x) - \ln(z)| \\ &= |\ln(x) - \ln(z) - \ln(y) + \ln(y)| \\ &= |[\ln(x) - \ln(y)] + [\ln(y) - \ln(z)]| \\ &\leq |\ln(x) - \ln(y)| + |\ln(y) - \ln(z)| \end{align*}

In general, the trick of writing the triangle inequality as $d(x, y) = |f(x) - f(y)|$, and then re-writing $d(x, z) = |f(x) - f(z)| = |(f(x) - f(y)) + f(y) - f(z)| \leq |f(x) - f(y)| + |f(y) - f(z)|$ works in most situations I have encountered, so it's a useful trick to remember to add and subtract the middle term.