Skip to content

12.4 Functions

Workshop 8.pdf

Workshop 8

Exercise 1

(a) Let \(f\) and \(g\) be the two functions from \(\mathbb{R}\) to \(\mathbb{R}\) defined by:

\[ f(x) = 3x + 1 \quad \text{and} \quad g(x) = x^2 - 1. \]

Calculate \(f \circ g\) and \(g \circ f\).

\(f\circ g=f(g(x))=f(x^2-1)=3x^2-3+1=3x^2-2\)

\(g\circ f=g(f(x))=g(3x+1)=(3x+1)^2-1=9x^2+6x+1-1=9x^2+6x\)

(b) In the following examples, determine two functions \(u\) and \(v\) such that \(h = u \circ v\):

  1. \(h_1(x) = \sqrt{3x - 1}\)

    \(u=\sqrt{x-1}\) and \(v=3x\left(x\geq\frac13\right)\)

  2. \(h_2(x) = \sin\left(x + \frac{\pi}{2}\right)\)

    \(u=\sin x\) and \(v=x+\frac{\pi}{2}\)

  3. \(h_3(x) = \frac{1}{x + 7}\).

    \(u=\frac1x\) and \(v=x+7\)

Exercise 2

Let \(f : I \to J\) be a function. Determine whether, from properties (a)-(d), we can deduce that:

  • \(f\) is injective (but not necessarily surjective);
  • \(f\) is surjective (but not necessarily injective);
  • \(f\) is bijective;
  • We cannot say anything about \(f\).

  • \(\forall y \in J, f^{-1}(\{y\}) \neq \emptyset\)

    Which means \(\forall y\in J,\exists f^{-1}(\{y\})\), then it is surjective

  • \(\forall y \in J, f^{-1}(\{y\})\) contains at most one element

    injective

  • \(\forall y \in f(I), f^{-1}(\{y\}) \neq \emptyset\)

    nothing

  • \(\forall y \in f(I), f^{-1}(\{y\})\) contains at most one element.

    Just one element, injective

Exercise 3

Are the following functions injective? Surjective? Bijective?

  1. \(f_1 : \mathbb{Z} \to \mathbb{Z}, n \mapsto 2n\),

    bijective

  2. \(f_2 : \mathbb{Z} \to \mathbb{Z}, n \mapsto -n\),

    bijective

  3. \(f_3 : \mathbb{R} \to \mathbb{R}, x \mapsto x^2\),

    none

  4. \(f_4 : \mathbb{R} \to \mathbb{R}^+, x \mapsto x^2\),

    surjective

  5. \(f_5 : \mathbb{C} \to \mathbb{C}, z \mapsto z^2\).

    none

Exercise 4

Are the following functions injective, surjective, bijective?

(a) \(f : \mathbb{N} \to \mathbb{N}, n \mapsto n + 1\),

bijective

(b) \(g : \mathbb{Z} \to \mathbb{Z}, n \mapsto n + 1\),

bijective

(c) \(h : \mathbb{R}^2 \to \mathbb{R}^2, (x, y) \mapsto (x + y, x - y)\).

bijective

Exercise 5

Is the map \(f : \mathbb{R}^2 \to \mathbb{R}^2, (x, y) \mapsto (x + y, xy)\) injective? Surjective?

Not injective, but surjective

Exercise 6

Let \(f\) and \(g\) be the functions of \(\mathbb{N}\) in \(\mathbb{N}\) defined by:

\[ f(x) = 2x \quad \text{and} \quad g(x) = \begin{cases} \frac{x}{2}, & \text{if } x \text{ is even}, \\ 0, & \text{if } x \text{ is odd}. \end{cases} \]

Determine \(g \circ f\) and \(f \circ g\). Are the functions \(f\) and \(g\) injective? Surjective? Bijective?

\(g\circ f=g(f(x))=x\) and \(f\circ g=f(g(x))=\begin{cases}x,\text{ x is even}\\0,\text{ x is odd}\end{cases}\)

\(f\) is bijective and \(g\) is surjective

Exercise 7

Consider 4 sets \(A, B, C, D\), and applications \(f : A \to B, g : B \to C\), and \(h : C \to D\). Show that:

  1. \(g \circ f\) injective \(\implies f\) injective,

    Let \(f(x_1)=f(x_2)=a\), then \(g(a)=g(a)\Rightarrow g(f(x_1))=g(f(x_2))\)

    Since \(g\circ f\) is injective, then \(x_1=x_2\), then we have \(f\) is injective

  2. \(g \circ f\) surjective \(\implies g\) surjective.

    Since \(g\circ f\) is surjective. Let's take \(\forall c\in C\), then \(\exists f\left(a\right)\in B:g\left(f(a)\right)=c\)

    Then let \(f(a)=b\), then we have \(\forall c\in C\), then \(\exists b\in B:g\left(b\right)=c\), then \(g\) is surjective

Show that: \(\left(g\circ f\text{ and }h\circ g\text{ are bijective}\right)\;\iff\;\left(f,g\text{ and }h\text{ are bijective}\right).\)

\(\Rightarrow\))

Since \(g\circ f\) is bijective and \(h\circ g\) is bijective, then \(g\) is bijective (use conclusion of 1)

Since \(g\circ f\) and \(g\) is bijective, then \(g^{-1}\) is bijective, then \(g^{-1}\circ g\circ f=f\) is bijective

Similarly, \(h\) is bijective

\(\Leftarrow\)) Easy

Exercise 8

Let \(E\) be a set. For \(A \in P(E)\), a subset of \(E\), we denote \(\overline{A}\) as its complement. Is the function \(\phi : P(E) \to P(E), A \mapsto \overline{A}\) injective? Surjective?

Take \(\bar A=\bar B\), then \(E-A=E-B\), then we have \(A=B\) injective

\(\forall M\in P\left(E\right),\exists\bar{M}:\phi\left(\bar{M}\right)=M\) surjective

Exercise 9 (⋆)

Let \(f : \mathbb{N}^2 \to \mathbb{N}^*, (n, p) \mapsto 2^n(2p + 1)\). Show that \(f\) is a bijection. Deduce a bijection of \(\mathbb{N}^2\) onto \(\mathbb{N}\).

  1. injective

    Take \(2^{n_1}(2p_1+1)=2^{n_2}(2p_2+1)\), then \(2^{n_1-n_2}=1+2\frac{p_2-p_1}{2p_1+1}\)

    The left is even and the right is even if unless \(n_1=n_2\), then \(p_2=p_1\)

  2. surjective

    \(\forall k\in \N^*\), then \(k=p_1^{\alpha_1}\ldots p_{n}^{\alpha_{n}}\), let \(p_1=2\), then we have \(k=2^{\alpha_1}\ldots p_{n}^{\alpha_{n}}\), we need to prove \(p_2^{\alpha_2}\ldots p_{n}^{\alpha_{n}}\) can be expressed as \(2n+1\)

    If \(2n+1\) is prime, then we are done

    If \(2n+1\) is not prime, then consider \(A=\{n:2n+1\text{ can not be expressed as }p_2^{\alpha_2}\ldots p_{n}^{\alpha_{n}}\}\)

    Suppose \(A=\empty\), then \(n_0\) is the first element in \(A\)

    Then we know \(2n+1=ab\) since \(2n+1\) is a composite number

    Thus \(a,b\) can be expressed, then \(2n+1\) must can be expressed

    Contradiction!

    Thus \(p_2^{\alpha_2}\ldots p_{n}^{\alpha_{n}}\) can be expressed as \(2n+1\)

    It is surjective

    Since \(f:\mathbb{N}^2\to\mathbb{N}^{*}\) is bijective, then we want a bijection from \(\mathbb{N}^2\) to \(\mathbb{N}\)

    Let's define a bijection from \(\N^*\) to \(\N\) which is \(g(x)=x-1\)

    Thus \(g\circ f\), we have a bijection from \(\mathbb{N}^2\) to \(\mathbb{N}\)