[Math] A function that’s injective but not surjective.

functionsreal-analysis

I'm trying to think of functions that are injective but not surjective between various sets. I can think of $f(x) = e^x$ for $f: \mathbb{R} \rightarrow \mathbb{R}$ (since the range should be positive $\mathbb{R}$ for this to be surjective, but $\mathbb{R}^+$ is a subset of $\mathbb{R}$) and $f(a,b) = a^b$ for $f: \mathbb{Z}\times\mathbb{Z} \rightarrow \mathbb{R}$ (the range should be $\mathbb{Q}$ for this to be surjective, but $\mathbb{Q}$ is a subset of $\mathbb{R}$) but is there any such function (injective, not surjective) from $\mathbb{Z}\times\mathbb{Z} \rightarrow \mathbb{Z}$?

Best Answer

Yes, there is such a function. Define $f: \Bbb Z \times \Bbb Z \to \Bbb Z$ by $$f(m,n) = \begin{cases} 2^{m}3^{n} & m, n \geq 0 \\ 5^{-m}7^{-n} & m, n < 0 \\ 11^{m}13^{-n} & m > 0, n < 0 \\ 17^{-m}19^{n} & m < 0, n > 0 \end{cases}.$$ You should prove this is injective. For it not being surjective: which pair of numbers is being sent to any negative integer? The range of $f$ is a subset of the positive integers.