# Is a function in the form of $f(x) = (x^2, x + 1)$ injective or surjective?

I understand the method used to prove injectivity or surjectivity, however, I am confused as to how to handle a function that presents itself as a set $(m,n)$.

In the example, $f:Z \rightarrow Z \times Z$, $f(x) = (x^2, x + 1)$

We know that $x^2$ is not injective as we can find for example $f(-1) = f (1) = 1$.

However, we also know that the second part of the equation is injective as we can deduct that:

$x + 1 = y + 1$

$x = y$

The form $(m, n)$ of the function is what is really confusing me.

1. Would it be correct to conclude that the function is injective since it will produce a set of unique $(m,n)$ values for each $x$?
2. If so, how would we define such a function to be surjective since there will exists coordinates for which there is no corresponding $x$? Would I be correct to conclude that the function is not surjective?

3. Also, if a function was in the form $f(x) = z + 5$, would it be correct to conclude that the function is not well defined, and thus we can't determine if it's surjective\injective due to the fact that it's based on a ambiguous variable $z$?

• Are you sure this is a function from $\mathbb{Z} \to \mathbb{Z}$ and not to $\mathbb{Z}^2$? – ImHereSometimes Oct 17 '17 at 21:08
• You are absolutely correct. My apologies, I will edit it! – hisoka Oct 17 '17 at 21:08
• All your answers are correct! – Bram28 Oct 17 '17 at 21:19

1. You are correct to assume $f$ is injective. A function $f(x)$ is injective iff $f(x) = f(y) \implies x = y$. It is true that $f$ returns two values, but the criterion is the same. If $f(x) = f(y)$, in particular the two second coordinates are the same, but like you said, $x + 1 = y + 1 \iff x = y$;

2. You are correct to assert $f$ is not surjective, as there is no $x$ such that $f(x) = (-1, 1)$, for example. An example of a surjective function could be a function that goes around in a spiral (for non-negative $x$) covering all points in $\mathbb{Z}^2$. That would be $f(0) = (0, 0), f(1) = (1,0), f(2) = (1,1), f(3) = (0,1), f(4) = (-1, 1), f(5) = (-1, 0), \cdots$, but I don't know how to write that in a clean way. For $x < 0$ we could just take anything you like.

3. Also right! Defining $f(x) = z+5$ is nonsensical, unless you previously stated that $z$ is some constant. In that case $f$ would be a constant function.

• How is your $g$ surjective? For what value of $x$ does $g(x)=(0,0)$? – G Tony Jacobs Oct 17 '17 at 22:14
• @GTonyJacobs For none, I don't know what I was thinking D: Please check my new example. – RGS Oct 17 '17 at 22:15

$$f:\mathbb{Z} \to \mathbb{Z}^2$$

If $f(x)=f(y)$, then we have $(x^2, x+1) =(y^2, y+1)$, hence $x+1=y+1$ of which we can conclude that $x=y$, hence it is injective.

It is not surjective, for example, $(2,3)$ is not in the image set.

As for your last question, what do you mean by $z$? I don't think it is well defined.