TExcelTAD
Home › Discrete Mathematics › Partial Orders

Partial Orders

Some things can be ranked completely, like numbers by size. Others only partly: version ranges, task dependencies, subsets ordered by inclusion, or job candidates where one is better in salary and another in location. A partial order captures "comes before" or "is at most" when not every pair needs to be comparable.

Properties of relations on a set

For a relation RR on a set AA:

Property Definition Example that has it
reflexive aRaa \mathrel{R} a for all aa ≤\le, ==, ⊆\subseteq
irreflexive never aRaa \mathrel{R} a <<, "is a parent of"
symmetric aRb→bRaa \mathrel{R} b \to b \mathrel{R} a "is a sibling of", ≡(modn)\equiv \pmod n
antisymmetric aRb∧bRa→a=ba \mathrel{R} b \land b \mathrel{R} a \to a = b ≤\le, ⊆\subseteq, divides (on positive integers)
asymmetric aRb→¬(bRa)a \mathrel{R} b \to \neg(b \mathrel{R} a) <<, "is a parent of"
transitive aRb∧bRc→aRca \mathrel{R} b \land b \mathrel{R} c \to a \mathrel{R} c ≤\le, <<, ⊆\subseteq, divides

Two kinds of partial order

  • A weak partial order is reflexive, antisymmetric and transitive. Examples: ≤\le on numbers, ⊆\subseteq on sets, ∣\mid (divides) on positive integers.
  • A strict partial order is irreflexive and transitive (and hence asymmetric). Examples: <<, ⊂\subset, "must be done before" for tasks.

They come in pairs: a≤b  ⟺  a<b∨a=ba \le b \iff a < b \lor a = b. A strict partial order is exactly the reachability relation of a DAG: "u<vu < v if there is a path of positive length from uu to vv".

A partial order is total (or linear) if every two elements are comparable: a≤ba \le b or b≤ab \le a. Divisibility is not total: neither 4∣64 \mid 6 nor 6∣46 \mid 4. Elements that are not comparable are incomparable.

python · try it yourself
from itertools import product

A = range(1, 13)
divides = lambda a, b: b % a == 0
props = {
    "reflexive": all(divides(a, a) for a in A),
    "antisymmetric": all(not (divides(a, b) and divides(b, a)) or a == b for a, b in product(A, A)),
    "transitive": all(not (divides(a, b) and divides(b, c)) or divides(a, c) for a, b, c in product(A, A, A)),
    "total": all(divides(a, b) or divides(b, a) for a, b in product(A, A)),
}
print("divides on 1..12:", props)
print("incomparable pairs, e.g.:", [(a, b) for a, b in product(A, A) if a < b and not divides(a, b)][:6])
divides on 1..12: {'reflexive': True, 'antisymmetric': True, 'transitive': True, 'total': False}
incomparable pairs, e.g.: [(2, 3), (2, 5), (2, 7), (2, 9), (2, 11), (3, 4)]

Hasse diagrams

A finite partial order is drawn as a Hasse diagram: draw an edge from aa up to bb when a<ba < b and nothing lies strictly between them (bb covers aa). The other relations follow by transitivity, so they are omitted. The covering relation for divisibility on {1,…,12}\{1, \ldots, 12\}:

python · try it yourself
A = range(1, 13)
lt = lambda a, b: a != b and b % a == 0
covers = [(a, b) for a in A for b in A if lt(a, b) and not any(lt(a, c) and lt(c, b) for c in A)]
for a in A:
    up = [b for x, b in covers if x == a]
    if up:
        print(f"{a:2d} -> {up}")
print("minimal elements:", [a for a in A if not any(lt(b, a) for b in A)])
print("maximal elements:", [a for a in A if not any(lt(a, b) for b in A)])
 1 -> [2, 3, 5, 7, 11]
 2 -> [4, 6, 10]
 3 -> [6, 9]
 4 -> [8, 12]
 5 -> [10]
 6 -> [12]
minimal elements: [1]
maximal elements: [7, 8, 9, 10, 11, 12]

Each cover multiplies by a prime: b=a⋅pb = a \cdot p. The minimal element is 1 (it divides everything), and the maximal elements are those with no multiple left in the set.

Product orders and representing orders as subsets

Two common constructions:

  • Product order: (a1,a2)≤(b1,b2)(a_1, a_2) \le (b_1, b_2) if a1≤b1a_1 \le b_1 and a2≤b2a_2 \le b_2. Comparing laptops by (RAM, storage), only some pairs are comparable; the non-dominated ones form the Pareto front.
  • Lexicographic order: compare the first components, and only if they are equal, the second. It is total. Python compares tuples and strings this way.

Theorem. Every partial order ≤\le on a set AA is isomorphic to a family of sets ordered by ⊆\subseteq: map aa to its down-set {x∈A∣x≤a}\{x \in A \mid x \le a\}. Then a≤b  ⟺  down(a)⊆down(b)a \le b \iff \text{down}(a) \subseteq \text{down}(b).

In software

Semantic versioning, type hierarchies (a subclass is "below" its superclass), lattice-based access control, vector clocks in distributed systems (one event happened before another only if every component is ≤\le) and Pareto-optimal results in multi-objective optimization are partial orders. Sorting needs a total order; topological sort extends a partial order to a total one.

Exercises

Exercise 1: Classify relations

Which properties do these relations on people have? (a) "is an ancestor of"; (b) "has the same birthday as"; (c) "is at least as tall as".

Answer

(a) irreflexive, asymmetric, transitive (a strict partial order); (b) reflexive, symmetric, transitive; (c) reflexive, transitive, total, but not antisymmetric.

Solution

(a) Nobody is their own ancestor; ancestry cannot go both ways; an ancestor of an ancestor is an ancestor. (b) is an equivalence relation (next lesson). (c) Two different people of the same height are each at least as tall as the other, so antisymmetry fails; it is a total preorder.

Exercise 2: Subsets

Draw (or list) the Hasse diagram of P({a,b,c})\mathcal{P}(\{a, b, c\}) under ⊆\subseteq. How many covering pairs are there?

Answer

It is a cube; 12 covering pairs.

Solution

BB covers AA when BB adds exactly one element to AA. Each of the 8 subsets can add each element it does not have; summing over subsets, ∑k(3k)(3−k)=3+6+3=12\sum_k \binom{3}{k}(3 - k) = 3 + 6 + 3 = 12. The diagram has ∅\emptyset at the bottom, the three singletons, the three pairs, and {a,b,c}\{a, b, c\} at the top.

Exercise 3: Pareto front (code)

Laptops as (RAM GB, battery hours): (8, 10), (16, 6), (16, 9), (32, 5), (8, 12), (12, 9). Which are not dominated in the product order?

Answer

(8, 12), (16, 9), (32, 5).

Solution

A laptop is dominated if another one is at least as good in both coordinates and different.

python · try it yourself
pts = [(8, 10), (16, 6), (16, 9), (32, 5), (8, 12), (12, 9)]
dom = lambda p, q: p != q and q[0] >= p[0] and q[1] >= p[1]
print([p for p in pts if not any(dom(p, q) for q in pts)])
[(16, 9), (32, 5), (8, 12)]

Test yourself

A weak partial order is…

  1. reflexive, symmetric, transitive
  2. reflexive, antisymmetric, transitive
  3. irreflexive and symmetric
  4. total and symmetric

Under divisibility on {1,…,12}\{1, \ldots, 12\}, which pair is incomparable?

  1. (2, 8)
  2. (3, 12)
  3. (4, 6)
  4. (1, 7)

How does Python compare the tuples (2, 9) and (3, 1)?

  1. They are incomparable
  2. (2, 9) < (3, 1) by lexicographic order
  3. (3, 1) < (2, 9) because 1 < 9
  4. By the sum of components