The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Finsupp.Lex

43 declarations. Mathlib docs · Source

Lexicographic order on finitely supported functions

This file defines the lexicographic order on Finsupp.

We are about to sneak in a hypothesis that might appear to be too strong. We assume AddLeftStrictMono (covariant with strict inequality <) also when proving the one with the weak inequality ≤. This is actually necessary: addition on Lex (α →₀ N) may fail to be monotone, when it is "just" monotone on N.

See Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean for a counterexample.

def Finsupp.Lex E1 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → (α → α → Prop) → (N → N → Prop) → (α →₀ N) → (α →₀ N) → Prop

Finsupp.Lex r s is the lexicographic relation on α →₀ N, where α is ordered by r, and N is ordered by s.

The type synonym Lex (α →₀ N) has an order given by Finsupp.Lex (· < ·) (· < ·).

theorem Pi.lex_eq_finsupp_lex E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] {r : α → α → Prop} {s : N → N → Prop} (a b : α →₀ N),
  Pi.Lex r (fun {i} ↦ s) ⇑a ⇑b = Finsupp.Lex r s a b

theorem Finsupp.lex_def E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] {r : α → α → Prop} {s : N → N → Prop} {a b : α →₀ N},
  Finsupp.Lex r s a b ↔ ∃ j, (∀ (d : α), r d j → a d = b d) ∧ s (a j) (b j)

theorem Finsupp.lex_eq_invImage_dfinsupp_lex E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] (r : α → α → Prop) (s : N → N → Prop),
  Finsupp.Lex r s = InvImage (DFinsupp.Lex r fun x ↦ s) Finsupp.toDFinsupp

instance Finsupp.instLTLex E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LT α] → [LT N] → LT (Lex (α →₀ N))

instance Finsupp.instLTColex E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LT α] → [LT N] → LT (Colex (α →₀ N))

theorem Finsupp.Lex.lt_iff E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LT α] [inst_2 : LT N] {a b : Lex (α →₀ N)},
  a < b ↔ ∃ i, (∀ j < i, (ofLex a) j = (ofLex b) j) ∧ (ofLex a) i < (ofLex b) i

theorem Finsupp.Colex.lt_iff E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LT α] [inst_2 : LT N] {a b : Colex (α →₀ N)},
  a < b ↔ ∃ i, (∀ (j : α), i < j → (ofColex a) j = (ofColex b) j) ∧ (ofColex a) i < (ofColex b) i

theorem Finsupp.lex_lt_of_lt_of_preorder E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : Preorder N] (r : α → α → Prop) [IsStrictOrder α r]
  {x y : α →₀ N}, x < y → ∃ i, (∀ (j : α), r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i

theorem Finsupp.lex_lt_of_lt E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : PartialOrder N] (r : α → α → Prop) [IsStrictOrder α r]
  {x y : α →₀ N}, x < y → Pi.Lex r (fun {i} x1 x2 ↦ x1 < x2) ⇑x ⇑y

theorem Finsupp.lex_iff_of_unique E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : Unique α] [inst_2 : LT N] {r : α → α → Prop} [Std.Irrefl r]
  {x y : α →₀ N}, Finsupp.Lex r (fun x1 x2 ↦ x1 < x2) x y ↔ x default < y default

theorem Finsupp.Lex.lt_iff_of_unique E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : Unique α] [inst_2 : LT N] [inst_3 : Preorder α]
  {x y : Lex (α →₀ N)}, x < y ↔ (ofLex x) default < (ofLex y) default

theorem Finsupp.Colex.lt_iff_of_unique E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : Unique α] [inst_2 : LT N] [inst_3 : Preorder α]
  {x y : Colex (α →₀ N)}, x < y ↔ (ofColex x) default < (ofColex y) default

instance Finsupp.Lex.isStrictOrder E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : PartialOrder N],
  IsStrictOrder (Lex (α →₀ N)) fun x1 x2 ↦ x1 < x2

instance Finsupp.Colex.isStrictOrder E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : PartialOrder N],
  IsStrictOrder (Colex (α →₀ N)) fun x1 x2 ↦ x1 < x2

instance Finsupp.Lex.partialOrder E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LinearOrder α] → [PartialOrder N] → PartialOrder (Lex (α →₀ N))

The partial order on Finsupps obtained by the lexicographic ordering. See Finsupp.Lex.linearOrder for a proof that this partial order is in fact linear.

instance Finsupp.Colex.partialOrder E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LinearOrder α] → [PartialOrder N] → PartialOrder (Colex (α →₀ N))

The partial order on Finsupps obtained by the colexicographic ordering. See Finsupp.Colex.linearOrder for a proof that this partial order is in fact linear.

instance Finsupp.Lex.linearOrder E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LinearOrder α] → [LinearOrder N] → LinearOrder (Lex (α →₀ N))

The linear order on Finsupps obtained by the lexicographic ordering.

instance Finsupp.Colex.linearOrder E0 #

{α : Type u_1} → {N : Type u_2} → [inst : Zero N] → [LinearOrder α] → [LinearOrder N] → LinearOrder (Colex (α →₀ N))

The linear order on Finsupps obtained by the colexicographic ordering.

theorem Finsupp.Lex.le_iff_of_unique E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : Unique α] [inst_3 : PartialOrder N]
  {x y : Lex (α →₀ N)}, x ≤ y ↔ (ofLex x) default ≤ (ofLex y) default

theorem Finsupp.Colex.le_iff_of_unique E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : Unique α] [inst_3 : PartialOrder N]
  {x y : Colex (α →₀ N)}, x ≤ y ↔ (ofColex x) default ≤ (ofColex y) default

theorem Finsupp.Lex.single_strictAnti E1 #

∀ {α : Type u_1} [inst : LinearOrder α], StrictAnti fun a ↦ toLex fun₀ | a => 1

theorem Finsupp.Colex.single_strictMono E1 #

∀ {α : Type u_1} [inst : LinearOrder α], StrictMono fun a ↦ toColex fun₀ | a => 1

theorem Finsupp.Lex.single_lt_iff E0 #

∀ {α : Type u_1} [inst : LinearOrder α] {a b : α}, ((toLex fun₀ | b => 1) < toLex fun₀ | a => 1) ↔ a < b

theorem Finsupp.Colex.single_lt_iff E0 #

∀ {α : Type u_1} [inst : LinearOrder α] {a b : α}, ((toColex fun₀ | a => 1) < toColex fun₀ | b => 1) ↔ a < b

theorem Finsupp.Lex.single_le_iff E0 #

∀ {α : Type u_1} [inst : LinearOrder α] {a b : α}, ((toLex fun₀ | b => 1) ≤ toLex fun₀ | a => 1) ↔ a ≤ b

theorem Finsupp.Colex.single_le_iff E0 #

∀ {α : Type u_1} [inst : LinearOrder α] {a b : α}, ((toColex fun₀ | a => 1) ≤ toColex fun₀ | b => 1) ↔ a ≤ b

theorem Finsupp.toLex_monotone E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : PartialOrder N], Monotone ⇑toLex

theorem Finsupp.toColex_monotone E1 #

∀ {α : Type u_1} {N : Type u_2} [inst : Zero N] [inst_1 : LinearOrder α] [inst_2 : PartialOrder N], Monotone ⇑toColex

instance Finsupp.Lex.addLeftStrictMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddLeftStrictMono N], AddLeftStrictMono (Lex (α →₀ N))

instance Finsupp.Colex.addLeftStrictMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddLeftStrictMono N], AddLeftStrictMono (Colex (α →₀ N))

instance Finsupp.Lex.addLeftMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddLeftStrictMono N], AddLeftMono (Lex (α →₀ N))

instance Finsupp.Colex.addLeftMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddLeftStrictMono N], AddLeftMono (Colex (α →₀ N))

instance Finsupp.Lex.addRightStrictMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddRightStrictMono N], AddRightStrictMono (Lex (α →₀ N))

instance Finsupp.Colex.addRightStrictMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddRightStrictMono N], AddRightStrictMono (Colex (α →₀ N))

instance Finsupp.Lex.addRightMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddRightStrictMono N], AddRightMono (Lex (α →₀ N))

instance Finsupp.Colex.addRightMono E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddMonoid N] [inst_2 : LinearOrder N]
  [AddRightStrictMono N], AddRightMono (Colex (α →₀ N))

instance Finsupp.Lex.orderBot E0 #

{α : Type u_1} →
  {N : Type u_2} →
    [inst : LinearOrder α] →
      [inst_1 : AddCommMonoid N] → [inst_2 : PartialOrder N] → [IsBotZeroClass N] → OrderBot (Lex (α →₀ N))

instance Finsupp.Lex.isBotZeroClass E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsBotZeroClass N], IsBotZeroClass (Lex (α →₀ N))

instance Finsupp.Colex.orderBot E0 #

{α : Type u_1} →
  {N : Type u_2} →
    [inst : LinearOrder α] →
      [inst_1 : AddCommMonoid N] → [inst_2 : PartialOrder N] → [IsBotZeroClass N] → OrderBot (Colex (α →₀ N))

instance Finsupp.Colex.isBotZeroClass E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsBotZeroClass N], IsBotZeroClass (Colex (α →₀ N))

instance Finsupp.Lex.isOrderedCancelAddMonoid E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsOrderedCancelAddMonoid N], IsOrderedCancelAddMonoid (Lex (α →₀ N))

instance Finsupp.Colex.isOrderedCancelAddMonoid E0 #

∀ {α : Type u_1} {N : Type u_2} [inst : LinearOrder α] [inst_1 : AddCommMonoid N] [inst_2 : PartialOrder N]
  [IsOrderedCancelAddMonoid N], IsOrderedCancelAddMonoid (Colex (α →₀ N))