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 / V04. Order and lattices

Mathlib.Order.Interval.Multiset

66 declarations. Mathlib docs · Source

Intervals as multisets

This file defines intervals as multisets.

Main declarations

In a LocallyFiniteOrder,

  • Multiset.Icc: Closed-closed interval as a multiset.
  • Multiset.Ico: Closed-open interval as a multiset.
  • Multiset.Ioc: Open-closed interval as a multiset.
  • Multiset.Ioo: Open-open interval as a multiset.

In a LocallyFiniteOrderTop,

  • Multiset.Ici: Closed-infinite interval as a multiset.
  • Multiset.Ioi: Open-infinite interval as a multiset.

In a LocallyFiniteOrderBot,

  • Multiset.Iic: Infinite-open interval as a multiset.
  • Multiset.Iio: Infinite-closed interval as a multiset.

TODO

Do we really need this file at all? (March 2024)

def Multiset.Icc E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrder α] → α → α → Multiset α

The multiset of elements x such that a ≤ x and x ≤ b. Basically Set.Icc a b as a multiset.

def Multiset.Ico E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrder α] → α → α → Multiset α

The multiset of elements x such that a ≤ x and x < b. Basically Set.Ico a b as a multiset.

def Multiset.Ioc E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrder α] → α → α → Multiset α

The multiset of elements x such that a < x and x ≤ b. Basically Set.Ioc a b as a multiset.

def Multiset.Ioo E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrder α] → α → α → Multiset α

The multiset of elements x such that a < x and x < b. Basically Set.Ioo a b as a multiset.

theorem Multiset.mem_Icc E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b x : α}, x ∈ Multiset.Icc a b ↔ a ≤ x ∧ x ≤ b

theorem Multiset.mem_Ico E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b x : α}, x ∈ Multiset.Ico a b ↔ a ≤ x ∧ x < b

theorem Multiset.mem_Ioc E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b x : α}, x ∈ Multiset.Ioc a b ↔ a < x ∧ x ≤ b

theorem Multiset.mem_Ioo E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b x : α}, x ∈ Multiset.Ioo a b ↔ a < x ∧ x < b

def Multiset.Ici E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrderTop α] → α → Multiset α

The multiset of elements x such that a ≤ x. Basically Set.Ici a as a multiset.

def Multiset.Ioi E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrderTop α] → α → Multiset α

The multiset of elements x such that a < x. Basically Set.Ioi a as a multiset.

theorem Multiset.mem_Ici E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrderTop α] {a x : α}, x ∈ Multiset.Ici a ↔ a ≤ x

theorem Multiset.mem_Ioi E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrderTop α] {a x : α}, x ∈ Multiset.Ioi a ↔ a < x

def Multiset.Iic E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrderBot α] → α → Multiset α

The multiset of elements x such that x ≤ b. Basically Set.Iic b as a multiset.

def Multiset.Iio E3 #

{α : Type u_1} → [inst : Preorder α] → [LocallyFiniteOrderBot α] → α → Multiset α

The multiset of elements x such that x < b. Basically Set.Iio b as a multiset.

theorem Multiset.mem_Iic E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrderBot α] {b x : α}, x ∈ Multiset.Iic b ↔ x ≤ b

theorem Multiset.mem_Iio E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrderBot α] {b x : α}, x ∈ Multiset.Iio b ↔ x < b

theorem Multiset.nodup_Icc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, (Multiset.Icc a b).Nodup

theorem Multiset.nodup_Ico E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, (Multiset.Ico a b).Nodup

theorem Multiset.nodup_Ioc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, (Multiset.Ioc a b).Nodup

theorem Multiset.nodup_Ioo E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, (Multiset.Ioo a b).Nodup

theorem Multiset.Icc_eq_zero_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, Multiset.Icc a b = 0 ↔ ¬a ≤ b

theorem Multiset.Ico_eq_zero_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, Multiset.Ico a b = 0 ↔ ¬a < b

theorem Multiset.Ioc_eq_zero_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, Multiset.Ioc a b = 0 ↔ ¬a < b

theorem Multiset.Ioo_eq_zero_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α} [DenselyOrdered α],
  Multiset.Ioo a b = 0 ↔ ¬a < b

theorem Multiset.Icc_eq_zero E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, ¬a ≤ b → Multiset.Icc a b = 0

Alias of the reverse direction of Multiset.Icc_eq_zero_iff.

theorem Multiset.Ico_eq_zero E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, ¬a < b → Multiset.Ico a b = 0

Alias of the reverse direction of Multiset.Ico_eq_zero_iff.

theorem Multiset.Ioc_eq_zero E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, ¬a < b → Multiset.Ioc a b = 0

Alias of the reverse direction of Multiset.Ioc_eq_zero_iff.

theorem Multiset.Ioo_eq_zero E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, ¬a < b → Multiset.Ioo a b = 0

theorem Multiset.Icc_eq_zero_of_lt E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b < a → Multiset.Icc a b = 0

theorem Multiset.Ico_eq_zero_of_le E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ≤ a → Multiset.Ico a b = 0

theorem Multiset.Ioc_eq_zero_of_le E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ≤ a → Multiset.Ioc a b = 0

theorem Multiset.Ioo_eq_zero_of_le E0 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ≤ a → Multiset.Ioo a b = 0

theorem Multiset.Ico_self E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] (a : α), Multiset.Ico a a = 0

theorem Multiset.Ioc_self E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] (a : α), Multiset.Ioc a a = 0

theorem Multiset.Ioo_self E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] (a : α), Multiset.Ioo a a = 0

theorem Multiset.left_mem_Icc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, a ∈ Multiset.Icc a b ↔ a ≤ b

theorem Multiset.left_mem_Ico E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, a ∈ Multiset.Ico a b ↔ a < b

theorem Multiset.right_mem_Icc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ∈ Multiset.Icc a b ↔ a ≤ b

theorem Multiset.right_mem_Ioc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ∈ Multiset.Ioc a b ↔ a < b

theorem Multiset.left_notMem_Ioc E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, a ∉ Multiset.Ioc a b

theorem Multiset.left_notMem_Ioo E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, a ∉ Multiset.Ioo a b

theorem Multiset.right_notMem_Ico E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ∉ Multiset.Ico a b

theorem Multiset.right_notMem_Ioo E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α}, b ∉ Multiset.Ioo a b

theorem Multiset.Ico_filter_lt_of_le_left E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b c : α} [inst_2 : DecidablePred fun x ↦ x < c],
  c ≤ a → Multiset.filter (fun x ↦ x < c) (Multiset.Ico a b) = ∅

theorem Multiset.Ico_filter_lt_of_right_le E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b c : α} [inst_2 : DecidablePred fun x ↦ x < c],
  b ≤ c → Multiset.filter (fun x ↦ x < c) (Multiset.Ico a b) = Multiset.Ico a b

theorem Multiset.Ico_filter_lt_of_le_right E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b c : α} [inst_2 : DecidablePred fun x ↦ x < c],
  c ≤ b → Multiset.filter (fun x ↦ x < c) (Multiset.Ico a b) = Multiset.Ico a c

theorem Multiset.Ico_filter_le_of_le_left E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b c : α} [inst_2 : DecidablePred fun x ↦ c ≤ x],
  c ≤ a → Multiset.filter (fun x ↦ c ≤ x) (Multiset.Ico a b) = Multiset.Ico a b

theorem Multiset.Ico_filter_le_of_right_le E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b : α} [inst_2 : DecidablePred fun x ↦ b ≤ x],
  Multiset.filter (fun x ↦ b ≤ x) (Multiset.Ico a b) = ∅

theorem Multiset.Ico_filter_le_of_left_le E1 #

∀ {α : Type u_1} [inst : Preorder α] [inst_1 : LocallyFiniteOrder α] {a b c : α} [inst_2 : DecidablePred fun x ↦ c ≤ x],
  a ≤ c → Multiset.filter (fun x ↦ c ≤ x) (Multiset.Ico a b) = Multiset.Ico c b

theorem Multiset.Icc_self E0 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] (a : α), Multiset.Icc a a = {a}

theorem Multiset.Ico_cons_right E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] {a b : α},
  a ≤ b → b ::ₘ Multiset.Ico a b = Multiset.Icc a b

theorem Multiset.Ioo_cons_left E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] {a b : α},
  a < b → a ::ₘ Multiset.Ioo a b = Multiset.Ico a b

theorem Multiset.Ico_disjoint_Ico E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] {a b c d : α},
  b ≤ c → Disjoint (Multiset.Ico a b) (Multiset.Ico c d)

theorem Multiset.Ico_inter_Ico_of_le E0 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] [inst_2 : DecidableEq α] {a b c d : α},
  b ≤ c → Multiset.Ico a b ∩ Multiset.Ico c d = 0

theorem Multiset.Ico_filter_le_left E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] {a b : α}
  [inst_2 : DecidablePred fun x ↦ x ≤ a], a < b → Multiset.filter (fun x ↦ x ≤ a) (Multiset.Ico a b) = {a}

theorem Multiset.card_Ico_eq_card_Icc_sub_one E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] (a b : α),
  (Multiset.Ico a b).card = (Multiset.Icc a b).card - 1

theorem Multiset.card_Ioc_eq_card_Icc_sub_one E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] (a b : α),
  (Multiset.Ioc a b).card = (Multiset.Icc a b).card - 1

theorem Multiset.card_Ioo_eq_card_Ico_sub_one E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] (a b : α),
  (Multiset.Ioo a b).card = (Multiset.Ico a b).card - 1

theorem Multiset.card_Ioo_eq_card_Icc_sub_two E1 #

∀ {α : Type u_1} [inst : PartialOrder α] [inst_1 : LocallyFiniteOrder α] (a b : α),
  (Multiset.Ioo a b).card = (Multiset.Icc a b).card - 2

theorem Multiset.Ico_subset_Ico_iff E0 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] {a₁ b₁ a₂ b₂ : α},
  a₁ < b₁ → (Multiset.Ico a₁ b₁ ⊆ Multiset.Ico a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂)

theorem Multiset.Ico_add_Ico_eq_Ico E1 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] {a b c : α},
  a ≤ b → b ≤ c → Multiset.Ico a b + Multiset.Ico b c = Multiset.Ico a c

theorem Multiset.Ico_inter_Ico E1 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] {a b c d : α},
  Multiset.Ico a b ∩ Multiset.Ico c d = Multiset.Ico (max a c) (min b d)

theorem Multiset.Ico_filter_lt E0 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] (a b c : α),
  Multiset.filter (fun x ↦ x < c) (Multiset.Ico a b) = Multiset.Ico a (min b c)

theorem Multiset.Ico_filter_le E0 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] (a b c : α),
  Multiset.filter (fun x ↦ c ≤ x) (Multiset.Ico a b) = Multiset.Ico (max a c) b

theorem Multiset.Ico_sub_Ico_left E0 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] (a b c : α),
  Multiset.Ico a b - Multiset.Ico a c = Multiset.Ico (max a c) b

theorem Multiset.Ico_sub_Ico_right E0 #

∀ {α : Type u_1} [inst : LinearOrder α] [inst_1 : LocallyFiniteOrder α] (a b c : α),
  Multiset.Ico a b - Multiset.Ico c b = Multiset.Ico a (min b c)