# Extensional dependent tree map lemmas #

This file contains lemmas about `Std.ExtDTreeMap`.

source
def Std.ExtDTreeMap.instCoeTypeForall_1 {α : Type u} :
Coe (Type v) (α → Type v)
Equations

- Std.ExtDTreeMap.instCoeTypeForall_1 = { coe := fun (γ : Type ?u.10) (x : α) => γ }

Instances For

source
@[simp]
theorem Std.ExtDTreeMap.isEmpty_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} :
∅.isEmpty = true
source
@[simp]
theorem Std.ExtDTreeMap.empty_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} :
∅ = t ↔ t = ∅
source
@[simp]
theorem Std.ExtDTreeMap.insert_ne_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
t.insert k v ≠ ∅
source
theorem Std.ExtDTreeMap.mem_iff_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
k ∈ t ↔ t.contains k = true
source
@[simp]
theorem Std.ExtDTreeMap.contains_iff_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
t.contains k = true ↔ k ∈ t
source
theorem Std.ExtDTreeMap.contains_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' : α} (hab : cmp k k' = Ordering.eq) :
t.contains k = t.contains k'
source
theorem Std.ExtDTreeMap.mem_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' : α} (hab : cmp k k' = Ordering.eq) :
k ∈ t ↔ k' ∈ t
source
@[simp]
theorem Std.ExtDTreeMap.contains_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} :
∅.contains k = false
source
@[simp]
theorem Std.ExtDTreeMap.not_mem_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} :
¬k ∈ ∅
source
theorem Std.ExtDTreeMap.eq_empty_iff_forall_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t = ∅ ↔ ∀ (a : α), t.contains a = false
source
theorem Std.ExtDTreeMap.eq_empty_iff_forall_not_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t = ∅ ↔ ∀ (a : α), ¬a ∈ t
source
theorem Std.ExtDTreeMap.ne_empty_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} (h : a ∈ t) :
t ≠ ∅
source
@[simp]
theorem Std.ExtDTreeMap.insert_eq_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {p : (a : α) × β a} :
Insert.insert p t = t.insert p.fst p.snd
source
@[simp]
theorem Std.ExtDTreeMap.singleton_eq_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {p : (a : α) × β a} :
{p} = ∅.insert p.fst p.snd
source
@[simp]
theorem Std.ExtDTreeMap.contains_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
(t.insert k v).contains a = (cmp k a == Ordering.eq || t.contains a)
source
@[simp]
theorem Std.ExtDTreeMap.mem_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
a ∈ t.insert k v ↔ cmp k a = Ordering.eq ∨ a ∈ t
source
theorem Std.ExtDTreeMap.contains_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).contains k = true
source
theorem Std.ExtDTreeMap.mem_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
k ∈ t.insert k v
source
theorem Std.ExtDTreeMap.contains_of_contains_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
(t.insert k v).contains a = true → cmp k a ≠ Ordering.eq → t.contains a = true
source
theorem Std.ExtDTreeMap.mem_of_mem_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
a ∈ t.insert k v → cmp k a ≠ Ordering.eq → a ∈ t
source
@[simp]
theorem Std.ExtDTreeMap.size_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} :
∅.size = 0
source
theorem Std.ExtDTreeMap.isEmpty_eq_size_beq_zero {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} :
t.isEmpty = (t.size == 0)
source
theorem Std.ExtDTreeMap.eq_empty_iff_size_eq_zero {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t = ∅ ↔ t.size = 0
source
theorem Std.ExtDTreeMap.size_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).size = if t.contains k = true then t.size else t.size + 1
source
theorem Std.ExtDTreeMap.size_le_size_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
t.size ≤ (t.insert k v).size
source
theorem Std.ExtDTreeMap.size_insert_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).size ≤ t.size + 1
source
@[simp]
theorem Std.ExtDTreeMap.erase_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} :
∅.erase k = ∅
source
@[simp]
theorem Std.ExtDTreeMap.erase_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
t.erase k = ∅ ↔ t = ∅ ∨ t.size = 1 ∧ k ∈ t
source
theorem Std.ExtDTreeMap.eq_empty_iff_erase_eq_empty_and_not_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (k : α) :
t = ∅ ↔ t.erase k = ∅ ∧ ¬k ∈ t
source
theorem Std.ExtDTreeMap.ne_empty_of_erase_ne_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (h : t.erase k ≠ ∅) :
t ≠ ∅
source
@[simp]
theorem Std.ExtDTreeMap.contains_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} :
(t.erase k).contains a = (cmp k a != Ordering.eq && t.contains a)
source
@[simp]
theorem Std.ExtDTreeMap.mem_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} :
a ∈ t.erase k ↔ cmp k a ≠ Ordering.eq ∧ a ∈ t
source
theorem Std.ExtDTreeMap.contains_of_contains_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} :
(t.erase k).contains a = true → t.contains a = true
source
theorem Std.ExtDTreeMap.mem_of_mem_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} :
a ∈ t.erase k → a ∈ t
source
theorem Std.ExtDTreeMap.size_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(t.erase k).size = if t.contains k = true then t.size - 1 else t.size
source
theorem Std.ExtDTreeMap.size_erase_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(t.erase k).size ≤ t.size
source
theorem Std.ExtDTreeMap.size_le_size_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
t.size ≤ (t.erase k).size + 1
source
@[simp]
theorem Std.ExtDTreeMap.containsThenInsert_fst {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.containsThenInsert k v).fst = t.contains k
source
@[simp]
theorem Std.ExtDTreeMap.containsThenInsert_snd {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.containsThenInsert k v).snd = t.insert k v
source
@[simp]
theorem Std.ExtDTreeMap.containsThenInsertIfNew_fst {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.containsThenInsertIfNew k v).fst = t.contains k
source
@[simp]
theorem Std.ExtDTreeMap.containsThenInsertIfNew_snd {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.containsThenInsertIfNew k v).snd = t.insertIfNew k v
source
@[simp]
theorem Std.ExtDTreeMap.get?_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
∅.get? a = none
source
theorem Std.ExtDTreeMap.get?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a k : α} {v : β k} :
(t.insert k v).get? a = if h : cmp k a = Ordering.eq then some (cast ⋯ v) else t.get? a
source
@[simp]
theorem Std.ExtDTreeMap.get?_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
(t.insert k v).get? k = some v
source
theorem Std.ExtDTreeMap.contains_eq_isSome_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
t.contains a = (t.get? a).isSome
source
@[simp]
theorem Std.ExtDTreeMap.isSome_get?_eq_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
(t.get? a).isSome = t.contains a
source
theorem Std.ExtDTreeMap.mem_iff_isSome_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
a ∈ t ↔ (t.get? a).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.isSome_get?_iff_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
(t.get? a).isSome = true ↔ a ∈ t
source
theorem Std.ExtDTreeMap.get?_eq_some_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
t.get? k = some v ↔ ∃ (h : k ∈ t), t.get k h = v
source
theorem Std.ExtDTreeMap.get?_eq_none_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
t.contains a = false → t.get? a = none
source
theorem Std.ExtDTreeMap.get?_eq_none {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} :
¬a ∈ t → t.get? a = none
source
theorem Std.ExtDTreeMap.get?_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} :
(t.erase k).get? a = if cmp k a = Ordering.eq then none else t.get? a
source
@[simp]
theorem Std.ExtDTreeMap.get?_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} :
(t.erase k).get? k = none
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_empty {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {a : α} :
get? ∅ a = none
source
theorem Std.ExtDTreeMap.Const.get?_insert {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a k : α} {v : β} :
get? (t.insert k v) a = if cmp k a = Ordering.eq then some v else get? t a
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_insert_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
get? (t.insert k v) k = some v
source
theorem Std.ExtDTreeMap.Const.contains_eq_isSome_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
t.contains a = (get? t a).isSome
source
@[simp]
theorem Std.ExtDTreeMap.Const.isSome_get?_eq_contains {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
(get? t a).isSome = t.contains a
source
theorem Std.ExtDTreeMap.Const.mem_iff_isSome_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
a ∈ t ↔ (get? t a).isSome = true
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
get? t k = some v ↔ ∃ (h : k ∈ t), get t k h = v
source
@[simp]
theorem Std.ExtDTreeMap.Const.isSome_get?_iff_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
(get? t a).isSome = true ↔ a ∈ t
source
theorem Std.ExtDTreeMap.Const.get?_eq_none_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
t.contains a = false → get? t a = none
source
theorem Std.ExtDTreeMap.Const.get?_eq_none {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} :
¬a ∈ t → get? t a = none
source
theorem Std.ExtDTreeMap.Const.get?_erase {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} :
get? (t.erase k) a = if cmp k a = Ordering.eq then none else get? t a
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_erase_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} :
get? (t.erase k) k = none
source
theorem Std.ExtDTreeMap.Const.get?_eq_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [LawfulEqCmp cmp] [TransCmp cmp] {a : α} :
get? t a = t.get? a
source
theorem Std.ExtDTreeMap.Const.get?_congr {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a b : α} (hab : cmp a b = Ordering.eq) :
get? t a = get? t b
source
theorem Std.ExtDTreeMap.get_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {v : β k} {h₁ : a ∈ t.insert k v} :
(t.insert k v).get a h₁ = if h₂ : cmp k a = Ordering.eq then cast ⋯ v else t.get a ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
(t.insert k v).get k ⋯ = v
source
@[simp]
theorem Std.ExtDTreeMap.get_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {h' : a ∈ t.erase k} :
(t.erase k).get a h' = t.get a ⋯
source
theorem Std.ExtDTreeMap.get?_eq_some_get {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} (h' : a ∈ t) :
t.get? a = some (t.get a h')
source
theorem Std.ExtDTreeMap.get_eq_get_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {h : a ∈ t} :
t.get a h = (t.get? a).get ⋯
source
theorem Std.ExtDTreeMap.get_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {h : (t.get? a).isSome = true} :
(t.get? a).get h = t.get a ⋯
source
theorem Std.ExtDTreeMap.Const.get_insert {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {v : β} {h₁ : a ∈ t.insert k v} :
get (t.insert k v) a h₁ = if h₂ : cmp k a = Ordering.eq then v else get t a ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_insert_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
get (t.insert k v) k ⋯ = v
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_erase {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {h' : a ∈ t.erase k} :
get (t.erase k) a h' = get t a ⋯
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_get {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} (h : a ∈ t) :
get? t a = some (get t a h)
source
theorem Std.ExtDTreeMap.Const.get_eq_get_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {h : a ∈ t} :
get t a h = (get? t a).get ⋯
source
theorem Std.ExtDTreeMap.Const.get_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {h : (get? t a).isSome = true} :
(get? t a).get h = get t a ⋯
source
theorem Std.ExtDTreeMap.Const.get_eq_get {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {h : a ∈ t} :
get t a h = t.get a h
source
theorem Std.ExtDTreeMap.Const.get_congr {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a b : α} (hab : cmp a b = Ordering.eq) {h' : a ∈ t} :
get t a h' = get t b ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get!_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
∅.get! a = default
source
theorem Std.ExtDTreeMap.get!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} [Inhabited (β a)] {v : β k} :
(t.insert k v).get! a = if h : cmp k a = Ordering.eq then cast ⋯ v else t.get! a
source
@[simp]
theorem Std.ExtDTreeMap.get!_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] {b : β a} :
(t.insert a b).get! a = b
source
theorem Std.ExtDTreeMap.get!_eq_default_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
t.contains a = false → t.get! a = default
source
theorem Std.ExtDTreeMap.get!_eq_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
¬a ∈ t → t.get! a = default
source
theorem Std.ExtDTreeMap.get!_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} [Inhabited (β a)] :
(t.erase k).get! a = if cmp k a = Ordering.eq then default else t.get! a
source
@[simp]
theorem Std.ExtDTreeMap.get!_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} [Inhabited (β k)] :
(t.erase k).get! k = default
source
theorem Std.ExtDTreeMap.get?_eq_some_get!_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
t.contains a = true → t.get? a = some (t.get! a)
source
theorem Std.ExtDTreeMap.get?_eq_some_get! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
a ∈ t → t.get? a = some (t.get! a)
source
theorem Std.ExtDTreeMap.get!_eq_get!_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
t.get! a = (t.get? a).get!
source
theorem Std.ExtDTreeMap.get_eq_get! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] {h : a ∈ t} :
t.get a h = t.get! a
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_empty {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [Inhabited β] {a : α} :
get! ∅ a = default
source
theorem Std.ExtDTreeMap.Const.get!_insert {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {k a : α} {v : β} :
get! (t.insert k v) a = if cmp k a = Ordering.eq then v else get! t a
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_insert_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {k : α} {v : β} :
get! (t.insert k v) k = v
source
theorem Std.ExtDTreeMap.Const.get!_eq_default_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
t.contains a = false → get! t a = default
source
theorem Std.ExtDTreeMap.Const.get!_eq_default {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
¬a ∈ t → get! t a = default
source
theorem Std.ExtDTreeMap.Const.get!_erase {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {k a : α} :
get! (t.erase k) a = if cmp k a = Ordering.eq then default else get! t a
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_erase_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {k : α} :
get! (t.erase k) k = default
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_get!_of_contains {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
t.contains a = true → get? t a = some (get! t a)
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_get! {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
a ∈ t → get? t a = some (get! t a)
source
theorem Std.ExtDTreeMap.Const.get!_eq_get!_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
get! t a = (get? t a).get!
source
theorem Std.ExtDTreeMap.Const.get_eq_get! {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} {h : a ∈ t} :
get t a h = get! t a
source
theorem Std.ExtDTreeMap.Const.get!_eq_get! {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited β] {a : α} :
get! t a = t.get! a
source
theorem Std.ExtDTreeMap.Const.get!_congr {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a b : α} (hab : cmp a b = Ordering.eq) :
get! t a = get! t b
source
@[simp]
theorem Std.ExtDTreeMap.getD_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
∅.getD a fallback = fallback
source
theorem Std.ExtDTreeMap.getD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {fallback : β a} {v : β k} :
(t.insert k v).getD a fallback = if h : cmp k a = Ordering.eq then cast ⋯ v else t.getD a fallback
source
@[simp]
theorem Std.ExtDTreeMap.getD_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback b : β a} :
(t.insert a b).getD a fallback = b
source
theorem Std.ExtDTreeMap.getD_eq_fallback_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
t.contains a = false → t.getD a fallback = fallback
source
theorem Std.ExtDTreeMap.getD_eq_fallback {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
¬a ∈ t → t.getD a fallback = fallback
source
theorem Std.ExtDTreeMap.getD_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {fallback : β a} :
(t.erase k).getD a fallback = if cmp k a = Ordering.eq then fallback else t.getD a fallback
source
@[simp]
theorem Std.ExtDTreeMap.getD_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {fallback : β k} :
(t.erase k).getD k fallback = fallback
source
theorem Std.ExtDTreeMap.get?_eq_some_getD_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
t.contains a = true → t.get? a = some (t.getD a fallback)
source
theorem Std.ExtDTreeMap.get?_eq_some_getD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
a ∈ t → t.get? a = some (t.getD a fallback)
source
theorem Std.ExtDTreeMap.getD_eq_getD_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} :
t.getD a fallback = (t.get? a).getD fallback
source
theorem Std.ExtDTreeMap.get_eq_getD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β a} {h : a ∈ t} :
t.get a h = t.getD a fallback
source
theorem Std.ExtDTreeMap.get!_eq_getD_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} [Inhabited (β a)] :
t.get! a = t.getD a default
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_empty {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {a : α} {fallback : β} :
getD ∅ a fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getD_insert {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {fallback v : β} :
getD (t.insert k v) a fallback = if cmp k a = Ordering.eq then v else getD t a fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_insert_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {fallback v : β} :
getD (t.insert k v) k fallback = v
source
theorem Std.ExtDTreeMap.Const.getD_eq_fallback_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} :
t.contains a = false → getD t a fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getD_eq_fallback {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} :
¬a ∈ t → getD t a fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getD_erase {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {fallback : β} :
getD (t.erase k) a fallback = if cmp k a = Ordering.eq then fallback else getD t a fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_erase_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {fallback : β} :
getD (t.erase k) k fallback = fallback
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_getD_of_contains {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} :
t.contains a = true → get? t a = some (getD t a fallback)
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_getD {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} :
a ∈ t → get? t a = some (getD t a fallback)
source
theorem Std.ExtDTreeMap.Const.getD_eq_getD_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} :
getD t a fallback = (get? t a).getD fallback
source
theorem Std.ExtDTreeMap.Const.get_eq_getD {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a : α} {fallback : β} {h : a ∈ t} :
get t a h = getD t a fallback
source
theorem Std.ExtDTreeMap.Const.get!_eq_getD_default {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {a : α} :
get! t a = getD t a default
source
theorem Std.ExtDTreeMap.Const.getD_eq_getD {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {a : α} {fallback : β} :
getD t a fallback = t.getD a fallback
source
theorem Std.ExtDTreeMap.Const.getD_congr {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {a b : α} {fallback : β} (hab : cmp a b = Ordering.eq) :
getD t a fallback = getD t b fallback
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {a : α} :
∅.getKey? a = none
source
theorem Std.ExtDTreeMap.getKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a k : α} {v : β k} :
(t.insert k v).getKey? a = if cmp k a = Ordering.eq then some k else t.getKey? a
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).getKey? k = some k
source
theorem Std.ExtDTreeMap.contains_eq_isSome_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
t.contains a = (t.getKey? a).isSome
source
@[simp]
theorem Std.ExtDTreeMap.isSome_getKey?_eq_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
(t.getKey? a).isSome = t.contains a
source
theorem Std.ExtDTreeMap.mem_iff_isSome_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
a ∈ t ↔ (t.getKey? a).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.isSome_getKey?_iff_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
(t.getKey? a).isSome = true ↔ a ∈ t
source
theorem Std.ExtDTreeMap.mem_of_getKey?_eq_some {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' : α} :
t.getKey? k = some k' → k' ∈ t
source
theorem Std.ExtDTreeMap.getKey?_eq_some_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' : α} :
t.getKey? k = some k' ↔ ∃ (h : k ∈ t), t.getKey k h = k'
source
theorem Std.ExtDTreeMap.getKey?_eq_none_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
t.contains a = false → t.getKey? a = none
source
theorem Std.ExtDTreeMap.getKey?_eq_none {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} :
¬a ∈ t → t.getKey? a = none
source
theorem Std.ExtDTreeMap.getKey?_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} :
(t.erase k).getKey? a = if cmp k a = Ordering.eq then none else t.getKey? a
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(t.erase k).getKey? k = none
source
theorem Std.ExtDTreeMap.compare_getKey?_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
Option.all (fun (x : α) => decide (cmp x k = Ordering.eq)) (t.getKey? k) = true
source
theorem Std.ExtDTreeMap.getKey?_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' : α} (h' : cmp k k' = Ordering.eq) :
t.getKey? k = t.getKey? k'
source
theorem Std.ExtDTreeMap.getKey?_eq_some_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} (h' : t.contains k = true) :
t.getKey? k = some k
source
theorem Std.ExtDTreeMap.getKey?_eq_some {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} (h' : k ∈ t) :
t.getKey? k = some k
source
theorem Std.ExtDTreeMap.getKey_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} {h₁ : a ∈ t.insert k v} :
(t.insert k v).getKey a h₁ = if h₂ : cmp k a = Ordering.eq then k else t.getKey a ⋯
source
@[simp]
theorem Std.ExtDTreeMap.getKey_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).getKey k ⋯ = k
source
@[simp]
theorem Std.ExtDTreeMap.getKey_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {h' : a ∈ t.erase k} :
(t.erase k).getKey a h' = t.getKey a ⋯
source
theorem Std.ExtDTreeMap.getKey?_eq_some_getKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} (h' : a ∈ t) :
t.getKey? a = some (t.getKey a h')
source
theorem Std.ExtDTreeMap.getKey_eq_get_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} {h : a ∈ t} :
t.getKey a h = (t.getKey? a).get ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a : α} {h : (t.getKey? a).isSome = true} :
(t.getKey? a).get h = t.getKey a ⋯
source
theorem Std.ExtDTreeMap.compare_getKey_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (h' : k ∈ t) :
cmp (t.getKey k h') k = Ordering.eq
source
theorem Std.ExtDTreeMap.getKey_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k₁ k₂ : α} (h' : cmp k₁ k₂ = Ordering.eq) (h₁ : k₁ ∈ t) :
t.getKey k₁ h₁ = t.getKey k₂ ⋯
source
@[simp]
theorem Std.ExtDTreeMap.getKey_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} (h' : k ∈ t) :
t.getKey k h' = k
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {a : α} [Inhabited α] :
∅.getKey! a = default
source
theorem Std.ExtDTreeMap.getKey!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k a : α} {v : β k} :
(t.insert k v).getKey! a = if cmp k a = Ordering.eq then k else t.getKey! a
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} {b : β a} :
(t.insert a b).getKey! a = a
source
theorem Std.ExtDTreeMap.getKey!_eq_default_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
t.contains a = false → t.getKey! a = default
source
theorem Std.ExtDTreeMap.getKey!_eq_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
¬a ∈ t → t.getKey! a = default
source
theorem Std.ExtDTreeMap.getKey!_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k a : α} :
(t.erase k).getKey! a = if cmp k a = Ordering.eq then default else t.getKey! a
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} :
(t.erase k).getKey! k = default
source
theorem Std.ExtDTreeMap.getKey?_eq_some_getKey!_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
t.contains a = true → t.getKey? a = some (t.getKey! a)
source
theorem Std.ExtDTreeMap.getKey?_eq_some_getKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
a ∈ t → t.getKey? a = some (t.getKey! a)
source
theorem Std.ExtDTreeMap.getKey!_eq_get!_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
t.getKey! a = (t.getKey? a).get!
source
theorem Std.ExtDTreeMap.getKey_eq_getKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} {h : a ∈ t} :
t.getKey a h = t.getKey! a
source
theorem Std.ExtDTreeMap.getKey!_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k k' : α} (h' : cmp k k' = Ordering.eq) :
t.getKey! k = t.getKey! k'
source
theorem Std.ExtDTreeMap.getKey!_eq_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} (h' : t.contains k = true) :
t.getKey! k = k
source
theorem Std.ExtDTreeMap.getKey!_eq_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} (h' : k ∈ t) :
t.getKey! k = k
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {a fallback : α} :
∅.getKeyD a fallback = fallback
source
theorem Std.ExtDTreeMap.getKeyD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a fallback : α} {v : β k} :
(t.insert k v).getKeyD a fallback = if cmp k a = Ordering.eq then k else t.getKeyD a fallback
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_insert_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} {b : β a} :
(t.insert a b).getKeyD a fallback = a
source
theorem Std.ExtDTreeMap.getKeyD_eq_fallback_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} :
t.contains a = false → t.getKeyD a fallback = fallback
source
theorem Std.ExtDTreeMap.getKeyD_eq_fallback {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} :
¬a ∈ t → t.getKeyD a fallback = fallback
source
theorem Std.ExtDTreeMap.getKeyD_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a fallback : α} :
(t.erase k).getKeyD a fallback = if cmp k a = Ordering.eq then fallback else t.getKeyD a fallback
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_erase_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k fallback : α} :
(t.erase k).getKeyD k fallback = fallback
source
theorem Std.ExtDTreeMap.getKey?_eq_some_getKeyD_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} :
t.contains a = true → t.getKey? a = some (t.getKeyD a fallback)
source
theorem Std.ExtDTreeMap.getKey?_eq_some_getKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} :
a ∈ t → t.getKey? a = some (t.getKeyD a fallback)
source
theorem Std.ExtDTreeMap.getKeyD_eq_getD_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} :
t.getKeyD a fallback = (t.getKey? a).getD fallback
source
theorem Std.ExtDTreeMap.getKey_eq_getKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {a fallback : α} {h : a ∈ t} :
t.getKey a h = t.getKeyD a fallback
source
theorem Std.ExtDTreeMap.getKey!_eq_getKeyD_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {a : α} :
t.getKey! a = t.getKeyD a default
source
theorem Std.ExtDTreeMap.getKeyD_congr {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k k' fallback : α} (h' : cmp k k' = Ordering.eq) :
t.getKeyD k fallback = t.getKeyD k' fallback
source
theorem Std.ExtDTreeMap.getKeyD_eq_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k fallback : α} (h' : t.contains k = true) :
t.getKeyD k fallback = k
source
theorem Std.ExtDTreeMap.getKeyD_eq_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k fallback : α} (h' : k ∈ t) :
t.getKeyD k fallback = k
source
@[simp]
theorem Std.ExtDTreeMap.insertIfNew_ne_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
t.insertIfNew k v ≠ ∅
source
@[simp]
theorem Std.ExtDTreeMap.contains_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
(t.insertIfNew k v).contains a = (cmp k a == Ordering.eq || t.contains a)
source
@[simp]
theorem Std.ExtDTreeMap.mem_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
a ∈ t.insertIfNew k v ↔ cmp k a = Ordering.eq ∨ a ∈ t
source
theorem Std.ExtDTreeMap.contains_insertIfNew_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).contains k = true
source
theorem Std.ExtDTreeMap.mem_insertIfNew_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
k ∈ t.insertIfNew k v
source
theorem Std.ExtDTreeMap.contains_of_contains_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
(t.insertIfNew k v).contains a = true → cmp k a ≠ Ordering.eq → t.contains a = true
source
theorem Std.ExtDTreeMap.mem_of_mem_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
a ∈ t.insertIfNew k v → cmp k a ≠ Ordering.eq → a ∈ t
source
theorem Std.ExtDTreeMap.mem_of_mem_insertIfNew' {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
a ∈ t.insertIfNew k v → ¬(cmp k a = Ordering.eq ∧ ¬k ∈ t) → a ∈ t

This is a restatement of `mem_of_mem_insertIfNew` that is written to exactly match the proof obligation in the statement of `get_insertIfNew`.

source
theorem Std.ExtDTreeMap.size_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).size = if k ∈ t then t.size else t.size + 1
source
theorem Std.ExtDTreeMap.size_le_size_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
t.size ≤ (t.insertIfNew k v).size
source
theorem Std.ExtDTreeMap.size_insertIfNew_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).size ≤ t.size + 1
source
theorem Std.ExtDTreeMap.get?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {v : β k} :
(t.insertIfNew k v).get? a = if h : cmp k a = Ordering.eq ∧ ¬k ∈ t then some (cast ⋯ v) else t.get? a
source
theorem Std.ExtDTreeMap.get_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {v : β k} {h₁ : a ∈ t.insertIfNew k v} :
(t.insertIfNew k v).get a h₁ = if h₂ : cmp k a = Ordering.eq ∧ ¬k ∈ t then cast ⋯ v else t.get a ⋯
source
theorem Std.ExtDTreeMap.get!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} [Inhabited (β a)] {v : β k} :
(t.insertIfNew k v).get! a = if h : cmp k a = Ordering.eq ∧ ¬k ∈ t then cast ⋯ v else t.get! a
source
theorem Std.ExtDTreeMap.getD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k a : α} {fallback : β a} {v : β k} :
(t.insertIfNew k v).getD a fallback = if h : cmp k a = Ordering.eq ∧ ¬k ∈ t then cast ⋯ v else t.getD a fallback
source
theorem Std.ExtDTreeMap.Const.get?_insertIfNew {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {v : β} :
get? (t.insertIfNew k v) a = if cmp k a = Ordering.eq ∧ ¬k ∈ t then some v else get? t a
source
theorem Std.ExtDTreeMap.Const.get_insertIfNew {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {v : β} {h₁ : a ∈ t.insertIfNew k v} :
get (t.insertIfNew k v) a h₁ = if h₂ : cmp k a = Ordering.eq ∧ ¬k ∈ t then v else get t a ⋯
source
theorem Std.ExtDTreeMap.Const.get!_insertIfNew {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {k a : α} {v : β} :
get! (t.insertIfNew k v) a = if cmp k a = Ordering.eq ∧ ¬k ∈ t then v else get! t a
source
theorem Std.ExtDTreeMap.Const.getD_insertIfNew {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k a : α} {fallback v : β} :
getD (t.insertIfNew k v) a fallback = if cmp k a = Ordering.eq ∧ ¬k ∈ t then v else getD t a fallback
source
theorem Std.ExtDTreeMap.getKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} :
(t.insertIfNew k v).getKey? a = if cmp k a = Ordering.eq ∧ ¬k ∈ t then some k else t.getKey? a
source
theorem Std.ExtDTreeMap.getKey_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a : α} {v : β k} {h₁ : a ∈ t.insertIfNew k v} :
(t.insertIfNew k v).getKey a h₁ = if h₂ : cmp k a = Ordering.eq ∧ ¬k ∈ t then k else t.getKey a ⋯
source
theorem Std.ExtDTreeMap.getKey!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k a : α} {v : β k} :
(t.insertIfNew k v).getKey! a = if cmp k a = Ordering.eq ∧ ¬k ∈ t then k else t.getKey! a
source
theorem Std.ExtDTreeMap.getKeyD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k a fallback : α} {v : β k} :
(t.insertIfNew k v).getKeyD a fallback = if cmp k a = Ordering.eq ∧ ¬k ∈ t then k else t.getKeyD a fallback
source
@[simp]
theorem Std.ExtDTreeMap.getThenInsertIfNew?_fst {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
(t.getThenInsertIfNew? k v).fst = t.get? k
source
@[simp]
theorem Std.ExtDTreeMap.getThenInsertIfNew?_snd {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
(t.getThenInsertIfNew? k v).snd = t.insertIfNew k v
source
@[simp]
theorem Std.ExtDTreeMap.Const.getThenInsertIfNew?_fst {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
(getThenInsertIfNew? t k v).fst = get? t k
source
@[simp]
theorem Std.ExtDTreeMap.Const.getThenInsertIfNew?_snd {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
(getThenInsertIfNew? t k v).snd = t.insertIfNew k v
source
@[simp]
theorem Std.ExtDTreeMap.length_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.keys.length = t.size
source
@[simp]
theorem Std.ExtDTreeMap.isEmpty_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.keys.isEmpty = t.isEmpty
source
@[simp]
theorem Std.ExtDTreeMap.keys_eq_nil_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.keys = [] ↔ t = ∅
source
@[simp]
theorem Std.ExtDTreeMap.contains_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [BEq α] [LawfulBEqCmp cmp] [TransCmp cmp] {k : α} :
t.keys.contains k = t.contains k
source
@[simp]
theorem Std.ExtDTreeMap.mem_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [LawfulEqCmp cmp] [TransCmp cmp] {k : α} :
k ∈ t.keys ↔ k ∈ t
source
theorem Std.ExtDTreeMap.mem_of_mem_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (h : k ∈ t.keys) :
k ∈ t
source
theorem Std.ExtDTreeMap.distinct_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) t.keys
source
theorem Std.ExtDTreeMap.nodup_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.keys.Nodup
source
theorem Std.ExtDTreeMap.ordered_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : α) => cmp a b = Ordering.lt) t.keys
source
@[simp]
theorem Std.ExtDTreeMap.map_fst_toList_eq_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
List.map Sigma.fst t.toList = t.keys
source
@[simp]
theorem Std.ExtDTreeMap.length_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.toList.length = t.size
source
@[simp]
theorem Std.ExtDTreeMap.isEmpty_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.toList.isEmpty = t.isEmpty
source
@[simp]
theorem Std.ExtDTreeMap.toList_eq_nil_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.toList = [] ↔ t = ∅
source
@[simp]
theorem Std.ExtDTreeMap.mem_toList_iff_get?_eq_some {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
⟨k, v⟩ ∈ t.toList ↔ t.get? k = some v
source
theorem Std.ExtDTreeMap.find?_toList_eq_some_iff_get?_eq_some {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β k} :
List.find? (fun (x : (a : α) × β a) => cmp x.fst k == Ordering.eq) t.toList = some ⟨k, v⟩ ↔ t.get? k = some v
source
theorem Std.ExtDTreeMap.find?_toList_eq_none_iff_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
List.find? (fun (x : (a : α) × β a) => cmp x.fst k == Ordering.eq) t.toList = none ↔ t.contains k = false
source
@[simp]
theorem Std.ExtDTreeMap.find?_toList_eq_none_iff_not_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
List.find? (fun (x : (a : α) × β a) => cmp x.fst k == Ordering.eq) t.toList = none ↔ ¬k ∈ t
source
theorem Std.ExtDTreeMap.distinct_keys_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) t.toList
source
theorem Std.ExtDTreeMap.ordered_keys_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : (a : α) × β a) => cmp a.fst b.fst = Ordering.lt) t.toList
source
@[simp]
theorem Std.ExtDTreeMap.Const.map_fst_toList_eq_keys {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
List.map Prod.fst (toList t) = t.keys
source
@[simp]
theorem Std.ExtDTreeMap.Const.length_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
(toList t).length = t.size
source
@[simp]
theorem Std.ExtDTreeMap.Const.isEmpty_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
(toList t).isEmpty = t.isEmpty
source
@[simp]
theorem Std.ExtDTreeMap.Const.toList_eq_nil_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
toList t = [] ↔ t = ∅
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_toList_iff_get?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {v : β} :
(k, v) ∈ toList t ↔ get? t k = some v
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_toList_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
(k, v) ∈ toList t ↔ t.getKey? k = some k ∧ get? t k = some v
source
theorem Std.ExtDTreeMap.Const.get?_eq_some_iff_exists_compare_eq_eq_and_mem_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
get? t k = some v ↔ ∃ (k' : α), cmp k k' = Ordering.eq ∧ (k', v) ∈ toList t
source
theorem Std.ExtDTreeMap.Const.find?_toList_eq_some_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {v : β} :
List.find? (fun (x : α × β) => cmp x.fst k == Ordering.eq) (toList t) = some (k', v) ↔ t.getKey? k = some k' ∧ get? t k = some v
source
theorem Std.ExtDTreeMap.Const.find?_toList_eq_none_iff_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} :
List.find? (fun (x : α × β) => cmp x.fst k == Ordering.eq) (toList t) = none ↔ t.contains k = false
source
@[simp]
theorem Std.ExtDTreeMap.Const.find?_toList_eq_none_iff_not_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} :
List.find? (fun (x : α × β) => cmp x.fst k == Ordering.eq) (toList t) = none ↔ ¬k ∈ t
source
theorem Std.ExtDTreeMap.Const.distinct_keys_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) (toList t)
source
theorem Std.ExtDTreeMap.Const.ordered_keys_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
List.Pairwise (fun (a b : α × β) => cmp a.fst b.fst = Ordering.lt) (toList t)
source
theorem Std.ExtDTreeMap.foldlM_eq_foldlM_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : δ → (a : α) → β a → m δ} {init : δ} :
foldlM f init t = List.foldlM (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init t.toList
source
theorem Std.ExtDTreeMap.foldl_eq_foldl_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} [TransCmp cmp] {f : δ → (a : α) → β a → δ} {init : δ} :
foldl f init t = List.foldl (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init t.toList
source
theorem Std.ExtDTreeMap.foldrM_eq_foldrM_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : (a : α) → β a → δ → m δ} {init : δ} :
foldrM f init t = List.foldrM (fun (a : (a : α) × β a) (b : δ) => f a.fst a.snd b) init t.toList
source
theorem Std.ExtDTreeMap.foldr_eq_foldr_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} [TransCmp cmp] {f : (a : α) → β a → δ → δ} {init : δ} :
foldr f init t = List.foldr (fun (a : (a : α) × β a) (b : δ) => f a.fst a.snd b) init t.toList
source
@[simp]
theorem Std.ExtDTreeMap.forM_eq_forM {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : (a : α) → β a → m PUnit} :
forM f t = ForM.forM t fun (a : (a : α) × β a) => f a.fst a.snd
source
theorem Std.ExtDTreeMap.forM_eq_forM_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : (a : α) × β a → m PUnit} :
ForM.forM t f = ForM.forM t.toList f
source
@[simp]
theorem Std.ExtDTreeMap.forIn_eq_forIn {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : (a : α) → β a → δ → m (ForInStep δ)} {init : δ} :
forIn f init t = ForIn.forIn t init fun (a : (a : α) × β a) (b : δ) => f a.fst a.snd b
source
theorem Std.ExtDTreeMap.forIn_eq_forIn_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : (a : α) × β a → δ → m (ForInStep δ)} {init : δ} :
ForIn.forIn t init f = ForIn.forIn t.toList init f
source
theorem Std.ExtDTreeMap.foldlM_eq_foldlM_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : δ → α → m δ} {init : δ} :
foldlM (fun (d : δ) (a : α) (x : β a) => f d a) init t = List.foldlM f init t.keys
source
theorem Std.ExtDTreeMap.foldl_eq_foldl_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} [TransCmp cmp] {f : δ → α → δ} {init : δ} :
foldl (fun (d : δ) (a : α) (x : β a) => f d a) init t = List.foldl f init t.keys
source
theorem Std.ExtDTreeMap.foldrM_eq_foldrM_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → δ → m δ} {init : δ} :
foldrM (fun (a : α) (x : β a) (d : δ) => f a d) init t = List.foldrM f init t.keys
source
theorem Std.ExtDTreeMap.foldr_eq_foldr_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} [TransCmp cmp] {f : α → δ → δ} {init : δ} :
foldr (fun (a : α) (x : β a) (d : δ) => f a d) init t = List.foldr f init t.keys
source
theorem Std.ExtDTreeMap.forM_eq_forM_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → m PUnit} :
(ForM.forM t fun (a : (a : α) × β a) => f a.fst) = t.keys.forM f
source
theorem Std.ExtDTreeMap.forIn_eq_forIn_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {δ : Type w} {m : Type w → Type w'} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → δ → m (ForInStep δ)} {init : δ} :
(ForIn.forIn t init fun (a : (a : α) × β a) (d : δ) => f a.fst d) = ForIn.forIn t.keys init f
source
theorem Std.ExtDTreeMap.Const.foldlM_eq_foldlM_toList {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : δ → α → β → m δ} {init : δ} :
foldlM f init t = List.foldlM (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toList t)
source
theorem Std.ExtDTreeMap.Const.foldl_eq_foldl_toList {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : δ → α → β → δ} {init : δ} :
foldl f init t = List.foldl (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toList t)
source
theorem Std.ExtDTreeMap.Const.foldrM_eq_foldrM_toList {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → β → δ → m δ} {init : δ} :
foldrM f init t = List.foldrM (fun (a : α × β) (b : δ) => f a.fst a.snd b) init (toList t)
source
theorem Std.ExtDTreeMap.Const.foldr_eq_foldr_toList {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → δ → δ} {init : δ} :
foldr f init t = List.foldr (fun (a : α × β) (b : δ) => f a.fst a.snd b) init (toList t)
source
theorem Std.ExtDTreeMap.Const.forM_eq_forMUncurried {α : Type u} {cmp : α → α → Ordering} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → β → m PUnit} :
forM f t = forMUncurried (fun (a : α × β) => f a.fst a.snd) t
source
theorem Std.ExtDTreeMap.Const.forMUncurried_eq_forM_toList {α : Type u} {cmp : α → α → Ordering} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α × β → m PUnit} :
forMUncurried f t = (toList t).forM f
source
theorem Std.ExtDTreeMap.Const.forIn_eq_forInUncurried {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α → β → δ → m (ForInStep δ)} {init : δ} :
forIn f init t = forInUncurried (fun (a : α × β) (b : δ) => f a.fst a.snd b) init t
source
theorem Std.ExtDTreeMap.Const.forInUncurried_eq_forIn_toList {α : Type u} {cmp : α → α → Ordering} {δ : Type w} {m : Type w → Type w'} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Monad m] [LawfulMonad m] {f : α × β → δ → m (ForInStep δ)} {init : δ} :
forInUncurried f init t = ForIn.forIn (toList t) init f
source
@[simp]
theorem Std.ExtDTreeMap.insertMany_nil {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.insertMany [] = t
source
@[simp]
theorem Std.ExtDTreeMap.insertMany_list_singleton {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
t.insertMany [⟨k, v⟩] = t.insert k v
source
theorem Std.ExtDTreeMap.insertMany_cons {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} {p : (a : α) × β a} :
t.insertMany (p :: l) = (t.insert p.fst p.snd).insertMany l
source
theorem Std.ExtDTreeMap.insertMany_append {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l₁ l₂ : List ((a : α) × β a)} :
t.insertMany (l₁ ++ l₂) = (t.insertMany l₁).insertMany l₂
source
@[simp]
theorem Std.ExtDTreeMap.contains_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} :
(t.insertMany l).contains k = (t.contains k || (List.map Sigma.fst l).contains k)
source
@[simp]
theorem Std.ExtDTreeMap.mem_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} :
k ∈ t.insertMany l ↔ k ∈ t ∨ (List.map Sigma.fst l).contains k = true
source
theorem Std.ExtDTreeMap.mem_of_mem_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} :
k ∈ t.insertMany l → (List.map Sigma.fst l).contains k = false → k ∈ t
source
theorem Std.ExtDTreeMap.get?_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).get? k = t.get? k
source
theorem Std.ExtDTreeMap.get?_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(t.insertMany l).get? k' = some (cast ⋯ v)
source
theorem Std.ExtDTreeMap.get_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains : (List.map Sigma.fst l).contains k = false) {h' : k ∈ t.insertMany l} :
(t.insertMany l).get k h' = t.get k ⋯
source
theorem Std.ExtDTreeMap.get_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) {h' : k' ∈ t.insertMany l} :
(t.insertMany l).get k' h' = cast ⋯ v
source
theorem Std.ExtDTreeMap.get!_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} [Inhabited (β k)] (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).get! k = t.get! k
source
theorem Std.ExtDTreeMap.get!_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} [Inhabited (β k')] (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(t.insertMany l).get! k' = cast ⋯ v
source
theorem Std.ExtDTreeMap.getD_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} {fallback : β k} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).getD k fallback = t.getD k fallback
source
theorem Std.ExtDTreeMap.getD_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} {fallback : β k'} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(t.insertMany l).getD k' fallback = cast ⋯ v
source
theorem Std.ExtDTreeMap.getKey?_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).getKey? k = t.getKey? k
source
theorem Std.ExtDTreeMap.getKey?_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(t.insertMany l).getKey? k' = some k
source
theorem Std.ExtDTreeMap.getKey_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) {h' : k ∈ t.insertMany l} :
(t.insertMany l).getKey k h' = t.getKey k ⋯
source
theorem Std.ExtDTreeMap.getKey_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) {h' : k' ∈ t.insertMany l} :
(t.insertMany l).getKey k' h' = k
source
theorem Std.ExtDTreeMap.getKey!_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).getKey! k = t.getKey! k
source
theorem Std.ExtDTreeMap.getKey!_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(t.insertMany l).getKey! k' = k
source
theorem Std.ExtDTreeMap.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k fallback : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(t.insertMany l).getKeyD k fallback = t.getKeyD k fallback
source
theorem Std.ExtDTreeMap.getKeyD_insertMany_list_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(t.insertMany l).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.size_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) :
(∀ (a : α), a ∈ t → (List.map Sigma.fst l).contains a = false) → (t.insertMany l).size = t.size + l.length
source
theorem Std.ExtDTreeMap.size_le_size_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} :
t.size ≤ (t.insertMany l).size
source
theorem Std.ExtDTreeMap.size_insertMany_list_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} :
(t.insertMany l).size ≤ t.size + l.length
source
@[simp]
theorem Std.ExtDTreeMap.isEmpty_insertMany_list {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} :
(t.insertMany l).isEmpty = (t.isEmpty && l.isEmpty)
source
@[simp]
theorem Std.ExtDTreeMap.insertMany_list_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {l : List ((a : α) × β a)} :
t.insertMany l = ∅ ↔ t = ∅ ∧ l = []
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertMany_nil {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] :
insertMany t [] = t
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertMany_list_singleton {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {v : β} :
insertMany t [(k, v)] = t.insert k v
source
theorem Std.ExtDTreeMap.Const.insertMany_cons {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {p : α × β} :
insertMany t (p :: l) = insertMany (t.insert p.fst p.snd) l
source
theorem Std.ExtDTreeMap.Const.insertMany_append {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l₁ l₂ : List (α × β)} :
insertMany t (l₁ ++ l₂) = insertMany (insertMany t l₁) l₂
source
@[simp]
theorem Std.ExtDTreeMap.Const.contains_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
(insertMany t l).contains k = (t.contains k || (List.map Prod.fst l).contains k)
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
k ∈ insertMany t l ↔ k ∈ t ∨ (List.map Prod.fst l).contains k = true
source
theorem Std.ExtDTreeMap.Const.mem_of_mem_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
k ∈ insertMany t l → (List.map Prod.fst l).contains k = false → k ∈ t
source
theorem Std.ExtDTreeMap.Const.getKey?_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany t l).getKey? k = t.getKey? k
source
theorem Std.ExtDTreeMap.Const.getKey?_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(insertMany t l).getKey? k' = some k
source
theorem Std.ExtDTreeMap.Const.getKey_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) {h' : k ∈ insertMany t l} :
(insertMany t l).getKey k h' = t.getKey k ⋯
source
theorem Std.ExtDTreeMap.Const.getKey_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) {h' : k' ∈ insertMany t l} :
(insertMany t l).getKey k' h' = k
source
theorem Std.ExtDTreeMap.Const.getKey!_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany t l).getKey! k = t.getKey! k
source
theorem Std.ExtDTreeMap.Const.getKey!_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(insertMany t l).getKey! k' = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k fallback : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany t l).getKeyD k fallback = t.getKeyD k fallback
source
theorem Std.ExtDTreeMap.Const.getKeyD_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(insertMany t l).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.Const.size_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) :
(∀ (a : α), a ∈ t → (List.map Prod.fst l).contains a = false) → (insertMany t l).size = t.size + l.length
source
theorem Std.ExtDTreeMap.Const.size_le_size_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} :
t.size ≤ (insertMany t l).size
source
theorem Std.ExtDTreeMap.Const.size_insertMany_list_le {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} :
(insertMany t l).size ≤ t.size + l.length
source
@[simp]
theorem Std.ExtDTreeMap.Const.isEmpty_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} :
(insertMany t l).isEmpty = (t.isEmpty && l.isEmpty)
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertMany_list_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} :
insertMany t l = ∅ ↔ t = ∅ ∧ l = []
source
theorem Std.ExtDTreeMap.Const.get?_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get? (insertMany t l) k = get? t k
source
theorem Std.ExtDTreeMap.Const.get?_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
get? (insertMany t l) k' = some v
source
theorem Std.ExtDTreeMap.Const.get?_insertMany_list {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
get? (insertMany t l) k = (List.findSomeRev? (fun (x : α × β) => match x with | (a, b) => if cmp a k = Ordering.eq then some b else none) l).or (get? t k)
source
theorem Std.ExtDTreeMap.Const.get_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) {h' : k ∈ insertMany t l} :
get (insertMany t l) k h' = get t k ⋯
source
theorem Std.ExtDTreeMap.Const.get_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) {h' : k' ∈ insertMany t l} :
get (insertMany t l) k' h' = v
source
theorem Std.ExtDTreeMap.Const.get!_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited β] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get! (insertMany t l) k = get! t k
source
theorem Std.ExtDTreeMap.Const.get!_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
get! (insertMany t l) k' = v
source
theorem Std.ExtDTreeMap.Const.getD_insertMany_list_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} {fallback : β} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
getD (insertMany t l) k fallback = getD t k fallback
source
theorem Std.ExtDTreeMap.Const.getD_insertMany_list_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v fallback : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
getD (insertMany t l) k' fallback = v
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertManyIfNewUnit_nil {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] :
insertManyIfNewUnit t [] = t
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertManyIfNewUnit_list_singleton {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {k : α} :
insertManyIfNewUnit t [k] = t.insertIfNew k ()
source
theorem Std.ExtDTreeMap.Const.insertManyIfNewUnit_cons {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} :
insertManyIfNewUnit t (k :: l) = insertManyIfNewUnit (t.insertIfNew k ()) l
source
@[simp]
theorem Std.ExtDTreeMap.Const.contains_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
(insertManyIfNewUnit t l).contains k = (t.contains k || l.contains k)
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
k ∈ insertManyIfNewUnit t l ↔ k ∈ t ∨ l.contains k = true
source
theorem Std.ExtDTreeMap.Const.mem_of_mem_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
k ∈ insertManyIfNewUnit t l → k ∈ t
source
theorem Std.ExtDTreeMap.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
¬k ∈ t → l.contains k = false → (insertManyIfNewUnit t l).getKey? k = none
source
theorem Std.ExtDTreeMap.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) :
¬k ∈ t → List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l → k ∈ l → (insertManyIfNewUnit t l).getKey? k' = some k
source
theorem Std.ExtDTreeMap.Const.getKey?_insertManyIfNewUnit_list_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} :
k ∈ t → (insertManyIfNewUnit t l).getKey? k = t.getKey? k
source
theorem Std.ExtDTreeMap.Const.getKey_insertManyIfNewUnit_list_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} {h' : k ∈ insertManyIfNewUnit t l} (contains : k ∈ t) :
(insertManyIfNewUnit t l).getKey k h' = t.getKey k contains
source
theorem Std.ExtDTreeMap.Const.getKey_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {h' : k' ∈ insertManyIfNewUnit t l} :
¬k ∈ t → List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l → k ∈ l → (insertManyIfNewUnit t l).getKey k' h' = k
source
theorem Std.ExtDTreeMap.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited α] {l : List α} {k : α} :
¬k ∈ t → l.contains k = false → (insertManyIfNewUnit t l).getKey! k = default
source
theorem Std.ExtDTreeMap.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [Inhabited α] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) :
¬k ∈ t → List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l → k ∈ l → (insertManyIfNewUnit t l).getKey! k' = k
source
theorem Std.ExtDTreeMap.Const.getKey!_insertManyIfNewUnit_list_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [Inhabited α] {l : List α} {k : α} :
k ∈ t → (insertManyIfNewUnit t l).getKey! k = t.getKey! k
source
theorem Std.ExtDTreeMap.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k fallback : α} :
¬k ∈ t → l.contains k = false → (insertManyIfNewUnit t l).getKeyD k fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) :
¬k ∈ t → List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l → k ∈ l → (insertManyIfNewUnit t l).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_insertManyIfNewUnit_list_of_mem {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k fallback : α} :
k ∈ t → (insertManyIfNewUnit t l).getKeyD k fallback = t.getKeyD k fallback
source
theorem Std.ExtDTreeMap.Const.size_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) :
(∀ (a : α), a ∈ t → l.contains a = false) → (insertManyIfNewUnit t l).size = t.size + l.length
source
theorem Std.ExtDTreeMap.Const.size_le_size_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} :
t.size ≤ (insertManyIfNewUnit t l).size
source
theorem Std.ExtDTreeMap.Const.size_insertManyIfNewUnit_list_le {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} :
(insertManyIfNewUnit t l).size ≤ t.size + l.length
source
@[simp]
theorem Std.ExtDTreeMap.Const.isEmpty_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} :
(insertManyIfNewUnit t l).isEmpty = (t.isEmpty && l.isEmpty)
source
@[simp]
theorem Std.ExtDTreeMap.Const.insertManyIfNewUnit_list_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} :
insertManyIfNewUnit t l = ∅ ↔ t = ∅ ∧ l = []
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
get? (insertManyIfNewUnit t l) k = if k ∈ t ∨ l.contains k = true then some () else none
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} {h' : k ∈ insertManyIfNewUnit t l} :
get (insertManyIfNewUnit t l) k h' = ()
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} :
get! (insertManyIfNewUnit t l) k = ()
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_insertManyIfNewUnit_list {α : Type u} {cmp : α → α → Ordering} {t : ExtDTreeMap α (fun (x : α) => Unit) cmp} [TransCmp cmp] {l : List α} {k : α} {fallback : Unit} :
getD (insertManyIfNewUnit t l) k fallback = ()
source
@[simp]
theorem Std.ExtDTreeMap.ofList_nil {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} :
ofList [] cmp = ∅
source
@[simp]
theorem Std.ExtDTreeMap.ofList_singleton {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} {v : β k} :
ofList [⟨k, v⟩] cmp = ∅.insert k v
source
theorem Std.ExtDTreeMap.ofList_cons {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} {v : β k} {tl : List ((a : α) × β a)} :
ofList (⟨k, v⟩ :: tl) cmp = (∅.insert k v).insertMany tl
source
theorem Std.ExtDTreeMap.ofList_eq_insertMany_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} :
ofList l cmp = ∅.insertMany l
source
@[simp]
theorem Std.ExtDTreeMap.contains_ofList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} :
(ofList l cmp).contains k = (List.map Sigma.fst l).contains k
source
@[simp]
theorem Std.ExtDTreeMap.mem_ofList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} :
k ∈ ofList l cmp ↔ (List.map Sigma.fst l).contains k = true
source
theorem Std.ExtDTreeMap.get?_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).get? k = none
source
theorem Std.ExtDTreeMap.get?_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(ofList l cmp).get? k' = some (cast ⋯ v)
source
theorem Std.ExtDTreeMap.get_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) {h : k' ∈ ofList l cmp} :
(ofList l cmp).get k' h = cast ⋯ v
source
theorem Std.ExtDTreeMap.get!_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} [Inhabited (β k)] (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).get! k = default
source
theorem Std.ExtDTreeMap.get!_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} [Inhabited (β k')] (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(ofList l cmp).get! k' = cast ⋯ v
source
theorem Std.ExtDTreeMap.getD_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} {fallback : β k} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).getD k fallback = fallback
source
theorem Std.ExtDTreeMap.getD_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β k} {fallback : β k'} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : ⟨k, v⟩ ∈ l) :
(ofList l cmp).getD k' fallback = cast ⋯ v
source
theorem Std.ExtDTreeMap.getKey?_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).getKey? k = none
source
theorem Std.ExtDTreeMap.getKey?_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(ofList l cmp).getKey? k' = some k
source
theorem Std.ExtDTreeMap.getKey_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) {h' : k' ∈ ofList l cmp} :
(ofList l cmp).getKey k' h' = k
source
theorem Std.ExtDTreeMap.getKey!_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [Inhabited α] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).getKey! k = default
source
theorem Std.ExtDTreeMap.getKey!_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [Inhabited α] {l : List ((a : α) × β a)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(ofList l cmp).getKey! k' = k
source
theorem Std.ExtDTreeMap.getKeyD_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List ((a : α) × β a)} {k fallback : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l cmp).getKeyD k fallback = fallback
source
theorem Std.ExtDTreeMap.getKeyD_ofList_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Sigma.fst l) :
(ofList l cmp).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.size_ofList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => ¬cmp a.fst b.fst = Ordering.eq) l) :
(ofList l cmp).size = l.length
source
theorem Std.ExtDTreeMap.size_ofList_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} :
(ofList l cmp).size ≤ l.length
source
@[simp]
theorem Std.ExtDTreeMap.ofList_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {l : List ((a : α) × β a)} :
ofList l cmp = ∅ ↔ l = []
source
@[simp]
theorem Std.ExtDTreeMap.Const.ofList_nil {α : Type u} {cmp : α → α → Ordering} {β : Type v} :
ofList [] cmp = ∅
source
@[simp]
theorem Std.ExtDTreeMap.Const.ofList_singleton {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {k : α} {v : β} :
ofList [(k, v)] cmp = ∅.insert k v
source
theorem Std.ExtDTreeMap.Const.ofList_cons {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {k : α} {v : β} {tl : List (α × β)} :
ofList ((k, v) :: tl) cmp = insertMany (∅.insert k v) tl
source
theorem Std.ExtDTreeMap.Const.ofList_eq_insertMany_empty {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} :
ofList l cmp = insertMany ∅ l
source
@[simp]
theorem Std.ExtDTreeMap.Const.contains_ofList {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
(ofList l cmp).contains k = (List.map Prod.fst l).contains k
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_ofList {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} :
k ∈ ofList l cmp ↔ (List.map Prod.fst l).contains k = true
source
theorem Std.ExtDTreeMap.Const.get?_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get? (ofList l cmp) k = none
source
theorem Std.ExtDTreeMap.Const.get?_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
get? (ofList l cmp) k' = some v
source
theorem Std.ExtDTreeMap.Const.get_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) {h : k' ∈ ofList l cmp} :
get (ofList l cmp) k' h = v
source
theorem Std.ExtDTreeMap.Const.get!_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} [Inhabited β] (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get! (ofList l cmp) k = default
source
theorem Std.ExtDTreeMap.Const.get!_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v : β} [Inhabited β] (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
get! (ofList l cmp) k' = v
source
theorem Std.ExtDTreeMap.Const.getD_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} {fallback : β} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
getD (ofList l cmp) k fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getD_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) {v fallback : β} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : (k, v) ∈ l) :
getD (ofList l cmp) k' fallback = v
source
theorem Std.ExtDTreeMap.Const.getKey?_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l cmp).getKey? k = none
source
theorem Std.ExtDTreeMap.Const.getKey?_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(ofList l cmp).getKey? k' = some k
source
theorem Std.ExtDTreeMap.Const.getKey_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) {h' : k' ∈ ofList l cmp} :
(ofList l cmp).getKey k' h' = k
source
theorem Std.ExtDTreeMap.Const.getKey!_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l cmp).getKey! k = default
source
theorem Std.ExtDTreeMap.Const.getKey!_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [Inhabited α] {l : List (α × β)} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(ofList l cmp).getKey! k' = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_ofList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List (α × β)} {k fallback : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l cmp).getKeyD k fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getKeyD_ofList_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) (mem : k ∈ List.map Prod.fst l) :
(ofList l cmp).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.Const.size_ofList {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} (distinct : List.Pairwise (fun (a b : α × β) => ¬cmp a.fst b.fst = Ordering.eq) l) :
(ofList l cmp).size = l.length
source
theorem Std.ExtDTreeMap.Const.size_ofList_le {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} :
(ofList l cmp).size ≤ l.length
source
@[simp]
theorem Std.ExtDTreeMap.Const.ofList_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {l : List (α × β)} :
ofList l cmp = ∅ ↔ l = []
source
@[simp]
theorem Std.ExtDTreeMap.Const.unitOfList_nil {α : Type u} {cmp : α → α → Ordering} :
unitOfList [] cmp = ∅
source
@[simp]
theorem Std.ExtDTreeMap.Const.unitOfList_singleton {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {k : α} :
unitOfList [k] cmp = ∅.insertIfNew k ()
source
theorem Std.ExtDTreeMap.Const.unitOfList_cons {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {hd : α} {tl : List α} :
unitOfList (hd :: tl) cmp = insertManyIfNewUnit (∅.insertIfNew hd ()) tl
source
@[simp]
theorem Std.ExtDTreeMap.Const.contains_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
(unitOfList l cmp).contains k = l.contains k
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
k ∈ unitOfList l cmp ↔ l.contains k = true
source
theorem Std.ExtDTreeMap.Const.getKey?_unitOfList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
(unitOfList l cmp).getKey? k = none
source
theorem Std.ExtDTreeMap.Const.getKey?_unitOfList_of_mem {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) (mem : k ∈ l) :
(unitOfList l cmp).getKey? k' = some k
source
theorem Std.ExtDTreeMap.Const.getKey_unitOfList_of_mem {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) (mem : k ∈ l) {h' : k' ∈ unitOfList l cmp} :
(unitOfList l cmp).getKey k' h' = k
source
theorem Std.ExtDTreeMap.Const.getKey!_unitOfList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] [Inhabited α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
(unitOfList l cmp).getKey! k = default
source
theorem Std.ExtDTreeMap.Const.getKey!_unitOfList_of_mem {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [Inhabited α] {l : List α} {k k' : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) (mem : k ∈ l) :
(unitOfList l cmp).getKey! k' = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_unitOfList_of_contains_eq_false {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k fallback : α} (contains_eq_false : l.contains k = false) :
(unitOfList l cmp).getKeyD k fallback = fallback
source
theorem Std.ExtDTreeMap.Const.getKeyD_unitOfList_of_mem {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k k' fallback : α} (k_eq : cmp k k' = Ordering.eq) (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) (mem : k ∈ l) :
(unitOfList l cmp).getKeyD k' fallback = k
source
theorem Std.ExtDTreeMap.Const.size_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} (distinct : List.Pairwise (fun (a b : α) => ¬cmp a b = Ordering.eq) l) :
(unitOfList l cmp).size = l.length
source
theorem Std.ExtDTreeMap.Const.size_unitOfList_le {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} :
(unitOfList l cmp).size ≤ l.length
source
@[simp]
theorem Std.ExtDTreeMap.Const.unitOfList_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} :
unitOfList l cmp = ∅ ↔ l = []
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [BEq α] [LawfulBEqCmp cmp] {l : List α} {k : α} :
get? (unitOfList l cmp) k = if l.contains k = true then some () else none
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k : α} {h : k ∈ unitOfList l cmp} :
get (unitOfList l cmp) k h = ()
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k : α} :
get! (unitOfList l cmp) k = ()
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_unitOfList {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {l : List α} {k : α} {fallback : Unit} :
getD (unitOfList l cmp) k fallback = ()
source
theorem Std.ExtDTreeMap.alter_eq_empty_iff_erase_eq_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
t.alter k f = ∅ ↔ t.erase k = ∅ ∧ f (t.get? k) = none
source
@[simp]
theorem Std.ExtDTreeMap.alter_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
t.alter k f = ∅ ↔ (t = ∅ ∨ t.size = 1 ∧ k ∈ t) ∧ f (t.get? k) = none
source
theorem Std.ExtDTreeMap.contains_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).contains k' = if cmp k k' = Ordering.eq then (f (t.get? k)).isSome else t.contains k'
source
theorem Std.ExtDTreeMap.mem_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} :
k' ∈ t.alter k f ↔ if cmp k k' = Ordering.eq then (f (t.get? k)).isSome = true else k' ∈ t
source
theorem Std.ExtDTreeMap.mem_alter_of_compare_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} (he : cmp k k' = Ordering.eq) :
k' ∈ t.alter k f ↔ (f (t.get? k)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.contains_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).contains k = (f (t.get? k)).isSome
source
@[simp]
theorem Std.ExtDTreeMap.mem_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
k ∈ t.alter k f ↔ (f (t.get? k)).isSome = true
source
theorem Std.ExtDTreeMap.contains_alter_of_not_compare_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} (he : ¬cmp k k' = Ordering.eq) :
(t.alter k f).contains k' = t.contains k'
source
theorem Std.ExtDTreeMap.mem_alter_of_not_compare_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} (he : ¬cmp k k' = Ordering.eq) :
k' ∈ t.alter k f ↔ k' ∈ t
source
theorem Std.ExtDTreeMap.size_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).size = if k ∈ t ∧ (f (t.get? k)).isNone = true then t.size - 1 else if ¬k ∈ t ∧ (f (t.get? k)).isSome = true then t.size + 1 else t.size
source
theorem Std.ExtDTreeMap.size_alter_eq_add_one {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (h₁ : ¬k ∈ t) (h₂ : (f (t.get? k)).isSome = true) :
(t.alter k f).size = t.size + 1
source
theorem Std.ExtDTreeMap.size_alter_eq_sub_one {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (h₁ : k ∈ t) (h₂ : (f (t.get? k)).isNone = true) :
(t.alter k f).size = t.size - 1
source
theorem Std.ExtDTreeMap.size_alter_eq_self_of_not_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (h₁ : ¬k ∈ t) (h₂ : (f (t.get? k)).isNone = true) :
(t.alter k f).size = t.size
source
theorem Std.ExtDTreeMap.size_alter_eq_self_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (h₁ : k ∈ t) (h₂ : (f (t.get? k)).isSome = true) :
(t.alter k f).size = t.size
source
theorem Std.ExtDTreeMap.size_alter_le_size {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).size ≤ t.size + 1
source
theorem Std.ExtDTreeMap.size_le_size_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
t.size - 1 ≤ (t.alter k f).size
source
theorem Std.ExtDTreeMap.get?_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).get? k' = if h : cmp k k' = Ordering.eq then cast ⋯ (f (t.get? k)) else t.get? k'
source
@[simp]
theorem Std.ExtDTreeMap.get?_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).get? k = f (t.get? k)
source
theorem Std.ExtDTreeMap.get_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} {hc : k' ∈ t.alter k f} :
(t.alter k f).get k' hc = if heq : cmp k k' = Ordering.eq then cast ⋯ ((f (t.get? k)).get ⋯) else t.get k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} {hc : k ∈ t.alter k f} :
(t.alter k f).get k hc = (f (t.get? k)).get ⋯
source
theorem Std.ExtDTreeMap.get!_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} [Inhabited (β k')] {f : Option (β k) → Option (β k)} :
(t.alter k f).get! k' = if heq : cmp k k' = Ordering.eq then (Option.map (cast ⋯) (f (t.get? k))).get! else t.get! k'
source
@[simp]
theorem Std.ExtDTreeMap.get!_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} [Inhabited (β k)] {f : Option (β k) → Option (β k)} :
(t.alter k f).get! k = (f (t.get? k)).get!
source
theorem Std.ExtDTreeMap.getD_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {fallback : β k'} {f : Option (β k) → Option (β k)} :
(t.alter k f).getD k' fallback = if heq : cmp k k' = Ordering.eq then (Option.map (cast ⋯) (f (t.get? k))).getD fallback else t.getD k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.getD_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {fallback : β k} {f : Option (β k) → Option (β k)} :
(t.alter k f).getD k fallback = (f (t.get? k)).getD fallback
source
theorem Std.ExtDTreeMap.getKey?_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKey? k' = if cmp k k' = Ordering.eq then if (f (t.get? k)).isSome = true then some k else none else t.getKey? k'
source
theorem Std.ExtDTreeMap.getKey?_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKey? k = if (f (t.get? k)).isSome = true then some k else none
source
theorem Std.ExtDTreeMap.getKey!_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k k' : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKey! k' = if cmp k k' = Ordering.eq then if (f (t.get? k)).isSome = true then k else default else t.getKey! k'
source
theorem Std.ExtDTreeMap.getKey!_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKey! k = if (f (t.get? k)).isSome = true then k else default
source
@[simp]
theorem Std.ExtDTreeMap.getKey_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} {hc : k ∈ t.alter k f} :
(t.alter k f).getKey k hc = k
source
theorem Std.ExtDTreeMap.getKeyD_alter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' fallback : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKeyD k' fallback = if cmp k k' = Ordering.eq then if (f (t.get? k)).isSome = true then k else fallback else t.getKeyD k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_alter_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k fallback : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).getKeyD k fallback = if (f (t.get? k)).isSome = true then k else fallback
source
theorem Std.ExtDTreeMap.Const.alter_eq_empty_iff_erase_eq_empty {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
alter t k f = ∅ ↔ t.erase k = ∅ ∧ f (get? t k) = none
source
@[simp]
theorem Std.ExtDTreeMap.Const.alter_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
alter t k f = ∅ ↔ (t = ∅ ∨ t.size = 1 ∧ k ∈ t) ∧ f (get? t k) = none
source
theorem Std.ExtDTreeMap.Const.contains_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} :
(alter t k f).contains k' = if cmp k k' = Ordering.eq then (f (get? t k)).isSome else t.contains k'
source
theorem Std.ExtDTreeMap.Const.mem_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} :
k' ∈ alter t k f ↔ if cmp k k' = Ordering.eq then (f (get? t k)).isSome = true else k' ∈ t
source
theorem Std.ExtDTreeMap.Const.mem_alter_of_compare_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} (he : cmp k k' = Ordering.eq) :
k' ∈ alter t k f ↔ (f (get? t k)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.Const.contains_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).contains k = (f (get? t k)).isSome
source
@[simp]
theorem Std.ExtDTreeMap.Const.mem_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
k ∈ alter t k f ↔ (f (get? t k)).isSome = true
source
theorem Std.ExtDTreeMap.Const.contains_alter_of_not_compare_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} (he : ¬cmp k k' = Ordering.eq) :
(alter t k f).contains k' = t.contains k'
source
theorem Std.ExtDTreeMap.Const.mem_alter_of_not_compare_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} (he : ¬cmp k k' = Ordering.eq) :
k' ∈ alter t k f ↔ k' ∈ t
source
theorem Std.ExtDTreeMap.Const.size_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).size = if k ∈ t ∧ (f (get? t k)).isNone = true then t.size - 1 else if ¬k ∈ t ∧ (f (get? t k)).isSome = true then t.size + 1 else t.size
source
theorem Std.ExtDTreeMap.Const.size_alter_eq_add_one {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (h₁ : ¬k ∈ t) (h₂ : (f (get? t k)).isSome = true) :
(alter t k f).size = t.size + 1
source
theorem Std.ExtDTreeMap.Const.size_alter_eq_sub_one {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (h₁ : k ∈ t) (h₂ : (f (get? t k)).isNone = true) :
(alter t k f).size = t.size - 1
source
theorem Std.ExtDTreeMap.Const.size_alter_eq_self_of_not_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (h₁ : ¬k ∈ t) (h₂ : (f (get? t k)).isNone = true) :
(alter t k f).size = t.size
source
theorem Std.ExtDTreeMap.Const.size_alter_eq_self_of_mem {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (h₁ : k ∈ t) (h₂ : (f (get? t k)).isSome = true) :
(alter t k f).size = t.size
source
theorem Std.ExtDTreeMap.Const.size_alter_le_size {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).size ≤ t.size + 1
source
theorem Std.ExtDTreeMap.Const.size_le_size_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
t.size - 1 ≤ (alter t k f).size
source
theorem Std.ExtDTreeMap.Const.get?_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} :
get? (alter t k f) k' = if cmp k k' = Ordering.eq then f (get? t k) else get? t k'
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
get? (alter t k f) k = f (get? t k)
source
theorem Std.ExtDTreeMap.Const.get_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} {hc : k' ∈ alter t k f} :
get (alter t k f) k' hc = if heq : cmp k k' = Ordering.eq then (f (get? t k)).get ⋯ else get t k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} {hc : k ∈ alter t k f} :
get (alter t k f) k hc = (f (get? t k)).get ⋯
source
theorem Std.ExtDTreeMap.Const.get!_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} [Inhabited β] {f : Option β → Option β} :
get! (alter t k f) k' = if cmp k k' = Ordering.eq then (f (get? t k)).get! else get! t k'
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} [Inhabited β] {f : Option β → Option β} :
get! (alter t k f) k = (f (get? t k)).get!
source
theorem Std.ExtDTreeMap.Const.getD_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {fallback : β} {f : Option β → Option β} :
getD (alter t k f) k' fallback = if cmp k k' = Ordering.eq then (f (get? t k)).getD fallback else getD t k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {fallback : β} {f : Option β → Option β} :
getD (alter t k f) k fallback = (f (get? t k)).getD fallback
source
theorem Std.ExtDTreeMap.Const.getKey?_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' : α} {f : Option β → Option β} :
(alter t k f).getKey? k' = if cmp k k' = Ordering.eq then if (f (get? t k)).isSome = true then some k else none else t.getKey? k'
source
theorem Std.ExtDTreeMap.Const.getKey?_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).getKey? k = if (f (get? t k)).isSome = true then some k else none
source
theorem Std.ExtDTreeMap.Const.getKey!_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k k' : α} {f : Option β → Option β} :
(alter t k f).getKey! k' = if cmp k k' = Ordering.eq then if (f (get? t k)).isSome = true then k else default else t.getKey! k'
source
theorem Std.ExtDTreeMap.Const.getKey!_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : Option β → Option β} :
(alter t k f).getKey! k = if (f (get? t k)).isSome = true then k else default
source
theorem Std.ExtDTreeMap.Const.getKey_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k k' : α} {f : Option β → Option β} {hc : k' ∈ alter t k f} :
(alter t k f).getKey k' hc = if heq : cmp k k' = Ordering.eq then k else t.getKey k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.getKey_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : Option β → Option β} {hc : k ∈ alter t k f} :
(alter t k f).getKey k hc = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_alter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k k' fallback : α} {f : Option β → Option β} :
(alter t k f).getKeyD k' fallback = if cmp k k' = Ordering.eq then if (f (get? t k)).isSome = true then k else fallback else t.getKeyD k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.getKeyD_alter_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k fallback : α} {f : Option β → Option β} :
(alter t k f).getKeyD k fallback = if (f (get? t k)).isSome = true then k else fallback
source
@[simp]
theorem Std.ExtDTreeMap.modify_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
t.modify k f = ∅ ↔ t = ∅
source
theorem Std.ExtDTreeMap.contains_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : β k → β k} :
(t.modify k f).contains k' = t.contains k'
source
theorem Std.ExtDTreeMap.mem_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : β k → β k} :
k' ∈ t.modify k f ↔ k' ∈ t
source
theorem Std.ExtDTreeMap.size_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
(t.modify k f).size = t.size
source
theorem Std.ExtDTreeMap.get?_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : β k → β k} :
(t.modify k f).get? k' = if h : cmp k k' = Ordering.eq then cast ⋯ (Option.map f (t.get? k)) else t.get? k'
source
@[simp]
theorem Std.ExtDTreeMap.get?_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
(t.modify k f).get? k = Option.map f (t.get? k)
source
theorem Std.ExtDTreeMap.get_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : β k → β k} {hc : k' ∈ t.modify k f} :
(t.modify k f).get k' hc = if heq : cmp k k' = Ordering.eq then cast ⋯ (f (t.get k ⋯)) else t.get k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} {hc : k ∈ t.modify k f} :
(t.modify k f).get k hc = f (t.get k ⋯)
source
theorem Std.ExtDTreeMap.get!_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} [hi : Inhabited (β k')] {f : β k → β k} :
(t.modify k f).get! k' = if heq : cmp k k' = Ordering.eq then (Option.map (cast ⋯) (Option.map f (t.get? k))).get! else t.get! k'
source
@[simp]
theorem Std.ExtDTreeMap.get!_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} [Inhabited (β k)] {f : β k → β k} :
(t.modify k f).get! k = (Option.map f (t.get? k)).get!
source
theorem Std.ExtDTreeMap.getD_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {fallback : β k'} {f : β k → β k} :
(t.modify k f).getD k' fallback = if heq : cmp k k' = Ordering.eq then (Option.map (cast ⋯) (Option.map f (t.get? k))).getD fallback else t.getD k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.getD_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {fallback : β k} {f : β k → β k} :
(t.modify k f).getD k fallback = (Option.map f (t.get? k)).getD fallback
source
theorem Std.ExtDTreeMap.getKey?_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' : α} {f : β k → β k} :
(t.modify k f).getKey? k' = if cmp k k' = Ordering.eq then if k ∈ t then some k else none else t.getKey? k'
source
theorem Std.ExtDTreeMap.getKey?_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
(t.modify k f).getKey? k = if k ∈ t then some k else none
source
theorem Std.ExtDTreeMap.getKey!_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k k' : α} {f : β k → β k} :
(t.modify k f).getKey! k' = if cmp k k' = Ordering.eq then if k ∈ t then k else default else t.getKey! k'
source
theorem Std.ExtDTreeMap.getKey!_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β k → β k} :
(t.modify k f).getKey! k = if k ∈ t then k else default
source
theorem Std.ExtDTreeMap.getKey_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k k' : α} {f : β k → β k} {hc : k' ∈ t.modify k f} :
(t.modify k f).getKey k' hc = if cmp k k' = Ordering.eq then k else t.getKey k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.getKey_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β k → β k} {hc : k ∈ t.modify k f} :
(t.modify k f).getKey k hc = k
source
theorem Std.ExtDTreeMap.getKeyD_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k k' fallback : α} {f : β k → β k} :
(t.modify k f).getKeyD k' fallback = if cmp k k' = Ordering.eq then if k ∈ t then k else fallback else t.getKeyD k' fallback
source
theorem Std.ExtDTreeMap.getKeyD_modify_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k fallback : α} {f : β k → β k} :
(t.modify k f).getKeyD k fallback = if k ∈ t then k else fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.modify_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {f : β → β} :
modify t k f = ∅ ↔ t = ∅
source
theorem Std.ExtDTreeMap.Const.contains_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {f : β → β} :
(modify t k f).contains k' = t.contains k'
source
theorem Std.ExtDTreeMap.Const.mem_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {f : β → β} :
k' ∈ modify t k f ↔ k' ∈ t
source
theorem Std.ExtDTreeMap.Const.size_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {f : β → β} :
(modify t k f).size = t.size
source
theorem Std.ExtDTreeMap.Const.get?_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {f : β → β} :
get? (modify t k f) k' = if cmp k k' = Ordering.eq then Option.map f (get? t k) else get? t k'
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {f : β → β} :
get? (modify t k f) k = Option.map f (get? t k)
source
theorem Std.ExtDTreeMap.Const.get_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {f : β → β} {hc : k' ∈ modify t k f} :
get (modify t k f) k' hc = if heq : cmp k k' = Ordering.eq then f (get t k ⋯) else get t k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {f : β → β} {hc : k ∈ modify t k f} :
get (modify t k f) k hc = f (get t k ⋯)
source
theorem Std.ExtDTreeMap.Const.get!_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} [hi : Inhabited β] {f : β → β} :
get! (modify t k f) k' = if cmp k k' = Ordering.eq then (Option.map f (get? t k)).get! else get! t k'
source
@[simp]
theorem Std.ExtDTreeMap.Const.get!_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} [Inhabited β] {f : β → β} :
get! (modify t k f) k = (Option.map f (get? t k)).get!
source
theorem Std.ExtDTreeMap.Const.getD_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {fallback : β} {f : β → β} :
getD (modify t k f) k' fallback = if cmp k k' = Ordering.eq then (Option.map f (get? t k)).getD fallback else getD t k' fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.getD_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {fallback : β} {f : β → β} :
getD (modify t k f) k fallback = (Option.map f (get? t k)).getD fallback
source
theorem Std.ExtDTreeMap.Const.getKey?_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' : α} {f : β → β} :
(modify t k f).getKey? k' = if cmp k k' = Ordering.eq then if k ∈ t then some k else none else t.getKey? k'
source
theorem Std.ExtDTreeMap.Const.getKey?_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k : α} {f : β → β} :
(modify t k f).getKey? k = if k ∈ t then some k else none
source
theorem Std.ExtDTreeMap.Const.getKey!_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [Inhabited α] {k k' : α} {f : β → β} :
(modify t k f).getKey! k' = if cmp k k' = Ordering.eq then if k ∈ t then k else default else t.getKey! k'
source
theorem Std.ExtDTreeMap.Const.getKey!_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [Inhabited α] {k : α} {f : β → β} :
(modify t k f).getKey! k = if k ∈ t then k else default
source
theorem Std.ExtDTreeMap.Const.getKey_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [Inhabited α] {k k' : α} {f : β → β} {hc : k' ∈ modify t k f} :
(modify t k f).getKey k' hc = if cmp k k' = Ordering.eq then k else t.getKey k' ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.getKey_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [Inhabited α] {k : α} {f : β → β} {hc : k ∈ modify t k f} :
(modify t k f).getKey k hc = k
source
theorem Std.ExtDTreeMap.Const.getKeyD_modify {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} {k k' fallback : α} {f : β → β} :
(modify t k f).getKeyD k' fallback = if cmp k k' = Ordering.eq then if k ∈ t then k else fallback else t.getKeyD k' fallback
source
theorem Std.ExtDTreeMap.Const.getKeyD_modify_self {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [Inhabited α] {k fallback : α} {f : β → β} :
(modify t k f).getKeyD k fallback = if k ∈ t then k else fallback
source
@[simp]
theorem Std.ExtDTreeMap.minKey?_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] :
∅.minKey? = none
source
@[simp]
theorem Std.ExtDTreeMap.minKey?_eq_none_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey? = none ↔ t = ∅
source
theorem Std.ExtDTreeMap.minKey?_eq_some_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} :
t.minKey? = some km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_eq_some_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {km : α} :
t.minKey? = some km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
@[simp]
theorem Std.ExtDTreeMap.isNone_minKey?_eq_isEmpty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey?.isNone = t.isEmpty
source
@[simp]
theorem Std.ExtDTreeMap.isSome_minKey?_eq_not_isEmpty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey?.isSome = !t.isEmpty
source
theorem Std.ExtDTreeMap.isSome_minKey?_iff_ne_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey?.isSome = true ↔ ¬t = ∅
source
theorem Std.ExtDTreeMap.minKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).minKey? = some (t.minKey?.elim k fun (k' : α) => if (cmp k k').isLE = true then k else k')
source
theorem Std.ExtDTreeMap.isSome_minKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).minKey?.isSome = true
source
theorem Std.ExtDTreeMap.minKey?_insert_le_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {km kmi : α} (hkm : t.minKey? = some km) (hkmi : (t.insert k v).minKey?.get ⋯ = kmi) :
(cmp kmi km).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_insert_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {kmi : α} (hkmi : (t.insert k v).minKey?.get ⋯ = kmi) :
(cmp kmi k).isLE = true
source
theorem Std.ExtDTreeMap.contains_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.minKey? = some km) :
t.contains km = true
source
theorem Std.ExtDTreeMap.minKey?_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.minKey? = some km) :
km ∈ t
source
theorem Std.ExtDTreeMap.isSome_minKey?_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) :
t.minKey?.isSome = true
source
theorem Std.ExtDTreeMap.isSome_minKey?_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
k ∈ t → t.minKey?.isSome = true
source
theorem Std.ExtDTreeMap.minKey?_le_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km : α} (hc : t.contains k = true) (hkm : t.minKey?.get ⋯ = km) :
(cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_le_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km : α} (hc : k ∈ t) (hkm : t.minKey?.get ⋯ = km) :
(cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.le_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(∀ (k' : α), t.minKey? = some k' → (cmp k k').isLE = true) ↔ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.getKey?_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.minKey? = some km) :
t.getKey? km = some km
source
theorem Std.ExtDTreeMap.getKey_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} {hc : t.contains km = true} (hkm : t.minKey?.get ⋯ = km) :
t.getKey km hc = km
source
theorem Std.ExtDTreeMap.getKey!_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {km : α} (hkm : t.minKey? = some km) :
t.getKey! km = km
source
theorem Std.ExtDTreeMap.getKeyD_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km fallback : α} (hkm : t.minKey? = some km) :
t.getKeyD km fallback = km
source
@[simp]
theorem Std.ExtDTreeMap.minKey?_bind_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey?.bind t.getKey? = t.minKey?
source
theorem Std.ExtDTreeMap.minKey?_erase_eq_iff_not_compare_eq_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(t.erase k).minKey? = t.minKey? ↔ ∀ {km : α}, t.minKey? = some km → ¬cmp k km = Ordering.eq
source
theorem Std.ExtDTreeMap.minKey?_erase_eq_of_not_compare_eq_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : ∀ {km : α}, t.minKey? = some km → ¬cmp k km = Ordering.eq) :
(t.erase k).minKey? = t.minKey?
source
theorem Std.ExtDTreeMap.isSome_minKey?_of_isSome_minKey?_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hs : (t.erase k).minKey?.isSome = true) :
t.minKey?.isSome = true
source
theorem Std.ExtDTreeMap.minKey?_le_minKey?_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km kme : α} (hkme : (t.erase k).minKey? = some kme) (hkm : t.minKey?.get ⋯ = km) :
(cmp km kme).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).minKey? = some (t.minKey?.elim k fun (k' : α) => if cmp k k' = Ordering.lt then k else k')
source
theorem Std.ExtDTreeMap.isSome_minKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).minKey?.isSome = true
source
theorem Std.ExtDTreeMap.minKey?_insertIfNew_le_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {km kmi : α} (hkm : t.minKey? = some km) (hkmi : (t.insertIfNew k v).minKey?.get ⋯ = kmi) :
(cmp kmi km).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_insertIfNew_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {kmi : α} (hkmi : (t.insertIfNew k v).minKey?.get ⋯ = kmi) :
(cmp kmi k).isLE = true
source
theorem Std.ExtDTreeMap.minKey?_eq_head?_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.minKey? = t.keys.head?
source
@[simp]
theorem Std.ExtDTreeMap.minKey?_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
(t.modify k f).minKey? = t.minKey?
source
theorem Std.ExtDTreeMap.minKey?_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).minKey? = some k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.Const.minKey?_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).minKey? = Option.map (fun (km : α) => if cmp km k = Ordering.eq then k else km) t.minKey?
source
@[simp]
theorem Std.ExtDTreeMap.Const.minKey?_modify_eq_minKey? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} :
(modify t k f).minKey? = t.minKey?
source
theorem Std.ExtDTreeMap.Const.isSome_minKey?_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).minKey?.isSome = !t.isEmpty
source
theorem Std.ExtDTreeMap.Const.isSome_minKey?_modify_eq_isSome {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).minKey?.isSome = t.minKey?.isSome
source
theorem Std.ExtDTreeMap.Const.compare_minKey?_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {km kmm : α} (hkm : t.minKey? = some km) (hkmm : (modify t k f).minKey?.get ⋯ = kmm) :
cmp kmm km = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.minKey?_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).minKey? = some k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.minKey_eq_get_minKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.minKey he = t.minKey?.get ⋯
source
theorem Std.ExtDTreeMap.minKey?_eq_some_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) :
t.minKey? = some (t.minKey he)
source
theorem Std.ExtDTreeMap.minKey_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {km : α} :
t.minKey he = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {he : t ≠ ∅} {km : α} :
t.minKey he = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).minKey ⋯ = t.minKey?.elim k fun (k' : α) => if (cmp k k').isLE = true then k else k'
source
theorem Std.ExtDTreeMap.minKey_insert_le_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {he : t ≠ ∅} :
(cmp ((t.insert k v).minKey ⋯) (t.minKey he)).isLE = true
source
theorem Std.ExtDTreeMap.minKey_insert_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(cmp ((t.insert k v).minKey ⋯) k).isLE = true
source
theorem Std.ExtDTreeMap.contains_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.contains (t.minKey he) = true
source
theorem Std.ExtDTreeMap.minKey_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.minKey he ∈ t
source
theorem Std.ExtDTreeMap.minKey_le_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) :
(cmp (t.minKey ⋯) k).isLE = true
source
theorem Std.ExtDTreeMap.minKey_le_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : k ∈ t) :
(cmp (t.minKey ⋯) k).isLE = true
source
theorem Std.ExtDTreeMap.le_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t ≠ ∅} :
(cmp k (t.minKey he)).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.getKey? (t.minKey he) = some (t.minKey he)
source
@[simp]
theorem Std.ExtDTreeMap.getKey_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {hc : t.minKey he ∈ t} :
t.getKey (t.minKey he) hc = t.minKey he
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {he : t ≠ ∅} :
t.getKey! (t.minKey he) = t.minKey he
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {fallback : α} :
t.getKeyD (t.minKey he) fallback = t.minKey he
source
@[simp]
theorem Std.ExtDTreeMap.minKey_erase_eq_iff_not_compare_eq_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} :
(t.erase k).minKey he = t.minKey ⋯ ↔ ¬cmp k (t.minKey ⋯) = Ordering.eq
source
theorem Std.ExtDTreeMap.minKey_erase_eq_of_not_compare_eq_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} (hc : ¬cmp k (t.minKey ⋯) = Ordering.eq) :
(t.erase k).minKey he = t.minKey ⋯
source
theorem Std.ExtDTreeMap.minKey_le_minKey_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} :
(cmp (t.minKey ⋯) ((t.erase k).minKey he)).isLE = true
source
theorem Std.ExtDTreeMap.minKey_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).minKey ⋯ = t.minKey?.elim k fun (k' : α) => if cmp k k' = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.minKey_insertIfNew_le_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {he : t ≠ ∅} :
(cmp ((t.insertIfNew k v).minKey ⋯) (t.minKey he)).isLE = true
source
theorem Std.ExtDTreeMap.minKey_insertIfNew_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(cmp ((t.insertIfNew k v).minKey ⋯) k).isLE = true
source
theorem Std.ExtDTreeMap.minKey_eq_head_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.minKey he = t.keys.head ⋯
source
@[simp]
theorem Std.ExtDTreeMap.minKey_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} {he : t.modify k f ≠ ∅} :
(t.modify k f).minKey he = t.minKey ⋯
source
theorem Std.ExtDTreeMap.minKey_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} {he : t.alter k f ≠ ∅} :
(t.alter k f).minKey he = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.Const.minKey_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
(modify t k f).minKey he = if cmp (t.minKey ⋯) k = Ordering.eq then k else t.minKey ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.minKey_modify_eq_minKey {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
(modify t k f).minKey he = t.minKey ⋯
source
theorem Std.ExtDTreeMap.Const.compare_minKey_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
cmp ((modify t k f).minKey he) (t.minKey ⋯) = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_minKey_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
compare ((modify t k f).minKey he) (t.minKey ⋯) = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.minKey_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} {he : alter t k f ≠ ∅} :
(alter t k f).minKey he = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.minKey_eq_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {he : t ≠ ∅} :
t.minKey he = t.minKey!
source
theorem Std.ExtDTreeMap.minKey?_eq_some_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.minKey? = some t.minKey!
source
@[simp]
theorem Std.ExtDTreeMap.minKey!_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [Inhabited α] :
∅.minKey! = default
source
theorem Std.ExtDTreeMap.minKey!_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {km : α} :
t.minKey! = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] (he : t ≠ ∅) {km : α} :
t.minKey! = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(t.insert k v).minKey! = t.minKey?.elim k fun (k' : α) => if (cmp k k').isLE = true then k else k'
source
theorem Std.ExtDTreeMap.minKey!_insert_le_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} {v : β k} :
(cmp (t.insert k v).minKey! t.minKey!).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_insert_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(cmp (t.insert k v).minKey! k).isLE = true
source
theorem Std.ExtDTreeMap.contains_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.contains t.minKey! = true
source
theorem Std.ExtDTreeMap.minKey!_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.minKey! ∈ t
source
theorem Std.ExtDTreeMap.minKey!_le_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (hc : t.contains k = true) :
(cmp t.minKey! k).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_le_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (hc : k ∈ t) :
(cmp t.minKey! k).isLE = true
source
theorem Std.ExtDTreeMap.le_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} :
(cmp k t.minKey!).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.getKey?_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.getKey? t.minKey! = some t.minKey!
source
theorem Std.ExtDTreeMap.getKey_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {hc : t.minKey! ∈ t} :
t.getKey t.minKey! hc = t.minKey!
source
@[simp]
theorem Std.ExtDTreeMap.getKey_minKey!_eq_minKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {hc : t.minKey! ∈ t} :
t.getKey t.minKey! hc = t.minKey ⋯
source
theorem Std.ExtDTreeMap.getKey!_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.getKey! t.minKey! = t.minKey!
source
theorem Std.ExtDTreeMap.getKeyD_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {fallback : α} :
t.getKeyD t.minKey! fallback = t.minKey!
source
theorem Std.ExtDTreeMap.minKey!_erase_eq_of_not_compare_minKey!_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (he : t.erase k ≠ ∅) (heq : ¬cmp k t.minKey! = Ordering.eq) :
(t.erase k).minKey! = t.minKey!
source
theorem Std.ExtDTreeMap.minKey!_le_minKey!_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (he : t.erase k ≠ ∅) :
(cmp t.minKey! (t.erase k).minKey!).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(t.insertIfNew k v).minKey! = t.minKey?.elim k fun (k' : α) => if cmp k k' = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.minKey!_insertIfNew_le_minKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} {v : β k} :
(cmp (t.insertIfNew k v).minKey! t.minKey!).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_insertIfNew_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(cmp (t.insertIfNew k v).minKey! k).isLE = true
source
theorem Std.ExtDTreeMap.minKey!_eq_head!_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] :
t.minKey! = t.keys.head!
source
@[simp]
theorem Std.ExtDTreeMap.minKey!_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β k → β k} :
(t.modify k f).minKey! = t.minKey!
source
theorem Std.ExtDTreeMap.minKey!_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} (he : t.alter k f ≠ ∅) :
(t.alter k f).minKey! = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.Const.minKey!_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : β → β} (he : modify t k f ≠ ∅) :
(modify t k f).minKey! = if cmp t.minKey! k = Ordering.eq then k else t.minKey!
source
@[simp]
theorem Std.ExtDTreeMap.Const.minKey!_modify_eq_minKey! {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β → β} :
(modify t k f).minKey! = t.minKey!
source
theorem Std.ExtDTreeMap.Const.compare_minKey!_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : β → β} :
cmp (modify t k f).minKey! t.minKey! = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_minKey!_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} [Inhabited α] {k : α} {f : β → β} :
compare (modify t k f).minKey! t.minKey! = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.minKey!_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : Option β → Option β} (he : alter t k f ≠ ∅) :
(alter t k f).minKey! = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.minKey?_eq_some_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.minKey? = some (t.minKeyD fallback)
source
@[simp]
theorem Std.ExtDTreeMap.minKeyD_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {fallback : α} :
∅.minKeyD fallback = fallback
source
theorem Std.ExtDTreeMap.minKey!_eq_minKeyD_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] :
t.minKey! = t.minKeyD default
source
theorem Std.ExtDTreeMap.minKeyD_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {km fallback : α} :
t.minKeyD fallback = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] (he : t ≠ ∅) {km fallback : α} :
t.minKeyD fallback = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp km k).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(t.insert k v).minKeyD fallback = t.minKey?.elim k fun (k' : α) => if (cmp k k').isLE = true then k else k'
source
theorem Std.ExtDTreeMap.minKeyD_insert_le_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k : α} {v : β k} {fallback : α} :
(cmp ((t.insert k v).minKeyD fallback) (t.minKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_insert_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(cmp ((t.insert k v).minKeyD fallback) k).isLE = true
source
theorem Std.ExtDTreeMap.contains_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.contains (t.minKeyD fallback) = true
source
theorem Std.ExtDTreeMap.minKeyD_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.minKeyD fallback ∈ t
source
theorem Std.ExtDTreeMap.minKeyD_le_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) {fallback : α} :
(cmp (t.minKeyD fallback) k).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_le_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : k ∈ t) {fallback : α} :
(cmp (t.minKeyD fallback) k).isLE = true
source
theorem Std.ExtDTreeMap.le_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k fallback : α} :
(cmp k (t.minKeyD fallback)).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.getKey?_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.getKey? (t.minKeyD fallback) = some (t.minKeyD fallback)
source
theorem Std.ExtDTreeMap.getKey_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {fallback : α} {hc : t.minKeyD fallback ∈ t} :
t.getKey (t.minKeyD fallback) hc = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.getKey!_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {fallback : α} :
t.getKey! (t.minKeyD fallback) = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.getKeyD_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback fallback' : α} :
t.getKeyD (t.minKeyD fallback) fallback' = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.minKeyD_erase_eq_of_not_compare_minKeyD_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k fallback : α} (he : t.erase k ≠ ∅) (heq : ¬cmp k (t.minKeyD fallback) = Ordering.eq) :
(t.erase k).minKeyD fallback = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.minKeyD_le_minKeyD_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (he : t.erase k ≠ ∅) {fallback : α} :
(cmp (t.minKeyD fallback) ((t.erase k).minKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(t.insertIfNew k v).minKeyD fallback = t.minKey?.elim k fun (k' : α) => if cmp k k' = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.minKeyD_insertIfNew_le_minKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k : α} {v : β k} {fallback : α} :
(cmp ((t.insertIfNew k v).minKeyD fallback) (t.minKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_insertIfNew_le_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(cmp ((t.insertIfNew k v).minKeyD fallback) k).isLE = true
source
theorem Std.ExtDTreeMap.minKeyD_eq_headD_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {fallback : α} :
t.minKeyD fallback = t.keys.headD fallback
source
@[simp]
theorem Std.ExtDTreeMap.minKeyD_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} {fallback : α} :
(t.modify k f).minKeyD fallback = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.minKeyD_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (he : t.alter k f ≠ ∅) {fallback : α} :
(t.alter k f).minKeyD fallback = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
theorem Std.ExtDTreeMap.Const.minKeyD_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} (he : modify t k f ≠ ∅) {fallback : α} :
(modify t k f).minKeyD fallback = if cmp (t.minKeyD fallback) k = Ordering.eq then k else t.minKeyD fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.minKeyD_modify_eq_minKeyD {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} {fallback : α} :
(modify t k f).minKeyD fallback = t.minKeyD fallback
source
theorem Std.ExtDTreeMap.Const.compare_minKeyD_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {fallback : α} :
cmp ((modify t k f).minKeyD fallback) (t.minKeyD fallback) = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_minKeyD_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} {k : α} {f : β → β} {fallback : α} :
compare ((modify t k f).minKeyD fallback) (t.minKeyD fallback) = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.minKeyD_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (he : alter t k f ≠ ∅) {fallback : α} :
(alter t k f).minKeyD fallback = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k k').isLE = true
source
@[simp]
theorem Std.ExtDTreeMap.maxKey?_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] :
∅.maxKey? = none
source
@[simp]
theorem Std.ExtDTreeMap.maxKey?_eq_none_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey? = none ↔ t = ∅
source
theorem Std.ExtDTreeMap.maxKey?_eq_some_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} :
t.maxKey? = some km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey?_eq_some_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {km : α} :
t.maxKey? = some km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
@[simp]
theorem Std.ExtDTreeMap.isNone_maxKey?_eq_isEmpty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey?.isNone = t.isEmpty
source
@[simp]
theorem Std.ExtDTreeMap.isSome_maxKey?_eq_not_isEmpty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey?.isSome = !t.isEmpty
source
theorem Std.ExtDTreeMap.isSome_maxKey?_iff_ne_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey?.isSome = true ↔ t ≠ ∅
source
theorem Std.ExtDTreeMap.maxKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).maxKey? = some (t.maxKey?.elim k fun (k' : α) => if (cmp k' k).isLE = true then k else k')
source
theorem Std.ExtDTreeMap.isSome_maxKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).maxKey?.isSome = true
source
theorem Std.ExtDTreeMap.maxKey?_le_maxKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {km kmi : α} (hkm : t.maxKey? = some km) (hkmi : (t.insert k v).maxKey?.get ⋯ = kmi) :
(cmp km kmi).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey?_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {kmi : α} (hkmi : (t.insert k v).maxKey?.get ⋯ = kmi) :
(cmp k kmi).isLE = true
source
theorem Std.ExtDTreeMap.contains_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.maxKey? = some km) :
t.contains km = true
source
theorem Std.ExtDTreeMap.maxKey?_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.maxKey? = some km) :
km ∈ t
source
theorem Std.ExtDTreeMap.isSome_maxKey?_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) :
t.maxKey?.isSome = true
source
theorem Std.ExtDTreeMap.isSome_maxKey?_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
k ∈ t → t.maxKey?.isSome = true
source
theorem Std.ExtDTreeMap.le_maxKey?_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km : α} (hc : t.contains k = true) (hkm : t.maxKey?.get ⋯ = km) :
(cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.le_maxKey?_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km : α} (hc : k ∈ t) (hkm : t.maxKey?.get ⋯ = km) :
(cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey?_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(∀ (k' : α), t.maxKey? = some k' → (cmp k' k).isLE = true) ↔ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.getKey?_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} (hkm : t.maxKey? = some km) :
t.getKey? km = some km
source
theorem Std.ExtDTreeMap.getKey_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km : α} {hc : t.contains km = true} (hkm : t.maxKey?.get ⋯ = km) :
t.getKey km hc = km
source
theorem Std.ExtDTreeMap.getKey!_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {km : α} (hkm : t.maxKey? = some km) :
t.getKey! km = km
source
theorem Std.ExtDTreeMap.getKeyD_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {km fallback : α} (hkm : t.maxKey? = some km) :
t.getKeyD km fallback = km
source
@[simp]
theorem Std.ExtDTreeMap.maxKey?_bind_getKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey?.bind t.getKey? = t.maxKey?
source
theorem Std.ExtDTreeMap.maxKey?_erase_eq_iff_not_compare_eq_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} :
(t.erase k).maxKey? = t.maxKey? ↔ ∀ {km : α}, t.maxKey? = some km → ¬cmp k km = Ordering.eq
source
theorem Std.ExtDTreeMap.maxKey?_erase_eq_of_not_compare_eq_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : ∀ {km : α}, t.maxKey? = some km → ¬cmp k km = Ordering.eq) :
(t.erase k).maxKey? = t.maxKey?
source
theorem Std.ExtDTreeMap.isSome_maxKey?_of_isSome_maxKey?_erase {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hs : (t.erase k).maxKey?.isSome = true) :
t.maxKey?.isSome = true
source
theorem Std.ExtDTreeMap.maxKey?_erase_le_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k km kme : α} (hkme : (t.erase k).maxKey? = some kme) (hkm : t.maxKey?.get ⋯ = km) :
(cmp kme km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).maxKey? = some (t.maxKey?.elim k fun (k' : α) => if cmp k' k = Ordering.lt then k else k')
source
theorem Std.ExtDTreeMap.isSome_maxKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).maxKey?.isSome = true
source
theorem Std.ExtDTreeMap.maxKey?_le_maxKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {km kmi : α} (hkm : t.maxKey? = some km) (hkmi : (t.insertIfNew k v).maxKey?.get ⋯ = kmi) :
(cmp km kmi).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey?_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {kmi : α} (hkmi : (t.insertIfNew k v).maxKey?.get ⋯ = kmi) :
(cmp k kmi).isLE = true
source
theorem Std.ExtDTreeMap.maxKey?_eq_getLast?_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] :
t.maxKey? = t.keys.getLast?
source
@[simp]
theorem Std.ExtDTreeMap.maxKey?_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} :
(t.modify k f).maxKey? = t.maxKey?
source
theorem Std.ExtDTreeMap.maxKey?_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} :
(t.alter k f).maxKey? = some k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.Const.maxKey?_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).maxKey? = Option.map (fun (km : α) => if cmp km k = Ordering.eq then k else km) t.maxKey?
source
@[simp]
theorem Std.ExtDTreeMap.Const.maxKey?_modify_eq_maxKey? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} :
(modify t k f).maxKey? = t.maxKey?
source
theorem Std.ExtDTreeMap.Const.isSome_maxKey?_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).maxKey?.isSome = !t.isEmpty
source
theorem Std.ExtDTreeMap.Const.isSome_maxKey?_modify_eq_isSome {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} :
(modify t k f).maxKey?.isSome = t.maxKey?.isSome
source
theorem Std.ExtDTreeMap.Const.compare_maxKey?_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {km kmm : α} (hkm : t.maxKey? = some km) (hkmm : (modify t k f).maxKey?.get ⋯ = kmm) :
cmp kmm km = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.maxKey?_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} :
(alter t k f).maxKey? = some k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_eq_get_maxKey? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.maxKey he = t.maxKey?.get ⋯
source
theorem Std.ExtDTreeMap.maxKey?_eq_some_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) :
t.maxKey? = some (t.maxKey he)
source
theorem Std.ExtDTreeMap.maxKey_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {km : α} :
t.maxKey he = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {he : t ≠ ∅} {km : α} :
t.maxKey he = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insert k v).maxKey ⋯ = t.maxKey?.elim k fun (k' : α) => if (cmp k' k).isLE = true then k else k'
source
theorem Std.ExtDTreeMap.maxKey_le_maxKey_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {he : t ≠ ∅} :
(cmp (t.maxKey he) ((t.insert k v).maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(cmp k ((t.insert k v).maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.contains_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.contains (t.maxKey he) = true
source
theorem Std.ExtDTreeMap.maxKey_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.maxKey he ∈ t
source
theorem Std.ExtDTreeMap.le_maxKey_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) :
(cmp k (t.maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.le_maxKey_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : k ∈ t) :
(cmp k (t.maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t ≠ ∅} :
(cmp (t.maxKey he) k).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.getKey? (t.maxKey he) = some (t.maxKey he)
source
@[simp]
theorem Std.ExtDTreeMap.getKey_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {hc : t.maxKey he ∈ t} :
t.getKey (t.maxKey he) hc = t.maxKey he
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {he : t ≠ ∅} :
t.getKey! (t.maxKey he) = t.maxKey he
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} {fallback : α} :
t.getKeyD (t.maxKey he) fallback = t.maxKey he
source
@[simp]
theorem Std.ExtDTreeMap.maxKey_erase_eq_iff_not_compare_eq_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} :
(t.erase k).maxKey he = t.maxKey ⋯ ↔ ¬cmp k (t.maxKey ⋯) = Ordering.eq
source
theorem Std.ExtDTreeMap.maxKey_erase_eq_of_not_compare_eq_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} (hc : ¬cmp k (t.maxKey ⋯) = Ordering.eq) :
(t.erase k).maxKey he = t.maxKey ⋯
source
theorem Std.ExtDTreeMap.maxKey_erase_le_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {he : t.erase k ≠ ∅} :
(cmp ((t.erase k).maxKey he) (t.maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(t.insertIfNew k v).maxKey ⋯ = t.maxKey?.elim k fun (k' : α) => if cmp k' k = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.maxKey_le_maxKey_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {he : t ≠ ∅} :
(cmp (t.maxKey he) ((t.insertIfNew k v).maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} :
(cmp k ((t.insertIfNew k v).maxKey ⋯)).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_eq_getLast_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {he : t ≠ ∅} :
t.maxKey he = t.keys.getLast ⋯
source
@[simp]
theorem Std.ExtDTreeMap.maxKey_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} {he : t.modify k f ≠ ∅} :
(t.modify k f).maxKey he = t.maxKey ⋯
source
theorem Std.ExtDTreeMap.maxKey_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} {he : t.alter k f ≠ ∅} :
(t.alter k f).maxKey he = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.Const.maxKey_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
(modify t k f).maxKey he = if cmp (t.maxKey ⋯) k = Ordering.eq then k else t.maxKey ⋯
source
@[simp]
theorem Std.ExtDTreeMap.Const.maxKey_modify_eq_maxKey {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
(modify t k f).maxKey he = t.maxKey ⋯
source
theorem Std.ExtDTreeMap.Const.compare_maxKey_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
cmp ((modify t k f).maxKey he) (t.maxKey ⋯) = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_maxKey_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} {k : α} {f : β → β} {he : modify t k f ≠ ∅} :
compare ((modify t k f).maxKey he) (t.maxKey ⋯) = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.maxKey_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} {he : alter t k f ≠ ∅} :
(alter t k f).maxKey he = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.maxKey_eq_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {he : t ≠ ∅} :
t.maxKey he = t.maxKey!
source
theorem Std.ExtDTreeMap.maxKey?_eq_some_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.maxKey? = some t.maxKey!
source
@[simp]
theorem Std.ExtDTreeMap.maxKey!_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [Inhabited α] :
∅.maxKey! = default
source
theorem Std.ExtDTreeMap.maxKey!_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {km : α} :
t.maxKey! = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey!_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] (he : t ≠ ∅) {km : α} :
t.maxKey! = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKey!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(t.insert k v).maxKey! = t.maxKey?.elim k fun (k' : α) => if (cmp k' k).isLE = true then k else k'
source
theorem Std.ExtDTreeMap.maxKey!_le_maxKey!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} {v : β k} :
(cmp t.maxKey! (t.insert k v).maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey!_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(cmp k (t.insert k v).maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.contains_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.contains t.maxKey! = true
source
theorem Std.ExtDTreeMap.maxKey!_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.maxKey! ∈ t
source
theorem Std.ExtDTreeMap.le_maxKey!_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (hc : t.contains k = true) :
(cmp k t.maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.le_maxKey!_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (hc : k ∈ t) :
(cmp k t.maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.maxKey!_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} :
(cmp t.maxKey! k).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.getKey?_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.getKey? t.maxKey! = some t.maxKey!
source
theorem Std.ExtDTreeMap.getKey_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {hc : t.maxKey! ∈ t} :
t.getKey t.maxKey! hc = t.maxKey!
source
@[simp]
theorem Std.ExtDTreeMap.getKey_maxKey!_eq_maxKey {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {hc : t.maxKey! ∈ t} :
t.getKey t.maxKey! hc = t.maxKey ⋯
source
theorem Std.ExtDTreeMap.getKey!_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) :
t.getKey! t.maxKey! = t.maxKey!
source
theorem Std.ExtDTreeMap.getKeyD_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {fallback : α} :
t.getKeyD t.maxKey! fallback = t.maxKey!
source
theorem Std.ExtDTreeMap.maxKey!_erase_eq_of_not_compare_maxKey!_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (he : t.erase k ≠ ∅) (heq : ¬cmp k t.maxKey! = Ordering.eq) :
(t.erase k).maxKey! = t.maxKey!
source
theorem Std.ExtDTreeMap.maxKey!_erase_le_maxKey! {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} (he : t.erase k ≠ ∅) :
(cmp (t.erase k).maxKey! t.maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.maxKey!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(t.insertIfNew k v).maxKey! = t.maxKey?.elim k fun (k' : α) => if cmp k' k = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.maxKey!_le_maxKey!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {k : α} {v : β k} :
(cmp t.maxKey! (t.insertIfNew k v).maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKey!_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {k : α} {v : β k} :
(cmp k (t.insertIfNew k v).maxKey!).isLE = true
source
theorem Std.ExtDTreeMap.maxKey!_eq_getLast!_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] :
t.maxKey! = t.keys.getLast!
source
@[simp]
theorem Std.ExtDTreeMap.maxKey!_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β k → β k} :
(t.modify k f).maxKey! = t.maxKey!
source
theorem Std.ExtDTreeMap.maxKey!_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} (he : t.alter k f ≠ ∅) :
(t.alter k f).maxKey! = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.Const.maxKey!_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : β → β} (he : modify t k f ≠ ∅) :
(modify t k f).maxKey! = if cmp t.maxKey! k = Ordering.eq then k else t.maxKey!
source
@[simp]
theorem Std.ExtDTreeMap.Const.maxKey!_modify_eq_maxKey! {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {k : α} {f : β → β} :
(modify t k f).maxKey! = t.maxKey!
source
theorem Std.ExtDTreeMap.Const.compare_maxKey!_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : β → β} :
cmp (modify t k f).maxKey! t.maxKey! = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_maxKey!_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} [Inhabited α] {k : α} {f : β → β} :
compare (modify t k f).maxKey! t.maxKey! = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.maxKey!_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {k : α} {f : Option β → Option β} (he : alter t k f ≠ ∅) :
(alter t k f).maxKey! = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.maxKey?_eq_some_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.maxKey? = some (t.maxKeyD fallback)
source
@[simp]
theorem Std.ExtDTreeMap.maxKeyD_empty {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {fallback : α} :
∅.maxKeyD fallback = fallback
source
theorem Std.ExtDTreeMap.maxKey!_eq_maxKeyD_default {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] :
t.maxKey! = t.maxKeyD default
source
theorem Std.ExtDTreeMap.maxKeyD_eq_iff_getKey?_eq_self_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {km fallback : α} :
t.maxKeyD fallback = km ↔ t.getKey? km = some km ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKeyD_eq_iff_mem_and_forall {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] (he : t ≠ ∅) {km fallback : α} :
t.maxKeyD fallback = km ↔ km ∈ t ∧ ∀ (k : α), k ∈ t → (cmp k km).isLE = true
source
theorem Std.ExtDTreeMap.maxKeyD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(t.insert k v).maxKeyD fallback = t.maxKey?.elim k fun (k' : α) => if (cmp k' k).isLE = true then k else k'
source
theorem Std.ExtDTreeMap.maxKeyD_le_maxKeyD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k : α} {v : β k} {fallback : α} :
(cmp (t.maxKeyD fallback) ((t.insert k v).maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKeyD_insert {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(cmp k ((t.insert k v).maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.contains_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.contains (t.maxKeyD fallback) = true
source
theorem Std.ExtDTreeMap.maxKeyD_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.maxKeyD fallback ∈ t
source
theorem Std.ExtDTreeMap.le_maxKeyD_of_contains {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : t.contains k = true) {fallback : α} :
(cmp k (t.maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.le_maxKeyD_of_mem {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (hc : k ∈ t) {fallback : α} :
(cmp k (t.maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.maxKeyD_le {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k fallback : α} :
(cmp (t.maxKeyD fallback) k).isLE = true ↔ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.getKey?_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback : α} :
t.getKey? (t.maxKeyD fallback) = some (t.maxKeyD fallback)
source
theorem Std.ExtDTreeMap.getKey_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {fallback : α} {hc : t.maxKeyD fallback ∈ t} :
t.getKey (t.maxKeyD fallback) hc = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.getKey!_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] (he : t ≠ ∅) {fallback : α} :
t.getKey! (t.maxKeyD fallback) = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.getKeyD_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {fallback fallback' : α} :
t.getKeyD (t.maxKeyD fallback) fallback' = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.maxKeyD_erase_eq_of_not_compare_maxKeyD_eq {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k fallback : α} (he : t.erase k ≠ ∅) (heq : ¬cmp k (t.maxKeyD fallback) = Ordering.eq) :
(t.erase k).maxKeyD fallback = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.maxKeyD_erase_le_maxKeyD {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} (he : t.erase k ≠ ∅) {fallback : α} :
(cmp ((t.erase k).maxKeyD fallback) (t.maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.maxKeyD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(t.insertIfNew k v).maxKeyD fallback = t.maxKey?.elim k fun (k' : α) => if cmp k' k = Ordering.lt then k else k'
source
theorem Std.ExtDTreeMap.maxKeyD_le_maxKeyD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] (he : t ≠ ∅) {k : α} {v : β k} {fallback : α} :
(cmp (t.maxKeyD fallback) ((t.insertIfNew k v).maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.self_le_maxKeyD_insertIfNew {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {k : α} {v : β k} {fallback : α} :
(cmp k ((t.insertIfNew k v).maxKeyD fallback)).isLE = true
source
theorem Std.ExtDTreeMap.maxKeyD_eq_getLastD_keys {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {fallback : α} :
t.maxKeyD fallback = t.keys.getLastD fallback
source
@[simp]
theorem Std.ExtDTreeMap.maxKeyD_modify {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β k → β k} {fallback : α} :
(t.modify k f).maxKeyD fallback = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.maxKeyD_alter_eq_self {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : Option (β k) → Option (β k)} (he : t.alter k f ≠ ∅) {fallback : α} :
(t.alter k f).maxKeyD fallback = k ↔ (f (t.get? k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.Const.maxKeyD_modify {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} (he : modify t k f ≠ ∅) {fallback : α} :
(modify t k f).maxKeyD fallback = if cmp (t.maxKeyD fallback) k = Ordering.eq then k else t.maxKeyD fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.maxKeyD_modify_eq_maxKeyD {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {k : α} {f : β → β} {fallback : α} :
(modify t k f).maxKeyD fallback = t.maxKeyD fallback
source
theorem Std.ExtDTreeMap.Const.compare_maxKeyD_modify_eq {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : β → β} {fallback : α} :
cmp ((modify t k f).maxKeyD fallback) (t.maxKeyD fallback) = Ordering.eq
source
@[simp]
theorem Std.ExtDTreeMap.Const.ordCompare_maxKeyD_modify_eq {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : ExtDTreeMap α (fun (x : α) => β) compare} {k : α} {f : β → β} {fallback : α} :
compare ((modify t k f).maxKeyD fallback) (t.maxKeyD fallback) = Ordering.eq
source
theorem Std.ExtDTreeMap.Const.maxKeyD_alter_eq_self {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {k : α} {f : Option β → Option β} (he : alter t k f ≠ ∅) {fallback : α} :
(alter t k f).maxKeyD fallback = k ↔ (f (get? t k)).isSome = true ∧ ∀ (k' : α), k' ∈ t → (cmp k' k).isLE = true
source
theorem Std.ExtDTreeMap.ext_get? {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {t₁ t₂ : ExtDTreeMap α β cmp} (h : ∀ (k : α), t₁.get? k = t₂.get? k) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.ext_get?_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {t₁ t₂ : ExtDTreeMap α β cmp} :
t₁ = t₂ ↔ ∀ (k : α), t₁.get? k = t₂.get? k
source
theorem Std.ExtDTreeMap.toList_inj {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} [TransCmp cmp] {t₁ t₂ : ExtDTreeMap α β cmp} :
t₁.toList = t₂.toList ↔ t₁ = t₂
source
theorem Std.ExtDTreeMap.ext_toList {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t₁ t₂ : ExtDTreeMap α β cmp} [TransCmp cmp] (h : t₁.toList.Perm t₂.toList) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_getKey_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t₁ t₂ : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] (hk : ∀ (k : α) (hk : k ∈ t₁) (hk' : k ∈ t₂), t₁.getKey k hk = t₂.getKey k hk') (hv : ∀ (k : α), get? t₁ k = get? t₂ k) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_get? {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t₁ t₂ : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] (h : ∀ (k : α), get? t₁ k = get? t₂ k) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_getKey?_unit {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {t₁ t₂ : ExtDTreeMap α (fun (x : α) => Unit) cmp} (h : ∀ (k : α), t₁.getKey? k = t₂.getKey? k) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_contains_unit {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {t₁ t₂ : ExtDTreeMap α (fun (x : α) => Unit) cmp} (h : ∀ (k : α), t₁.contains k = t₂.contains k) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_mem_unit {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] [LawfulEqCmp cmp] {t₁ t₂ : ExtDTreeMap α (fun (x : α) => Unit) cmp} (h : ∀ (k : α), k ∈ t₁ ↔ k ∈ t₂) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.toList_inj {α : Type u} {cmp : α → α → Ordering} {β : Type v} [TransCmp cmp] {t₁ t₂ : ExtDTreeMap α (fun (x : α) => β) cmp} :
toList t₁ = toList t₂ ↔ t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_toList {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t₁ t₂ : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] (h : (toList t₁).Perm (toList t₂)) :
t₁ = t₂
source
theorem Std.ExtDTreeMap.Const.ext_keys_unit {α : Type u} {cmp : α → α → Ordering} [TransCmp cmp] {t₁ t₂ : ExtDTreeMap α (fun (x : α) => Unit) cmp} (h : t₁.keys.Perm t₂.keys) :
t₁ = t₂
source
@[simp]
theorem Std.ExtDTreeMap.toList_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → Option (γ a)} :
(filterMap f t).toList = List.filterMap (fun (p : (a : α) × β a) => Option.map (fun (x : γ p.fst) => ⟨p.fst, x⟩) (f p.fst p.snd)) t.toList
source
theorem Std.ExtDTreeMap.filterMap_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} :
filterMap f t = ∅ ↔ ∀ (k : α) (h : k ∈ t), f k (t.get k h) = none
source
theorem Std.ExtDTreeMap.contains_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
(filterMap f t).contains k = Option.any (fun (x : β k) => (f k x).isSome) (t.get? k)
source
theorem Std.ExtDTreeMap.mem_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
k ∈ filterMap f t ↔ ∃ (h : k ∈ t), (f k (t.get k h)).isSome = true
source
theorem Std.ExtDTreeMap.contains_of_contains_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
(filterMap f t).contains k = true → t.contains k = true
source
theorem Std.ExtDTreeMap.mem_of_mem_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
k ∈ filterMap f t → k ∈ t
source
theorem Std.ExtDTreeMap.size_filterMap_le_size {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → Option (γ a)} :
(filterMap f t).size ≤ t.size
source
theorem Std.ExtDTreeMap.size_filterMap_eq_size_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} :
(filterMap f t).size = t.size ↔ ∀ (a : α) (h : a ∈ t), (f a (t.get a h)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.get?_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
(filterMap f t).get? k = (t.get? k).bind (f k)
source
theorem Std.ExtDTreeMap.isSome_apply_of_mem_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} (h' : k ∈ filterMap f t) :
(f k (t.get k ⋯)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.get_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} {h' : k ∈ filterMap f t} :
(filterMap f t).get k h' = (f k (t.get k ⋯)).get ⋯
source
@[simp]
theorem Std.ExtDTreeMap.get!_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} [Inhabited (γ k)] :
(filterMap f t).get! k = ((t.get? k).bind (f k)).get!
source
@[simp]
theorem Std.ExtDTreeMap.getD_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} {fallback : γ k} :
(filterMap f t).getD k fallback = ((t.get? k).bind (f k)).getD fallback
source
theorem Std.ExtDTreeMap.getKey?_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} :
(filterMap f t).getKey? k = (t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (t.get x ⋯)).isSome
source
@[simp]
theorem Std.ExtDTreeMap.getKey_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → Option (γ a)} {k : α} {h' : k ∈ filterMap f t} :
(filterMap f t).getKey k h' = t.getKey k ⋯
source
theorem Std.ExtDTreeMap.getKey!_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {f : (a : α) → β a → Option (γ a)} {k : α} :
(filterMap f t).getKey! k = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (t.get x ⋯)).isSome).get!
source
theorem Std.ExtDTreeMap.getKeyD_filterMap {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Option (γ a)} {k fallback : α} :
(filterMap f t).getKeyD k fallback = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (t.get x ⋯)).isSome).getD fallback
source
theorem Std.ExtDTreeMap.Const.filterMap_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} :
filterMap f t = ∅ ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) (get t k h) = none
source
theorem Std.ExtDTreeMap.Const.mem_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} :
k ∈ filterMap f t ↔ ∃ (h : k ∈ t), (f (t.getKey k h) (get t k h)).isSome = true
source
theorem Std.ExtDTreeMap.Const.size_filterMap_eq_size_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} :
(filterMap f t).size = t.size ↔ ∀ (k : α) (h : k ∈ t), (f (t.getKey k h) (get t k h)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} :
get? (filterMap f t) k = (get? t k).pbind fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x
source
theorem Std.ExtDTreeMap.Const.get?_filterMap' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → Option γ} {k : α} :
get? (filterMap f t) k = (get? t k).bind fun (x : β) => f k x

Simpler variant of `get?_filterMap` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.get?_filterMap_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k k' : α} (h : t.getKey? k = some k') :
get? (filterMap f t) k = (get? t k).bind (f k')
source
theorem Std.ExtDTreeMap.Const.isSome_apply_of_mem_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} (h : k ∈ filterMap f t) :
(f (t.getKey k ⋯) (get t k ⋯)).isSome = true
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} {h : k ∈ filterMap f t} :
get (filterMap f t) k h = (f (t.getKey k ⋯) (get t k ⋯)).get ⋯
source
theorem Std.ExtDTreeMap.Const.get_filterMap' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → Option γ} {k : α} {h : k ∈ filterMap f t} :
get (filterMap f t) k h = (f k (get t k ⋯)).get ⋯

Simpler variant of `get_filterMap` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.get!_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited γ] {f : α → β → Option γ} {k : α} :
get! (filterMap f t) k = ((get? t k).pbind fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x).get!
source
theorem Std.ExtDTreeMap.Const.get!_filterMap' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited γ] {f : α → β → Option γ} {k : α} :
get! (filterMap f t) k = ((get? t k).bind (f k)).get!

Simpler variant of `get!_filterMap` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.get!_filterMap_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited γ] {f : α → β → Option γ} {k k' : α} (h : t.getKey? k = some k') :
get! (filterMap f t) k = ((get? t k).bind (f k')).get!
source
theorem Std.ExtDTreeMap.Const.getD_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} {fallback : γ} :
getD (filterMap f t) k fallback = ((get? t k).pbind fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x).getD fallback
source
theorem Std.ExtDTreeMap.Const.getD_filterMap' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → Option γ} {k : α} {fallback : γ} :
getD (filterMap f t) k fallback = ((get? t k).bind (f k)).getD fallback

Simpler variant of `getD_filterMap` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.getD_filterMap_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k k' : α} {fallback : γ} (h : t.getKey? k = some k') :
getD (filterMap f t) k fallback = ((get? t k).bind (f k')).getD fallback
source
theorem Std.ExtDTreeMap.Const.toList_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} :
toList (filterMap (fun (k : α) (v : β) => f k v) t) = List.filterMap (fun (p : α × β) => Option.map (fun (x : γ) => (p.fst, x)) (f p.fst p.snd)) (toList t)
source
theorem Std.ExtDTreeMap.Const.getKey?_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k : α} :
(filterMap f t).getKey? k = (t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (get t x ⋯)).isSome
source
theorem Std.ExtDTreeMap.Const.getKey!_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {f : α → β → Option γ} {k : α} :
(filterMap f t).getKey! k = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (get t x ⋯)).isSome).get!
source
theorem Std.ExtDTreeMap.Const.getKeyD_filterMap {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Option γ} {k fallback : α} :
(filterMap f t).getKeyD k fallback = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => (f x (get t x ⋯)).isSome).getD fallback
source
theorem Std.ExtDTreeMap.filterMap_eq_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {f : (a : α) → β a → Bool} :
filterMap (fun (k : α) => Option.guard fun (v : β k) => f k v) t = filter f t
source
@[simp]
theorem Std.ExtDTreeMap.toList_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : (a : α) → β a → Bool} :
(filter f t).toList = List.filter (fun (p : (a : α) × β a) => f p.fst p.snd) t.toList
source
theorem Std.ExtDTreeMap.keys_filter_key {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} :
(filter (fun (k : α) (x : β k) => f k) t).keys = List.filter f t.keys
source
theorem Std.ExtDTreeMap.filter_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} :
filter f t = ∅ ↔ ∀ (k : α) (h : k ∈ t), f k (t.get k h) = false
source
theorem Std.ExtDTreeMap.filter_key_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} :
filter (fun (a : α) (x : β a) => f a) t = ∅ ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) = false
source
theorem Std.ExtDTreeMap.contains_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
(filter f t).contains k = Option.any (f k) (t.get? k)
source
theorem Std.ExtDTreeMap.mem_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
k ∈ filter f t ↔ ∃ (h : k ∈ t), f k (t.get k h) = true
source
theorem Std.ExtDTreeMap.mem_filter_key {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} {k : α} :
k ∈ filter (fun (a : α) (x : β a) => f a) t ↔ ∃ (h : k ∈ t), f (t.getKey k h) = true
source
theorem Std.ExtDTreeMap.contains_of_contains_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
(filter f t).contains k = true → t.contains k = true
source
theorem Std.ExtDTreeMap.mem_of_mem_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
k ∈ filter f t → k ∈ t
source
theorem Std.ExtDTreeMap.size_filter_le_size {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : (a : α) → β a → Bool} :
(filter f t).size ≤ t.size
source
theorem Std.ExtDTreeMap.size_filter_eq_size_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} :
(filter f t).size = t.size ↔ ∀ (k : α) (h : k ∈ t), f k (t.get k h) = true
source
theorem Std.ExtDTreeMap.filter_eq_self_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} :
filter f t = t ↔ ∀ (k : α) (h : k ∈ t), f k (t.get k h) = true
source
theorem Std.ExtDTreeMap.filter_key_equiv_self_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} :
filter (fun (k : α) (x : β k) => f k) t = t ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) = true
source
theorem Std.ExtDTreeMap.size_filter_key_eq_size_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} :
(filter (fun (k : α) (x : β k) => f k) t).size = t.size ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) = true
source
@[simp]
theorem Std.ExtDTreeMap.get?_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
(filter f t).get? k = Option.filter (f k) (t.get? k)
source
@[simp]
theorem Std.ExtDTreeMap.get_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} {h' : k ∈ filter f t} :
(filter f t).get k h' = t.get k ⋯
source
theorem Std.ExtDTreeMap.get!_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} [Inhabited (β k)] :
(filter f t).get! k = (Option.filter (f k) (t.get? k)).get!
source
theorem Std.ExtDTreeMap.getD_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} {fallback : β k} :
(filter f t).getD k fallback = (Option.filter (f k) (t.get? k)).getD fallback
source
theorem Std.ExtDTreeMap.keys_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} :
(filter f t).keys = (List.filter (fun (x : { x : α // x ∈ t.keys }) => match x with | ⟨x, h'⟩ => f x (t.get x ⋯)) t.keys.attach).unattach
source
theorem Std.ExtDTreeMap.getKey?_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k : α} :
(filter f t).getKey? k = (t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (t.get x ⋯)
source
theorem Std.ExtDTreeMap.getKey?_filter_key {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} {k : α} :
(filter (fun (k : α) (x : β k) => f k) t).getKey? k = Option.filter f (t.getKey? k)
source
@[simp]
theorem Std.ExtDTreeMap.getKey_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : (a : α) → β a → Bool} {k : α} {h' : k ∈ filter f t} :
(filter f t).getKey k h' = t.getKey k ⋯
source
theorem Std.ExtDTreeMap.getKey!_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited α] {f : (a : α) → β a → Bool} {k : α} :
(filter f t).getKey! k = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (t.get x ⋯)).get!
source
theorem Std.ExtDTreeMap.getKey!_filter_key {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [Inhabited α] {f : α → Bool} {k : α} :
(filter (fun (k : α) (x : β k) => f k) t).getKey! k = (Option.filter f (t.getKey? k)).get!
source
theorem Std.ExtDTreeMap.getKeyD_filter {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → Bool} {k fallback : α} :
(filter f t).getKeyD k fallback = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (t.get x ⋯)).getD fallback
source
theorem Std.ExtDTreeMap.getKeyD_filter_key {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} [TransCmp cmp] {f : α → Bool} {k fallback : α} :
(filter (fun (k : α) (x : β k) => f k) t).getKeyD k fallback = (Option.filter f (t.getKey? k)).getD fallback
source
theorem Std.ExtDTreeMap.Const.filter_eq_empty_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
filter f t = ∅ ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) (get t k h) = false
source
theorem Std.ExtDTreeMap.Const.mem_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k : α} :
k ∈ filter f t ↔ ∃ (h' : k ∈ t), f (t.getKey k h') (get t k h') = true
source
theorem Std.ExtDTreeMap.Const.size_filter_le_size {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
(filter f t).size ≤ t.size
source
theorem Std.ExtDTreeMap.Const.size_filter_eq_size_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
(filter f t).size = t.size ↔ ∀ (a : α) (h : a ∈ t), f (t.getKey a h) (get t a h) = true
source
theorem Std.ExtDTreeMap.Const.filter_eq_self_iff {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
filter f t = t ↔ ∀ (k : α) (h : k ∈ t), f (t.getKey k h) (get t k h) = true
source
theorem Std.ExtDTreeMap.Const.get?_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k : α} :
get? (filter f t) k = (get? t k).pfilter fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_filter' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → Bool} {k : α} :
get? (filter f t) k = Option.filter (f k) (get? t k)

Simpler variant of `get?_filter` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.get?_filter_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k k' : α} :
t.getKey? k = some k' → get? (filter f t) k = Option.filter (fun (x : β) => f k' x) (get? t k)
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k : α} {h' : k ∈ filter f t} :
get (filter f t) k h' = get t k ⋯
source
theorem Std.ExtDTreeMap.Const.get!_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {f : α → β → Bool} {k : α} :
get! (filter f t) k = ((get? t k).pfilter fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x).get!
source
theorem Std.ExtDTreeMap.Const.get!_filter' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited β] {f : α → β → Bool} {k : α} :
get! (filter f t) k = (Option.filter (f k) (get? t k)).get!

Simpler variant of `get!_filter` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.get!_filter_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited β] {f : α → β → Bool} {k k' : α} :
t.getKey? k = some k' → get! (filter f t) k = (Option.filter (fun (x : β) => f k' x) (get? t k)).get!
source
theorem Std.ExtDTreeMap.Const.getD_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k : α} {fallback : β} :
getD (filter f t) k fallback = ((get? t k).pfilter fun (x : β) (h' : get? t k = some x) => f (t.getKey k ⋯) x).getD fallback
source
theorem Std.ExtDTreeMap.Const.getD_filter' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → Bool} {k : α} {fallback : β} :
getD (filter f t) k fallback = (Option.filter (f k) (get? t k)).getD fallback

Simpler variant of `getD_filter` when `LawfulEqCmp` is available.

source
theorem Std.ExtDTreeMap.Const.getD_filter_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k k' : α} {fallback : β} :
t.getKey? k = some k' → getD (filter f t) k fallback = (Option.filter (fun (x : β) => f k' x) (get? t k)).getD fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.toList_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
toList (filter f t) = List.filter (fun (p : α × β) => f p.fst p.snd) (toList t)
source
theorem Std.ExtDTreeMap.Const.keys_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} :
(filter f t).keys = (List.filter (fun (x : { x : α // x ∈ t.keys }) => match x with | ⟨x, h'⟩ => f x (get t x ⋯)) t.keys.attach).unattach
source
theorem Std.ExtDTreeMap.Const.getKey?_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k : α} :
(filter f t).getKey? k = (t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (get t x ⋯)
source
theorem Std.ExtDTreeMap.Const.getKey!_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited α] {f : α → β → Bool} {k : α} :
(filter f t).getKey! k = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (get t x ⋯)).get!
source
theorem Std.ExtDTreeMap.Const.getKeyD_filter {α : Type u} {cmp : α → α → Ordering} {β : Type v} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → Bool} {k fallback : α} :
(filter f t).getKeyD k fallback = ((t.getKey? k).pfilter fun (x : α) (h' : t.getKey? k = some x) => f x (get t x ⋯)).getD fallback
source
@[simp]
theorem Std.ExtDTreeMap.map_id {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} :
map (fun (x : α) (v : β x) => v) t = t
source
@[simp]
theorem Std.ExtDTreeMap.map_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} {δ : α → Type w'} {f : (a : α) → β a → γ a} {g : (a : α) → γ a → δ a} :
map g (map f t) = map (fun (k : α) (v : β k) => g k (f k v)) t
source
@[simp]
theorem Std.ExtDTreeMap.toList_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} :
(map f t).toList = List.map (fun (p : (a : α) × β a) => ⟨p.fst, f p.fst p.snd⟩) t.toList
source
@[simp]
theorem Std.ExtDTreeMap.keys_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} :
(map f t).keys = t.keys
source
theorem Std.ExtDTreeMap.filterMap_eq_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} :
filterMap (fun (k : α) (v : β k) => some (f k v)) t = map f t
source
@[simp]
theorem Std.ExtDTreeMap.map_eq_empty_iff {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} :
map f t = ∅ ↔ t = ∅
source
theorem Std.ExtDTreeMap.contains_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
(map f t).contains k = t.contains k
source
theorem Std.ExtDTreeMap.contains_of_contains_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
(map f t).contains k = true → t.contains k = true
source
@[simp]
theorem Std.ExtDTreeMap.mem_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
k ∈ map f t ↔ k ∈ t
source
theorem Std.ExtDTreeMap.mem_of_mem_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
k ∈ map f t → k ∈ t
source
@[simp]
theorem Std.ExtDTreeMap.size_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} :
(map f t).size = t.size
source
@[simp]
theorem Std.ExtDTreeMap.get?_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
(map f t).get? k = Option.map (f k) (t.get? k)
source
@[simp]
theorem Std.ExtDTreeMap.get_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → γ a} {k : α} {h' : k ∈ map f t} :
(map f t).get k h' = f k (t.get k ⋯)
source
theorem Std.ExtDTreeMap.get!_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → γ a} {k : α} [Inhabited (γ k)] :
(map f t).get! k = (Option.map (f k) (t.get? k)).get!
source
theorem Std.ExtDTreeMap.getD_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [LawfulEqCmp cmp] {f : (a : α) → β a → γ a} {k : α} {fallback : γ k} :
(map f t).getD k fallback = (Option.map (f k) (t.get? k)).getD fallback
source
@[simp]
theorem Std.ExtDTreeMap.getKey?_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} :
(map f t).getKey? k = t.getKey? k
source
@[simp]
theorem Std.ExtDTreeMap.getKey_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k : α} {h' : k ∈ map f t} :
(map f t).getKey k h' = t.getKey k ⋯
source
@[simp]
theorem Std.ExtDTreeMap.getKey!_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] [Inhabited α] {f : (a : α) → β a → γ a} {k : α} :
(map f t).getKey! k = t.getKey! k
source
@[simp]
theorem Std.ExtDTreeMap.getKeyD_map {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {t : ExtDTreeMap α β cmp} {γ : α → Type w} [TransCmp cmp] {f : (a : α) → β a → γ a} {k fallback : α} :
(map f t).getKeyD k fallback = t.getKeyD k fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_map {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → γ} {k : α} :
get? (map f t) k = Option.map (f k) (get? t k)
source
@[simp]
theorem Std.ExtDTreeMap.Const.get?_map' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → γ} {k : α} :
get? (map f t) k = Option.pmap (fun (v : β) (h' : k ∈ t) => f (t.getKey k h') v) (get? t k) ⋯

Variant of `get?_map` that holds without `LawfulEqCmp`.

source
theorem Std.ExtDTreeMap.Const.get?_map_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → γ} {k k' : α} (h : t.getKey? k = some k') :
get? (map f t) k = Option.map (f k') (get? t k)
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_map {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → γ} {k : α} {h' : k ∈ map f t} :
get (map f t) k h' = f k (get t k ⋯)
source
@[simp]
theorem Std.ExtDTreeMap.Const.get_map' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → γ} {k : α} {h' : k ∈ map f t} :
get (map f t) k h' = f (t.getKey k ⋯) (get t k ⋯)

Variant of `get_map` that holds without `LawfulEqCmp`.

source
theorem Std.ExtDTreeMap.Const.get!_map {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] [Inhabited γ] {f : α → β → γ} {k : α} :
get! (map f t) k = (Option.map (f k) (get? t k)).get!
source
theorem Std.ExtDTreeMap.Const.get!_map' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited γ] {f : α → β → γ} {k : α} :
get! (map f t) k = (Option.pmap (fun (v : β) (h : k ∈ t) => f (t.getKey k h) v) (get? t k) ⋯).get!

Variant of `get!_map` that holds without `LawfulEqCmp`.

source
theorem Std.ExtDTreeMap.Const.get!_map_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited γ] {f : α → β → γ} {k k' : α} (h : t.getKey? k = some k') :
get! (map f t) k = (Option.map (f k') (get? t k)).get!
source
theorem Std.ExtDTreeMap.Const.getD_map {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [LawfulEqCmp cmp] {f : α → β → γ} {k : α} {fallback : γ} :
getD (map f t) k fallback = (Option.map (f k) (get? t k)).getD fallback
source
theorem Std.ExtDTreeMap.Const.getD_map' {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → γ} {k : α} {fallback : γ} :
getD (map f t) k fallback = (Option.pmap (fun (v : β) (h : k ∈ t) => f (t.getKey k h) v) (get? t k) ⋯).getD fallback

Variant of `getD_map` that holds without `LawfulEqCmp`.

source
theorem Std.ExtDTreeMap.Const.getD_map_of_getKey?_eq_some {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] [Inhabited γ] {f : α → β → γ} {k k' : α} {fallback : γ} (h : t.getKey? k = some k') :
getD (map f t) k fallback = (Option.map (f k') (get? t k)).getD fallback
source
@[simp]
theorem Std.ExtDTreeMap.Const.toList_map {α : Type u} {cmp : α → α → Ordering} {β : Type v} {γ : Type w} {t : ExtDTreeMap α (fun (x : α) => β) cmp} [TransCmp cmp] {f : α → β → γ} :
toList (map f t) = List.map (fun (p : α × β) => (p.fst, f p.fst p.snd)) (toList t)