Skip to main content

Relations

(Content adapted from Critchlow & Eck)

In the Functions section, we saw that "mother of" is a functional relationship because every person has one and only one mother, but that "child of" is not a functional relationship, because a person can have no children or more than one child. However, the relationship expressed by "child of" is certainly one that we have a right to be interested in and one that we should be able to deal with mathematically.

There are many examples of relationships that are not functional relationships. The relationship that holds between two natural numbers nn and mm when nmn\le m is an example in mathematics. The relationship between a person and a book that that person has on loan from the library is another. Some relationships involve more than two entities, such as the relationship that associates a name, an address, and a phone number in an address book or the relationship that holds among three real numbers xx, yy, and zz if x2+y2+z2=1x^2+y^2+z^2=1. Each of these relationships can be represented mathematically by what is called a "relation."

A relation on two sets, AA and BB, is defined to be a subset of A×BA\times B. Since a function from AA to BB is defined, formally, as a subset of A×BA\times B that satisfies certain properties, a function is a relation. However, relations are more general than functions, since any subset of A×BA\times B is a relation. We also define a relation among three or more sets to be a subset of the cross product of those sets. In particular, a relation on AA, BB, and CC is a subset of A×B×CA\times B\times C.

For example, if PP is the set of people and BB is the set of books owned by a library, then we can define a relation R{\mathscr R} on the sets PP and BB to be the set R={(p,b)P×Bp has b out on loan}{\mathscr R}=\{(p,b)\in P\times B\mid p\text{ has }b\text{ out on loan}\}. The fact that a particular (p,b)R(p,b)\in{\mathscr R} is a fact about the world that the library will certainly want to keep track of. When a collection of facts about the world is stored on a computer, it is called a database. We'll see in the next section that relations are the most common means of representing data in databases.

If AA is a set and R{\mathscr R} is a relation on the sets AA and AA (that is, on two copies of AA), then R\mathscr R is said to be a binary relation on AA. That is, a binary relation on the set AA is a subset of A×AA\times A. The relation consisting of all ordered pairs (c,p)(c,p) of people such that cc is a child of pp is a binary relation on the set of people. The set {(n,m)N×Nnm}\{(n,m)\in\N\times\N\mid n\le m\} is a binary relation on N\N. Similarly, we define a ternary relation on a set AA to be a subset of A×A×AA\times A\times A. The set {(x,y,z)R×R×Rx2+y2+z2=1}\{(x,y,z)\in\R\times\R\times\R\mid x^2+y^2+z^2=1\} is a ternary relation on R\R. For complete generality, we can define an nn-ary relation on AA, for any positive integer nn, to be a subset of A×A××AA\times A\times\dots\times A, where AA occurs nn times in the cross product.

For the rest of this section, we will be working exclusively with binary relations. Suppose that RA×A{\mathscr R}\subseteq A\times A. That is, suppose that R{\mathscr R} is a binary relation on a set AA. If (a,b)R(a,b)\in{\mathscr R}, then we say that aa is related to bb by R{\mathscr R}. Instead of writing "(a,b)R(a,b)\in {\mathscr R}", we will often write "aRba\,{\mathscr R}\,b". This notation is used in analogy to the notation nmn\le m to express the relation that nn is less than or equal to mm. Remember that aRba\,{\mathscr R}\,b is just an alternative way of writing (a,b)R(a,b)\in{\mathscr R}. In fact, we could consider the relation \le to be a set of ordered pairs and write (n,m)(n,m)\in\,\le in place of the notation nmn\le m.

Properties of Relations

In many applications, attention is restricted to relations that satisfy some property or set of properties. (This is, of course, just what we do when we study functions.) We begin our discussion of binary relations by considering several important properties. In this discussion, let AA be a set and let R{\mathscr R} be a binary relation on AA, that is, a subset of A×AA\times A.

R\mathscr R is said to be reflexive if aA(aRa)\forall a\in A\,(a \,{\mathscr R}\, a). That is, a binary relation on a set is reflexive if every element of the set is related to itself. This is true, for example, for the relation \le on the set N\N, since nnn\le n for every nNn\in\N. On the other hand, it is not true for the relation << on N\N, since, for example, the statement 17<1717<17 is false.1

R\mathscr R is called transitive if aA,bA,cA((aRbbRc)(aRc))\forall a\in A,\,\forall b\in A,\,\forall c\in A\, \big((a\,{\mathscr R}\,b \land b\,{\mathscr R}\,c)\rightarrow (a\,{\mathscr R}\,c)\big). Transitivity allows us to "chain together" two true statements aRba\,{\mathscr R}\,b and bRcb\,{\mathscr R}\,c, which are "linked" by the bb that occurs in each statement, to deduce that aRca\,{\mathscr R}\,c. For example, suppose PP is the set of people, and define the relation C{\mathscr C} on PP such that xPyx\,{\mathscr P}\,y if and only if xx is a child of yy. The relation P{\mathscr P} is not transitive because the child of a child of a person is not a child of that person. Suppose, on the other hand, that we define a relation D{\mathscr D} on PP such that xDyx\,{\mathscr D}\,y if and only if xx is a descendent of yy. Then DD is a transitive relation on the set of people, since a descendent of a descendent of a person is a descendent of that person. That is, from the facts that Elizabeth is a descendent of Victoria and Victoria is a descendent of James, we can deduce that Elizabeth is a descendent of James. In the mathematical world, the relations \le and << on the set N\N are both transitive.

R{\mathscr R} is said to be symmetric if aA,bB(aRbbRa)\forall a\in A,\,\forall b\in B\, (a\,{\mathscr R}\,b\rightarrow b\,{\mathscr R}\,a). That is, whenever aa is related to bb, it follows that bb is related to aa. The relation "is a first cousin of" on the set of people is symmetric, since whenever xx is a first cousin of yy, we have automatically that yy is a first cousin of xx. On the other hand, the "child of" relation is certainly not symmetric. The relation \le on N\N is not symmetric. From the fact that nmn\le m, we cannot conclude that mnm\le n. It is true for some nn and mm in N\N that nmmnn\le m\rightarrow m\le n, but it is not true for all nn and mm in N\N.

Finally, R\mathscr R is antisymmetric if aA,bB((aRbbRa)a=b)\forall a\in A,\,\forall b\in B\, \big((a\,{\mathscr R}\,b\land b\,{\mathscr R}\,a)\rightarrow a=b\big). The relation R\mathscr R is antisymmetric if for any two distinct elements xx and yy of AA, we can't have both xRyx\,{\mathscr R}\,y and yRxy\,{\mathscr R}\,x. The relation \le on N\N is antisymmetric because from the facts that nmn\le m and mnm\le n, we can deduce that n=mn=m. The relation "child of" on the set of people is antisymmetric since it's impossible to have both that xx is a child of yy and yy is a child of xx.

Ordering Relations

There are a few combinations of properties that define particularly useful types of binary relations. The relation \le on the set N\N is reflexive, antisymmetric, and transitive. These properties define what is called a partial order: A partial order on a set AA is a binary relation on AA that is reflexive, antisymmetric, and transitive.

Another example of a partial order is the subset relation, \subseteq, on the power set of any set. If XX is a set, then of course P(X){\mathscr P}(X) is a set in its own right, and \subseteq can be considered to be a binary relation on this set. Two elements AA and BB of P(X){\mathscr P}(X) are related by \subseteq if and only if ABA\subseteq B. This relation is reflexive since every set is a subset of itself. The fact that it is antisymmetric follows from the Set Equality Theorem. The fact that it is transitive was Exercise 11 in the Set Concepts section.

The ordering imposed on N\N by \le has one important property that the ordering of subsets by \subseteq does not share. If nn and mm are natural numbers, then at least one of the statements nmn\le m and mnm\le n must be true. However, if AA and BB are subsets of a set XX, it is certainly possible that both ABA\subseteq B and BAB\subseteq A are false. A binary relation R\mathscr R on a set AA is said to be a total order if it is a partial order and furthermore for any two elements aa and bb of AA, either aRba\,{\mathscr R}\,b or bRab\,{\mathscr R}\,a. The relation \le on the set N\N is a total order. The relation \subseteq on P(X){\mathscr P}(X) is not. (Note once again the slightly odd mathematical language: A total order is a kind of partial ordernot, as you might expect, the opposite of a partial order.)

For another example of ordering, let LL be the set of strings that can be made from lowercase letters. LL contains both English words and nonsense strings such as "sxjja". There is a commonly used total order on the set LL, namely alphabetical order.

Equivalence Relations and Partitions

We'll approach another important kind of binary relation indirectly, through what might at first appear to be an unrelated idea. Let AA be a set. A partition of AA is defined to be a collection of non-empty subsets of AA such that each pair of distinct subsets in the collection is disjoint and the union of all the subsets in the collection is AA. A partition of AA is just a division of all the elements of AA into non-overlapping subsets. For example, the sets {1,2,6}\{1,2,6\}, {3,7}\{3,7\}, {4,5,8,10}\{4,5,8,10\}, and {9}\{9\} form a partition of the set {1,2,,10}\{1,2,\dots,10\}. Each element of {1,2,,10}\{1,2,\dots,10\} occurs in exactly one of the sets that make up the partition. As another example, we can partition the set of all people into two sets, the set of those who have taken Foundations and the set of those who have not. Biologists try to partition the set of all organisms into different species. Librarians try to partition books into various categories such as fiction, biography, and poetry. In the real world, classifying things into categories is an essential activity, although the boundaries between categories are not always well-defined. The abstract mathematical notion of a partition of a set models the real-world notion of classification. In the mathematical world, though, the categories are sets and the boundary between two categories is sharp.

In the real world, items are classified in the same category because they are related in some way. This leads us from partitions back to relations. Suppose that we have a partition of a set AA. We can define a relation R\mathscr R on AA by declaring that for any aa and bb in AA, aRba\,{\mathscr R}\,b if and only if aa and bb are members of the same subset in the partition. That is, two elements of AA are related if they are in the same category. It is clear that the relation defined in this way is reflexive, symmetric, and transitive.

An equivalence relation is defined to be a binary relation that is reflexive, symmetric, and transitive. Any relation defined, as above, from a partition is an equivalence relation. Conversely, we can show that any equivalence relation defines a partition. Suppose that R\mathscr R is an equivalence relation on a set AA. Let aAa\in A. We define the equivalence class of aa under the equivalence relation R\mathscr R to be the subset [a]R[a]_{\mathscr R} defined as [a]R={bAbRa}[a]_{\mathscr R}=\{b\in A\mid b\,{\mathscr R}\,a\}. That is, the equivalence class of aa is the set of all elements of AA that are related to aa. In most cases, we'll assume that the relation in question is understood, and we'll write [a][a] instead of [a]R[a]_{\mathscr R}. Note that each equivalence class is a subset of AA. The following theorem shows that the collection of equivalence classes form a partition of AA.

Theorem: Partitions Let AA be a set and let R\mathscr R be an equivalence relation on AA. Then the collection of all equivalence classes under R\mathscr R is a partition of AA.

Proof: To show that a collection of subsets of AA is a partition, we must show that each subset is non-empty, that the intersection of two distinct subsets is empty, and that the union of all the subsets is AA.

If [a][a] is one of the equivalence classes, it is certainly non-empty, since a[a]a\in[a]. (This follows from the fact that R\mathscr R is reflexive, and hence aRaa\,{\mathscr R}\,a.) To show that AA is the union of all the equivalence classes, we just have to show that each element of AA is a member of one of the equivalence classes. Again, the fact that a[a]a\in[a] for each aAa\in A shows that this is true.

Finally, we have to show that the intersection of two distinct equivalence classes is empty. Suppose that aa and bb are elements of AA and consider the equivalence classes [a][a] and [b][b]. We have to show that if [a][b][a]\not=[b], then [a][b]=[a]\cap[b]=\emptyset. Equivalently, we can show the converse: If [a][b][a]\cap[b]\not=\emptyset then [a]=[b][a]=[b]. So, assume that [a][b][a]\cap[b]\not=\emptyset. Saying that a set is not empty just means that the set contains some element, so there must be an xAx\in A such that x[a][b]x\in[a]\cap[b]. Since x[a]x\in[a], xRax\,{\mathscr R}\,a. Since R\mathscr R is symmetric, we also have aRxa\,{\mathscr R}\,x. Since x[b]x\in[b], xRbx\,{\mathscr R}\,b. Since R\mathscr R is transitive and since (aRx)(xRb)(a\,{\mathscr R}\,x)\land (x\,{\mathscr R}\,b), it follows that aRba\,{\mathscr R}\,b.

Our object is to deduce that [a]=[b][a]=[b]. Since [a][a] and [b][b] are sets, they are equal if and only if [a][b][a]\subseteq[b] and [b][a][b]\subseteq[a]. To show that [a][b][a]\subseteq[b], let cc be an arbitrary element of [a][a]. We must show that c[b]c\in[b]. Since c[a]c\in[a], we have that cRac\,{\mathscr R}\,a. And we have already shown that aRba\,{\mathscr R}\,b. From these two facts and the transitivity of R\mathscr R, it follows that cRbc\,{\mathscr R}\,b. By definition, this means that c[b]c\in[b]. We have shown that any member of [a][a] is a member of [b][b] and therefore that [a][b][a]\subseteq[b]. The fact that [b][a][b]\subseteq[a] can be shown in the same way. We deduce that [a]=[b][a]=[b], which proves the theorem.

The point of this theorem is that if we can find a binary relation that satisfies certain properties, namely the properties of an equivalence relation, then we can classify things into categories, where the categories are the equivalence classes.

For example, suppose that UU is a possibly infinite set. Define a binary relation \sim on P(U){\mathscr P}(U) as follows: For XX and YY in P(U){\mathscr P}(U), XYX\sim Y if and only if there is a bijective function from the set XX to the set YY. In other words, XYX\sim Y means that XX and YY have the same cardinality. Then \sim is an equivalence relation on P(U){\mathscr P}(U). (The symbol \sim is often used to denote equivalence relations. It is usually read "is equivalent to.") If XP(U)X\in{\mathscr P}(U), then the equivalence class [X][X]_{\sim} consists of all the subsets of UU that have the same cardinality as XX. We have classified all the subsets of UU according to their cardinalityeven though we have never said what an infinite cardinality is. (We have only said what it means to have the same cardinality.)

You might remember a popular puzzle called Rubik's Cube, a cube made of smaller cubes with colored sides that could be manipulated by twisting layers of little cubes. The object was to manipulate the cube so that the colors of the little cubes formed a certain configuration. Define two configurations of the cube to be equivalent if it's possible to manipulate one configuration into the other by a sequence of twists. This is, in fact, an equivalence relation on the set of possible configurations. (Symmetry follows from the fact that each move is reversible.) It has been shown that this equivalence relation has exactly twelve equivalence classes. The interesting fact is that it has more than one equivalence class: If the configuration that the cube is in and the configuration that you want to achieve are not in the same equivalence class, then you are doomed to failure.

Transitive Closure

Suppose that R\mathscr R is a binary relation on a set AA. Even though R\mathscr R might not be transitive, it is always possible to construct a transitive relation from R\mathscr R in a natural way. If we think of aRba\,{\mathscr R}\,b as meaning that aa is related by R\mathscr R to bb "in one step," then we consider the relationship that holds between two elements xx and yy when xx is related by R\mathscr R to yy "in one or more steps." This relationship defines a binary relation on AA that is called the transitive closure of R\mathscr R. The transitive closure of R\mathscr R is denoted R{\mathscr R}^*. Formally, R{\mathscr R}^* is defined as follows: For aa and bb in AA, aRba\,{\mathscr R}^*\,b if there is a sequence x0,x1,xnx_0,x_1,\dots x_n of elements of AA, where n>0n>0 and x0=ax_0=a and xn=bx_n=b, such that x0Rx1x_0\,{\mathscr R}\,x_1, x1Rx2x_1\,{\mathscr R}\,x_2, \dots, and xn1Rxnx_{n-1}\,{\mathscr R}\,x_n.

For example, if aRca\,{\mathscr R}\,c, cRdc\,{\mathscr R}\,d, and dRbd\,{\mathscr R}\,b, then we would have that aRba\,{\mathscr R}^*\,b. Of course, we would also have that aRca\,{\mathscr R}^*\,c, and aRda\,{\mathscr R}^*\,d.

For a practical example, suppose that CC is the set of all cities and let A\mathscr A be the binary relation on CC such that for xx and yy in CC, xAyx\,{\mathscr A}\,y if there is a regularly scheduled airline flight from xx to yy. Then the transitive closure A{\mathscr A}^* has a natural interpretation: xAyx\,{\mathscr A}^*\,y if it's possible to get from xx to yy by a sequence of one or more regularly scheduled airline flights. You'll find a few more examples of transitive closures in the exercises.

Exercises

  1. For a finite set, it is possible to define a binary relation on the set by listing the elements of the relation, considered as a set of ordered pairs. Let AA be the set {a,b,c,d}\{a,b,c,d\}, where aa, bb, cc, and dd are distinct. Consider each of the following binary relations on AA. Is the relation reflexive? Symmetric? Antisymmetric? Transitive? Is it a partial order? An equivalence relation?

    • R={(a,b),(a,c),(a,d)}{\mathscr R}=\{ (a,b),\, (a,c),\, (a,d) \}.
      Answer

      Antisymmetric and transitive.

    • S={(a,a),(b,b),(c,c),(d,d),(a,b),(b,a)}{\mathscr S}=\{ (a,a),\, (b,b),\, (c,c),\, (d,d),\, (a,b),\, (b,a) \}.
      Answer

      Reflexive, symmetric, transitive, hence equivalence relation.

    • T={(b,b),(c,c),(d,d)}{\mathscr T}=\{ (b,b),\, (c,c),\, (d,d)\}.
      Answer

      Antisymmetric, symmetric and transitive. It is an equivalence relation on the subset {b,c,d}\{b,c,d\}, but not on the full set AA.

    • C={(a,b),(b,c),(a,c),(d,d)}{\mathscr C}=\{ (a,b),\, (b,c),\, (a,c),\, (d,d)\}.
      Answer

      Antisymmetric and transitive only.

    • D={(a,b),(b,a),(c,d),(d,c)}{\mathscr D}=\{ (a,b),\, (b,a),\, (c,d),\, (d,c)\}.
      Answer

      Symmetric only.

  2. Let AA be the set {1,2,3,4,5,6}\{1,2,3,4,5,6\}. Consider the partition of AA into the subsets {1,4,5}\{1,4,5\}, {3}\{3\}, and {2,6}\{2,6\}. Write out the associated equivalence relation on AA as a set of ordered pairs.

    Answer

    {(1,1),(1,4),(1,5),(4,1),(4,4),(4,5),(5,1),(5,4),(5,5),(3,3),(2,2),(2,6),(6,2),(6,6)}\{(1,1), (1,4), (1,5), (4,1), (4,4), (4,5), (5,1), (5,4), (5,5), (3,3), (2,2), (2,6), (6,2), (6,6)\}

  3. Consider each of the following relations on the set of people. Is the relation reflexive? Symmetric? Transitive? Is it an equivalence relation?

    • xx is related to yy if xx and yy have the same biological parents.
      Answer

      This is reflexive, symmetric, transitive, and hence an equivalence relation.

    • xx is related to yy if xx and yy have at least one biological parent in common.
      Answer

      This is reflexive and symmetric, but not transitive (Alice and Bob might share a mother, while Bob and Carla share a father, while Alice and Carla have no parent in common).

    • xx is related to yy if xx and yy were born in the same year.
      Answer

      This is reflexive, symmetric, transitive, and hence an equivalence relation.

    • xx is related to yy if xx is taller than yy.
      Answer

      This is transitive only.

    • xx is related to yy if xx and yy have both visited Honolulu.
      Answer

      This is reflexive, symmetric, transitive, and hence an equivalence relation.

  4. It is possible for a relation to be both symmetric and antisymmetric. For example, the equality relation, ==, is a relation on any set which is both symmetric and antisymmetric. Suppose that AA is a set and R\mathscr R is a relation on AA that is both symmetric and antisymmetric. Show that R\mathscr R is a subset of == (when both relations are considered as sets of ordered pairs). That is, show that for any aa and bb in AA, (aRb)(a=b)(a\,{\mathscr R}\,b)\rightarrow (a=b).

    Answer

    If we have aRba\,{\mathscr R}\,b, then we also know bRab\,{\mathscr R}\,a, because R\mathscr R is symmetric. However, that can only be true if a=ba=b, because R\mathscr R is antisymmetric. The relation R\mathscr R may be a proper subset of == because there may be some aAa\in A that are not related to anything by R\mathscr R. In fact, every subset of == is a symmetric and antisymmetric relation, including the empty set.

  5. Let \sim be the relation on R\R, the set of real numbers, such that for xx and yy in R\R, xyx\sim y if and only if xyZx-y\in\Z. For example, 212+17\sqrt{2\,}-1\sim\sqrt{2\,}+17 because the difference, (21)(2+17)(\sqrt{2\,}-1)-(\sqrt{2\,}+17), is 18-18, which is an integer. Show that \sim is an equivalence relation. Show that each equivalence class [x][x]_{\sim} contains exactly one number aa which satisfies 0a<10\le a<1. (Thus, the set of equivalence classes under \sim is in one-to-one correspondence with the half-open interval [0,1)[0,1).)

    Answer
    • \sim is reflexive because for any xRx\in\R, xx=0Zx-x=0\in\Z, so xxx\sim x.
    • \sim is symmetric because if xyx\sim y, then xy=nx-y=n for some nZn\in\Z. But yx=(xy)=ny-x=-(x-y)=-n, which is also in Z\Z, so yxy\sim x.
    • \sim is transitive because if xyx\sim y and yzy\sim z, then we know xy=mx-y=m and yz=ny-z=n for some m,nZm,n\in\Z. But xz=(xy)+(yz)=m+nx-z=(x-y)+(y-z)=m+n, which is also in Z\Z, so xzx\sim z.

    Therefore \sim is an equivalence relation.

    Given any xRx\in\R, we may find an aRa\in\R such that xax\sim a and 0a<10\le a<1: let nn be the largest integer less than or equal to xx (the floor of xx, often written x\lfloor x\rfloor), and take a=xna=x-n. Then xa=nZx-a=n\in\Z (so xax\sim a), 0a0\le a (because nxn\le x), and a<1a<1 (because if not, then n+1xn+1\le x, contradicting the choice of nn as the largest such integer). Therefore a[x]a\in[x]_{\sim} has the stated property. If there were another b[x]b\in[x]_{\sim} such that 0b<10\le b<1, then we would also have aba\sim b, hence abZa-b\in\Z. But if aa and bb are different, then aba-b must be a non-zero integer, and either b<0b<0 or b1b\ge 1, which is a contradiction. Therefore, aa is unique.

  6. Let AA and BB be any sets, and suppose f ⁣:ABf\colon A\to B. Define a relation \sim on AA such that for any xx and yy in AA, xyx\sim y if and only if f(x)=f(y)f(x)=f(y). Show that \sim is an equivalence relation on AA.

    Answer
    • For any xx, obviously f(x)=f(x)f(x)=f(x), so xxx\sim x.
    • If xyx\sim y, then we know f(x)=f(y)f(x)=f(y). This is the same as saying f(y)=f(x)f(y)=f(x), so we also find yxy\sim x.
    • If xyx\sim y and yzy\sim z, then f(x)=f(y)f(x)=f(y) and f(y)=f(z)f(y)=f(z). Therefore f(x)=f(z)f(x)=f(z), so xzx\sim z.

    Thus \sim is reflexive, symmetric, and transitive, so it is an equivalence relation.

  7. Let Z+\Z^+ be the set of positive integers {1,2,3,}\{1,2,3,\dots\}. Define a binary relation D\mathscr D on Z+\Z^+ such that for nn and mm in Z+\Z^+, nDmn\,{\mathscr D}\,m if nn divides evenly into mm, with no remainder. Equivalently, nDmn\,{\mathscr D}\,m if nn is a factor of mm, that is, if there is a kk in Z+\Z^+ such that m=nkm=nk. Show that D\mathscr D is a partial order.

    Answer
    • For any nZ+n\in\Z^+, nn evenly divides nn, so nDnn\,{\mathscr D}\,n.
    • If mDnm\,{\mathscr D}\,n and nDmn\,{\mathscr D}\,m, then we know that each evenly divides the other. However, if one positive integer evenly divides another, it must be less than or equal to the other. Therefore, we know mnm\le n and nmn\le m, so m=nm=n.
    • If mDnm\,{\mathscr D}\,n and nDpn\,{\mathscr D}\,p, then we know that there exist j,kZ+j,k\in\Z^+ such that n=jmn=jm and p=knp=kn. Therefore, p=(kj)mp=(kj)m, so we also have mDpm\,{\mathscr D}\,p.

    Since D\mathscr D is reflexive, antisymmetric, and transitive, it is a partial order.

  8. Consider the set N×N\N\times\N, which consists of all ordered pairs of natural numbers. Since N×N\N\times\N is a set, it is possible to have binary relations on N×N\N\times\N. Such a relation would be a subset of (N×N)×(N×N)(\N\times\N)\times(\N\times\N). Define a binary relation \preceq on N×N\N\times\N such that for (m,n)(m,n) and (k,)(k,\ell) in N×N\N\times\N, (m,n)(k,)(m,n)\preceq(k,\ell) if and only if either m<km<k or ((m=k)(n))((m=k)\land (n\le\ell)). Which of the following are true?

    • (2,7)(5,1)(2,7)\preceq(5,1)

      Answer

      True

    • (8,5)(8,0)(8,5)\preceq(8,0)

      Answer

      False

    • (0,1)(0,2)(0,1)\preceq(0,2)

      Answer

      True

    • (17,17)(17,17)(17,17)\preceq(17,17)

      Answer

      True

      Show that \preceq is a total order on N×N\N\times\N.

      Answer

      This ordering is known as the lexicographic ordering on N×N\N\times\N, because it is a generalization of the way words are ordered in a dictionary (a "lexicon"). Let us first show that it is a partial order:

      • For any (m,n)(m,n), we have (m,n)(m,n)(m,n)\preceq(m,n), because (m=m)(nn)(m=m)\land(n\le n).
      • If (m,n)(k,)(m,n)\preceq(k,\ell) and (k,)(m,n)(k,\ell)\preceq(m,n), then it cannot be the case that either m<km<k or k<mk<m, so we know m=km=k. Therefore, we know that nn\le\ell and n\ell\le n, hence n=n=\ell and we have (m,n)=(k,)(m,n)=(k,\ell).
      • If (m,n)(k,)(m,n)\preceq(k,\ell) and (k,)(p,q)(k,\ell)\preceq(p,q), then we know that mkm\le k and kpk\le p, so mpm\le p. If it is the case that m<pm<p, then we certainly have (m,n)(p,q)(m,n)\preceq(p,q), so consider the case when m=pm=p. When m=pm=p we also know m=km=k and k=pk=p, so we must have nn\le\ell and q\ell\le q. Therefore nqn\le q, and we again find (m,n)(p,q)(m,n)\preceq(p,q).

      Since \preceq is reflexive, antisymmetric, and transitive, it is a partial order. Now suppose that we have two pairs (m,n)(m,n) and (k,)(k,\ell) in N×N\N\times\N. We know that m<km<k, m>km>k, or m=km=k; in the first two cases, we see that either (m,n)(k,)(m,n)\preceq(k,\ell) or (k,)(m,n)(k,\ell)\preceq(m,n). Therefore, consider the case m=km=k. If also nn\le\ell, then (m,n)(k,)(m,n)\preceq(k,\ell), while if n>n>\ell, then (k,)(m,n)(k,\ell)\preceq(m,n) (and if n=n=\ell they are both true). Therefore in every case either (m,n)(k,)(m,n)\preceq(k,\ell) or (k,)(m,n)(k,\ell)\preceq(m,n), so \preceq is a total order.

  9. Let \sim be the relation defined on N×N\N\times\N such that (n,m)(k,)(n,m)\sim(k,\ell) if and only if n+=m+kn+\ell=m+k. Show that \sim is an equivalence relation.

    Answer
    • For any (n,m)(n,m), we have (n,m)(n,m)(n,m)\sim(n,m), because n+m=m+nn+m=m+n.
    • If (n,m)(k,)(n,m)\sim(k,\ell), then n+=m+kn+\ell=m+k. But this is equivalent to saying k+m=+nk+m=\ell+n, which means we also have (k,)(n,m)(k,\ell)\sim(n,m).
    • If (n,m)(k,)(n,m)\sim(k,\ell) and (k,)(p,q)(k,\ell)\sim(p,q), then we know n+=m+kn+\ell=m+k and k+q=+pk+q=\ell+p. Therefore n++q=m+k+q=m++pn+\ell+q=m+k+q=m+\ell+p; subtracting \ell from both sides gives n+q=m+pn+q=m+p, which is what we need to show (n,m)(p,q)(n,m)\sim(p,q).

    Therefore \sim is an equivalence relation, because it is reflexive, symmetric, and transitive. Another way to look at this relation is that (n,m)(k,)(n,m)\sim(k,\ell) if (nm)=(k)(n-m)=(k-\ell), although we have to be careful to perform the subtraction in Z\Z because it is not always defined in N\N. The equivalence classes of \sim are actually in one-to-one correspondence with the integers (Z\Z), so this gives us a way to encode the integers using only the natural numbers.

  10. Let PP be the set of people and let C\mathscr C be the "child of" relation. That is xCyx\,{\mathscr C}\,y means that xx is a child of yy. What is the meaning of the transitive closure C{\mathscr C}^*? Explain your answer.

    Answer

    The relation C{\mathscr C}^* is the "descendant of" relation. That is, xCyx\,{\mathscr C}^*\,y holds if there is a chain of people p0p_0, p1p_1, , pnp_n for some n>0n>0 such that x=p0x=p_0, pn=yp_n=y, and for each i<ni<n we have that pip_i is a child of pi+1p_{i+1}.

  11. Let R\mathscr R be the binary relation on N\N such that xRyx\,{\mathscr R}\,y if and only if y=x+1y=x+1. Identify the transitive closure R{\mathscr R}^*. (It is a well-known relation.) Explain your answer.

    Answer

    If there is a chain of numbers x=a0x=a_0, a1a_1, , an=ya_n=y for some n>0n>0 such that ai+1=ai+1a_{i+1}=a_i+1 for each i<ni<n, then it is easy to check that ai=x+ia_i=x+i, so y=x+ny=x+n. Therefore, xRyx\,{\mathscr R}^*\,y is equivalent to saying y=x+ny=x+n for some n>0n>0. This is true exactly when x<yx<y.

  12. Suppose that R\mathscr R is a reflexive, symmetric binary relation on a set AA. Show that the transitive closure R{\mathscr R}^* is an equivalence relation.

    Answer
    • Since xRxx\,{\mathscr R}\,x for every xAx\in A, we also know that xRxx\,{\mathscr R}^*\,x (take the chain x=a0x=a_0 and a1=xa_1=x).
    • Suppose we have xRyx\,{\mathscr R}^*\,y for some x,yAx,y\in A. Then there is a chain x=a0x=a_0, a1a_1, , an=ya_n=y for some n>0n>0 such that aiRai+1a_i\,{\mathscr R}\,a_{i+1} for each i<ni<n. Since R\mathscr R is symmetric, this also gives us a chain y=any=a_n, an1a_{n-1}, , a0=xa_0=x where ai+1Raia_{i+1}\,{\mathscr R}\,a_i for each i<ni<n. Therefore, yRxy\,{\mathscr R}^*\,x.
    • If xRyx\,{\mathscr R}^*\,y and yRzy\,{\mathscr R}^*\,z, then we know there are chains x=a0x=a_0, a1a_1, , an=ya_n=y and y=b0y=b_0, b1b_1, , bm=zb_m=z for some n,m>0n,m>0, such that aiRai+1a_i\,{\mathscr R}\,a_{i+1} and bjRbj+1b_j\,{\mathscr R}\,b_{j+1} for all i<ni<n and j<mj<m. These chains may be "pasted together" into a single chain establishing that xRzx\,{\mathscr R}^*\,z.

    Therefore, R{\mathscr R}^* is reflexive, symmetric, and transitive, so it must be an equivalence relation.


  1. Note that to show that the relation R{\mathscr R} is not reflexive, you only need to find one aa such that aRaa\,{\mathscr R}\,a is false. This follows from the fact that ¬(aA(aRa))aA(¬(aRa))\lnot\big(\forall a\in A\,(a \,{\mathscr R}\, a)\big) \equiv \exists a\in A\,\big(\lnot(a \,{\mathscr R}\, a)\big). A similar remark holds for each of the properties of relations that are discussed here.