Graded orders #
This file defines graded orders, also known as ranked orders.
An π-graded order is an order Ξ± equipped with a distinguished "grade" function Ξ± β π which
should be understood as giving the "height" of the elements. Usual graded orders are β-graded,
cograded orders are βα΅α΅-graded, but we can also grade by β€, and polytopes are naturally
Fin n-graded.
Visually, grade β a is the height of a in the Hasse diagram of Ξ±.
Main declarations #
GradeOrder: Graded order.GradeMinOrder: Graded order where minimal elements have minimal grades.GradeMaxOrder: Graded order where maximal elements have maximal grades.GradeBoundedOrder: Graded order where minimal elements have minimal grades and maximal elements have maximal grades.grade: The grade of an element. Because an order can admit several gradings, the first argument is the order we grade by.
How to grade your order #
Here are the translations between common references and our GradeOrder:
- [Stanley][stanley2012] defines a graded order of rank
nas an order where all maximal chains have "length"n(so the number of elements of a chain isn + 1). This corresponds toGradeBoundedOrder (Fin (n + 1)) Ξ±. - [Engel][engel1997]'s ranked orders are somewhere between
GradeOrder β Ξ±andGradeMinOrder β Ξ±, in that he requiresβ a, IsMin a β§ grade β a = 0rather thanβ a, IsMin a β grade β a = 0. He defines a graded order as an order where all minimal elements have grade0and all maximal elements have the same grade. This is roughly a less bundled version ofGradeBoundedOrder (Fin n) Ξ±, assuming we discard orders with infinite chains.
Implementation notes #
One possible definition of graded orders is as the bounded orders whose flags (maximal chains) all have the same finite length (see Stanley p. 99). However, this means that all graded orders must have minimal and maximal elements and that the grade is not data.
Instead, we define graded orders by their grade function, without talking about flags yet.
References #
- [Konrad Engel, Sperner Theory][engel1997]
- [Richard Stanley, Enumerative Combinatorics][stanley2012]
An π-graded order is an order Ξ± equipped with a strictly monotone function
grade π : Ξ± β π which preserves order covering (CovBy).
- grade : Ξ± β π
The grading function.
- grade_strictMono : StrictMono GradeOrder.grade
gradeis strictly monotonic. - covBy_grade β¦a b : Ξ±β¦ : a β b β GradeOrder.grade a β GradeOrder.grade b
Instances
An π-graded order where minimal elements have minimal grades.
- grade : Ξ± β π
- isMin_grade β¦a : Ξ±β¦ : IsMin a β IsMin (GradeOrder.grade a)
Minimal elements have minimal grades.
Instances
An π-graded order where maximal elements have maximal grades.
- grade : Ξ± β π
- isMax_grade β¦a : Ξ±β¦ : IsMax a β IsMax (GradeOrder.grade a)
Maximal elements have maximal grades.
Instances
An π-graded order where minimal elements have minimal grades and maximal elements have maximal
grades.
- grade : Ξ± β π
Instances
The grade of an element in a graded order. Morally, this is the number of elements you need to
go down by to get to β₯.
Equations
- grade π = GradeOrder.grade
Instances For
Instances #
Equations
- Preorder.toGradeBoundedOrder = { grade := id, grade_strictMono := β―, covBy_grade := β―, isMin_grade := β―, isMax_grade := β― }
Dual #
Equations
- OrderDual.gradeOrder = { grade := βOrderDual.toDual β grade π β βOrderDual.ofDual, grade_strictMono := β―, covBy_grade := β― }
Equations
- OrderDual.gradeMinOrder = { toGradeOrder := OrderDual.gradeOrder, isMin_grade := β― }
Equations
- OrderDual.gradeMaxOrder = { toGradeOrder := OrderDual.gradeOrder, isMax_grade := β― }
Equations
- instGradeBoundedOrderOrderDual = { toGradeMinOrder := OrderDual.gradeMinOrder, isMax_grade := β― }
Lifting a graded order #
Lifts a graded order along a strictly monotone function.
Equations
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMinOrder.liftLeft f hf hcovBy hmin = { toGradeOrder := GradeOrder.liftLeft f hf hcovBy, isMin_grade := β― }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMaxOrder.liftLeft f hf hcovBy hmax = { toGradeOrder := GradeOrder.liftLeft f hf hcovBy, isMax_grade := β― }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeBoundedOrder.liftLeft f hf hcovBy hmin hmax = { toGradeMinOrder := GradeMinOrder.liftLeft f hf hcovBy hmin, isMax_grade := β― }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMinOrder.liftRight f hf hcovBy hmin = { toGradeOrder := GradeOrder.liftRight f hf hcovBy, isMin_grade := β― }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMaxOrder.liftRight f hf hcovBy hmax = { toGradeOrder := GradeOrder.liftRight f hf hcovBy, isMax_grade := β― }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeBoundedOrder.liftRight f hf hcovBy hmin hmax = { toGradeMinOrder := GradeMinOrder.liftRight f hf hcovBy hmin, isMax_grade := β― }
Instances For
A Fin n-graded order is also β-graded. We do not mark this an instance because n is not
inferable.
Equations
- GradeOrder.finToNat n = GradeOrder.liftLeft Fin.val β― β―
Instances For
A Fin n-graded order is also β-graded. We do not mark this an instance because n is not
inferable.
Equations
- GradeMinOrder.finToNat n = GradeMinOrder.liftLeft Fin.val β― β― β―
Instances For
Equations
- GradeOrder.natToInt = GradeOrder.liftLeft (fun (x : β) => βx) Int.natCast_strictMono β―
Grading a flag #
A flag inherits the grading of its ambient order.
Equations
Equations
- s.instGradeMinOrderSubtypeMem = GradeMinOrder.liftRight Subtype.val β― β― β―
Equations
- s.instGradeMaxOrderSubtypeMem = GradeMaxOrder.liftRight Subtype.val β― β― β―
Equations
- s.instGradeBoundedOrderSubtypeMem = GradeBoundedOrder.liftRight Subtype.val β― β― β― β―