1.3.3: Functions as Relations
A function which maps element s of \(A\) to element s of \(B\) obviously defines a relation between \(A\) and \(B\) , namely the relation which holds between \(x\) and \(y\) iff \(f(x) = y\) . In fact, we might even—if we are interested in reducing the building blocks of mathematics for instance— identify the function \(f\) with this relation, i.e., with a set of pairs. This then raises the question: which relations define functions in this way?
Let \(f\colon A \to B\) be a function. The graph of \(f\) is the relation \(R_f \subseteq A \times B\) defined by \[R_f = \Setabs{\tuple{x,y}}{f(x) = y}.\nonumber\]
The graph of a function is uniquely determined, by extensionality. Moreover, extensionality (on sets) will immediately vindicate the implicit principle of extensionality for functions, whereby if \(f\) and \(g\) share a domain and codomain then they are identical if they agree on all values.
Similarly, if a relation is “functional”, then it is the graph of a function.
Let \(R \subseteq A \times B\) be such that:
- If \(Rxy\) and \(Rxz\) then \(y = z\) ; and
- for every \(x \in A\) there is some \(y \in B\) such that \(\tuple{x, y} \in R\) .
Then \(R\) is the graph of the function \(f\colon A \to B\) defined by \(f(x) = y\) iff \(Rxy\) .
Proof. Suppose there is a \(y\) such that \(Rxy\) . If there were another \(z \neq y\) such that \(Rxz\) , the condition on \(R\) would be violated. Hence, if there is a \(y\) such that \(Rxy\) , this \(y\) is unique, and so \(f\) is well-defined. Obviously, \(R_f = R\) . ◻
Every function \(f\colon A \to B\) has a graph, i.e., a relation on \(A \times B\) defined by \(f(x) = y\) . On the other hand, every relation \(R \subseteq A \times B\) with the properties given in Proposition \(\PageIndex{1}\) is the graph of a function \(f \colon A \to B\) . Because of this close connection between functions and their graphs, we can think of a function simply as its graph. In other words, functions can be identified with certain relations, i.e., with certain sets of tuples. Note, though, that the spirit of this “identification” is as in section 2.2 : it is not a claim about the metaphysics of functions, but an observation that it is convenient to treat functions as certain sets. One reason that this is so convenient, is that we can now consider performing similar operations on functions as we performed on relations (see section 2.7 ). In particular:
Let \(f \colon A \to B\) be a function with \(C\subseteq A\) .
The restriction of \(f\) to \(C\) is the function \(\funrestrictionto{f}{C}\colon C \to B\) defined by \((\funrestrictionto{f}{C})(x) = f(x)\) for all \(x \in C\) . In other words, \(\funrestrictionto{f}{C} = \Setabs{\tuple{x, y} \in R_f}{x \in C}\) .
The application of \(f\) to \(C\) is \(\funimage{f}{C} = \Setabs{f(x)}{x \in C}\) . We also call this the image of \(C\) under \(f\) .
It follows from these definition that \(\ran{f} = \funimage{f}{\dom{f}}\) , for any function \(f\) . These notions are exactly as one would expect, given the definitions in section 2.7 and our identification of functions with relations. But two other operations—inverses and relative products—require a little more detail. We will provide that in section 3.4 and section 3.5 .