Prove function is a metric

44 Views Asked by At

I have a function on $\mathbb{R}^2$ defined as $d((x_1, x_2), (y_1, y_2)) = |x_2 - y_2|$ if $x_1 = y_1$ and $d((x_1, x_2), (y_1, y_2)) = |x_1 - y_1| + |x_2| + |y_2|$ otherwise. I want to prove that it is a metric.

I can do it only by considering many cases which is quite lengthy. Can it be proven neatly?