Finding Injectivity in function

58 Views Asked by At

I have a doubt with the following problem. I have to find if the function is injective, surjective and if bijective find the inverse function

$$f : \mathbb{Z} \longrightarrow \mathbb{N},\qquad f(a) = \begin{cases} 2a & \text{if } a >0, \\ 1 - 2a & \text{if } a \le 0. \\ \end{cases}$$

The solution to the problem:

Injectivity: $f(a)=f(b) \Rightarrow a=b$. Taking a $x_{1}$,$x_{2} \in \mathbb{Z}$, I separate into the following cases:

1) $x_ {1} > 0$, $x_{2} > 0:\; 2x_{1} = 2x_{2} \Rightarrow x_{1} = x_{2}$

2) $x_ {1} \le 0$, $x_{2} \le 0:\; 1-2x_{1} = 1-2x_{2} \Rightarrow x_{1} = x_{2}$

3) $x_{1} > 0, x_{2} \le 0:\;2x_{1} = 1-2x_{2} \Rightarrow 2x_{1} + 2x_{2} = 1 \Rightarrow (x_{1} + x_{2}) = 1/2$

The case $x_{2} > 0$, $x_{1} \le 0$, gives the same answer as the third case. My question is that if this conclusion makes the function not injective, or it simply is telling me that this is a case that cannot happen since $x_{1}$,$x_{2} \in \mathbb{Z}$.

Putting aside this, the function also is surjective and I could find the inverse function, that is

$$f^{-1} : \mathbb{N} \longrightarrow \mathbb{Z},\qquad f^{-1}(a) = \begin{cases} \text{a/2} &\text{if $a$ is even,} \\ \text{(1 - a)/2} &\text{if $a$ is odd.} \\ \end{cases} $$

Is this correct?

PD: First time writing LATEX, feedback is very welcomed!

2

There are 2 best solutions below

0
On BEST ANSWER

For the 3rd and 4th cases, you just have to say it can't happen since $x_1$ and $x_2$ are integers.

However, I would put all this differently: the restrictions of $f$ to positive integers and to nonpositive integers are, separately, injective (affine functions).

Furthermore, if one of $x_1,x_ 2$ is $>0$ and the other $\le0$, one of $f(x_1), f(x_2)$ is an even and the other an odd integer. So they can't be equal, which proves that, globally, $f$ is injective.

1
On

The function is injective if you draw the graph. It looks like a ''V''.

But it is not surjective, since $0$ doesn't lie in the image: If $a>0$, then $f(a)=2a>0$ and if $a$ is non-positive, the function has the form: $f(0) = 1$, $f(-1)=3$, $f(-2)=5$ and so on.