Sometimes it is possible to “undo” the effect of a function. In these cases, we can define a function that reverses the effects of another function. A function that we can “undo” is called invertible.
Let \(A\) and \(B\) be non-empty sets. We say that a function \(f:A\to B\) is invertible if for every \(b\in B\) there is exactly one \(a\in A\) such that \(f(a)=b\text{.}\) The inverse of an invertible function \(f:A\to B\text{,}\) denoted by \(f^{-1}\text{,}\) is the function \(f^{-1}:B \to A\) that assigns to each element \(b \in B\) the unique element \(a \in A\) such that \(f(a) = b\text{.}\)
In other words, a function \(f:A\to B\) is invertible if every \(b\in B\) has exactly one preimage \(a\in A\text{.}\) So if \(f(a) = b\text{,}\) then \(f^{-1}(b) = a\text{.}\)
Example7.52.Are \(\mathrm{studentid} \) and \(\mathrm{grade}\) invertible ?
We use the functions \(\mathrm{studentid} \colon N \to I\) and \(\mathrm{grade} \colon I \to G\) from Example 7.5 and Example 7.7 given by the tables in Figure 7.4 and Figure 7.6 respectively.
The function \(\mathrm{studentid} \colon N \to I\) where \(I\) is the set of student identification numbers and \(N\) is the set of student names is invertible as long as every student has a different name. The function \(\mathrm{studentid}^{-1}: I \to N\) is the function that tells us the student’s name for a given identification number. With the table in Figure 7.4 we get
\begin{equation*}
\mathrm{studentid} (\mathsf{ Alice } ) = 1001, \text{ so } \mathrm{studentid}^{-1}(0001) = \mathsf{ Alice } \text{.}
\end{equation*}
Recall the function grade from Example 7.7. The function \(\mathrm{grade} \colon I \to G\) where \(I\) is the set of identification numbers and \(G\) is the set of grades is not invertible since many students may earn the same grade in a class. Both the students with the identification number 1007 and 1008 earn an A in MAT 112. We have \(\mathrm{grade} ({ 1007 } ) =\text{A}\) and \(\mathrm{grade} ({ 1008 } ) = \mathsf{A}\text{,}\) and we would not be able to uniquely define \(\mathrm{grade}^{-1}(A)\text{.}\)
In Figure 7.53 we give an example of an invertible function from \(\Z_5\) to \(\Z_5\) and its inverse. The function \(e\) in Figure 7.59 illustrates that for an invertible function the domain and codomain do not have to be the same.
The function \(g\) is not invertible since \(2\in\{0,1,2\}\) has no preimage in \(\{-1,0,1\}\text{.}\) (Note that \(g\) fails to be invertible for multiple reasons, since \(g(-1) =1\) and \(g(1) = 1\text{.}\))
The function \(h\) is invertible since each element in the domain is assigned to a distinct element in the codomain. We have \(h^{-1}:\{2,3,4\}\to\{0,1,2\}\) defined by \(h^{-1}(z)=z-2\text{.}\) In particular, \(h^{-1}(2)=0\text{,}\)\(h^{-1}(3)=1\text{,}\) and \(h^{-1}(4)=2\text{.}\)
Example7.56.An invertible function from \(\Z_2\times\Z_2\) to \(\Z_4\).
Consider the function \(b:\Z_4\to\Z_2\times\Z_2\) given by \(b(0):=(0,0)\text{,}\)\(b(1):=(0,1)\text{,}\)\(b(2):=(1,0)\text{,}\) and \(b(3):=(1,1)\text{.}\) Since every element in \(\Z_2\times\Z_2\) has exactly one preimage in \(\Z_4\) under \(b\text{,}\) the function \(b\) is invertible. The inverse \(b^{-1}:\Z_2\times\Z_2 \to\Z_4\) of the function \(b\) is given by \(b^{-1}\left((0,0)\right):=0\text{,}\)\(b^{-1}\left((0,1)\right):=1\text{,}\)\(b^{-1}\left((1,0)\right):=2\text{,}\) and \(b^{-1}\left((1,1)\right):=3\text{.}\)
Suppose that \(f:A\to B\) is invertible, and let \(f^{-1} :B \to A\) be its inverse. If \(f(a) = b\text{,}\) then \(f^{-1}(b)=a\text{.}\) Thus for the composition functions \(f^{-1}\circ f\) and \(f \circ f^{-1}\text{,}\) we have
For \(f^{-1}:B\to A\) the inverse is the function \(\left(f^{-1}\right)^{-1}:A\to B\) that assigns to \(a\in A\) the element \(b\in B\) such that \(f^{-1}(b)=a\text{.}\) This element \(b\) is equal to \(f(a)\text{.}\) Thus \(\left(f^{-1}\right)^{-1}(a)=f(a)\text{.}\) Therefore \(\left(f^{-1}\right)^{-1}=f\text{.}\) So \(f\) is the inverse of \(f^{-1}\text{.}\)
Figure7.59.We specify the invertible function \(e:\Z_4\to \Z_5^\otimes\) in three ways and its inverse \(e^{-1}:\Z^\otimes_5\to \Z_4\) in two ways. Additionally, the algebraic rule that defines \(e\) is given in (c).
Assume that \(f:A\to B\) is a function and there is a function \(g:B\to A\) such that \(g\circ f=\id_A\text{.}\) Let \(a\in A\) and \(b=f(a)\text{.}\) Now
Already in Section 7.5 we have encountered two invertible functions and their inverses. In Example 7.46 we checked whether the composite of two functions is the identity function. By Theorem 7.60 this means that they are each others inverses. In Example 7.47 we encountered a functions that is its own inverse.
be its graph. We obtain the graph of \(f^{-1}\) by swapping the order of elements in the pairs in the graph of \(f\text{.}\) Thus the graph of \(f^{-1}\) is \(\{ (y,x)\mid (x,y)\in G\}\text{.}\) This is illustrated in Example 7.61.
We obtain the graph of the inverse \(f^{-1}\) by swapping the order of the numbers in the ordered pairs in the graph of \(f\text{.}\) Thus the graph of \(f^{-1}\) is