# Do distance-preserving maps from $\mathbb R^2 \rightarrow \mathbb R$ exist?

So, I know that it's 'impossible' to have a perfectly bijective map $$F:\mathbb R^2 \rightarrow \mathbb R$$, but I was wondering nevertheless: what would the 'best' possible map be, that is closest to being bijective? Additionally, can you make $$F$$ 'preserve distance' in some sense - and if so, what would the best form of $$F$$ be to do that? To clarify, if you had $$n$$ points in 2-D space, $$F$$ would ensure that points clustered close together stay relatively close. Apologies if this is too vague a question!

Edit:

Maybe I should make it clearer what I mean by 'close' since I didn't define it very well. I was thinking about collision detection, which is how I initially stumbled on this question. In collision detection, if you have two (circular) objects $$A$$ and $$B$$, that have co-ords $$(x_1,y_1), (x_2,y_2)$$, they collide if the sum of the distances between them is less than the sum of their radii. Practically though, it's computationally really expensive to do this check if you have a very large number of objects. In that case, you'd want to have a rough idea of the neighbourhood of each object, and only check for collisions within that neighbourhood - some defined circular region of radius $$r$$.

If you had a map from $$\mathbb R^2 \rightarrow \mathbb R$$ (albeit a slightly imperfect, discontinuous map), then it'd be really easy to figure out what the neighbourhood is. Hopefully that makes things clearer!

• Look into Hilbert curves, I think they may be relevant. Oct 11, 2021 at 21:17
• This is a good question that can be be easily digested: we want the images of points in $\mathbb{R}^2$ under the mapping $F$ to be "close" if the points themselves are "close". To answer it though, we need to conceive of an intuitive, but precise definition of what it means for numbers in $\mathbb{R}$ to be "close" if their corresponding points in $\mathbb{R}^2$ are "close". Oct 11, 2021 at 21:22
• If you merely want to "ensure that points clustered close together stay relatively close", just take $F(x,y)=x$. But if you really want distance-preserving, then there are no such maps. There are no even maps which are continuous and 1-1. Oct 11, 2021 at 21:29
• It is possible to find a bijection between $\Bbb{R}^2$ and $\Bbb{R}$. However such a bijection cannot be continuous. Oct 11, 2021 at 21:43
• Just think about an equilateral triangle. Oct 11, 2021 at 22:27

You can have a bijection between $$\mathbb R^2$$ to $$\mathbb R$$. After all they have the same cardinalilty. But a distance preserving map cannot exist:

If $$x\in\mathbb R^2$$ and $$R\ni y=f(x)$$. Then for $$x^\ast\in S_r(x)$$ we need $$f(x^\ast) = y\pm r$$. But this means that any point on $$S_r(x)$$ can only map onto two points, so at least half of these points (in sense of measure) map to the same point (which would thus mean distance $$0$$).

In my answer, I'm going to try and make rigorous the intuitive idea of "close" points getting mapped to "close" numbers.

Given points $$\textbf{x}_1,\textbf{x}_2\in\mathbb{R}^2$$ that are "close" in some sense, we want $$F(\textbf{x}_1)$$ and $$F(\textbf{x}_2)$$ to be the same level of "close" or even closer.

Before proceeding further, there's an important issue that needs to be addressed: not everyone agrees with what it means for two points in $$\mathbb{R}^2$$ to be close. Personally, I require the distance between them be no more than $$1$$. Others may be more lenient, allowing the distance to be at most $$2$$, $$3$$, or (if they're nuts) $$14789$$. To allow anyone to use our definition, let's use a letter for our "closeness" tolerance, say $$\delta>0$$. Then for our case, if $$\textbf{x}_1$$ and $$\textbf{x}_2$$ are to be counted as "close", the distance between them needs to be at most $$\delta$$. The distance between them is $$\|\textbf{x}_1-\textbf{x}_2\|$$, so this condition can be expressed mathematically as

$$\|\textbf{x}_1-\textbf{x}_2\|\leq \delta$$

As stated, we want $$F(\textbf{x}_1)$$ and $$F(\textbf{x}_2)$$ to be either close or even closer. I don't know about you, but I don't immediately find it reasonable to use the same "closeness" tolerance $$\delta$$ here, since $$\mathbb{R}$$ and $$\mathbb{R}^2$$ are, at least on the surface, very different spaces; what we take to be "close" in $$\mathbb{R}^2$$ might be different from what we take to be "close" in $$\mathbb{R}$$. To account for this, we use a different letter for our "closeness" tolerance in $$\mathbb{R}$$, say $$\varepsilon$$. Since the distance between $$F(\textbf{x}_1)$$ and $$F(\textbf{x}_2)$$ is $$|F(\textbf{x}_1)-F(\textbf{x}_2)|$$, we want

$$|F(\textbf{x}_1)-F(\textbf{x}_2)|\leq\varepsilon$$

Motivated by our developments, we make the following definition:

Definition: given specified "closeness" tolerances $$\delta>0$$ and $$\varepsilon>0$$ for $$\mathbb{R}^2$$ and $$\mathbb{R}$$, respectively, we say that $$F:\mathbb{R}^2\to\mathbb{R}$$ maps "close" points to "close" numbers provided that for any $$\textbf{x}_1,\textbf{x}_2$$ in the domain of $$F$$, if $$\|\textbf{x}_1-\textbf{x}_2\|\leq \delta$$, then $$|F(\textbf{x}_1)-F(\textbf{x}_2)|\leq\varepsilon$$

It's important to note that this definition depends on one's tolerance for "closeness" in $$\mathbb{R}^2$$ and $$\mathbb{R}$$; a function that satisfies my "closeness" tolerances might not satisfy yours. In a sense, this definition is a function of $$\delta$$ and $$\varepsilon$$.

A few more words:

I could call it a day here, but I think there's more that can be said to this topic. Recall my earlier writing in this answer:

"...$$\mathbb{R}$$ and $$\mathbb{R}^2$$ are, at least on the surface, very different spaces; what we take to be "close" in $$\mathbb{R}^2$$ might be different from what we take to be "close" in $$\mathbb{R}$$"

Although "on the surface" it is certainly true that $$\mathbb{R}$$ and $$\mathbb{R}^2$$ are different, it doesn't take much digging to see that they are much more closely related than originally thought. Imagine laying the real line $$\mathbb{R}$$ on top of the $$x$$-axis in $$\mathbb{R}^2$$. After doing this, it should be clear that $$\mathbb{R}$$ and the $$x$$-axis are pretty much the same space. Every number in $$\mathbb{R}$$ will correspond to one and only one point in the $$x$$-axis of $$\mathbb{R}^2$$; $$1$$ corresponds to $$(1,0)$$, $$0$$ corresponds to $$(0,0)$$, $$\sqrt{2}$$ corresponds to $$(\sqrt{2},0)$$, and so on.

Thus, it seems like if two points are close in $$\mathbb{R}^2$$, they should also be close in $$\mathbb{R}$$. Since this means making our $$\mathbb{R}$$ closeness tolerance equal to that of $$\mathbb{R}^2$$'s, we will need $$\varepsilon$$ to equal $$\delta$$. Our definition then becomes the following:

Improved definition: given a specified "closeness" tolerance $$\delta>0$$, we say that $$F:\mathbb{R}^2\to\mathbb{R}$$ maps "close" points to "close" numbers provided that for any $$\textbf{x}_1,\textbf{x}_2$$ in the domain of $$F$$, if $$\|\textbf{x}_1-\textbf{x}_2\|\leq \delta$$, then $$|F(\textbf{x}_1)-F(\textbf{x}_2)|\leq\delta$$.

I hope you find this helpful :)

(From the edit I see this may not be quite what you want, but perhaps it gives some insight anyway.)

The notion that "points clustered close together stay relatively close" can be formalised as the notion of continuity. If this is the case, there cannot be a continuous $$f: \mathbb R^2\to\mathbb R$$ which is bijective. One way to see this is to remove a point from $$\mathbb R^2$$ and look at the induced map from the punctured plane to $$\mathbb R$$ minus a point, which is supposedly a continuous bijection from a connected space to a disconnected space, which is a contradiction. This generalises to maps $$\mathbb R^n\to\mathbb R$$ for all $$n\geq2$$.

So, bijectivity is too strong of a condition to impose. So how close to bijectivity can we get? Well, the image of $$f$$ is connected, hence an interval in $$\mathbb R$$. Suppose it's an open interval, the closed interval case is similar. But now pick any point $$x$$ in $$I:=\operatorname{im} f$$ and remove it, considering the restriction of $$f$$ to $$D_x:=\mathbb R^2-f^{-1}(x)$$. Then we would still have a continuous mapping $$D_x\to I-\{x\}$$. If $$D_x$$ is connected, then we again have a surjective continuous map of a connected space into a disconnected one, a contradiction. We conclude that for all $$x$$, the space $$D_x$$ is disconnected. In particular, $$f^{-1}(x)$$ is infinite as the plane minus finitely many points is still connected.

In conclusion, if we require continuity, $$f$$ cannot be bijective and in fact the preimages of each point must be really large (infinite cardinality and disconnects the plane). It is reasonable to suspect, then, that even a slight weakening of the continuity condition (e.g. continuous except at finitely many points) would still have similar issues and we can't get anything close to injectivity.