Skip to content

6 Function

Yue Shi 999027873

BCH6.pdf

Exercise 1 (25 points)

Let \(f : A \to B\) and \(g : C \to D\) be functions. Define a relation \(f \times g \subset (A \times C) \times (B \times D)\) as \(f \times g = \{((a, c), (b, d)) : f(a) = b, g(c) = d\}\).

  1. Prove that \(f \times g\) is a function from \(A \times C\) to \(B \times D\) and compute \((f\times g)(a,c)\)​.

    First, we prove \(\text{Dom} (f\times g)=A\times C\)

    \(\subseteq\)) Take any \(\left(a,c)\in\text{Dom}(f\times g\right)\Rightarrow\exists\left(b,d\right)\in B\times D\text{ such that }((a,c),\left(b,d\right))\in f\times g\)

    Since \(f : A \to B\) and \(g : C \to D\) are functions. Then \(\exists b\in B\) and \(\exists d\in D\) such that \(f(a)=b,g(c)=d\), then \(a\in A\) and \(c\in C\)

    Then \((a,c)\in A\times C\)

    \(\supseteq\)) Take any \((a,c)\in A\times C\), then \(a\in A\) and \(c\in C\). Since \(f : A \to B\) and \(g : C \to D\) are functions, thus there \(\exists b\in B,d\in D:f(a)=b,g(c)=d\)

    Then we have \(((a,c),(b,d))\in\left(f\times g\right)\), thus \((a,c)\in \text{Dom}(f\times g)\)

    Then we prove if \(xfy\wedge xfy^{\prime}\), then \(y=y'\)

    Let take \(\left(\left(a,c\right),\left(b,d\right)\right),\left(\left(a,c\right),\left(b^{\prime},d^{\prime}\right)\right)\in f\times g\), then we have \(f(a)=b,g(c)=d,f(a)=b',g(c)=d'\)

    Since \(f : A \to B\) and \(g : C \to D\) are functions, then \(b=b',d=d'\)

    Thus \((b,d)=(b',d')\)

    Thus \(f \times g\) is a function from \(A \times C\) to \(B \times D\)

    For \((f\times g)(a,c)\), by definition we know \((f\times g)(a,c)=\left(f\left(a\right),g\left(c\right)\right)=\left(b,d\right)\)

  2. Prove that the function \(h : \mathbb{N}^2 \to \mathbb{N}^2\) given by \(h(m, n) = (m^2, n+1)\) is of the form \(f \times g\) for some functions \(f, g : \mathbb{N} \to \mathbb{N}\).

    Consider \(f:\mathbb{N}\rightarrow\mathbb{N},f\left(x\right)=x^2\) and \(g:\mathbb{N}\rightarrow\mathbb{N},g\left(x\right)=x+1\), then we compute \(f\times g\)

    \(f\times g=\{((a,b),(a^2,b+1)):f(a)=a^2,g(b)=b+1\}\), then consider \(h=f\times g\), then we have \(h(a,b)=(a^2,b+1)\) which is same with \(h(m, n) = (m^2, n+1)\)

    Thus \(h : \mathbb{N}^2 \to \mathbb{N}^2\) given by \(h(m, n) = (m^2, n+1)\) is of the form \(f\times g\)

  3. Give an example of a function \(h : \mathbb{N}^2 \to \mathbb{N}^2\) that is not of the form \(f \times g\).

    \(h(x,y)=(x+y,x-y)\)


Exercise 2 (25 points)

Let

\[ f(x) = \begin{cases} 2x + 3 & \text{if } x < 3 \\ x^2 & \text{if } x \geq 3 \end{cases}, \quad g(x) = \begin{cases} 7 - 2x & \text{if } x \leq 2 \\ x + 1 & \text{if } x > 2 \end{cases}. \]
  1. Which one is injective, which one is surjective, and which one is bijective? Justify.

    imageimage

    By Horizontal line test, for \(f(x)\) each horizontal line meets the graph in unique one point, thus it is injective and surjective

    For \(g(x)\), \(y=4\) meets the graph in two points, thus it is not injective. And \(y=1\) meets the graph in zero points, thus it is not surjective.

    Thus \(f(x)\) is bijective and \(g(x)\) is not injective and not surjective.

  2. Compute \(g \circ f\) and \(f \circ g\).

    \(g\circ f\left(x\right)=g\left(f\left(x\right)\right)=\begin{cases}g\left(2x+3\right) & \text{if }x<3\\ g\left(x^2\right) & \text{if }x\geq3\end{cases}\Rightarrow\begin{cases}g\left(2x+3\right) & \text{if }2x+3<9\\ g\left(x^2\right) & \text{if }x^2\geq9\end{cases}\Rightarrow\begin{cases}g\left(2x+3\right) & \text{if }2x+3\leq2\\ g\left(2x+3\right) & \text{if }2<2x+3<9\\ x^2+1 & \text{if }x^2\geq9\end{cases}\Rightarrow\begin{cases}1-4x & \text{if }2x+3\leq2\\ 2x+4 & \text{if }2<2x+3<9\\ x^2+1 & \text{if }x^2\geq9\end{cases}\)

    Then we have \(g\circ f\left(x\right)=\begin{cases}1-4x & \text{if }x\leq-\frac12\\ 2x+4 & \text{if }-\frac12<x<3\\ x^2+1 & \text{if }x\geq3\end{cases}\)

    \(f\circ g\left(x\right)=f\left(g\left(x\right)\right)=\begin{cases}f\left(7-2x\right) & \text{if }x\leq2\\ f\left(x+1\right) & \text{if }x>2\end{cases}\Rightarrow\begin{cases}f\left(7-2x\right) & \text{if }7-2x\geq3\\ f\left(x+1\right) & \text{if }x+1>3\end{cases}\Rightarrow\begin{cases}\left(7-2x\right)^2 & \text{if }7-2x\geq3\\ \left(x+1\right)^2 & \text{if }x+1>3\end{cases}\)

    Then we have \(f\circ g\left(x\right)=\begin{cases}4x^2-28x+49 & \text{if }x\leq2\\ x^2+2x+1 & \text{if }x>2\end{cases}\)


Exercise 3 (25 points)

For each of the following functions \(f : A \to \mathbb{R}\), show that they are one-to-one, compute \(\text{Im}(f)\), and find a formula for the inverse \(f^{-1} : \text{Im}(f) \to A\).

  1. \(f : (-2, \infty) \to \mathbb{R}\) given by \(f(x) = \frac{4x}{x+2}\).

    Let \(f(x_1)=f(x_2)\), then \(\frac{4x_1}{x_1+2}=\frac{4x_2}{x_2+2}\Rightarrow x_1x_2+2x_1=x_1x_2+2x_2\Rightarrow2x_1=2x_2\Rightarrow x_1=x_2\)

    Thus it is injective.

    Since \(x>-2\), then \(\frac{2}{x}\in\left(0,\infty\right)\cup\left(-\infty,-1\right)\Rightarrow1+\frac{2}{x}\in\left(1,\infty\right)\cup\left(-\infty,0\right)\Rightarrow\frac{4}{1+\frac{2}{x}}\in\left(0,4\right)\cup\left(-\infty,0\right)\)

    Also \(x=0\) is valid, thus \(\frac{4x}{x+2}\in\left(-\infty,4\right)\), then \(\text{Im}(f)\in\left(-\infty,4\right)\)

    Since \(y=\frac{4x}{x+2}\Rightarrow\left(x+2\right)y=4x\Rightarrow xy+2y-4x=0\Rightarrow x\left(y-4\right)=-2y\Rightarrow x=\frac{2y}{4-y}\)

    Thus \(f^{-1}=\frac{2x}{4-x}\)

  2. \(f : (3, \infty) \to \mathbb{R}\) given by \(f(x) = \frac{5(x-1)}{x-3}\).

    Let \(f(x_1)=f(x_2)\), then \(\frac{5(x_1-1)}{x_1-3}=\frac{5(x_2-1)}{x_2-3}\Rightarrow x_1x_2-3x_1-x_2+3=x_1x_2-3x_2-x_1+3\Rightarrow-2x_1=-2x_2\Rightarrow x_1=x_2\)

    Thus it is injective.

    Let's simplify \(f(x)=\frac{5(x-1)}{x-3}=\frac{5(x-3)+10}{x-3}=5+\frac{10}{x-3}\)

    Since \(x>3\), then \(x-3>0\Rightarrow\frac{10}{x-3}>0\Rightarrow5+\frac{10}{x-3}>5\), then \(\text{Im}(f)\in\left(5,\infty\right)\)

    Since \(y=5+\frac{10}{x-3}\Rightarrow\frac{y-5}{10}=x-3\Rightarrow\frac{y+25}{10}=x\)

    Thus \(f^{-1}=\frac{3x-5}{x-5}\)


Exercise 4 (25 points)

Decide if the following sentences are true or false. When they are true, give a proof. When they are false, give a counterexample.

(a) Every function \(f : A \to A\) is injective or surjective.

False \(g(x)=\begin{cases}7-2x & \text{if }x\leq2\\ x+1 & \text{if }x>2\end{cases}.\)

(b) If \(f : A \to A\) satisfies \(f^2 = \text{id}_A\), then \(f\) is bijective.

True. Assume \(f : A \to A\), \(f^2(x)=x=id_{A}\), then \(f(x)=\begin{cases}\sqrt{x}\text{ for some }x\in A\\ -\sqrt{x}\text{ for some }x\in A\end{cases}\)

  1. Injective

    1. Let's take \(f\left(x_1\right)=\sqrt{x_1}=f\left(x_2\right)=\sqrt{x_2}\), then \(x_1=x_2\)
    2. Let's take \(f\left(x_1\right)=-\sqrt{x_1}=f\left(x_2\right)=-\sqrt{x_2}\), then \(x_1=x_2\)
    3. Since \(\sqrt{x}\geq 0\) and \(-\sqrt{x}\leq 0\) and \(\sqrt0=0=-\sqrt0\), thus it is also valid

    Thus it is injective

  2. Surjective

    Let's take any \(y\in A\), we have two cases

    1. If \(y=\sqrt{x}\), then \(\exists x=y^2:f(x)=\sqrt{y^2}=y=\sqrt{x}{}\)
    2. If \(y=-\sqrt{x}\), then \(\exists x=y^2:f(x)=-\sqrt{y^2}=-\left|y\right|=-\sqrt{x}{}\)

    Thus it is surjective

Thus it is bijective

(c) If \(f : A \to B\) and \(g : B \to A\) are functions such that \(g \circ f = \text{id}_A\), then \(f\) is bijective.

False \(A=\{1\}\) and \(B=\{1,2\}\). Define \(f(1)=1\) and \(g(1)=g(2)=1\)

Then \(g\circ f=g\left(f\left(x\right)\right)=g\left(1\right)=1=id_{A}\)

But \(f\) is not surjective

(d) There is a bijective function \(f : \mathbb{N} \to \mathbb{Z}\).

True, \(f(n)=\begin{cases}\frac{n-1}{2}\text{ if n is odd}\wedge n\neq1\\ -\frac{n}{2}\text{ if n is even}\\ 0\text{ if }n=1\end{cases}\)