Partial Order
Given a set of items, if there is a way to "sort" (or order) the elements without contradiction, then it is a partial order.
The word "partial" implies that not every element needs to be comparable.
Mathematical Formalities
We formally define a partially ordered set as a pair \((P, \preccurlyeq)\) where:
- \(P\) - Set of elements
- \(\preccurlyeq\) - Binary relation on \(P\) which fulfills the following properties
- Reflexive
- Anti-symmetric
- Transitive
What does \(\preccurlyeq\) really mean?
The \(\preccurlyeq\) is expressed as \preccurlyeq in LaTeX.
The prec part stands for "precedes", indicating an ordering relation.
The curlyeq suffix stands for "or is equal to", using a curled variation of the equals sign
Technically, you should read "\(A \preccurlyeq B\)" as "A precedes or is equal to B". However, I find it more natural to just say "A precedes B", keeping in mind it includes the case where \(A = B\).
Here are some common variations of the “precedes” symbol:
\prec→ \(\prec\): strictly precedes (no equality)\preceq→ \(\preceq\): precedes or equals (with a straight equals)\preccurlyeq→ \(\preccurlyeq\): precedes or equals (with a curled equals)
Both \(\preceq\) and \(\preccurlyeq\) express the same logical idea: “precedes or is equal to.” The difference is purely stylistic.
Intuition 1
What are some things that can be ordered?
- Integers
- A series of steps
What can they be ordered by?
Let's use the example of the series of steps.
For example, this is your daily routine, with the specified deadlines.
- Wake up (by 7am)
- Check phone (by 7:30am)
- Make Coffee (by 7:10am)
- Leave house (by 8am)
How can we order these steps?
We can order them by "must be completed before" relation. \(A \preccurlyeq B\) iff \(A\) must be completed before \(B\).
We'll get the following diagram:
graph BT
Wake["Wake up (by 7am)"]
Phone["Check phone (by 7:30am)"]
Coffee["Make coffee (by 7:10am)"]
Leave["Leave house (by 8am)"]
Coffee --- Leave
Phone --- Leave
Wake --- Coffee
Wake --- Phone
Warning
The way to interpret this diagram isn't that checking phone and making coffee need to be done at the same time. It just means that there is no strict requirement to check phone or make coffee first. It is perfectly valid to check phone from 7am to 7:05am before making coffee from 7:05am to 7:10am. The constraints are still satisfied.
Can we order the tasks in a different way?
We can order them by "has deadline before" relation. \(A \preccurlyeq B\) iff \(A\) has deadline before \(B\).
graph BT
Wake["Wake up (by 7am)"]
Coffee["Make coffee (by 7:10am)"]
Phone["Check phone (by 7:30am)"]
Leave["Leave house (by 8am)"]
Phone --- Leave
Coffee --- Phone
Wake --- Coffee
Very important
For mathematical correctness, the relations defined isn't actually partial order because they're not reflexive. For example, is the statement "\(A\) has deadline before \(A\)" true for all \(A\)? It is not, because a partial order requires that \(A \preccurlyeq A\) holds for every \(A\) (reflexivity).
Therefore, the correct definition of that relation should be "\(A \preccurlyeq B\) iff \(A\) has deadline before (or equal to) \(B\) ".
Putting it together
There are 2 things that you must specify when defining a partial order: the set of elements, and the binary relation. As you can see from the example above, using the same set of elements, we can come up with different partial orders using different binary relations.
Intuition 2: Using Graph Theory
Info
For the graph theory people
If it helps, you can think of the problem as a graph problem. Using the same example from Intuition 1, you can model the graph \(G = (V,E)\) as follows:
- Nodes represent the tasks
- Edges: \((u, v) \in E\) iff \(u\) must be completed before (or equals to) \(v\)
- Be mindful: to model a true partial order, you must ensure reflexivity, that is, \((u, u) \in E\) for all \(u \in V\).
Info
The meaning is similar except the notations used are different
You can try modeling the “has deadline before (or equal to)” relation as an exercise :>
Ignoring the self loops, this graph is a DAG.
Conclusion
A partial order is just a consistent way to say "this comes before that", even if not everything needs to be compared.
Takeaway Question
If we sort the set of integers in descending order, what is the binary relation that we're using?
- Set of elements: \(\mathbb{Z}\)
- Binary Relation: ??? (How do we define \(\preccurlyeq\)?)
Solution
We define \(A \preccurlyeq B\) iff \(A \geq B\)
Formally, the poset is defined as \((\mathbb{Z}, \geq)\)