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 defines a graded order of rank
n
as 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's ranked orders are somewhere between
GradeOrder โ ฮฑ
andGradeMinOrder โ ฮฑ
, in that he requiresโ a, IsMin a โง grade โ a = 0
rather thanโ a, IsMin a โ grade โ a = 0
. He defines a graded order as an order where all minimal elements have grade0
and 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 #
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
grade
is 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 : ฮฑ โ ๐
- grade_strictMono : StrictMono GradeOrder.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 : ฮฑ โ ๐
- grade_strictMono : StrictMono GradeOrder.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 : ฮฑ โ ๐
- grade_strictMono : StrictMono GradeOrder.grade
Instances
Instances #
Equations
- Preorder.toGradeBoundedOrder = GradeBoundedOrder.mk โฏ
Dual #
Equations
- OrderDual.gradeMinOrder = GradeMinOrder.mk โฏ
Equations
- OrderDual.gradeMaxOrder = GradeMaxOrder.mk โฏ
Equations
- instGradeBoundedOrderOrderDual = GradeBoundedOrder.mk โฏ
Lifting a graded order #
Lifts a graded order along a strictly monotone function.
Equations
- GradeOrder.liftLeft f hf hcovBy = { grade := f โ grade ๐, grade_strictMono := โฏ, covBy_grade := โฏ }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMinOrder.liftLeft f hf hcovBy hmin = GradeMinOrder.mk โฏ
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMaxOrder.liftLeft f hf hcovBy hmax = GradeMaxOrder.mk โฏ
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeBoundedOrder.liftLeft f hf hcovBy hmin hmax = GradeBoundedOrder.mk โฏ
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeOrder.liftRight f hf hcovBy = { grade := grade ๐ โ f, grade_strictMono := โฏ, covBy_grade := โฏ }
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMinOrder.liftRight f hf hcovBy hmin = GradeMinOrder.mk โฏ
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeMaxOrder.liftRight f hf hcovBy hmax = GradeMaxOrder.mk โฏ
Instances For
Lifts a graded order along a strictly monotone function.
Equations
- GradeBoundedOrder.liftRight f hf hcovBy hmin hmax = GradeBoundedOrder.mk โฏ
Instances For
A Fin n
-graded order is also โ
-graded. We do not mark this an instance because n
is not
inferrable.
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
inferrable.
Equations
- GradeMinOrder.finToNat n = GradeMinOrder.liftLeft Fin.val โฏ โฏ โฏ
Instances For
Equations
- GradeOrder.natToInt = GradeOrder.liftLeft (fun (x : โ) => โx) Int.natCast_strictMono โฏ