Relation between sets 2/16 A relation R between sets A and B is a - - PowerPoint PPT Presentation

relation between sets
SMART_READER_LITE
LIVE PREVIEW

Relation between sets 2/16 A relation R between sets A and B is a - - PowerPoint PPT Presentation

Relation between sets 2/16 A relation R between sets A and B is a predicate on A B . R ( x, y ) means x A and y B are related. Example (Arrow Graph) The relation is child of is a Relations predicate on Lectures 89


slide-1
SLIDE 1

/ department of mathematics and computer science

Relations

Lectures 8–9 (Chapter 17)

2/16 / department of mathematics and computer science

Relation between sets

A relation R between sets A and B is a predicate on A × B. R(x, y) means ‘x ∈ A and y ∈ B are related.’

Example (Arrow Graph) A = Children B = Parents

tim sara ron anna bert clemens daphne

The relation ‘is child of’ is a predicate on Children × Parents . In this example we have: R(b, r), R(b, s), R(c, t), and R(d, r) We sometimes write bRr instead of R(b, r).

3/16 / department of mathematics and computer science

Relation between sets

A relation R between sets A and B is a subset of A × B. That is: R ⊆ A × B.

Example (Cartesian Graph)

A r s t B a b c d

R = {(b, r), (b, s), (c, t), (d, r)} . We sometimes write (b, r) ∈ R instead of R(b, r).

4/16 / department of mathematics and computer science

Relation on a set

A relation R on A is a relation between A and A.

Example (Directed Graph)

R on {−1, 0, 1} with R(x, y) if |x| = |y|:

1 −1

slide-2
SLIDE 2

5/16 / department of mathematics and computer science

Reflexive relations

A relation R on A is reflexive if ∀x[x ∈ A : xRx] .

x for all x ∈ A. Reflexive:

val

= = , |

val

= = on abstr. props

◮ =, ≥ on R ◮ . . .

Not reflexive:

◮ > on R ◮ R on N with xRy if x = 3y

(Counterexample: ¬(1R1).)

◮ . . . 6/16 / department of mathematics and computer science

Symmetric relations

A relation R on A is symmetric if ∀x,y[x, y ∈ A : xRy ⇒ yRx] .

then

x y

if

for all x, y ∈ A. Symmetric:

val

= = on abstr. props

◮ = on R ◮ ‘is married’ on people ◮ . . .

Not symmetric:

◮ |

val

= = on abstr. props

◮ >, ≥ on R ◮ ‘is child of’ on people ◮ R on N with xRy if x = 3y

(Counterexample: 6R2, but ¬(2R6))

◮ . . . 7/16 / department of mathematics and computer science

Transitive relations

A relation R on A is transitive if ∀x,y,z[x, y, z ∈ A : (xRy∧yRz)⇒xRz] .

for all x, y, z ∈ A. x

if then

y z Transitive:

val

= = , |

val

= = on abstr. props

◮ =, >, ≥ on R ◮ . . .

Not transitive:

◮ ‘is sister of’ on people ◮ R on N with xRy if x = 3y

(Counterexample: 18R6 and 6R2, but ¬(18R2))

◮ . . . 8/16 / department of mathematics and computer science

Equivalence relation

R on A is an equivalence relation if and only if

  • 1. R is reflexive, and
  • 2. R is symmetric, and
  • 3. R is transitive.

Examples

val

= = on abstr. props

◮ = on N, Z, R, C, . . . ◮ = on sets ◮ the relation ≡6 on Z defined by

x ≡6 y if x − y is a multiple of 6 (e.g., 10 ≡6 4, 61 ≡6 1, −2 ≡6 10, 9 ≡6 9) ∃k[k ∈ Z : x − y = k · 6]

slide-3
SLIDE 3

10/16 / department of mathematics and computer science

≡6 on Z

Define the binary relation ≡6 on Z by x ≡6 y if ∃k[k ∈ Z : x − y = 6 · k].

Fact

≡6 is an equivalence relation on Z.

Proof:

We need to prove that

  • 1. ≡6 is reflexive;

[Proof: see book.]

  • 2. ≡6 is symmetric;

[Proof: see book.]

  • 3. ≡6 is transitive.

[Proof on next slide; see also book]

11/16 / department of mathematics and computer science

≡6 is transitive:

var x, y, z; x, y, z ∈ Z x ≡6 y ∧ y ≡6 z ∃k[k ∈ Z : x − y = 6 · k] (∧-elim + definition ≡6) Pick a k with k ∈ Z and x − y = 6 · k (∃∗-elim) ∃ℓ[ℓ ∈ Z : y − z = 6 · ℓ] (∧-elim + definition ≡6) Pick an ℓ with ℓ ∈ Z and y − z = 6 · ℓ (∃∗-elim) x − z = (x − y) + (y − z) = 6 · k + 6 · ℓ = 6 · (k + ℓ) (Mathematics) x − z = 6 · (k + ℓ) (Mathematics) k + ℓ ∈ Z (since k ∈ Z and ℓ ∈ Z) ∃m[m ∈ Z : x − z = 6 · m] (∃∗-intro) x ≡6 z (definition ≡6) ∀x,y,z[x, y, z ∈ Z : x ≡6 y ∧ y ≡6 z ⇒ x ≡6 z]

Note: It is important to choose k and ℓ distinct in this proof.

12/16 / department of mathematics and computer science

≡6 is transitive:

Proof:

To prove that x ≡6 y and y ≡6 z implies x ≡6 z for all x, y, z ∈ Z, let x, y, z ∈ Z and suppose that x ≡6 y and y ≡6 z; we need to establish that x ≡6 z. From x ≡6 y and y ≡6 z it follows, by the definition of ≡6, that there exists k and ℓ with x − y = 6 · k and y − z = 6 · ℓ. Hence, x − z = (x − y) + (y − z) = 6 · k + 6 · ℓ = 6 · (k + ℓ) . Since k, ℓ ∈ Z, we also have that (k + ℓ) ∈ Z. So we have that x − z is a multiple of 6, and hence, according to the definition of ≡6, it follows that x ≡6 z.

13/16 / department of mathematics and computer science

Equivalence classes

Let A be a set, let R be an equivalence relation on A. K(a) def = {x ∈ A | aRx} The equivalence class of a ∈ A is the set of all end- points of arrows from a.

K(a′) a′ b′ c′ d′ d c b a K(a)

Note: K(a)=K(b)=K(c)=K(d) Since R is an equivalence relation, everything within a class is related. For instance: aRd

symm.

  • dRa

aRc

  • trans.

dRc

slide-4
SLIDE 4

14/16 / department of mathematics and computer science

Equivalence classes

Example

Consider the equivalence relation ≡5 on Z.

K(2) 1 2 3 4 K(0) K(1) K(4) K(3)

Then, e.g., K(3) = {. . . , −7, −2, 3, 8, 13, . . . } . Note: K(4) = K(9) = K(14) = · · ·

15/16 / department of mathematics and computer science

Equivalence classes

Example

Let R be an equivalence relation on a set A, and let a, a′ ∈ A. Prove that ¬(aRa′) ⇒ K(a) ∩ K(a′) = ∅ [Proof on next slide]

16/16 / department of mathematics and computer science

Example: ¬(aRa′) ⇒ K(a) ∩ K(a′) = ∅

(1) ¬(a R a′) (2) var x; x ∈ K(a) ∩ K(a′) (3) x ∈ K(a) ∧ x ∈ K(a′) (4) a R x (5) a′ R x (6) x R a′ (∀-elim on ‘R is symmetric’ followed by ⇒-elim) (7) a R a′ (∀-elim on ‘R is transitive’ followed by ∧-intro and ⇒-elim) (8) False (9) K(a) ∩ K(a′) = ∅ (10) ¬(aRa′) ⇒ K(a) ∩ K(a′) = ∅