Documentation

Std.Data.DHashMap.Lemmas

Dependent hash map lemmas #

This file contains lemmas about Std.Data.DHashMap. Most of the lemmas require EquivBEq α and LawfulHashable α for the key type α. The easiest way to obtain these instances is to provide an instance of LawfulBEq α.

@[simp]
theorem Std.DHashMap.isEmpty_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {c : Nat} :
@[simp]
theorem Std.DHashMap.isEmpty_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} :
@[simp]
theorem Std.DHashMap.isEmpty_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
theorem Std.DHashMap.mem_iff_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {a : α} :
theorem Std.DHashMap.contains_congr {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a b : α} (hab : (a == b) = true) :
theorem Std.DHashMap.mem_congr {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a b : α} (hab : (a == b) = true) :
a m b m
@[simp]
theorem Std.DHashMap.contains_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.not_mem_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.contains_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} :
@[simp]
theorem Std.DHashMap.not_mem_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} :
theorem Std.DHashMap.contains_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
theorem Std.DHashMap.not_mem_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
m.isEmpty = true¬a m
theorem Std.DHashMap.isEmpty_eq_false_iff_exists_contains_eq_true {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
theorem Std.DHashMap.isEmpty_eq_false_iff_exists_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
theorem Std.DHashMap.isEmpty_iff_forall_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
m.isEmpty = true ∀ (a : α), m.contains a = false
theorem Std.DHashMap.isEmpty_iff_forall_not_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
m.isEmpty = true ∀ (a : α), ¬a m
@[simp]
theorem Std.DHashMap.insert_eq_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {p : (a : α) × β a} :
@[simp]
theorem Std.DHashMap.singleton_eq_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {p : (a : α) × β a} :
@[simp]
theorem Std.DHashMap.contains_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insert k v).contains a = (k == a || m.contains a)
@[simp]
theorem Std.DHashMap.mem_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
a m.insert k v (k == a) = true a m
theorem Std.DHashMap.contains_of_contains_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insert k v).contains a = true(k == a) = falsem.contains a = true
theorem Std.DHashMap.mem_of_mem_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
a m.insert k v(k == a) = falsea m
theorem Std.DHashMap.contains_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insert k v).contains k = true
theorem Std.DHashMap.mem_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
k m.insert k v
@[simp]
theorem Std.DHashMap.size_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {c : Nat} :
(empty c).size = 0
@[simp]
theorem Std.DHashMap.size_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} :
theorem Std.DHashMap.isEmpty_eq_size_eq_zero {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} :
m.isEmpty = (m.size == 0)
theorem Std.DHashMap.size_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insert k v).size = if k m then m.size else m.size + 1
theorem Std.DHashMap.size_le_size_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
m.size (m.insert k v).size
theorem Std.DHashMap.size_insert_le {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insert k v).size m.size + 1
@[simp]
theorem Std.DHashMap.erase_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {k : α} {c : Nat} :
(empty c).erase k = empty c
@[simp]
theorem Std.DHashMap.erase_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {k : α} :
@[simp]
theorem Std.DHashMap.isEmpty_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
(m.erase k).isEmpty = (m.isEmpty || m.size == 1 && m.contains k)
@[simp]
theorem Std.DHashMap.contains_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} :
(m.erase k).contains a = (!k == a && m.contains a)
@[simp]
theorem Std.DHashMap.mem_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} :
a m.erase k (k == a) = false a m
theorem Std.DHashMap.contains_of_contains_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} :
(m.erase k).contains a = truem.contains a = true
theorem Std.DHashMap.mem_of_mem_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} :
a m.erase ka m
theorem Std.DHashMap.size_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
(m.erase k).size = if k m then m.size - 1 else m.size
theorem Std.DHashMap.size_erase_le {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
(m.erase k).size m.size
theorem Std.DHashMap.size_le_size_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
m.size (m.erase k).size + 1
@[simp]
theorem Std.DHashMap.containsThenInsert_fst {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.containsThenInsert_snd {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.containsThenInsertIfNew_fst {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.containsThenInsertIfNew_snd {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.get?_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.get?_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} :
theorem Std.DHashMap.get?_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} :
m.isEmpty = truem.get? a = none
theorem Std.DHashMap.get?_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a k : α} {v : β k} :
(m.insert k v).get? a = if h : (k == a) = true then some (cast v) else m.get? a
@[simp]
theorem Std.DHashMap.get?_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {v : β k} :
(m.insert k v).get? k = some v
theorem Std.DHashMap.contains_eq_isSome_get? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} :
m.contains a = (m.get? a).isSome
theorem Std.DHashMap.get?_eq_none_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} :
m.contains a = falsem.get? a = none
theorem Std.DHashMap.get?_eq_none {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} :
¬a mm.get? a = none
theorem Std.DHashMap.get?_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} :
(m.erase k).get? a = if (k == a) = true then none else m.get? a
@[simp]
theorem Std.DHashMap.get?_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} :
(m.erase k).get? k = none
@[simp]
theorem Std.DHashMap.Const.get?_empty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.Const.get?_emptyc {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {a : α} :
theorem Std.DHashMap.Const.get?_of_isEmpty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} :
m.isEmpty = trueget? m a = none
theorem Std.DHashMap.Const.get?_insert {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β} :
get? (m.insert k v) a = if (k == a) = true then some v else get? m a
@[simp]
theorem Std.DHashMap.Const.get?_insert_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β} :
get? (m.insert k v) k = some v
theorem Std.DHashMap.Const.contains_eq_isSome_get? {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} :
m.contains a = (get? m a).isSome
theorem Std.DHashMap.Const.get?_eq_none_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} :
m.contains a = falseget? m a = none
theorem Std.DHashMap.Const.get?_eq_none {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} :
¬a mget? m a = none
theorem Std.DHashMap.Const.get?_erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} :
get? (m.erase k) a = if (k == a) = true then none else get? m a
@[simp]
theorem Std.DHashMap.Const.get?_erase_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} :
get? (m.erase k) k = none
theorem Std.DHashMap.Const.get?_eq_get? {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {a : α} :
get? m a = m.get? a
theorem Std.DHashMap.Const.get?_congr {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a b : α} (hab : (a == b) = true) :
get? m a = get? m b
theorem Std.DHashMap.get_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {v : β k} {h₁ : a m.insert k v} :
(m.insert k v).get a h₁ = if h₂ : (k == a) = true then cast v else m.get a
@[simp]
theorem Std.DHashMap.get_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {v : β k} :
(m.insert k v).get k = v
@[simp]
theorem Std.DHashMap.get_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {h' : a m.erase k} :
(m.erase k).get a h' = m.get a
theorem Std.DHashMap.get?_eq_some_get {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {h : a m} :
m.get? a = some (m.get a h)
theorem Std.DHashMap.Const.get_insert {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β} {h₁ : a m.insert k v} :
get (m.insert k v) a h₁ = if h₂ : (k == a) = true then v else get m a
@[simp]
theorem Std.DHashMap.Const.get_insert_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β} :
get (m.insert k v) k = v
@[simp]
theorem Std.DHashMap.Const.get_erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {h' : a m.erase k} :
get (m.erase k) a h' = get m a
theorem Std.DHashMap.Const.get?_eq_some_get {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {h : a m} :
get? m a = some (get m a h)
theorem Std.DHashMap.Const.get_eq_get {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {a : α} {h : a m} :
get m a h = m.get a h
theorem Std.DHashMap.Const.get_congr {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {a b : α} (hab : (a == b) = true) {h' : a m} :
get m a h' = get m b
@[simp]
theorem Std.DHashMap.get!_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} [Inhabited (β a)] {c : Nat} :
@[simp]
theorem Std.DHashMap.get!_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} [Inhabited (β a)] :
theorem Std.DHashMap.get!_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
theorem Std.DHashMap.get!_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} [Inhabited (β a)] {v : β k} :
(m.insert k v).get! a = if h : (k == a) = true then cast v else m.get! a
@[simp]
theorem Std.DHashMap.get!_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] {b : β a} :
(m.insert a b).get! a = b
theorem Std.DHashMap.get!_eq_default_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
theorem Std.DHashMap.get!_eq_default {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
¬a mm.get! a = default
theorem Std.DHashMap.get!_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} [Inhabited (β a)] :
(m.erase k).get! a = if (k == a) = true then default else m.get! a
@[simp]
theorem Std.DHashMap.get!_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} [Inhabited (β k)] :
theorem Std.DHashMap.get?_eq_some_get!_of_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
m.contains a = truem.get? a = some (m.get! a)
theorem Std.DHashMap.get?_eq_some_get! {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
a mm.get? a = some (m.get! a)
theorem Std.DHashMap.get!_eq_get!_get? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
m.get! a = (m.get? a).get!
theorem Std.DHashMap.get_eq_get! {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] {h : a m} :
m.get a h = m.get! a
@[simp]
theorem Std.DHashMap.Const.get!_empty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [Inhabited β] {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.Const.get!_emptyc {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [Inhabited β] {a : α} :
theorem Std.DHashMap.Const.get!_of_isEmpty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
theorem Std.DHashMap.Const.get!_insert {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k a : α} {v : β} :
get! (m.insert k v) a = if (k == a) = true then v else get! m a
@[simp]
theorem Std.DHashMap.Const.get!_insert_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k : α} {v : β} :
get! (m.insert k v) k = v
theorem Std.DHashMap.Const.get!_eq_default_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
theorem Std.DHashMap.Const.get!_eq_default {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
¬a mget! m a = default
theorem Std.DHashMap.Const.get!_erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k a : α} :
get! (m.erase k) a = if (k == a) = true then default else get! m a
@[simp]
theorem Std.DHashMap.Const.get!_erase_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k : α} :
theorem Std.DHashMap.Const.get?_eq_some_get!_of_contains {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
m.contains a = trueget? m a = some (get! m a)
theorem Std.DHashMap.Const.get?_eq_some_get! {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
a mget? m a = some (get! m a)
theorem Std.DHashMap.Const.get!_eq_get!_get? {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
get! m a = (get? m a).get!
theorem Std.DHashMap.Const.get_eq_get! {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} {h : a m} :
get m a h = get! m a
theorem Std.DHashMap.Const.get!_eq_get! {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] [Inhabited β] {a : α} :
get! m a = m.get! a
theorem Std.DHashMap.Const.get!_congr {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a b : α} (hab : (a == b) = true) :
get! m a = get! m b
@[simp]
theorem Std.DHashMap.getD_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} {fallback : β a} {c : Nat} :
(empty c).getD a fallback = fallback
@[simp]
theorem Std.DHashMap.getD_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {a : α} {fallback : β a} :
.getD a fallback = fallback
theorem Std.DHashMap.getD_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
m.isEmpty = truem.getD a fallback = fallback
theorem Std.DHashMap.getD_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {fallback : β a} {v : β k} :
(m.insert k v).getD a fallback = if h : (k == a) = true then cast v else m.getD a fallback
@[simp]
theorem Std.DHashMap.getD_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {fallback v : β k} :
(m.insert k v).getD k fallback = v
theorem Std.DHashMap.getD_eq_fallback_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
m.contains a = falsem.getD a fallback = fallback
theorem Std.DHashMap.getD_eq_fallback {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
¬a mm.getD a fallback = fallback
theorem Std.DHashMap.getD_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {fallback : β a} :
(m.erase k).getD a fallback = if (k == a) = true then fallback else m.getD a fallback
@[simp]
theorem Std.DHashMap.getD_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {fallback : β k} :
(m.erase k).getD k fallback = fallback
theorem Std.DHashMap.get?_eq_some_getD_of_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
m.contains a = truem.get? a = some (m.getD a fallback)
theorem Std.DHashMap.get?_eq_some_getD {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
a mm.get? a = some (m.getD a fallback)
theorem Std.DHashMap.getD_eq_getD_get? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} :
m.getD a fallback = (m.get? a).getD fallback
theorem Std.DHashMap.get_eq_getD {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} {fallback : β a} {h : a m} :
m.get a h = m.getD a fallback
theorem Std.DHashMap.get!_eq_getD_default {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {a : α} [Inhabited (β a)] :
m.get! a = m.getD a default
@[simp]
theorem Std.DHashMap.Const.getD_empty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {a : α} {fallback : β} {c : Nat} :
getD (empty c) a fallback = fallback
@[simp]
theorem Std.DHashMap.Const.getD_emptyc {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {a : α} {fallback : β} :
getD a fallback = fallback
theorem Std.DHashMap.Const.getD_of_isEmpty {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
m.isEmpty = truegetD m a fallback = fallback
theorem Std.DHashMap.Const.getD_insert {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {fallback v : β} :
getD (m.insert k v) a fallback = if (k == a) = true then v else getD m a fallback
@[simp]
theorem Std.DHashMap.Const.getD_insert_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback v : β} :
getD (m.insert k v) k fallback = v
theorem Std.DHashMap.Const.getD_eq_fallback_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
m.contains a = falsegetD m a fallback = fallback
theorem Std.DHashMap.Const.getD_eq_fallback {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
¬a mgetD m a fallback = fallback
theorem Std.DHashMap.Const.getD_erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {fallback : β} :
getD (m.erase k) a fallback = if (k == a) = true then fallback else getD m a fallback
@[simp]
theorem Std.DHashMap.Const.getD_erase_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} :
getD (m.erase k) k fallback = fallback
theorem Std.DHashMap.Const.get?_eq_some_getD_of_contains {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
m.contains a = trueget? m a = some (getD m a fallback)
theorem Std.DHashMap.Const.get?_eq_some_getD {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
a mget? m a = some (getD m a fallback)
theorem Std.DHashMap.Const.getD_eq_getD_get? {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} :
getD m a fallback = (get? m a).getD fallback
theorem Std.DHashMap.Const.get_eq_getD {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a : α} {fallback : β} {h : a m} :
get m a h = getD m a fallback
theorem Std.DHashMap.Const.get!_eq_getD_default {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {a : α} :
get! m a = getD m a default
theorem Std.DHashMap.Const.getD_eq_getD {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {a : α} {fallback : β} :
getD m a fallback = m.getD a fallback
theorem Std.DHashMap.Const.getD_congr {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {a b : α} {fallback : β} (hab : (a == b) = true) :
getD m a fallback = getD m b fallback
@[simp]
theorem Std.DHashMap.getKey?_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.getKey?_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a : α} :
theorem Std.DHashMap.getKey?_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
theorem Std.DHashMap.getKey?_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a k : α} {v : β k} :
(m.insert k v).getKey? a = if (k == a) = true then some k else m.getKey? a
@[simp]
theorem Std.DHashMap.getKey?_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insert k v).getKey? k = some k
theorem Std.DHashMap.contains_eq_isSome_getKey? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
theorem Std.DHashMap.getKey?_eq_none_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
theorem Std.DHashMap.getKey?_eq_none {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} :
¬a mm.getKey? a = none
theorem Std.DHashMap.getKey?_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} :
(m.erase k).getKey? a = if (k == a) = true then none else m.getKey? a
@[simp]
theorem Std.DHashMap.getKey?_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
theorem Std.DHashMap.getKey_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} {h₁ : a m.insert k v} :
(m.insert k v).getKey a h₁ = if h₂ : (k == a) = true then k else m.getKey a
@[simp]
theorem Std.DHashMap.getKey_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insert k v).getKey k = k
@[simp]
theorem Std.DHashMap.getKey_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {h' : a m.erase k} :
(m.erase k).getKey a h' = m.getKey a
theorem Std.DHashMap.getKey?_eq_some_getKey {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a : α} {h : a m} :
m.getKey? a = some (m.getKey a h)
@[simp]
theorem Std.DHashMap.getKey!_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [Inhabited α] {a : α} {c : Nat} :
@[simp]
theorem Std.DHashMap.getKey!_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [Inhabited α] {a : α} :
theorem Std.DHashMap.getKey!_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
theorem Std.DHashMap.getKey!_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k a : α} {v : β k} :
(m.insert k v).getKey! a = if (k == a) = true then k else m.getKey! a
@[simp]
theorem Std.DHashMap.getKey!_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} {b : β a} :
(m.insert a b).getKey! a = a
theorem Std.DHashMap.getKey!_eq_default_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
theorem Std.DHashMap.getKey!_eq_default {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
¬a mm.getKey! a = default
theorem Std.DHashMap.getKey!_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k a : α} :
@[simp]
theorem Std.DHashMap.getKey!_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} :
theorem Std.DHashMap.getKey?_eq_some_getKey!_of_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
m.contains a = truem.getKey? a = some (m.getKey! a)
theorem Std.DHashMap.getKey?_eq_some_getKey! {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
a mm.getKey? a = some (m.getKey! a)
theorem Std.DHashMap.getKey!_eq_get!_getKey? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
m.getKey! a = (m.getKey? a).get!
theorem Std.DHashMap.getKey_eq_getKey! {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} {h : a m} :
m.getKey a h = m.getKey! a
@[simp]
theorem Std.DHashMap.getKeyD_empty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a fallback : α} {c : Nat} :
(empty c).getKeyD a fallback = fallback
@[simp]
theorem Std.DHashMap.getKeyD_emptyc {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {a fallback : α} :
.getKeyD a fallback = fallback
theorem Std.DHashMap.getKeyD_of_isEmpty {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
m.isEmpty = truem.getKeyD a fallback = fallback
theorem Std.DHashMap.getKeyD_insert {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a fallback : α} {v : β k} :
(m.insert k v).getKeyD a fallback = if (k == a) = true then k else m.getKeyD a fallback
@[simp]
theorem Std.DHashMap.getKeyD_insert_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k fallback : α} {v : β k} :
(m.insert k v).getKeyD k fallback = k
theorem Std.DHashMap.getKeyD_eq_fallback_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
m.contains a = falsem.getKeyD a fallback = fallback
theorem Std.DHashMap.getKeyD_eq_fallback {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
¬a mm.getKeyD a fallback = fallback
theorem Std.DHashMap.getKeyD_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a fallback : α} :
(m.erase k).getKeyD a fallback = if (k == a) = true then fallback else m.getKeyD a fallback
@[simp]
theorem Std.DHashMap.getKeyD_erase_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k fallback : α} :
(m.erase k).getKeyD k fallback = fallback
theorem Std.DHashMap.getKey?_eq_some_getKeyD_of_contains {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
m.contains a = truem.getKey? a = some (m.getKeyD a fallback)
theorem Std.DHashMap.getKey?_eq_some_getKeyD {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
a mm.getKey? a = some (m.getKeyD a fallback)
theorem Std.DHashMap.getKeyD_eq_getD_getKey? {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} :
m.getKeyD a fallback = (m.getKey? a).getD fallback
theorem Std.DHashMap.getKey_eq_getKeyD {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {a fallback : α} {h : a m} :
m.getKey a h = m.getKeyD a fallback
theorem Std.DHashMap.getKey!_eq_getKeyD_default {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {a : α} :
@[simp]
theorem Std.DHashMap.isEmpty_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.contains_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insertIfNew k v).contains a = (k == a || m.contains a)
@[simp]
theorem Std.DHashMap.mem_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
a m.insertIfNew k v (k == a) = true a m
theorem Std.DHashMap.contains_insertIfNew_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
theorem Std.DHashMap.mem_insertIfNew_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
theorem Std.DHashMap.contains_of_contains_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insertIfNew k v).contains a = true(k == a) = falsem.contains a = true
theorem Std.DHashMap.mem_of_mem_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
a m.insertIfNew k v(k == a) = falsea m
theorem Std.DHashMap.contains_of_contains_insertIfNew' {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insertIfNew k v).contains a = true¬((k == a) = true m.contains k = false) → m.contains a = true

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

theorem Std.DHashMap.mem_of_mem_insertIfNew' {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
a m.insertIfNew k v¬((k == a) = true ¬k m) → a m

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

theorem Std.DHashMap.size_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insertIfNew k v).size = if k m then m.size else m.size + 1
theorem Std.DHashMap.size_le_size_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
theorem Std.DHashMap.size_insertIfNew_le {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} :
(m.insertIfNew k v).size m.size + 1
theorem Std.DHashMap.get?_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {v : β k} :
(m.insertIfNew k v).get? a = if h : (k == a) = true ¬k m then some (cast v) else m.get? a
theorem Std.DHashMap.get_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {v : β k} {h₁ : a m.insertIfNew k v} :
(m.insertIfNew k v).get a h₁ = if h₂ : (k == a) = true ¬k m then cast v else m.get a
theorem Std.DHashMap.get!_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} [Inhabited (β a)] {v : β k} :
(m.insertIfNew k v).get! a = if h : (k == a) = true ¬k m then cast v else m.get! a
theorem Std.DHashMap.getD_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k a : α} {fallback : β a} {v : β k} :
(m.insertIfNew k v).getD a fallback = if h : (k == a) = true ¬k m then cast v else m.getD a fallback
theorem Std.DHashMap.Const.get?_insertIfNew {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β} :
get? (m.insertIfNew k v) a = if (k == a) = true ¬k m then some v else get? m a
theorem Std.DHashMap.Const.get_insertIfNew {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β} {h₁ : a m.insertIfNew k v} :
get (m.insertIfNew k v) a h₁ = if h₂ : (k == a) = true ¬k m then v else get m a
theorem Std.DHashMap.Const.get!_insertIfNew {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k a : α} {v : β} :
get! (m.insertIfNew k v) a = if (k == a) = true ¬k m then v else get! m a
theorem Std.DHashMap.Const.getD_insertIfNew {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k a : α} {fallback v : β} :
getD (m.insertIfNew k v) a fallback = if (k == a) = true ¬k m then v else getD m a fallback
theorem Std.DHashMap.getKey?_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} :
(m.insertIfNew k v).getKey? a = if (k == a) = true ¬k m then some k else m.getKey? a
theorem Std.DHashMap.getKey_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a : α} {v : β k} {h₁ : a m.insertIfNew k v} :
(m.insertIfNew k v).getKey a h₁ = if h₂ : (k == a) = true ¬k m then k else m.getKey a
theorem Std.DHashMap.getKey!_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k a : α} {v : β k} :
(m.insertIfNew k v).getKey! a = if (k == a) = true ¬k m then k else m.getKey! a
theorem Std.DHashMap.getKeyD_insertIfNew {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k a fallback : α} {v : β k} :
(m.insertIfNew k v).getKeyD a fallback = if (k == a) = true ¬k m then k else m.getKeyD a fallback
@[simp]
theorem Std.DHashMap.getThenInsertIfNew?_fst {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.getThenInsertIfNew?_snd {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {v : β k} :
@[simp]
theorem Std.DHashMap.Const.getThenInsertIfNew?_fst {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} {k : α} {v : β} :
@[simp]
theorem Std.DHashMap.Const.getThenInsertIfNew?_snd {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} {k : α} {v : β} :
@[simp]
theorem Std.DHashMap.length_keys {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
@[simp]
theorem Std.DHashMap.isEmpty_keys {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
@[simp]
theorem Std.DHashMap.contains_keys {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {k : α} :
@[simp]
theorem Std.DHashMap.mem_keys {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} :
k m.keys k m
theorem Std.DHashMap.distinct_keys {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] :
List.Pairwise (fun (a b : α) => (a == b) = false) m.keys
@[simp]
theorem Std.DHashMap.insertMany_nil {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} :
@[simp]
theorem Std.DHashMap.insertMany_list_singleton {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {k : α} {v : β k} :
m.insertMany [k, v] = m.insert k v
theorem Std.DHashMap.insertMany_cons {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} {l : List ((a : α) × β a)} {k : α} {v : β k} :
m.insertMany (k, v :: l) = (m.insert k v).insertMany l
@[simp]
theorem Std.DHashMap.contains_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
@[simp]
theorem Std.DHashMap.mem_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
theorem Std.DHashMap.mem_of_mem_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} (mem : k m.insertMany l) (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
k m
theorem Std.DHashMap.get?_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).get? k = m.get? k
theorem Std.DHashMap.get?_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(m.insertMany l).get? k' = some (cast v)
theorem Std.DHashMap.get_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) {h : k m.insertMany l} :
(m.insertMany l).get k h = m.get k
theorem Std.DHashMap.get_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) {h : k' m.insertMany l} :
(m.insertMany l).get k' h = cast v
theorem Std.DHashMap.get!_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} [Inhabited (β k)] (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).get! k = m.get! k
theorem Std.DHashMap.get!_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} [Inhabited (β k')] (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(m.insertMany l).get! k' = cast v
theorem Std.DHashMap.getD_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} {fallback : β k} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).getD k fallback = m.getD k fallback
theorem Std.DHashMap.getD_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} {fallback : β k'} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(m.insertMany l).getD k' fallback = cast v
theorem Std.DHashMap.getKey?_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.getKey?_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
theorem Std.DHashMap.getKey_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) {h : k m.insertMany l} :
(m.insertMany l).getKey k h = m.getKey k
theorem Std.DHashMap.getKey_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) {h : k' m.insertMany l} :
(m.insertMany l).getKey k' h = k
theorem Std.DHashMap.getKey!_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.getKey!_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
(m.insertMany l).getKey! k' = k
theorem Std.DHashMap.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k fallback : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).getKeyD k fallback = m.getKeyD k fallback
theorem Std.DHashMap.getKeyD_insertMany_list_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' fallback : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
(m.insertMany l).getKeyD k' fallback = k
theorem Std.DHashMap.size_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) :
(∀ (a : α), a m(List.map Sigma.fst l).contains a = false)(m.insertMany l).size = m.size + l.length
theorem Std.DHashMap.size_le_size_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
theorem Std.DHashMap.size_insertMany_list_le {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
@[simp]
theorem Std.DHashMap.isEmpty_insertMany_list {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
@[simp]
theorem Std.DHashMap.Const.insertMany_nil {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} :
@[simp]
theorem Std.DHashMap.Const.insertMany_list_singleton {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} {k : α} {v : β} :
theorem Std.DHashMap.Const.insertMany_cons {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} {l : List (α × β)} {k : α} {v : β} :
insertMany m ((k, v) :: l) = insertMany (m.insert k v) l
@[simp]
theorem Std.DHashMap.Const.contains_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
@[simp]
theorem Std.DHashMap.Const.mem_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
theorem Std.DHashMap.Const.mem_of_mem_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (mem : k insertMany m l) (contains_eq_false : (List.map Prod.fst l).contains k = false) :
k m
theorem Std.DHashMap.Const.getKey?_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.getKey?_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
theorem Std.DHashMap.Const.getKey_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) {h : k insertMany m l} :
(insertMany m l).getKey k h = m.getKey k
theorem Std.DHashMap.Const.getKey_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) {h : k' insertMany m l} :
(insertMany m l).getKey k' h = k
theorem Std.DHashMap.Const.getKey!_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.getKey!_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
(insertMany m l).getKey! k' = k
theorem Std.DHashMap.Const.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k fallback : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany m l).getKeyD k fallback = m.getKeyD k fallback
theorem Std.DHashMap.Const.getKeyD_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' fallback : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
(insertMany m l).getKeyD k' fallback = k
theorem Std.DHashMap.Const.size_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) :
(∀ (a : α), a m(List.map Prod.fst l).contains a = false)(insertMany m l).size = m.size + l.length
theorem Std.DHashMap.Const.size_le_size_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
theorem Std.DHashMap.Const.size_insertMany_list_le {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
@[simp]
theorem Std.DHashMap.Const.isEmpty_insertMany_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
theorem Std.DHashMap.Const.get?_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get? (insertMany m l) k = get? m k
theorem Std.DHashMap.Const.get?_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
get? (insertMany m l) k' = some v
theorem Std.DHashMap.Const.get_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) {h : k insertMany m l} :
get (insertMany m l) k h = get m k
theorem Std.DHashMap.Const.get_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) {h : k' insertMany m l} :
get (insertMany m l) k' h = v
theorem Std.DHashMap.Const.get!_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get! (insertMany m l) k = get! m k
theorem Std.DHashMap.Const.get!_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
get! (insertMany m l) k' = v
theorem Std.DHashMap.Const.getD_insertMany_list_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} {fallback : β} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
getD (insertMany m l) k fallback = getD m k fallback
theorem Std.DHashMap.Const.getD_insertMany_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v fallback : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
getD (insertMany m l) k' fallback = v
@[simp]
theorem Std.DHashMap.Const.insertManyIfNewUnit_nil {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} :
@[simp]
theorem Std.DHashMap.Const.insertManyIfNewUnit_list_singleton {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} {k : α} :
theorem Std.DHashMap.Const.insertManyIfNewUnit_cons {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} {l : List α} {k : α} :
@[simp]
theorem Std.DHashMap.Const.contains_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
@[simp]
theorem Std.DHashMap.Const.mem_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
theorem Std.DHashMap.Const.mem_of_mem_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
theorem Std.DHashMap.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (not_mem : ¬k m) (contains_eq_false : l.contains k = false) :
theorem Std.DHashMap.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
theorem Std.DHashMap.Const.getKey?_insertManyIfNewUnit_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (h' : k m) :
theorem Std.DHashMap.Const.getKey_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) {h : k' insertManyIfNewUnit m l} :
theorem Std.DHashMap.Const.getKey_insertManyIfNewUnit_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (mem : k m) {h : k insertManyIfNewUnit m l} :
theorem Std.DHashMap.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k : α} (not_mem : ¬k m) (contains_eq_false : l.contains k = false) :
theorem Std.DHashMap.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
theorem Std.DHashMap.Const.getKey!_insertManyIfNewUnit_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k : α} (mem : k m) :
theorem Std.DHashMap.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k fallback : α} (not_mem : ¬k m) (contains_eq_false : l.contains k = false) :
(insertManyIfNewUnit m l).getKeyD k fallback = fallback
theorem Std.DHashMap.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' fallback : α} (k_beq : (k == k') = true) (not_mem : ¬k m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
(insertManyIfNewUnit m l).getKeyD k' fallback = k
theorem Std.DHashMap.Const.getKeyD_insertManyIfNewUnit_list_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k fallback : α} (mem : k m) :
(insertManyIfNewUnit m l).getKeyD k fallback = m.getKeyD k fallback
theorem Std.DHashMap.Const.size_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) :
(∀ (a : α), a ml.contains a = false)(insertManyIfNewUnit m l).size = m.size + l.length
theorem Std.DHashMap.Const.size_le_size_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} :
theorem Std.DHashMap.Const.size_insertManyIfNewUnit_list_le {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} :
@[simp]
theorem Std.DHashMap.Const.isEmpty_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} :
theorem Std.DHashMap.Const.get?_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
theorem Std.DHashMap.Const.get_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} {l : List α} {k : α} {h : k insertManyIfNewUnit m l} :
theorem Std.DHashMap.Const.get!_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} {l : List α} {k : α} :
theorem Std.DHashMap.Const.getD_insertManyIfNewUnit_list {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α fun (x : α) => Unit} {l : List α} {k : α} {fallback : Unit} :
getD (insertManyIfNewUnit m l) k fallback = ()
@[simp]
theorem Std.DHashMap.ofList_nil {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} :
@[simp]
theorem Std.DHashMap.ofList_singleton {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {k : α} {v : β k} :
ofList [k, v] = .insert k v
theorem Std.DHashMap.ofList_cons {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {k : α} {v : β k} {tl : List ((a : α) × β a)} :
ofList (k, v :: tl) = (.insert k v).insertMany tl
@[simp]
theorem Std.DHashMap.contains_ofList {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
@[simp]
theorem Std.DHashMap.mem_ofList {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
theorem Std.DHashMap.get?_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.get?_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(ofList l).get? k' = some (cast v)
theorem Std.DHashMap.get_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) {h : k' ofList l} :
(ofList l).get k' h = cast v
theorem Std.DHashMap.get!_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} [Inhabited (β k)] (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.get!_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} [Inhabited (β k')] (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(ofList l).get! k' = cast v
theorem Std.DHashMap.getD_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} {fallback : β k} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).getD k fallback = fallback
theorem Std.DHashMap.getD_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [LawfulBEq α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) {v : β k} {fallback : β k'} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k, v l) :
(ofList l).getD k' fallback = cast v
theorem Std.DHashMap.getKey?_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.getKey?_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
(ofList l).getKey? k' = some k
theorem Std.DHashMap.getKey_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) {h : k' ofList l} :
(ofList l).getKey k' h = k
theorem Std.DHashMap.getKey!_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
theorem Std.DHashMap.getKey!_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List ((a : α) × β a)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
(ofList l).getKey! k' = k
theorem Std.DHashMap.getKeyD_ofList_of_contains_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k fallback : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).getKeyD k fallback = fallback
theorem Std.DHashMap.getKeyD_ofList_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k k' fallback : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) (mem : k List.map Sigma.fst l) :
(ofList l).getKeyD k' fallback = k
theorem Std.DHashMap.size_ofList {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) :
theorem Std.DHashMap.size_ofList_le {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
@[simp]
theorem Std.DHashMap.isEmpty_ofList {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
@[simp]
theorem Std.DHashMap.Const.ofList_nil {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} :
@[simp]
theorem Std.DHashMap.Const.ofList_singleton {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {k : α} {v : β} :
theorem Std.DHashMap.Const.ofList_cons {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {k : α} {v : β} {tl : List (α × β)} :
ofList ((k, v) :: tl) = insertMany (.insert k v) tl
@[simp]
theorem Std.DHashMap.Const.contains_ofList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
@[simp]
theorem Std.DHashMap.Const.mem_ofList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
theorem Std.DHashMap.Const.get?_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.get?_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
get? (ofList l) k' = some v
theorem Std.DHashMap.Const.get_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) {h : k' ofList l} :
get (ofList l) k' h = v
theorem Std.DHashMap.Const.get!_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k : α} [Inhabited β] (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.get!_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v : β} [Inhabited β] (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
get! (ofList l) k' = v
theorem Std.DHashMap.Const.getD_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k : α} {fallback : β} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
getD (ofList l) k fallback = fallback
theorem Std.DHashMap.Const.getD_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [LawfulBEq α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) {v fallback : β} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : (k, v) l) :
getD (ofList l) k' fallback = v
theorem Std.DHashMap.Const.getKey?_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.getKey?_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
(ofList l).getKey? k' = some k
theorem Std.DHashMap.Const.getKey_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) {h : k' ofList l} :
(ofList l).getKey k' h = k
theorem Std.DHashMap.Const.getKey!_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
theorem Std.DHashMap.Const.getKey!_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List (α × β)} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
(ofList l).getKey! k' = k
theorem Std.DHashMap.Const.getKeyD_ofList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k fallback : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l).getKeyD k fallback = fallback
theorem Std.DHashMap.Const.getKeyD_ofList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k k' fallback : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) (mem : k List.map Prod.fst l) :
(ofList l).getKeyD k' fallback = k
theorem Std.DHashMap.Const.size_ofList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) :
theorem Std.DHashMap.Const.size_ofList_le {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
@[simp]
theorem Std.DHashMap.Const.isEmpty_ofList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
@[simp]
theorem Std.DHashMap.Const.unitOfList_nil {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} :
@[simp]
theorem Std.DHashMap.Const.unitOfList_singleton {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {k : α} :
theorem Std.DHashMap.Const.unitOfList_cons {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {hd : α} {tl : List α} :
@[simp]
theorem Std.DHashMap.Const.contains_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
@[simp]
theorem Std.DHashMap.Const.mem_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
theorem Std.DHashMap.Const.getKey?_unitOfList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
theorem Std.DHashMap.Const.getKey?_unitOfList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
theorem Std.DHashMap.Const.getKey_unitOfList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) {h : k' unitOfList l} :
(unitOfList l).getKey k' h = k
theorem Std.DHashMap.Const.getKey!_unitOfList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
theorem Std.DHashMap.Const.getKey!_unitOfList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k k' : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
theorem Std.DHashMap.Const.getKeyD_unitOfList_of_contains_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k fallback : α} (contains_eq_false : l.contains k = false) :
(unitOfList l).getKeyD k fallback = fallback
theorem Std.DHashMap.Const.getKeyD_unitOfList_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k k' fallback : α} (k_beq : (k == k') = true) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k l) :
(unitOfList l).getKeyD k' fallback = k
theorem Std.DHashMap.Const.size_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) :
theorem Std.DHashMap.Const.size_unitOfList_le {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} :
@[simp]
theorem Std.DHashMap.Const.isEmpty_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} :
@[simp]
theorem Std.DHashMap.Const.get?_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
@[simp]
theorem Std.DHashMap.Const.get_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {l : List α} {k : α} {h : k unitOfList l} :
get (unitOfList l) k h = ()
@[simp]
theorem Std.DHashMap.Const.get!_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {l : List α} {k : α} :
@[simp]
theorem Std.DHashMap.Const.getD_unitOfList {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {l : List α} {k : α} {fallback : Unit} :
getD (unitOfList l) k fallback = ()
theorem Std.DHashMap.isEmpty_alter_eq_isEmpty_erase {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).isEmpty = ((m.erase k).isEmpty && (f (m.get? k)).isNone)
@[simp]
theorem Std.DHashMap.isEmpty_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).isEmpty = ((m.isEmpty || m.size == 1 && m.contains k) && (f (m.get? k)).isNone)
theorem Std.DHashMap.contains_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} :
(m.alter k f).contains k' = if (k == k') = true then (f (m.get? k)).isSome else m.contains k'
theorem Std.DHashMap.mem_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} :
k' m.alter k f if (k == k') = true then (f (m.get? k)).isSome = true else k' m
theorem Std.DHashMap.mem_alter_of_beq {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} (h : (k == k') = true) :
k' m.alter k f (f (m.get? k)).isSome = true
@[simp]
theorem Std.DHashMap.contains_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).contains k = (f (m.get? k)).isSome
@[simp]
theorem Std.DHashMap.mem_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
k m.alter k f (f (m.get? k)).isSome = true
theorem Std.DHashMap.contains_alter_of_beq_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} (h : (k == k') = false) :
(m.alter k f).contains k' = m.contains k'
theorem Std.DHashMap.mem_alter_of_beq_eq_false {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} (h : (k == k') = false) :
k' m.alter k f k' m
theorem Std.DHashMap.size_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).size = if (m.contains k && (f (m.get? k)).isNone) = true then m.size - 1 else if (!m.contains k && (f (m.get? k)).isSome) = true then m.size + 1 else m.size
theorem Std.DHashMap.size_alter_eq_add_one {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} (h : ¬k m) (h' : (f (m.get? k)).isSome = true) :
(m.alter k f).size = m.size + 1
theorem Std.DHashMap.size_alter_eq_sub_one {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} (h : k m) (h' : (f (m.get? k)).isNone = true) :
(m.alter k f).size = m.size - 1
theorem Std.DHashMap.size_alter_eq_self_of_not_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} (h : ¬k m) (h' : (f (m.get? k)).isNone = true) :
(m.alter k f).size = m.size
theorem Std.DHashMap.size_alter_eq_self_of_mem {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} (h : k m) (h' : (f (m.get? k)).isSome = true) :
(m.alter k f).size = m.size
theorem Std.DHashMap.size_alter_le_size {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).size m.size + 1
theorem Std.DHashMap.size_le_size_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
m.size - 1 (m.alter k f).size
theorem Std.DHashMap.get?_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} :
(m.alter k f).get? k' = if h : (k == k') = true then cast (f (m.get? k)) else m.get? k'
@[simp]
theorem Std.DHashMap.get?_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).get? k = f (m.get? k)
theorem Std.DHashMap.get_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} {h : k' m.alter k f} :
(m.alter k f).get k' h = if heq : (k == k') = true then cast ((f (m.get? k)).get ) else m.get k'
@[simp]
theorem Std.DHashMap.get_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} {h : k m.alter k f} :
(m.alter k f).get k h = (f (m.get? k)).get
theorem Std.DHashMap.get!_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} [hi : Inhabited (β k')] {f : Option (β k)Option (β k)} :
(m.alter k f).get! k' = if heq : (k == k') = true then (Option.map (cast ) (f (m.get? k))).get! else m.get! k'
@[simp]
theorem Std.DHashMap.get!_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} [Inhabited (β k)] {f : Option (β k)Option (β k)} :
(m.alter k f).get! k = (f (m.get? k)).get!
theorem Std.DHashMap.getD_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {fallback : β k'} {f : Option (β k)Option (β k)} :
(m.alter k f).getD k' fallback = if heq : (k == k') = true then (Option.map (cast ) (f (m.get? k))).getD fallback else m.getD k' fallback
@[simp]
theorem Std.DHashMap.getD_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {fallback : β k} {f : Option (β k)Option (β k)} :
(m.alter k f).getD k fallback = (f (m.get? k)).getD fallback
theorem Std.DHashMap.getKey?_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKey? k' = if (k == k') = true then if (f (m.get? k)).isSome = true then some k else none else m.getKey? k'
theorem Std.DHashMap.getKey?_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKey? k = if (f (m.get? k)).isSome = true then some k else none
theorem Std.DHashMap.getKey!_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKey! k' = if (k == k') = true then if (f (m.get? k)).isSome = true then k else default else m.getKey! k'
theorem Std.DHashMap.getKey!_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKey! k = if (f (m.get? k)).isSome = true then k else default
theorem Std.DHashMap.getKey_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : Option (β k)Option (β k)} {h : k' m.alter k f} :
(m.alter k f).getKey k' h = if heq : (k == k') = true then k else m.getKey k'
@[simp]
theorem Std.DHashMap.getKey_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k : α} {f : Option (β k)Option (β k)} {h : k m.alter k f} :
(m.alter k f).getKey k h = k
theorem Std.DHashMap.getKeyD_alter {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' fallback : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKeyD k' fallback = if (k == k') = true then if (f (m.get? k)).isSome = true then k else fallback else m.getKeyD k' fallback
@[simp]
theorem Std.DHashMap.getKeyD_alter_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k fallback : α} {f : Option (β k)Option (β k)} :
(m.alter k f).getKeyD k fallback = if (f (m.get? k)).isSome = true then k else fallback
theorem Std.DHashMap.Const.isEmpty_alter_eq_isEmpty_erase {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
(alter m k f).isEmpty = ((m.erase k).isEmpty && (f (get? m k)).isNone)
@[simp]
theorem Std.DHashMap.Const.isEmpty_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
(alter m k f).isEmpty = ((m.isEmpty || m.size == 1 && m.contains k) && (f (get? m k)).isNone)
theorem Std.DHashMap.Const.contains_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} :
(alter m k f).contains k' = if (k == k') = true then (f (get? m k)).isSome else m.contains k'
theorem Std.DHashMap.Const.mem_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} :
k' alter m k f if (k == k') = true then (f (get? m k)).isSome = true else k' m
theorem Std.DHashMap.Const.mem_alter_of_beq {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} (h : (k == k') = true) :
k' alter m k f (f (get? m k)).isSome = true
@[simp]
theorem Std.DHashMap.Const.contains_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
(alter m k f).contains k = (f (get? m k)).isSome
@[simp]
theorem Std.DHashMap.Const.mem_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
k alter m k f (f (get? m k)).isSome = true
theorem Std.DHashMap.Const.contains_alter_of_beq_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} (h : (k == k') = false) :
(alter m k f).contains k' = m.contains k'
theorem Std.DHashMap.Const.mem_alter_of_beq_eq_false {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} (h : (k == k') = false) :
k' alter m k f k' m
theorem Std.DHashMap.Const.size_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} :
(alter m k f).size = if (m.contains k && (f (get? m k)).isNone) = true then m.size - 1 else if (!m.contains k && (f (get? m k)).isSome) = true then m.size + 1 else m.size
theorem Std.DHashMap.Const.size_alter_eq_add_one {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} (h : ¬k m) (h' : (f (get? m k)).isSome = true) :
(alter m k f).size = m.size + 1
theorem Std.DHashMap.Const.size_alter_eq_sub_one {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} (h : k m) (h' : (f (get? m k)).isNone = true) :
(alter m k f).size = m.size - 1
theorem Std.DHashMap.Const.size_alter_eq_self_of_not_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} (h : ¬k m) (h' : (f (get? m k)).isNone = true) :
(alter m k f).size = m.size
theorem Std.DHashMap.Const.size_alter_eq_self_of_mem {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} (h : k m) (h' : (f (get? m k)).isSome = true) :
(alter m k f).size = m.size
theorem Std.DHashMap.Const.size_alter_le_size {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} :
(alter m k f).size m.size + 1
theorem Std.DHashMap.Const.size_le_size_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option βOption β} :
m.size - 1 (alter m k f).size
theorem Std.DHashMap.Const.get?_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} :
get? (alter m k f) k' = if (k == k') = true then f (get? m k) else get? m k'
@[simp]
theorem Std.DHashMap.Const.get?_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
get? (alter m k f) k = f (get? m k)
theorem Std.DHashMap.Const.get_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} {h : k' alter m k f} :
get (alter m k f) k' h = if heq : (k == k') = true then (f (get? m k)).get else get m k'
@[simp]
theorem Std.DHashMap.Const.get_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} {h : k alter m k f} :
get (alter m k f) k h = (f (get? m k)).get
theorem Std.DHashMap.Const.get!_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} [Inhabited β] {f : Option βOption β} :
get! (alter m k f) k' = if (k == k') = true then (f (get? m k)).get! else get! m k'
@[simp]
theorem Std.DHashMap.Const.get!_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} [Inhabited β] {f : Option βOption β} :
get! (alter m k f) k = (f (get? m k)).get!
theorem Std.DHashMap.Const.getD_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {fallback : β} {f : Option βOption β} :
getD (alter m k f) k' fallback = if (k == k') = true then (f (get? m k)).getD fallback else getD m k' fallback
@[simp]
theorem Std.DHashMap.Const.getD_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} {f : Option βOption β} :
getD (alter m k f) k fallback = (f (get? m k)).getD fallback
theorem Std.DHashMap.Const.getKey?_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option βOption β} :
(alter m k f).getKey? k' = if (k == k') = true then if (f (get? m k)).isSome = true then some k else none else m.getKey? k'
theorem Std.DHashMap.Const.getKey?_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option βOption β} :
(alter m k f).getKey? k = if (f (get? m k)).isSome = true then some k else none
theorem Std.DHashMap.Const.getKey!_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : Option βOption β} :
(alter m k f).getKey! k' = if (k == k') = true then if (f (get? m k)).isSome = true then k else default else m.getKey! k'
theorem Std.DHashMap.Const.getKey!_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : Option βOption β} :
(alter m k f).getKey! k = if (f (get? m k)).isSome = true then k else default
theorem Std.DHashMap.Const.getKey_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : Option βOption β} {h : k' alter m k f} :
(alter m k f).getKey k' h = if heq : (k == k') = true then k else m.getKey k'
@[simp]
theorem Std.DHashMap.Const.getKey_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : Option βOption β} {h : k alter m k f} :
(alter m k f).getKey k h = k
theorem Std.DHashMap.Const.getKeyD_alter {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' fallback : α} {f : Option βOption β} :
(alter m k f).getKeyD k' fallback = if (k == k') = true then if (f (get? m k)).isSome = true then k else fallback else m.getKeyD k' fallback
theorem Std.DHashMap.Const.getKeyD_alter_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k fallback : α} {f : Option βOption β} :
(alter m k f).getKeyD k fallback = if (f (get? m k)).isSome = true then k else fallback
@[simp]
theorem Std.DHashMap.isEmpty_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : β kβ k} :
@[simp]
theorem Std.DHashMap.contains_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : β kβ k} :
(m.modify k f).contains k' = m.contains k'
@[simp]
theorem Std.DHashMap.mem_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : β kβ k} :
k' m.modify k f k' m
@[simp]
theorem Std.DHashMap.size_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : β kβ k} :
(m.modify k f).size = m.size
theorem Std.DHashMap.get?_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : β kβ k} :
(m.modify k f).get? k' = if h : (k == k') = true then cast (Option.map f (m.get? k)) else m.get? k'
@[simp]
theorem Std.DHashMap.get?_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : β kβ k} :
(m.modify k f).get? k = Option.map f (m.get? k)
theorem Std.DHashMap.get_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : β kβ k} (h : k' m.modify k f) :
(m.modify k f).get k' h = if heq : (k == k') = true then cast (f (m.get k )) else m.get k'
@[simp]
theorem Std.DHashMap.get_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : β kβ k} {h : k m.modify k f} :
(m.modify k f).get k h = f (m.get k )
theorem Std.DHashMap.get!_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} [hi : Inhabited (β k')] {f : β kβ k} :
(m.modify k f).get! k' = if heq : (k == k') = true then (Option.map (cast ) (Option.map f (m.get? k))).get! else m.get! k'
@[simp]
theorem Std.DHashMap.get!_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} [Inhabited (β k)] {f : β kβ k} :
(m.modify k f).get! k = (Option.map f (m.get? k)).get!
theorem Std.DHashMap.getD_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {fallback : β k'} {f : β kβ k} :
(m.modify k f).getD k' fallback = if heq : (k == k') = true then (Option.map (cast ) (Option.map f (m.get? k))).getD fallback else m.getD k' fallback
@[simp]
theorem Std.DHashMap.getD_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {fallback : β k} {f : β kβ k} :
(m.modify k f).getD k fallback = (Option.map f (m.get? k)).getD fallback
theorem Std.DHashMap.getKey?_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' : α} {f : β kβ k} :
(m.modify k f).getKey? k' = if (k == k') = true then if k m then some k else none else m.getKey? k'
theorem Std.DHashMap.getKey?_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k : α} {f : β kβ k} :
(m.modify k f).getKey? k = if k m then some k else none
theorem Std.DHashMap.getKey!_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : β kβ k} :
(m.modify k f).getKey! k' = if (k == k') = true then if k m then k else default else m.getKey! k'
theorem Std.DHashMap.getKey!_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k : α} {f : β kβ k} :
(m.modify k f).getKey! k = if k m then k else default
theorem Std.DHashMap.getKey_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : β kβ k} {h : k' m.modify k f} :
(m.modify k f).getKey k' h = if (k == k') = true then k else m.getKey k'
@[simp]
theorem Std.DHashMap.getKey_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k : α} {f : β kβ k} {h : k m.modify k f} :
(m.modify k f).getKey k h = k
theorem Std.DHashMap.getKeyD_modify {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] {k k' fallback : α} {f : β kβ k} :
(m.modify k f).getKeyD k' fallback = if (k == k') = true then if k m then k else fallback else m.getKeyD k' fallback
theorem Std.DHashMap.getKeyD_modify_self {α : Type u} {β : αType v} {x✝ : BEq α} {x✝¹ : Hashable α} {m : DHashMap α β} [LawfulBEq α] [Inhabited α] {k fallback : α} {f : β kβ k} :
(m.modify k f).getKeyD k fallback = if k m then k else fallback
@[simp]
theorem Std.DHashMap.Const.isEmpty_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : ββ} :
@[simp]
theorem Std.DHashMap.Const.contains_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : ββ} :
(modify m k f).contains k' = m.contains k'
@[simp]
theorem Std.DHashMap.Const.mem_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : ββ} :
k' modify m k f k' m
@[simp]
theorem Std.DHashMap.Const.size_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : ββ} :
(modify m k f).size = m.size
theorem Std.DHashMap.Const.get?_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : ββ} :
get? (modify m k f) k' = if (k == k') = true then Option.map f (get? m k) else get? m k'
@[simp]
theorem Std.DHashMap.Const.get?_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : ββ} :
get? (modify m k f) k = Option.map f (get? m k)
theorem Std.DHashMap.Const.get_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : ββ} {h : k' modify m k f} :
get (modify m k f) k' h = if heq : (k == k') = true then f (get m k ) else get m k'
@[simp]
theorem Std.DHashMap.Const.get_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : ββ} {h : k modify m k f} :
get (modify m k f) k h = f (get m k )
theorem Std.DHashMap.Const.get!_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} [Inhabited β] {f : ββ} :
get! (modify m k f) k' = if (k == k') = true then (Option.map f (get? m k)).get! else get! m k'
@[simp]
theorem Std.DHashMap.Const.get!_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} [Inhabited β] {f : ββ} :
get! (modify m k f) k = (Option.map f (get? m k)).get!
theorem Std.DHashMap.Const.getD_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {fallback : β} {f : ββ} :
getD (modify m k f) k' fallback = if (k == k') = true then (Option.map f (get? m k)).getD fallback else getD m k' fallback
@[simp]
theorem Std.DHashMap.Const.getD_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} {f : ββ} :
getD (modify m k f) k fallback = (Option.map f (get? m k)).getD fallback
theorem Std.DHashMap.Const.getKey?_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : ββ} :
(modify m k f).getKey? k' = if (k == k') = true then if k m then some k else none else m.getKey? k'
theorem Std.DHashMap.Const.getKey?_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : ββ} :
(modify m k f).getKey? k = if k m then some k else none
theorem Std.DHashMap.Const.getKey!_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : ββ} :
(modify m k f).getKey! k' = if (k == k') = true then if k m then k else default else m.getKey! k'
theorem Std.DHashMap.Const.getKey!_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : ββ} :
(modify m k f).getKey! k = if k m then k else default
theorem Std.DHashMap.Const.getKey_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : ββ} {h : k' modify m k f} :
(modify m k f).getKey k' h = if (k == k') = true then k else m.getKey k'
@[simp]
theorem Std.DHashMap.Const.getKey_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : ββ} {h : k modify m k f} :
(modify m k f).getKey k h = k
theorem Std.DHashMap.Const.getKeyD_modify {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' fallback : α} {f : ββ} :
(modify m k f).getKeyD k' fallback = if (k == k') = true then if k m then k else fallback else m.getKeyD k' fallback
theorem Std.DHashMap.Const.getKeyD_modify_self {α : Type u} {x✝ : BEq α} {x✝¹ : Hashable α} {β : Type v} {m : DHashMap α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k fallback : α} {f : ββ} :
(modify m k f).getKeyD k fallback = if k m then k else fallback