# Proving that the function is a distance in $\mathbb{R}^2$

Let $\mathcal{U}=\mathbb{R}^2$ and consider the function $d:\mathcal{U} \times \mathcal{U} \to \mathbb{R}$ defined by

$$d(P,Q) = | x_1-x_2| + |y_1-y_2|$$

where $P=(x_1,y_1)$ and $Q=(x_2,y_2)$. Prove that $d$ is a distance in $\mathbb{R}^2$.

So I need to verfy the following axioms hold

$1.$ $d(P,Q)=d(Q,p)$

$d(P,Q) = | x_1-x_2| + |y_1-y_2|=|y_1-y_2|+| x_1-x_2|=d(Q,P)$ since addition of two positive numbers is commutative.

$2.$ $d(P,Q) \geq 0$

Now for this one I'm not that sure but it seems clear that since they are two distinct points and we have the absolute value set up clearly the distance will always be greater then 0 unless both points are equal.

$3.$ $d(P,Q)=0$ if and only if $P=Q$

$d(P,Q)=| x_1-x_2| + |y_1-y_2|=0$ Therefore since $| x_1-x_2|$ and $|y_1-y_2|$ is always $\geq 0$ Then the only way the sum of both is zero is if both $|y_1-y_2|$ and $| x_1-x_2|=0$ Thus $x_1=x_2$ and $y_1=y_2$ thus $P=Q$. Now the converse is easier since if $P=Q$ then $x_1=x_2$ and $y_1=y_2$ thus $d(P,Q)=| x_1-x_2| + |y_1-y_2|=0$

Oh one follow up I forgot to add. Find all the points at distance $1$ from $(0,0)$ using the distance given . Make a picture of this circle with radius $1$ Let $d(P,Q)=| x_1-x_2| + |y_1-y_2|=1$ Then either $| x_1-x_2|$ is $1$ or $0$ and vice versa for $|y_1-y_2|$. Thus the points are as follows when setting $Q$ at the origin. either $P=(1,0),(0,1),(-1,0),(0,-1)$ is that ok? But its not a circle.

• $d(Q, P)$ isn't $|y_1 - y_2| + |x_1 - x_2|$, it's $|x_2 - x_1| + |y_2 - x_1|$. Jan 31 '17 at 22:07
• it was presented to me the way I posted it. Now it shouldn't really matter the order due to the absolute value or does it? Jan 31 '17 at 22:08
• In one sense, that's right, it doesn't matter, but in another sense, the fact that it doesn't matter is exactly what you're trying to prove. Jan 31 '17 at 22:55
• I agree with ConMan: the reason why $d(P,Q)=d(Q,P)$ is not the commutativity of (not necessarily positive) real numbers, but the fact that the absolute value function is even. Jan 31 '17 at 23:47
• More importantly, you also forgot to check one fundamental property of distances: the triangular inequality $d(P,R)\leqslant d(P,Q)+d(Q,R)$ for any $P,Q,R$. It follows here from the triangular inequalityand the fact that the addition is compatible with the order in $\mathbb R$. Jan 31 '17 at 23:49

It's not clear what you are asking here. Since $1$ and $3$ are alright, I'm assuming you need help to set up a proof for 2.

$2.$ Follows from this:

$| x_1-x_2| \geq 0$ and $| y_1-y_2| \geq 0$ from the definition of absolute value. So the sum of both should be greater or equal to zero.

• Oh one follow up I forgot to add. Find all the points at distance $1$ from $(0,0)$ using the distance above . Make a picture of this circle with radius $1$ Let $d(P,Q)=| x_1-x_2| + |y_1-y_2|=1$ Then either $| x_1-x_2|$ is $1$ or $0$ and vice versa for $|y_1-y_2|$. Thus the points are as follows when setting $Q$ at the origin. either $P=(1,0),(0,1),(-1,0),(0,-1)$ is that ok? But its not a circle. Jan 31 '17 at 23:37
• @HighSchool15: This is not correct. You are assuming that $|x_1-x_2|$ and $|y_1-y_2|$ are integers, which is nowhere assumed in the question. The equation $X+Y=1$, with $X\geqslant 0$, $Y\geqslant 0$ has infinitely many solutions. Jan 31 '17 at 23:52

There are several things to consider to check if a function is a distance:

1. Symmetry: If $P(x_1,y_1)$ and $Q(x_2,y_2)$, then $$d(Q,P)=|x_2-x_1|+|y_2-y_1|=|x_1-x_2|+|y_1-y_2|=d(P,Q)$$ The main argument here is that the absolute value function is even (and $x_2-x_1=-(x_2-x_1)$).

2. As the OP explained, since an absolute value is always nonnegative, then $d(P,Q)$ is clearly nonnegative. If $d(P,Q)=|x_1-x_2|+|y_1-y_2|=0$, then $|x_1-x_2|=|y_1-y_2|=0$. This implies that $x_1=x_2$ and $y_1=y_2$, that is $P=Q$.

3. Triangular inequality: If $P(x_1,y_1)$, $Q(x_2,y_2)$ and $R(x_3,y_3)$, then $$d(P,R)=|x_1-x_3|+|y_1-y_3| \leqslant |x_1-x_2|+|x_2-x_3|+|y_1-y_2|+|y_2-y_3| = |x_1-x_2|+|y_1-y_2|+|x_2-x_3|+|y_2-y_3| = d(P,Q)+d(Q,R)$$ (Here, the properties of $\mathbb R$ involved are: triangular inequality, associativity, and commutativity).

We can conclude that $d$ is indeed a distance.

Finally, what is the "circle" of points $P(x,y)$ at a distance exactly $1$ from the origin $(0,0)$? They are the solution of the equation $|x|+|y|=1$. Since the absolute value is even, the graph of this equation is symmetric about the $x$- and $y$-axes, so it is sufficient to consider what happens in the first quadrant ($x\geqslant 0$, $y\geqslant 0$). There, the equation becomes $x+y=1$, that is $y=1-x$. Because of the restrictions on $x$ and $y$, the part in the first quadrant is the line segment $y=1-x$ for $x\in[0,1]$. As a conclusion, the "circle" is the square with vertices $(1,0)$, $(0,1)$, $(-1,0)$, and $(0,-1)$.