您在這裡

Functions as Relations

16 六月, 2015 - 14:29
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/383d4b87-2d7b-454e-99fe-2eaa43eae8ff@20.20

Some binary relations have a special property: each element of the domain occurs as the first item in exactly one tuple. For example, isPlanet = {(Earth, true) , (Venus, true) , (Sol, false) , (Ceres, false) , (Mars, true)}is actually a (unary) function. On the other hand, isTheSquareOf = {(0, 0) , (1, 1) , (1, 1) , (4, 2) , (4, 2) , (9, 3) , (9, 3) ,...} is not a function, for two reasons. First, some numbers occur as the first element of multiple pairs. Second, some numbers, like 3, occurs as the first element of no pairs.

We can generalize this to relations of higher arity, also. This is explored in this exercise (Exercise 4.4.2) and this one (Exercise 4.4.3).