To prove following is a metric space I have $X= \mathbb{R^2}$ $d(x,y)=\sqrt{(x_1-y_1)^2+(x_2-y_2)^2}$.
I am having trouble on how to show triangle inequality property while other two are quite trivial. What is method of doing this?
Thanks
 A: In $\mathbb R^n$, you can use the dot product as a tool to construct this type of proof. The triangle inequality is in fact a direct consequence of the Cauchy-Schwarz inequality $(\mathbf a\cdot\mathbf b)(\mathbf a\cdot\mathbf b)\le(\mathbf a\cdot\mathbf a)(\mathbf b\cdot\mathbf b)$. There are many proofs, but the simplest one in $\mathbb R^2$ is pobably just enumerating all the terms of the dot products.
$$(\mathbf a\cdot\mathbf a)(\mathbf b\cdot\mathbf b)-(\mathbf a\cdot\mathbf b)(\mathbf a\cdot\mathbf b)=a_1^2b_2^2+a_2^2b_1^2-2a_1a_2b_1b_2=(a_1b_2-a_2b_1)^2$$
The difference is therefore nonnegative, so the Cauchy-Schwarz inequality must hold. Let $||\mathbf v||=\sqrt{\mathbf v\cdot\mathbf v}$. We can state the CS inequality as:
$$\mathbf a\cdot\mathbf b\le||\mathbf a||\ ||\mathbf b||$$
We can then multiply by $2$ and add the terms $\mathbf a\cdot\mathbf a=||\mathbf a||^2$ and $\mathbf b\cdot\mathbf b=||\mathbf b||^2$ to both sides:
$$\mathbf a\cdot\mathbf a+2\mathbf a\cdot\mathbf b+\mathbf b\cdot\mathbf b\le||\mathbf a||^2+2||\mathbf a||\ ||\mathbf b||+||\mathbf b||^2$$
We can factor these, since dot product distributes like multiplication.
$$(\mathbf a+\mathbf b)\cdot(\mathbf a+\mathbf b)\le\left(||\mathbf a||+||\mathbf b||\right)^2$$
$$||\mathbf a+\mathbf b||^2\le\left(||\mathbf a||+||\mathbf b||\right)^2$$
$$||\mathbf a+\mathbf b||\le||\mathbf a||+||\mathbf b||$$
This is exactly the triangle inequality we want to prove. Letting $\mathbf a=\mathbf z-\mathbf x$ and $\mathbf b=\mathbf y-\mathbf z$ makes this more clear:
$$||\mathbf y-\mathbf x||\le||\mathbf z-\mathbf x||+||\mathbf y-\mathbf z||$$
