1
$\begingroup$

Prove that the following function is invertible: $g:\mathbb{Z}\rightarrow\mathbb{N}$

$ g(x) = \left\{ \begin{array}{lr} -2x & : x\le0\\ 2x-1 & : x>0 \end{array} \right. $

I'm having an issue proving that it is one-to-one in all cases. The cases where $x_{1},x_{2}\le0$ and $x_{1},x_{2}>0$ both pass proof by contrapostitive where $g(x_{1})=g(x_{2})$. I'm having a problem proving it is also one-to one if $x_{1}\le0$ but $x_{2}>0$ which would result in:

$ -2x_{1}=2x_{2}-1 $ $ x_{1}=-x_{2}+\frac{1}{2} $

I know I'm going something wrong in my thinking and I have a sneaking suspicion it has something to do with the fact that I'm mapping to $\mathbb{N}$, but I'm completely unsure of where to go from here.

  • 0
    Sorry, it's actually $\mathbb{Z}\rightarrow\mathbb{N}$. Let me edit my question.2012-10-20

1 Answers 1

0

$-2x$ will always give you a nonnegative, even integer, when $x \leq 0$. And, $-2x$ is strictly decreasing. $2x - 1$ will always give a positive, odd integer, when $x > 0$. And, $2x - 1$ is strictly increasing. That's all you need.

  • 0
    @kamikazekent Correct. Injective means that $g(x_1) = g(x_2)$ implies $x_1 = x_2$. Or, equivalently, the contrapositive is $x_1 \neq x_2$ implies $g(x_1) \neq g(x_2)$. So, pick two $x$ values that are both $x \leq 0$. The fact that the function is strictly decreasing implies $g(x_1) \neq g(x_2)$. Similarly if your two $x$ values are both > 0. And, if one is nonpositive and one is positive, then $g(x_1)$ is even and $g(x_2)$ is odd, so they're not equal then also.2012-10-20