I have to give an example of an injection $\mathbb N \times \mathbb N \times \mathbb N \to \mathbb N$.
Would something like $f(x)=x^3$ be an answer to this question?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityI have to give an example of an injection $\mathbb N \times \mathbb N \times \mathbb N \to \mathbb N$.
Would something like $f(x)=x^3$ be an answer to this question?
Hint: It might be helpful to think about the fact that prime factorizations are unique -- so that any function which yields different prime factorizations for every input will definitely be an injection.
Let $a_n(k)$ be the $n$-th digit of $k$ counted from the least significant and starting at $0$, i.e. $$a_n(k) = \lfloor 10^{-n} \cdot k \rfloor \text{ mod } 10$$ Then $$f(n_1, n_2, n_3) := \sum_{j=0}^{\infty} a_j(n_1) \cdot 10^{3j} + a_j(n_2) \cdot 10^{3j+1} + a_j(n_3) \cdot 10^{3j+3}$$ does the trick. This can be considered "mingling" the digits:
$$f(12,34,56) = 531642$$
The "advantage" over the prime-factorisation is that $f$ is also surjective with inverse. $$f^{-1}(n) = \left(\sum_{j=0}^\infty a_{3j}(n) 10^j, \sum_{j=0}^\infty a_{3j+1} 10^j, \sum_{j=0}^\infty a_{3j+2}(n) 10^j\right)$$
Hint: Use the fact that prime factorisations are unique.
I prefer (assuming that $0\notin\mathbb N$) $$ (x,y,z)\mapsto \left((2x-1)2^{y}-1\right)2^{z-1}$$ (why?)
Given a bijection $\varphi : \Bbb N \times \Bbb N \to \Bbb N$, simply use the bijection
$$(x,y,z) \to \varphi(\varphi(x,y),z)$$
For $\varphi$, you can use for example:
$$\varphi_1(x,y)=(2x+1)2^y-1$$
Or
$$\varphi_2(x,y)=\frac 1 2 (x+y)(x+y+1)+y$$
To give an idea of $\varphi_2$, here is an array with entries $a_{ij}=\varphi_2(i,j)$ (indices starting at $0$):
$$\pmatrix{ 0&2&5&9&14&20\cr 1&4&8&13&19&26\cr 3&7&12&18&25&33\cr 6&11 &17&24&32&41\cr 10&16&23&31&40&50\cr 15&22&30&39&49&60\cr }$$
And with $\varphi_1$:
$$\pmatrix{0&1&3&7&15&31\cr 2&5&11&23&47&95\cr 4&9&19&39&79&159\cr 6& 13&27&55&111&223\cr 8&17&35&71&143&287\cr 10&21&43&87&175&351\cr }$$