Equivalence relations R A A is an equivalence relation if R is 1. reflexive (a, a) R 2. symmetric, and (a, b) R (b, a) R 3. transitive. (a, b), (b, c) R (a, c) R Example: Let S be a relation on people such that a S b if a and b have the same parents. Example: Let M be a relation on integers such that (i, j) M if i j(mod 5) (0, 0) M, (0, 5) M, (5, 0) M, (0, 10) M (1, 1) M, (1, 6) M, (6, 1) M, (1, 11) M (2, 2) M, (2, 7) M, (7, 2) M, (2, 12) M (3, 3) M, (3, 8) M, (8, 3) M, (3, 13) M (4, 4) M, (4, 9) M, (9, 4) M, (4, 14) M 1
a, b {..., 10, 5, 0, 5, 10, 15,...} amb Similarly: a, b {..., 9, 4, 1, 6, 11, 16,...} amb a, b {..., 8, 3, 2, 7, 12, 17,...} amb a, b {..., 7, 2, 3, 8, 13, 18,...} amb a, b {..., 6, 1, 4, 9, 14, 19,...} amb where i M j if i j(mod 5) 2
Equivalence Classes Let R A A be an equivalence relation. For any a in A, the set of all elements related to a by R is called the equivalence class of a (induced by R). We denote the equivalence class of a by [a] R. Formally, [a] R = {b (a, b) R} A representative of an equivalence class [a] R is any element b [a] R. Example: [0] M = {..., 10, 5, 0, 5, 10, 15,...} [1] M = {..., 9, 4, 1, 6, 11, 16,...} [2] M = {..., 8, 3, 2, 7, 12, 17,...} [3] M = {..., 7, 2, 3, 8, 13, 18,...} [4] M = {..., 6, 1, 4, 9, 14, 19,...} [0] M = [5] M = [ 10] M, [0] M [1] M = 3
Theorem: Let R be an equivalence relation. Then the following are equivalent. 1. a R b 2. [a] R = [b] R 3. [a] R [b] R So any two classes of an equivalence relation are either the same or disjoint. A: A 2 A 3 A 1 A 4 A 5 4
Partitions of a set Let A i, i = 1, 2,..., n be subsets of a set A. Then {A 1, A 2..., A n } is a partition of A when 1. A i, for all i = 1, 2,..., n. 2. A 1 A 2... A n = A, and 3. A i A j = if i j (sets are pairwise disjoint). A: A 2 A 3 A1 A 4 A 5 5
Theorem: 1. Let R be an equivalence relation on set A. The distinct equivalence classes of R form a partition of A. 2. Conversely, given a partition A 1, A 2,..., A n of A, there is an equivalence relation R that has A 1, A 2,..., A n as its equivalence classes. 6
Partial Orderings A generalization of the relation on the powerset of a set. (as in {1, 2} {1, 2, 3}) Recall that is a relation that is reflexive (a, a) R, antisymmetric (a, b), (b, a) R a = b, and transitive (a, b), (b, c) R (a, c) R. Let R A A. Then R is a partial ordering if it is reflexive, antisymmetric and transitive. The pair (A, R) is called a partially ordered set or poset when A is a set and R is a partial ordering on A. Example: The operation is a partial ordering on a set of subsets. Thus, for instance (P(N), ) is a poset. 7
Posets and total orders In a poset (A, R), if (a, b) R we write a b (or b a) We say a is less than or equal to b even if A is not a set of numbers. If a b and a b then we write a b. If a b or b a then a and b are comparable. In a poset, there might be elements a and b such that a / b and b / a. We call such elements incomparable. If (A, ) is a poset, and every two elements of A are comparable then A is called a totally ordered set and is called a total order, or a chain. 8
The usual graph representation of a poset is crowded with arcs: Example: (P({1, 2, 3}), ) {1} {1,2} {2} {1,3} { } {1,2,3} {3} {3,2} 9
Hasse diagram for posets: The Hasse diagram is obtained from the graph representation by: 1. Removing all arcs due to reflexivity, 2. Removing all arcs due to transitivity, 3. Positioning all elements so that if a b then b is above a. {1,2,3} {1,2} {1,3} {3,2} {1} {1,2} {2} {1,3} {1} {2} {3} { } {1,2,3} { } {3} {3,2} 10
A Hasse diagram is the usual representation of partial orders. Example: The Hasse diagram of course prerequisites. C326 C346 C353 C354 C352 C335 C229 C239 C249 C228 C238 C248 11
If R is a total order then in the Hasse diagram of R all elements of R are aligned on a line. Recall that a total order is called a chain. Example: on natural numbers is a total order... 6 5 4 3 2 1 0 12
Lexicographic Order A method to extend a partial order from a set A of elements to strings constructed from elements in A. Also called dictionary order. Example: We have a partial (actually total) ordering on letters: a b c d e y z We want to extend to words made from letters to get an ordering as in dictionaries. ace acme bamboo bank zebra First, we show how to extend partial orders of sets A and B to obtain an ordering of A B. 13
Lexicographic Order Let (A 1, 1 ) and (A 2, 2 ) be two posets. The lexicographic ordering on A B is defined as: (a 1, b 1 ) (a 2, b 2 ) if either a 1 1 a 2 or a 1 = a 2 and b 1 2 b 2 Lexicographic ordering for strings on a poset (A, ) Let u = a 1 a 2 a 3 a m, and v = b 1 b 2 b 3 b n u v if either a 1 b 1 or a 1 = b 1 and a 2 b 2 or a 1 a 2 = b 1 b 2 and a 3 b 3... or a 1 a 2 a m = b 1 b 2 b m and m < n 14
Let (A, ) be a poset. An element a A is minimal if there is no element b A such that b a. An element a A is a smallest element if a b for all b in A. An element a A is maximal if there is no element b A such that a b. An element a A is a greatest element if b a for all b in A. 15
Let (A, ) be a poset, and B A An element a A is an upper bound B, if b a for all b B. of An element a A is a least upper bound of B, if a b for all other upper bounds b of B. An element a A of a poset is a lower bound of B, if a b for all b B. An element a A of a poset is a greatest lower bound of B, if b a for all other lower bounds b of B. Some posets don t have any minimal element, some can have more than one. Some posets don t have any maximal element, some can have more than one. 16
Minimal elements:? Maximal elements:? Upper bounds of {C238, C249}:? Least upper bound of {C238, C249}:? Lower bounds of {C335, C352, C326}:? Greatest lower bound of {C335, C352, C326}:? The set {C239, C249} does not have the least upper bound. C229 is the least upper bound of {C228, C248} C326 C346 C353 C354 C352 C335 C229 C239 C249 C228 C238 C248 17
Lattices A lattice is a partially ordered set in which every pair of elements have both a least upper bound and a greatest lower bound. Lattice of partitions of {1, 2, 3, 4} ordered by refines. Lattice of subsets of {x, y, z} ordered by. 18
Lattice of integers ordered by Lattice of integer divisors of 60 ordered by divides. ordered by. 19
PO s that are not lattices 20