Chapter 6. Order Relations and Structure Weiqi Luo (骆伟祺) School of Software Sun Yat-Sen University Email:weiqi.luo@yahoo.com Office:A309 Chapter six: Order Relations and Structures 6.1. Partially Ordered Sets 6.2. Extremal Elements of Partially Ordered Sets 6.3. Lattices 6.4. Finite Boolean Algebras 6.5. Functions on Boolean Algebras 6.6. Circuit Design 2 School of Software 6.1 Partially Ordered Sets Partial Order A relation R on a set A is called a partial order if R is reflexive, antisymmetric and transitive. The set A together with the partial order R is called a partially ordered set, or simply a poset, denoted by (A, R) For instance, 1.Let A be a collection of subsets of a set S. The relation ⊆ of set inclusion is a partial order on A, so (A, ⊆) is a poset. 2.Let Z+ be the set of positive integers. The usual relation ≤ is a partial order on Z+, as is “≥” 3 School of Software 6.1 Partially Ordered Sets Example 6 Let R be a partial order on a set A, and let R-1 be the inverse relation of R. Then R-1 is also a partial order. Proof: (a) Reflexive Δ⊆R Δ=Δ-1 ⊆ R-1 (b) Antisymmetric R ∩ R-1 ⊆ Δ R-1 ∩ R ⊆ Δ (c) Transitive R2 ⊆ R (R-1)2 ⊆ R-1 Thus, R-1 is also a partial order. The poset (A, R-1) is called the dual of the poset (A, R). whenever (A, ≤) is a poset, we use “≥” for the partial order ≤-1 4 School of Software 6.1 Partially Ordered Sets Comparable If (A, ≤) is a poset, elements a and b of A are comparable if a ≤ b or b ≤ a In some poset, e.g. the relation of divisibility (a R b iff a | b), some pairs of elements are not comparable 2 | 7 and 7 | 2 Note: if every pair of elements in a poset A is comparable, we say that A is linear ordered set, and the partial order is called a linear order. We also say that A is a chain. 5 School of Software 6.1 Partially Ordered Sets Theorem 1 If (A, ≤ ) and (B, ≤ ) are posets, then (A×B, ≤) is a poset, with partial order ≤ defined by (a, b) ≤ (a’, b’) if a ≤ a’ in A and b≤b’ in B Note: the ≤ is used to denote three different partial orders. Proof: (a) Reflexive support (a, b) in A×B, then (a, b) ≤ (a, b) since a ≤ a in A and b ≤ b in B ((A, ≤) and (B, ≤) are posets) 6 School of Software 6.1 Partially Ordered Sets (b) Antisymmetry support (a, b) ≤ (a’, b’) and (a’, b’) ≤ (a, b), then a ≤ a’ and a’ ≤ a in A ; b ≤ b’ and b’ ≤ b in B since A and B are posets, a=a’, b=b’ (antisymmetry property in A and B, respectively), which means that (a, b)=(a’, b’) and thus ≤ satisfies the antisymmetry property in A×B (c) Transitive support (a, b) ≤ (a’, b’) and (a’, b’) ≤ (a’’, b’’), then a ≤ a’ and a’ ≤ a’’ in A ; b ≤ b’ and b’ ≤ b’’ in B , since A and B are posets, a ≤ a’’ and b ≤ b’’ (transitive property in A and B, respectively), which means that (a, b) ≤ (a’’, b’’) 7 School of Software 6.1 Partially Ordered Sets Product partial order The partial order ≤ defined on the Cartesian product A× B is called the Product partial order The symbol < If (A, ≤ ) is a poset, we say a<b if a ≤ b but a ≠ b Lexicographic (dictionary) order Another useful partial order on A×B, denoted by ≺, is defined as (a, b) ≺ (a’, b’) if a<a’ or a=a’ and b ≤ b’ why ≺ is a partial order? 8 School of Software 6.1 Partially Ordered Sets Example 8 Let A=R, with the usual order ≤. Then the plane R2=R×R may be given lexicographic order P1=(x1,y1) p3 P2=(x2,y2) p2 P1 ≺ P2 P1 ≺ P3 p1 P2 ≺ P3 P3=(x2,y3) (x1 ≤ x2, x1 ≠x2) (x2=x2, y2 ≤ y3) x x=x1 x=x2 9 School of Software 6.1 Partially Ordered Sets Lexicographic ordering is easily extended to Cartesian products A1×A2 …×An as follows: (a1, a2, …, an) ≺ (a’1, a’2, …, a’n) if and only if a1 < a’1 or a1 = a’1and a2 < a’2 or a1 = a’1and a2 = a’2 and a3 < a’3 or … a1 = a’1and a2 = a’2 … , an-1 = a’n-1, an ≤ a’n Why? 10 School of Software 6.1 Partially Ordered Sets Theorem 2 The digraph of a partial order has no cycle of length larger than 1 Proof: support that the digraph of the partial order ≤ on the set A contains a cycle of length n>=2. Then there exist distinct elements a1,a2,…,an in A such that a1 ≤a2, a2 ≤a3,…, an-1 ≤an, an ≤a1 by the transitivity of the partial order, used n-1 times, a1 ≤an by antisymmetry, an ≤a1and a1 ≤an then a1=an (Contradiction) 11 School of Software 6.1 Partially Ordered Sets Hasse Diagrams Just a reduced version of the diagram of the partial order of the poset. a) Reflexive Every vertex has a cycle of length 1 (delete all cycles) 12 School of Software 6.1 Partially Ordered Sets Transitive a ≤ b, and b ≤c, then a ≤c (delete the edge from a to c) c c c b b b a a a Vertex dot 13 Remove arrow (all edges pointing upward) School of Software 6.1 Partially Ordered Sets Example 11 Let A={1,2,3,4,12}. Consider the partial order of divisibility on A. Draw the corresponding Hasse diagram. 12 12 4 4 3 3 2 2 1 1 14 School of Software 6.1 Partially Ordered Sets Example 12 Let S={a,b,c} and A=P(S). Draw the Hasse diagram of the poset A with the partial order ⊆ {a,b,c} {b,c} {a,b} {a,c} {c} {b} {a} ф 15 School of Software 6.1 Partially Ordered Sets The Hasse diagram of a finite linearly order set Let A={a1,a2,…,an} be a finite set, and ai ≤aj if i ≤j an an-1 a2 a1 16 School of Software 6.1 Partially Ordered Sets Example 13 Fig. a shows the Hasse diagram of a poset (A, ≤), where A={a, b, c, d, e, f} Fig. b shows the Hasse diagram of the dual poset (A, ≥) a f d e a b b d c c e f 17 School of Software 6.1 Partially Ordered Sets Topological Sorting If A is a poset with partial order ≤, we sometimes need to find a linear order ≺ for the set A that will merely be an extension of the given partial order in the sense that if a ≤ b, then a ≺b. The process of constructing a linear order such as ≺ is called topological sorting. (refer to p.229 for the details of the algorithm) 18 School of Software 6.1 Partially Ordered Sets Example 14 Give a topological sorting for the poset whose Hasse diagram as follows f e g b d c a f f f g e g e d c d b e c g b b a c a d 19 Usually, the topological sorting is not unique. a School of Software 6.1 Partially Ordered Sets Isomorphism Let (A, ≤) and (A’, ≤’) be posets and let f: AA’ be a one to one correspondence between A and A’. The function f is called an isomorphism from (A, ≤) to (A’, ≤’) if, for any a and b in A, a ≤ b if and only if f(a) ≤’ f(b) If f: AA’ is an isomorphism, we say that (A, ≤ ) and (A’, ≤’) are isomorphic posets. 20 School of Software 6.1 Partially Ordered Sets Example 15 Let A be the set Z+ of positive integers, and let ≤ be the usual partial order on A. Let A’ be the set of positive even integers, and let ≤’ be the usual partial order on A’. The function f: AA’ given by f(a) = 2 a is an isomorphism form (A, ≤) to (A’, ≤’) Proof: First, it is very to show that f is one to one, everywhere defined and onto (one to one correspondence). Finally, if a and b are elements of A, then it is clear that a ≤ b if and only if 2a ≤’ 2b. Thus f is an isomorphism. 21 School of Software 6.1 Partially Ordered Sets Theorem 3 Suppose that f : AA’ is an isomorphism from a poset (A, ≤) to a poset (A’, ≤’). Suppose also that B is a subset of A, and B’=f(B) is the corresponding subset of A’. The following principle must hold. If the elements of B have any property relating to one another or to other elements of A, and if this property can be defined entirely in terms of the relation ≤, then the elements of B’ must possess exactly the same property, defined in terms of ≤’. 22 School of Software 6.1 Partially Ordered Sets Example 16 Let (A, ≤ ) be the poset whose Hasse diagram is shown below, and suppose that f is an isomorphism from (A, ≤) to some other poset (A’, ≤’). Note d ≤ x for any x in A, then the corresponding element f(d) in A’ must satisfy the property f(d) ≤y for all y in A’. b a c As another example, a ≤ b and b ≤ a. Such a pair is called incomparable in A, then f(a) and f(b) are also incomparable in A’ d 23 School of Software 6.1 Partially Ordered Sets Let (A, ≤ ) and (A’, ≤ ’) be finite posets, let f: AA’ be a one-to-one correspondence, and let H be any Hasse diagram of (A, ≤ ). Then If f is an isomorphism and each label a of H is replaced by f(a), then H will become a Hasse diagram for (A, ≤ ’) Conversely If H becomes a Hasse diagram for (A’, ≤ ’), whenever each label a is replaced by f(a), then f is an isomorphism. Two finite isomorphic posets have the same Hasse diagrams 24 School of Software 6.1 Partially Ordered Sets Example 17 Let A={1,2,3,6} and let ≤ be the relation | . Let A’= {ф, {a}, {b}, {a, b}} and let ≤’ be set containment, ⊆. If f(1)= ф, f(2)={a}, f(3)={b}, f(6)={a, b}, then f is an isomorphism. They have the same Hasse diagrams. 6 {a, b} 2 3 {a} {b} ф 1 25 School of Software 6.1 Partially Ordered Sets Homework Ex. 2, Ex. 14, Ex. 16, Ex. 18, Ex. 19 , Ex. 30, Ex. 32 26 School of Software 6.2 Extremal Elements of Partially Ordered Sets Consider a poset (A, ≤ ) Maximal Element An element a in A is called a maximal element of A if there is no element c in A such that a<c. Minimal Element An element b in A is called a minimal element of A if there is no element c in A such that c<b. an element a in A is a maximal (minimal) element of (A, ≥ ) if and only if a is a minimal (maximal) element of (A, ≤ ) 27 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 1 Find the maximal and minimal elements in the following Hasse diagram a3 a1 Maximal elements a2 b1 Note: a1, a2, a3 are incomparable b1, b2, b3 are incomparable b2 Minimal element b3 28 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 2 Let A be the poset of nonnegative real number with the usual partial order ≤ . Then 0 is a minimal element of A. There are no maximal elements of A Example 3 The poset Z with the usual partial order ≤ has no maximal elements and has no minimal elements 29 School of Software 6.2 Extremal Elements of Partially Ordered Sets Theorem 1 Let A be a finite nonempty poset with partial order ≤. Then A has at least one maximal element and at least one minimal element. Proof: Let a be any element of A. If a is not maximal, we can find an element a1 in A such that a<a1. If a1 is not maximal, we can find an element a2 in A such that a1<a2. This argument can not be continued indefinitely, since A is a finite set. Thus we eventually obtain the finite chain a <a1<a2<…<ak-1<ak which cannot be extended. Hence we cannot have ak < b for any b in A, so Ak is a maximal element of (A, ≤). 30 School of Software 6.2 Extremal Elements of Partially Ordered Sets Algorithm For finding a topological sorting of a finite poset (A ≤). Step 1: Choose a minimal element a of A Step 2: Make a the next entry of SORT and replace A with A-{a} Step 3: Repeat step 1 and 2 until A={ }. 31 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 4 b a a a b a c c d b a c e e SORT: b d e c 32 b a School of Software 6.2 Extremal Elements of Partially Ordered Sets Greatest element An element a in A is called a greatest element of A if x ≤ a for all x in A. Least element An element a in A is called a least element of A if a ≤ x for all x in A. Note: an element a of (A, ≤ ) is a greatest (or least) element if and only if it is a least (or greatest) element of (A, ≥ ) 33 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 5 Let A be the poset of nonnegative real number with the usual partial order ≤ . Then 0 is a least element of A. There are no greatest elements of A Example 7 The poset Z with usual partial order has neither a least nor a greatest element. 34 School of Software 6.2 Extremal Elements of Partially Ordered Sets Theorem 2 A poset has at most one greatest element and at most one least element. Proof: Support that a and b are greatest elements of a poset A. since b is a greatest element, we have a ≤ b; since a is a greatest element, we have b ≤ a; thus a=b by the antisymmetry property. so, if a poset has a greatest element, it only has one such element. This is true for all posets, the dual poset (A, ≥) has at most one greatest element, so (A, ≤) also has at most one least element. 35 School of Software 6.2 Extremal Elements of Partially Ordered Sets Unit element The greatest element of a poset, if it exists, is denoted by I and is often called the unit element. Zero element The least element of a poset, if it exists, is denoted by 0 and is often called the zero element. Q: does unit/zero element exist for a finite nonempty poset? 36 School of Software 6.2 Extremal Elements of Partially Ordered Sets Consider a poset A and a subset B of A Upper bound An element a in A is called an upper bound of B if b ≤ a for all b in B Lower bound An element a in A is called a lower bound of B if a ≤ b for all b in B 37 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 8 Find all upper and lower bounds of the following subset of A: (a) B1={a, b}; B2={c, d, e} h f g d e c a B1 has no lower bounds; The upper bounds of B1 are c, d, e, f, g and h The lower bounds of B2 are c, a and b The upper bounds of B2 are f, g and h b 38 School of Software 6.2 Extremal Elements of Partially Ordered Sets Let A be a poset and B a subset of A, Least upper bound An element a in A is called a least upper bound of B, denoted by (LUB(B)), if a is an upper bound of B and a ≤a’, whenever a’ is an upper bound of B. Greatest lower bound An element a in A is called a greatest lower bound of B, denoted by (GLB(B)), if a is a lower bound of B and a’ ≤ a, whenever a’ is a lower bound of B. 39 School of Software 6.2 Extremal Elements of Partially Ordered Sets Some properties of dual of poset The upper bounds in (A, ≤ ) correspond to lower bounds in (A, ≥) (for the same set of elements) The lower bounds in (A, ≤ ) correspond to upper bounds in (A, ≥) (for the same set of elements) Similar statements hold for greatest lower bounds and least upper bounds. 40 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 9 Find all least upper bounds and all greatest lower bounds of (a) B1={a, b} (b) B2={c, d, e} h f g d e c a (a) Since B1 has no lower bounds, it has no greatest lower bounds; However, LUB(B1)=c (b)Since the lower bounds of B2 are c, a and b, we find that GLB(B2)=c The upper bounds of B2 are f, g and h. Since f and g are not comparable, we conclude that B2 has no least upper bound. b 41 School of Software 6.2 Extremal Elements of Partially Ordered Sets Theorem 3 Let (A, ≤) be a poset. Then a subset B of A has at most one LUB and at most one GLB Please refer to the proof of Theorem 2. 42 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 10 Let A={1,2,3,…,11} be the poset whose Hasse diagram is shown below. Find the LUB and GLB of B={6,7,10}, if they exist. 11 The upper bounds of B are 10, 11, and LUB(B) is 10 (the first vertex that can be Reached from {6,7,10} by upward paths ) 10 9 5 8 7 6 3 The lower bounds of B are 1,4, and GLB(B) is 4 (the first vertex that can be Reached from {6,7,10} by downward paths ) 4 2 1 43 School of Software 6.2 Extremal Elements of Partially Ordered Sets Theorem 4 Suppose that (A, ≤) and (A, ≤’) are isomorphic posets under the isomorphic f: AA’ 1. If a is a maximal (minimal) element of (A, ≤), then f(a) is a maximal (minimal) element of (A’, ≤’) 2. If a is the greatest (least) element of (A, ≤), then f(a) is the greatest (least) element of (A’,≤’) 3. If a is an upper (lower, least upper, greatest lower) bound of a subset B of A, then f(a) is an upper (lower, least upper, greatest lower) bound for subset f(B) of A’ 4. If every subset of (A, ≤) has a LUB (GLB), then every subset of (A’, ≤’) has a LUB (GLB) 44 School of Software 6.2 Extremal Elements of Partially Ordered Sets Example 11 Show that the posets (A, ≤) and (A’, ≤’), whose Hasse diagrams are shown below are not isomorphic. a b a’ c b’ c’ (A, ≤) has a greatest element a, while (A’, ≤’) does not have a greatest element 45 School of Software 6.2 Extremal Elements of Partially Ordered Sets Homework Ex. 2, Ex. 18, Ex. 22, Ex. 28, Ex. 34, Ex. 37 46 School of Software 6.3 Lattices Lattice A lattice is a poset (L, ≤) in which every subset {a, b} consisting of two elements has a least upper bound and a greatest lower bound. we denote LUB({a, b}) by a∨ b (the join of a and b) GLB({a, b}) by a ∧b (the meet of a and b) 47 School of Software 6.3 Lattices Example 1 Let S be a set and let L=P(S). As we have seen, ⊆, containment, is a partial order on L. Let A and B belong to the poset (L, ⊆). Then a∨ b =A U B & a ∧b = A ∩ B Why? Assuming C is a upper bound of {a, b}, then A ⊆ C and B ⊆ C thus A U B ⊆ C Assuming C is a lower bound of {a, b}, then C ⊆ A and C ⊆ B thus C ⊆ A ∩ B 48 School of Software 6.3 Lattices Example 2 Consider the poset (Z+, ≤), where for a and b in Z+, a ≤ b if and only if a | b , then a∨b = LCM(a,b) a∧b = GCD(a,b) LCM: least common multiple GCD: greatest common divisor 49 School of Software 6.3 Lattices Example 3 Let n be a positive integer and Dn be the set of all positive divisors of n. Then Dn is a lattice under the relation of divisibility. For instance, D20= {1,2,4,5,10,20} D30= {1,2,3,5,6,10,15,20} 30 20 4 10 2 5 6 10 15 2 3 5 1 1 50 School of Software 6.3 Lattices Example 4 Which of the Hasse diagrams represent lattices? f g e d d e c e c c b d d b c d b b a a b f c a a a a d e b c d b c a a 51 School of Software 6.3 Lattices Example 6 Let S be a set and L =P(S). Then (L, ⊆ ) is a lattice, and its dual lattice is (L, ⊇), where “⊆” is “contained in”, and “⊇” is “contains”. Then, in the poset (L, ⊇ ) join: A∨B=A∩B , meet: A∧B=A∪B. 52 School of Software 6.3 Lattices Theorem 1 If (L1, ≤ ) and (L2, ≤ ) are lattices, then (L, ≤ ) is a lattices, where L= L1 ×L2, and the partial order ≤ of L is the product partial order. Proof: we denote the join and meet in is L1by ∨1 and ∧1 the join and meet in is L2by ∨2 and ∧2 We know that L is a poset (Theorem 1 in p.219) for (a1,b1) and (a2,b2) in L. then (a1,b1) ∨ (a2,b2) = (a1 ∨1 a2, b1 ∨2 b2 ) in L (a1,b1) ∧ (a2,b2) = (a1 ∧1 a2, b1 ∧2 b2 ) in L 53 School of Software 6.3 Lattices Example 7 (I1 , I2) (I1 ,a) I1 I2 × 01 L1 (01 ,I2) = b a 02 (01 ,a) (I1 ,02 ) (01 ,02 ) L1×L2 L2 54 School of Software (I1 ,b) (01 ,b ) 6.3 Lattices Sublattice Let (L, ≤) be a lattice. A nonempty subset S of L is called a sublattice of L if a ∨ b in S and a ∧ b in S whenever a and b in S For instance Example 3 is one of sublattices of Example 2 55 School of Software 6.3 Lattices Example 9 I I e c f a I e b f a 0 b e c f a sublattice Not a lattice a b a c b 0 0 a lattice, not a Sublattice 56 School of Software 6.3 Lattices Isomorphic Lattices If f: L1L2 is an isomorphism form the poset (L1, ≤1 ) to the poset (L2, ≤ 2) , then L1 is a lattice if and only if L2 is a lattice. In fact, if a and b are elements of L1, then f(a ∨ b)= f(a) ∨ f(b) & f (a ∧ b)=f(a) ∧ f(b). If two lattices are isomorphic, as posets, we say they are isomorphic lattices. 57 School of Software 6.3 Lattices Example 10 (P.225 Ex.17) Let A={1,2,3,6} and let ≤ be the relation | . Let A’= {ф, {a}, {b}, {a, b}} and let ≤’ be set containment, ⊆. If f(1)= ф, f(2)={a}, f(3)={b}, f(6)={a, b}, then f is an isomorphism. They have the same Hasse diagrams. 6 {a, b} 2 3 {a} {b} ф 1 58 School of Software 6.3 Lattices a ∨ b (LUB{a, b}) 1. a ≤ a∨b and b ≤ a∨b; a∨b is an upper bound of a and b 2. If a ≤ c and b ≤ c, then a∨ b ≤ c ; a∨ b is the least upper bound of a and b a ∧ b (GLB{a, b}) 3. a∧b ≤ a and a ∧ b ≤ b; a ∧ b is a lower bound of a and b 4. If c≤ a and c ≤ b, then c≤ a ∧ b ; a ∧ b is the greatest lower bound of a and b 59 School of Software 6.3 Lattices Theorem 2 Let L be a lattice. Then for every a and b in L (a) a ∨ b =b if and only if a ≤ b (b) a ∧ b =a if and only if a ≤ b (c) a ∧ b =a if and only if a∨ b =b Proof: (a) if a∨b =b, since a≤ a∨b, thus a ≤ b if a ≤ b, since b ≤ b , thus b is a upper bound of a and b, by definition of least upper bound we have a∨b ≤ b. since a∨b is an upper bound of a and b, b ≤ a∨b, so a∨b =b (b) Similar to (a); (c) the proof follows from (a) & (b) 60 School of Software 6.3 Lattices Example 12 Let L be a linearly ordered set. If a and b in L, then either a ≤ b or b ≤ a. It follows form Theorem 2 that L is a lattice, since every pair of elements has a least upper bound and a greatest lower bound. 61 School of Software 6.3 Lattices Theorem 3 Let L be a lattice. Then 1. Idempotent properties: a∨a =a ; a∧a =a 2. Commutative properties: a∨b= b∨a; a∧b = b∧a 3. Associative properties: (a) (a∨b)∨c= a∨(b∨c ) (b) (a∧b) ∧c= a∧(b∧c) 4. Absorption properties: (a) a ∨ (a ∧b) =a (b) a ∧ (a ∨ b) =a 62 School of Software 6.3 Lattices Proof: 3. (a) (a∨b)∨c= a∨(b∨c) a≤ a∨(b∨c) & b∨c≤ a∨(b∨c) b≤ b∨c & c ≤ b∨c (definition of LUB) b≤ b∨c & c ≤ b∨c & b∨c≤ a∨(b∨c) b≤ a∨(b∨c) & c ≤ a∨(b∨c) (transitivity) a≤ a∨(b∨c) & b≤ a∨(b∨c) a∨(b∨c) is a upper of a and b then we have a∨b ≤ a∨(b∨c) (why?) a∨b ≤ a∨(b∨c) & c ≤ a∨(b∨c) a∨(b∨c) is a upper of a∨b and c then we have (a∨b)∨c ≤ a∨(b∨c) Similarly, a∨(b∨c) ≤ (a∨b)∨c Therefore (a∨b)∨c = a∨(b∨c) (why?) 63 School of Software 6.3 Lattices (a ∨ b) ∨c = a ∨ (b ∨c) = a ∨ b ∨c (a∧ b)∧ c = a ∧ (b ∧ c) = a ∧ b ∧ c LUB({a1,a2,…,an})= a1 ∨ a2 ∨ … ∨ an GLB({a1,a2,…,an}) =a1 ∧ a2 ∧ … ∧ an 64 School of Software 6.3 Lattices Theorem 4 Let L be a lattice. Then, for every a, b and c in L 1. If a ≤ b, then (a) a ∨ c ≤ b ∨c (b) a ∧c ≤ b ∧ c 2. a ≤ c and b ≤ c if and only if a ∨ b ≤ c 3. c ≤ a and c ≤ b if and only if c ≤ a ∧b 4. If a ≤b and c ≤d, then (a) a∨c ≤ b∨d (b) a ∧ c ≤ b∧d 65 School of Software 6.3 Lattices Proof 1. (a) If a ≤ b, then a ∨ c ≤ b ∨c c ≤ b ∨c ; b≤ b ∨c (definition of LUB) a ≤ b ; b≤ b ∨c a≤ b ∨c (transitivity) therefore, b ∨c is a upper bound of a and c , which means a ∨ c ≤ b ∨c (why? ) The proofs for others left as exercises. 66 School of Software 6.3 Lattices Bounded A lattice L is said to be bounded if it has a greatest element I and a least element 0 For instance: Example 15: The lattice P(S) of all subsets of a set S, with the relation containment is bounded. The greatest element is S and the least element is empty set. Example 13: The lattice Z+ under the partial order of divisibility is not bounded, since it has a least element 1, but no greatest element. 67 School of Software 6.3 Lattices If L is a bounded lattice, then for all a in A 0 ≤ a ≤ I a ∨ 0 = a, a∨I=I a∧0=0, a∧I=a Note: I (0) and a are comparable, for all a in A. 68 School of Software 6.3 Lattices Theorem 5 Let L={a1,a2,…,an} be a finite lattice. Then L is bounded. Proof: The greatest element of L is a1 ∨ a2 ∨ … ∨ an, and the least element of L is a1 ∧ a2 ∧ … ∧ an 69 School of Software 6.3 Lattices Distributive A lattice L is called distributive if for any elements a, b and c in L we have the following distributive properties: 1. a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) 2. a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c) If L is not distributive, we say that L is nondistributive. Note: the distributive property holds when a. any two of the elements a, b and c are equal or b. when any one of the elements is 0 or I. 70 School of Software 6.3 Lattices Example 16 For a set S, the lattice P(S) is distributive, since union and intersection each satisfy the distributive property. Example 17 The lattice whose Hasse diagram shown as follows is I distributive. b d a c 0 71 School of Software 6.3 Lattices Example 18 Show that the lattices as follows are nondistributive. I I a a c b c b 0 0 a∧( b ∨ c) = a ∧ I = a (a∧ b)∨(a ∧ c) = b ∨ 0 = b a∧( b ∨ c) = a ∧ I = a (a∧ b)∨(a ∧ c) = 0 ∨ 0 = 0 72 School of Software 6.3 Lattices Theorem 6 A lattice L is nondistributive if and only if it contains a sublattice that is isomorphic to one of the lattices whose Hasse diagrams are as show. I I a a c b c b 0 0 73 School of Software 6.3 Lattices Complement Let L be bounded lattice with greatest element I and least element 0, and let a in L. An element a’ in L is called a complement of a if a ∨ a’ = I and a ∧ a’ =0 Note that 0’=I and I’=0 74 School of Software 6.3 Lattices Example 19 The lattice L=P(S) is such that every element has a complement, since if A in L, then its set complement A has the properties A ∨ A = S and A ∧ A=ф. That is, the set complement is also the complement in L. Example 20 I I a a c b c b 0 0 75 School of Software 6.3 Lattices Example 21 20 30 4 10 6 10 15 2 5 2 3 5 1 1 D20 D30 76 School of Software 6.3 Lattices Theorem 7 Let L be a bounded distributive lattice. If a complement exists, it is unique. Proof: Let a’ and a’’ be complements of the element a in L, then a ∨ a’ = I, a ∨ a’’= I ; a ∧ a’ = 0, a ∧ a’’ =0 using the distributive laws, we obtain a’= a’ ∨ 0 = a’ ∨(a ∧ a’’ ) = (a’ ∨ a) ∧ (a’ ∨ a’’) = I ∧ (a’ ∨ a’’) = a’ ∨ a’’ Also a’’= a’’ ∨ 0 = a’’ ∨(a ∧ a’ ) = (a’’ ∨ a) ∧ (a’’ ∨ a’) = I ∧ (a’ ∨ a’’) = a’ ∨ a’’ Hence a’=a’’ 77 School of Software 6.3 Lattices Complemented A lattice L is called complemented if it is bounded and if every element in L has a complement. 78 School of Software 6.3 Lattices Example 22 The lattice L=P(S) is complemented. Observe that in this case each element of L has a unique complement, which can be seen directly or is implied by Theorem 7. Example 23 I I a a c b c b 0 0 79 School of Software 6.3 Lattices Homework Ex. 6, Ex. 7, Ex. 12, Ex. 19, Ex. 24, Ex. 32, Ex. 40 80 School of Software 6.4 Finite Boolean Algebras Theorem 1 If S1={x1,x2,…,xn} and S2={y1,y2,…,yn} are any two finite sets with n elements, then the lattices (P(S1), ⊆) and (P(S2), ⊆) are isomorphic. Consequently, the Hasse diagrams of these lattices may be drawn identically. Arrange the elements in S1 and S2 A S1: x1 x2 x3 … xn S1: x1 x2 x3 … xn f(A) S2: y1 y2 y3 … yn S2: y1 y2 y3 … yn 81 School of Software 6.4 Finite Boolean Algebras Example 1: S={a, b, c} and T={2,3,5}. Consider the Hasse diagrams of the two lattices (P(S), ⊆) and (P(T), ⊆). {a,b,c} {a,b} {2,3,5} {b,c} {2,3} {3,5} {a,c} {2,5} {b} {a} {3} {c} {2} ф {5} ф Note : the lattice depends only on the number of elements in set, not on the elements. 82 School of Software 6.4 Finite Boolean Algebras Label the subsets Let a set S={a1,a2,…,an}, then P(S) has 2n subsets. We label subsets by sequences of 0’s and 1’s of length n. For instance, {a1,a2} 1 1 0 0 …0 {a1,an } 1 0 0 0 …1 ф 0 0 0 0 …0 {a1,a2,…,an} 1 1 1 1 …1 … 83 School of Software 6.4 Finite Boolean Algebras Get the{2,3,5} unique Hasse Diagram {2,3} {2,5} {3} {2} {3,5} 111 110 {5} 011 101 ф {a,b,c} 010 {a,b} {a,c} 100 {b,c} 001 000 {b} {a} {c} ф 84 School of Software 6.4 Finite Boolean Algebras Lattice Bn If the Hasse diagram of the lattice corresponding to a set with n elements is labeled by sequences of 0’s and 1’s of length n, the resulting lattice is named Bn. The properties of the partial order on Bn can be described directly as follows. If x=a1a2…an and y=b1b2…bn are two element of Bn, then 1. x ≤ y iff ak ≤ bk (as numbers 0 or 1) for k=1,2,…,n 2. x ∧ y=c1c2…cn, where ck= min{ak,bk} 3. x ∨ y=c1c2…cn, where ck= max{ak,bk} 4. x has a complement x’=z1z2…zn, where zk=1 if xk=0 and zk=0 if xk=1 85 School of Software 6.4 Finite Boolean Algebras Boolean algebra A finite lattice is called a Boolean algebra if it is isomorphic with Bn for some nonnegative integer n. 111 |Bn| =2n 11 1 110 011 101 01 10 010 100 0 n=0 n=1 001 00 000 n=2 86 n=3 School of Software 6.4 Finite Boolean Algebras (P(S), ⊆) Each x and y in Bn correspond to subsets A and B of S. Then x ≤ y, x ∧ y, x ∨ y and x’ correspond to A ⊆ B, A ∩ B, A U B and A. Therefore, (P(S), ⊆) is isomorphic with Bn, where n=|S| Example 3 Consider the lattice D6 consisting of all positive integer divisors of 6 under the partial order of divisibility. 6 11 10 2 3 1 87 D6 is a Boolean algebras 01 00 School of Software 6.4 Finite Boolean Algebras Example 4 Consider the lattices D20 and D30 of all positive integer divisors of 20 and 30, respectively. 20 30 D20 is not a Boolean algebra (why? 6 is not 2n ) 4 10 6 10 15 2 5 2 3 5 D30 is a Boolean algebra, D30 B3 88 School of Software 1 1 6.4 Finite Boolean Algebras Theorem 2 Let n=p1p2…pk, where the pi are distinct primes. The Dn is a Boolean algebra. Proof: Let S={p1 , p2 , … , pk}. If T ⊆ S and aT is the product of the primes in T, then aT | n. Any divisor of n must be of the form aT for some subset T of S (let aф=1) . If V and T are subsets of S, V ⊆T if and only if aV | aT aV ∩ T = aV ∧ aT = GCD(aV,aT) & aV U T= aV ∨ aT = LCM(aV,aT) Thus, the function f: P(S) Dn given by f(T)=aT is a isomorphism form P(S) to Dn. Since P(S) is a Boolean algebra, so is Dn. 89 School of Software 6.4 Finite Boolean Algebras Example Let S={2,3,5}, show the Hasse diagrams of (P(S), ⊆) and D30 as follows. 2×3×5=30 {2,3,5} {2,3} {2} {2,5} {3,5} {3} {5} 30 3×5=15 ф 6 10 15 2 3 5 1 90 School of Software 6.4 Finite Boolean Algebras Example 5 Since 210=2×3×5×7, 66=2×3×11 and 646=2×17×19, then D210, D66 D646 are all Boolean algebras. Example 9 Since 40=23×5, and 75=3×52, neither D40 and D75 are Boolean algebras. Note: If n is positive integer and p2 | n, where p is a prime number, then Dn is not a Boolean algebra. 91 School of Software 6.4 Finite Boolean Algebras Theorem 3 (Substitution rule for Boolean algebra) Any formula involving U or ∩ that holds for arbitrary subsets of a set S will continue to hold for arbitrary elements of a Boolean algebra L if is ∧ substituted for ∩ and ∨ for U. Example 6 If L is any Boolean algebra and x,y and z are in L, then the following three properties hold. 1. (x’)’=x 2. (x∧y)’ = x’ ∨ y’ 3. (x∨y)’ = x’ ∧ y’ This is true by theorem 3, 1. (A)=A 2. (A∩B) =A U B 3. (A U B ) = A ∩ B hold for arbitrary subsets A and B of a set S. More properties can be found in p. 247, 1 ~12 92 School of Software 6.4 Finite Boolean Algebras Example 7 Show the lattice whose Hasse diagram shown below is not a Boolean algebra. I a and e are both complements of c a f e However, based on the 11. Every element x has a unique complement x’ Every element A has a unique complement x d b c Theorem 3 (e.g. properties 1~14) is usually used to show that a lattice L is not a Boolean algebra. 0 93 School of Software 6.4 Finite Boolean Algebras Denote the Boolean algebra B1 simply as B. Thus B contains only the two elements 0 and 1. It is a fact that any of the Boolean algebras Bn can be described in terms of B. The following theorem gives this description. Theorem 4 For any n>=1, Bn is the product B×B×…×B of B, n factors, where B×B×…×B is given the product partial order. 94 School of Software 6.4 Finite Boolean Algebras Homework Ex. 6, Ex. 10, Ex. 12, Ex. 20, Ex. 24, Ex. 26, Ex. 29 95 School of Software