Posets
Posets
In our context…
• We aim at computing properties on programs
• How can we represent these properties? Which kind of algebraic
features have to be satisfied on these representations?
• Which conditions guarantee that this computation terminates?
Motivating Example (1)
• Consider the renovation of the building of a firm.
In this process several tasks are undertaken
– Remove asbestos
– Replace windows
– Paint walls
– Refinish floors
– Assign offices
– Move in office furniture
– …
Motivating Example (2)
• Clearly, some things had to be done before others could begin
– Asbestos had to be removed before anything (except
assigning
offices)
– Painting walls had to be done before refinishing floors
to avoid ruining them, etc.
• On the other hand, several things could be done concurrently:
– Painting could be done while replacing the windows
– Assigning offices could be done at anytime before
moving in office furniture
• This scenario can be nicely modeled using partial orderings
Partial Orderings: Definitions
• Definitions:
– A relation R on a set S is called a partial order if it is
• Reflexive
• Antisymmetric
• Transitive
– A set S together with a partial ordering R is called a
partially ordered set (poset, for short) and is denote
(S,R)
• Partial orderings are used to give an order to sets that may
not have a natural one
• In our renovation example, we could define an ordering
such that (a,b)R if ‘a must be done before b can be
done’
Partial Orderings: Notation
• We use the notation:
– a p b, when (a,b)R
– a p b, when (a,b)R and ab
• The notation p is not to be mistaken for “less than” (p versus ≤)
• The notation p is used to denote any partial ordering
Comparability: Definition
• Definition:
– The elements a and b of a poset (S, p) are called comparable
if
either apb or bpa.
– When for a,bS, we have neither apb nor bpa, we say
that a,b are incomparable
• Consider again our renovation example
– Remove Asbestos p ai for all activities ai except assign
offices
– Paint walls p Refinish floors
– Some tasks are incomparable: Replacing windows can
be done before, after, or during the assignment of
offices
Total orders: Definition
• Definition:
– If (S,p) is a poset and every two elements of S are
comparable,
S is called a totally ordered set.
– The relation p is said to be a total order
• Example
– The relation “less than or equal to” over the set of
integers (Z, ) since for every a,bZ, it must be the
case that ab or ba
– What happens if we replace with <?
a a5
a a
5
4 4
a a
2 a 2 a3
3
a a
1 1
Hasse Diagrams: Example (1)
• Of course, you need not always start with the complete
relation in the partial order and then trim everything.
• Rather, you can build a Hasse Diagram directly from
the partial order
• Example: Draw the Hasse Diagram
– for the following partial ordering: {(a,b) | a|b }
– on the set {1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60}
– (these are the divisors of 60 which form the basis of
the ancient Babylonian base-60 numeral system)
Hasse Diagram: Example (2)
6
0
1 2 3
2 0 0
4 6 1 15
0
2 3 5
1
Example
c d e f
a b
L= {a,b,c,d,e,f,g}
p ={(a,c), (a,e), (b,d), (b,f), (c,g), (d,g), (e,g), (f,g)}RT
6 L= N (natural numbers)
5 p ={(0,1), (1,2), (2,3), (3,4), (4,5),…}RT
4
3 (L, p) is a totally ordered set (infinite)
2
1
0
Example
9
8
7
L= N (natural numbers)
6
p ={(n,m): k such that m=n*k}
5
4 (L, p) is a partially ordered set (infinite)
3
2
Example
• On the same set E={1,2,3,4,6,12} we can define
different partial orders:
12 12
12
6 6
4 6 4 4
3
3 2 2
2 1 3
1 1
Example
N x N
(x1,y1) N x N (x2,y2) x 1 N x 2
y 1 N y 2
Example
N ´
N upper bounds of Y
lub(Y)
glb(Y)
lower bounds of Y
(x1,y1) N x N (x2,y2) x 1 N x 2
y 1 N y 2
Extremal Elements: Example 1
c d
a b
• Minimal: {a,b}
• Maximal: {c,d}
• There are no unique minimal or maximal elements,
thus no minimum or maximum
Extremal Elements: Example 2
Give lower/upper
{d,e,f}
bounds & glb/lub of the
sets: • Lower bounds: , thus no glb
• Upper bounds: , thus no lub
{d,e,f}, {a,c} and
{b,d}
{a,c}
g i h
• Lower bounds: , thus no glb
• Upper bounds: {h}, lub: h
d e f
{b,d}
• Lower bounds: {b}, glb: b
b
a c • Upper bounds: {d,g},
lub: d because dpg
Extremal Elements: Example 3
• Minimal/Maximal elements?
i j
• Minimal & Minimum element: a
• Maximal elements: b,d,i,j
f g h
• Bounds, glb, lub of {c,e}?
c
b d • Bounds, glb, lub of {b,i}?
• Lower bounds: {a}, thus glb is c
a
• Upper bounds: , thus lub DNE
Lattices
• A special structure arises when every pair of elements in
a poset has an lub and a glb
• Definition: A lattice is a partially ordered set in which
every pair of elements has both
– a least upper bound and
– a greatest lower bound
Lattices: Example 1
• Is the example from before a i j
lattice?
f g h
a
Lattices: Example 2
• What if we modified it as j
shown here?
i
f g h
b c d
a
A Lattice Or Not a Lattice?
• To show that a partial order is not a lattice, it suffices to
find a pair that does not have an lub or a glb (i.e., a
counter-example)
• For a pair not to have an lub/glb, the elements of the pair
must first be incomparable (Why?)
• You can then view the upper/lower bounds on a pair as a
sub-Hasse diagram: If there is no maximum/minimum
element in this sub- diagram, then it is not a lattice
Complete lattices
• Definition:
A lattice A is called a complete lattice if every subset S of A
admits a glb and a lub in A.
• Exercise:
Show that for any (possibly infinite) set E, (P(E),) is a
complete lattice
(P(E) denotes the powerset of E, i.e. the set of all subsets of E).
Example
Y
c d e f
a b
L= {a,b,c,d,e,f,g}
={(a,c), (a,e), (b,d), (b,f), (c,g), (d,g), (e,g), (f,g)}T
{1,2,3}
lub(Y)
{1} { {3}
2
}
L= glb(Y) = Y
({1,2,3})
p =
lub(Y) = Y
glb(Y)
Example
- - - - 0 1 2 3 4
4 3 2 1
L= Z {T,}
nZ : p npT
Example
L= Z+
6
p total order on Z+
5
lub = max
glb = min 4
3
2
is a lattice, but not complete:
It 1
For instance, the set of even numbers has no lub 0
37
Example
L= Z+ {T}
6
p total order on Z+ {T}
5
lub = max
glb = min 4
3
2
is a complete lattice
This 1
0
Examples
• Proof:
– 1 2 e 1 3 by definition
– In order to prove that 2 1, let us define for
each Y L glb(Y) = lub({l L | l’ Y : l
l’})
upper bounds of Z
Y
{1,2} {1, {2,3}
3}
lub(Z)
{ {2} {3}
1
}
{l L | l’ Y : l l’}
Z=
Functions on partial orders
• Let (P,P) and (Q,Q) two partial orders. A function from
P to Q is said:
• monotone (order
preserving) if p1 P p2
p1 Q p2
• embedding if
p1 P p2 p1 Q p2
e
2d2e is2 monotone, but it is not
d b c
b c 2 2 an
2a embedding:2bQ2c
but it is not true that
a
bPc
Examples
e
d 3e 3 is monotone but it is
3c3 not an
b c embedding:3bQ3c
d
but it is not true that
3a3
a bPc
b
d 4d
4c
b c
4 is an embedding, but
not an isomorphism.
a 4b
4a
Isomorphism
j j’
i g h g’
i’
f
d e
e ’ d’
h’
f’
b b’
a’
c
c’
Monotone? Embedding? Isomorphism?
1
from((S), )
0 , defined by:
to
(U)=1 if U is nonempty, ()=0.
n0N : nN : n0 n ln ln
0
• Infinite set
• Satisfies both ACC and
... DCC
Lattices and ACC
• If P is a lattice, it has a bottom element and satisfies ACC,
tyen it is a complete lattice
(P, (Q,Q
P) )
S
(S
)
Fixpoints
Fix(f) ={ l P | f(l)=l}
Fixpoint on Complete Lattices
• Tarski Theorem:
Let L be a complete lattice. If f:LL is monotone then
lfp(f) = glb{ l L | f(l) l
} gfp(f) = lub{ l L | l
f(l) }
Fixpoints on Complete Lattices
{ l L | f(l) P l}
gfp(f) = lub{ l L | l
Fix(f) ={ l L |
f(l)=l} f(l) } lfp(f) = glb{ l L |
f(l) l }
{ l L | l P f(l)}
Kleene Theorem
• Let f be a monotone function: (P,P) (P,P) on a complete
lattice P. Let = n0 f n()
– Kleene Theorem
If f is continuous then the least fixpoint of f esists , and it is
equal
to