# How to prove if a function is bijective?

I am having problems being able to formally demonstrate when a function is bijective (and therefore, surjective and injective). Here's an example:

How do I prove that $g(x)$ is bijective?

\begin{align} f &: \mathbb R \to\mathbb R \\ g &: \mathbb R \to\mathbb R \\ g(x) &= 2f(x) + 3 \end{align}

However, I fear I don't really know how to do such. I realize that the above example implies a composition (which makes things slighty harder?). In any case, I don't understand how to prove such (be it a composition or not).

For injective, I believe I need to prove that different elements of the codomain have different preimages in the domain. Alright, but, well, how?

As for surjective, I think I have to prove that all the elements of the codomain have one, and only one preimage in the domain, right? I don't know how to prove that either!

EDIT

f is a bijection. Sorry I forgot to say that.

• Normally one distinguishes between the two different arrows $\mapsto$ and $\to$. One writes $f:\mathbb{R}\to\mathbb{R}$ to mean $f$ is a function from $\mathbb{R}$ into $\mathbb{R}$. The notation $x\mapsto x^3$ means the function that maps every input value to its cube. – Michael Hardy Jul 1 '12 at 20:39
• Wouldn't you have to know something about $f$? Is $f$ a bijection? – Dylan Moreland Jul 1 '12 at 20:40
• My apologies! Yes, f is a bijection. – Zol Tun Kul Jul 1 '12 at 20:40
• Both of your deinitions are wrong. Maybe all you need in order to finish the problem is to straighten those out and go from there. I've posted the definitions as an answer below. – Michael Hardy Jul 1 '12 at 20:45

## 5 Answers

The way to verify something like that is to check the definitions one by one and see if $g(x)$ satisfies the needed properties.

Recall that $F\colon A\to B$ is a bijection if and only if $F$ is:

1. injective: $F(x)=F(y)\implies x=y$, and
2. surjective: for all $b\in B$ there is some $a\in A$ such that $F(a)=b$.

Assuming that $R$ stands for the real numbers, we check.

Is $g$ injective?

Take $x,y\in R$ and assume that $g(x)=g(y)$. Therefore $2f(x)+3=2f(y)+3$. We can cancel out the $3$ and divide by $2$, then we get $f(x)=f(y)$. Since $f$ is a bijection, then it is injective, and we have that $x=y$.

Is $g$ surjective?

Take some $y\in R$, we want to show that $y=g(x)$ that is, $y=2f(x)+3$. Subtract $3$ and divide by $2$, again we have $\frac{y-3}2=f(x)$. As before, if $f$ was surjective then we are about done, simply denote $w=\frac{y-3}2$, since $f$ is surjective there is some $x$ such that $f(x)=w$. Show now that $g(x)=y$ as wanted.

Alternatively, you can use theorems. What sort of theorems? The composition of bijections is a bijection. If $f$ is a bijection, show that $h_1(x)=2x$ is a bijection, and show that $h_2(x)=x+2$ is also a bijection. Now we have that $g=h_2\circ h_1\circ f$ and is therefore a bijection.

Of course this is again under the assumption that $f$ is a bijection.

• "Subtract 3 and divide by 2, again we have (y−3)/2=f(x). As before, if f was surjective then we are about done" I'm not sure, but why would we be done there? – Zol Tun Kul Jul 1 '12 at 21:18
• @Omega: If $f$ was surjective, then there is some $x$ such that $f(x)=\frac{y-3}2$, show now that $g(x)=y$. – Asaf Karagila Jul 1 '12 at 21:20
• You know, it had me thinking: according to your method to find out if it is injective, no matter what function I test it with, I always manage to get the final equality (x = y). How would a function ever be not-injective? – Zol Tun Kul Jul 1 '12 at 22:34
• @Omega: No, assume that $f(x)=0$ for all $x$, suppose that $x,y$ are any two real numbers (perhaps different and perhaps not), does $f(x)=f(y)$ tell you something about $x=y$ or $x\neq y$? No, because taking $x=1$ and $y=2$ gives $f(1)=0=f(2)$, but $1\neq 2$. Note that my answer relies critically on the fact that $f$ itself is injective. – Asaf Karagila Jul 1 '12 at 22:37

To prove a function is bijective, you need to prove that it is injective and also surjective.

"Injective" means no two elements in the domain of the function gets mapped to the same image.

"Surjective" means that any element in the range of the function is hit by the function.

Let us first prove that $g(x)$ is injective. If $g(x_1) = g(x_2)$, then we get that $2f(x_1) + 3 = 2f(x_2) +3 \implies f(x_1) = f(x_2)$. Since $f(x)$ is bijective, it is also injective and hence we get that $x_1 = x_2$.

Now let us prove that $g(x)$ is surjective. Consider $y \in \mathbb{R}$ and look at the number $\dfrac{y-3}2$. Since $f(x)$ is surjective, there exists $\hat{x}$ such that $f(\hat{x}) = \dfrac{y-3}2$. This means that $g(\hat{x}) = 2f(\hat{x}) +3 = y$. Hence, given any $y \in \mathbb{R}$, there exists $\hat{x} \in \mathbb{R}$ such that $g(\hat{x}) = y$. Hence, $g$ is also surjective.

Hence, $g(x)$ is bijective.

In general, if $g(x) = h(f(x))$ and if $f(x) : A \to B$ and $h(x): B \to C$ are both bijective then $g(x): A \to C$ is also bijective.

In your case, $f(x)$ was bijective from $\mathbb{R} \to \mathbb{R}$ and $h(x) = 2x+3$ is also bijective from $\mathbb{R} \to \mathbb{R}$.

First show that $g$ is injective ($1$-$1$) by showing that if $g(x)=g(y)$, then $x=y$. This isn’t hard: if $g(x)=g(y)$, then $2f(x)+3=2f(y)+3$, so by elementary algebra $f(x)=f(y)$. By hypothesis $f$ is a bijection and therefore injective, so $x=y$.

Now show that $g$ is surjective. To do this, you must show that for each $y\in\Bbb R$ there is some $x\in\Bbb R$ such that $g(x)=y$. That requires finding an $x\in\Bbb R$ such that $2f(x)+3=y$ or, equivalently, such that $f(x)=\frac{y-3}2$. But $f$ is known to be a bijection and hence a surjection, so you know that there is such an $x\in\Bbb R$.

In general this is one of the two natural ways to show that a function is bijective: show directly that it’s both injective and surjective. The other is to construct its inverse explicitly, thereby showing that it has an inverse and hence that it must be a bijection. You could take that approach to this problem as well:

$$g^{-1}(y)=f^{-1}\left(\frac{y-3}2\right)\;,$$

since

\begin{align*} g\left(f^{-1}\left(\frac{y-3}2\right)\right)&=2f\left(f^{-1}\left(\frac{y-3}2\right)\right)+3\\ &=2\left(\frac{y-3}2\right)+3\\ &=y\;, \end{align*}

and since $f$ is a bijection, $f^{-1}\left(\frac{y-3}2\right)$ exists for every $y\in\Bbb R$.

Added: As Marc reminds me, this is only half the job: if you take this approach, you must either show directly that $g$ is injective, as I did above, or verify that the function that I called $g^{-1}$ above is a two-sided inverse, i.e., that $g^{-1}\big(g(x)\big)=x$ for $x\in\Bbb R$. This is not particularly difficult in this case:

\begin{align*} g^{-1}\big(g(x)\big)&=g^{-1}\big(2f(x)+3\big)\\ &=f^{-1}\left(\frac{\big(2f(x)+3\big)-3}2\right)\\ &=f^{-1}\big(f(x)\big)\\ &=x\;, \end{align*}

since $f$ is a bijection.

• When using the "inverse" criterion, you should be careful in really checking that a purported inverse is an inverse, both ways. With $g^{-1}$ denoting your purported inverse, your final argument checked that $g(g^{-1}(y))=y$ for all $y\in\mathbb R$; this only shows that $g$ is surjective (it has a right inverse, also called a section). To show that $g$ is also injective you need to separately check that $g^{-1}(g(x))=x$ for all $x\in\mathbb R$. – Marc van Leeuwen Jul 1 '12 at 21:22
• @Marc: Yes, I should probably say as much; I hadn’t originally intended to mention this approach at all, and did so only as an afterthought. I was implicitly assuming that the obvious injectivity had already been checked, but that’s not clear from what I wrote. – Brian M. Scott Jul 1 '12 at 21:26

You haven't said enough about the function $f$ to say whether $g$ is bijective.

"Injective" means different elements of the domain always map to different elements of the codomain.

"Surjective" means every element of the codomain has at least one preimage in the domain.

Later edit: What you've now added---that $f$ is a bijection---bring us to the point where we can answer the question. However, maybe you should look at what I wrote above. Since both definitions that I gave contradict what you wrote, that might be enough to get you there.

• Sorry, yes, f is bijective. Thank you for clarifying that :) – Zol Tun Kul Jul 1 '12 at 20:43

My professor always stressed this unique approach that I have not seen anywhere else really. If you wish to prove that a function is bijective, you can prove that for every single element in the codomain, there exists a unique element in the domain. (or for every element in the domain there exists a unique element in the codomain). If this is too hard, you simply prove for $$f: X \to Y$$

1) injectivity $$f(a)=f(b) \implies a=b$$

2) surjectivity $$\forall b\in \text{Image}(f)$$ we know $$\exists a \in \text{domain}(f)$$ such that $$f(a)=b$$.

Sometimes it is nice to hit two birds with one stone.