Show that the real line with the metric $d(x,y) = |x - y|$ is indeed a metric space.
My solution
It is indeed positive-definite as well as symmetric on the variables $x$ and $y$. It remains to prove it satisfies the triangle inequality.
Let us consider the real numbers $a$ and $b$. Thus we have $|a| + |b| \geq |a+b|$. Indeed, we have that \begin{align*} (|a| + |b|)^{2} = a^{2} + 2|ab| + b^{2} \geq a^{2} + 2ab + b^{2} = |a+b|^{2} \Rightarrow |a| + |b| \geq |a+b| \end{align*} Thus if we choose $a = x - y$ and $b = y - z$, one gets the desired result: \begin{align*} |a + b| = |x - y + y - z| = |x - z| \leq |x - y| + |y - z| = |a| + |b| \end{align*} and we are done.
Is it correct? Could someone provide a proof different from this one?
Another proof of triangle inequality: If $a+b \geq 0$ then $|a+b|=a+b \leq |a|+|b|$. If $a+b <0$ then $|a+b|=-a-b \leq |a|+|b|$. I have used the fact that $x\leq |x|$ and $-x \leq |x|$. [These two inequalities become obvious when you consider the cases $x \geq 0$ and $x<0$].
Now $d(x,y)=|x-y|=|(x-z)+z-y)| \leq |x-z| +|z-y| =d(x,z)+d(z,y)$ where the inequality follows by taking $a=x-z$ and $b=z-y$.