From 1f71c95093e435a2a074a437ff503444c2983248 Mon Sep 17 00:00:00 2001 From: Boris Marinov Date: Tue, 23 Feb 2021 12:00:33 +0200 Subject: [PATCH] Preorder --- _chapters/04_order.md | 97 +++-- _chapters/04_order/color_mixing_poset.svg | 270 ++++++++++++++ _chapters/04_order/hasse.svg | 137 +++++-- _chapters/04_order/meet.svg | 168 +++++++++ _chapters/04_order/non_maximal_element.svg | 244 ++++++++++++ _chapters/04_order/preorder.svg | 281 ++++++++++++++ _chapters/04_order/preorder_equivalence.svg | 362 ++++++++++++++++++ _chapters/04_order/preorder_sports.svg | 390 ++++++++++++++++++++ 8 files changed, 1890 insertions(+), 59 deletions(-) create mode 100644 _chapters/04_order/color_mixing_poset.svg create mode 100644 _chapters/04_order/meet.svg create mode 100644 _chapters/04_order/non_maximal_element.svg create mode 100644 _chapters/04_order/preorder.svg create mode 100644 _chapters/04_order/preorder_equivalence.svg create mode 100644 _chapters/04_order/preorder_sports.svg diff --git a/_chapters/04_order.md b/_chapters/04_order.md index dd01464..acd46bc 100644 --- a/_chapters/04_order.md +++ b/_chapters/04_order.md @@ -6,13 +6,11 @@ title: Orders Orders === -This chapter is about order (not as "Law and order", but as "alphabetical ordered") and about its mathematical qualities. - -Given a set of objects, there can be numerous criteria, based on which to order them, and which depend on the objects themselves. +Given a set of objects, there can be numerous criteria, based on which to order them, and which depend on the objects themselves - size, weight, age, alphabetical order etc. ![Balls](balls.svg) -Howevever, as mathematicians we are not interested in the *criteria* that we can use to order objects, but in the *nature of the relationship* that defines the order, of which there can be several types. +Howevever, as mathematicians we are not interested in the *criteria* that we can use to order objects, but in the *nature of the relationship* that defines the order, of which there can be several types as well. Linear order === @@ -64,12 +62,12 @@ The third law is called antisymmetry and it states that the function that define ![antisymmetry](antisymmetry.svg) -Also it means that no ties are permitted - either I am better than my grandmother at socker or she is better at it than me. +It also means that no ties are permitted - either I am better than my grandmother at socker or she is better at it than me. -Connexity +Totality --- -The last law is called connexity, or totality and it mandates that all elements that belong to the order should be comparable - **a ≤ b or b ≤ a**. That is, for any two elements, one would always be "bigger" than the other. +The last law is called totality or connexity and it mandates that all elements that belong to the order should be comparable - **a ≤ b or b ≤ a**. That is, for any two elements, one would always be "bigger" than the other. **NB:** By the way this law makes the reflexivity law redundant, as it is just a special case of reflexivity when **a** and **b** are one and the same object. @@ -77,7 +75,7 @@ The last law is called connexity, or totality and it mandates that all elements You might say that this law is not as self-evident as the rest of them - if you think about different types of real-life objects that we typically order by various criteria you would probably think of some instances where it is not valid. For example, if we aim to order all people based on soccer skills there are many ways in which we can rank a person compared to their friends their friend's friends etc. but there isn't a way to order groups of people who never played with one another. -Orders like the order of people based on their soccer skills that don't follow the connexity law are called **partial orders** and they are actually much more interesting than linear orders (which are also called **total orders**, by the way). +Orders like the order of people based on their soccer skills that don't follow the totality law are called **partial orders** and they are actually much more interesting than linear orders (which are also called **total orders**, by the way). **Task:** Think about other orders and think about whether they are partial or total. @@ -107,7 +105,7 @@ However, this is not the case with partial orders that we will look into next. Partial order === -Like linear orders, a partial orders consists of a set plus a relationship, with the only difference is that although the relationship obeys the reflexive, transitive and the anti-symmetric laws, it does not obey the law of totality, that is, not all elements are necessarily ordered. I say "necessarily" because even if all elements are ordered, the partial order is still a partial order (just as a group is still a monoid) - all linear orders are also partial orders, but not the other way around (we can create an *order of orders*, based on which is more general, but we can do it later). +Like linear orders, a partial orders consists of a set plus a relationship, with the only difference is that although the relationship obeys the reflexive, transitive and the antisymmetric laws, it does not obey the law of totality, that is, not all elements are necessarily ordered. I say "necessarily" because even if all elements are ordered, the partial order is still a partial order (just as a group is still a monoid) - all linear orders are also partial orders, but not the other way around (we can create an *order of orders*, based on which is more general, but we can do it later). Partial orders --- @@ -139,36 +137,35 @@ For example, this set is not linearly ordered. Although the connection establishes the relationship between **D** and **G** (**D ≤ G**) and although the relationship between **F** and **G** is known as well (**F ≤ G**), the relationship between **D** and **F** is *not* known. Any element can be bigger than the other one. -Maximal and minimal elements +Maximum and minimum --- -We established that partial orders cannot give us a definite answer of the question who is better at who at soccer, but some people don't care who is better than who, they only care about one thing (and one element) *who is number one* i.e. the champion, the player who is better than anyone else, or the element that is bigger than any other elements. Although, partial sets don't always have a maximal element, some of them do. For example, in our last diagram **M** is the maximal element. +So partial orders do not provide us with a definite answer of the question who is better at who at soccer, but in sports (as well as in other domains) people often don't care who is better than, *who is number one* i.e. the champion, the player who is better than anyone else, or more generally, the element that is bigger than any other element, which is called the *maximum element*. +In our last diagram **M** is the maximum element. In this diagram, the green element is the biggest one. + +![Join diagram with one more element](join_additional_element.svg) + +Sometimes we have more than one elements that are bigger than all other elements, in this case none of them are maximum. + +![A diagram with no maximum element](non_maximal_element.svg) + +We also may have a minimum (smallest) element, which is defined in the same way. Joins --- -When we have two or more elements have a unique upper bound that is common to all them, without the elements being ordered themselves, we say that the upper element is a **join** of these elements, e.g. the green element is a join of the other two. +Give two elements, the smallest element that is bigger than both of them (i.e. their *least upper bound*) is called the *join* of these elements, e.g. the green element is a join of the other two. Formally the join of **A** and **B** is defined as the smallest element **C** for which **A ≤ C**, and **B ≤ C**. -![Join diagram](join.svg) +![Join](join.svg) -A join is formally defined as +In a totally ordered set, the *join* of any subset of elements is just their the *maximum* element. -A couple of clarifications about joins: - -- An element counts as a join if the elements are not directly connected to it. - -![Join diagram with one more element](join_additional_element.svg) - -- An element can have, more than one arrows, - -![Also Join diagram with one more element](join_additional_arrows.svg) - -- If two elements have several upper bounds, that are equally big, then none of them is a **join** (a join must be unique). +And, like with the maxumum element, if two elements have several upper bounds that are equally big, then none of them is a *join* (a join must be unique). ![A non-join diagram](non_join.svg) -If, however one is established as bigger than another, it immediately qualifies +If, however one is established as bigger than another, it immediately qualifies. ![A join diagram](non_join_fix.svg) @@ -177,30 +174,64 @@ If, however one is established as bigger than another, it immediately qualifies Meets --- +Given two elements, the biggest element that is smaller than both of them is called the *meet* of these elements. + +![Meet](meet.svg) + +The same rules as for the joins apply. + **Question:** What is the relationship of join and meet in terms of category theory? Interlude: Hasse diagrams --- -By the way, in this section we use what are called a "Hasse diagrams". They are much like our usual diagrams, however they have an additional rule which we follow - "bigger" elements are always above smaller ones. +In this section we use what are called "Hasse diagrams", they are much like our usual diagrams, however they have an additional rule that is followed - "bigger" elements are always positioned above smaller ones. -In terms of arrows the rule means that if you add an arrow to a point, you the point *to* which the arrow points must always be above the one *from* which it points. +In terms of arrows, the rule means that if you add an arrow to a point, you the point *to* which the arrow points must always be above the one *from* which it points. ![A join diagram](hasse.svg) -This allows us to compare any two points by just seeing which one is above the other. - -Order as sets ---- +This allows us to compare any two points by just seeing which one is above the other e.g. to spot the *join* of two elements, you just have to identify the ones they connect to and see which one is lowest. Preorder === -Equivalence relation +In the last chapter, we saw how removing the law of totality from the laws of *(linear) order* produces a different (and somewhat more interesting) structure, called *partial order*. Now let's see what will happen if we remove another one of the laws, namely the *antisymmetry* law. If you recall, the antisymmetry law mandated that you cannot have an object that is at the same time smaller and bigger than another one. (or that **a ≤ b ⟺ b ≰ a**) and removing it leaves us with just one law - transitivity - **a ≤ b and b ≤ c ➞ a ≤ c** (two, if we count reflexivity). + + +| **Total order** | reflexive | transitive | antisymmetric | total | +| **Partial order** | reflexive | transitive | antisymmetric | ~~total~~ | +| **Preorder** | reflexive | transitive | ~~antisymmetric~~ | ~~total~~ | + +This results in something called a preorder which is not exactly an order, as it can have arrows coming from any point to any other. If a partial order can be used to model who is better at who in soccer, then a preorder can be used to model who has beaten who, either directly (by playing him) or indirectly + +![preorder](preorder.svg) + +An interesting consequence of the reflexivity property is that all indirect wins (ones that are wins not against the player directly, but against someone who had beat them) are added as a direct result of its application, as seen here (we show indirect wins in lighter tone). + +![preorder in sport](preorder_sports.svg) + + Also, notice that all "circle" relationships (e.g. where you have a weaker player beating a stronger one) result in just a bunch of objects that are all connected to one another, due to which, we can convert the preorder into partial order, by grouping all objects that have arrows to one another in sets and then create an order from those sets. + +![preorder](preorder_equivalence.svg) + +Those sets are called *equivalence classes*. + +Orders as categories +=== + +Let's revisit our color-mixing monoid and create a color-mixing poset + +![A color mixing poset](color_mixing_poset.svg) + +Orders as powersets === Lattices === +Order as powersets +--- + Logic === diff --git a/_chapters/04_order/color_mixing_poset.svg b/_chapters/04_order/color_mixing_poset.svg new file mode 100644 index 0000000..8400a82 --- /dev/null +++ b/_chapters/04_order/color_mixing_poset.svg @@ -0,0 +1,270 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_chapters/04_order/hasse.svg b/_chapters/04_order/hasse.svg index 849f6b1..3bdfc30 100644 --- a/_chapters/04_order/hasse.svg +++ b/_chapters/04_order/hasse.svg @@ -20,12 +20,41 @@ image/svg+xml - + + id="defs3401"> + + + + + + + + + + + + + transform="matrix(0.70959204,0.01739057,-0.01739057,0.70959204,213.22179,32.108129)"> + transform="matrix(0.501908,0.501908,-0.501908,0.501908,194.0301,23.234669)"> + transform="matrix(0.70959204,0.01739057,-0.01739057,0.70959204,412.02218,96.812973)"> + transform="matrix(0.501908,0.501908,-0.501908,0.501908,392.83049,87.939513)"> + transform="matrix(0.501908,0.501908,-0.501908,0.501908,429.25522,-129.59646)"> + inkscape:transform-center-y="-5.3920968"> + transform="matrix(0.12454177,-0.21029416,0.21744958,0.24187047,349.27537,58.195759)" + inkscape:transform-center-x="-8.9787696" + inkscape:transform-center-y="0.91069311"> + transform="matrix(0.16397951,-0.19198139,0.15331244,0.35379157,339.53662,20.665794)" + inkscape:transform-center-x="-8.3124537" + inkscape:transform-center-y="4.0075378"> + + 1 + 2 + 3 diff --git a/_chapters/04_order/meet.svg b/_chapters/04_order/meet.svg new file mode 100644 index 0000000..61a60b0 --- /dev/null +++ b/_chapters/04_order/meet.svg @@ -0,0 +1,168 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_chapters/04_order/non_maximal_element.svg b/_chapters/04_order/non_maximal_element.svg new file mode 100644 index 0000000..05755f8 --- /dev/null +++ b/_chapters/04_order/non_maximal_element.svg @@ -0,0 +1,244 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_chapters/04_order/preorder.svg b/_chapters/04_order/preorder.svg new file mode 100644 index 0000000..14389ab --- /dev/null +++ b/_chapters/04_order/preorder.svg @@ -0,0 +1,281 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + M + + + + + + + + + + + + + + + D + + + + + + + O + + + + + + + + + + + G + + + + diff --git a/_chapters/04_order/preorder_equivalence.svg b/_chapters/04_order/preorder_equivalence.svg new file mode 100644 index 0000000..e20440c --- /dev/null +++ b/_chapters/04_order/preorder_equivalence.svg @@ -0,0 +1,362 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + G + + + + + + + F + + + + + + + O + + + + + + + + + + + + + + + M + + + + + + + + + + + + + + + D + + + + diff --git a/_chapters/04_order/preorder_sports.svg b/_chapters/04_order/preorder_sports.svg new file mode 100644 index 0000000..d7c109f --- /dev/null +++ b/_chapters/04_order/preorder_sports.svg @@ -0,0 +1,390 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + M + + + + + + + G + + + + + + F + + + + + + + + + + + + + + + + + + D + + + + + + + O + + + + + + + + + + + + + + + + + + + +