[Math] Prove that $f$ is Injective and Surjective: $f:N\times N \rightarrow N :f(m,n)= 2^{m-1}(2n-1)$

discrete mathematics

I`m trying to prove that $f$ is Injective and Surjective
$$f:N\times N \rightarrow N :f(m,n)= 2^{m-1}(2n-1)$$
what I did so far is to set $m_{1},m_{2},n_{1},n_{2}$

so by definition of injective function if $f(x1)=f(x2) \rightarrow x1=x2$
$$2^{m_1-1}(2n_1-1)=2^{m_2-1}(2n_2-1)$$
$$2^{m_1}(2n_1-1)=2^{m_2}(2n_2-1)$$
from here, if $n_1=n_2$ so $m_1=m_2$ and its enough right?
I would like to get some advice how to do that, I dont know if I did right.
Thanks!

Best Answer

Hint:

$$\begin{align}2^{m_1}(2n_1-1)&=2^{m_2}(2n_2-1)\\ \frac{2^{m_1}}{2^{m_2}}(2n_1-1)&=(2n_2-1)\\ 2^{m_1-m_2}(2n_1-1)&=(1)(2n_2-1) \\ 2^{m_1-m_2}(2n_1-1)&=2^0(2n_2-1) \\ m_1-m_2=0\end{align} $$

Related Question