12.9 Function
Inverse function
A function \(f:A\rightarrow B\), then \(f^{-1}\) is a function from \(B\) to \(A\) and \(f^{-1}(f(a))=a,\forall a\in A\), \(f(f^{-1}(b)) = b \quad \forall b \in B\)
In other words, \(f^{-1} \circ f = \text{id}_A\) and \(f \circ f^{-1} = \text{id}_B\).
Proposition
Let \(f: A \to B\) be a function. If \(\exists g: B \to A\) such that \(g \circ f = \text{id}_A\) and \(f \circ g = \text{id}_B\).
Then \(f\) is bijective and \(g = f^{-1}\).
Proof
-
\(f\) is injective Let \(a_1, a_2 \in A\) such that \(f(a_1) = f(a_2)\). We apply \(g\): \(g(f(a_1)) = g(f(a_2)) \implies a_1 = a_2\).
-
\(f\) is surjective Let \(b \in B\). Let \(a = g(b) \in A\). Then \(f(a) = f(g(b)) = b\).
Thus, \(f\) is bijective.
We now prove that \(f^{-1} = g\). Let \(b \in B\).
We solve \(f(x) = b\), then we have \(x=f^{-1}\left(b\right)\)
We apply \(g\): \(g(f(x)) = g(b)\Rightarrow x=g(b)\).
Thus, \(f^{-1}(b)=g(b)\Rightarrow f^{-1}=g\)
Remarks
If \(f: A \to B\) is a function, then \(f: A \to \text{Im} f\) is surjective.
In particular, if \(f: A \to B\) is injective, then \(f: A \to \text{Im} f\) is bijective, so \(\exists f^{-1}: \text{Im} f \to A\).
Example
\(f: \mathbb{N} \to \mathbb{N}, \, f(n) = 2n\) is injective
\(\text{Im } f = \{ \text{positive even numbers} \} = 2\mathbb{N}\), then \(\exists f^{-1}: 2\mathbb{N} \to \mathbb{N}, \, f^{-1}(m) = \frac{m}{2}\).
This is because \(f^{-1} \circ f = \text{id}_{\mathbb{N}}\) and \(f \circ f^{-1} = \text{id}_{2\mathbb{N}}\).
Note
If \(f: A \to B\) is not injective, we might obtain a bijective function by restricting both domain and codomain (keeping the same image).
Example
\(\sin: \mathbb{R} \to \mathbb{R}, \, x \mapsto \sin(x)\). The image is \([-1, 1]\), thus \(\sin: \mathbb{R} \to [-1, 1]\) is surjective.
The restriction \(\sin: \left[ -\frac{\pi}{2}, \frac{\pi}{2} \right] \to [-1, 1]\) is bijective. So this function has an inverse.
\(\arcsin: [-1, 1] \to \left[ -\frac{\pi}{2}, \frac{\pi}{2} \right]\)
Because \(\sin(\arcsin(y)) = y \quad \forall y \in [-1, 1]\) and \(\arcsin(\sin(x)) = x \quad \forall x \in \left[ -\frac{\pi}{2}, \frac{\pi}{2} \right]\).
The graph of the inverse
Given \(f: A \to B\), the graph is the function viewed as a relation.
In other words \(\text{Graph}(f) = \{(a, b) \in A \times B : b = f(a)\} = f\)
If \(f\) is bijective, then \(\exists f^{-1}: B \to A\) and \(\text{Graph}(f^{-1}) = \{(b, a) \in B \times A : f^{-1}(b) = a\}\)
\(= \{(b, a) \in B \times A : f(a) = b\}\).
In the case of functions from \(A \subseteq \mathbb{R}\) to \(B \subseteq \mathbb{R}\):
Example
\(\sin: \left[ -\frac{\pi}{2}, \frac{\pi}{2} \right] \to [-1, 1]\) and \(\arcsin: [-1, 1] \to \left[ -\frac{\pi}{2}, \frac{\pi}{2} \right]\)
Images/Inverse Images
\(f: A \to B\). Given \(X \subseteq A\), we define \(f(X) = \{f(x) : x \in X\} = \{b \in B : (\exists x \in X)(f(x) = b)\} \subseteq B\).
(Image of \(X\) by \(f\))
Given \(Y \subseteq B\), we define \(f^{-1}(Y) = \{x \in A : f(x) \in Y\} = \bigcup_{y \in Y} f^{-1}(y) \subseteq A\).
(Inverse image of \(Y\) by \(f\))
Obs: If \(x \in f^{-1}(Y)\), then \(f(x) \in Y\). If \(x \notin f^{-1}(Y)\), then \(f(x) \notin Y\).
Example
\(f: \mathbb{N} \to \mathbb{N}, \, f(x) = x + 4\).
\(f(\{1, 2, 3, 4\}) = \{5, 6, 7, 8\}\). \(f(\mathbb{N}) = \text{Im } f = \{5, 6, 7, 8, \dots\}\). \(f(\emptyset) = \emptyset\).
\(f^{-1}(\{3, 4, 5, 6\}) = \{x \in \mathbb{N} : x + 4 \in \{3, 4, 5, 6\}\} = \{1, 2\}\). \(f^{-1}(\{5, 6\}) = \{1, 2\}\).
\(f^{-1}(\{x : x \geq 10\}) = \{x \in \mathbb{N} : x + 4 \geq 10\} = \{x \in \mathbb{N} : x \geq 6\}\).
\(f^{-1}(\{1,2\})=\emptyset\).
Example
\(f(X) = X^2\)
\(f([1, 2]) = [1, 4]\), \(f([0, 2]) = [0, 4]\), \(f([-2, -1]) = [1, 4]\)
\(f^{-1}([1, 4]) = [-2, -1] \cup [1, 2]\), \(f^{-1}([0, 4]) = [-2, 2]\), \(f^{-1}([-4, 4]) = [-2, 2]\), \(f^{-1}([-4, -2]) = \emptyset\)
Obs
For \(f: A \to B\), taking the image of subsets of \(A\) is a function: \(\mathcal{P}(A) \to \mathcal{P}(B), \quad X \mapsto f(X)\).
And taking the inverse image is a function: \(\mathcal{P}(B) \to \mathcal{P}(A), \quad Y \mapsto f^{-1}(Y)\).
Example
For \(f: \{1, 2, 3\} \to \{1, 2, 3\}\): \(1 \mapsto 1\), \(2 \mapsto 3\), \(3 \mapsto 3\).
\(\mathcal{P}(\{1, 2, 3\}) = \{\emptyset, \{1\}, \{2\}, \{3\}, \{1, 2\}, \{1, 3\}, \{2, 3\}, \{1, 2, 3\}\}\).
\(\mathcal{P}(A)\to\mathcal{P}(B)\)
Mapping subsets: \(\emptyset \mapsto \emptyset\), \(\{1, 2\} \mapsto \{1, 3\}\).
Proposition
-
\(f(X_1 \cup X_2) = f(X_1) \cup f(X_2)\).
-
\(f(X_1 \cap X_2) \subseteq f(X_1) \cap f(X_2)\).
-
\(f^{-1}(Y_1 \cup Y_2) = f^{-1}(Y_1) \cup f^{-1}(Y_2)\).
-
\(f^{-1}(Y_1 \cap Y_2) = f^{-1}(Y_1) \cap f^{-1}(Y_2)\).
Proof Exercise!
For \(f(x) = x^2\): \(f([-2, -1] \cap [1, 2]) = \emptyset\), \(f([-2, 2]) \cap f([1, 2]) = [1, 4] \cap [1, 4] = [1, 4]\).