Search code examples
haskellcategory-theory

What is partial order?


I am reading category theory for programmers from Bartosz Milewski and I did not get the idea of partial order.

I did not get the context of the following sentences:

You can also have a stronger relation, that satisfies an additional condition that, if a <= b and b <= a then a must be the same as b. That’s called a partial order.

Why a must be the same as b? For example, a = 4 and b = 5, so it is not the same at all. If he would mention

....if a = b and b = a....

Then yes, I would agree.

The second part, that I also do not understand:

Finally, you can impose the condition that any two objects are in a relation with each other, one way or another; and that gives you a linear order or total order.

What does he mean?


Solution

  • if a <= b ...

    so a = 4 and b = 5 satisfy the first inequality

    and b <= a

    but they don't satisfy the second inequality. So, your counterexample is invalid.

    Let's forget <= because I suspect it's tricking you into thinking about integers or some other set of numbers you're familiar with. So, we'll re-write it with some arbitrary relation, say ¤

    if a ¤ b is true

    and b ¤ a is true

    and this always implies that a is the same entity as b

    then we call relation ¤ a "partial order" (over whatever set a, b are drawn from)

    All the author is saying is that for some relation, if the given rule is true, then we call that relation a partial order. This is the author's definition of a partial order. If you find some situation where the rule doesn't hold - that just means you found a type of relation that is not a partial order.

    Anyway, the reason for defining a partial order is that sometimes we have collections of objects, and we can't compare all of them to each other.

    For example, a set of grades for different subjects: perhaps I can decide whether one student is better at English than another, and I can decide whether one student is better at Music than another, but it doesn't make sense to discuss whether one student's English is better than another's Music.

    The last quote just means that if we have a relation which is at least a partial order (it satisfies the rule given) and it can be applied to your whole set (say we're only discussing English grades), then we can call it a total order over that set.


    PS. As it happens the rule does hold for the usual <= with integers: hence, we can call the relation <= a partial order over ℤ. Since it is also defined for every pair of integers, we can also call <= a total order on ℤ.

    PPS. Yes, a partial order also requires transitivity: my answer really only addresses the fairly informal definition quoted in the question. You can find more complete definitions at Wolfram MathWorld, Wikipedia or wherever.