Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing Fundamentals 2 Lecture 4 Lattice Theory

Similar presentations


Presentation on theme: "Computing Fundamentals 2 Lecture 4 Lattice Theory"— Presentation transcript:

1 Computing Fundamentals 2 Lecture 4 Lattice Theory
Lecturer: Patrick Browne Based on Chapter 11. Introduction to Discrete Mathematics for Software Engineers By Tim Denvir

2 Partial Order (e.g. ) A binary relation  on a set B is called a partial order on B if it is: reflexive, anti-symmetric, and transitive. <B,  > is called a partially ordered set or poset. Example, the vertex set of a directed acyclic graph ordered by reachability. Reachability is a partial order ≤ on vertices, where u ≤ v exactly when there exists a directed path from u to v . A total or linear order is a partial order such that for all a,bA, either aRb or bRa. When everything can be compared to everything else, then you have a total order. When we have a set of things of which some are comparable but others are not, then you have a partial order Examples of partial: divisibility in the integers and inclusion between sets. Each directed acyclic graph gives rise to a partial order ≤ on its vertices, where u ≤ v exactly when there exists a directed path from u to v in the DAG The set of natural numbers equipped with the relation of divisibility. The set of subsets of a given set (its power set) ordered by inclusion.

3 Hasse diagrams Hasse diagrams represent partial orders (reflexive, anti-symmetric, transitive). When reading there is an implied upward orientation e.g. lower < upper. A point is drawn for each element of the poset, and line segments representing relations are drawn between these points according to the following two rules: 1. If x<y in the poset, then the point corresponding to x appears lower in the drawing than the point corresponding to. 2. The line segment between the points corresponding to any two elements x and y of the poset is included in the drawing iff x covers y or y covers x .

4 Hasse diagrams The implicit relations in a Hasse diagram are reflexive and transitive The explicit relations in a Hasse diagram is anti-symmetry. A cover is the transitive reflexive reduction of a partial order.

5 Hasse diagrams An element z of a partially ordered set (X,<=) covers another element x provided that there exists no third element y in the poset for which x <= y <= z. In that case, z is called an upper cover of x and x a lower cover of z. A cover is the transitive reflexive reduction of a partial order.

6 Partial Order for divides | and <
| is the “divides” operator

7 Divides by Relation | is the “divides” operator

8 Order Relation on Power set1.
A partially order set can be represented with using a POSET diagram. The POSET diagram on the right is based on the power set (all possible subsets) of the three element set {a, b, c}. These subsets form a special kind of partial order that is referred to as a lattice From last year: From Charles F. Schmidt , Cognition - Section 1 Arrows are usually implicit and not required. The above figure is the Hasse diagram for the poset ( ({a, b, c}), ). The supremum is given by the union and the infimum by the intersection of subsets (see later for definition of these terms).

9 Hasse diagrams The Hasse diagram below represents information on a set of college computing courses and their prerequisites. The prerequisites form a partial order. Relating the prerequisites (partial order) to the diagram every course is dependent on Comp101, Comp252 covers Comp250, but not Comp201 Comp341 directly depends on Comp251 and Comp252

10 Example: Constructing a Hasse Diagram
Table 1 (next slide) represents information on a set of college courses and their prerequisites. The prerequisites relation is a partial order. We also show a Hasse for the partial ordering of these courses

11 Example: Constructing a Hasse Diagram
Table 1 represents information on a set of college courses and their prerequisites. The prerequisites relation is a partial order, the next slide shows a Hasse for the partial ordering of these courses

12 Example: Constructing a Hasse Diagram

13 An relation on binary digits.
Each source has one less ‘1’ digit than its target.

14 Order relation Integers related to relation on binary digits.
How do binary digits relate to their values? What about the value relation ‘less than’ on integers? From “Belief Revision and ordered theory presentation” by Mark Ryan In P. Dekker and M. Stokhof, editors, Proc. Eighth Amsterdam Colloquium on Logic,

15 All connected Posets on 4 elements

16 Ordered relation “divides by”
Let A = {1,2,3,4,6,9,12,18,24} 24 8 12 18 4 6 9 1 2 3 From Schaum’s Discrete Mathematics. For two natural numbers m and n the divisibility relation (|) can be written n|m if n divides m without remainder. 1 For two natural numbers m and n the divisibility relation (|) can be written n|m if n divides m without remainder. (reads “n divides m." e.g. 2 divides 4)

17 Ordered relation “partial order”
Let B = {a,b,c,d,e}, Relation: db,dc,ec,ba,ca Transitivity and identity not shown. a 1 b c d e

18 Ordered relation “partition order”
A partition of a positive integer m is a set whose sum is m. A partition P1 precedes a partition P2 if the integers in P1 can be added to obtain the partition P2. Let m=5 then we have: 5,3+2,2+2+1, , 4+1, 3+1+1, 5 3+2 4+1 A partition P1 precedes a partition P2 if the integers in P1 can be added to obtain the partition P2. 1 2+2 +1 3+1+1 P2 P1

19 Ordered relation “partition order”
Two element set {p,q} . {p,q} {q} {p} {} 1

20 Hasse diagram summary The subset relation ( ) represent partial order (reflexive, anti- symmetric, transitive <). When reading there is an implied upward orientation e.g. lower < upper. A point is drawn for each element of the poset, and line segments representing relations are drawn between these points according to the following two rules: 1. If x<y in the poset, then the point corresponding to x appears lower in the drawing than the point corresponding to y . 2. The line segment between the points corresponding to any two elements x and y of the poset is included in the drawing iff x covers y or y covers x . Implicit relations reflexive and transitive Explicit relation anti-symmetry.

21 Example relations Transitive; {1}{1,2}{1,2,3} Reflexive: {1}{1}
Cover: A cover is the transitive reflexive reduction of a partial order. An element z (e.g. {1,2}) of a partially ordered set above (X,<=) covers another element x (e.g.{1} and {2}) provided that there exists no third element y in the poset for which x <= y <= z. If we have x <= y <= z., then z is called an upper cover of x and x a lower cover of z. Proper subsets of exactly one other set. {1,2}, {1,3}, {2,3}  {1,2,3}

22 Minimal and Maximal Elements
An element a in S is called a minimal element if no other element of S strictly precedes a (no edge enters a from below). An element b in S is called a maximal element if no other element of S strictly succeeds b (no edge leaves b from above). S can have more that one maximal and more that one minimal element. S may have

23 Maximal & Minimal examples
24 H 8 12 a 18 4 6 9 b c 2 3 d e 1 From Schaum’s Discrete Mathematics by Seymor Lipschutz (Author), Marc Lipson (Author) H, on the left, is a partial because it is reflexive, anti-symmetric, and transitive because of divisibility relation. H has two maximal elements 24, 18 H has one minimal element 1 H has one first element 1 H has no last element because it has two maximal elements neither of which is a last element (they are not comparable). One maximal Two minimal One minimal Two maximal

24 First and Last Elements
An element a in S is a called first (or least) if ax for every element x in S (at bottom of page). An element b in S is a called last (or greatest) if yb for every element y in S (at top of page). S may have neither a first or a last element. S can have at most one first element, which must be minimal. S can have at most one last element, which must be maximal. S is a partially ordered set.

25 First & Last examples 24 8 12 a 18 4 6 9 b c 2 3 d e 1
From Schaum’s Discrete Mathematics. One maximal, which is also last Two minimal, neither a first. One minimal, which is also first Two maximal, neither is a last

26 First, Last, Maximal, Minimal
Hasse diagram on left is ordered by set inclusion. U=Last and Maximal. = First and Minimal From Charles F. Schmidt , Cognition - Section 1 Arrows are usually implicit and not required. The above figure is the Hasse diagram for the poset ( ({a, b, c}), ).

27 Partial order Let D = {1,2,4,5,10,20,25,50,100} x,yD let d(x,y) (meaning x divides y evenly) form partial order x ≤ y. Let S = {10,20,50} where SD Find each of the following: The minimal elements of S. The maximal elements of S. The lower bond of S. The upper bound of S The GLB of S (not covered yet) The LUB of S (not covered yet)

28 Sub set of a partial order
Let D = {1,2,4,5,10,20,25,50,100} Let S = {10,20,50} where SD 100 S 20 50 S  D 4 10 25 2 5 1

29 Recall properties of relations
Reflexive (b| b  b) Irreflexive ( b| (b  b)) Symmetric ( b,c | (b  c)  (c  b)) Antisymmetric (b,c | (b  c)  (c  b)  b=c) Asymmetric (non-symmetric, see notes section) ( b,c | (b  c)  (c  b)) Transitive ( b,c,d | (b  c)  (c  d)  b  d) For this section, we do not need all of these properties. Some authors distinguish Asymmetric and not symmetric. Some say not symmetric means that there is at least one pair of elements that is not symmetric i.e. we have aRb but no bRa

30 Sensible Closures Reflexive Closure r() Symmetric s()
( ⊔ 0) Symmetric s() ( ⊔ -1) Other closures include Transitive closure + Reflexive Transitive closure * Let R = {<a,b>,<c,a>,<c,c> } be a relation on the set A={a,b,c}. The reflexive closure is: r(R) = {a,b>,<c,a>,<a,a>,<b,b>,<c,c>} The symmetric closure is: s(R) = {<a,b>,<c,a>,<c,c>,<b,a>,<a,c>

31 Sample closures Let R = {<a,b>,<c,a>,<c,c> } be a relation on the set A={a,b,c}. The reflexive closure is: r(R) = {<a,b>,<c,a>,<a,a>,<b,b>,<c,c>} The symmetric closure is: s(R) = {<a,b>,<c,a>,<c,c>,<b,a>,<a,c>

32 Equivalence Relations
A relations is an equivalence relation iff it is reflexive, symmetric and transitive (e.g. =). An equivalence relation  on a set B partitions the set into non-empty disjoint subsets. Elements that are equivalent under  are placed in the same partition. Elements that are not equivalent under  are placed in different partitions. For example: b,c ∊ sameEye  b and c have same eye colour

33 Partial Order, Linear Order
A binary relation  on a set B is called a partial order on B if it is reflexive, antisymmetric, and transitive. <B,  > is called a partially ordered set or poset. A linear order is a partial order such that for all a,b∊A, either aRb or bRa. We can choose the type of order that is appropriate to a particular situation For example, we may consider the containment relation as transitive (if a contains b and b contains c, then a contains c) Then we have a partonomy or, more formally, a partially ordered set or poset. Whether this poset is strict or reflexive is largely a matter of suitability Strict PO means a collection is never part of itself.

34 Partial Order, Notation
Finite partially ordered sets can be represented in a diagram where elements of the set are represented by nodes and a line connecting two nodes indicates that the lower of them is related to the upper. Reflexivity and Transitivity are assumed but not shown.

35 Whole-part Order A B C D E F G K L H I J M O N Whole to part relation
Everything is a component of A. What about J? M O N

36

37 Use of lattices A lattice is a partially ordered set in which every two elements have a least upper bound and a greatest lower bound. An example is given by the natural numbers, partially ordered by divisibility, for which the least upper bound is the least common multiple and the greatest lower bound is the greatest common divisor. GCD(8,12) = 4 LCM(4,6) =12 GDC is the largest positive integer that divides the numbers without a remainder. For example, the GCD of 8 and 12 is 4 LCM(a, b), is the smallest positive integer that is divisible by both a and b

38 Use of lattices Lattices can be used for knowledge representation, such as Formal Concept Analysis (FCA), semantic web, class hierarchies (check the web). Lattices are present in specification and programming languages e.g. relating CafeOBJ sorts, CafeOBJ module imports form a partial order1. Assertions about programs have a special relation with each other and form a lattice structure. 1. See page 46 CafeOBJ report We first look at ordered lattices and then algebraic lattice, which is a complete lattice L, where every element of L can be written as a join of compact elements.

39 Specification Mathematics is an appropriate linguistic tool for expressing specifications of algebras, lattices, sets, graphs. Lattices are important both as examples of a kind of algebra, and also used in the study of other kinds of algebra. Each algebra has an associated lattice.

40 Lattice: preliminary definitions
Given a partially ordered set (A,R) and subset SA, then aA is a lower bound of S if: xS.aRx (e.g. xS.a≤x ) Given a partially ordered set (A,R) and subset SA,then bA is an upper bound of S if: xS.xRb (e.g. x  S.x≤b) A,S denote sets and S is smaller than or equal to A. Also, a and b are not necessarily in S, they could be in A (bigger set).

41 What are the upper and lower bounds of S?
g f Lattice A e c b Subset S d a i h k

42 S={a,b,c} Subset S g Upper bound of {a,b,c} f L e c b d a i h k
Lower bound of {a,b,c}

43 Lattice: preliminary definitions
a is called the greatest lower bound (glb) of a set S if a is the greatest of all lower bounds. aRS  lA.lRS  lRa (in general) a≤S  lA.l≤S  l≤a (for example) We write ⊓S for glb of S.

44 Lattice: preliminary definitions
b is called the least upper bound (lub) of S if b is the least of all upper bounds. SRb  uA.SRb  bRu (in general) S≤b  uA.S≤u  b≤u (for example) We write ⊔S for lub of S.

45 Lattice and Algebra LUB is referred to as the Supremum (⊔S).
GLB is referred to as the Infimum (⊓S).

46 Top and Bottom elements
For the lattice of implication (⇒) T a = `Alice stole the tarts!’; k = `The Knave of Hearts stole the tarts!’; n = `No one stole the tarts!’: \/ corresponds to (lub) The lattice A3 generated by these assertions. The bottom element of the lattice is called the logical absurdity. It is always false, and as such, it implies every other statement in the lattice. The three statements a, k, and n are the atoms which cover the bottom. All other logical statements in this space can be generated from joins of these three statements. For example, the statement ‘a or k’ is the statement ‘Either Alice or the Knave stole the tarts!’ The top element T is called the truism, since it is trivially true that ‘Either Alice, the Knave, or nobody stole the tarts!’ The truism is implied by every other statement in the lattice. Since the lattice is Boolean, each element in the lattice has a unique complement (C1, C2). The statement a = ‘Alice stole the tarts!’ has as its complement the statement a not( (k or n) =‘Either the Knave or no one stole the tarts!’ This statement a is equivalent to ‘Alice did not steal the tarts!’ Note that this lattice (Fig. 2) is isomorphic to the lattice of powersets slides 3 and 49 and , therefore Boolean algebra describes the operations on a powerset as well as implication on a set of logical statements.

47 This POSET A itself has no lub, but the subset S={a,b,c} has both a lub & glb.
LUB of {a,b,c} f POSET A L e c b Subset S d a i h k glb GLB of {a,b,c}

48 Lattice: definition A partially ordered set in which every finite subset has a least upper bound and a greatest lower bound is called a lattice. A partially ordered set in which every subset (not just finite) has a lub and glb is called a complete lattice.

49 Subsets An element a in S is a called first (or least) if ax for every element x in S (at bottom of page). An element b in S is a called last (or greatest) if yb for every element y in S (at top of page)...

50 Subsets An element a in S is a called first (or least) if ax for every element x in S (at bottom of page). An element b in S is a called last (or greatest) if yb for every element y in S (at top of page)...

51 Partial Order Relation on Divisibility1.
The set A = { 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 } of all divisors of 60, partially ordered by divisibility.

52 Partial Order Relation on Divisibility.
The set A = { 1, 2, 3, 5, 6, 10, 15 } contains of all divisors of 30. The Hasse diagram partially ordered by divisibility.

53 Partial Order Relation.
h What is the set here? What is the relation? Is this a lattice?

54 Partial Order Relation.
{0,3,4,6} {1,5,8} {0,3,6} {3,6} {4,6} {1,2} {1,8} {3} {4} h {1} {2} S={{1},{2},{3},{4}, {1,2},{1,5},{3,6},{4,6},{0,3,6},{1,5,8},{0,3,4,6}}

55 Partial Order Relation: Descendants
Betty Jack Audrey Don Dave Amy Jess John h Don and Betty are Dave’s parents, Jack and Audrey are Amy’s parents. Dave and Amy are parents of John and Jess. S={John, Jess, Dave, Amy, Don, Betty, Audrey, Jack}

56 Partial Order Relation.
Let S be a set of sets. Define ARB to mean A⊆B. R is an antisymmetric relation on S, because if XRY and YRX then: X⊆Y ⋀ Y⊆X ⇒ X=Y. R is reflexive, because Y⊆X R is transitive

57 Lattice & Sub-lattice. Let D(n) denote the positive divisors of n.
L = D(30) = {1, 2, 3, 5, 6, 10, 15,30} Sub-lattices: D(6), D(10), D(15), {5,10,15,30} For the divisor relation, if nm then D(m) is a sub- lattice of D(n). From : A Textbook of Discrete Mathematics by Swapan Kumar Sarkar

58 Hasse Diagram Example Given the relation  defined on the set A
 = {(x,y) | x is a factor of y} A = {1, 2, 3, 4, 6, 10, 12, 20} The next slide shows the Hasse diagram for the relation  on the set A.

59 Not a lattice  = {(x,y) | x is a factor of y} A = {1, 2, 3, 4, 6, 10, 12, 20} = {(x,y) | x is a factor of y} A = {1, 2, 3, 4, 6, 10, 12, 20}. Is this a lattice? No, because each subset does not have a lub or a glb. (e.g. {20,12} has no lub)

60 Subset of poset with lub & glb
Bounds may be in S. Recall that lattices are based on POSETs (reflexive, anti-symmetric, transitive), so (glb) a≤a, a≤b b≤c c≤c (lub) lub c b A subset may have a lower bound within itself or not within itself, and likewise for upper bounds. glb a lb A subset may have a lower bound within itself or not within itself, and likewise for upper bounds. lb lb lb

61 This POSET A has no lub, but the subset S={a,b,c} has both a lub & glb.
LUB of {a,b,c} f POSET A L e c b Subset S d a i h k glb GLB of {a,b,c}

62 S={e,f,g,c} has no LUB or any upper bounds, but has GLB
Sub-set S e c d b a i glb k j lb

63 LUB is the least of all upper bounds
g ub e lub c d b Sub-set S={a,b} a i lb No GLB k lb j lb GLB (if exists) is the greatest of all lower bounds

64 Recall def. of GLB a. (capital A,S are sets) a≤S  lA.l≤S  l≤a
What is GLB of S={a,b,c}? g f L e c b d a i h Where l≤S means element l is less than or equal to every element in S. Two lower bounds (h,i) neither of which is greater than the other so neither h or i can be greater. But k is a GLB. k GLB Recall def. of GLB a. (capital A,S are sets) a≤S  lA.l≤S  l≤a

65 Recall def. of LUB b. (capital A,S are sets) S≤b  uA.S≤u  b≤u
What is LUB of S={a,b,c}? g LUB f e c b d a i h Where S≤u means element u is greater than or equal to every element in S. Two lower bounds (h,i) neither of which is greater than the other k Recall def. of LUB b. (capital A,S are sets) S≤b  uA.S≤u  b≤u

66 LUB b: S≤b  uA.S≤u  b≤u
b, if it exists, is the least of all upper bounds g h and i are lower bounds of S={a,b}, h is a lower bound of both, while i is a lower bound of b only So the set S has two lower bounds neither of which is greater. No GLB f l e c b d a i h,i are lower bounds of S={a,b}, h is a lower bound of both, i is a lower bound of b only So the set S has two lower bounds neither of which is greater. But we should have a in the general formula as the greatest of all lower bounds We write ⊔S for lub of S. We write ⊓S for glb of S. h k GLB a. : a≤S  lA.l≤S  l≤a a, if it exists, is the greatest of all lower bounds.

67 LUB b: S≤b  uA.S≤u  b≤u
g f l Providing bounds e c b d a i h k GLB a. : a≤S  lA.l≤S  l≤a

68

69 Top and Bottom elements
The element of a complete lattice which is the lub of the whole lattice is called top T , and the glb is called bottom . Sometimes the symbol ⊑ is used to represent a general relation e.g. for the lattice (ℤ, ≤) ⊑ corresponds to ≤ ⊓ corresponds to Max (glb of two integers) ⊔ corresponds to Min (lub)

70 Top and Bottom elements
For the lattice (Bool, =>) (implies) ⊑ corresponds to = ⊓ corresponds to  (glb) ⊔ corresponds to ⌵ (lub) Every two-element subset has a lub (supremum) and glb (infimum).

71 Example Which of the following partially ordered sets are lattices: I
c d a b A poset is a lattice iff for each pair x,y lub(x,y) and glb(x,y) both exist. On RHS {a,b} has three upper bounds c, d, and I and no one of them precedes the other two, i.e. none is least. The least upper bound and the greatest lower bound are called. supremum and infimum respectively

72 Power set1(again) The POSET Lattice on the right is based on the power set of {a, b, c}. The LUB is given by the union and the GLB by the intersection of subsets. A lattice is a special kind of partial order, it has a glb (infimum) and a lub (supremum). If either the glb or the lub exist then they are unique. The lub is given by the union and the glb by the intersection of subsets. Consider first the operation of Union. Consider any pair of sets in the diagram. The Union of the pair will always yield a set which contains them both. For example, D Union E equals U; A Union B equals D; and so on. If one of the sets precedes the other in the partial order, then the union yields the set that occurs higher in the order. For example, A U D equals D. The set obtained under union is referred to as the Least Upper Bound. Next consider the set operation of intersection. Again consider any pair of sets in the diagram. For example, D Intersection E equals A; A Intersection B equals ø; and so on. The set obtained under intersection is referred to as the Greatest Lower Bound for the pair.

73 Sub Lattices L L1 L2 h g In L meet is e /\ g = c f e c b d a h e g h f

74 Formal Concepts Analysis is based on Lattice Theory.
A branch of computing that uses lattices is called Formal Concept Analysis. FCA is based on the assumption that human knowledge involves conceptual thinking, and that human reasoning involves manipulation of concepts. FCA takes the view that a concept is a unit of thought constituted by its extension (values or instances) and its intension (seems intention is OK) (schemas or classes). These ideas go back over 2000 years to Aristotle. Intension refers to the set of all possible things a word or phrase could describe

75 Lattices can be used for Knowledge RepresentationKarl Erich Wolff
A useful knowledge representation for the semantic web. A line diagram consists of circles, lines and the names of all objects and all attributes of the given context. The circles represent the concepts and the information of the context can be read from the line diagram by the following simple reading rule: An object g has an attribute m if and only if there is an upwards leading path from the circle named by "g" to the circle named by "m". Karl Erich Wolff A FIRST COURSE IN FORMAL CONCEPT ANALYSIS

76 Use as Knowledge Representation Karl Erich Wolff
A FIRST COURSE IN FORMAL CONCEPT ANALYSIS The top of the lattice contains all of the objects and none of the attributes, while the bottom of the lattice contains all of the attributes and none of the objects.

77 Formal Concepts Background
“Adding axioms makes a theory larger, in the sense that more propositions become provable. But the larger theory is also more specialized, since it applies to a smaller range of possible models. This principle, which was first observed by Aristotle, is known as the inverse relationship between intension and extension: as the meaning or intension grows larger in terms of the number of axioms or defining conditions, the extension grows smaller in terms of the number of possible instances. “ Sowa CafeOBJ algebras can be organized as a lattice of sorts and modules.

78 Formal Concepts Background
“As an example, more conditions are needed to define the type Dog than the type Animal; therefore, there are fewer instances of dogs in the world than there are animals. Even more axioms are needed to define the subtypes Dachshund or Collie, which have even fewer instances than the type Dog.”: Sowa The material presented here is quite modern (FCA from Ganter & Wille).

79 Formal Concepts Background
A concept (O,A) consists of Objects and Attributes. The extension of a concept (O,A) is the collection of all objects O belonging to that concept. The intension of a concept (O,A) is the collection of all attributes A belonging to that concept. Sub-concepts satisfy larger sets of axioms or attributes (usually less instances of them exist, ). Subsets of attributes determine super-concepts (usually more instances of them exist, ). For each set of formal concepts of a formal context there always exists a unique greatest sub-concept (meet, ) and a unique smallest super-concept (join, ). (meet, AB) the largest partitions refining A and B. (join, ) the smallest partitions refining both A and B AB the largest partition refining A and B (meet) AB the smallest partitions refining both A and B (join)

80 Formal Concepts Background
There is a duality between objects and attributes called a Galois connection. A Galois connection implies that if one makes the set of objects larger, it corresponds to smaller set of attributes, and vice versa. This particular Galois connections exhibits a closure of the relation between objects and attributes. From any set of formal objects one can identify all formal attributes which they have in common (and vice versa). For each set of formal concepts of a formal context there always exists a unique greatest sub-concept (meet, ) and a unique smallest super-concept (join, ). (meet, AB) the largest partitions refining A and B. (join, ) the smallest partitions refining both A and B AB the largest partition refining A and B (meet) AB the smallest partitions refining both A and B (join)

81 Formal Concepts Background1
The top and bottom concepts in a concept lattice are special. The top concept has all formal objects in its extension. Its intension is often empty but does not need to be empty. The top concept can be thought of as representing the “universal” concept of a formal context. The bottom concept has all formal attributes in its intension. The bottom concept the “null” or “contradictory” concept of a formal context. Formal Concept Analysis in Information Science, by Uta Priss the top concept could have a formal attribute “animal”. The bottom concept has all formal attributes its intension. If any of the formal attributes mutually exclude each other (such as “dog” and “cat”) then the extension of the bottom concept must be empty (because no formal object can be a dog and cat at the same time).

82 Formal Concepts Background1
FCA is just a mathematic theory, like integers or sets. Caution is required when applying FCA to real world domains. Many formal concepts may correspond to intuitive notions, but not all formal concepts need to do so. FCA focuses on formal structure, it is the user’s responsibility to insure the formal context corresponds to some cognitive or real world entity (i.e. an idea or a thing). FCA not a formal analysis of human concepts, but instead is a mathematical method using formal concepts and contexts. Formal Concept Analysis in Information Science, by Uta Priss the top concept could have a formal attribute “animal”. The bottom concept has all formal attributes its intension. If any of the formal attributes mutually exclude each other (such as “dog” and “cat”) then the extension of the bottom concept must be empty (because no formal object can be a dog and cat at the same time).

83 Definitions: Context & Concept
Let M be a set of attributes, G be a set of objects, and I a relation between G and M I is called the incidence relation of the formal context K = (G,M,I) A pair (A,B) is said to be a formal concept of the formal context (G,M,I) if A  G, B  M, σ(A)=B and τ(B)=A. B(G,M,I) denotes the set of all concepts in context (G,M,I) The letters B,G, and M are based on German names. German English Begriffe Concept Gegenstande Objects Merkmal Attributes σ(A)=B, σ (sigma) of object set A gives attribute set B τ(B)=A. τ (tau) of attribute set B gives object set A

84 Extent and Intent The actual OBJECTS A are the extent of the formal concept (A,B) The actual ATTRIBUTES B are the intent of the formal concept (A,B) Several objects may match the intent of a node exactly. They are said to be contingent. The size of the object contingent represents the number of objects for each concept. The terms Extent and Intent are also used in a similar way in database theory

85 Formal Concepts have an ordered relation
Let B(G,M,I) denote the set of all concepts of the context (G,M,I). The concepts of a context are ordered by the subconcept-superconcept relation which is defined by: (A1 , B1 ) ≤ (A2 , B2 ) <=> A1  A2  B2  B1 Which says: (A2,B2) is a super-concept of (A1,B1) or (A1,B1) is a sub-concept of (A2,B2) Sub-concepts are said to be smaller or less general than their super-concepts and the super-concepts larger or more general than their sub-concepts. More Objects Less attributes

86 Lab Read “A first course in formal concept analysis” by Karl Erich Wolff

87 Lab Download and install Concept Explorer from: http://sourceforge

88 What happens if we add a Bat?

89 Formal Concept Analysis applications to Requirements Engineering and Design T. Tilley, School of Information Technology and Electrical Engineering, University of Queensland, PhD Thesis, December 2004.

90 Ideal ⤓ The extent of a concept represents all the object labels that can be reached along a descending path from the concept. The set of concepts along the downward path is known as the down-set or order ideal. Filter = all nodes, that are reachable by ascending paths from selected node to top of lattice Ideal = all nodes, that are reachable by descending paths from selected node to bottom of lattices

91 Filter⤒ Conversely, the intent of a concept can be recovered by collecting all of the attribute labels along upward paths from the concept. The set of concepts along the upward paths are known as the up-set or order filter. Filter = all nodes, that are reachable by ascending paths from selected node to top of lattice Ideal = all nodes, that are reachable by descending paths from selected node to bottom of lattices

92 Retrieving Extension & Intension
To retrieve the extension of a formal concept one needs to trace all paths which lead down from the node to collect the formal objects. To retrieve the intension of a formal concept one needs to trace all paths which lead up in order to collect all the formal attributes.

93 Example: all Object & All Attributes
See 'planets.pdf' document on course web page. At the top of the lattice we have all the objects but no attributes (we know nothing about everything) At the bottom of the lattice we have no objects and all the attribute (we know everything about nothing) See 'planets.pdf' document on course web page. At the top of the lattice we know “nothing about everything” At the bottom of the lattice we know “everything about nothing”

94 Example 1 Reading Rule: An object g has an attribute m if and only if there is an upwards leading path from the circle named by "g" to the circle named by "m". See 'planets.pdf' document on course web page. At the top of the lattice we know “nothing about everything” At the bottom of the lattice we know “everything about nothing”

95 Example 2 See 'planets.pdf' document on course web page.
At the top of the lattice we know “nothing about everything” At the bottom of the lattice we know “everything about nothing”

96 Advantages of FCA FCA develops a mathematical theory of concepts, which consist of objects and attributes. FCA formally represent a Galois connection between ordered sets of objects and attributes. A Galois connection is a relation between two partially ordered sets (posets). In the FCA case the posets are objects and attributes. Sets of formal concepts can be visualized. Automated logical inference can be used.

97 Advantages of FCA FCA develops a mathematical and computable theory which can represent concepts, which consist of objects and attributes. This mathematical theory can be visualized in an intuitive way. Concept Analysis can be used to identify groupings of objects that possess common attributes. FCA formally represents Galois connections and the sets of formal concepts can be visualized. A Galois connection is a relation between two partially ordered sets (posets). In the FCA these posets are objects and attributes.

98 Applications of FCA Constructing classification & taxonomies.
Data mining Conceptual information systems Information retrieval systems Semantic Web Formally modelling OO class hierarchies

99 Intuitive approach to Constructing a Concept Lattice

100 Intuitive approach to Constructing a Concept Lattice
1. Start at top with all objects and no attributes. ({Gibbons, Dolphins, Whales, Humans, Dogs, Cats},). 2. Make a concepts for the biggest set of attributes (i.e. intelligent and haircovered) 2.1 Are there any objects that exactly match these attributes? No, so we label the concepts with only the attributes. ({Gibbons, Dolphins, Whales, Humans}, {intelligent}), ({Gibbons, Dogs, Cats}, {haircovered}).

101 Intuitive approach to Constructing a Concept Lattice
3. Add one attribute at a time to the attribute sets. First marine and thumbed to intelligent Second four-legged to haircovered. 3.1 Are there any objects that exactly match these attributes? Yes, so we label the concepts with objects. Giving: ({Dolphins, Whales},{intelligent, marine}) ({Humans}, {intelligent, thumbed}), ({Cats,Dogs}, {four-legged, haircovered}

102 Intuitive approach to Constructing a Concept Lattice
3. This only leaves the Gibbon object. Are there any objects that exactly match these and previous attributes? Yes, giving new node: ({Gibbon},{intelligent, thumbed, haircovered} Place these new nodes under the appropriate parent node, but we only label them with the current objects and current attributes (not with the inherited attributes)

103 Intuitive approach to Constructing a Concept Lattice
Now all of the objects have be generated: ({Dolphins, Whales},{intelligent, marine}) ({Humans}, {intelligent, thumbed}), ({Cats,Dogs}, {four-legged, haircovered} ({Gibbon},{intelligent, thumbed, haircovered}

104 Intuitive approach to Constructing a Concept Lattice
4.We have now individually covered all the objects, so we add the full collection to the bottom node. (,{intelligent, thumbed, four-legged, haircovered, marine})

105 Age Sowa chapter 2

106 Live in water

107 Table 1 contains information on beverage types and their attributes.
Based on the information in Table 1 draw a concept lattice with Beverage at the top and at the bottom

108 The above diagram is not a lattice. What needs to be added?

109 Based on above a lattice of sorts and operations
mod TEST { [ C1 C2 C3 C4 C5 C6 C7 C8 C9 ] [ C7 C8 < C9 ] [ C5 < C7 C8 ] [ C6 < C8 ] [ C1 < C7 ] [ C2 C3 < C5 ] [ C3 C4 < C6 ] op a : C7 -> C7 op b : C8 -> C8 op d : C6 -> C6 op e : C4 -> C4 op f : C1 -> C1 op c : C2 -> C2 } Eof Red a(c:C7)

110 Advanced FCA: nested diagrams1.
Formal Concept Analysis in Information Science, by Uta Priss

111 Advanced FCA: merging diagrams1.
1. Linguistic Applications of Formal Concept Analysis Uta Priss

112 Intent B Extent A National Parks in California
Def.: A formal concept is a pair (A,B) where A is a set of objects (the extent of the concept), B is a set of attributes (the intent of the concept), AB is a maximal rectangle in the binary relation. The extent (yellow rows) contain a common set of attributes Intent B National Parks in California From FCA-MERGE: Bottom-up Merging of Ontologies by Gred Stumme, Alexander Maedche, Presenter: Yihong Ding Extent A

113 National Parks in California
The blue concept is a subconcept of the yellow one, since its extent is contained in the yellow one. National Parks in California

114

115 Top, intermediate, and bottom logical concepts.
⊤= all structures, true sentences c = extent(c), intent(c) ⊥ = no structures, all sentences From Kent (Kent 2004)the relation between extension and intension in FCA According to Armstrong concepts are united all members of a class have some aspect in common they may have aspects that differ there is a order they partition the universe of discourse.

116 Non-distributive lattice
Logic as Algebra; by Paul Halmos, Steven Givant

117 Concepts are maximal rectangles
By attribute By object

118 ({Father, Mother, Son, Daughter }, {})
({Father,Son},{Male} ) ({Mother,Father},{Old} ) ({Mother,Daughter},{Female} ) ({Son,Daughter},{Young} ) ({Mother},{Old,Female} ) ({Son},{Male, Young} ) ({Daughter},{Female, Young} ) ({Faher},{Old, Male} ) ({},{Female, Male, Old, Young} )

119 Examples The subset relation ( ) represent partial order (reflexive, anti- symmetric, transitive <). When reading there is an implied upward orientation e.g. lower < upper. A point is drawn for each element of the poset, and line segments representing relations are drawn between these points according to the following two rules: 1. If x<y in the poset, then the point corresponding to x appears lower in the drawing than the point corresponding to y . 2. The line segment between the points corresponding to any two elements x and y of the poset is included in the drawing iff x covers y or y covers x . Implicit relations reflexive and transitive Explicit relation anti-symmetry.

120 Examples Transitive; Several examples {1}{1,2}{1,2,3}
Reflexive: Several examples {1}{1} Cover: A cover is the transitive reflexive reduction of a partial order. An element z (e.g. {1,2}) of a partially ordered set above (X,<=) covers another element x (e.g.{1} and {2}) provided that there exists no third element y in the poset for which x <= y <= z. If we have x <= y <= z., then z is called an upper cover of x and x a lower cover of z. Subsets of exactly one set. {1,2} {1,2,3} {1,2,3}{1,3} {1,2,3}{2,3}

121 Examples Cover: A cover is the transitive reflexive reduction of a partial order. An element z (e.g. {1,2}) of a partially ordered set above (X,<=) covers another element x (e.g.{1} and {2}) provided that there exists no third element y in the poset for which x <= y <= z. If we have x <= y <= z., then z is called an upper cover of x and x a lower cover of z.

122 Examples Proper subsets of exactly one set. {1,2}  {1,2,3}
{1,3}  {1,2,3} {2,3}  {1,2,3}

123 Examples H is a partial, it is reflexive, anti-symmetric, and transitive because of the divisibility relation. H has two maximal elements 24, 18 H has one minimal element 1 H has one first element 1 H has no last element because it has two maximal elements neither of which is a last element (they are not comparable).

124 Examples

125 Examples FCA develops a mathematical and computable theory of concepts, which consist of objects and attributes. FCA formally represent a Galois connection between ordered sets of objects and attributes. A Galois connection is a relation between two partially ordered sets (posets). In the FCA case the posets are objects and attributes. Sets of formal concepts can be visualized. Logical inference can be used using a computer. FCA develops a mathematical theory which can represent concepts, which consist of objects and attributes. This mathematical theory can be visualized in an intuitive way. Concept Analysis can be used to identify groupings of objects that possess common attributes G={Air ,Water, Fire, Earth}, M={moist,hot,cold,dry} R is defined in the table. Top = <{Air ,Water, Fire, Earth},  > Bottom= < ,{moist,hot,cold,dry}>

126 Examples FCA can be used as: general knowledge representation, ontology and ontology merging, in UML transition and transition reduction, Constructing classification & taxonomies, Data mining, Conceptual information systems, Information retrieval systems, Semantic Web Formally modelling object oriented class hierarchies See FORMAL CONCEPT ANALYSIS APPLICATIONS TO REQUIREMENTS ENGINEERING AND DESIGN Thomas Tilley

127 Examples Hasse diagram of the subset relation ( ) on the power set of {1,2,3} ( {1,2,3} ). Implicitly and explicitly relations, reading conventions. Identify a transitive relation, a reflexive relation, a cover, a set that is a proper subset of exactly one set. The subset relation ( ) represent partial order (reflexive, anti-symmetric, transitive <). When reading there is an implied upward orientation e.g. lower < upper. A point is drawn for each element of the poset, and line segments representing relations are drawn between these points according to the following two rules: 1. If x<y in the poset, then the point corresponding to x appears lower in the drawing than the point corresponding to y . 2. The line segment between the points corresponding to any two elements x and y of the poset is included in the drawing iff x covers y or y covers x . Implicit relations reflexive and transitive Explicit relation anti-symmetry.

128 Examples Hasse diagram can represent a partial order.
Locating: single maximal element, a minimal element, a first element and a last element. Yes H is a partial because it is reflexive, anti-symmetric, and transitive because of divisibility relation. H has two maximal elements 24, 18 H has one minimal element 1 H has one first element 1 H has no last element because it has two maximal elements neither of which is a last element (they are not comparable).

129 Examples Constructing a concept lattice from a table.
Listing objects and attributes on a lattice

130 Examples The advantages of using a concept lattice for knowledge representation? Application of formal concept analysis. FCA develops a mathematical and computable theory of concepts, which consist of objects and attributes. FCA formally represent a Galois connection between ordered sets of objects and attributes. A Galois connection is a relation between two partially ordered sets (posets). In the FCA case the posets are objects and attributes. Sets of formal concepts can be visualized. Logical inference can be used. FCA develops a mathematical theory which can represent concepts, which consist of objects and attributes. This mathematical theory can be visualized in an intuitive way. Concept Analysis can be used to identify groupings of objects that posses common attributes. Example of applications General knowledge representation, ontology and ontology merging, in UML transition and transition reduction, Constructing classification & taxonomies, Data mining Conceptual information systems, Information retrieval systems, Semantic Web Formally modelling object oriented class hierarchies.

131 http://www. cs. utoronto. ca/~torsten/KR2008-RTRepresentation_Slides


Download ppt "Computing Fundamentals 2 Lecture 4 Lattice Theory"

Similar presentations


Ads by Google