Page 244 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 244
P1: Oyk/
0521861241c05 CB996/Velleman October 19, 2005 0:16 0 521 86124 1 Char Count= 0
230 Functions
Because functions are just relations of a special kind, the concepts introduced
in Chapter 4 for relations can be applied to functions as well. For example,
suppose f : A → B. Then f is a relation from A to B, so it makes sense to talk
about the domain of f, which is a subset of A, and the range of f, which is a
subset of B. According to the definition of function, every element of A must
appear as the first coordinate of some (in fact, exactly one) ordered pair in f,
so the domain of f must actually be all of A. But the range of f need not be all
of B. The elements of the range of f will be the second coordinates of all the
ordered pairs in f, and the second coordinate of an ordered pair in f is what we
have called the image of its first coordinate. Thus, the range of f could also be
described as the set of all images of elements of A under f :
Ran( f ) ={ f (a) | a ∈ A}.
For example, for the function f defined in part 1 of Example 5.1.3, Ran( f ) =
{ f (s) | s ∈ S}= the set of all advisors of students.
We can draw diagrams of functions in exactly the same way we drew dia-
grams for relations in Chapter 4. If f : A → B, then as before, every ordered
pair (a, b) ∈ f would be represented in the diagram by an edge connecting a
to b. By the definition of function, every a ∈ A occurs as the first coordinate
of exactly one ordered pair in f, and the second coordinate of this ordered pair
is f (a). Thus, for every a ∈ A there will be exactly one edge coming from a,
and it will connect a to f (a). For example, Figure 1 shows what the diagram
for the function L defined in part 3 of Example 5.1.2 would look like.
Figure 1
The definition of composition of relations can also be applied to functions. If
f : A → B and g : B → C, then f is a relation from A to B and g is a relation
from B to C, so it makes sense to talk about g ◦ f , which will be a relation

