Operations on Relations

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 R and S be relations from a set A to a set B.

Since R and S are simply subsets of A×B, we can use set operations on R and S.

Complement

  • complementary relation: R的补运算R¯

a R¯ ba  b

Inverse

  • inverse relation: R的逆运算R1

a R1 bb R a

THEOREM 1: R from A to B

Suppose that R and S are relations from A to B. (a) If RS, then R1S1. (b) If RS, then S¯R¯. (c) (RS)1=R1S1 and (RS)1=R1S1. (d) RS=R¯S¯ and RS=R¯S¯.

Parts (b) and (d) are special cases of general set properties. We now prove part (a). Suppose that RS and let (a,b)R1. Then (b,a)R, so (b,a)S. This, in turn, implies that (a,b)S1. Since each element of R1 is in S1, we are done.

We next prove part (c). For the first part, suppose that (a,b)(RS)1. Then (b,a)RS, so (b,a)R and (b,a)S. This means that (a,b)R1 and (a,b)S1, so (a,b)R1S1. The converse containment can be proved by reversing the steps. A similar argument works to show that (RS)1=R1S1. The relations R¯ and R1 can be used to check if R has the properties of relations that we presented in Section 4. For instance, we saw earlier that R is symmetric if and only if R=R1. Here are some other connections between operations on relations and properties of relations.

THEOREM 2: R on A

Let R and S be relations on a set A. (a) If R is reflexive, so is R1. (b) If R and S are reflexive, then so are RS and RS. (c) R is reflexive if and only if R¯ is irreflexive.

Proof:

Let Δ be the equality relation on A. We know that R is reflexive if and only if ΔR. Clearly, Δ=Δ1, so if ΔR, then Δ=Δ1R1 by Theorem 1 , so R1 is also reflexive. This proves part (a). To prove part (b), we note that if ΔR and ΔS, then ΔRS and ΔRS. To show part (c), we note that a relation S is irreflexive if and only if SΔ=. Then R is reflexive if and only if ΔR if and only if ΔR¯= if and only if R¯ is irreflexive.

THEOREM3

Let R be a relation on a set A. Then (a) R is symmetric if and only if R=R1. (b) R is antisymmetric if and only if RR1Δ. (c) R is asymmetric if and only if RR1=.

THEOREM4

Let R and S be relations on A. (a) If R is symmetric, so are R1 and R¯. (b) If R and S are symmetric, so are RS and RS.

Proof:

If R is symmetric, R=R1 and thus (R1)1=R=R1, which means that R1 is also symmetric. Also, (a,b)(R¯)1 if and only if (b,a)R¯ if and only if (b,a)R if and only if (a,b)R1=R if and only if (a,b)R¯, so R¯ is symmetric and part (a) is proved. The proof of part (b) follows immediately from Theorem 1(c).

THEOREM5

Let R and S be relations on A. (a) (RS)2R2S2. (b) If R and S are transitive, so is RS. (c) If R and S are equivalence relations, so is RS.

Proof:

We prove part (a) geometrically. We have a(RS)2b if and only if there is a path of length 2 from a to b in RS. Both edges of this path lie in R and in S, so aR2b and aS2b, which implies that a(R2S2)b. To show part (b), recall from Section 4 that a relation T is transitive if and only if T2T. If R and S are transitive, then R2R,S2S, so (RS)2R2S2 [by part (a)] RS, so RS is transitive. We next prove part (c). Relations R and S are each reflexive, symmetric, and transitive. The same properties hold for RS from Theorems 2(b), 4(b), and 5(b), respectively. Hence RS is an equivalence relation.

Closure

If R is a relation on a set A, it may well happen that R lacks some of the important relational properties, especially reflexivity, symmetry, and transitivity

If R does not possess a particular property, we may wish to add pairs to R 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 R1 on A that contains R and possesses the property we desire. Sometimes R1 does not exist. If a relation such as R1 does exist, we call it the closure of R with respect to the property in question. 我们要得到的是R的最小超集R1, 它具有我们希望的property. 如果R1存在, 那么就称R1R的关于给定property的闭包(closure).

Transtive Closure放在单独的章节讲. 本章介绍Reflexive Closure and Symmetric Closure.

Reflexive Closure

Suppose that R is a relation on a set A, and R is not reflexive. This can only occur because some pairs of the diagonal relation Δ are not in R.

Thus R1=RΔ is the smallest reflexive relation on A containing R; that is, the reflexive closure of R is RΔ.

Symmetric Closure

Suppose now that R is a relation on A that is not symmetric. Then there must exist pairs (x,y) in R such that (y,x) is not in R.

Of course, (y,x)R1, so if R is to be symmetric we must add all pairs from R1; that is, we must enlarge R to RR1. RR1R的超集. 这里没有证明RR1是“最小的”, 因为这是显然的, 这是由于我们只添加了symmetric所需的必要的有序对,.

Clearly, (RR1)1=RR1.这里证明了RR1也是symmetric的.

So RR1 is the smallest symmetric relation containing R; that is, RR1 is the symmetric closure of R.


Example:

If A={a,b,c,d} and R={(a,b),(b,c),(a,c),(c,d)}, then R1={(b,a), (c,b),(c,a),(d,c)}, so the symmetric closure of R is RR1={(a,b),(b,a),(b,c),(c,b),(a,c),(c,a),(c,d),(d,c)}. The symmetric closure of a relation R is very easy to visualize geometrically. All edges in the digraph of R become "two-way streets" in RR1. Thus the graph of the symmetric closure of R is simply the digraph of R with all edges made bidirectional. We show in Figure 39(a) the digraph of the relation R of Example 9. Figure 39(b) shows the graph of the symmetric closure RR1.

Example of symmetric closure

Composition

Now suppose that A,B, and C are sets, R is a relation from A to B, and S is a relation from B to C.

我们可以定义一个新的relation SR, 它是RScomposition(组合).

SR是一个 AC 的关系, 定义如下:

If a is in A and c is in C, then a(SR)c <=> for some b in B, we have aRb and bSc.

a(SR)c <=>"存在" b, 使得路径aRb,bRc成立

In other words, a is related to c by SR if we can get from a to c in two stages:

  1. first to an intermediate vertex b by relation R
  2. and then from b to c by relation S.

The relation SR might be thought of as " S following R " since it represents the combined effect of two relations, first R, then S.


Example:

Let:

A={1,2,3,4},

R={(1,2),(1,1),(1,3),(2,4),(3,2)},

S={(1,4), (1,3),(2,3),(3,1),(4,1)}.

Since (1,2)R and (2,3)S, we must have (1,3) SR.

Similarly, since (1,1)R and (1,4)S, we see that (1,4)SR.

Proceeding in this way, we find that SR={(1,4),(1,3),(1,1),(2,1),(3,3)}. The following result shows how to compute relative sets for the composition of two relations.

THEOREM6

Let R be a relation from A to B and let S be a relation from B to C. Then, if A1 is any subset of A, we have (SR)(A1)=S(R(A1)) Note: 这里的(SR)(A1)表示A1的R-相关集, 其中的R在这里指(SR).

Proof: If an element zC is in (SR)(A1), then x(SR)z for some x in A1. 对任意一个 z(SR)(A1), 自然有zC. 根据组合的定义, 总存在xA1使得x(SR)z 成立.

根据组合的定义, x(SR)z 意味着总存在yB使得xRy and ySz 成立.

Thus yR(x), zR(y), so (1)zS(R(x)) According to Theorem 1(1) of Relations and Digraphs: If A1A2, then R(A1)R(A2). Since {x}A1, we have S(R(x))S(R(A1)) And since (1), we have zS(R(A1)), so (SR)(A1)S(R(A1))

Conversely, suppose that zS(R(A1)). Then zS(y) for some y in R(A1) and, similarly, yR(x) for some x in A1. This means that xRy and ySz, so x(SR)z. Thus z(SR)(A1), so S(R(A1))(SR)(A1). This proves the theorem.

THEOREM7

Let A,B,C, and D be sets, R a relation from A to B,S a relation from B to C, and T a relation from C to D. Then T(SR)=(TS)R. Proof The relations R,S, and T are determined by their Boolean matrices MR,MS, and MT, respectively. As we showed after Example 11, the matrix of the composition is the Boolean matrix product; that is, MSR=MRMS. Thus MT(SR)=MSRMT=(MRMS)MT. Similarly, M(TS)R=MR(MSMT). Since Boolean matrix multiplication is associative, we must have (MRMS)MT=MR(MSMT), and therefore MT(SR)=M(TS)R Then T(SR)=(TS)R 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, RSSR, as shown in the following example.