Working on the book: Richard Hammack. "Book of Proof" (p. 252)
- Let $B=\{2^n:n \in \mathbb{Z}\}$. Show that the function $f: \mathbb{Z}\to B$, defined as $f(n) = 2^n$ is bijective. Then find $f^{-1}$.
The author proves surjectivity:
The function $f$ is surjective as follows. Suppose $b \in \mathbb{B}$. By definition of $B$ this means $b = 2^n$ for some $n \in \mathbb{Z}$. Then $f(n) = 2^n = b$
Perhaps I'm missing something, but I think this does not proves surjectivity. Instead, would be neccesary to take an arbitrary element $b \in B$, and show there exists an element $a \in \mathbb{Z}$ such that $f(a) = b$. In this case, letting $a = \log_2(b)$, we see $$ f(a)=f(\log_2(b))=2^{\log_2(b)}=b $$
Is my observation correct ?
That is exactly what the author did do!
S/he picked $b$ to be an arbitrary element of $B$. By the definition of $B$ all the elements of $B$ are of the form $2^n$ for some $n\in \mathbb Z$.
So s/he just let $a$ be that $n$. She just didn't want to spend the $25$ cents to buy a second variable. (If she asked me, I know a place where she can get variables wholesale.....)
That's one way to get the $a$.... but you have to then prove that $\log_2 b\in \mathbb Z$[1].
But another way to get that $a$ is to say $b = 2^n$ for some $n$, so let $a = n$.
That way you can save on the cost of the function turning handcranks. Variables are cheap but the function turning handcranks are mucho bucks if you don't need them.
====
[1] How would you prove $\log_2 b \in \mathbb Z$?
Well, really the only way I see is: ... Let $b \in B$. Then there is an integer $n$ so that $b = 2^n$. So $\log_2 b =\log_2 2^n = n$ which is an integer.