[Math] Prove a functions is injective

discrete mathematicsfunctions

Prove the function
$f:\mathbb{N} \to\mathbb{N}$
defined by $f(x)=2^x$ for all $x$ in $\mathbb{N}$ is one to one.

Is my proof correct and if not what errors are there.

For all $x_1,x_2$ $\in$$N$, if $f(x_1)=f(x_2)$, then $x_1=x_2$
$f(x)=2^x$
Assume $f(x_1)=f(x_2)$ and show $x_1=x_2$
$2^{x_1}=2^{x_2}$
$x_1=x_2$ , which means $f$ is injective.

Best Answer

Looks like you got it down. I don't see any errors in comprehension; just a little redundancy in the layout of the proof. If I were to make changes I would completely do away with the line "For all $x_1,x_2$ $\in$$N$, if $f(x_1)=f(x_2)$, then $x_1=x_2$ $f(x)=2^x$" then edit the rest of your proof to read

"Assume $f(x_1)=f(x_2)$. Then $$2^{x_1}=2^{x_2} \\ \implies \frac{2^{x_1}}{2^{x_1}} = \frac{2^{x_2}}{2^{x_1}} \\ \implies 1 = 2^{x_2-x_1}$$ And we know $a^b = 0$ whenever $a \neq 0$ and $b = 0$. Hence, $x_1-x_2=0$ so $f$ is one-to-one."