# Is $d(x,y) = (x-y)^2$ a metric on $\Bbb R$?

For $x,y,z \in \Bbb R$, define $d(x,y):= (x-y)^2$

Is this a metric on $\Bbb R$?

It's clear that $d(x,x)=0$ and $d(x,y)=d(y,x)$ for all $x,y \in \Bbb R$.

The triangle inequality seems to have a contradiction [$d(x,z) \leq d(x,y) +d(y,z)$] If I let $x=1$, $y=0$ and $z=-1$, then I will have $(1+1)^2 = 4 > (1-0)^2 + (0+1)^2 = 2$.

So is this $d$ a metric? If it's, how can I prove it?

• This is a practice question for my class. Show that d(x,y) = (x-y)^2 defines a metric on R. Sep 13, 2014 at 1:15
• Nice counterexample. Sep 13, 2014 at 1:18
• I really doubt that it's not a metric. I have seen this in many book's exercise. Sep 13, 2014 at 1:34
• That's why Euclidean distance has an extra square root, which makes the triangle inequality work out (think of the reals as a one dimensional vector space) Sep 13, 2014 at 2:29

The function $d$ defined is not a metric. The triangle inequality fails, and you showed a counter-example yourself. Good job.