The areas / V03. Sets, finite structures and big operators
Mathlib.Data.DFinsupp.Lex
44 declarations. Mathlib docs · Source
Lexicographic order on finitely supported dependent functions
This file defines the lexicographic order on DFinsupp.
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 (Π₀ i, α i) may fail
to be monotone, when it is "just" monotone on α i.
def DFinsupp.Lex E1 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
(ι → ι → Prop) → ((i : ι) → α i → α i → Prop) → (Π₀ (i : ι), α i) → (Π₀ (i : ι), α i) → Prop
DFinsupp.Lex r s is the lexicographic relation on Π₀ i, α i, where ι is ordered by r,
and α i is ordered by s i.
The type synonym Lex (Π₀ i, α i) has an order given by DFinsupp.Lex (· < ·) (· < ·), whereas
Colex (Π₀ i, α i) has an order given by DFinsupp.Lex (· > ·) (· < ·).
theorem Pi.lex_eq_dfinsupp_lex E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] {r : ι → ι → Prop} {s : (i : ι) → α i → α i → Prop}
(a b : Π₀ (i : ι), α i), Pi.Lex r (fun {i} ↦ s i) ⇑a ⇑b = DFinsupp.Lex r s a b
theorem DFinsupp.lex_def E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] {r : ι → ι → Prop} {s : (i : ι) → α i → α i → Prop}
{a b : Π₀ (i : ι), α i}, DFinsupp.Lex r s a b ↔ ∃ j, (∀ (d : ι), r d j → a d = b d) ∧ s j (a j) (b j)
instance DFinsupp.instLTLex E0 #
{ι : Type u_1} →
{α : ι → Type u_2} → [inst : (i : ι) → Zero (α i)] → [LT ι] → [(i : ι) → LT (α i)] → LT (Lex (Π₀ (i : ι), α i))
instance DFinsupp.instLTColex E0 #
{ι : Type u_1} →
{α : ι → Type u_2} → [inst : (i : ι) → Zero (α i)] → [LT ι] → [(i : ι) → LT (α i)] → LT (Colex (Π₀ (i : ι), α i))
theorem DFinsupp.Lex.lt_iff E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LT ι] [inst_2 : (i : ι) → LT (α i)]
{a b : Lex (Π₀ (i : ι), α i)}, a < b ↔ ∃ i, (∀ j < i, (ofLex a) j = (ofLex b) j) ∧ (ofLex a) i < (ofLex b) i
theorem DFinsupp.Colex.lt_iff E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LT ι] [inst_2 : (i : ι) → LT (α i)]
{a b : Colex (Π₀ (i : ι), α i)},
a < b ↔ ∃ i, (∀ (j : ι), i < j → (ofColex a) j = (ofColex b) j) ∧ (ofColex a) i < (ofColex b) i
theorem DFinsupp.lex_lt_of_lt_of_preorder E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : (i : ι) → Preorder (α i)] (r : ι → ι → Prop)
[IsStrictOrder ι r] {x y : Π₀ (i : ι), α i}, x < y → ∃ i, (∀ (j : ι), r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i
theorem DFinsupp.lex_lt_of_lt E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : (i : ι) → PartialOrder (α i)]
(r : ι → ι → Prop) [IsStrictOrder ι r] {x y : Π₀ (i : ι), α i}, x < y → Pi.Lex r (fun {i} x1 x2 ↦ x1 < x2) ⇑x ⇑y
theorem DFinsupp.lex_iff_of_unique E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : Unique ι] [inst_2 : (i : ι) → LT (α i)]
{r : ι → ι → Prop} [Std.Irrefl r] {x y : Π₀ (i : ι), α i},
DFinsupp.Lex r (fun x x1 x2 ↦ x1 < x2) x y ↔ x default < y default
theorem DFinsupp.Lex.lt_iff_of_unique E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : Unique ι] [inst_2 : (i : ι) → LT (α i)]
[inst_3 : Preorder ι] {x y : Lex (Π₀ (i : ι), α i)}, x < y ↔ (ofLex x) default < (ofLex y) default
theorem DFinsupp.colex_lt_iff_of_unique E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : Unique ι] [inst_2 : (i : ι) → LT (α i)]
[inst_3 : Preorder ι] {x y : Colex (Π₀ (i : ι), α i)}, x < y ↔ (ofColex x) default < (ofColex y) default
instance DFinsupp.Lex.isStrictOrder E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → PartialOrder (α i)], IsStrictOrder (Lex (Π₀ (i : ι), α i)) fun x1 x2 ↦ x1 < x2
instance DFinsupp.Colex.isStrictOrder E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → PartialOrder (α i)], IsStrictOrder (Colex (Π₀ (i : ι), α i)) fun x1 x2 ↦ x1 < x2
instance DFinsupp.Lex.partialOrder E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[LinearOrder ι] → [(i : ι) → PartialOrder (α i)] → PartialOrder (Lex (Π₀ (i : ι), α i))
The partial order on DFinsupps obtained by the lexicographic ordering.
See DFinsupp.Lex.linearOrder for a proof that this partial order is in fact linear.
instance DFinsupp.Colex.partialOrder E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[LinearOrder ι] → [(i : ι) → PartialOrder (α i)] → PartialOrder (Colex (Π₀ (i : ι), α i))
The partial order on DFinsupps obtained by the colexicographic ordering.
See DFinsupp.Colex.linearOrder for a proof that this partial order is in fact linear.
theorem DFinsupp.Lex.le_iff_of_unique E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι] [inst_2 : Unique ι]
[inst_3 : (i : ι) → PartialOrder (α i)] {x y : Lex (Π₀ (i : ι), α i)}, x ≤ y ↔ (ofLex x) default ≤ (ofLex y) default
theorem DFinsupp.Colex.le_iff_of_unique E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι] [inst_2 : Unique ι]
[inst_3 : (i : ι) → PartialOrder (α i)] {x y : Colex (Π₀ (i : ι), α i)},
x ≤ y ↔ (ofColex x) default ≤ (ofColex y) default
instance DFinsupp.Lex.total_le E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → LinearOrder (α i)], Std.Total fun x1 x2 ↦ x1 ≤ x2
instance DFinsupp.Colex.total_le E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → LinearOrder (α i)], Std.Total fun x1 x2 ↦ x1 ≤ x2
instance DFinsupp.Lex.decidableLE E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[inst_1 : LinearOrder ι] → [inst_2 : (i : ι) → LinearOrder (α i)] → DecidableLE (Lex (Π₀ (i : ι), α i))
The less-or-equal relation for the lexicographic ordering is decidable.
instance DFinsupp.Colex.decidableLE E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[inst_1 : LinearOrder ι] → [inst_2 : (i : ι) → LinearOrder (α i)] → DecidableLE (Colex (Π₀ (i : ι), α i))
The less-or-equal relation for the colexicographic ordering is decidable.
instance DFinsupp.Lex.decidableLT E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[inst_1 : LinearOrder ι] → [inst_2 : (i : ι) → LinearOrder (α i)] → DecidableLT (Lex (Π₀ (i : ι), α i))
The less-than relation for the lexicographic ordering is decidable.
instance DFinsupp.Colex.decidableLT E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[inst_1 : LinearOrder ι] → [inst_2 : (i : ι) → LinearOrder (α i)] → DecidableLT (Colex (Π₀ (i : ι), α i))
The less-than relation for the colexicographic ordering is decidable.
instance DFinsupp.Lex.linearOrder E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[LinearOrder ι] → [(i : ι) → LinearOrder (α i)] → LinearOrder (Lex (Π₀ (i : ι), α i))
The linear order on DFinsupps obtained by the lexicographic ordering.
instance DFinsupp.Colex.linearOrder E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : (i : ι) → Zero (α i)] →
[LinearOrder ι] → [(i : ι) → LinearOrder (α i)] → LinearOrder (Colex (Π₀ (i : ι), α i))
The linear order on DFinsupps obtained by the colexicographic ordering.
theorem DFinsupp.toLex_monotone E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → PartialOrder (α i)], Monotone ⇑toLex
theorem DFinsupp.toColex_monotone E1 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : (i : ι) → Zero (α i)] [inst_1 : LinearOrder ι]
[inst_2 : (i : ι) → PartialOrder (α i)], Monotone ⇑toColex
instance DFinsupp.Lex.addLeftStrictMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddLeftStrictMono (α i)], AddLeftStrictMono (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.addLeftStrictMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddLeftStrictMono (α i)],
AddLeftStrictMono (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.addLeftMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddLeftStrictMono (α i)], AddLeftMono (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.addLeftMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddLeftStrictMono (α i)], AddLeftMono (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.addRightStrictMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddRightStrictMono (α i)],
AddRightStrictMono (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.addRightStrictMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddRightStrictMono (α i)],
AddRightStrictMono (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.addRightMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddRightStrictMono (α i)], AddRightMono (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.addRightMono E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddMonoid (α i)]
[inst_2 : (i : ι) → LinearOrder (α i)] [∀ (i : ι), AddRightStrictMono (α i)], AddRightMono (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.orderBot E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : LinearOrder ι] →
[inst_1 : (i : ι) → AddCommMonoid (α i)] →
[inst_2 : (i : ι) → PartialOrder (α i)] → [∀ (i : ι), IsBotZeroClass (α i)] → OrderBot (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.isBotZeroClass E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommMonoid (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsBotZeroClass (α i)], IsBotZeroClass (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.orderBot E0 #
{ι : Type u_1} →
{α : ι → Type u_2} →
[inst : LinearOrder ι] →
[inst_1 : (i : ι) → AddCommMonoid (α i)] →
[inst_2 : (i : ι) → PartialOrder (α i)] → [∀ (i : ι), IsBotZeroClass (α i)] → OrderBot (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.isBotZeroClass E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommMonoid (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsBotZeroClass (α i)], IsBotZeroClass (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.isOrderedCancelAddMonoid E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommMonoid (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsOrderedCancelAddMonoid (α i)],
IsOrderedCancelAddMonoid (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.isOrderedCancelAddMonoid E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommMonoid (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsOrderedCancelAddMonoid (α i)],
IsOrderedCancelAddMonoid (Colex (Π₀ (i : ι), α i))
instance DFinsupp.Lex.isOrderedAddMonoid E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommGroup (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsOrderedAddMonoid (α i)],
IsOrderedAddMonoid (Lex (Π₀ (i : ι), α i))
instance DFinsupp.Colex.isOrderedAddMonoid E0 #
∀ {ι : Type u_1} {α : ι → Type u_2} [inst : LinearOrder ι] [inst_1 : (i : ι) → AddCommGroup (α i)]
[inst_2 : (i : ι) → PartialOrder (α i)] [∀ (i : ι), IsOrderedAddMonoid (α i)],
IsOrderedAddMonoid (Colex (Π₀ (i : ι), α i))