The informal idea of a function as a "rule" is intuitive but imprecise. This section gives the rigorous, set-theoretic definition of a function based on ordered pairs, removing all ambiguity and providing a foundation for advanced mathematics.
Quick Reference
| Concept | Formal Meaning |
|---|---|
| Ordered pair | $(a, b)$ where $a$ is the first member and $b$ is the second |
| Function $f$ | A set of ordered pairs $(x, y)$ with no two pairs sharing the same first member |
| Domain | Set of all first members of pairs in $f$ |
| Range | Set of all second members of pairs in $f$ |
| Function notation | $y = f(x)$ means the pair $(x, y)$ belongs to $f$ |
Why a Formal Definition?
Previously, we described a function as a "rule" or "procedure" that assigns to each element of a set $A$ exactly one element in a set $B$. However, the words rule, procedure, and assigns are not mathematical concepts: they can mean different things to different people. To make the definition completely precise, we reformulate it using the mathematical concept of an ordered pair.
Ordered Pairs
An ordered pair $(a, b)$ consists of two objects, where $a$ is the first member and $b$ is the second. Two ordered pairs $(a, b)$ and $(c, d)$ are equal if and only if both members match:
$ (a, b) = (c, d) \quad \Leftrightarrow \quad a = c \text{ and } b = d. $You have already seen ordered pairs in coordinate geometry: the point $(3, -4)$ is different from the point $(-4, 3)$. In an ordered pair, order matters.
Definition of a Function
A function $f$ is a set of ordered pairs $(x, y)$ in which no two pairs share the same first member.
The set of all elements $x$ that appear as first members of pairs in $f$ is called the domain of $f$. The set of all second members $y$ is called the range (or set of values) of $f$.
Think of a function as a two-column table: the left column holds $x$-values (the domain), the right column holds the corresponding $y$-values (the range). The key rule is that no two rows can have the same $x$-value with different $y$-values. In set notation:
$ \text{for every } (x, y) \in f \text{ and } (x, z) \in f \quad \Rightarrow \quad y = z. $Let
$f = \{(2,-1),\, (1,7),\, (3,5),\, (5,-1)\}.$Solution
$f$ is a function because no two pairs share the same first element. The domain and range are: $ \begin{aligned} \operatorname{Dom}(f) &= \{2, 1, 3, 5\}, \\ \operatorname{Rng}(f) &= \{-1, 7, 5\}. \end{aligned} $ Notice that the pairs $(2, -1)$ and $(5, -1)$ share the same second element $-1$. That is perfectly fine: different inputs may produce the same output. What is forbidden is the same input producing two different outputs. Now consider $g = \{(2,-1),\, (2,0),\, (1,7),\, (3,5),\, (5,8)\}.$ $g$ is not a function because both $(2, -1)$ and $(2, 0)$ belong to $g$: the input $2$ is mapped to two different outputs $-1$ and $0$.
Function Notation Revisited
Since for every $x$ in the domain there is precisely one $y$ with $(x, y) \in f$, once $x$ is specified, $y$ is uniquely determined. This justifies the familiar notation
$y = f(x),$which simply means "the pair $(x, y)$ belongs to the set $f$." The notation is more efficient and readable than writing $(x, y) \in f$ every time.
Domain, Range, and Codomain
When we write $f : A \to B$, we declare:
- $A$ is the domain of $f$: the set of allowable inputs.
- $B$ is the codomain of $f$: the set that outputs are supposed to lie in.
- The range of $f$ is the set of outputs actually produced: $\operatorname{Rng}(f) = \{f(x) \mid x \in A\}$, which is always a subset of $B$.
The range may be strictly smaller than the codomain. For example, $f : \mathbb{R} \to \mathbb{R}$ defined by $f(x) = x^2$ has codomain $\mathbb{R}$ but range $[0, \infty)$.
In the next section, we will study domain and range of a function in more detail and various examples.