Proving a piecewise-defined map $\mathbb Z\to\mathbb N$ is onto

35 Views Asked by At

Let $F: \mathbb Z \rightarrow \mathbb N$ be defined by $F(n) = \begin{cases} 2x, & x\ge 0 \\ -2x-1, & x\lt 0 \end{cases} $. Prove that $F$ is onto.

I Considered $y \in \mathbb N$. To find $x$ for which $F(x) =y$, $y=2x$, $x=\frac{y}{2}$ and then $F(x)=y$ and now I need to consider other 2 cases – $y$ even and $y$ odd. (stuck)

Can you help me out?

2

There are 2 best solutions below

0
On

You write the first part of the answer yourself.

If $y$ is even, $y=2k$, then we use $x=k$ Since $y$ is positive, so is $k$ $$f(k)=2k=y$$

If $y$ is odd, $y=2k-1$, then we use $x=-k$. Since $y\geq1$, $k\geq1$ and $-k\leq-1$. $$f(-k)=-2(-k)-1=2k-1=y$$

0
On

Let $y=F(n)$. In the first case we have: $$y=2n \leftrightarrow x=\frac{n}{2}$$ Because, $n\geq0$ and $y$ is even, then $n$ can vary in all naturals numbers. Let $F(n)=2n+1$. Here we have: $$n=-\frac{y+1}{2}$$ Because $y=-2n-1, n<0$, $y$ is odd so $n=-\frac{y+1}{2}$ varies in negative intgers numbers. In conclusion $F(n)$ is surjective.