# Check if this function is injective and surjective

Check if $$f:\mathbb Z \mapsto \mathbb Z \times \mathbb N$$ $$f(x) = (2x+1, 4x^2-x)$$ is surjective and injective.

This is how I've attempted to solve this:
1. Injective
Assume that $f(a) = (x,y)$ Then, $x = 2a+1 \iff a = \frac{x-1}{2}$ and $y = 4a^2-a$. Since the expression for $a$ is injective, then the function, too, is injective.

2. Surjective
This function will never take the value of - for example - $(2,2)$, because then $x = \frac{2-1}{2} \notin \mathbb Z$

Is my answer correct? What should I change/improve?

• Did you copy the function wrong? Your $f$ isn't a function of $y$ at all, so $f(2,0) = f(2,1) = f(2,2) = \dots$.
– Mark
Jan 6, 2018 at 23:58
• @Mark Thank you, I have corrected that typo. Jan 6, 2018 at 23:59
• The yellow displayed box is still weird: what is >=? Also, the expression for $y$ is not correct, should be $4a^2-a$. But the proof is fine :) Jan 7, 2018 at 0:01
• A minor remark, but often in this type of exercise, even if not explicitly mentioned, you are generally required to prove the function is correctly defined, in this case show that $4x^2-x\ge 0$ for all $x$ (even if this looks trivial).
– zwim
Jan 7, 2018 at 0:11

$$f$$ is indeed not surjective, as you have noted. Indeed, the first component of $$f(a)$$ for any $$a\in\Bbb Z$$ cannot be even.

$$f$$ is injective because $$f(x)=f(y)\implies \begin{cases}2x+1=2y+1\\4x^2-x=4y^2-y\end{cases}\implies x=y$$

Your proof is correct. I will say your proof for lack of surjectivity is good. However, the injectivity proof looks a bit odd to me; I would approach it as I have above (i.e. by showing directly $$f(x)=f(y)\implies x=y$$).

• I agree that the injectivity proof is weird, it looks like it starts as a surjectivity proof actually. I too much prefer $f(x)=f(y)$ statement.
– zwim
Jan 7, 2018 at 0:08

What you have for surjective is correct. For what you put for injective, "the expression for $a$ being injective" would imply that the first coordinate of $f$ is surjective, which you show to be false.

All you need to do is show that the value for $x$ uniquely determines a value of $a$. So you need an inverse function that is well defined rather than injective.

Formally, you would need to first assume that $f(a) = (x,y) = f(b)$ and then show that $a = b$