The areas / V04. Order and lattices
Mathlib.Order.Prod.Lex.Basic
39 declarations. Mathlib docs · Source
Lexicographic order
This file defines the lexicographic relation for pairs of orders, partial orders and linear orders.
Main declarations
Prod.Lex.<pre/partial/linear>Order: Instances lifting the orders onαandβtoα ×ₗ β.
Notation
α ×ₗ β:α × βequipped with the lexicographic order
See also
Related files are:
Data.Finset.CoLex: Colexicographic order on finite sets.Data.List.Lex: Lexicographic order on lists.Data.Pi.Lex: Lexicographic order onΠₗ i, α i.Order.PSigma: Lexicographic order onΣ' i, α i.Order.Sigma: Lexicographic order onΣ i, α i.
TODO
Some lemmas could be automatically generated with to_dual.
See [https://github.com/leanprover-community/mathlib4/pull/37939#discussion_r3367855484]
def Prod.Lex.«term_×ₗ_» E1 #
Lean.TrailingParserDescr
A type synonym to equip a type with its lexicographic order.
instance Prod.Lex.instLE E0 #
(α : Type u_3) → (β : Type u_4) → [LT α] → [LE β] → LE (Lex (α × β))
Dictionary / lexicographic ordering on pairs.
instance Prod.Lex.instLT E0 #
(α : Type u_3) → (β : Type u_4) → [LT α] → [LT β] → LT (Lex (α × β))
theorem Prod.Lex.toLex_le_toLex E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : LT α] [inst_1 : LE β] {x y : α × β},
toLex x ≤ toLex y ↔ x.1 < y.1 ∨ x.1 = y.1 ∧ x.2 ≤ y.2
theorem Prod.Lex.toLex_lt_toLex E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : LT α] [inst_1 : LT β] {x y : α × β},
toLex x < toLex y ↔ x.1 < y.1 ∨ x.1 = y.1 ∧ x.2 < y.2
theorem Prod.Lex.le_iff E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : LT α] [inst_1 : LE β] {x y : Lex (α × β)},
x ≤ y ↔ (ofLex x).1 < (ofLex y).1 ∨ (ofLex x).1 = (ofLex y).1 ∧ (ofLex x).2 ≤ (ofLex y).2
theorem Prod.Lex.lt_iff E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : LT α] [inst_1 : LT β] {x y : Lex (α × β)},
x < y ↔ (ofLex x).1 < (ofLex y).1 ∨ (ofLex x).1 = (ofLex y).1 ∧ (ofLex x).2 < (ofLex y).2
instance Prod.Lex.instWellFoundedLTLex E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : LT α] [inst_1 : LT β] [WellFoundedLT α] [WellFoundedLT β],
WellFoundedLT (Lex (α × β))
instance Prod.Lex.instWellFoundedRelationLexOfWellFoundedLT E0 #
{α : Type u_1} →
{β : Type u_2} →
[inst : LT α] → [inst_1 : LT β] → [WellFoundedLT α] → [WellFoundedLT β] → WellFoundedRelation (Lex (α × β))
instance Prod.Lex.instPreorder E0 #
(α : Type u_3) → (β : Type u_4) → [Preorder α] → [Preorder β] → Preorder (Lex (α × β))
Dictionary / lexicographic preorder for pairs.
theorem Prod.Lex.monotone_fst E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : LE β] (t c : Lex (α × β)),
t ≤ c → (ofLex t).1 ≤ (ofLex c).1
See also monotone_fst_ofLex for a version stated in terms of Monotone.
theorem Prod.Lex.monotone_fst_ofLex E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β], Monotone fun x ↦ (ofLex x).1
theorem WCovBy.fst_ofLex E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] {a b : Lex (α × β)},
a ⩿ b → (ofLex a).1 ⩿ (ofLex b).1
theorem Prod.Lex.toLex_covBy_toLex_iff E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] {a₁ a₂ : α} {b₁ b₂ : β},
toLex (a₁, b₁) ⋖ toLex (a₂, b₂) ↔ a₁ = a₂ ∧ b₁ ⋖ b₂ ∨ a₁ ⋖ a₂ ∧ IsMax b₁ ∧ IsMin b₂
theorem Prod.Lex.covBy_iff E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] {a b : Lex (α × β)},
a ⋖ b ↔
(ofLex a).1 = (ofLex b).1 ∧ (ofLex a).2 ⋖ (ofLex b).2 ∨
(ofLex a).1 ⋖ (ofLex b).1 ∧ IsMax (ofLex a).2 ∧ IsMin (ofLex b).2
theorem Prod.Lex.toLex_le_toLex' E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β] {x y : α × β},
toLex x ≤ toLex y ↔ x.1 ≤ y.1 ∧ (x.1 = y.1 → x.2 ≤ y.2)
Variant of Prod.Lex.toLex_le_toLex for partial orders.
theorem Prod.Lex.toLex_lt_toLex' E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β] {x y : α × β},
toLex x < toLex y ↔ x.1 ≤ y.1 ∧ (x.1 = y.1 → x.2 < y.2)
Variant of Prod.Lex.toLex_lt_toLex for partial orders.
theorem Prod.Lex.le_iff' E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β] {x y : Lex (α × β)},
x ≤ y ↔ (ofLex x).1 ≤ (ofLex y).1 ∧ ((ofLex x).1 = (ofLex y).1 → (ofLex x).2 ≤ (ofLex y).2)
Variant of Prod.Lex.le_iff for partial orders.
theorem Prod.Lex.lt_iff' E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β] {x y : Lex (α × β)},
x < y ↔ (ofLex x).1 ≤ (ofLex y).1 ∧ ((ofLex x).1 = (ofLex y).1 → (ofLex x).2 < (ofLex y).2)
Variant of Prod.Lex.lt_iff for partial orders.
theorem Prod.Lex.toLex_mono E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β], Monotone ⇑toLex
theorem Prod.Lex.toLex_strictMono E1 #
∀ {α : Type u_1} {β : Type u_2} [inst : PartialOrder α] [inst_1 : Preorder β], StrictMono ⇑toLex
instance Prod.Lex.instPartialOrder E0 #
(α : Type u_3) → (β : Type u_4) → [PartialOrder α] → [PartialOrder β] → PartialOrder (Lex (α × β))
Dictionary / lexicographic partial order for pairs.
instance Prod.Lex.instOrdLexProd E0 #
{α : Type u_1} → {β : Type u_2} → [Ord α] → [Ord β] → Ord (Lex (α × β))
theorem Prod.Lex.compare_def E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Ord α] [inst_1 : Ord β],
compare = compareLex (compareOn fun x ↦ (ofLex x).1) (compareOn fun x ↦ (ofLex x).2)
theorem lexOrd_eq E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Ord α] [inst_1 : Ord β], lexOrd = Prod.Lex.instOrdLexProd
theorem Ord.lex_eq E0 #
∀ {α : Type u_1} {β : Type u_2} [oα : Ord α] [oβ : Ord β], oα.lex oβ = Prod.Lex.instOrdLexProd
instance Prod.Lex.instOrientedOrdLex E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Ord α] [inst_1 : Ord β] [Std.OrientedOrd α] [Std.OrientedOrd β],
Std.OrientedOrd (Lex (α × β))
instance Prod.Lex.instTransOrdLex E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Ord α] [inst_1 : Ord β] [Std.TransOrd α] [Std.TransOrd β],
Std.TransOrd (Lex (α × β))
instance Prod.Lex.instLinearOrder E0 #
(α : Type u_3) → (β : Type u_4) → [LinearOrder α] → [LinearOrder β] → LinearOrder (Lex (α × β))
Dictionary / lexicographic linear order for pairs.
instance Prod.Lex.orderBot E0 #
{α : Type u_1} →
{β : Type u_2} →
[inst : PartialOrder α] → [inst_1 : Preorder β] → [OrderBot α] → [OrderBot β] → OrderBot (Lex (α × β))
instance Prod.Lex.orderTop E0 #
{α : Type u_1} →
{β : Type u_2} →
[inst : PartialOrder α] → [inst_1 : Preorder β] → [OrderTop α] → [OrderTop β] → OrderTop (Lex (α × β))
instance Prod.Lex.boundedOrder E0 #
{α : Type u_1} →
{β : Type u_2} →
[inst : PartialOrder α] → [inst_1 : Preorder β] → [BoundedOrder α] → [BoundedOrder β] → BoundedOrder (Lex (α × β))
instance Prod.Lex.instDenselyOrderedLex E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [DenselyOrdered α] [DenselyOrdered β],
DenselyOrdered (Lex (α × β))
instance Prod.Lex.instDenselyOrderedLexOfNoMinOrder E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMinOrder β] [DenselyOrdered β],
DenselyOrdered (Lex (α × β))
instance Prod.Lex.instDenselyOrderedLexOfNoMaxOrder E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMaxOrder β] [DenselyOrdered β],
DenselyOrdered (Lex (α × β))
instance Prod.Lex.noMaxOrder_of_left E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMaxOrder α], NoMaxOrder (Lex (α × β))
instance Prod.Lex.noMinOrder_of_left E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMinOrder α], NoMinOrder (Lex (α × β))
instance Prod.Lex.noMinOrder_of_right E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMinOrder β], NoMinOrder (Lex (α × β))
instance Prod.Lex.noMaxOrder_of_right E0 #
∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] [NoMaxOrder β], NoMaxOrder (Lex (α × β))