Let \(X\) and \(Y\) be two sets. A function from \(X\) to \(Y\), denoted \(f\colon X\rightarrow Y\text{,}\) is a rule which, given any input \(x\in X\text{,}\) returns an output \(y\in Y\text{.}\) In this case we write \(y=f(x)\) and call \(y\) the image of \(x\) under \(f\), or the value of \(f\) at \(x\). Similarly, we say \(f\) maps (or sends) the input \(x\) to the output \(y\text{.}\)
The set \(X\) is called the domain of \(f\text{;}\) the set \(Y\) is called the codomain of \(f\text{.}\)
When we wish to indicate what rule defines the function, we use the elaborated notation
\begin{align*}
f\colon X \amp\rightarrow Y\\
x \amp\mapsto f(x)\text{.}
\end{align*}
This is read as “The function \(f\) with domain \(X\) and codomain \(Y\) maps an input \(x\) to the output \(f(x)\)”.
Invoking the notion of a rule in the definition of a function is admittedly somewhat vague. A more precise definition can be given using the Cartesian product. Namely, given sets \(X\) and \(Y\text{,}\) we define a function \(f\colon X\rightarrow Y\) to be a subset \(f\subseteq X\times Y\) satisfying the following property: for all \(x\in X\) there is a unique element \((x,y)\in f\text{.}\) The uniqueness of the pair \((x,y)\) then allows us to define the value \(f(x)\) of \(f\) at \(x\) as \(y\text{,}\) denoted \(f(x)=y\text{.}\)
As with sets and tuples, we are obliged to specify what we mean for two functions to be equal. The definition below makes clear how the the domain and codomain, as well as the rule that takes inputs to outputs, are all essential ingredients of a function.
Definition0.2.5.Function equality.
Functions \(f\) and \(g\) are equal if
they have the same domain \(X\) and codomain \(Y\text{,}\) and
for all \(x\in X\text{,}\) we have \(f(x)=g(x)\text{.}\)
Definition0.2.6.Image of a set.
Given a function \(f\colon X\rightarrow Y\) and a subset \(A \subseteq X\text{,}\) the image of \(A\) under \(f\), denoted \(f(A)\text{,}\) is defined as
\begin{equation*}
f(A)=\left\{ y \in Y \colon f(a)=y \text{ for some } a \in A \right\}\text{.}
\end{equation*}
In other words, \(f(A)\) is the set of all outputs \(f(a)\text{,}\) where \(a\in X\text{.}\)
The image of \(f\), denoted \(\operatorname{im} f\text{,}\) is the set of all outputs of \(f\text{:}\) i.e.,
\begin{equation*}
\operatorname{im} f=f(X)=\left\{ y \in Y \colon f(x)=y \text{ for some } x \in X \right\}\text{.}
\end{equation*}
Definition0.2.7.Injective, surjective, bijective.
Let \(f\colon X\rightarrow Y\) be a function.
The function \(f\) is injective (or one-to-one) if for all \(x,x'\in X\text{,}\) if \(f(x)=f(x')\text{,}\) then \(x=x'\text{:}\) equivalently, if \(x\ne x'\text{,}\) then \(f(x)\ne f(x')\text{.}\)
The function \(f\) is surjective (or onto) if for all \(y\in Y\text{,}\) there is an \(x\in X\) such that \(f(x)=y\text{:}\) equivalently, \(\im f=Y\text{.}\)
The function \(f\) is bijective (or a one-to-one correspondence) if it is injective and surjective.
Example0.2.8.Role of domain and codomain in injectivity and surjectivity.
Consider the following three functions
\begin{align*}
f\colon \R \amp\rightarrow \R \amp g\colon [0,\infty)\amp\rightarrow \R \amp h\colon [0,\infty)\amp \rightarrow [0,\infty) \\
x \amp\mapsto x^2 \amp x \amp\mapsto x^2 \amp x \amp\mapsto x^2 \amp \text{.}
\end{align*}
Although all three functions are defined using the same rule (\(x\mapsto x^2\)), they are not equal thanks to their differing domains and/or codomains. The choice of domain and codomain in these examples also plays a crucial role in determining whether the function is injective and/or surjective. The function \(f\) is neither injective (\(f(-2)=f(2)=4\)) nor surjective (\(f(X)=[0,\infty)\ne \R\)); the function \(g\) is injective but not surjective; the function \(h\) is both injective and surjective, hence bijective.
Definition0.2.9.Function composition.
Suppose \(f\colon Z\rightarrow W\) and \(g\colon X\rightarrow Y\) are functions satisfying \(Y\subseteq Z\text{.}\) The composition of \(f\) and \(g\) is the function \(f\circ g\colon X\rightarrow W\) defined as \(f\circ g\, (x)=f(g(x))
\text{,}\) for all \(x\in X\text{.}\)
Definition0.2.10.Identity and inverse functions.
For any set \(X\) the identity function on \(X\) is the function \(\id_X\colon X\rightarrow X\) defined as \(\id_X(x)=x\) for all \(x\in X\text{.}\)
A function \(f\colon X\rightarrow Y\) is invertible if there is a function \(g\colon Y\rightarrow X\) satisfying \(g\circ f=\id_X\) and \(f\circ g=\id_Y\text{:}\) i.e.,
\begin{align*}
g(f(x))\amp =x \text{ for all } x\in X, \\
f(g(y))\amp=y \text{ for all } y\in Y \text{.}
\end{align*}
The function \(g\) in this case is called the inverse of \(f\text{,}\) denoted \(g=f^{-1}\text{.}\)
Theorem0.2.11.Invertible is equivalent to bijective.
A function \(f\colon X\rightarrow Y\) is invertible if and only if it is bijective.
\(x^{2}\) is not one-to-one, you can not simply plug the endpoints of the interval into the function to get the endpoints of the answer. Instead, try graphing the function and shading on the \(x\)-axis the input set. Then use the graph to see which \(y\)-values you get out when you put those \(x\)’s in. For instance, notice that \(0 \in (-4, 5)\text{.}\) Because \(f(0) = 0\text{,}\) you should have \(0 \in f( (-4, 5))\text{.}\) Do you?
2.
For each of the following functions, \(f:\textbf{R}\longrightarrow\textbf{R}\) state whether they are one-to-one, onto, both or neither. Use the following key:
SOLUTION One way we can check which functions are inverses is to make sure they satisfy the identities \(f \left( f^{-1}(x) \right)=x\) and \(f^{-1} \left( f(x) \right)=x\text{.}\) This will show that \(p(x)\) and \(q(x)\) and \(g(x)\) and \(r(x)\) are inverses of each other, while the other pairs of functions are not. Let’s consider \(p(x)\) and \(q(x)\text{.}\) The composition
Thus these are inverses of one another. We can similarly show that \(g(x)\) and \(r(x)\) are inverses of each other. However, the remaining pairs are not inverses. For example, if we consider \(q(x)\) and \(r(x)\text{,}\) we have