function

If there is any one concept that can be said to be at the heart of modern mathematics it is the notion of a function, yet functions are often misunderstood. They are commonly introduced to students as a kind of machine into which one places a value, and out of which comes some corresponding value.

Figure 1: Functions as machines.

This characterization is useful in that it captures an important feature of functions, namely that for each input we get exactly one output. It fails as a definition, however, not just because of what it leaves out but because it is in one respect quite misleading, as we'll see below.

The Definition

Properly understood a function is first of all a set, a well-defined collection of objects. In particular, a function is an example of the kind of set called a relation, that is, it is a set of ordered pairs.

Figure 2: A Relation R from A to B.

The ordered pairs that constitute the relation have the property that the first element in any pair comes from a set called the domain, and the second element comes from a set called the codomain, and the relation is then said to be from the domain and to the codomain. It sometimes happens that the domain and the codomain are the same set, in which case we would say that the relation is ‘on the set,’ meaning that it is a relation from the set to itself.

There is no further restriction on the ordered pairs in a relation. Any particular element of the domain may be paired with one, some, or all of the elements of the codomain, or even with none at all. Ditto for elements of the codomain. A relation can be empty (contain no ordered pairs), or total (contain every ordered pair).

To qualify as a function a relation must meet some further requirements. To begin with, we expect every element of the domain to be mapped by the function to some element of the codomain. Further, we require that each element of the domain be mapped to just one element of the codomain. Here, then, is the definition:

Def n: A function is a relation in which every element of the domain is mapped to exactly one element of the codomain.

You may have noticed an asymmetry in this definition. The definition does not require that each element of the codomain have just one element of the domain mapped to it. Nor does it require that each element of the codomain have any element of the domain mapped to it. Thus, we can have a relation that is a function in one direction, so to speak, but not in the other. Consider the following diagram of a function:

Figure 3: Example of a function.

It is easy to see that this is a function; each element of the domain gets mapped to one element in the codomain. Some get mapped to the same element, but that is okay. Likewise, there are some elements of the codomain that have nothing mapped to them, and this is okay too.

The subset of the codomain that is mapped to by the function is called the function's range. The range of the function pictured above is \(\{b_1,b_4,b_5,b_6\}\).

Injections, Surjections, and Bijections

If it happens that a function maps each element of its domain to a unique element of the codomain, we say that the function is ‘one-to-one’, and we call it an injection. This is pictured below.

Figure 4: An injection.

If the range of a function is equal to its codomain, which is to say that every element of the codomain is mapped to by some element of the domain, then we say that the function is ‘onto,’ and we call it a surjection.

Figure 5: A surjection.

A function that is both an injection and a surjection is called a bijection.

Figure 6: A bijection.

A bijection—a function that is both ‘one-to-one’ and ‘onto’—has the special property that it is still a function if we swap the domain and codomain, that is, switch the order of each ordered pair. The reversed function is called the inverse function, and this is indicated by superscripting a ‘-1’ on the function symbol.

Figure 7: A function and its inverse.

In the figure above we have

\[\begin{eqnarray*}f &=& \{(a_1,b_3),(a_2,b_1),(a_3,b_5),\\ & & \,\,\,(a_4,b_4),(a_5,b_2),(a_6,b_6)\}\end{eqnarray*}\]

and

\[\begin{eqnarray*}f^{-1} &=& \{(b_1,a_2),(b_2,a_5),(b_3,a_1),\\ & & \,\,\,(b_4,a_4),(b_5,a_3),(b_6,a_6)\}\end{eqnarray*}\].

The function and its inverse are mirror images of one another. It is an important fact that being a bijection is not only a sufficient condition for a function to have an inverse, it is also a necessary condition. To say that a function is a bijection and to say that it has an inverse is to say the same thing in two ways.

Function Notation

In workaday mathematics we are generally interested in functions on a set of numbers, usually the set of real numbers. By convention we denote a variable in the domain by \(x\) and a variable in the codomain by \(y\), and we write \(y=f(x)\) to indicate that the ordered pair \((x,y)\) is an element of the function \(f\).

\[y=f(x)\,\,\, \mbox{ means } \,\,\,(x,y) \in f \]

We call \(x\) the argument of the function, and we say that \(y\) is the value of the function ‘at \(x\).’

When it comes to functions on the real numbers we encounter, broadly speaking, just three types: those that have an algebraic definition, those that have a definition but not an algebraic one, and those that have no definition at all. We will consider these in turn.

An algebraic function is a function that operates on its argument with arithmetical operators: addition and subtraction, multiplication and division, raising to a rational power (exponent), or taking a rational root. We denote such a function in the following way:

\[f(x) = \mbox{some algebra stuff happening to } x\]

Examples include:

\[\begin{eqnarray*} f(x) & = & x+1 \\ & & \\ f(x) & = & x^2 \\ & & \\ f(x) & = & \left(\sqrt{x} + 1\right)^2 \\ & & \\ f(x) & = & \frac{x^2}{\left(\sqrt{x} + 1\right)^2} \\ \end{eqnarray*}\]

Not all functions on the real numbers can be defined using just the arithmetical operators, and those that cannot are called the transcendental functions. These functions always have names (because for the most part we can't just use arithmetic symbols to represent them) and special definitions. The commonest examples are the exponential, logarithmic, and trigonometric functions:

\[\begin{eqnarray*} f(x) & = & \log x \\ & & \\ f(x) & = & e^x \\ & & \\ f(x) & = & \sin x \end{eqnarray*}\]

The algebraic and definable non-algebraic functions exhaust all the possibilities for functions that are defined by rules we can state. But this still doesn't include every function. Indeed, there is a sense in which there are far more functions that have no definition—that in fact can't have a definition—than there are functions that do have a definition. It is this unsettling fact that makes the machine metaphor for functions misleading. The notion of function is much more general than the notion of ‘machine,’ because to call something a machine is to imply that it has a structure we can describe and understand, and we know that there are functions we cannot describe, even in principle.

In most of the mathematics we learn we treat functions as a “value in, value out” affair, and this is perfectly legitimate. But we should never lose site of the underlying fact that a function is a collection of ordered pairs that satisfies certain conditions. Like many of the apparently simple things we learn early on in our journey through mathematics, the notion of a function is one that takes on unexpected depth as we gain mathematical maturity, and leads us in time to surprising mathematical beauties.

Home