Define $f:\mathbb{N}\times \mathbb{N}\longrightarrow \mathbb{N}$ Proof that $f$ is bijective function.. I need help with this excercise:
Define $$f:\mathbb{N}\times\mathbb{N}\longrightarrow \mathbb{N}$$ 
Where, $$f(a,b)=2^{a-1}(2b-1).$$
Proof that $f$ is bijective function..
I try 
$1-$ Injective:
Get $(a,b),(c,d)\in \mathbb{N}\text{x}\mathbb{N}$ and supose that $a>c$ , $b>d$ and $f(a,b)=f(c,d)$ then,
$$2^{a-1}(2b-1)=2^{c-1}(2d-1)$$
$$2^{a-c}(2b-1)=2d-1$$
If $a \neq c$ then $2d-1$ is even, $\bot$, therefore $a=c$, then,
$$2b-1=2d-1,$$ therefore $b=d$
Then, $(a,b)=(c,d)$
This part is ok??
How proof that $f$ is surjective?
 A: Hint: $f$ surjective follows from the factoring theorem.
So take $n\in\mathbb N$, and you can write n=$2^{a-1}p_1^{\alpha_1}\ldots p_k^{\alpha_k}$ with $a,\alpha_1,\ldots,\alpha_k>0$ and $p_1,\ldots,p_k$ odd primes. Note that $a-1$ can be zero when $n$ is odd.
Then take $2b-1=p_1^{\alpha_1}\ldots p_k^{\alpha_k}$, which is guaranteed to be odd, since the product of two odd numbers is odd.
Then $f(a,b)=n$.
Also, your reasoning for $2^{a-c}(2b-1)=2d-1$ works only when $a>c$, but it can be easily fixed by symmetry.
A: Every positive $n$ integer can be writen $2^au$ (to see this write $n$ as the product of power of primes, $n=2^a3^{n_3}...p_i^{n_i}$, where $2,3,..,p_i$ are prime numbers. $3^{n_3}...p_i^{n_i}=u$ is odd)  where $u$ is odd $u=2b-1$, $f(a-1,b)=n$.
A: Suppose $n$ is odd. Then there exists a $b$ such that $2b-1=n$ and hence $f(1,(n+1)/2)=n$.
Suppose $n$ is even. Then there exists $2^{a-1}$ such that $n=2^{a-1}m$ with $m$ odd. So first determine $a$ such that $n/2^{a-1}$ is odd and realize
$$f(a-1,(n/2^{a-1}+1)/2)=2^{a-1}m=n $$
A: A simpler way to prove injectivity: it follows from unique factorisation.
Indeed, if $2^{a-1}(2b-1)=2^{c-1}(2d-1)$, both sides have the same $2$-valuation (the exponent of $2$ in their decomposition into prime factors), and as $2b-1$ and $2d-1$ are odd, this means $a-1=c-1$, i.e. $a=c$. 
Cancelling the powers of $2$, there results $2b-1=2d-1$, whence $c=d$.
Surjectivity:
If $n$ is a ntural number, let $r$ the greatest power of $2$ which divides $n$. Then $n=2^r m$, and $m$ is odd. It is easy to check that
$$n=f\Bigl(r+1,\frac{m+1}2\Bigr).$$
A: Let's fix two arbitrary integers $i,j\in \mathbb{N}-\{0\}$. Set the function $\varphi:\mathbb{R}^2\to \mathbb{R}^2$ by
$$
\varphi(x,y)=\left( 2^{x-1}(2y-1)\, , 2^{[x+i]-1}(2[y+j]-1) \right).
$$
Note that $\varphi(r,s)\in \mathbb{N}\times \mathbb{N}$ for all $r,s\in \mathbb{N}$.  If $\varphi$ is globally invertible at $\mathbb{R}^2$ for all $i,j\in \mathbb{N}-\{0\}$ then, in particular, the restriction $\varphi|_{\mathbb{N}\times \mathbb{N} }$ is also globally invertible at $\mathbb{N}^2$ for any $i,j\in \mathbb{N}-\{0\}$.
The tip to prove what you want, the idea is to use the

Hadamard global inverse function theorem. A $C^1$-map $f:\mathbb{R}^n\to \mathbb{R}^n$ is a $C^1$-diffeomorphism
  if and only if 
  the Jacobian $\det Df(z_1,\ldots,z
_n)$ never vanishes and
  $|f(x_1,\ldots,x_n)|\to\infty$ whenever $|(x_1,\ldots,x_n)|\to\infty$.

