Prove that triangle inequality holds for $d(x,y) = \frac{|x-y|}{1+|x-y|}$

91 Views Asked by At

I got 0 points for the proof I gave, and I would like to know the mistakes I made. Thank you.

Want to show: $$\frac{|x-y|}{1+|x-y|} \le \frac{|x-z|}{1+|x-z|} + \frac{|z-y|}{1+|z-y|}$$ $$\frac{|x-y|}{1+|x-y|} \le \frac{|x-z|+2|x-z||z-y|+|z-y|}{(1+|x-z|)(1+|z-y|)}$$ Let $a = |x-y|, b = |x-z|, c = |z-y|$. We have already shown that $|x-y| \le |x-z|+|z-y|$ (i.e. $a \le b + c$). $$\frac{a}{1+a} \le \frac{b+2bc+c}{(1+b)(1+c)}$$ $$a (1+b+c+bc) \le (b+2bc+c)(1+a)$$ $$a+ab+ac+abc \le b+2bc+c+ab+2abc+ac$$ $$a \le b+c+2bc+abc$$, which we know is true, $\because a \le b + c$. So $d(x,y)$ satisfies the triangle inequality.

My grader wrote that if $a=1; b=c=0$ then the inequality does not hold. But if $b=c$, then $x=z=y$, and therefore $a = 0$ too.

1

There are 1 best solutions below

7
On BEST ANSWER

The following is OP's proof plus my annotations (in red), which would make it rigorous IMHO.

Want to show: $$ \color{red}{d(x,y) \le d(x,z)+d(z,y)} \tag{1} $$ $$ \color{red}{\iff\quad}\frac{|x-y|}{1+|x-y|} \le \frac{|x-z|}{1+|x-z|} + \frac{|z-y|}{1+|z-y|} $$ $$ \color{red}{\iff\quad}\frac{|x-y|}{1+|x-y|} \le \frac{|x-z|+2|x-z||z-y|+|z-y|}{(1+|x-z|)(1+|z-y|)} \tag{2} $$

Let $\,a = |x-y|, \,b = |x-z|, \,c = |z-y|\, \color{red}{\;\style{font-family:inherit}{\text{where}}\; a,b,c \ge 0 \;\;\;(3)\,}\,$.
We have already shown that $|x-y| \le |x-z|+|z-y|$ i.e.  $\;\color{red}{\iff}a \le b + c \;\;\;\color{red}{(4)}\,$.
$\color{red}{\style{font-family:inherit}{\text{Then}}\; (2)} \;\color{red}{\style{font-family:inherit}{\text{can be rewritten in terms of}}\; a,b,c \;\style{font-family:inherit}{\text{as follows}}}\,$:

$$\frac{a}{1+a} \le \frac{b+2bc+c}{(1+b)(1+c)} \tag{5}$$

$\color{red}{\style{font-family:inherit}{\text{The denominators are positive on both sides because of}}\;(3) ,\style{font-family:inherit}{\text{and after eliminating them}}:}$

$$a (1+b+c+bc) \le (b+2bc+c)(1+a)$$ $$\color{red}{\iff\quad}a+ab+ac+abc \le b+2bc+c+ab+2abc+ac$$ $$\color{red}{\iff\quad}a \le b+c+2bc \color{red}{+abc} \tag{6}$$

which we know is true $\because a \le b + c$ $\,\color{red}{\style{font-family:inherit}{\text{by}}\;(4)}\,$.

$\color{red}{\style{font-family:inherit}{\text{Since we proved}}\;(6)\;\style{font-family:inherit}{\text{to hold true,}}}$ $\color{red}{\style{font-family:inherit}{\text{and all steps from}}\;(1)\; \style{font-family:inherit}{\text{to}} \;(6)\;}$ $\color{red}{\style{font-family:inherit}{\text{are reversible equivalences,}}}$ $\color{red}{\style{font-family:inherit}{\text{the above proves}}\;(1)}\,$. So $d(x,y)$ satisfies the triangle inequality.

As a side comment, my grader wrote that if a=1, b=c=0 then the inequality does not hold their choice of values is inconsistent with $\,(4)\,$ so it cannot be used as a counterexample to dispute or invalidate the proof.

As for I would very much like to know how I can improve one way would be to write your own version of the above (note: do not copy/paste, make it your own proof), and ask the grader what they think about it. That should give you a better sense of what the requirements/expectations are.