# Show that function distances are preserved

If for all $$x,y \in \mathbb{R}^n$$ that satisfies $$|x - y| = t$$ also satisfies $$|f(x) - f(y)|=t$$ (for some constant $$t \in \mathbb{R}^{+}$$), show that $$|f(x) - f(y)| = |x-y|$$ for all values of $$x,y \in \mathbb{R}^n$$.

This seems very much intuitive to me and that $$f(x) = x$$ or that the range set is a copy of $$\mathbb{R}^n$$. My initial goal was to show if $$r \in l(x,y)$$, then $$f(r) \in l(f(x),f(y))$$ such that $$|f(r)-f(z)| = |r - z|$$ where $$z \in \{x,y\}$$. Showing this is enough to solve the problem. The most intuitive idea, however that seems to work is creating equilateral triangles in some way and make it work.

$$\color{green}{\text{Edit :}}$$ In $$\mathbb{R}$$, by taking $$f$$ as the greatest integer function with a period of $$t$$, we get a clear contradiction to the initial statement. The idea doesn't seem to directly work for higher dimensions, albeit the first answer claims so. Can this (or the claim in the original question) be proven for $$n > 1$$?

• What if $f$ have derivative? – zkutch Jun 20 '20 at 1:33
• @zkutch Do you mean solving it by assuming the existence of a derivative? – oldsailorpopoye Jun 20 '20 at 1:46
• Yes, sometimes it is handy to simplify problem, solve it and then look for generalization. – zkutch Jun 20 '20 at 1:58
• Well, as is I can't see how this can be true in general. Take $t=0$ then $x=y\implies f(x)=f(y)$ is just a triviality. It won't magically makes $f$ an isometry. – zwim Jun 20 '20 at 2:04
• @AlexRavsky Not necessarily. But it would be interesting to know both sides of the cion (ie, the result when $f$ is continuous and when it is not) – oldsailorpopoye Aug 18 '20 at 14:50

This is true in $$\mathbb{R}^n$$ for $$n\ge2$$ and it is wrong in $$\mathbb{R}$$. First not that $$f:\mathbb{R}^n\to\mathbb{R}^n$$ preserves the distance $$t$$ if and only if $$\widetilde{f}(x)\triangleq\frac{1}{t}f(tx)$$ preserves the distance $$1$$. So, we may suppose that $$t=1$$ without loss of generality.

• If $$n=1$$ then the function $$f(x)=\cases{x+1&if x\in\mathbb{Z},\\ x&if x\notin\mathbb{Z}.}$$ is a counter-example.
• If $$n>1$$ then it is Beckman-Quarles theorem that date back to 1953. The article is freely accessible here.

I don't think this is true without further hypothesis (continuity maybe), because we can build counter examples with periodic stuff or similar.

In $$\mathbb R$$ take $$f(x)=\lfloor x\rfloor$$ and $$t=1$$. Then $$f(\frac12)-f(\frac 13)=0\neq \frac 12-\frac 13$$.

I think we can extend that to higher dimensions without too much issues.

• I get how this could work for $t \neq 1$ when in $\mathbb{R}$. How would you extend this to $\mathbb{R}^2$? – oldsailorpopoye Jun 20 '20 at 2:55
• This is not by massive downvotes you will give me incentives to investigate more. And surely not how it will motivate others to try their chance. – zwim Jun 20 '20 at 11:04
• That's how stack works. I see genuine questions being asked and down-voted for no rhyme or reason whatsoever. People defend their fellow SErs by saying "You have been down-voted probably because you had something wrong" which is not what I expect from MSE. I down-voted it since "this answer is not useful" to me. I will take my share of down-vote back once the answer is edited (It is not possible otherwise). Thank you! – oldsailorpopoye Jun 20 '20 at 23:02