Skip to content

Chapter 2 — Functions and Dynamic Relations

2.1 — The Notion of Function: from Correspondence to Determinism

Before asking how a function behaves, one must ask what kind of object it is.


The previous chapter worked with numbers, expressions and curves: a value of \(x\) that satisfies an equation, a point of the plane that belongs to a circle. Still missing is the object that systematically links the elements of one set with those of another: the function. A function is neither a formula nor a graph; both are, as we will see, ways of presenting something more elementary. It is a relation between two sets that satisfies a very particular condition. Fixing that condition precisely, before handling a single concrete function, is the purpose of this section.


§1. The Cartesian product

Given two sets \(A\) and \(B\), their Cartesian product is the set of all ordered pairs whose first component belongs to \(A\) and whose second component belongs to \(B\):

\[A \times B = \{(a, b) \mid a \in A, b \in B\}\]

This is the set-builder notation of §1.1: the bar \(\mid\) separates the elements from the condition they satisfy, and \(\in\) indicates membership. As in §1.8, order matters: \((a, b) = (c, d)\) means \(a = c\) and \(b = d\), so that \((a, b)\) and \((b, a)\) are different pairs unless \(a = b\). That is why \(A \times B\) and \(B \times A\) are, in general, different sets.

The case \(A = B = \mathbb{R}\) is already familiar to us, although we did not call it that: \(\mathbb{R} \times \mathbb{R}\) is the set \(\mathbb{R}^2\) of §1.8, the Cartesian plane. The analytic geometry of the previous chapter can be reread as the study of certain subsets of this Cartesian product.



§2. Set inclusion and relations

Before going on, it is worth fixing a symbol the book has been using without defining it, since the chain of number sets in §1.1. Given two sets \(S\) and \(T\), we say that \(S\) is a subset of \(T\), and write \(S \subseteq T\), when every element of \(S\) also belongs to \(T\):

\[S \subseteq T \iff (\text{for all } x: x \in S \Rightarrow x \in T)\]

The arrow \(\Rightarrow\) reads "implies": if \(x\) is in \(S\), then it is in \(T\). When moreover \(S \neq T\), we say that \(S\) is a proper subset of \(T\) and use the strict symbol \(\subset\), the same one as in the chain \(\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\).

With this vocabulary, a relation from \(A\) to \(B\) is, by definition, any subset \(R \subseteq A \times B\). The definition requires nothing about how the pairs are distributed within \(R\). The circle of §1.8, for example, is a relation on \(\mathbb{R} \times \mathbb{R}\):

\[R = \{(x, y) \in \mathbb{R} \times \mathbb{R} \mid x^2 + y^2 = r^2\}\]

with \(r > 0\), is a subset of \(\mathbb{R} \times \mathbb{R}\) and therefore a legitimate relation. But, as we will see shortly, not every relation deserves to be called a function.

Reminder. \(A \times B\) gathers all possible ordered pairs between \(A\) and \(B\). \(S \subseteq T\) means that every element of \(S\) is in \(T\). A relation from \(A\) to \(B\) is any subset of \(A \times B\).



§3. The function: existence and uniqueness

Among all the relations from \(A\) to \(B\), one particular kind is of interest: those in which each element of \(A\) determines, without ambiguity, a single element of \(B\).

Definition. A relation \(f \subseteq A \times B\) is a function from \(A\) to \(B\) if it satisfies two conditions:

(Existence) for every \(a \in A\) there is \(b \in B\) such that \((a, b) \in f\);

(Uniqueness) if \((a, b_1) \in f\) and \((a, b_2) \in f\), then \(b_1 = b_2\).

The two conditions are abbreviated with symbols we will use from now on. The symbol \(\forall\) reads "for all", \(\exists\) reads "there exists" and \(\exists!\) reads "there exists a unique". With them, the two conditions fit on one line:

\[\forall a \in A, \exists! b \in B \text{ such that } (a, b) \in f\]

When this holds, the unique \(b\) associated with \(a\) is denoted \(f(a)\), and it is called the image of \(a\) under \(f\) or the value of \(f\) at \(a\).

Why are both conditions required? Existence guarantees that no element of \(A\) is left unassociated: the function is defined on all of \(A\). Uniqueness is the condition that separates a function from the rest of the relations: it forbids the same \(a\) from being linked to two different values. Without it, the expression "\(f(a)\)" would be ambiguous, because we would not know which of the possible values it designates, and everything the book builds on functions, from solving \(f(x) = 0\) to composing functions, would lose its meaning.

The circle of §2 shows how both conditions can fail. If \(|x| < r\), then \(r^2 - x^2 > 0\), and there are two different values of \(y\) satisfying \(x^2 + y^2 = r^2\), namely \(y = \sqrt{r^2 - x^2}\) and \(y = -\sqrt{r^2 - x^2}\): uniqueness fails. If \(|x| > r\), then \(r^2 - x^2 < 0\), and no real \(y\) satisfies \(y^2 = r^2 - x^2\): existence fails. The circle is a legitimate relation, but not a function from \(\mathbb{R}\) to \(\mathbb{R}\). Its upper half, \(\{(x, y) \mid y = \sqrt{r^2 - x^2}\}\), is a function from \([-r, r]\) to \(\mathbb{R}\): for each \(x\) in that interval, the root exists and is unique by §1.2.

Reminder. A function from \(A\) to \(B\) is a relation that satisfies existence (each \(a\) has some \(b\)) and uniqueness (that \(b\) is unique). The full circle is not a function.



§4. Domain, codomain and image

If \(f\) is a function from \(A\) to \(B\), we write

\[f : A \to B\]

and say that \(A\) is the domain of \(f\), denoted \(\operatorname{Dom}(f)\), and that \(B\) is its codomain. The notation \(f : A \to B\) declares the two sets. The rule of assignment is declared with another arrow, \(\mapsto\), which carries a small bar at its tail: \(x \mapsto x^2\) reads "\(x\) is assigned \(x^2\)". Thus \(f : \mathbb{R} \to \mathbb{R}\), \(x \mapsto x^2\) describes a function completely.

There is a subtlety here. As a set of pairs, \(f\) does not remember its codomain: the same set of pairs is a subset of \(A \times B\) and of \(A \times B'\) for any \(B'\) containing all the values of \(f\). Yet the codomain is a piece of data we will need in §2.7, when defining what it means for a function to be surjective. We therefore adopt the usual convention: a function is determined by three pieces of data, its domain, its codomain and its set of pairs, and two functions with the same pairs but a different declared codomain are regarded as different.

Not every element of the codomain has to be reached. The subset of \(B\) that is reached is the image of \(f\):

\[\operatorname{Img}(f) = \{f(a) \mid a \in A\} \subseteq B\]

The inclusion \(\operatorname{Img}(f) \subseteq B\) may be proper: nothing in the definition of function requires the whole codomain to be covered. This difference between what is declared as possible and what is actually reached looks like a technicality for now, but it is exactly what will allow us, in §2.7, to specify what it means for a function to be surjective.

Example. Let \(f : \mathbb{R} \to \mathbb{R}\), \(f(x) = x^2\). Its image is the interval \([0, \infty)\), in the notation of §1.1. To prove it we must see two things. On the one hand, no negative real is reached, because no real square is negative (§1.3). On the other, every \(y \ge 0\) is reached: by §1.2, \(\sqrt{y}\) exists, and \(f(\sqrt{y}) = y\). The codomain is \(\mathbb{R}\) and the image is \([0, \infty)\): they do not coincide, and both are legitimate data of the function.

Reminder. \(f : A \to B\) declares the domain \(A\) and the codomain \(B\); \(x \mapsto f(x)\) declares the rule. The image is what is actually reached, and it may be a proper subset of the codomain.



§5. Representations of a function

The same function can be presented in different ways, and recognizing them as presentations of a single object is part of understanding the concept.

Verbal representation. It describes the rule in ordinary language: "each real number is assigned its square". It is the least precise form, but it is often the starting point when translating a problem, as in §1.6.

Numerical representation. It is a table of pairs \((a, f(a))\) for some values of the domain. When the domain is infinite it is necessarily incomplete, because no table exhausts \(\mathbb{R}\), but it is the most direct way of working with experimental data.

Algebraic representation. It is a formula that computes \(f(x)\) from \(x\) with the operations already available: sums, products, powers, roots and quotients. It is the predominant form in the rest of the book, with one caveat: not every function admits a single formula valid on its whole domain. When the rule changes according to the value of \(x\), the function is said to be piecewise defined, and it is written with a brace that distinguishes the cases. The absolute value of §1.1 is the first example:

\[|x| = \begin{cases} x & \text{if } x \ge 0 \\ -x & \text{if } x < 0 \end{cases}\]

The definition of §3 does not require a single formula: it requires that each \(x\) in the domain correspond to a single value, regardless of whether that value is computed one way for \(x \ge 0\) and another way for \(x < 0\). For a piecewise expression to actually define a function, two things must be checked: that the cases cover the whole declared domain, which is existence, and that, if two cases overlap at some value of \(x\), they give the same result there, which is uniqueness.

Graphical representation. The graph of a function \(f\) whose domain is contained in \(\mathbb{R}\) is the set

\[\operatorname{Gr}(f) = \{(x, f(x)) \mid x \in \operatorname{Dom}(f)\} \subseteq \mathbb{R} \times \mathbb{R}\]

It is not a drawing that is traced and then interpreted, but a precise subset of the plane of §1.8. In fact, with the definition of §3, the graph is the set of pairs \(f\) itself; the name \(\operatorname{Gr}(f)\) emphasizes that we look at it as a figure in the plane. A natural question remains: given an arbitrary subset of the plane, how can we recognize whether it is the graph of some function? The answer, a geometric translation of the uniqueness condition, is the first topic of §2.3.

Reminder. A function has four usual presentations: verbal, numerical, algebraic, including piecewise functions, and graphical. The graph is not an intuitive drawing but the set \(\{(x, f(x))\}\) of pairs of the function.



The uniqueness condition of §3 is not a formal whim: it is the mathematical way of expressing determinism. An arbitrary relation, such as the full circle, allows the same input value to coexist with more than one output value. A function, on the other hand, establishes that, once the input is fixed, the output is completely determined. The same requirement is expected of a physical law: to each initial state, a single resulting state. A question remains open that the rest of the chapter does not fully resolve: is this uniqueness a property that mathematics discovers in the world, or a condition that mathematics imposes in order to speak about it precisely?

With the function defined as an object and its representations distinguished, the next section takes up the question that every formula raises at once: for which values of \(x\) does it make sense to compute \(f(x)\)? It is the question of the implicit domain, the topic of §2.2.