40. The graph of a function
40.1 Definition: graph of a function
The graph of a function $F\colon A \to B$ is the set
$$\left\{ \langle a, F(a)\rangle \mid a \in A \right\}$$
of ordered pairs whose first coordinates are all the elements of $A$ with the second coordinate in each case being the value of $F$ at the first coordinate. The graph of $F$ is denoted by $\Gamma(F)$
40.1.1 Fact $\Gamma(F)$ is necessarily a subset of $A\times B$.
40.1.2 Example For the function $G$ of Example 39.3.1, the graph
$$\Gamma(G) = \left\{ \langle x, G(x)\rangle \mid x \in \mathrm{R} \right\} = \left\{ \langle x,y\rangle \mid x \in \mathrm{R} \wedge y = x^{2} + 2x + 5 \right\}$$
which is a subset of $\mathrm{R} \times \mathrm{R}$. $\Gamma(G)$ is of course what is usually called the graph of $G$ in analytic geometry — in this case it is a parabola.
40.1.3 Example The graph of the function $F$ of Example 39.3.3 is
$$\{\langle 1, 4\rangle, \langle 2, 5\rangle, \langle 3, 5\rangle\}$$
40.2 Properties of the graph of a function
Using the notion of graph, Specification 39.2 can be reworded as requiring the following statements to be true about a function $F\colon A \to B$:
GS.1 $\operatorname{dom} F$ is exactly the set of first coordinates of the graph, and
GS.2 For every $a \in A$, there is exactly one element $b$ of $B$ such that $\langle a,b\rangle \in \Gamma(F)$.
40.2.1 Fact GS–2 implies that, for all $a \in A$ and $b\in B$,
$$\left( \langle a,b\rangle \in \Gamma(F) \wedge \langle a,b'\rangle \in \Gamma(F) \right) \Rightarrow b = b' \tag{40.1}$$
40.2.2 Usage The requirement of formula (40.1)is sometimes described by saying that functions have to be single-valued.
40.2.3 Warning Do not confuse the property of being single-valued with the Substitution Property of Theorem 39.6, which in terms of the graph can be stated this way: For all $a\in A$ and $b\in B$,
$$\left( \langle a,b\rangle \in \Gamma(F) \wedge a = a' \right) \Rightarrow \langle a',b\rangle \in \Gamma \tag{40.2}$$
40.2.4 Remark When a function goes from $\mathrm{R}$ to $\mathrm{R}$ the way the function $G$ of Example 39.3.1 does, its graph can be drawn, and then the single-valued property implies that a vertical line will cross the graph only once. In general, you can’t draw the graph of a function (for example, the length function defined on words, as in Example 39.3.4).
40.2.5 Remark Not every set of ordered pairs can be the graph of a function. A set $P$ of ordered pairs is said to be functional or to have the functional property if
$$\left( \langle a,b\rangle \in P \wedge \langle a,b'\rangle \in P \right) \Rightarrow b = b' \tag{40.3}$$
Of course, Formula (40.1) above says that the graph of a function is functional. Conversely, if a set $P$ of ordered pairs is functional, then there are sets $A$ and $B$ and a function $F\colon A \to B$ for which $\Gamma(F) = P$. $F$ is constructed this way:
FC.1 $A$ must be the set of first coordinates of pairs in $P$.
FC.2 $B$ can be any set containing as elements all the second coordinates of pairs in $P$.
FC.3 For each $a\in A$, define $F(a) = b$, where $\langle a,b\rangle$ is the ordered pair in $P$ with $a$ as first coordinate: there is only one such by the functional property.
40.2.6 Exercise For $A = \{ 1, 2, 3, 4\}$, $B = \{ 3, 4, 5, 6\}$, which of these sets of ordered pairs is the graph of a function from $A$ to $B$?
a) $\left\{ \langle 1, 3\rangle, \langle 2, 3\rangle, \langle 3, 4\rangle, \langle 4, 6\rangle \right\}$.
b) $\left\{ \langle 1, 3\rangle, \langle 2, 3\rangle, \langle 4, 5\rangle, \langle 4, 6\rangle \right\}$.
c) $\left\{ \langle 1, 3\rangle, \langle 2, 3\rangle, \langle 4, 6\rangle \right\}$.
d) $\left\{ \langle 1, 3\rangle, \langle 2, 4\rangle, \langle 3, 5\rangle, \langle 4, 6\rangle \right\}$. (Answer on page 245.)
40.2.7 Exercise If $P \subseteq A\times B$, then the opposite of $P$ is the set $P^{op} = \left\{ \langle b,a\rangle \mid \langle a,b\rangle \in P \right\}$. Give examples of:
a) a function $F\colon A\to B$ for which $(\Gamma(F))^{op}$ is the graph of a function.
b) a function $G\colon A \to B$ for which $(\Gamma(G))^{op}$ is not the graph of a function.
40.2.8 Exercise Create a Mathematica command InGraphQ with the property that the expression InGraphQ[F,{x,y}] returns True if $\langle x,y\rangle \in \Gamma(F)$ and False otherwise.
40.2.9 Usage
a) In mathematical texts in complex function theory, and in older texts in general, functions are not always assumed single-valued.
b) As you can see, part FD. 2 requires $\Gamma(F)$ to have the functional property. In texts which do not require that a function’s codomain be specified, a function is often defined simply as a set of ordered pairs with the functional property.
40.3 Explicit definitions of function
In many texts, the concept of function is defined explicitly (as opposed to being given a specification) by some such definition as this: A function $F$ is an ordered triple $\langle A,B,\Gamma(F)\rangle$ for which
FD.1 $A$ and $B$ are sets and $\Gamma(F)\subseteq A\times B$, and
FD.2 If $a\in A$, then there is exactly one ordered pair in $\Gamma(F)$ whose first coordinate is $a$.
Pages 61–63 of the book (PDF).