Glossary

Select one of the keywords on the left…

Sets and functionsFunction Operations

Reading time: ~25 min

Restriction

It is frequently useful to focus on a subset of the domain of a function without changing the codomain elements that the function associates with those domain elements. For example, if we partition a grocery list with quantity counts among several shoppers, then each shopper will be interested in the restriction of the quantity count function to their own portion of the domain. In other words, they need to know how many of each of their items to pick up, and they don't need to know anything about the other shoppers' items.

Definition (Restriction)
If f: A \to B and A' \subset A, then the restriction of f to A' is the function

\begin{align*}\left. f \right|_{A'} : A' \to B\end{align*}

defined by

\begin{align*}\left. f \right|_{A'}(x) = f(x) \textrm{ for all }x \in A'.\end{align*}

Exercise
State a general relationship involving the terms restriction, image, and range.

Solution. If f:A \to B and A' \subset A, then the range of the restriction

\begin{align*}\left. f \right|_{A'}\end{align*}

is equal to the image f(A'). These sets are equal because they are both equal to the set of elements of B which f maps to from some element of A'.

Composition

Sometimes the elements output by a function f will themselves have associated data, and in this case we often want to connect each element in the domain of f to these data.

For example, consider the album function from the set of songs to the set of albums. Evaluated on a song, the album function returns the album on which the song appeared. Consider also the year function from the set of albums to the set of years (which returns the year in which each album was released). We can determine the year in which a song was released by composing the album function and the year function.

Definition (Composition)
If f: A \to B and g:B \to C, then the function g\circ f which maps x \in A to g(f(x))\in C is called the composition of g and f.

Exercise
Show that composition is associative: (f\circ g)\circ h = f \circ (g \circ h) for all functions f, g, and h with the property that the codomain of h is equal to the domain of g and the codomain of g is equal to the domain of f.

Solution. We check that two functions are equal by checking that they have the same domain and codomain and that they map all input values to the same output values.

The domain of (f\circ g)\circ h is the domain of h, and the domain of f \circ (g \circ h) is h. Similarly both functions have a codomain equal to the codomain of f.

Furthermore, (f\circ g)\circ h maps x to (f\circ g)(h(x)), which by definition of f \circ g is equal to f(g(h(x))). Similarly, f \circ (g \circ h) maps x to f(g(h(x))). Therefore, these functions are equal, and we conclude that compositions are associative.

Anonymous functions

If the rule defining a function is sufficiently simple, we can describe the function using anonymous function notation. For example, x \in \mathbb{R}\mapsto x^2 \in \mathbb{R}, or x\mapsto x^2 for short, is the squaring function from \mathbb{R} to \mathbb{R}. Note that bar on the left edge of the arrow, which distinguishes the arrow in anonymous function notation from the arrow between the domain and codomain of a named function.

Exercise
Suppose that f is the function (x\mapsto \sqrt{x}) \circ (y\mapsto 3y). Then f\left(\frac{1}{12}\right) =

Solution. We first substitute \frac{1}{12} into the tripling function to get \frac{1}{4}, and then we substitute that value into the square root function to get f\left(\frac{1}{12}\right) = \boxed{\tfrac{1}{2}}.

Inverses

Suppose that f: A \to B is a function from the set A of names of customers at a bank to the set B of their primary checking account numbers. Specifically, suppose f maps each customer name to that customer's primary checking account.

Since f is bijective, we can ask to reverse the lookup that f performs: given a primary checking account number, what is the corresponding customer name? This function from B to A is called the inverse of f.

Exercise
Find the inverse of the function f(x) = x^2 + 1 from the interval [0,\infty) to the interval [1,\infty).

Solution. Given y \in [1,\infty), we want to find the value of x that f maps to it. In other words, we want to solve x^2 + 1 = y for . Doing so, we get x = \sqrt{y-1}. Therefore, f^{-1}(y) = \sqrt{y-1}.

Exercise
Select the functions which have inverses.

The function which maps each point (x,y) \in \mathbb{R}^2 to its distance from the origin.
The function which maps each automobile to its VIN (vehicle identification number).
The function which maps each negative real number to its distance from the origin.
The function which maps each real number to its cube.

Exercise
Which of the following is equal to (g\circ f)^{-1}, if f and g are invertible functions for which the codomain of f and the domain of g are equal?

g^{-1} \circ f^{-1}
f^{-1} \circ g^{-1}

Solution. We have (f^{-1} \circ g^{-1}) \circ (g \circ f(x)) = f^{-1}(f(x)) = x, so f^{-1} \circ g^{-1} is the inverse of f\circ g.

Congratulations! You've completed the Data Gymnasia Sets and Functions course.

Bruno
Bruno Bruno