A poset is naturally labeled if the ground set is ordered v1, ..., vn and if vi ≤vj in P implies i ≤j. This method relabels the ground set of the poset (suppose it has n vertices) to be 0, 1, ..., n-1.
i1 : P = booleanLattice 3;
|
i2 : Q = naturalLabeling P
o2 = Q
o2 : Poset
|
i3 : all(allRelations Q, r -> r_0 <= r_1)
o3 = true
|
If startIndex is specified, then the values are shifted by that amount. This can be useful for making a disjoint union of posets.
i4 : C = chain 3;
|
i5 : Q' = sum(3, i -> naturalLabeling(C, 3*i))
o5 = Q'
o5 : Poset
|
i6 : all(allRelations Q', r -> r_0 <= r_1)
o6 = true
|
Note the cache of P is copied to the cache of Q with the appropriate adjustments being made.