A metric on $\mathbb R^2$

inequalitymetric-spaces

I’m trying to show that
$d(x,y)= |x_1-x_2|^2 + |y_1-y_2|^2$ is a metric on $\mathbb R^2$ where $x=(x_1,y_1)$ and $y=(x_2,y_2)$

I have stuck on triangle inequality.

Let $z=(x_3,y_3)$

I must show $d(x,y) \leq d(x,z) + d(z,y)$ namely $|x_1-x_2|^2 + |y_1-y_2|^2 \leq |x_1-x_3|^2 + |y_1-y_3|^2 + |x_3-x_2|^2 + |y_3-y_2|^ 2$

I have tried to use $|x_1-x_2|=|x_1-x_3+x_3-x_2| \leq |x_1-x_3| + |x_3-x_2| $ but I couldn’t obtain the triangle inequality. I could get $|x_1-x_2|^2 + |y_1-y_2|^2 \leq 2|x_1-x_3|^2 + 2|y_1-y_3|^2 + 2|x_3-x_2|^2 + 2|y_3-y_2|^ 2$ via using $2ab \leq a^2 + b^2$ inequality.

I know it is probably a piece of cake but I cannot see it. I need some hints.

Thanks in advance for any help.

Best Answer

I'm afraid @Mindlack is right. Note that $$|x_1-x_2|^2+|x_2-x_3|^2-|x_1-x_3|^2\\=x_1^2+x_2^2-2x_1x_2+x_2^2+x_3^2-2x_2x_3-x_1^2-x_3^2+2x_1x_3\\=2(x_2-x_1)(x_2-x_3)$$can be positive, negative or zero depending on the values of $x_1,\,x_2,\,x_3$. A similar result holds for the $y_i$. Thus $$|x_1-x_2|^2+|x_2-x_3|^2-|x_1-x_3|^2+x_i\mapsto y_i$$needn't be non-negative, as the triangle inequality would require. In fact, we can also think of this in terms of the cosine rule in planar Euclidean geometry: if $x_1,\,x_2,\,x_3$ are the vertices of a triangle with internal angle $\theta$ at $x_2$,$$|x_1-x_2|^2+|x_2-x_3|^2-|x_1-x_3|^2=2|x_1-x_2||x_2-x_3|\cos\theta$$has the same sign as $\cos\theta$.