Section 1.2 Sets and Functions Review
The concept of a function is truly the megastar of much of mathematics. A function gives two separate structures (e.g. sets, spaces, etc.) permission to talk to each other and relate their properties. So it is of great importance that we are comfortable with some basic vocabulary concerning functions. In order to become so, we also require knowledge of some basic set theory notation.
Definition 1.2.1.
A set is a collection of elements. We write \(a \in A \) to denote that the element \(a \) is in the set \(A \text{.}\) A set \(A_0 \) is a subset of \(A \text{,}\) written \(A_0 \subseteq A \text{,}\) if all elements in \(A_0 \) are also in \(A \text{.}\)
Example 1.2.2. Natural numbers as a set.
The set of natural numbers \(\mathbb{N} \) is one of the first sets we learn to work with. Examples of subsets include the even numbers \(2\mathbb{N} = \{0, 2, 4, \cdots\} \text{,}\) the numbers between \(0 \) and \(n \) \([n] = \{0,1, \ldots, n\} \) and the empty set \(\emptyset \) which, as its name suggests, is the set with no elements. To denote that these are subsets, one would write \([n] \subset \mathbb{N}\) or \(\emptyset \subset \mathbb{N}\text{.}\) Of course, negative integers are not natural numbers, so the integers do not form a subset of the naturals. We can denote this fact by \(\mathbb{Z} \not\subset \mathbb{N}\text{.}\)
Useful operations on subsets are intersection and union.
Definition 1.2.3.
Given subsets \(A_0, A_1 \subseteq A \) their intersection is
\begin{equation*}
A_0 \cap A_1 = \{ a \in A : a \in A_0 \text{ and } a \in A_1 \}
\end{equation*}
while their union is
\begin{equation*}
A_0 \cup A_1 = \{ a \in A : a \in A_0 \text{ or } a \in A_1 \}
\end{equation*}
Given a pair of sets, we may produce many other sets even if they do not live in the same larger set. A standard construction that we will often encounter is the product of two sets \(A \) and \(B \text{.}\)
Definition 1.2.4.
The product set of \(A \) and \(B \) is the set of ordered pairs
\begin{equation*}
A \times B = \{(a, b) : a \in A \text{ and } b \in B \} \text{.}
\end{equation*}
For a positive integer \(n \text{,}\) we denote by \(A^n \) the \(n \)-fold product of \(A \) with itself consisting of \(n \)-tuples \((a_1, a_2, \ldots, a_n) \text{.}\)
This definition, while coming to us from the abstract viewpoint, gives us our first glimpse of one of the central objects of calculus. As such, we obtain a computational and geometric structure.
Example 1.2.5. Product sets.
We write \(\mathbb{R}^n \) and \(\mathbb{C}^n \) for \(n \)-dimensional real (or Euclidean) and complex space. The points of \(\mathbb{R}^n \) are \(n \)-tuples of real numbers \((r_1, r_2, \ldots, r_n) \) (although in some contexts, we will write them as columns instead of rows). The cases of the real line \(\mathbb{R} = \mathbb{R}^1 \) and the Cartesian plane \(\mathbb{R}^2 \) or most likely very familiar to you by now. Three dimensional space can also be given Cartesian coordinates by considering
\begin{equation*}
\mathbb{R}^3 = \{ (x, y, z) : x, y, z \text{ real numbers} \}
\end{equation*}
Here we take \(z \) to be a height coordinate and place the Cartesian plane \((x,y) \) flat at height zero \((x, y, 0) \text{.}\) We do this so that, looking downward at the plane, the positive \(x\)-axis moves counter-clockwise towards the positive \(y \)-axis. This method of orienting three space is called the ‘Right-hand rule’.
Now let us bring in our megastar, the function, by defining it abstractly.
Definition 1.2.6.
A function \(f \) from the set \(A \) to the set \(B \) is a subset \(gr_f \) of \(A \times B \) which satisfies the property :
The element \(b \) from the pair \((a, b) \) is written \(f(a) \) and we think of \(f \) as assigning \(a \) to \(b \text{.}\)
The notation for this setup is
\begin{equation}
f: A \longrightarrow B \tag{1.2.1}
\end{equation}
and the vocabulary around this is
\(gr_f \) is called the graph of \(f \text{,}\)
\(A \) is called the domain of \(f \text{,}\)
\(B \) is called the codomain of \(f \text{,}\)
the set of elements \(b \) in \(B \) that can be written in the form \(f(a) \) for some \(a \) in \(A \) is called the range or image of \(f \text{.}\)
An astute student may object and note that \(f \) is defined to be \(gr_f \text{,}\) so why would we call \(gr_f \) the graph of the function and not just the function itself? The answer may not satisfy, but in fact a function is often thought of as an assignment, rather than a graph (even though it technically is a graph), so we differentiate the language in order to express the different perspectives. Indeed, the definition given here is an abstract definition but it ties in directly to the computational side through formulas and the geometric perspective by considering the graph.
Example 1.2.7. Functions of one real variable.
A calculus student spends nearly all of their time thinking about functions
\begin{equation}
f : (a,b) \to \mathbb{R}\tag{1.2.2}
\end{equation}
where
\((a,b) \) is some interval in
\(\mathbb{R} \text{.}\) Note that, for these functions, the property
\(\bullet\) in
Definition 1.2.6 is precisely the vertical line test for a function.
In a calculus course, the notation above is rare and functions are often written computationally in terms of a formula
\begin{equation*}
f(x) = x^2 + 1.
\end{equation*}
or referred to as \(y \) as in:
\begin{equation*}
\text{`Consider the function } y = x^2 + 1 \text{'}.
\end{equation*}
This last statement is actually talking about the abstract definition of a function, namely, its graph:
\begin{equation*}
gr_f = \{(x, y) : y = x^2 + 1 \} = \{(x, y) : y = f(x) \}.
\end{equation*}
Note that we did not define the domain of
\(f(x) \) here, and it could indeed be any subset of
\(\mathbb{R} \) and the most general set would be
\(\mathbb{R} \) itself. We did define the codomain of
\(f \) as
\(\mathbb{R} \) in
(1.2.2), but, if we take the domain to be
\(\mathbb{R} \text{,}\) we can compute the range to be
\((1, \infty) \text{.}\) We see that the codomain and range of a function may indeed be distinct.
The difference between the codomain and range seen in
Example 1.2.7 leads to a few special definitions which will arise repeatedly throughout this course.
Definition 1.2.8.
Let \(f : A \to B \) be a function.
We say that \(f \) is one-to-one (or 1-1) if the equality \(f(a_0) = f(a_1) \) implies that \(a_0 = a_1 \text{.}\)
We say that \(f \) is onto if \(B \) is the range of \(f \text{.}\)
We say that \(f \) is a one-to-one correspondence if it is both one-to-one and onto.
The element \(b \) from the pair \((a, b) \) is written \(f(a) \) and we think of \(f \) as assigning \(a \) to \(b \text{.}\)
One should think of one-to-one functions as including one set into another and onto functions as covering one set by another. A one-to-one correspondence should be thought of as an exact element to element matching from the domain to the codomain.
Example 1.2.9. One-to-one and onto functions.
As it turns out, functions can satisfy none, some or all of the properties in
Definition 1.2.8. Indeed, consider the following list of functions:
\begin{align*}
f_1 : \mathbb{R} \amp \to \mathbb{R} \amp f(x) \amp = x^2 \amp \text{neither one-to-one nor onto} \\
f_2 : \mathbb{N} \amp \to \mathbb{R} \amp f(x) \amp = x \amp \text{one-to-one but not onto} \\
f_3 : \mathbb{R} \amp \to \mathbb{R} \amp f(x) \amp = x^3 - x \amp \text{onto but not one-to-one} \\
f_4 : \mathbb{R} \amp \to \mathbb{R} \amp f(x) \amp = x^3 \amp \text{one-to-one and onto} = \text{one-to-one correspondence}
\end{align*}
In the previous section, we reviewed ways of combining numbers and it is the case the functions can be combined as well using composition. However, for two functions \(f \) and \(g \) to admit a composition \(g \circ f \text{,}\) we must have that the codomain of \(f \) is the domain of \(g \) (or at least contained in the domain).
Definition 1.2.10.
Given functions \(f : A \to B \) and \(g: B \to C \) the composite function \(g \circ f : A \to C \) is defined by the formula
\begin{equation*}
(g\circ f) (a) = g( f(a)).
\end{equation*}
It is the case that composition is associative, but commutativity is sometimes not even a sensible property, and when it is, it often fails to hold. Another property that we will often want (and rarely have) is the existence of an inverse function. To explain this concept, we need the notation of the identity function
\begin{equation*}
1_A : A \longrightarrow A
\end{equation*}
which by definition gives \(1_A (a) = a \) for all elements \(a \) of \(A \text{.}\) It is not hard to see that given any \(f : A \to B \) the identity functions act as identities with respect to composition
\begin{equation*}
1_B \circ f = f = f \circ 1_A \text{.}
\end{equation*}
An inverse function of \(f \) is a function \(g : B \to A \) (or \(f^{-1} \)) which satisfies the equations
\begin{align}
g \circ f \amp = 1_A, \tag{1.2.3}\\
f \circ g \amp = 1_B.\tag{1.2.4}
\end{align}
The following is a useful and basic result.
Proposition 1.2.11.
A function \(f : A \to B \) has an inverse function if and only if it is a one-to-one correspondence. In this case, its inverse is unique.
Proof.
We need to show both that a one-to-one correspondence has an inverse and that a function with an inverse is a one-to-one correspondence. Let’s start with the latter and assume \(f \) has an inverse \(g \text{.}\) To see that \(f \) is one-to-one, suppose \(f(a_0) = f(a_1) \text{.}\) Then
\begin{equation*}
a_0 = 1_A (a_0) = (g \circ f) (a_0) = g(f(a_0)) = g(f(a_1)) = (g \circ f) (a_1) = 1_A (a_1) = a_1,
\end{equation*}
showing that \(f \) is one-to-one. To see that \(f \) is onto, simply observe that for any \(b \in B \text{,}\) we have that \(b = 1_B (b) = (f \circ g) (b) = f (g(b)) \) so that \(b \) is in the range of \(f \) and \(f \) is onto.
Now for the converse. Suppose
\(f \) is a one-to-one correspondence and let
\(b \) be any element of
\(B \text{.}\) Then, since
\(f \) is onto, there is some
\(a \) in
\(A \) with
\(f(a) = b \text{.}\) We define
\(g(b) = a \text{.}\) To see that this makes sense, we need to verify (*) in
Definition 1.2.6 and show that
\(a \) is unique. But if
\(f(a^\prime) = b \) for some other
\(a^\prime \) in
\(A \text{,}\) then
\(f \) is not one-to-one, so
\(a \) must be unique implying
\(g \) is a function. It is clear that
\((g \circ f) (a) = g(b) = a \) so that
\(g \circ f = 1_A \) and
\((f \circ g) (b) = f(a) = b \) so that
\(f \circ g = 1_B \text{.}\) Thus
\(g \) is an inverse function to
\(f \text{.}\)
For the last statement about the uniqueness of the function \(g \text{,}\) one considers what would happen if \(h \) were another inverse. Then for any \(b \) in \(B \text{,}\)
\begin{equation*}
h(b) = (h \circ 1_B ) (b) = (h \circ f \circ g) (b) = (1_A \circ g) (b) = 1_A (g(b)) = g(b).
\end{equation*}
But this means that \(h = g \) as a function and \(g \) is the unique inverse.
Example 1.2.12. A function and its inverse.
Consider the function \(f(x) = \frac{x - 1}{x + 1} \) as a function from \(\mathbb{R} - \{-1\} \) to \(\mathbb{R} - \{1\} \text{.}\) We note that \(f(x) = 1 - \frac{2}{x + 1} \) and that its derivative is \(\frac{2}{(x + 1)^2} \gt 0 \text{.}\) So it is an increasing function which implies it is one-to-one (the conclusion made is true, but the argument has a flaw... why?). Encouraged by this, we can compute an inverse to \(f(x) \text{.}\) Since \(y = f(x) = 1 - \frac{2}{x + 1} \) we have
\begin{equation*}
\frac{1 - y}{2} = \frac{1}{x + 1}
\end{equation*}
So that \(x = \frac{2}{1 - y} - 1 = \frac{1 + y}{1 - y} \text{.}\) Thus
\begin{equation*}
g(y) = \frac{1+y}{1 - y}
\end{equation*}
gives an inverse.
The types of functions one often begins to explore after the first year of calculus are so called vector valued functions> which are usually thought of as functions
\begin{equation}
f : U \to \mathbb{R}^m \tag{1.2.5}
\end{equation}
where \(U \subseteq \mathbb{R}^n\text{.}\) These functions can be, and often are, written in coordinates as
\begin{equation*}
f(x_1, \ldots, x_n) = \left( f_1 (x_1, \ldots, x_n), \ldots, f_m (x_1, \ldots , x_n) \right).
\end{equation*}
Vector valued functions where either \(n = 1 \) or \(m = 1 \) occupy a large part of our attention and have special names. If both \(m = 1 \) and \(n = 1 \) we are in the setting of one variable calculus. When just \(n = 1 \text{,}\) but \(m \) is potentially larger, we call the function \(f(x) \) a path and its image (or range) a curve. As we will see, such functions are the focal point of ordinary differential equations. An example that one will have seen before is the parametrization of the unit circle
\begin{equation}
f(\theta) = (\cos \theta , \sin \theta), \text{ where } 0 \leq \theta \lt 2\pi. \tag{1.2.6}
\end{equation}
On the other hand, when \(m = 1 \) and \(n \) is potentially larger, we call \(f(x_1, \ldots, x_n) \) a scalar function. Scalar functions are ubiquitous in mathematics and applications. Indeed, any system that is producing a single value which relies on several variables contains a scalar function. For example, the total energy \(H \) of a particle of mass \(m \) in a gravitational field \(g \) will depend on that particles height \(q \) and its momentum \(p \) so that
\begin{equation*}
H(p, q) = \frac{p^2}{2m} + mgq .
\end{equation*}
Thus \(H \) is a scalar valued function. In fact, much of classical mechanics is guided by these types of functions.
Exercises Exercises
1.
Explain the claim in
Example 1.2.7 that the property
\(\bullet\) is the same as the vertical line test. Likewise, explain why one of these functions is one-to-one if and only if it survives the horizontal line test.
2.
Let \(f(x) = x + 2\pi \) and \(g(x) = \sin (x) \) both be considered as functions from \(\mathbb{R} \) to \(\mathbb{R} \text{.}\) Show that commutativity fails for their composition.
3.
4.
A function
\(f : A \to B \) has a left inverse if
(1.2.3) holds for some
\(g:B \to A \) and a right inverse if equation
(1.2.4) holds for some
\(g : B \to A \text{.}\)
(a)
Prove that \(f \) has a left inverse if and only if it is one-to-one.
(b)
Prove that \(f \) has a right inverse if and only if it is onto.
5.
Inverse trigonometric functions are often used in a second semester calculus course. They are, however, frequently misunderstood because of their dependence on the subdomain of the original function. The standard range for \(\arcsin \) is \(\left[-\frac{\pi}{2}, \frac{\pi}{2} \right] \text{.}\) Give an alternative definition of \(\arcsin \) as an inverse to \(\sin \) by specifying another domain where \(\sin \) is one-to-one. What is the domain of your new \(\arcsin \text{?}\)
6.
Write a formula for a function satisfying the following description:
(a)
A path parametrizing the \(y \)-axis of three dimensional space \(\mathbb{R}^3 \text{.}\)
(b)
A scalar valued function describing the distance from a point \((x,y,z) \) to the \(y \)-axis.