Skip to main content
\(\require{mathrsfs}\newcommand{\abs}[1]{\left| #1 \right|} \renewcommand{\emptyset}{\varnothing} \DeclareMathOperator{\dom}{dom} \DeclareMathOperator{\range}{rng} \DeclareMathOperator{\perm}{perm} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section5.9Function Review

1

Find a bijection between the closed intervals \([a,b]\) and \([c,d]\) with \(a \lt b\) and \(c \lt d\text{.}\) You must prove that the function you construct is a bijection.

Solution

You really want to use a line segment. Let's start by finding a bijection \(f : [0,1] \to [a,b]\text{.}\) So, we could make the graph of our function a line through \((0,a)\) and \((1,b)\text{.}\) The formula for such a line is \(f(x) = (b-a)x + a\text{.}\)

We claim that \(f\) is a bijection. First, notice that since \(0 \le x \le 1\) and \(b-a \gt 0\text{,}\) we have \(a \le (b-a)x + a \le (b-a)+a = b\text{,}\) so \([a,b]\) is a valid codomain. Now suppose \(f(x) = f(y)\text{.}\) Then \((b-a)x + a = (b-a)y + a\) so \((b-a)x = (b-a)y\) and hence \(x = y\) since \(b-a \gt 0\text{.}\) Thus \(f\) is injective. Now let \(z \in [a,b]\) and consider \(x = \frac{z-a}{b-a}\) which lies in \([0,1]\) since \(z \in [a,b]\text{.}\) Then a computation guarantees that \(f(x) = z\text{,}\) so \(f\) is surjective.

Now, the function \(g : [0,1] \to [c,d]\) given by \(g(x) = (d-c)x + c\) is also a bijection, and its inverse is given by the formula \(g^{-1}(x) = \frac{x-c}{d-c}\text{.}\) Then \(f \circ g^{-1} : [c,d] \to [a,b]\) is a bijection and \((f \circ g^{-1})(x) = (b-a) \frac{x-c}{d-c} + a\text{.}\)

2

Let \(f : A \to B\) and \(g : C \to D\) be functions. Define \(f \times g = \{ \big( (a,c), (b,d) \big) \mid (a,b) \in f \wedge (c,d) \in g \}\text{.}\) Prove that \(f \times g\) is a function from \(A \times C\) to \(B \times D\) and find a formula for \((f \times g)(a,c)\) in terms of \(f(a)\) and \(g(c)\text{.}\)

3

In each case, find functions \(f : A \to B\) and \(g : B \to C\) (you get to pick the sets in each case) with the stated properties:

  1. \(f\) is surjecetive, but \(g \circ f\) is not surjective.
  2. \(g\) is surjective, but \(g \circ f\) is not surjective.
  3. \(g \circ f\) is surjective, but \(f\) is not surjective.
  4. \(f\) is injective, but \(g \circ f\) is not injective.
  5. \(g\) is injective, but \(g \circ f\) is not injective.
  6. \(g \circ f\) is injective, but \(g\) is not injective.
4

Consider the functions \(f : (-\infty,0] \to \mathbb{R}\) and \(g : [0,\infty) \to \mathbb{R}\) given by the formulae \(f(x) = x^2\) and \(g(x) = \cos x\text{.}\) Is \(f \cup g\) a function? Justify.

Solution

No, \(f \cup g\) is not a function because \(f(0) = 0\) (so \((0,0) \in f\)) and \(g(0) = \cos 0 = 1\) (so \((0,1) \in g\)), and hence \((0,0),(0,1) \in f \cup g\text{.}\) Thus there is an element in the domain of \(f \cup g\) which is related to two different elements, and so \(f \cup g\) cannot be a function.

5

Suppose \(f : A \to B\) and \(g : A \to C\) are functions with the same domain. Prove that

\begin{equation*} \langle f,g \rangle := \{ (a,(b,c)) \in A \times (B \times C) \mid (a,b) \in f, (a,c) \in g \} \end{equation*}

is a function.

Solution

Consider any element \(a \in A\text{,}\) then \(f(a) \in B, g(a) \in C\) and so \((a,f(a)) \in f\) and \((a,g(a)) \in g\text{.}\) Hence \((a,(f(a),g(a)) \in \langle f,g \rangle\text{.}\) Moreover, suppose \((a,(b,c)) \in \langle f,g \rangle\text{.}\) Then \((a,b) \in f\) and \((a,c) \in g\text{.}\) Since \(f,g\) are functions, their outputs are unique, so \(b = f(a)\) and \(c = g(a)\text{.}\) Therefore, \((a,(b,c)) = (a,(f(a),g(a)))\text{.}\) Thus \(\langle f,g \rangle\) is a function.

6

Prove that \(f : \mathbb{R} \to \mathbb{R}\) given by \(f(x) = 3x^3 + 5\) is injective and surjective.

Hint

Injectivity should be very easy. For surjectivity, try using the intermediate value theorem from calculus (I will allow you to assume without proof that \(f\) is continuous).

Solution

Let \(x,y \in \mathbb{R}\) and suppose \(f(x) = f(y)\text{.}\) Then \(3x^3 + 5 = 3y^3 + 5\) and so \(3x^3 = 3y^3\) and also \(x^3 = y^3\text{.}\) Taking cube roots we find \(x = y\text{.}\) Thus \(f\) is injective.

Suppose \(z \in \mathbb{R}^2\text{.}\) Then \(z \le \abs{z}\text{.}\) If \(\abs{z} \le 1\text{,}\) then \(\abs{z} \le 5\) and if \(\abs{z} \ge 1\text{,}\) then \(\abs{z} \le 3\abs{z}^3\text{.}\) Either way \(\abs{z} \le f(\abs{z})\text{.}\)

We know \((-\abs{z}-2)^3 = -\abs{z}^3-6\abs{z}^2-12\abs{z}-8 \le -\abs{z}-8\text{.}\) Thus \(f(-\abs{z}-2) = 3(-\abs{z}-2)^3 + 5 \le -3\abs{z}-24 + 5 \le -\abs{z} \le z\text{.}\)

Thus \(f(-\abs{z}-2) \le z \le f(\abs{z})\text{.}\) Therefore, since \(f\) is continuous, by the intermediate value theorem there is some \(x \in [-\abs{z}-2, \abs{z}]\) for which \(f(x) = z\text{.}\)

7

Prove that \(\sqrt{\cdot} : \{ x \in \mathbb{R} \mid x \ge 0 \} \to \mathbb{R}\) is injective.

Solution

Suppose \(y,z \in \{ x \in \mathbb{R} \mid x \ge 0\}\) and \(\sqrt{y} = \sqrt{z}\text{.}\) Then, by the definition of square root, \(y = (\sqrt{y})^2 = (\sqrt{z})^2 = z\text{.}\) Therefore \(\sqrt{\cdot}\) is injective on this domain.

Note, we could have also proved this by noting that this is the inverse of the squaring function \((\cdot)^2\) restricted to the nonnegative real numbers, and inverses of functions are always injective by another exercise.

8

Is \(f(x) = x^3 - x\) injective if the domain and codomain are both \(\mathbb{R}\text{?}\)

Solution

No, since \(f(-1) = f(0) = f(1) = 0\text{.}\)

Facts about injections, surjections and inverses.

9

Suppose that \(f : A \to B\) and \(g : B \to C\) are functions. Prove that if \(g \circ f\) is injective, then \(f\) is injective. Prove that if \(g \circ f\) is surjective, then \(g\) is surjective.

Solution

We prove the first statement by contraposition. Suppose \(f\) is not injective. Then there exist \(x,y \in A\) with \(x \not= y\) so that \(f(x) = f(y)\text{.}\) Applying \(g\) we find that \((g \circ f)(x) = g(f(x) = g(f(y)) = (g \circ f)(y)\text{,}\) so \(g \circ f\) is not injective.

We prove the second statement by contraposition as well. Recall that even for relations, we have \(\range(g \circ f) \subseteq \range(g)\text{.}\) Therefore, if \(g\) is not surjective, then \(\range(g) \subsetneq C\) and hence \(\range(g\circ f) \not= C\text{,}\) so \(g \circ f\) is not surjective either.

10

Suppose that \(f : A \to B\) is a function. Prove that if \(f\) is injective, then there is a function \(g : B \to A\) so that \(g \circ f = Id_A\text{.}\) Prove that if \(f\) is surjective, then there is a function \(h : B \to A\) so that \(f \circ h = Id_B\text{.}\)

Solution

Suppose \(f\) is injective. Let \(f^{-1} : \range(f) \to A\) be its inverse. Let \(a \in A\) be any element. Define \(\tilde{g} : B \setminus \range(f) \to A\) by \(\tilde{g}(y) = a\) for all \(y \in B \setminus \range(f)\text{.}\) Then let \(g = f \cup \tilde{g} : B \to A\text{.}\) Now, for any element \(x \in A\text{,}\) \(f(x) \in \range (f)\text{,}\) so \(g(f(x)) = f^{-1}(f(x)) = x = Id_A(x)\text{.}\) Thus \(g \circ f = Id_A\text{.}\)

Suppose now that \(f\) is surjective. Then for each \(y \in B\) the preimage set \(f^{-1}(y) := \{ x \in A \mid f(x) = y \}\) is nonempty since \(f\) is surjective. By the Axiom of Choice we may choose one element from each set. More specifically, there is some function \(h : B \to A\) such that \(h(y) \in f^{-1}(y)\text{.}\) Thus, \((f \circ h)(y) = f(h(y)) = y = Id_B(y)\) by the definition of \(f^{-1}(y)\text{,}\) so \(f \circ h = Id_B\text{.}\)

11

Use the previous two exercises to prove that \(f : A \to B\) is bijective if and only if there exists a single function \(g : B \to A\) for which \(g \circ f = Id_A\) and \(f \circ g = Id_B\text{.}\)

Solution

If \(f\) is bijective, we may simply choose \(g = f^{-1}\text{.}\)

If there exists \(g : B \to A\) so that \(f \circ g = Id_B\) and \(g \circ f = Id_A\) are both bijections. Since \(f \circ g\) is surjective, \(f\) must be surjective as well. since \(g \circ f\) is injective, \(f\) must be injective as well. Hence \(f\) is a bijection.

12

Find a bijection between \(\mathbb{N}\) and \(\mathbb{N} \setminus \{1\}\text{.}\)

Solution

Define \(f : \mathbb{N} \to \mathbb{N} \setminus \{1\}\) by \(f(n) = n+1\text{.}\) The claimed codomain is valid since if \(n \in \mathbb{N}\) then \(n \ge 1\) and hence \(n+1 \in \mathbb{N}\) and \(n+1 \ge 2\text{,}\) so \(n+1 \in \mathbb{N} \setminus \{1\}\text{.}\)

The function \(f\) is clearly injective because if \(f(n) = f(m)\) then \(n+1 = m+1\) and hence \(m = n\) by cancellation.

The function \(f\) is surjective because if \(m \in \mathbb{N} \setminus\{1\}\text{,}\) then \(m-1 \in \mathbb{N}\text{,}\) and moreover, \(f(m-1) = (m-1)+1 = m\text{.}\)

13

Provide an example of an injective function \(f : \mathbb{R} \to \mathbb{R}\) which is not surjective.

Solution

Consider \(f(x) = e^x\text{.}\) Then \(f\) is injective because it has an inverse (namely, \(\ln(x)\)), and it is not surjective because \(e^x \gt 0\) for all \(x\) (so no nonpositive values are in the range).

14

Provide an example of a surjective function \(f : \mathbb{R} \to \mathbb{R}\) which is not injective.

Solution

The function \(f(x) = x(x+1)(x-1) = x^3 - x\) is not injective because \(f(0) = f(1) = f(-1) = 0\text{,}\) but it is surjective. The proof of surjectivity uses the intermediate value theorem and is similar to the one given above in a different exercise.

15

Prove by any means that \(\mathbb{N}, \mathbb{Z}\) have the same cardinality.

16

For \(a,b,c,d \in \mathbb{R}\) with \(a \lt b\) and \(c \lt d\text{,}\) prove that the intervals \([a,b)\) and \((c,d]\) have the same cardinality by finding a bijection between them.

Solution

By a proof analogous to the homework, the function \(g : [0,1) \to (c,d]\) given by \(g(x) = (c-d)x + d\) is a bijection. Moreover, from the homework we know the function \(f: [a,b) \to [0,1)\) given by \(f(x) = \frac{x-a}{b-a}\) is a bijection. Therefore \(g \circ f : [a,b) \to (c,d]\) is a bijection given by the formula

\begin{equation*} (g \circ f)(x) = g(f(x)) = \frac{c-d}{b-a}(x-a) + d. \end{equation*}
17

Prove by finding a bijection that \((0,1)\) and \((0,\infty)\) have the same cardinality. You may use standard facts about functions from calculus to prove your claims.

Solution

Chose \(f : (0,1) \to (0,\infty)\) to be \(f(x) = -\ln(x)\text{.}\) The claimed codomain is valid because \(\ln(x) \lt 0\) if \(0 \lt x \lt 1\text{.}\) This function is bijective because it has an inverse, namely, \(f^{-1}(x) = e^{-x}\text{.}\)

18

Recall that \([0,1]\) is uncountable by Cantor's diagonal argument. Prove that any subset of \(\mathbb{R}\) which contains an interval (open, closed, half-open), no matter how small, is uncountable.

Solution

Suppose \(A\) is a subset of \(\mathbb{R}\) which contains an interval \((a,b)\text{;}\) if it contains a closed or half-open interval, then it contains this open interval. By earlier exercises, this open interval can be mapped bijectively to \((0,1)\text{,}\) and so the inverse of this function is an injection from \((0,1)\) to \(A\text{.}\) Thus, the cardinality of \(A\) is at least as large as the cardinality of \((0,1)\text{,}\) which is uncountable by Cantor's diagonal argument.

19

Prove by any means that the unit circle \(\mathbb{T} := \{ (x,y) \in \mathbb{R}^2 \mid x^2 + y^2 = 1 \}\) has the same cardinality as the unit interval \((0,1)\text{.}\)

20

Prove (by any method) that the unit square \([0,1]^2\) and the unit disk \(\mathbb{D} = \{ (x,y) \mid x^2 + y^2 \lt 1 \}\) have the same cardinality.

Solution

Consider the function \(f : [0,1]^2 \to \mathbb{D}\) given by the formula \(f(x,y) = \left(\frac{x}{2}, \frac{y}{2}\right)\text{.}\) Note that if \((x,y) \in [0,1]^2\) then \(0 \le x,y \le 1\) and hence \(0 \le \frac{x}{2}, \frac{y}{2} \le \frac{1}{2}\text{.}\) Therefore, \(\left(\frac{x}{2}\right)^2 + \left(\frac{y}{2}\right)^2 \le \frac{1}{2} \lt 1\) and hence \(f(x,y) \in \mathbb{D}\) as claimed.

We now prove \(f\) is injective. Suppose \(f(x,y) = f(u,v)\text{.}\) Then \(\left(\frac{x}{2}, \frac{y}{2}\right) = \left(\frac{u}{2}, \frac{v}{2}\right)\) and hence \(\frac{x}{2} = \frac{u}{2}\) and similarly \(\frac{y}{2} = \frac{v}{2}\text{.}\) So \(x = u\) and \(y = v\text{,}\) hence \((x,y) = (u,v)\text{,}\) so \(f\) is injective.

Consider the function \(g : \mathbb{D} \to [0,1]^2\) given by \(f(x,y) = \left(\frac{x+1}{2} , \frac{y+1}{2}\right)\text{.}\) Note that if \((x,y) \in \mathbb{D}\text{,}\) then \(x^2 + y^2 \lt 1\) and hence \(-1 \lt x,y \lt 1\text{.}\) Adding \(1\) and dividing by \(2\) yields \(0 \lt \frac{x+1}{2}, \frac{y+1}{2} \lt 1\text{.}\) Thus \(f(x,y) \in [0,1]^2\text{,}\) as claimed.

We now prove \(g\) is injective. The argument that \(g\) is injective is very similar to the one for \(f\text{.}\)

By the Cantor--Schroeder--Bernstein theorem, there is a bijection between \([0,1]^2\) and \(\mathbb{D}\text{.}\)