mathlib3 documentation

order.grade

Graded orders #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file defines graded orders, also known as ranked orders.

A 𝕆-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 #

How to grade your order #

Here are the translations between common references and our grade_order:

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 #

@[class]
structure grade_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] :
Type (max u_5 u_6)

An 𝕆-graded order is an order α equipped with a strictly monotone function grade 𝕆 : α → 𝕆 which preserves order covering (covby).

Instances of this typeclass
Instances of other typeclasses for grade_order
  • grade_order.has_sizeof_inst
@[class]
structure grade_min_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] :
Type (max u_5 u_6)

A 𝕆-graded order where minimal elements have minimal grades.

Instances of this typeclass
Instances of other typeclasses for grade_min_order
  • grade_min_order.has_sizeof_inst
@[instance]
def grade_min_order.to_grade_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] [self : grade_min_order 𝕆 α] :
grade_order 𝕆 α
@[instance]
def grade_max_order.to_grade_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] [self : grade_max_order 𝕆 α] :
grade_order 𝕆 α
@[class]
structure grade_max_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] :
Type (max u_5 u_6)

A 𝕆-graded order where maximal elements have maximal grades.

Instances of this typeclass
Instances of other typeclasses for grade_max_order
  • grade_max_order.has_sizeof_inst
@[class]
structure grade_bounded_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] :
Type (max u_5 u_6)

A 𝕆-graded order where minimal elements have minimal grades and maximal elements have maximal grades.

Instances of this typeclass
Instances of other typeclasses for grade_bounded_order
  • grade_bounded_order.has_sizeof_inst
@[instance]
def grade_bounded_order.to_grade_min_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] [self : grade_bounded_order 𝕆 α] :
@[instance]
def grade_bounded_order.to_grade_max_order (𝕆 : Type u_5) (α : Type u_6) [preorder 𝕆] [preorder α] [self : grade_bounded_order 𝕆 α] :
def grade (𝕆 : Type u_1) {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] :
α 𝕆

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
@[protected]
theorem covby.grade (𝕆 : Type u_1) {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] {a b : α} (h : a b) :
grade 𝕆 a grade 𝕆 b
theorem grade_strict_mono {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] :
theorem covby_iff_lt_covby_grade {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] {a b : α} :
a b a < b grade 𝕆 a grade 𝕆 b
@[protected]
theorem is_min.grade (𝕆 : Type u_1) {α : Type u_3} [preorder 𝕆] [preorder α] [grade_min_order 𝕆 α] {a : α} (h : is_min a) :
is_min (grade 𝕆 a)
@[simp]
theorem is_min_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_min_order 𝕆 α] {a : α} :
is_min (grade 𝕆 a) is_min a
@[protected]
theorem is_max.grade (𝕆 : Type u_1) {α : Type u_3} [preorder 𝕆] [preorder α] [grade_max_order 𝕆 α] {a : α} (h : is_max a) :
is_max (grade 𝕆 a)
@[simp]
theorem is_max_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_max_order 𝕆 α] {a : α} :
is_max (grade 𝕆 a) is_max a
theorem grade_mono {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [partial_order α] [grade_order 𝕆 α] :
theorem grade_injective {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] :
@[simp]
theorem grade_le_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] {a b : α} :
grade 𝕆 a grade 𝕆 b a b
@[simp]
theorem grade_lt_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] {a b : α} :
grade 𝕆 a < grade 𝕆 b a < b
@[simp]
theorem grade_eq_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] {a b : α} :
grade 𝕆 a = grade 𝕆 b a = b
theorem grade_ne_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] {a b : α} :
grade 𝕆 a grade 𝕆 b a b
theorem grade_covby_grade_iff {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [linear_order α] [grade_order 𝕆 α] {a b : α} :
grade 𝕆 a grade 𝕆 b a b
@[simp]
theorem grade_bot {𝕆 : Type u_1} {α : Type u_3} [partial_order 𝕆] [preorder α] [order_bot 𝕆] [order_bot α] [grade_min_order 𝕆 α] :
grade 𝕆 =
@[simp]
theorem grade_top {𝕆 : Type u_1} {α : Type u_3} [partial_order 𝕆] [preorder α] [order_top 𝕆] [order_top α] [grade_max_order 𝕆 α] :
grade 𝕆 =

Instances #

@[protected, instance]
Equations
@[simp]
theorem grade_self {α : Type u_3} [preorder α] (a : α) :
grade α a = a

Dual #

@[protected, instance]
def order_dual.grade_order {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] :
Equations
@[simp]
theorem grade_to_dual {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] (a : α) :
@[simp]
theorem grade_of_dual {𝕆 : Type u_1} {α : Type u_3} [preorder 𝕆] [preorder α] [grade_order 𝕆 α] (a : αᵒᵈ) :

Lifting a graded order #

@[reducible]
def grade_order.lift_left {𝕆 : Type u_1} {ℙ : Type u_2} {α : Type u_3} [preorder 𝕆] [preorder «ℙ»] [preorder α] [grade_order 𝕆 α] (f : 𝕆 «ℙ») (hf : strict_mono f) (hcovby : (a b : 𝕆), a b f a f b) :
grade_order «ℙ» α

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_min_order.lift_left {𝕆 : Type u_1} {ℙ : Type u_2} {α : Type u_3} [preorder 𝕆] [preorder «ℙ»] [preorder α] [grade_min_order 𝕆 α] (f : 𝕆 «ℙ») (hf : strict_mono f) (hcovby : (a b : 𝕆), a b f a f b) (hmin : (a : 𝕆), is_min a is_min (f a)) :
grade_min_order «ℙ» α

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_max_order.lift_left {𝕆 : Type u_1} {ℙ : Type u_2} {α : Type u_3} [preorder 𝕆] [preorder «ℙ»] [preorder α] [grade_max_order 𝕆 α] (f : 𝕆 «ℙ») (hf : strict_mono f) (hcovby : (a b : 𝕆), a b f a f b) (hmax : (a : 𝕆), is_max a is_max (f a)) :
grade_max_order «ℙ» α

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_bounded_order.lift_left {𝕆 : Type u_1} {ℙ : Type u_2} {α : Type u_3} [preorder 𝕆] [preorder «ℙ»] [preorder α] [grade_bounded_order 𝕆 α] (f : 𝕆 «ℙ») (hf : strict_mono f) (hcovby : (a b : 𝕆), a b f a f b) (hmin : (a : 𝕆), is_min a is_min (f a)) (hmax : (a : 𝕆), is_max a is_max (f a)) :

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_order.lift_right {𝕆 : Type u_1} {α : Type u_3} {β : Type u_4} [preorder 𝕆] [preorder α] [preorder β] [grade_order 𝕆 β] (f : α β) (hf : strict_mono f) (hcovby : (a b : α), a b f a f b) :
grade_order 𝕆 α

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_min_order.lift_right {𝕆 : Type u_1} {α : Type u_3} {β : Type u_4} [preorder 𝕆] [preorder α] [preorder β] [grade_min_order 𝕆 β] (f : α β) (hf : strict_mono f) (hcovby : (a b : α), a b f a f b) (hmin : (a : α), is_min a is_min (f a)) :

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_max_order.lift_right {𝕆 : Type u_1} {α : Type u_3} {β : Type u_4} [preorder 𝕆] [preorder α] [preorder β] [grade_max_order 𝕆 β] (f : α β) (hf : strict_mono f) (hcovby : (a b : α), a b f a f b) (hmax : (a : α), is_max a is_max (f a)) :

Lifts a graded order along a strictly monotone function.

Equations
@[reducible]
def grade_bounded_order.lift_right {𝕆 : Type u_1} {α : Type u_3} {β : Type u_4} [preorder 𝕆] [preorder α] [preorder β] [grade_bounded_order 𝕆 β] (f : α β) (hf : strict_mono f) (hcovby : (a b : α), a b f a f b) (hmin : (a : α), is_min a is_min (f a)) (hmax : (a : α), is_max a is_max (f a)) :

Lifts a graded order along a strictly monotone function.

Equations

fin n-graded to -graded to -graded #

@[reducible]
def grade_order.fin_to_nat {α : Type u_3} [preorder α] (n : ) [grade_order (fin n) α] :

A fin n-graded order is also -graded. We do not mark this an instance because n is not inferrable.

Equations
@[reducible]

A fin n-graded order is also -graded. We do not mark this an instance because n is not inferrable.

Equations
@[protected, instance]
Equations