1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3.

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

Equivalence Relations
Equivalence Relations
Equivalence Relations
Relations Relations on a Set. Properties of Relations.
COUNTING AND PROBABILITY
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Properties of Relations
Discrete Mathematics Lecture # 16 Inverse of Relations.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Discrete Structures Chapter 5 Relations Nurul Amelina Nasharuddin Multimedia Department.
Congruence of Integers
Relations binary relations xRy on sets x  X y  Y R  X  Y Example: “less than” relation from A={0,1,2} to B={1,2,3} use traditional notation 0 < 1,
Equivalence Relations: Selected Exercises
Discrete Mathematics Lecture#11.
Partially Ordered Sets Basic Concepts
Relations Chapter 9.
Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.
The Integers and Division
Equivalence Relations MSU CSE 260. Outline Introduction Equivalence Relations –Definition, Examples Equivalence Classes –Definition Equivalence Classes.
Great Theoretical Ideas in Computer Science.
1 Introduction (Pengenalan) n About the Lecturer: –Nama lengkap: Heru Suhartanto, Ph.D –Kantor: Ruang 1214, Gedung A, Fakultas Ilmu Komputer UI, Depok.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
1 Annoucement n Skills you need: (1) (In Thinking) You think and move by Logic Definitions Mathematical properties (Basic algebra etc.) (2) (In Exploration)
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Week 9 - Wednesday.  What did we talk about last time?  Exam 2  Before that: review  Before that: relations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Rosen, Section 8.5 Equivalence Relations
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Mathematical Preliminaries
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Lecture 2: Relations Relations Reading: Epp Chp 10.1, 10.2.
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
Great Theoretical Ideas in Computer Science.
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
1 Lecture 2 (part 1) Partial Orders Reading: Epp Chp 10.5.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda.
Chap. 7 Relations: The Second Time Around
Basic Probability. Introduction Our formal study of probability will base on Set theory Axiomatic approach (base for all our further studies of probability)
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 41 May 7, 2008.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Great Theoretical Ideas in Computer Science.
Discrete Mathematics Lecture # 17 Function. Relations and Functions  A function F from a set X to a set Y is a relation from X to Y that satisfies the.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Equivalence Relations: Selected Exercises
The Relation Induced by a Partition
Relations Chapter 9.
Number Theory and Modular Arithmetic
Great Theoretical Ideas in Computer Science
Formal Definition and Examples
Equivalence Relations
Equivalence Relations
Equivalence Relations: Selected Exercises
Presentation transcript:

1 Lecture 2 Equivalence Relations Reading: Epp Chp 10.3

2 Overview – Equivalence Relations 1.Revision 2.Definition of an Equivalence Relation 3.Examples (and non-examples) 4.Visualization Tool 5.FromEquivalence Relations toEquivalence Classes toPartitions 6.FromPartitions toEquivalence Relations 7.Another Example

3 1. Revision Concrete World Abstract World a. ___ has been to ___ {John, Mary, Peter} {Tokyo, NY, HK}{(John,Tokyo), (John,NY), (Peter, NY)} b. ___ is in ___ {Tokyo, NY} {Japan, USA}{(Tokyo,Japan), (NY,USA)} c. ___ divides ___{1,2,3,4} {10,11,12} {(1,10),(1,11),(1,12), (2,10), (2,12),(3,12), (4,12)} d. ___ less than ___ {1,2,3} {(1,2),(1,3),(2,3)} ___ R ___ AB R  A  BR  A  B Q: What can you do with relations? A: (1) Set Operations; (2) Complement; (3) Inverse; (4) Composition Q: What happens if A = B ? Relation R from A to B

4 1. Revision Concrete World a. ___ same age as ___ {John, Mary, Peter} {(John,John), (Mary,Mary) (Peter,Peter), (Mary,Peter), (Peter,Mary)} b. ___ same # of elements as ___ { {}, {1}, {2}, {3.4} } { ({},{}), ({1},{1}), ({2},{2}) ({3,4},{3,4}) ({1},{2}), ({2},{1}) c. ___  ___ { {}, {1}, {2}, {1,2} } { ({},{}), ({},{1}), ({},{2}), ({},{1,2}), ({1},{1}), ({1},{1,2}), ({2},{2}), ({2},{1,2}) ({1,2},{1,2}) } d. ___  ___ {1,2,3} {(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)} ___ R ___ A R  A2R  A2 Relation R on A “Everyone is related to himself” “If x is related to y and y is related to z, then x is related to z.” Reflexive Transitive “If x is related to y, then y is related to x ” “If x is related to y and y is related to x, then x = y.” Symmetric Anti-Symmetric

5 1. Revision n Given a relation R on a set A, –R is reflexive iff  x  A, x R x –R is symmetric iff  x,y  A, x R y  y R x –R is anti-symmetric iff  x,y  A, x R y  y R x  x=y –R is transitive iff  x,y  A, x R y  y R z  x R z

6 Overview – Equivalence Relations 1.Revision 2.Definition of an Equivalence Relation 3.Examples (and non-examples) 4.Visualization Tool 5.FromEquivalence Relations toEquivalence Classes toPartitions 6.FromPartitions toEquivalence Relations 7.Another Example

7 2. Definition n Given a relation R on a set A, –R is an equivalence relation iff R is reflexive, symmetric and transitive. (Today’s Lecture) –R is a partial order iff R is reflexive, anti-symmetric and transitive. (Next Lectures)

8 2. Definition n Given a relation R on a set A, –R is an equivalence relation iff R is reflexive, symmetric and transitive. n Q: How do I check whether a relation is an equivalence relation? n A: Just check whether it is reflexive, symmetric and transitive. (Always go back to the definition.) n Q: How do I check whether a relation is reflexive, symmetric and transitive? n A: Again, go back to the definitions of reflexive, symmetric and transitive. (Previous Lecture)

9 3 Examples (EqRel in life) 3.1 Let S be the set of all second year students. Define a relation C on S such that x C y iff x and y take at least 1 course in common Q1: Is C reflexive? (  x  S, x C x) ??? Yes. Q2: Is C symmetric? (  x,y  S, x C y  y C x) ??? Yes. Q3: Is C transitive? (  x,y  S, x C y  y C z  x C z) ??? NO!!! Therefore C is NOT an equivalence relation.

10 3 Examples (EqRel in life) 3.2 Let S be the set of all second year students. Define a relation N on S such that x N y iff x and y take NO courses in common Q1: Is N reflexive? (  x  S, x N x) ??? NO!!!. Q2: Is N symmetric? (  x,y  S, x N y  y N x) ??? Yes. Q3: Is N transitive? (  x,y  S, x N y  y N z  x N z) ??? NO!!! Therefore N is NOT an equivalence relation.

11 3 Examples (EqRel in life) 3.3 Let S be the set of all people this room. Define a relation T on S such that x T y iff x is of equal or taller height than y Q1: Is T reflexive? (  x  S, x T x) ??? Yes. Q2: Is T symmetric? (  x,y  S, x T y  y T x) ??? NO!!! Q3: Is T transitive? (  x,y  S, x T y  y T z  x T z) ??? Yes. Therefore T is NOT an equivalence relation.

12 3 Examples (EqRel in life) 3.4 Let S be the set of all people in this room. Define a relation M on S such that x M y iff x is born in the same month as y Q1: Is M reflexive? (  x  S, x M x) ??? Yes. Q2: Is M symmetric? (  x,y  S, x M y  y M x) ??? Yes. Q3: Is M transitive? (  x,y  S, x M y  y M z  x M z) ??? Yes. Therefore M is an equivalence relation.

13 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q1: Is R reflexive? Reflexive :  x  A, x R x (Always go back to the definition) n Yes!

14 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition)

15 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition)

16 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition)

17 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition)

18 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition)

19 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q2: Is R symmetric? Symmetric :  x,y  A, x R y  y R x (Always go back to the definition) n Yes, R is symmetric.

20 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q3: Is R transitive? Transitive :  x,y  A, x R y  y R z  x R z (Always go back to the definition)

21 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q3: Is R transitive? Transitive :  x,y  A, x R y  y R z  x R z (Always go back to the definition)

22 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q3: Is R transitive? Transitive :  x,y  A, x R y  y R z  x R z (Always go back to the definition)

23 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q3: Is R transitive? Transitive :  x,y  A, x R y  y R z  x R z (Always go back to the definition)

24 3 Examples (Finite Eq Rels) 3.5 Let A = {0,1,2,3,4} Let R = {(0,0), (0,4), (1,1), (1,3), (2,2), (4,0), (3,3), (3,1), (4,4)} Is R an equivalence relation? Q3: Is R transitive? Transitive :  x,y  A, x R y  y R z  x R z (Always go back to the definition) n Carry on with checking … n Yes, R is transitive.

25 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) Prove that R an equivalence relation. NOTE: Do not be confuse with the ‘  ’ notation GO BACK TO THE DEFINITION: x  y (mod k) iff k | (x-y) Remember? “x is congruent to y modulo k”? (Meaning that “x and y will give the same remainder when divided by k”) n Therefore, by definition: x  y (mod 3) iff 3 | (x-y)

26 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) Prove that R an equivalence relation. To show that R is Reflexive: We must show x  x (mod 3) n Hence, we must show 3 | (x - x) n Which is true, since 3 | 0. n Hence R is Reflexive.

27 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) Prove that R an equivalence relation. To show that R is Symmetric: n Assume x R y  x  y (mod 3)(Defn of R)  3 | (x - y)(Defn of congruence modulo)  3 | (y - x)(DM1 Thm3.2.4: m|n  m|-n )  y  x (mod 3)(Defn of congruence modulo)  y R x(Defn of R)

28 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) Prove that R an equivalence relation. To show that R is Transitive: n Assume x R y and y R z.  x  y (mod 3) and y  z (mod 3)(Defn of R)  3 | (x - y) and 3 | (y - z)(Defn of  mod)  (x - y) = 3j and (y - z) = 3k(Defn of ‘|’)  (x - z) = 3(j+k)(Add both eqns)  3 | (x - z)(Defn of ‘|’)  x  z (mod 3)(Defn of  mod)  x R z(Defn of R)

29 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) Q: How does an equivalence relation look like? Well, let’s draw the above equivalence relation and see… But first, before we draw, we must find out some of the numbers which are related.

30 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) DEFINITION: x  y (mod 3) iff 3 | (x-y) 0 R 0 since 0  0 (mod 3) 0 R 3 since 0  3 (mod 3) 3 R 0 since 3  0 (mod 3) 3 R 3 since 3  3 (mod 3) 0 R 6 since 0  6 (mod 3) 6 R 0 since 6  0 (mod 3) 3 R 6 since 3  6 (mod 3) 6 R 3 since 6  3 (mod 3) 9 R 9, 0 R 9, 9 R 0, 3 R 9, 9 R 3 6 R 9, 9 R 6,… 0 R -3since 0  -3 (mod 3) -3 R 0since -3  0 (mod 3) -3 R -3since -3  -3 (mod 3) 0 R -6since 0  -6 (mod 3) -6 R 0since -6  0 (mod 3) -6 R -6since -6  -6 (mod 3) -3 R -6since -3  -6 (mod 3) -6 R -3since -6  -3 (mod 3) -9 R -9, 0 R -9, -9 R 0, -3 R -9, -9 R R -9, -9 R -6,…

31 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) DEFINITION: x  y (mod 3) iff 3 | (x-y) 1 R 1 since 1  1 (mod 3) 1 R 4 since 1  4 (mod 3) 4 R 1 since 4  1 (mod 3) 4 R 4 since 4  4 (mod 3) 1 R 7 since 1  7 (mod 3) 7 R 1 since 7  1 (mod 3) 4 R 7 since 4  7 (mod 3) 7 R 4 since 7  4 (mod 3) 1 R -2since 1  -2 (mod 3) -2 R 1since -2  1 (mod 3) -2 R -2since -2  -2 (mod 3) 1 R -5since 1  -5 (mod 3) -5 R 1since -5  1 (mod 3) -5 R -5since -5  -5 (mod 3) -2 R -5since -2  -5 (mod 3) -5 R -2since -5  -2 (mod 3)

32 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) 2 R 2 since 2  2 (mod 3) 2 R 5 since 2  5 (mod 3) 5 R 2 since 5  2 (mod 3) 5 R 5 since 5  5 (mod 3) 2 R 8 since 2  8 (mod 3) 8 R 2 since 8  2 (mod 3) 5 R 8 since 5  8 (mod 3) 8 R 5 since 8  5 (mod 3) 2 R -1since 2  -1 (mod 3) -1 R 2since -1  2 (mod 3) -1 R -1since -1  -1 (mod 3) 2 R -4since 2  -4 (mod 3) -4 R 2since -4  2 (mod 3) -4 R -4since -4  -4 (mod 3) -1 R -4since -1  -4 (mod 3) -4 R -1since -4  -1 (mod 3) DEFINITION: x  y (mod 3) iff 3 | (x-y)

33 3 Examples (Infinite Eq Rels) 3.6 Let R be a relation on Z, such that x R y iff x  y (mod 3) 2 R 2 2 R 5 5 R 2 5 R 5 2 R 8 8 R 2 5 R 8 8 R 5 2 R R 2 -1 R -1 2 R R 2 -4 R R R -1 1 R 1 1 R 4 4 R 1 4 R 4 1 R 7 7 R 1 4 R 7 7 R 4 1 R R 1 -2 R -2 1 R R 1 -5 R R R -2 0 R 0 0 R 3 3 R 0 3 R 3 0 R 6 6 R 0 3 R 6 6 R 3 0 R R 0 -3 R -3 0 R R 0 -6 R R R -3 DEFINITION: x  y (mod 3) iff 3 | (x-y)

34 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) R = {(0,0),(3,3),(0,3),(3,0),(6,6),(0,6),(6,0),(3,6),(6,3),(9,9),(0,9),(9,0),(3,9),(9,3),(6,9),(9,6),(-3,-3),(0,-3),(-3,0),(3,-3),(3-,3),(6,-3),(-3,6),(9,-3),(-3,9) …..

Visual Tool: R  Z 2, x R y iff x  y (mod 3)

Notice that we will have a group of elements, everyone related to everyone else in that group - Very troublesome to draw lines everywhere since we know everyone is related to everyone else in that group. 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3)

37 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Notice also that we have a few distinct groups. No one from one group is related to another element from another group. Let’s simplify the drawing:

38 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) We can partition Z into a few sets based on the rule that the elements within a partition are related to each other, and the elements between partitions are not related to each other. Z

39 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) After partitioning, we can drop the arrows depicting the relationships, because we know that everyone within the same partition is relation to each other. Z

40 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) After partitioning, we can drop the arrows depicting the relationships, because we know that everyone within the same partition is relation to each other. Z

41 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) The partitioning of Z, shown here in a diagram can be written down as: {{…,-6,-3,0,3,6,…},{…,-5,-2,1,4,7,…},{…,-4,-1,2,5,8,…}} Z

42 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Q: Does this partitioning work for every equivalence relation? Can every equivalence relation R on a set A, be partitioned in this manner? A: Yes. We will now prove it in general. Z

43 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z Instead of writing {…,-6,-3,0,3,6,…}, we define the concept of an equivalence class. The idea is that we take one element to represent all the elements of that partition. Definition: Let R be an equivalence relation on a set A, and let a  A. The equivalence class of a is defined as follows: [a] = { x  A | x R a} (i.e. x  [a] iff x R a) Note: (1) ‘a’ is known as a representative. (2) [a] is a SET

44 By analogy, consider the earlier example 3.4 Let A be all the people in this room. We define a relation R on S such that x R y iff x and y are born in the same month (We have seen earlier the R is an equivalence relation) A can be divided in the twelve partitions. Previous slide defn: [a] = { x  A | x R a} (i.e. x  [a] iff x R a) So what is [Riza]? [Riza]= {x  A | x R Riza} = {x  A | x and Riza are born in the same month} And what is [Mika]? [Mika]= {x  A | x R Mika} = {x  A | x and Mika are born in the same month} is [Riza] = [Mika]? 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3)

45 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z [a] = {x  A | x R a} (i.e. x  [a] iff x R a) Q:What is [0]? A: By Definition: [0] = { x  Z | x R 0} = { x  Z | x  0 (mod 3)} [0] = {…,-3,0,3,6,9,…} Q:What is [3]? A: By Definition: [3] = { x  Z | x R 3} = { x  Z | x  0 (mod 3)} [3] = {…,-3,0,3,6,9,…} So similarly, in this congruence modulo relation…

46 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z [0] = [3] = {…,-3,0,3,6,9,…} In fact, [0] = [3] = [-3] = [6] = [-6] = {…,-3,0,3,6,9,…} We just need one representative of that class. So similarly, in this congruence modulo relation… [a] = {x  A | x R a} (i.e. x  [a] iff x R a)

47 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z Q:What is [1]? A: By Definition: [1] = { x  Z | x R 1} = { x  Z | x  1 (mod 3)} [1] = {…,-5,-2,1,4,7,10,13,16…} [1] = [-2] = [4] = [7] = {…,-5,-2,1,4,7,10,13,16…} All refer to the same partition. So similarly, in this congruence modulo relation… [a] = {x  A | x R a} (i.e. x  [a] iff x R a)

48 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z Q:What is [8]? A: By Definition: [8] = { x  Z | x R 8} = { x  Z | x  8 (mod 3)} [8] = {…,-4,-1,2,5,8,11,14,17…} [-1] = [2] = [5] = [8] = {…,-4,-1,2,5,8,11,14,17…} All refer to the same partition. So similarly, in this congruence modulo relation… [a] = {x  A | x R a} (i.e. x  [a] iff x R a)

49 4. Visual Tool: R  Z 2, x R y iff x  y (mod 3) Z (1) Given an equivalence relation R on A, and a,b  A If a R b then [a] = [b] We make a guess on the following generalisations: (2) Given an equivalence relation R on A, and a,b  A Either [a]  [b] =  or [a] = [b] (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A.

50 5. From Eq Rel to Eq Class to Partitions Equivalence Relation Partition Distinct equivalence classes form a … Prove: Given an equivalence relation R on A, and a,b  A 1.If a R b then [a] = [b] 2.Either [a]  [b] =  or [a] = [b] 3.The distinct equivalence classes of R form a partition of A.

Proof (1) Given an equivalence relation R on A, and a,b  A If a R b then [a] = [b] Proof: [a]  [b]: Assume: e  [a]  e R a (by definition: x  [a] iff x R a )  e R a  a R b (since we assumed that a R b)  e R b (Since R, being an Eq Rel, is transitive)  e  [b] (by definition: x  [b] iff x R b ) Therefore [a]  [b] (Note: We can’t flip the arrow and go backwards)

Proof (1) Given an equivalence relation R on A, and a,b  A If a R b then [a] = [b] Proof: [b]  [a]: Assume: e  [b]  e R b (by definition: x  [b] iff x R b )  e R b  a R b (since we assumed that a R b)  e R b  b R a (Since R, being an Eq Rel, is symmetric)  e R a (Since R, being an Eq Rel, is transitive)  e  [a] (by definition: x  [b] iff x R b ) Therefore [b]  [a]

Proof (2) Given an equivalence relation R on A, and a,b  A Either [a]  [b]   or [a]  [b] Proof: Either [a]  [b]   or [a]  [b]   Case 1: Assuming that [a]  [b]  , then we are done! Since it’s true that: [a]  [b]   or [a]  [b] Case 2: Assuming that [a]  [b]   … next slide … [a]  [b]   or [a]  [b]

Proof  e  [a]  [b](Defn of  : (  x, x  S)  S=  )  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b]) Proven.  [a]  [b]    or [a] = [b] Assuming that [a]  [b]   then

Proof Assuming that [a]  [b]   then  e  [a]  [b](Defn of  : (  x, x  S)  S=  )  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof Look here… Do you know that a lot of things are happening here?

Proof Assuming that [a]  [b]   then  e  [a]  [b](Defn of  : (  x, x  S)  S=  )  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then  x, (x  [a]  [b]) (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then  x, (x  [a]  [b]) (Defn of  : (  x, x  S)  S=  ) e  [a]  [b] e  [a]  e  [b] (By defn of  ) e R a  e R b(By defn of Eq Class) a R e  e R b(Since R, an Eq Rel is symmetric) a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b]  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof Looks familiar?

Proof Assuming that [a]  [b]   then  x, (x  [a]  [b]) (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then (Defn of  : (  x, x  S)  S=  )  e  [a]  [b]  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof

Proof Assuming that [a]  [b]   then  e  [a]  [b](Defn of  : (  x, x  S)  S=  )  e  [a]  e  [b] (By defn of  )  e R a  e R b(By defn of Eq Class)  a R e  e R b(Since R, an Eq Rel is symmetric)  a R b(Since R, an Eq Rel is transitive)  [a] = [b](Proven: IF a R b THEN [a] = [b])  [a]  [b]    or [a] = [b] Let’s sidetrack a bit and take a closer look at the proof Although you dropped certain symbols, be aware that they are still very much there.

66 5. From Eq Rel to Eq Class to Partitions Equivalence Relation Partition Distinct equivalence classes form a … Prove: Given an equivalence relation R on A, and a,b  A 1.If a R b then [a] = [b] 2.Either [a]  [b] =  or [a] = [b] 3.The distinct equivalence classes of R form a partition of A.

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: Let A 1, A 2,…,A n be distinct equivalence classes of R. To do: Show that A 1, A 2,…,A n form a partition of A. Q: What is the definition of a partition? A: A 1, A 2,…,A n is a partition of A iff (1) A = A 1  A 2  …   A n (2)  i,j, i  j  A i  A j =  (Mutually disjoint)

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: Let A 1, A 2,…,A n be distinct equivalence classes of R. To do: Show that (1) A = A 1  A 2  …   A n (2)  i,j, i  j  A i  A j =  (Mutually disjoint)

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: (1) Show that A = A 1  A 2  …   A n (a) Show A  A 1  A 2  …   A n (b) Show A 1  A 2  …   A n  A

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: (1) Show that A = A 1  A 2  …   A n (a) Show A  A 1  A 2  …   A n Let x  A  x R x(Since R, an Eq Rel, is reflexive)  x  [x](By defn of Eq Class)  [x] must be one of the A i (i from 1 to n)  x  A i (for some i from 1 to n)  x  A 1  A 2  …  A n

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: (1) Show that A = A 1  A 2  …   A n (a) Show A  A 1  A 2  …   A n (b) Show A 1  A 2  …   A n  A Let x  A 1  A 2  …  A n  x  A i (for some i from 1 to n, by defn of Union) But each A i is an Eq Class of R (we assumed this) and any Eq Class is a subset of A (Remember the Defn: [a] = { x  A | x R a} ) Therefore A i  A. Hence  x  A

Proof (3) Given an equivalence relation R on A, the distinct equivalence classes of R form a partition of A. Proof: (2) Show that  i,j, i  j  A i  A j =  (Mutually disjoint) Assume i  j, and so the 2 sets A i  A j Then there exists elements a and b in A such that A i = [a] and A j = [b] Now, either [a]  [b]   or [a]  [b]  ( Lemma proven ) But we know [a]  [b]. Therefore [a]  [b]  . Hence A i  A j  

Where are we? Equivalence Relation Partition Distinct equivalence classes form a … Q:Is a relation induced by a partition an equivalence relation?

74 6. From Partitions to Eq Rel. Defn: Given a set A, and partition of A (A = A 1  A 2  …  A n ), the (binary) relation R, induced by the partition, is defined as: x R y iff (  i, x  A i and y  A i ) (meaning to say x R y iff x and y belong to the same partition) n For example, let A = {0,1,2,3,4} and let {0,3,4}, {1}, {2} be a partition of A. Let R be the relation induced by this partition. n Question: –Is 0 R 0? –Is 0 R 3? –Is 0 R 1? –Is 1 R 2? –Is 3 R 4? –Is 1 R 1? Yes. No. Yes. n List the elements in R R = {(0,0),(3,3),(4,4),(0,3),(3,0),(0,4),(4,0),(3,4),(4,3),(1,1),(2,2)}

75 6. From Partitions to Eq Rel. The (binary) relation induced by the partition, R is defined as:  x,y  A, x R y iff x and y belong to the same partition of A A

76 6. From Partitions to Eq Rel. (Thm) Let A be a set with a partition and let R be the relation induced by the partition. Then R is an equivalence relation. x R y iff (  i, x  A i and y  A i ) n Proof (Reflexive): –Pick any x in A. –Then x  A i for some i. (meaning that x must be in some partition) –So  i, x  A i and x  A i –So x R x. –So R is reflexive.

77 6. From Partitions to Eq Rel. (Thm) Let A be a set with a partition and let R be the relation induced by the partition. Then R is an equivalence relation. x R y iff (  i, x  A i and y  A i ) n Proof (symmetric): –Assume x R y –Then (  i, x  A i and y  A i ) –Then (  i, y  A i and x  A i ) –So y R x.

78 6. From Partitions to Eq Rel. (Thm) Let A be a set with a partition and let R be the relation induced by the partition. Then R is an equivalence relation. x R y iff (  i, x  A i and y  A i ) n Proof (transitive): –Assume x R y and y R z –Then x  A i and y  A i (for some i) and y  A k and z  A k (for some k) –Claim: i=k. –If i  k, then A i  A j = . (defn: partitions are mutually disjoint). But we know that y  A i, and also that y  A k. Meaning that y  A i  A j meaning that A i  A j  (  !) –Therefore (  i, x  A i and z  A i ) –Therefore x R z.

79 6. From Partitions to Eq Rel. Equivalence Relation Partition Distinct equivalence classes form a … Relation induced by a partition is an equivalence relation

80 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n R is a relation on (Z + ) 2 !!! Wow! Confusing. n Just go back to the definition: n R is a relation on A means: R  (A x A) or R  A 2 n R is a relation on (Z + ) 2 means: R  ((Z + ) 2 x (Z + ) 2 ) or R  ((Z + ) 2 ) 2

81 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R reflexive? Go back to definition: If R is on A, reflexive means:  x  A, x R x n Now, R is on (Z + ) 2, … so reflexive means:  (m,n)  (Z + ) 2, (m,n) R (m,n) n It is NOT:  (m,m)  (Z + ) 2, (m,m) R (m,m) n Be very careful!!!

82 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R reflexive? Go back to definition:  (m,n)  (Z + ) 2, (m,n) R (m,n) n The above is true in general since given any (m,n): (m,n) R (m,n) due to the fact that mn = nm n Therefore R is reflexive.

83 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R symmetric? Go back to definition: n If R is on A, symmetric means:  x,y  A, x R y  y R x n Now, R is on (Z + ) 2, … so symmetric means:  (a,b), (c,d)  (Z + ) 2, (a,b) R (c,d)  (c,d) R (a,b)

84 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R symmetric? Go back to definition:  (a,b), (c,d)  (Z + ) 2, (a,b) R (c,d)  (c,d) R (a,b) n Assume (a,b) R (c,d) n ad = bc n bc = ad n cb = da n (c,d) R (a,b) n Yes, R is symmetric

85 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R transitive? Go back to definition: n If R is on A, transitive means:  x,y,z  A, x R y  y R z  x R z n Now, R is on (Z + ) 2, … so transitive means:  (a,b),(c,d),(e,f)  (Z + ) 2, (a,b) R (c,d)  (c,d) R (e,f)  (a,b) R (e,f)

86 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n Is R an equivalence relation? n Is R transitive? Go back to definition:  (a,b),(c,d),(e,f)  (Z + ) 2, (a,b) R (c,d)  (c,d) R (e,f)  (a,b) R (e,f) n Assume (a,b) R (c,d) and (c,d) R (e,f): n ad = bc and cf = de (by definition) n a/b = c/d and c/d=e/f n a/b = e/f. Therefore af = eb. And so af = be n Hence (a,b) R (e,f)

87 7. Example n Let R be a relation on (Z + ) 2, such that (a,b) R (c,d) iff ad = bc n What are the distinct Eq Classes of R? n [(1,1)] = {(1,1), (2,2), (3,3), (4,4), …} n [(1,2)] = {(1,2), (2,4), (3,6), (4,8), …} n [(1,3)] = {(1,3), (2,6), (3,9), (4,12),…} n [(2,3)] = {(2,3), (4,6), (6,9), (8,12),…} n [(2,1)] = {(2,1), (4,2), (6,3), (8,4),…} n Looks familiar? n We have defined what it means for two fractions to be the same. n Distinct Equivalence classes are: [(m,n)] where m,n  Z + and gcd(m,n) = 1.

88 8. Summary of Definition & Theorems Definition: Let R be an equivalence relation on a set A, and let a  A. The equivalence class of a is defined as follows: [a] = { x  A | x R a} OR x  [a] iff x R a If a R b then [a] = [b] Either [a]  [b] =  or [a] = [b] Given an Equivalence relation R on A, the distinct equivalence classes of R form a partition of A.

89 Again the skills: n 2 things you need to know: –Your HEAD Logic (which includes proving) Definitions (which includes theorems and lemmas) –Always go back to the definition. –Do not misinterpret the definition. »Be very very sensitive to what the definition says and what it does not say. »Be careful that you do not add in your pre-conceived ideas into the definition. –Trust the definition (not your feelings) –Memorise the definitions. –Your HEART Intuition: Draw diagrams if possible, to get a good feel of the problem. Try various small examples. n End of Lecture