The essential idea from the previous post on orders is that comparing the elements of a set gives rise to relations between them and adding a “sense” (a measure that quantifies the relation mathematically) to the relation allows for the ordering of elements within the set. Taking only those ordered sets where elements can be related to themselves (irreflexive) and where not every element is related to another in the set (partial), taking subsets of such posets and checking if any notable properties emerge from them is interesting exercise, so let’s start there.
Take a subset of an partially ordered set with relation on it. In :
The set of all lower bounds is defined as:
(the set of all values in X that bound the subset Y from below)
and the set of all upper bounds as:
(the set of all values in X that bound the subset Y from above)
Note that all of these arises from nothing more than taking a subset of the original partially set and using the relation to relate members of the original set and the subsets . Because is an ordered set using a binary relation , the sets of bounds are also ordered in two directions - lower and upper.
When the set of upper bounds Y has a least element, it is the least upper bound of which is given by :
Considering the dual, the set of lower bounds Y has a greatest element or the greatest lower bound and is given by :
In literature, the least upper bound is the supremum (written as sup
)
of the subset
and the greatest lower bound is the infimum of Y
(written as inf
)
Important points to note are:
A set Y need not have a supremum or an infimum.
E.g. Let X = {a, b, c, d} be a poset with:
(neither c R d nor d R c holds).
Take Y = {a, b}. To calculate the set of upper bounds for Y, must be i.e. for each :
| y | relation | x |
|---|---|---|
| a | a R c | c |
| a | a R d | d |
| b | b R c | c |
| b | b R d | d |
S^u = {c, d}
To get only one element out of requires a comparision between c and d but since R does not hold for both, there’s no least element or supremum in {c, d}.
A supremum or an infimum, if either exist, are always unique. Looking at the definition above, if x and x’ are both upper bounds in , then we must have and which is only possible when x’ = x in a poset (the antisymmetry property).
The supremum or the infimum of a set may or may not belong to the set itself.
An poset X has a bottom element if there exists (called bottom) with the property that for all x . The dual element in X is a top element which if exists is defined as for all . For the set of upper bounds Y , the least upper bound or supremum and the set of lower bounds Y , the greatest lower bound or infimum .
So far, the definitions of subsets of posets have meant any subset of a poset . Now if the definition were to narrowed down to every two-element (or doubleton) subset of , then a structure called a lattice emerges from only if:
A poset is a join-semilattice (or upper-semilattice) in which , exists. The dual holds for meet-s semilattices (lower-semilattices) i.e. , .
For a subsets :
If both , exist for all , the is a complete lattice.
A principal filter or principal up-set on a poset generated by an element is defined as:
is everything in the poset that is “at” or “above” y (at because y R y by definition).
The set of upper bounds of two element set, y$ since x R y, nothing “below” can be an upper bound. Since the least element of is y, .
A principal down-set on a poset generated by an element is defined as:
is everything in the poset that is “at” or “below” x (at because again x R x by definition).
The set of lower bounds of two element set, is given by as nothing “below” x can be a lower bound. Since the least element of $x is x, .
This far, diagrams for definitions have shown abstract versions of posets, their subsets, upper/lower bounds. One representation of specific posets are Hasse diagrams. A Hasse diagram for a poset with is done as follows:
This Hasse diagram is a representation of poset
Moving upward from an circle depicting an element shows the transitive relations e.g. b R e R h b R h. Elements e and d are not ordered by ( ). The reflexivity of elements is implied.
A mathematical or a computational entity has an algebraic structure when it is comprised of:
Sets themselves have identities that any set must follow. As ordered sets with other features, lattices are algebraic structures too,a denoted by
The following rules are equivalent for all lattices from poset , where :
and give rise to the following axioms with :
The four axioms hold for their dual versions where and are exchanged.
Chapter 2 of the Lattices and Order has far more details on the topic of lattices if you are interested. A thorough understanding of these definitions should, hopefully, be enough to dig through how a lattice structure has been added to OCaml’s type system to build OxCaml in the next post.
It’s thanks to Claude credits that I could come up with the illustrative diagrams very easily.