π Functions and other mappings#
β± | words
References and additional materials

Mappings#
Definition
A generic mapping \(f\) from \(A\) to \(B\) is a rule that assigns elements \(x\) of a set \(A\) to elements of a set \(B\). We write
There are four basic types of mappings:
A one-to-one mapping:
\(\forall x \in X\) there is at most one \(f(x) \in Y\); and
\(\forall y \in Y\) there is at most one \(x \in X\) such that \(f(x)=y\).
example: \(f(x) = x\)
A many-to-one mapping:
\(\forall x \in X\) there is at most one \(f(x) \in Y\); but
\(\exists y \in Y\) for which \(\exists x_1 \ne x_2 \in X\) such that \(f(x_1)=f(x_2)=y\).
example: \(f(x) = x^2\)
A one-to-many mapping:
\(\exists x \in X\) for which \(\exists y_1 \ne y_2 \in f(x) \subset Y\); but
\(\forall y \in Y\) there is at most one \(x \in X\) such that \(f(x)=y\).
example: \(f(x) = \{e^x,-e^x\}\)
A many-to-many mapping:
\(\exists x \in X\) for which \(\exists y_1 \ne y_2 \in f(x) \subset Y\); but
\(\exists y \in Y\) for which \(\exists x_1 \ne x_2 \in X\) such that \(f(x_1)=f(x_2)=y\).
example: \(f(x) = \{x,x+1,x+2,\dots\}\)
Mappings of the first two types are referred to as functions. Mappings of the last two types are referred to as set-valued functions or correspondences.
Functions#
Definition
A function \(f: A \rightarrow B\) from set \(A\) to set \(B\) is a mapping that associates to each element of \(A\) a uniquely determined element of \(B\).
typically functions map \(A\) to a (Cartesian product of) set(s) of real numbers \(\mathbb{R}\)
Example
Each student gets a set of textbooks
Each student gets a grade between 0 and 100
Both are mappings
Second is a function, maps to real numbers

Definition
\(A\) is called the domain of \(f\) and \(B\) is called the co-domain
Example
Consider the sets \(A=\{a,b,c,d\}\) and \(B=\{1,2,3,4\}\). The following diagrams illustrate possible associations between elements of \(A\) and \(B\), i.e. domain \(A\) and co-domain \(B\):

These associations can be written as subsets of the Cartesian product \(A \times B\) as follows:
(i) \(\{(a,2),(b,1),(c,4),(d,4)\} \subset A \times B\)
(ii) \(\{(a,1),(a,2),(b,3),(c,4)\} \subset A \times B\)
Panel (i) illustrates a function from \(A\) to \(B\) because each element of \(A\) is associated with no more than one element of \(B\).
Panel (ii) does not illustrate a function from \(A\) to \(B\) because the element \(a\) is associated with two elements of \(B\), and element \(d\) is not associated with any element of \(B\).
Example
is a function from \(\mathbb{R}\) to \(\mathbb{R}\). We may also write
Definition
Functions can be:
scalar-valued when \(n=1\), so \(f: A \to \mathbb{R}\)
vector-valued when \(n>1\), so \(f: A \to \mathbb{R}^n\)
univariate when \(A = \mathbb{R}\), so \(f: \mathbb{R} \to \mathbb{R}^n\)
multivariate when \(A = \mathbb{R}^m\), so \(f: \mathbb{R}^m \to \mathbb{R}^n\)
Definition
For each \(a \in A\), \(f(a) \in B\) is called the image of \(a\) under \(f\)
Definition
If \(f(a) = b\) then \(a\) is called a pre-image of \(b\) under \(f\)
Definition
The definitions of image and pre-image naturally generalize to subsets of the domain.
For each \(X \subset A\), \(f(X) = \{f(x): x \in X\} \in B\) is called the image of \(X\) under \(f\)
For each \(Y \subset B\), \(\{x: f(x) \in Y\} \in A\) is called the pre-image of \(Y\) under \(f\)

Each point in \(B\) can have one, many or zero pre-images
The co-domain of a function is not uniquely pinned down
Example
Consider the mapping defined by \(f(x) = \exp(-x^2)\)
All of these statements are valid:
\(f\) a function from \(\mathbb{R}\) to \(\mathbb{R}\)
\(f\) a function from \(\mathbb{R}\) to \((0, \infty)\)
\(f\) a function from \(\mathbb{R}\) to \((0, 1]\)
Definition
The smallest possible co-domain is called the range of \(f: A \to B\):

Example
Let \(f: [-1, 1] \to \mathbb{R}\) be defined by
Then \(\mathrm{rng}(f) = [0.8, 2.0]\)

Example
If \( f: [0, 1] \to \mathbb{R}\) is defined by
then \(\mathrm{rng}(f) = [0, 2]\)
Example
If \(f: \mathbb{R} \to \mathbb{R}\) is defined by
then \(\mathrm{rng}(f) = (0, \infty)\)
Compositions#
Definition
The composition of \(f: A \to B\) and \(g: B \to C\) is the function \(g \circ f\) from \(A\) to \(C\) defined by

Example
Let \(f: \mathbb{R} \to \mathbb{R}\) be defined by \(f(x) = x^2\) and \(g: \mathbb{R} \to \mathbb{R}\) be defined by \(g(x) = x + 1\)
Then \((g \circ f)(x) = g(f(x)) = g(x^2) = x^2 + 1\)
Note that \((f \circ g)(x) = f(g(x)) = f(x+1) = (x+1)^2 \ne (g \circ f)(x)\)
Order of components in a composite function matters
The domain of the outer function in a composition must contain the range of the inner function
Onto (Surjections)#
Definition
A function \(f: A \to B\) is called onto (or surjection) if every element of \(B\) is the image under \(f\) of at least one point in \(A\).
Equivalently, \(\mathrm{rng}(f) = B\)

Fact
\(f: A \to B\) is onto if and only if each element of \(B\) has at least one pre-image under \(f\)

Fig. 5 Onto (surjection)#

Fig. 6 Not onto!#

Fig. 7 Not onto!#
Example
The function \(f: \mathbb{R} \to \mathbb{R}\) defined by
is onto whenever \(a \ne 0\)
To see this pick any \(y \in \mathbb{R}\)
We claim \(\exists \; x \in \mathbb{R}\) such that \(f(x) = y\)
Equivalent:
Fact
Every cubic equation with \(a \ne 0\) has at least one real root

Fig. 8 Cubic functions from \(\mathbb{R}\) to \(\mathbb{R}\) are always onto#
One-to-One (Injections)#
Definition
A function \(f: A \to B\) is called one-to-one (or injection) if distinct elements of \(A\) are always mapped into distinct elements of \(B\).
That is, \(f\) is one-to-one if
Equivalently,
Fact
\(f: A \to B\) is one-to-one if and only if each element of \(B\) has at most one pre-image under \(f\)

Fig. 9 One-to-one#

Fig. 10 One-to-one#

Fig. 11 Not one-to-one#
Bijections#
Definition
A function that is
one-to-one (injection) and
onto (surjection)
is called a bijection or one-to-one correspondence

Fact
\(f: A \to B\) is a bijection if and only if each \(b \in B\) has one and only one pre-image in \(A\)
Example
\(x \mapsto 2x\) is a bijection from \(\mathbb{R}\) to \(\mathbb{R}\)

Example
\(k \mapsto -k\) is a bijection from \(\mathbb{Z}\) to \(\mathbb{Z}\)

Example
\(x \mapsto x^2\) is not a bijection from \(\mathbb{R}\) to \(\mathbb{R} \)

Inverse functions#
Fact
If \(f: A \to B\) a bijection, then there exists a unique function \(\phi: B \to A\) such that
That function \(\phi\) is called the inverse of \(f\) and written \(f^{-1}\)

Example
Let
\(f: \mathbb{R} \to (0, \infty)\) be defined by \(f(x) = \exp(x) := e^x\)
\(\phi: (0, \infty) \to \mathbb{R}\) be defined by \(\phi(x) = \log(x)\)
Then \(\phi = f^{-1}\) because, for any \(a \in \mathbb{R}\),
Fact
If \(f: A \to B\) is one-to-one, then \(f: A \to \mathrm{rng}(f)\) is a bijection
Fact
Let \(f: A \to B\) and \(g: B \to C\) be bijections
\(f^{-1}\) is a bijection and its inverse is \(f\)
\(f^{-1}(f(a)) = a\) for all \(a \in A\)
\(f(f^{-1}(b)) = b\) for all \(b \in B\)
\(g \circ f\) is a bijection from \(A\) to \(C\) and \((g \circ f)^{-1} = f^{-1} \circ g^{-1}\)

Fig. 12 Illustration of \((g \circ f)^{-1} = f^{-1} \circ g^{-1}\)#
Set operations on image and pre-image#
Fact
The pre-image of the union of two sets is equal to the union of the pre-images of each of the two sets: \(f^{β1}(A \cup B) = f^{β1}(A) \cup f^{β1}(B)\).
Proof
Let \(f: X \rightarrow Y\) and consider two sets, \(A \subseteq Y\) and \(B \subseteq Y\). We want to show that the pre-image of the union of two sets is equal to the union of the pre-images of each of the two sets: \(f^{β1}(A \cup B) = f^{β1}(A) \cup f^{β1}(B)\).
Note that
Example
Example: \(f: \mathbb{Z} \rightarrow \mathbb{R}\) defined by \(f(z) = z^2, A = [0, 9] \subset \mathbb{R}\), and \(B = [5, 25] \subset \mathbb{R}\). \(A \cup B = [0, 25] \subset \mathbb{R}\).
The pre-image mapping here is given by \(f^{β1}(y) = \pm \sqrt{y}\) if \(\pm \sqrt{y}\) is an integer, and \(f^{β1}(y) = \varnothing\) otherwise. Note that this pre-image mapping is not an inverse function, because \(\pm \sqrt{y}\) is sometimes multi-valued.
\(f^{β1}(A \cup B) = \{β5, β4, β3, β2, β1, 0, 1, 2, 3, 4, 5\}\)
\(f^{β1}(A) = \{β3, β2, β1, 0, 1, 2, 3\}\)
\(f^{β1}(B) = \{β5, β4, β3, 3, 4, 5\}\)
\(f^{β1}(A) \cup f^{-1}(B) = \{β5, β4, β3, β2, β1, 0, 1, 2, 3, 4, 5\} = f^{β1}(A \cup B)\)
Fact
The pre-image of the intersection of two sets is equal to the intersection of the pre-images of each of the two sets: \(f^{β1}(A \cap B) = f^{β1}(A) \cap f^{β1}(B)\).
Proof
Let \(f: X \rightarrow Y\) and consider two sets, \(A \subseteq Y\) and \(B \subseteq Y\). We want to show that the pre-image of the intersection of two sets is equal to the intersection of the pre-images of each of the two sets: \(f^{β1}(A \cap B) = f^{β1}(A) \cap f^{β1}(B)\).
Note that
Example
Example: \(f: \mathbb{Z} \rightarrow \mathbb{R}\) defined by \(f(z) = z^2, A = [0, 9] \subset \mathbb{R}\), and \(B = [5, 25] \subset \mathbb{R}\). \(A \cap B = [5, 9] \subset \mathbb{R}\).
The pre-image mapping here is given by \(f^{β1}(y) = \pm \sqrt{y}\) if \(\pm \sqrt{y}\) is an integer, and \(f^{β1}(y) = \varnothing\) otherwise. Note that this pre-image mapping is not an inverse function, because \(\pm \sqrt{y}\) is sometimes multi-valued.
\(f^{β1}(A \cap B) = \{β3, 3\}\)
\(f^{β1}(A) = \{β3, β2, β1, 0, 1, 2, 3\}\)
\(f^{β1}(B) = \{β5, β4, β3, 3, 4, 5\}\)
\(f^{β1}(A) \cap f^{-1}(B) = \{β3, 3\} = f^{β1}(A \cap B)\)
Fact
The image of the union of two sets is equal to the union of the images of each of the two sets: \(f(A \cup B) = f(A) \cup f(B)\).
Proof
Let \(f: X \rightarrow Y\) and consider two sets, \(A \subseteq Y\) and \(B \subseteq Y\). We want to show that the image of the union of two sets is equal to the union of the images of each of the two sets: \(f(A \cup B) = f(A) \cup f(B)\).
Note that
Example
Example: \(f: \mathbb{Z} \rightarrow \mathbb{R}\) defined by \(f(z) = z^2, A = \{1, 2, 3\} \subset \mathbb{Z}\), and \(B = \{2,3,4,5\} \subset \mathbb{Z}\).
\(A \cup B = \{1,2,3,4,5\} \subset \mathbb{Z}\)
\(f(A \cup B) = \{1, 4, 9, 16, 25\} \subset \mathbb{R}\)
\(f(A) = \{1, 4, 9\} \subset \mathbb{R}\)
\(f(B) = \{4, 9, 16, 25\} \subset \mathbb{R}\)
\(f(A) \cup f(B) = \{1, 4, 9, 16, 25\} = f(A \cup B)\)
Note
However, the image of the intersection of two sets is not necessarily equal to the intersection of the images of each of the two sets. In other words, there are some cases where \(f(A \cap B) \ne f(A) \cap f(B)\).
Example
Consider the mapping \(f: \mathbb{R}^2 \rightarrow \mathbb{R}\) defined by \(f(x, y) = x\), along with the sets
and
Note that \(A \cap B = \varnothing\), so that \(f(A \cap B) = f(\varnothing) = \varnothing\). Note also that
and
so that
Clearly, we have
Non-decreasing and strictly increasing functions#
Definition
A function \(f : X \rightarrow \mathbb{R}\), where \(X \subseteq \mathbb{R}\), is said to be a non-decreasing function if
Definition
A function \(f : X \rightarrow \mathbb{R}\), where \(X \subseteq \mathbb{R}\), is said to be a strictly increasing function if both
(a) \(x = y \iff f(x) = f(y)\); and
(b) \(x < y \iff f(x) < f(y)\).
Note the following:
A strictly increasing function is also a one-to-one function.
There are some one-to-one functions that are not strictly increasing.
A strictly increasing function is also a non-decreasing function.
There are some non-decreasing functions that are not strictly increasing.
Exercise: give examples of each case
Definition
Non-increasing and strictly decreasing functions are defined in a similar manner, with the inequality signs flipped.
Monotonic transformations#
Suppose that \(U : X \rightarrow \mathbb{R}\) is a utility function that represents the weak preference relation \(\succsim\). This means that \(x \succsim y \iff U(x) \geqslant U(y)\).
Let \(f: \mathbb{R} \rightarrow \mathbb{R}\) be a strictly increasing function. Consider the composite function \(V = f \circ U\). It can be shown that \(V\) is also a utility function that represents the weak preference relation \(\succsim\). In other words, it can be shown that \(x \succsim y \iff V(x) \geqslant V(y)\).
Definition
Monotonic transformation of a given function is its composition with a a strictly increasing or strictly decreasing function.
Fact
Monotonic transformation of a utility function that represents a preference relation will represent the same preference relation.
Example
Consider a consumer whose preferences over bundles of strictly positive amounts of each of two commodities can be represented by a utility function \(U : \mathbb{R}^2_{++} \rightarrow \mathbb{R}_{++}\) of the form
where \(A > 0, \alpha > 0\), and \(\beta > 0\).
Such preferences are known as Cobb-Douglas preferences.
The function \(f: \mathbb{R}_{++} \rightarrow \mathbb{R}_{++}\) defined by \(f(x) = \left( \frac{1}{A} \right)x\) is strictly increasing. Thus we know that another utility function that represents this consumerβs preferences is
The function \(g: \mathbb{R}_{++} \rightarrow \mathbb{R}_{++}\) defined by \(g(x) = x^{\frac{1}{(\alpha + \beta)}}\) is strictly increasing. (If any relevant surd expression can be either positive or negative, then we will assume that the positive option is chosen throughout this Cobb-Douglas preferences example.) Thus we know that another utility function that represents this consumerβs preferences is
where \( \gamma = \frac{\alpha}{\alpha + \beta} \in (0, 1)\).
The function \(k: \mathbb{R}_{++} \rightarrow \mathbb{R}\) defined by \(k(x) = ln(x )\) is strictly increasing. Thus we know that another utility function that represents this consumerβs preferences is
Graphs of functions and correspondences#
Definition
A graph of a mapping \(f \colon X \to Y\) is a set \(\Gamma \subset X \times Y\) of points \(x \in X\) and \(y \in Y\) where it holds \(y \in f(x)\), or \(y = f(x)\) in hte case \(f\) is a function.
For the functions \(\mathbb{R} \to \mathbb{R}\) a graph can be conveniently drawn on a plane. We can also easily plot graphs of correspondences \(\mathbb{R} \to 2^\mathbb{R}\).
Shifting the graph#
Fact
Consider \(\Gamma_0\) the graph of function \(f(x): \mathbb{R} \to \mathbb{R}\). Denote \(\Gamma_1\) the graph of the composite function \(g(x) = af(bx+c)+d\), such that when \(a=b=1\) and \(c=d=0\) \(f(x)=g(x)\). It holds that:
for \(a \ne 1\), \(a>0\) graph \(\Gamma_1\) is a vertical stretch or compression of \(\Gamma_0\) by a factor of \(|a|\)
for \(a<0\) in addition graph \(\Gamma_1\) flips around the horizontal axis
for \(b \ne 1\), \(b>0\) graph \(\Gamma_1\) is a horizontal stretch or compression of \(\Gamma_0\) by a factor of \(|b|\)
for \(b<0\) in addition graph \(\Gamma_1\) flips around the vertical axis
for \(c \ne 0\) graph \(\Gamma_1\) is a horizontal shift of \(\Gamma_0\) by \(\frac{c}{b}\), left for \(\frac{c}{b}>0\) and right for \(\frac{c}{b}<0\)
for \(d \ne 0\) graph \(\Gamma_1\) is a vertical shift of \(\Gamma_0\) by \(d\), up for \(d>0\) and down for \(d<0\)
Example
Online graphing tools like Desmos
Graph of the inverse function#
Fact
When the inverse exists, its graph is a flip of the original graph over the 45 degree line.

Fig. 15 Graph of inverse functions#