Relations and Properties of Relations

Relations (Chapter 8)

Two-Place Predicates

  • Two-place predicates, like B(x,y)B(x, y) where xx is the brother of yy, are fundamental in mathematics.

  • They help describe basic concepts.

  • Examples:

    • G(x,y)G(x, y): xx is greater than or equal to yy (magnitude comparison).

    • P(x,y)P(x, y): xx has the same parity as yy (parity comparison of integers).

    • S(x,y)S(x, y): xx has square equal to yy (relates a value to its square).

What are Relations?

  • Two-place predicates are also called relations.

  • Definition: If P(x,y)P(x, y) is a two-place predicate with domain of discourse AA for xx and BB for yy, then PP is a relation from AA to BB.

    • AA is called the domain of the relation.

    • BB is called the codomain of the relation.

Specifying Relations

  • Verbal Description: Providing a verbal description (e.g., E(x,y)E(x, y): The word xx ends with the letter yy).

    • Domain: Words in English.

    • Codomain: Letters of the alphabet.

    • Example: (cat, t) satisfies EE, but (dog, w) does not.

  • Listing Ordered Pairs: Explicitly listing the ordered pairs that satisfy the relation.

    • Example: If A=1,2,3,4A = {1, 2, 3, 4} and B=a,b,c,dB = {a, b, c, d}, a relation RR from AA to BB could be R=(1,b),(2,c),(4,c)R = {(1, b), (2, c), (4, c)}.

  • Notation: aRbaRb is often used in place of (a,b)R(a, b) \in R.

    • For example, G(3,2)G(3, 2) is true, or (3,2)G(3, 2) \in G, or 3G23G2.

Representing Relations with Graphs

  • Relations can be represented using graphs.

  • Bipartite Graph: A diagram with vertices (dots) and edges (lines).

    • Create a column of dots for elements of AA and label them.

    • Create a column of dots for elements of BB and label them.

    • Connect vertex aAa \in A to vertex bBb \in B with an edge if (a,b)R(a, b) \in R.

  • Example 8.1: Let A=1,2,3,4A = {1, 2, 3, 4}, B=a,b,c,dB = {a, b, c, d}, and R=(1,a),(2,b),(3,c),(3,d),(4,d)R = {(1, a), (2, b), (3, c), (3, d), (4, d)}. A bipartite graph represents RR.

Relations on a Set

  • If RR is a relation from AA to AA, then RR is a relation on AA.

    • Relations on a set can be represented using a digraph.

  • Digraph (Directed Graph): Edges have a direction indicated by an arrowhead.

    • Each element of AA labels a single point.

    • An arrow connects vertex ss to vertex tt if (s,t)R(s, t) \in R.

    • An edge of the form (s,s)(s, s) is called a loop.

  • Example 8.2: Let A=1,2,3,4,5A = {1, 2, 3, 4, 5} and R=(1,1),(1,2),(2,2),(2,3),(3,3),(3,4),(4,4)R = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3), (3, 4), (4, 4)}. A digraph visually represents RR.

Representing Relations with Matrices

  • A 0-1 matrix is used to represent a relation, handy for computer encoding.

  • An m×nm \times n matrix is a rectangular array with mm rows and nn columns.

    • Entries are indexed by row and column: a<em>i,ja<em>{i,j} or a</em>ija</em>{ij} represents the entry in the ithi^{th} row and jthj^{th} column.

  • For finite sets AA and BB with mm and nn elements respectively, use elements of AA and BB to index rows and columns.

  • Matrix of R, MRM_R: The entry in the row labeled by aa and the column labeled by bb is 1 if aRbaRb and 0 otherwise.

  • Example 8.3: Let A=1,2,3,4A = {1, 2, 3, 4} and B=a,b,c,dB = {a, b, c, d}, and R=(1,a),(1,b),(2,c),(4,c),(4,a)R = {(1, a), (1, b), (2, c), (4, c), (4, a)}.

    • The 0-1 matrix representing RR is:
      MR=[1amp;1amp;0amp;0 0amp;0amp;1amp;0 0amp;0amp;0amp;0 1amp;0amp;1amp;0]M_R = \begin{bmatrix} 1 &amp; 1 &amp; 0 &amp; 0 \ 0 &amp; 0 &amp; 1 &amp; 0 \ 0 &amp; 0 &amp; 0 &amp; 0 \ 1 &amp; 0 &amp; 1 &amp; 0 \end{bmatrix}

    • The matrix appearance depends on the order of elements in AA and BB.

Set Operations on Relations

  • Relations as sets of ordered pairs allow set operations.

  • Bit-wise operations on 0-1 matrices represent these operations.

    • M<em>RS=M</em>RMSM<em>{R \cup S} = M</em>R \lor M_S

    • M<em>RS=M</em>RMSM<em>{R \cap S} = M</em>R \land M_S

  • MNM \subseteq N means that wherever NN has a 0 entry, MM also has a 0.

    • RSR \subseteq S means the same as M<em>RM</em>SM<em>R \subseteq M</em>S.

Inverse of a Relation

  • Reversing all ordered pairs in RR gives the inverse relation, denoted R1R^{-1}.

    • R1=(b,a)(a,b)RR^{-1} = {(b, a) | (a, b) \in R}

  • The bipartite graph for R1R^{-1} is obtained by interchanging columns of vertices with edges.

  • The matrix for R1R^{-1} is the transpose of the matrix for RR.

    • M<em>R1=M</em>RTM<em>{R^{-1}} = M</em>R^T

Composition of Relations

  • If SS is a relation from AA to BB and RR is a relation from BB to CC, then the composition of SS by RR is RSR \circ S.

    • RS=(a,c)aA,cC and bB, such that (a,b)S and (b,c)RR \circ S = {(a, c) | a \in A, c \in C \text{ and } \exists b \in B, \text{ such that } (a, b) \in S \text{ and } (b, c) \in R}

  • Example 8.4: Let A=1,2,3,4A = {1, 2, 3, 4}, B=α,βB = {\alpha, \beta}, and C=a,b,cC = {a, b, c}. Further, let S=(1,α),(1,β),(2,α),(3,β),(4,α)S = {(1, \alpha), (1, \beta), (2, \alpha), (3, \beta), (4, \alpha)} and R=(α,a),(α,c),(β,b)R = {(\alpha, a), (\alpha, c), (\beta, b)}.

    • Since (1,α)S(1, \alpha) \in S and (α,a)R(\alpha, a) \in R, it follows that (1,a)RS(1, a) \in R \circ S.

    • RS=(1,a),(1,b),(1,c),(2,a),(2,c),(3,b),(4,a),(4,c)R \circ S = {(1, a), (1, b), (1, c), (2, a), (2, c), (3, b), (4, a), (4, c)}.

  • Composition can be determined using bipartite graphs: RSR \circ S has a two-edge path from xx to yy.

Boolean Product of Matrices

  • If M<em>SM<em>S is the m×km \times k matrix of SS and M</em>RM</em>R is the k×nk \times n matrix of RR, then the matrix MRSM_{R \circ S} represents the composition.

    • The Boolean product of M<em>SM<em>S and M</em>RM</em>R is the matrix MRSM_R S of the composition.

  • Given an m×km \times k 0-1 matrix MM and a k×nk \times n 0-1 matrix NN, MNM \odot N is an m×nm \times n 0-1 matrix where the (i,j)(i, j) entry is (m<em>i,1n</em>1,j)(m<em>i,2n</em>2,j)(m<em>i,kn</em>k,j)(m<em>{i,1} \land n</em>{1,j}) \lor (m<em>{i,2} \land n</em>{2,j}) \lor … \lor (m<em>{i,k} \land n</em>{k,j}).

  • The ordinary matrix product is computed the same way as the boolean product where multiplication and addition have been replaced with and and or, respectively.

  • Example: For the relations in the example above:
    MRS=[1amp;1amp;1 1amp;1amp;1 0amp;0amp;1 1amp;1amp;1]=[1amp;1amp;0 1amp;0amp;0 0amp;1amp;0 1amp;0amp;0][1amp;0amp;1 0amp;1amp;0 0amp;0amp;0]=MSMRMR S = \begin{bmatrix} 1 &amp; 1 &amp; 1 \ 1 &amp; 1 &amp; 1 \ 0 &amp; 0 &amp; 1 \ 1 &amp; 1 &amp; 1 \end{bmatrix} = \begin{bmatrix} 1 &amp; 1 &amp; 0 \ 1 &amp; 0 &amp; 0 \ 0 &amp; 1 &amp; 0 \ 1 &amp; 0 &amp; 0 \end{bmatrix} \odot \begin{bmatrix} 1 &amp; 0 &amp; 1 \ 0 &amp; 1 &amp; 0 \ 0 &amp; 0 &amp; 0 \end{bmatrix} = MS MR

Properties of Relations (Chapter 9)

Reflexive Relations

  • A relation RR on AA is reflexive if for all aAa \in A, aRaaRa.

    • Every element in the domain is related to itself.

  • Example: S(m,n)S(m, n): m+nm + n is even on the set of integers.

  • Symbolic logic: aA,aRa\forall a \in A, aRa

  • Digraph: Has a loop at every vertex.

  • Matrix: All entries on the main diagonal are 1s.

Irreflexive Relations

  • A relation RR on AA is irreflexive if aRaaRa is false for all aAa \in A.

    • No element of AA is related to itself.

  • Digraph: Contains no loops.

  • Matrix: All 0s on the main diagonal.

  • Symbolic logic: aA,aRa\forall a \in A, a \cancel{R} a

Domain Specificity

  • Whether a relation is reflexive or irreflexive depends on the domain.

  • Example: S(x,y)S(x, y): The square of xx is greater than or equal to yy.

    • Reflexive on NN (natural numbers), as n2nn^2 \ge n for all nNn \in N.

    • Not reflexive on RR (real numbers), as \left( \frac{1}{2} \right)^2 = \frac{1}{4} < \frac{1}{2}.

Symmetric Relations

  • A relation RR on AA is symmetric if (a,b)R    (b,a)R(a, b) \in R \implies (b, a) \in R.

    • R=R1R = R^{-1}

    • If aa is related to bb, then bb is related to aa.

  • Digraph: Every non-loop has a return edge.

  • Matrix: M=MTM = M^T (symmetric about the main diagonal).

  • Symbolic logic: a,bA,aRb    bRa\forall a, b \in A, aRb \implies bRa

Antisymmetric Relations

  • A relation RR on AA is antisymmetric if whenever (a,b)R(a, b) \in R and (b,a)R(b, a) \in R, then a=ba = b.

    • The only objects related to each other are the same object.

  • Example: The \le relation for integers.

  • Digraph: All streets one-way except loops.

  • Matrix: If a<em>i,j=1a<em>{i,j} = 1 and iji \ne j, then a</em>j,i=0a</em>{j,i} = 0.

  • Symbolic logic: a,bA,(aRbbRa)    (a=b)\forall a, b \in A, (aRb \land bRa) \implies (a = b)

Transitive Relations

  • A relation RR on AA is transitive if whenever (a,b)R(a, b) \in R and (b,c)R(b, c) \in R, then (a,c)R(a, c) \in R.

    • RRRR \circ R \subseteq R.

  • Example: The \le relation on NN.

  • Digraph: If there's a directed path of length two from aa to cc through bb, there's a direct link from aa to cc.

  • Matrix: MMMM \cdot M \subseteq M.

  • Symbolic logic: a,b,cA,(aRbbRc)    aRc\forall a, b, c \in A, (aRb \land bRc) \implies aRc

Examples

  • Example 9.1: The "lives within one mile of" relation is reflexive, symmetric, but not antisymmetric or transitive.

  • Example 9.2: aRb    abaRb \iff a \le b is reflexive, transitive, and antisymmetric (an ordering relation).

  • Example 9.3: aRb \iff a < b is irreflexive and transitive.

  • Example 9.4: A reflexive, symmetric, and transitive relation on A=1,2,3,4,5,6A = {1, 2, 3, 4, 5, 6}.

  • Example 9.5: A relation that is not reflexive, irreflexive, symmetric, or transitive but is antisymmetric.

Equivalence Relations (Chapter 10)

Concept of Equivalence

  • Equivalence captures the notion of "same kind".

  • Properties:

    • (1) Reflexive: Every object is equivalent to itself.

    • (2) Symmetric: If aa is equivalent to bb, then bb is equivalent to aa.

    • (3) Transitive: If aa is equivalent to bb and bb is equivalent to cc, then aa is equivalent to cc.

Definition of Equivalence Relation

  • A relation EE on a set AA is an equivalence relation if it is reflexive, symmetric, and transitive.

  • If (s,t)E(s, t) \in E, then ss and tt are considered to be of the same kind.

Equivalence Class

  • The equivalence class of xx (denoted as [x][x]) is the set of all elements in AA that are equivalent to xx.

    • [x]=yAyEx[x] = {y \in A | yEx}

Partitioning

  • Equivalence classes partition the set AA into separate pieces.

  • Example: Considering cards with the same rank splits a deck into 13 equivalence classes.

Examples of Equivalence Relations

  • Example 10.1: Equality on NN. aRb    a=baRb \iff a = b.

  • Example 10.2: Logical equivalence on logical propositions. pRq    pqpRq \iff p \equiv q.

  • Example 10.3: Same age on people. aRb    aaRb \iff a and bb are the same age.

  • Example 10.4: Given by a matrix (from exercise 3, part a) of chapter 9).

  • Example 10.5: Same parity on integers. aPb    aaPb \iff a and bb are both even or both odd.

  • Example 10.6: The equivalence class of 2 for the same parity relation is the set of all even integers. [2]=,4,2,0,2,4,[2] = {\dots, -4, -2, 0, 2, 4, \dots}.

Theorem 10.7

  • Let EE be an equivalence relation on a set AA, and let aAa \in A. Then there is exactly one equivalence class to which aa belongs.

  • Proof: EE is reflexive, so aEaaEa, and thus a[a]a \in [a] is true. If a[b]a \in [b] then [b]=[a][b] = [a].

    • Need to show: If c[a]c \in [a], then c[b]c \in [b], and if c[b]c \in [b], then c[a]c \in [a].

    • Direct proof (part 2): If c[b]c \in [b], then cEbcEb. Since a[b]a \in [b], aEbaEb, and by symmetry, bEabEa. By transitivity, cEacEa, meaning c[a]c \in [a].

Definition 10.8

  • A partition of a set A is a collection of nonempty, pairwise disjoint subsets of A, so that A is the union of the subsets in the collection.

  • A partition of a set AA is a collection of nonempty, pairwise disjoint subsets of AA, such that AA is the union of the subsets in the collection.

Digraph and Matrix Representation

  • Digraph: Every vertex in an equivalence class is connected to every other vertex in that class (including itself).

  • Matrix: Can be arranged in block diagonal form with all-1s matrices on the diagonal.