If \(f:X\to Y\) and \(g:Y\to Z\) are functions, we define \(g\circ f:X\to Z\) via \(\tcboxmath{(g\circ f)(x)=g(f(x))}\text{.}\) The function \(g\circ f\) is called the composition of \(f\) and \(g\text{.}\)
It is important to notice that the function on the right is the one that βgoes first.β Moreover, we cannot compose any two random functions since the codomain of the first function must agree with the domain of the second function. In particular, \(f\circ g\) may not be a sensible function even when \(g\circ f\) exists. FigureΒ 8.4 provides a visual representation of function composition in terms of function diagrams.
Consider the inclusion map \(\iota:X\to Y\) such that \(X\) is a proper subset of \(Y\) and suppose \(f:Y\to Z\) is a function. Then the composite function \(f\circ \iota:X\to Z\) is given by
for all \(x\in X\text{.}\) Notice that \(f\circ \iota\) is simply the function \(f\) but with a smaller domain. In this case, we say that \(f\circ \iota\) is the restriction of \(f\) to \(X\), which is often denoted by \(\tcboxmath{f|_X}\text{.}\)
Define \(f:\mathbb{R}\to \mathbb{R}\) and \(g:\mathbb{R}\to \mathbb{R}\) via \(f(x)=x^2\) and \(g(x)=3x-5\text{,}\) respectively. Determine formulas for the composite functions \(f\circ g\) and \(g\circ f\text{.}\)
Define \(f:\mathbb{Z}/15\mathbb{Z}\to \mathbb{Z}/23\mathbb{Z}\) and \(g:\mathbb{Z}/23\mathbb{Z}\to \mathbb{Z}/32\mathbb{Z}\) via \(f([x]_{15})=[3x+5]_{23}\) and \(g([x]_{23})=[2x+1]_{32}\text{,}\) respectively. Find a formula for the composite function \(g\circ f\text{.}\)
If \(f:X\to Y\) is a function, then \(f\circ i_X = f = i_Y\circ f\text{,}\) where \(i_X\) and \(i_Y\) are the identity maps on \(X\) and \(Y\text{,}\) respectively.
In each case, give examples of finite sets \(X\text{,}\)\(Y\text{,}\) and \(Z\text{,}\) and functions \(f:X\to Y\) and \(g:Y\to Z\) that satisfy the given conditions. Drawing a function diagram is sufficient.
\(f\) is surjective, but \(g\circ f\) is not surjective.
Assume that \(f:X\to Y\) and \(g:Y\to Z\) are both functions. Determine whether each of the following statements is true or false. If a statement is true, prove it. Otherwise, provide a counterexample.
If \(g\circ f\) is injective, then \(f\) is injective.
Let \(f:X\to Y\) be a function. Then \(f\) is injective if and only if there exists a function \(g:Y\to X\) such that \(g\circ f=i_X\text{,}\) where \(i_X\) is the identity map on \(X\text{.}\)
Let \(f:X\to Y\) be a function. Then \(f\) is surjective if and only if there exists a function \(g:Y\to X\) such that \(f\circ g=i_Y\text{,}\) where \(i_Y\) is the identity map on \(Y\text{.}\)
In the previous result, the functions \(f\) and \(g\) βcancelβ each other out. In this case, we say that \(g\) is a two-sided inverse of \(f\text{.}\)
Notice that we called \(f^{-1}\) a relation and not a function. In some circumstances \(f^{-1}\) will be a function and sometimes it will not be. Given a function \(f\text{,}\) the inverse relation is simply the set of ordered pairs that results from reversing the ordered pairs in \(f\text{.}\) It is worth pointing out that we have only defined inverse relations for functions. However, one can easily adapt our definition to handle arbitrary relations.
Consider the function \(f\) given in ExampleΒ 8.2 (see FigureΒ 8.1). List the ordered pairs in the relation \(f^{-1}\) and draw the corresponding digraph. Is \(f^{-1}\) a function?
Suppose \(X\subseteq \mathbb{R}\) and \(f:X\to \mathbb{R}\) is a function. What is the relationship between the graph of the function \(f\) and the graph of the inverse relation \(f^{-1}\text{?}\)
If \(f:X\to Y\) and \(g:Y\to X\) are functions such that \(g\circ f=i_X\) and \(f\circ g=i_Y\text{,}\) then \(f^{-1}\) is a function and \(g=f^{-1}\text{.}\)
The upshot of TheoremΒ 8.76 and TheoremΒ 8.78 is that if \(f^{-1}\) is a function, then it is the only one satisfying the two-sided inverse property exhibited in CorollaryΒ 8.69 and TheoremΒ 8.76. That is, inverse functions are unique when they exist. When the relation \(f^{-1}\) is a function, we call it the inverse function of \(f\text{.}\)
Let \(X\subseteq\mathbb{R}\) and suppose \(f:X\to\mathbb{R}\) is a function. Explain the difference between \(f^{-1}(x)\) and \([f(x)]^{-1}\text{.}\) When does each exist?
Let \(X,Y\subseteq\mathbb{R}\) and define \(f:X\to Y\) via \(f(x)=e^x\) and \(g:Y\to X\) via \(g(x)=\ln(x)\text{.}\) Identify the largest possible choices for \(X\) and \(Y\) so that \(f\) and \(g\) are inverses of each other.
In the previous theorem, we restricted our attention to bijections so that \(f^{-1}\) would be a function, thus making \((f^{-1})^{-1}\) a sensible inverse relation in light of DefinitionΒ 8.70. If we had defined inverses for arbitrary relations, then we would not have needed to require the function in TheoremΒ 8.81 to be a bijection. In fact, we do not even need to require the relation to be a function. That is, if \(R\) is a relation from \(X\) to \(Y\text{,}\) then \((R^{-1})^{-1}=R\text{,}\) as expected. Similarly, the next result generalizes to arbitrary relations.