53. Relations and functions
53.1 Functional relations
The graph $\Gamma(F)$ of a function $F\colon A \to B$ is a binary relation from $A$ to $B$. It relates $a\in A$ to $b \in B$ precisely when $b = F(a)$. Of course, not any relation can be the graph of a function: to be the graph of a function, a binary relation $\alpha$ from $A$ to $B$ must have the functional property described in 40.2:
$$(a\,\alpha\, b \text{ and } a\,\alpha\, b') \Rightarrow b = b' \tag{53.1}$$
A relation satisfying Equation (53.1) is called a functional relation.
This requirement can fail because there are ordered pairs $\langle a,b\rangle$ and $\langle a,b'\rangle$ in $\alpha$ with $b\neq b'$. Even if it is satisfied, $\alpha$ may not be the graph of a function from $A$ to $B$, since there may be elements $a\in A$ for which there is no ordered pair $\langle a,b\rangle \in \alpha$. However, a functional relation in $\operatorname{Rel}(A,B)$ is always the graph of a function whose domain is some subset of $A$.
53.1.1 Usage For some authors a function is simply a functional relation. For them, the domain and codomain are not part of the definition.
53.1.2 Exercise Which of these are functional relations?
a) $\{\langle 1, 3\rangle, \langle 2, 3\rangle, \langle 3, 4\rangle\}$.
b) $\{\langle 1, 1\rangle, \langle 1, 2\rangle, \langle 2, 3\rangle\}$.
c) $\{\langle x, \sqrt{x}\rangle \mid x \in \mathrm{R}\}$.
d) $\{\langle \sqrt{x}, x\rangle \mid x \in \mathrm{R}\}$.
e) $\{\langle \sqrt{x}, x\rangle \mid x \in \mathrm{R}^{+}\}$. (Answer on page 245.)
As we have seen, the concept of relation from $A$ to $B$ is a generalization of the concept of function from $A$ to $B$. In general, for a given $a \in A$ there may be no ordered pairs $\langle a,b\rangle \in \alpha$ or there may be more than one. Another way of saying this is that for a given element $a\in A$, there is a set $\{b\in B \mid \langle a,b\rangle \in \alpha \}$. For $\alpha$ to be a function from $A$ to $B$, each such set must be a singleton. In general, a relation associates a (possibly empty) subset of $B$ to each element of $A$.
53.2 Definition: relation as function to powerset
If $\alpha$ is a relation from $A$ to $B$, let $\alpha ^{*}\colon A \to \mathcal{P}B$ denote the function defined by $\alpha ^{*}(a) = \{b \in B \mid \langle a,b\rangle \in \alpha \}$.
53.2.1 Remark Definition 53.2 gives us a process that constructs a function from $A$ to the powerset of $B$ for each relation from $A$ to $B$. For any $a \in A$ and $b\in B$,
$$b \in \alpha ^{*}(a) \Leftrightarrow a\alpha b$$
53.2.2 Example For the relation $\alpha$ of Example 51.1.4, we have $\alpha ^{*}(1) = \{ 3, 5\}$, $\alpha ^{*}(2) = \{ 1, 2, 5\}$ and $\alpha ^{*}(3) = \emptyset$.
53.2.3 Exercise Write the function $\alpha ^{*}\colon A \to \mathcal{P}B$ corresponding to the relation in Problem 51.1.5(a). (Answer on page 245.)
Conversely, if we have a function $F\colon A \to \mathcal{P}B$, we can construct a relation:
53.3 Definition: relation induced by a function to a powerset
Given $F\colon A \to \mathcal{P}B$, the relation $\alpha _{F}$ from $A$ to $B$ is defined by $a\,\alpha _{F}\, b$ if and only if $b \in F(a)$.
53.3.1 Remark In the preceding definition, it makes sense to talk about $b \in F(a)$, because $F(a)$ is a subset of $B$.
53.3.2 Example Let $F\colon \{ 1, 2, 3\} \to \mathcal{P}(\{ 1, 2, 3\})$ be defined by $F(1) = \{ 1, 2\}$, $F(2) = \{ 2\}$ and $F(3) = \emptyset$. Then $\alpha _{F} = \{\langle 1, 1\rangle, \langle 1, 2\rangle, \langle 2, 2\rangle\}$.
53.3.3 Exercise A function $F\colon \mathrm{Z} \to \mathcal{P}\mathrm{Z}$ has $F(1) = \{ 3, 4\}$, $F(2) = \{ 1, 3, 4\}$, $F(-666) = \{ 0\}$, and $F(n) = \emptyset$ for all other integers $n$. List the ordered pairs in the corresponding relation $\alpha _{F}$ on $\mathrm{Z}$. (Answer on page 245.)
53.3.4 Exercise Let $F$ be the function of Problem 39.3.9, page 58. List the ordered pairs in $\alpha _{F}$ that have 6 as first element.
Pages 75–76 of the book (PDF).