The graph of $f$ is the relation $\operatorname {\mathrm{Gr}}(f)\colon A\mathrel {\rightarrow \kern -9.5pt\mathrlap {|}\kern 6pt}B$ defined as follows:1
-
•
Viewing relations from $A$ to $B$ as subsets of $A\times B$, we define
\[ \operatorname {\mathrm{Gr}}(f)\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ (a,f(a))\in A\times B\ \middle |\ a\in A\right\} . \] -
•
Viewing relations from $A$ to $B$ as functions $A\times B\to \{ \mathsf{true},\mathsf{false}\} $, we define
\[ \operatorname {\mathrm{Gr}}(f)^{b}_{a}\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\begin{cases} \mathsf{true}& \text{if $b=f(a)$,}\\ \mathsf{false}& \text{otherwise} \end{cases} \]for each $(a,b)\in A\times B$.
-
•
Viewing relations from $A$ to $B$ as functions $A\to \mathcal{P}(B)$, we define
\[ [\operatorname {\mathrm{Gr}}(f)](a)\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ f(a)\right\} \]for each $a\in A$, i.e. we define $\operatorname {\mathrm{Gr}}(f)$ as the composition
\[ A \overset {f}{\to } B \overset {\chi _{B}}{\hookrightarrow } \mathcal{P}(B). \]
- 1Further Terminology and Notation: When $f=\operatorname {\mathrm{id}}_{A}$, we write $\operatorname {\mathrm{Gr}}(A)$ for $\operatorname {\mathrm{Gr}}(\operatorname {\mathrm{id}}_{A})$, calling it the graph of $A$.