[Math] Prove that f is a bijection

functions

Define the function
$$f : \{n \mid n = 3m − 1 \text{ for some } m \in \mathbb{Z}\} \rightarrow \{k \mid k = 4m + 2 \text{ for some } m \in \mathbb{Z}\}$$
by
$$f(n)=\frac{4(n+1)}{3}-2$$
Prove that $f$ is a bijection.

I am aware that I need to prove $f$ is injective and surjective and therefore, a bijection. How should I approach this? (The lecturer has written "Backwards proof" on my script and marked my answer as incorrect)

Edit (my answer as requested in comments)

Edit2 (switched incorrectly labelled domain and codomain)

if
$$f(x) = f(y)$$
then
$$\frac{4(x+1)}{3}-2 = \frac{4(y+1)}{3}-2$$
$$x = y \text{ }$$
Therefore the function is injective.

Let
$$m \in \mathbb{Z} \text{, } 3m-1 \in \mathbb{D} \text{ (domain)}$$
$$m+1 \in \mathbb{Z} \text{, } 3(m+1)-1 \text{, } 3m+2 \in \mathbb{D}$$
$$f(3m+2) = \frac{4((3m+2)+1)}{3}-2$$
$$f(3m+2) = \frac{4(3m+3)}{3}-2$$
$$f(3m+2) = \frac{12m+12)}{3}-2$$
$$f(3m+2) = 4m+4-2$$
$$f(3m+2) = 4m+2$$
$$4m+2 \in \mathbb{C} \text{ (codomain)}$$
Therefore the function is surjective.

Since the function is injective and surjective, it is a bijection.

Best Answer

First, note that the function is indeed well-defined: if $n=3m-1$, then $$f(n) = \frac{4(n+1)}{3}-2 = \frac{4(3m-1+1)}{3}-2 = \frac{4(3m)}{3} -2= 4m-2 = 4(m-1)+2$$ which is in the (alleged) codomain.

There are now two ways of showing this: either prove that $f$ is injective and onto; or prove that $f$ has an inverse.

The computation above might help to show the function is onto: if you take $4k+2$ in the image, what value of $n$ will give you $f(n) = 4k+2$?

It might also help with one-to-one: if $f(a)=f(b)$, with $a=3m-1$ and $b=3n-1$, then by the computations above we get $4m-2 = f(a) = f(b) = 4n-2$. What does that tell us about $a$ and $b$?

Alternatively: define $$g\colon \{k\mid k=4m+2\text{ for some }m\in\mathbb{Z}\}\to \{n\mid n=3m-1\text{ for some }m\in\mathbb{Z}\}$$ by letting $$g(4m+2) = 3(m+1)-1.$$ Verify that $f(g(4m+2)) = 4m+2$ and $g(f(3m-1)) = 3m-1$, proving that $g=f^{-1}$, so $f$ is bijective.

Related Question