Surjective function proof

45 Views Asked by At

Given a function $f: \mathbf{N}_0 \to \mathbf{N}_0$, defined $$ f(x) = \begin{cases} x+3 & \text{if } x \in \mathbf{N}_{\text{even}} \\ x-1 & \text{if } x \in \mathbf{N}_{\text{odd}} \end{cases} $$

I have to prove that the function is surjective.

My attempt:

Take any y ∈ N even

f(x)=y ⇒ x+3=y ⇒ x=y-3

Note x=y-3 ∈ N even and

f(x)=f(y-3)=y-3+3=y

Take any y ∈ N odd

f(x)=y ⇒ x-1=y ⇒ x=y+1

Note x=y+1 ∈ N odd and

f(x)=f(y+1)=y+1-1=y

This shows that f is surjective.

2

There are 2 best solutions below

0
On BEST ANSWER

The function $f$ is not surjective: there is no $n\in\mathbb N_0$ such that $f(n)=1$.

2
On

Your proof is not correct: if $y$ is odd, then $y+1$ will not be odd. Similarly if $y$ is even, then $y-3$ won't be even.

If the function was defined from the integers to the integers $\mathbb Z\to\mathbb Z$ then it would be surjective by the following argument (which is the "corrected version" of yours). Given $y$ there are two cases:

  1. if $y$ is even then $x:= y+1$ is odd and we have $f(x)=y$
  2. if $y$ is odd then $x:= y-3$ is even and we have $f(x)=y$

Note however that in your exercise the function is defined $\mathbb N_0 \to\mathbb N_0$. Note that there is no $x\in\mathbb N_0$ that maps to $1$ so the function is not surjective. How to see there is no such $x$? If $x$ was odd then $f(x)=x-1$ would be even, so certainly $f(x)\neq 1$. If $x$ was even $f(x)=x+3\geq 0+3>1$ (here we use that $x\geq 0$ by definition of $x\in\mathbb N_0$)