<s>[INST] $d(x,y) = | x^{2} - y^{2}|$ and $ d(x,y) = | x^{3} - y^{3}|$ are metrics on $\mathbb R$ or not$?$ $d(x,y) = | x^{2} - y^{2}|$ and $ d(x,y) = | x^{3} - y^{3}|$ are metrics on $\mathbb R$ or not$?$
Clearly,

*

*$d(x,x) = 0$


*$d(x,y) = d(y,x)$


*$d(x,y) ≥ 0$ , for all $x,y$ for both.
Now, for fourth axiom.


*$d(x,z) = |x^{2} - z^{2}| = |x^{2} - y^{2} + y^{2} - z^{2}| ≤ |x^{2} - y^{2}| + |y^{2} - z^{2}| = d(x,y) + d(y,z)$
Similarly,
$d(x,z) = |x^{3} - z^{3}| = |x^{3} - y^{3} + y^{3} - z^{3}| ≤ |x^{3} - y^{3}| + |y^{3} - z^{3}| = d(x,y) + d(y,z)$
So both should be metrics. But answer is given that only the second one in metric. So what's wrong with my proof. I think something is wrong with my proof of fourth axiom.
I've just started metric spaces today.
Please suggest..
 [/INST] Recall the definition of a metric. A function $d: X \to \mathbb{R}$ on a space $X$ is a metric if:
1) $d(x,y) = 0$ if and only if $x=y$. 
2) $d(x,y) =d(y,x)\ \forall\ x,y \in X.$
3) $d(x,y) \le d(x,z) + d(y,z) \ \forall \ x,y,z \in X.$
Now we check above conditions on two of our metrics:
Case 1 : $d(x,y) = |x^2-y^2|$.
$(i)\ d(x,y) = 0 \Rightarrow |x^2-y^2| = 0 \Rightarrow x^2-y^2 = 0 \ (\text{as modulus is always} \ge 0) \Rightarrow x^2 =y^2.$
So any $x,y \in \mathbb{R}$ such that $x^2 =y^2$ gives $d(x,y) = 0.$ This contradicts our first condition for a metric. Hence $d(x,y) = |x^2-y^2|$ is not a metric on $\mathbb{R}$.
Case 2 : $d(x,y) = |x^3-y^3|$.
$(i)\ d(x,y) = 0 \Rightarrow |x^3-y^3| = 0 \Rightarrow x^3 - y^3 = 0 \Rightarrow (x-y)(x^2+xy+y^2) = 0 \Rightarrow x = y$ (as second term is never zero under the condition given). The other side is trivial as if $ x= y $ then $d(x,y) = |x^3-y^3| = 0$. 
$(ii)\ d(x,y) = |x^3-y^3| = |y^3-x^3| = d(y,x).$
$(iii)\ d(x,y) = |x^3- y^3| = |x^3-z^3+ z^3-y^3| \le |x^3- z^3|+ |z^3-y^3|$ (by the triangular inequality in modulus.)
$\Rightarrow d(x,y) \le d(x,z)+d(z,y). $
Hence $d(x,y) = |x^3-y^3|$ is a metric on $\mathbb{R}$.
</s>