Page 187 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 187

P1: PIG/  P2: OYK/
                   0521861241c04  CB996/Velleman  October 20, 2005  2:54  0 521 86124 1  Char Count= 0






                                                       Relations                       173
                            Finally, suppose R is a relation from A to B and S is a relation from B to C.
                            Then the composition of S and R is the relation S ◦ R from A to C defined as
                            follows:
                                  S ◦ R ={(a, c) ∈ A × C |∃b ∈ B((a, b) ∈ R and (b, c) ∈ S)}.

                            Notice that we have assumed that the second coordinates of pairs in R and the
                            first coordinates of pairs in S both come from the same set, B. If these sets were
                            not the same, the composition S ◦ R would be undefined.

                              According to Definition 4.2.3, the domain of a relation from A to B is the
                            set containing all the first coordinates of ordered pairs in the relation. This will
                            in general be a subset of A, but it need not be all of A. For example, consider
                            the relation L from part 4 of Example 4.2.2, which pairs up students with the
                            dorm rooms in which they live. The domain of L would contain all students
                            who appear as the first coordinate in some ordered pair in L – in other words,
                            all students who live in some dorm room – but would not contain, for example,
                            students who live in apartments off campus. Working it out more carefully from
                            the definition as stated, we have

                                Dom(L) ={s ∈ S |∃r ∈ R((s,r) ∈ L)}
                                       ={s ∈ S |∃r ∈ R (the student s lives in the dorm room r)}
                                       ={s ∈ S | the student s lives in some dorm room}.

                            Similarly, the range of a relation is the set containing all the second coordinates
                            of its ordered pairs. For example, the range of the relation L would be the set
                            of all dorm rooms in which some student lives. Any dorm rooms that are
                            unoccupied would not be in the range of L.
                              The inverse of a relation contains exactly the same ordered pairs as the
                            original relation, but with the order of the coordinates of each pair reversed.
                            Thus, in the case of the relation L, if Joe Smith lives in room 213 Davis Hall,
                            then (Joe Smith, 213 Davis Hall) ∈ L and (213 Davis Hall, Joe Smith) ∈ L −1 .
                            In general, for any student s and dorm room r, we would have (r, s) ∈ L −1
                            iff (s,r) ∈ L. For another example, consider the relation G from part 2 of
                            Example 4.2.2. It contains all ordered pairs of real numbers (x, y) in which x
                            is greater than y. We might call it the “greater-than” relation. Its inverse is
                                            G −1  ={(x, y) ∈ R × R | (y, x) ∈ G}
                                                ={(x, y) ∈ R × R | y > x}
                                                ={(x, y) ∈ R × R | x < y}.

                            In other words, the inverse of the greater-than relation is the less-than relation!
   182   183   184   185   186   187   188   189   190   191   192