Ref: Bernard Kolman, Robert C. Busby & Sharon Cutler Ros. (2014). Relations and Digraph. Discrete Mathematical Structures (6th ed., pp. 139-204). Pearson.
Intro
Now that we have investigated the classification of relations by properties they do or do not have, we next define some operations on relations. Together with these operations, the accompanying properties form a mathematical structure
Let and be relations from a set to a set .
Since and are simply subsets of , we can use set operations on and .
Complement
complementary relation: 的补运算
Inverse
inverse relation: 的逆运算
THEOREM 1: R from A to B
Suppose that and are relations from to . (a) If , then . (b) If , then . (c) and . (d) and .
Parts (b) and (d) are special cases of general set properties. We now prove part (a). Suppose that and let . Then , so . This, in turn, implies that . Since each element of is in , we are done.
We next prove part (c). For the first part, suppose that . Then , so and . This means that and , so . The converse containment can be proved by reversing the steps. A similar argument works to show that . The relations and can be used to check if has the properties of relations that we presented in Section 4. For instance, we saw earlier that is symmetric if and only if . Here are some other connections between operations on relations and properties of relations.
THEOREM 2: R on A
Let and be relations on a set . (a) If is reflexive, so is . (b) If and are reflexive, then so are and . (c) is reflexive if and only if is irreflexive.
Proof:
Let be the equality relation on . We know that is reflexive if and only if . Clearly, , so if , then by Theorem 1 , so is also reflexive. This proves part (a). To prove part (b), we note that if and , then and . To show part (c), we note that a relation is irreflexive if and only if . Then is reflexive if and only if if and only if if and only if is irreflexive.
THEOREM3
Let be a relation on a set . Then (a) is symmetric if and only if . (b) is antisymmetric if and only if . (c) is asymmetric if and only if .
THEOREM4
Let and be relations on . (a) If is symmetric, so are and . (b) If and are symmetric, so are and .
Proof:
If is symmetric, and thus , which means that is also symmetric. Also, if and only if if and only if if and only if if and only if , so is symmetric and part (a) is proved. The proof of part (b) follows immediately from Theorem 1(c).
THEOREM5
Let and be relations on . (a) . (b) If and are transitive, so is . (c) If and are equivalence relations, so is .
Proof:
We prove part (a) geometrically. We have if and only if there is a path of length 2 from to in . Both edges of this path lie in and in , so and , which implies that . To show part (b), recall from Section 4 that a relation is transitive if and only if . If and are transitive, then , so [by part (a)] , so is transitive. We next prove part (c). Relations and are each reflexive, symmetric, and transitive. The same properties hold for from Theorems 2(b), 4(b), and 5(b), respectively. Hence is an equivalence relation.
Closure
If is a relation on a set , it may well happen that lacks some of the important relational properties, especially reflexivity, symmetry, and transitivity
If does not possess a particular property, we may wish to add pairs to until we get a relation that does have the required property. 我们很自然地想到可以通过给R添加一些有序对直到它满足题目所给的property.
Naturally, we want to add as few new pairs as possible, so what we need to find is the smallest relation on that contains and possesses the property we desire. Sometimes does not exist. If a relation such as does exist, we call it the closure of with respect to the property in question. 我们要得到的是的最小超集, 它具有我们希望的property. 如果存在, 那么就称为的关于给定property的闭包(closure).
Transtive Closure放在单独的章节讲. 本章介绍Reflexive Closure and Symmetric Closure.
Reflexive Closure
Suppose that is a relation on a set , and is not reflexive. This can only occur because some pairs of the diagonal relation are not in .
Thus is the smallest reflexive relation on containing ; that is, the reflexive closure of is .
Symmetric Closure
Suppose now that is a relation on that is not symmetric. Then there must exist pairs in such that is not in .
Of course, , so if is to be symmetric we must add all pairs from ; that is, we must enlarge to .是的超集. 这里没有证明是“最小的”, 因为这是显然的, 这是由于我们只添加了symmetric所需的必要的有序对,.
Clearly, .这里证明了也是symmetric的.
So is the smallest symmetric relation containing ; that is, is the symmetric closure of .
Example:
If and , then , , so the symmetric closure of is The symmetric closure of a relation is very easy to visualize geometrically. All edges in the digraph of become "two-way streets" in . Thus the graph of the symmetric closure of is simply the digraph of with all edges made bidirectional. We show in Figure 39(a) the digraph of the relation of Example 9. Figure 39(b) shows the graph of the symmetric closure .
Example of symmetric closure
Composition
Now suppose that , and are sets, is a relation from to , and is a relation from to .
我们可以定义一个新的relation , 它是和的composition(组合).
是一个 到 的关系, 定义如下:
If is in and is in , then <=> for some in , we have and .
<=>"存在" , 使得路径成立
In other words, is related to by if we can get from to in two stages:
first to an intermediate vertex by relation
and then from to by relation .
The relation might be thought of as " following " since it represents the combined effect of two relations, first , then .
Example:
Let:
,
,
, .
Since and , we must have .
Similarly, since and , we see that .
Proceeding in this way, we find that . The following result shows how to compute relative sets for the composition of two relations.
THEOREM6
Let be a relation from to and let be a relation from to . Then, if is any subset of , we have Note: 这里的表示的R-相关集, 其中的R在这里指.
Proof: If an element is in , then for some in . 对任意一个 , 自然有. 根据组合的定义, 总存在使得 成立.
根据组合的定义, 意味着总存在使得 and 成立.
Thus , , so According to Theorem 1(1) of Relations and Digraphs: If , then . Since , we have And since , we have , so
Conversely, suppose that . Then for some in and, similarly, for some in . This means that and , so . Thus , so . This proves the theorem.
THEOREM7
Let , and be sets, a relation from to a relation from to , and a relation from to . Then Proof The relations , and are determined by their Boolean matrices , and , respectively. As we showed after Example 11, the matrix of the composition is the Boolean matrix product; that is, . Thus Similarly, Since Boolean matrix multiplication is associative, we must have and therefore Then since these relations have the same matrices. The proof illustrates the advantage of having several ways to represent a relation. Here using the matrix of the relation produces a simple proof. In general, , as shown in the following example.