# How to show that the triangle inequality holds for this metric?

Define $d:\mathbb{Z}\times\mathbb{Z}\rightarrow \mathbb{R}$ by $\displaystyle d(m,n)=\frac{1}{\sup\{l\in\mathbb{N}: l!\text{ divides }\lvert m-n\rvert\}}$ with the obvious interpretation that when the supremum doesn't exist we define $d(m,n)=0$.

I'm having a bit of difficulty trying to show that the triangle inequality holds. Can someone give me some intuition on what direction I should head towards?

Thoughts: To show $d(m,n)\le d(m,k)+d(k,n)$, if one of either $\lvert m-k\rvert$ or $\lvert k-n\rvert$ odd then we're done. So we only need to consider the case where all of them are even. But I don't quite know how this helps.

Also as a bit of an aside, how is this metric useful? It was just an example given in the notes and the details were left as an exercise.

I don't think that you need to treat odd and even cases separately, but the parity observations are good ones.

Assume that $m, k$ and $n$ are distinct integers, since the other cases are easily dealt with. Suppose that $l_1!$ is the maximal factorial dividing $|m-k|$ and $l_2!$ is the maximal factorial dividing $|k-n|$. Without loss of generality assume $l_1\leq l_2$. Note that this implies $l_1!$ divides $l_2!$, and so $l_1!$ divides $m-k+k-n=m-n$. If $l$ is the maximal natural number whose factorial divides $m-n$, it follows that $l$ is at least $l_1$ and:

$$d(m,n) \leq \frac{1}{l_1} \leq \frac{1}{l_1}+\frac{1}{l_2} = d(m,k)+d(k,n).$$

I've never encountered this metric before, and unfortunately I haven't the foggiest idea how it might be "useful" (beyond providing an interesting exercise for those learning about metrics). Exploring properties of the topology associated to the metric might provide insight into what the metric is measuring, and this might suggest where it could arise naturally or be put to good use. Perhaps someone else will have a better idea on this part -- or you could ask the person who constructed those notes.

• A clue might be the fact that, for this metric, two integers will only have distance below 1 if they have enough factors to contain a factorial (in which case, integers which are very far apart in the usual metric can be very close together in this one.) – Semiclassical Jul 23 '14 at 5:00
• Good point. It might also be useful to note there are infinitely many numbers of maximal distance from a given number $n$ (namely all not congruent to $n$ $\mod 2$), and in fact infinitely many numbers at any given distance $\frac{1}{k}$ from the number (consider, for instance, $n+p^lk!$ for $p$ coprime to $k+1$). – vociferous_rutabaga Jul 23 '14 at 5:28
• I'm reminded of two things. 1) the $p$-adic norm (to the extent that integers which are far apart can be small in norm. 2) the factorial number system. I (rather perversely) wonder if there's such a thing as an $n!$-adic norm... – Semiclassical Jul 23 '14 at 5:36
• @MorganO: Thanks! Just to clarify, when you said that $l$ is at least $l_1$, you're assuming that the $min{l_1!,l_2!}=l_1$ right? If there are no other answers to be posted then I'll accept this as an answer. I usually make it my policy to wait at least 2 days until I accept an answer. – tcmtan Jul 24 '14 at 1:58
• @tcmtan: Yes, I'm assuming $l_1 \leq l_2$-- I should have made that clearer! I've fixed it now. – vociferous_rutabaga Jul 24 '14 at 2:08