How to test if a function is a metric (generally)

577 Views Asked by At

I am curious if there are good sets of points to consider when you are trying to decide whether a function on $\mathbb R$ or $\mathbb R^n$ is a metric. On a past math GRE exam, I was left with the following two answers (trying to decide which is NOT a metric), and while I was able to come up with an example for the latter, I felt like I wasn't using any sort of good intuition as to what to test. I also just had no idea whether there was a simple way to test whether the former is a metric. Obviously triangle inequality is the hard axiom to check, but that is as narrow as I could get without getting into a lot of aimless trial and error.

$d(x,y)=\frac{|x-y|}{|x-y|+1}$

$d(x,y)=(x-y)^2$

Thank you.

1

There are 1 best solutions below

2
On

In general a metric $d: X\to \mathbb{R}$ (here $X$ is a metric space) is a nonnegative real valued function fullfilling the conditions:

$$d(x,y)\geqslant 0,\hspace{0.2cm} \forall x,y\in X\hspace{0.2cm}\text{and}\hspace{0.2cm}d(x,y)=0\hspace{0.2cm}\text{iff} \hspace{0.2cm}x=y\\ d(x,y)=d(y,x)\hspace{0.1cm}(\text{symmetry})\hspace{0.2cm} \forall x,y\in X\\ d(x,y)\leqslant d(x,z)+d(z,y)\hspace{0.1cm}(\text{triangle inequality})\hspace{0.2cm} \forall x,y,z\in X$$ Just check these conditions.

$\textbf{Addendum:}$ Obviously the first two conditions are trivial. I will do here for the first case only and see whether triangle inequality holds. Note that the function $f:\mathbb{R_+}\to\mathbb{R_+}$ given by $$f(t):=\frac{t}{t+1}$$ is monotone increasing (just check that the first derivative is positive on $\mathbb{R}_+$). Therefore $$d(x,y)=\frac{|x-y|}{|x-y|+1}\leqslant \frac{|x-z|+|z-y|}{|x-z|+|z-y|+1}\\=\frac{|x-z|}{|x-z|+|z-y|+1}+\frac{|z-y|}{|x-z|+|z-y|+1}\\\leqslant \frac{|x-z|}{|x-z|+1}+\frac{|z-y|}{|z-y|+1}\\=d(x,z)+d(z,y)$$ Notice we have used the fact that $|x-y|\leqslant |x-z|+|z-y|$ for all $x,y,z\in X$ (this in itself can be a nice exercise for you). So the first function is a metric. Now since your question is multiple choice surely this disqualifies the other option. But try to see what goes wrong with the other option.