1

Does exists injective functions $f$ such that $f: \Bbb Q^n \rightarrow \Bbb R^2$ or at least $f: \Bbb Z^n \rightarrow \Bbb R^2$ for $n > 2$? (for big values of $n$ more exactly, e.g n = 100)

Sorry if this is a dumb or too simple question, but I m not a math guy; I need this knowledge for a computer science project

dacian
  • 35
  • 1
    Yes - there is even a bijective function $f: \Bbb R^n \to \Bbb R^m$ for any $n, m > 0$. However the definition of such a function that a mathematician will give you may be quite unhelpful for a computer science project (they are generally extremely discontinuous and therefore do not work very well if you're interpreting $\Bbb R$ using floating-point arithmetic). Or for $\Bbb Q^n$, you can just map $(a, b, c, ...)$ to $a \sqrt 2 + b \sqrt 3 + c \sqrt 5 + \dotsb$ and so on. Can you say a little more about why you need such a function? – Izaak van Dongen Oct 14 '23 at 14:48
  • 1
    Actually, in case of $f\colon \mathbb Q^n\rightarrow \mathbb R^2$ (or even $f\colon \mathbb Q^n\rightarrow \mathbb R$) you can find a continuous injective function (because $\mathbb Q^n$ is topologically the same as $\mathbb Q$). However, I don't think you can effectively extract the formula from mathematical reasoning for computer science purposes. See https://math.stackexchange.com/questions/355779/showing-mathbbq-is-homeomorphic-to-mathbbq2 – Kulisty Oct 14 '23 at 15:22
  • @Kulisty, the "$\sqrt p$" formula I gave defines a continuous injection $\Bbb Q^n \to \Bbb R$! However it's still not very useful - I would say the main problem is that if you're mapping to the set $Y$ of $64$-bit floating point numbers, it will not actually be injective even restricted to say $X^2$, where $X$ is the set of $64$-bit integers, purely by the pigeonhole principle. In fact the map $X \to Y; n \mapsto \mathtt{float}(n)$ isn't even injective due to the lack of precision for large $n$. – Izaak van Dongen Oct 14 '23 at 15:34
  • @IzaakvanDongen I just need to map n-dimension points into 2-d points for different purposes. And related to R and Q its ok; theoretically, in a computing enviroment the max field ( set) that can be achieved is Q because we represent numbers with a finite number of decimals. Eg - you cannot compute the whole pi value; if you write it with lets say 50 decimals you can rewrite it as a fraction so it belongs to Q – dacian Oct 14 '23 at 17:55
  • @dacian, it's really hard to tell what you actually need. Can you give some examples of the purposes you're interested in? I find it extremely unlikely that such an injection will be of practical use in a program, unless the program's sole purpose is to play around with that function for recreational purposes. "Does there exist an injection $X \to Y$?" is a very different question to "is there a useful injection $X \to Y$ that I can easily implement and whose outputs are easy to work with?". There are even bijections $\Bbb Q^n \to \Bbb Z$, but I just doubt that's actually what you want! – Izaak van Dongen Oct 14 '23 at 19:22

0 Answers0