# Injective/Surjective function with multiple variables

$$f:\mathbb{Z}$$ $$\rightarrow \mathbb{Z}$$ defined by $$f(x)=mx^3 - nx$$, where $$m, n \in \mathbb{Z}$$ and $$m\not|n$$.

I am trying to prove whether or not the function is injective/subjective. How could I prove surjectivity for this function without Calculus?

Injectivity:

Suppose $$f(a) = f(b)$$ where $$a,b \in \mathbb{Z}$$. $$ma^3-na = mb^3-nb \iff ma^3-mb^3 = na-nb \iff m(a^3-b^3) = n(a-b) \iff m(a-b)(a^2+ab+b^2)=n(a-b)$$.

Case 1) $$a-b=0$$. Then $$a=b$$

Case 2) $$a-b \not= 0$$. Then $$m(a^2+ab+b^2)=n \iff a^2+ab+b^2 = \frac{n}{m}$$. Contradiction.

Taking case 1), therefore f is injective.

Surjectivity:

Suppose $$f(a)=b$$.

• Good work on the injectivity! I don't think this will necessarily be surjective. Can you think of an example where the image of $f$ only includes even integers? Mar 27 at 15:30
• Clearly, in the case where $\gcd(m, n) \neq 1$, the function isn't surjective. Mar 27 at 15:35
• @blacknapkins7, I'm not sure what you're trying to show there exactly. In general $0$ does actually lie in the image of $f$, since $f(0) = 0$. It's true that for $x \ne 0$, we have $f(x) \ne 0$, but this doesn't show $f$ isn't surjective. Mar 27 at 16:16
• @IzaakvanDongen An example would be f(2)=8m−2n⟺2(4m−n). Where would I go from there? Mar 28 at 16:30

I could not say the exact answer to the question, but I don't have enough reputation to add a comment so I'll post Answer. + I first think maybe there must be an condition that $$m$$, $$n$$ not zero at the same time.

To prove the surjectivity,

for $$f(x) = mx^3 - nx$$, put in $$\ n \$$ and $$\ n+1$$.

Then

$$f(n) = mn^3 - n^2$$

$$f(n+1) = mn^3+3n^2m+3nm+m-n^2$$

So, $$f(n+1) - f(n) = 3n^2m+3nm+m = 3m(n^2+n+1)$$

When $$n$$ is $$1$$ or $$-1$$, it has the smallest value $$1$$

Thus, If $$m \neq 0$$, it is not surjective.

If $$m = 0$$, $$f(x) = -nx$$ do the same step as above (compare n and n+1 values) and you can find it is surjective when $$n= \pm 1$$

Thus, $$\begin{cases} \mbox{surjective} & \mbox{if } \ m = 0 \ \& \ n = \pm 1 \\ \mbox{not surjective} & \mbox{Otherwise} \end{cases}$$

• I don't understand exactly what you're showing here. $f(n)$ and $f(n + 1)$ are just two values of $f$, so how are you concluding anything about surjectivity? I think that the only case where $f$ ends up being surjective is $m = 0$ (as else eventually $f$ grows too fast) and $n = \pm 1$ (as else $1$ doesn't lie in the image). Mar 27 at 16:19
• @Izaak van Dongen Oh I made a mistake. f is only surjective when n = $\pm 1$.
• @Izaak van Dongen What I showed is that the value of $f(n+1) - f(n)$ is bigger than $3$ (if $m \neq 0$). For example, if $m=1$, $f(n+1)-f(n)$ is $3(n^2+n+1)$ which means $f(n+1)-f(n) \geq 3$ thus, $\nexists n_0$ such that $f(n_0)=f(n)+1$.
• I don't think that follows. Remember $n$ is fixed, so you've shown that the two specific output values $f(n)$ and $f(n + 1)$ are far apart - this doesn't stop $f$ from being a surjection necessarily. For example, consider the function $f(x)$ given by $f(1) = 10$, $f(10) = 1$ and $f(x) = x$ otherwise. Then $f(1)$ is much bigger than $f(0)$ but $f$ is nevertheless surjective. I think the clearest reason that $f$ fails to be surjective for $m \ne 0$ in this question is the asymptotic behaviour - for large $x$, $\lvert f(x + 1) - f(x) \rvert$ is large, and $f$ is odd, so $f$ can't be surjective. Mar 28 at 7:03