# Dependent hash map lemmas #

This file contains lemmas about `Std.Data.DHashMap.Raw`. 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 α`.

source
def Std.DHashMap.Internal.Raw.tacticSimp_to_rawUsing_ :
Lean.ParserDescr

Internal implementation detail of the hash map

Equations

- One or more equations did not get rendered due to their size.

Instances For

source
@[simp]
theorem Std.DHashMap.Raw.size_emptyWithCapacity {α : Type u} {β : α → Type v} {c : Nat} :
(emptyWithCapacity c).size = 0
source
@[simp]
theorem Std.DHashMap.Raw.size_empty {α : Type u} {β : α → Type v} :
∅.size = 0
source
@[reducible, inline, deprecated Std.DHashMap.Raw.size_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.size_emptyc {α : Type u_1} {β : α → Type u_2} :
∅.size = 0
Equations

- @Std.DHashMap.Raw.size_emptyc = @Std.DHashMap.Raw.size_empty

Instances For

source
theorem Std.DHashMap.Raw.isEmpty_eq_size_eq_zero {α : Type u} {β : α → Type v} {m : Raw α β} :
m.isEmpty = (m.size == 0)
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {c : Nat} :
(emptyWithCapacity c).isEmpty = true
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] :
∅.isEmpty = true
source
@[reducible, inline, deprecated Std.DHashMap.Raw.isEmpty_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.isEmpty_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] :
∅.isEmpty = true
Equations

- @Std.DHashMap.Raw.isEmpty_emptyc = @Std.DHashMap.Raw.isEmpty_empty

Instances For

source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).isEmpty = false
source
theorem Std.DHashMap.Raw.mem_iff_contains {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {a : α} :
a ∈ m ↔ m.contains a = true
source
@[simp]
theorem Std.DHashMap.Raw.contains_iff_mem {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {a : α} :
m.contains a = true ↔ a ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.contains_eq_false_iff_not_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {k : α} :
m.contains k = false ↔ ¬k ∈ m
source
theorem Std.DHashMap.Raw.contains_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a b : α} (hab : (a == b) = true) :
m.contains a = m.contains b
source
theorem Std.DHashMap.Raw.mem_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a b : α} (hab : (a == b) = true) :
a ∈ m ↔ b ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.contains_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} {c : Nat} :
(emptyWithCapacity c).contains a = false
source
@[simp]
theorem Std.DHashMap.Raw.not_mem_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} {c : Nat} :
¬a ∈ emptyWithCapacity c
source
@[simp]
theorem Std.DHashMap.Raw.contains_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} :
∅.contains a = false
source
@[reducible, inline, deprecated Std.DHashMap.Raw.contains_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.contains_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {a : α} :
∅.contains a = false
Equations

- @Std.DHashMap.Raw.contains_emptyc = @Std.DHashMap.Raw.contains_empty

Instances For

source
@[simp]
theorem Std.DHashMap.Raw.not_mem_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} :
¬a ∈ ∅
source
@[reducible, inline, deprecated Std.DHashMap.Raw.not_mem_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.not_mem_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {a : α} :
¬a ∈ ∅
Equations

- @Std.DHashMap.Raw.not_mem_emptyc = @Std.DHashMap.Raw.not_mem_empty

Instances For

source
theorem Std.DHashMap.Raw.contains_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.isEmpty = true → m.contains a = false
source
theorem Std.DHashMap.Raw.not_mem_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.isEmpty = true → ¬a ∈ m
source
theorem Std.DHashMap.Raw.isEmpty_eq_false_iff_exists_contains_eq_true {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.isEmpty = false ↔ ∃ (a : α), m.contains a = true
source
theorem Std.DHashMap.Raw.isEmpty_eq_false_iff_exists_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.isEmpty = false ↔ ∃ (a : α), a ∈ m
source
theorem Std.DHashMap.Raw.isEmpty_iff_forall_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.isEmpty = true ↔ ∀ (a : α), m.contains a = false
source
theorem Std.DHashMap.Raw.isEmpty_iff_forall_not_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.isEmpty = true ↔ ∀ (a : α), ¬a ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.insert_eq_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {p : (a : α) × β a} :
Insert.insert p m = m.insert p.fst p.snd
source
@[simp]
theorem Std.DHashMap.Raw.singleton_eq_insert {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {p : (a : α) × β a} :
{p} = ∅.insert p.fst p.snd
source
@[simp]
theorem Std.DHashMap.Raw.contains_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a k : α} {v : β k} :
(m.insert k v).contains a = (k == a || m.contains a)
source
@[simp]
theorem Std.DHashMap.Raw.mem_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
a ∈ m.insert k v ↔ (k == a) = true ∨ a ∈ m
source
theorem Std.DHashMap.Raw.contains_of_contains_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a k : α} {v : β k} :
(m.insert k v).contains a = true → (k == a) = false → m.contains a = true
source
theorem Std.DHashMap.Raw.mem_of_mem_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
a ∈ m.insert k v → (k == a) = false → a ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.contains_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).contains k = true
source
@[simp]
theorem Std.DHashMap.Raw.mem_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
k ∈ m.insert k v
source
theorem Std.DHashMap.Raw.size_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).size = if k ∈ m then m.size else m.size + 1
source
theorem Std.DHashMap.Raw.size_le_size_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
m.size ≤ (m.insert k v).size
source
theorem Std.DHashMap.Raw.size_insert_le {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).size ≤ m.size + 1
source
@[simp]
theorem Std.DHashMap.Raw.erase_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {k : α} {c : Nat} :
(emptyWithCapacity c).erase k = emptyWithCapacity c
source
@[simp]
theorem Std.DHashMap.Raw.erase_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {k : α} :
∅.erase k = ∅
source
@[reducible, inline, deprecated Std.DHashMap.Raw.erase_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.erase_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {k : α} :
∅.erase k = ∅
Equations

- @Std.DHashMap.Raw.erase_emptyc = @Std.DHashMap.Raw.erase_empty

Instances For

source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
(m.erase k).isEmpty = (m.isEmpty || m.size == 1 && m.contains k)
source
@[simp]
theorem Std.DHashMap.Raw.contains_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
(m.erase k).contains a = (!k == a && m.contains a)
source
@[simp]
theorem Std.DHashMap.Raw.mem_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
a ∈ m.erase k ↔ (k == a) = false ∧ a ∈ m
source
theorem Std.DHashMap.Raw.contains_of_contains_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
(m.erase k).contains a = true → m.contains a = true
source
theorem Std.DHashMap.Raw.mem_of_mem_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
a ∈ m.erase k → a ∈ m
source
theorem Std.DHashMap.Raw.size_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
(m.erase k).size = if k ∈ m then m.size - 1 else m.size
source
theorem Std.DHashMap.Raw.size_erase_le {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
(m.erase k).size ≤ m.size
source
theorem Std.DHashMap.Raw.size_le_size_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
m.size ≤ (m.erase k).size + 1
source
@[simp]
theorem Std.DHashMap.Raw.containsThenInsert_fst {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) {k : α} {v : β k} :
(m.containsThenInsert k v).fst = m.contains k
source
@[simp]
theorem Std.DHashMap.Raw.containsThenInsert_snd {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) {k : α} {v : β k} :
(m.containsThenInsert k v).snd = m.insert k v
source
@[simp]
theorem Std.DHashMap.Raw.containsThenInsertIfNew_fst {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) {k : α} {v : β k} :
(m.containsThenInsertIfNew k v).fst = m.contains k
source
@[simp]
theorem Std.DHashMap.Raw.containsThenInsertIfNew_snd {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) {k : α} {v : β k} :
(m.containsThenInsertIfNew k v).snd = m.insertIfNew k v
source
@[simp]
theorem Std.DHashMap.Raw.get?_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} {c : Nat} :
(emptyWithCapacity c).get? a = none
source
@[simp]
theorem Std.DHashMap.Raw.get?_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} :
∅.get? a = none
source
@[reducible, inline, deprecated Std.DHashMap.Raw.get?_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.get?_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] [LawfulBEq α] {a : α} :
∅.get? a = none
Equations

- @Std.DHashMap.Raw.get?_emptyc = @Std.DHashMap.Raw.get?_empty

Instances For

source
theorem Std.DHashMap.Raw.get?_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
m.isEmpty = true → m.get? a = none
source
theorem Std.DHashMap.Raw.get?_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a k : α} {v : β k} :
(m.insert k v).get? a = if h : (k == a) = true then some (cast ⋯ v) else m.get? a
source
@[simp]
theorem Std.DHashMap.Raw.get?_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).get? k = some v
source
theorem Std.DHashMap.Raw.contains_eq_isSome_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
m.contains a = (m.get? a).isSome
source
@[simp]
theorem Std.DHashMap.Raw.isSome_get?_eq_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
(m.get? a).isSome = m.contains a
source
theorem Std.DHashMap.Raw.mem_iff_isSome_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
a ∈ m ↔ (m.get? a).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.isSome_get?_iff_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
(m.get? a).isSome = true ↔ a ∈ m
source
theorem Std.DHashMap.Raw.get?_eq_some_iff {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
m.get? k = some v ↔ ∃ (h : k ∈ m), m.get k h = v
source
theorem Std.DHashMap.Raw.get?_eq_none_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
m.contains a = false → m.get? a = none
source
theorem Std.DHashMap.Raw.get?_eq_none {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} :
¬a ∈ m → m.get? a = none
source
theorem Std.DHashMap.Raw.get?_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k a : α} :
(m.erase k).get? a = if (k == a) = true then none else m.get? a
source
@[simp]
theorem Std.DHashMap.Raw.get?_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} :
(m.erase k).get? k = none
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {β : Type v} {a : α} {c : Nat} :
get? (emptyWithCapacity c) a = none
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_empty {α : Type u} [BEq α] [Hashable α] {β : Type v} {a : α} :
get? ∅ a = none
source
@[reducible, inline, deprecated Std.DHashMap.Raw.Const.get?_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.Const.get?_emptyc {α : Type u_1} [BEq α] [Hashable α] {β : Type u_2} {a : α} :
get? ∅ a = none
Equations

- @Std.DHashMap.Raw.Const.get?_emptyc = @Std.DHashMap.Raw.Const.get?_empty

Instances For

source
theorem Std.DHashMap.Raw.Const.get?_of_isEmpty {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.isEmpty = true → get? m a = none
source
theorem Std.DHashMap.Raw.Const.get?_insert {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β} :
get? (m.insert k v) a = if (k == a) = true then some v else get? m a
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_insert_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
get? (m.insert k v) k = some v
source
theorem Std.DHashMap.Raw.Const.contains_eq_isSome_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.contains a = (get? m a).isSome
source
@[simp]
theorem Std.DHashMap.Raw.Const.isSome_get?_eq_contains {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
(get? m a).isSome = m.contains a
source
theorem Std.DHashMap.Raw.Const.mem_iff_isSome_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
a ∈ m ↔ (get? m a).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.Const.isSome_get?_iff_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
(get? m a).isSome = true ↔ a ∈ m
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
get? m k = some v ↔ ∃ (h : k ∈ m), get m k h = v
source
theorem Std.DHashMap.Raw.Const.get?_eq_none_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.contains a = false → get? m a = none
source
theorem Std.DHashMap.Raw.Const.get?_eq_none {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
¬a ∈ m → get? m a = none
source
theorem Std.DHashMap.Raw.Const.get?_erase {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
get? (m.erase k) a = if (k == a) = true then none else get? m a
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_erase_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
get? (m.erase k) k = none
source
theorem Std.DHashMap.Raw.Const.get?_eq_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] (h : m.WF) {a : α} :
get? m a = m.get? a
source
theorem Std.DHashMap.Raw.Const.get?_congr {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a b : α} (hab : (a == b) = true) :
get? m a = get? m b
source
theorem Std.DHashMap.Raw.get_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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 ⋯
source
@[simp]
theorem Std.DHashMap.Raw.get_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).get k ⋯ = v
source
@[simp]
theorem Std.DHashMap.Raw.get_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k a : α} {h' : k ∈ m.erase a} :
(m.erase a).get k h' = m.get k ⋯
source
theorem Std.DHashMap.Raw.get?_eq_some_get {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} (h✝ : a ∈ m) :
m.get? a = some (m.get a h✝)
source
theorem Std.DHashMap.Raw.get_eq_get_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {h' : a ∈ m} :
m.get a h' = (m.get? a).get ⋯
source
theorem Std.DHashMap.Raw.get_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {h' : (m.get? a).isSome = true} :
(m.get? a).get h' = m.get a ⋯
source
theorem Std.DHashMap.Raw.Const.get_insert {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_insert_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
get (m.insert k v) k ⋯ = v
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_erase {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {h' : a ∈ m.erase k} :
get (m.erase k) a h' = get m a ⋯
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_get {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} (h✝ : a ∈ m) :
get? m a = some (get m a h✝)
source
theorem Std.DHashMap.Raw.Const.get_eq_get_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h' : a ∈ m} :
get m a h' = (get? m a).get ⋯
source
theorem Std.DHashMap.Raw.Const.get_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h' : (get? m a).isSome = true} :
(get? m a).get h' = get m a ⋯
source
theorem Std.DHashMap.Raw.Const.get_eq_get {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] (h : m.WF) {a : α} {h✝ : a ∈ m} :
get m a h✝ = m.get a h✝
source
theorem Std.DHashMap.Raw.Const.get_congr {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a b : α} (hab : (a == b) = true) {h' : a ∈ m} :
get m a h' = get m b ⋯
source
@[simp]
theorem Std.DHashMap.Raw.get!_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} [Inhabited (β a)] {c : Nat} :
(emptyWithCapacity c).get! a = default
source
@[simp]
theorem Std.DHashMap.Raw.get!_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} [Inhabited (β a)] :
∅.get! a = default
source
@[reducible, inline, deprecated Std.DHashMap.Raw.get!_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.get!_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] [LawfulBEq α] {a : α} [Inhabited (β a)] :
∅.get! a = default
Equations

- @Std.DHashMap.Raw.get!_emptyc = @Std.DHashMap.Raw.get!_empty

Instances For

source
theorem Std.DHashMap.Raw.get!_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
m.isEmpty = true → m.get! a = default
source
theorem Std.DHashMap.Raw.get!_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k a : α} [Inhabited (β a)] {v : β k} :
(m.insert k v).get! a = if h : (k == a) = true then cast ⋯ v else m.get! a
source
@[simp]
theorem Std.DHashMap.Raw.get!_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} [Inhabited (β k)] {v : β k} :
(m.insert k v).get! k = v
source
theorem Std.DHashMap.Raw.get!_eq_default_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
m.contains a = false → m.get! a = default
source
theorem Std.DHashMap.Raw.get!_eq_default {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
¬a ∈ m → m.get! a = default
source
theorem Std.DHashMap.Raw.get!_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k a : α} [Inhabited (β a)] :
(m.erase k).get! a = if (k == a) = true then default else m.get! a
source
@[simp]
theorem Std.DHashMap.Raw.get!_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} [Inhabited (β k)] :
(m.erase k).get! k = default
source
theorem Std.DHashMap.Raw.get?_eq_some_get!_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
m.contains a = true → m.get? a = some (m.get! a)
source
theorem Std.DHashMap.Raw.get?_eq_some_get! {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
a ∈ m → m.get? a = some (m.get! a)
source
theorem Std.DHashMap.Raw.get!_eq_get!_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
m.get! a = (m.get? a).get!
source
theorem Std.DHashMap.Raw.get_eq_get! {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] {h✝ : a ∈ m} :
m.get a h✝ = m.get! a
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {β : Type v} [Inhabited β] {a : α} {c : Nat} :
get! (emptyWithCapacity c) a = default
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_empty {α : Type u} [BEq α] [Hashable α] {β : Type v} [Inhabited β] {a : α} :
get! ∅ a = default
source
@[reducible, inline, deprecated Std.DHashMap.Raw.Const.get!_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.Const.get!_emptyc {α : Type u_1} [BEq α] [Hashable α] {β : Type u_2} [Inhabited β] {a : α} :
get! ∅ a = default
Equations

- @Std.DHashMap.Raw.Const.get!_emptyc = @Std.DHashMap.Raw.Const.get!_empty

Instances For

source
theorem Std.DHashMap.Raw.Const.get!_of_isEmpty {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
m.isEmpty = true → get! m a = default
source
theorem Std.DHashMap.Raw.Const.get!_insert {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {k a : α} {v : β} :
get! (m.insert k v) a = if (k == a) = true then v else get! m a
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_insert_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {k : α} {v : β} :
get! (m.insert k v) k = v
source
theorem Std.DHashMap.Raw.Const.get!_eq_default_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
m.contains a = false → get! m a = default
source
theorem Std.DHashMap.Raw.Const.get!_eq_default {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
¬a ∈ m → get! m a = default
source
theorem Std.DHashMap.Raw.Const.get!_erase {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {k a : α} :
get! (m.erase k) a = if (k == a) = true then default else get! m a
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_erase_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {k : α} :
get! (m.erase k) k = default
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_get!_of_contains {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
m.contains a = true → get? m a = some (get! m a)
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_get! {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
a ∈ m → get? m a = some (get! m a)
source
theorem Std.DHashMap.Raw.Const.get!_eq_get!_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
get! m a = (get? m a).get!
source
theorem Std.DHashMap.Raw.Const.get_eq_get! {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} {h✝ : a ∈ m} :
get m a h✝ = get! m a
source
theorem Std.DHashMap.Raw.Const.get!_eq_get! {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] [Inhabited β] (h : m.WF) {a : α} :
get! m a = m.get! a
source
theorem Std.DHashMap.Raw.Const.get!_congr {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a b : α} (hab : (a == b) = true) :
get! m a = get! m b
source
@[simp]
theorem Std.DHashMap.Raw.getD_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} {fallback : β a} {c : Nat} :
(emptyWithCapacity c).getD a fallback = fallback
source
@[simp]
theorem Std.DHashMap.Raw.getD_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {a : α} {fallback : β a} :
∅.getD a fallback = fallback
source
@[reducible, inline, deprecated Std.DHashMap.Raw.getD_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.getD_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] [LawfulBEq α] {a : α} {fallback : β a} :
∅.getD a fallback = fallback
Equations

- @Std.DHashMap.Raw.getD_emptyc = @Std.DHashMap.Raw.getD_empty

Instances For

source
theorem Std.DHashMap.Raw.getD_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
m.isEmpty = true → m.getD a fallback = fallback
source
theorem Std.DHashMap.Raw.getD_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
@[simp]
theorem Std.DHashMap.Raw.getD_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback b : β a} :
(m.insert a b).getD a fallback = b
source
theorem Std.DHashMap.Raw.getD_eq_fallback_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
m.contains a = false → m.getD a fallback = fallback
source
theorem Std.DHashMap.Raw.getD_eq_fallback {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
¬a ∈ m → m.getD a fallback = fallback
source
theorem Std.DHashMap.Raw.getD_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k a : α} {fallback : β a} :
(m.erase k).getD a fallback = if (k == a) = true then fallback else m.getD a fallback
source
@[simp]
theorem Std.DHashMap.Raw.getD_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {fallback : β k} :
(m.erase k).getD k fallback = fallback
source
theorem Std.DHashMap.Raw.get?_eq_some_getD_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
m.contains a = true → m.get? a = some (m.getD a fallback)
source
theorem Std.DHashMap.Raw.get?_eq_some_getD {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
a ∈ m → m.get? a = some (m.getD a fallback)
source
theorem Std.DHashMap.Raw.getD_eq_getD_get? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} :
m.getD a fallback = (m.get? a).getD fallback
source
theorem Std.DHashMap.Raw.get_eq_getD {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} {fallback : β a} {h✝ : a ∈ m} :
m.get a h✝ = m.getD a fallback
source
theorem Std.DHashMap.Raw.get!_eq_getD_default {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {a : α} [Inhabited (β a)] :
m.get! a = m.getD a default
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {β : Type v} {a : α} {fallback : β} {c : Nat} :
getD (emptyWithCapacity c) a fallback = fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_empty {α : Type u} [BEq α] [Hashable α] {β : Type v} {a : α} {fallback : β} :
getD ∅ a fallback = fallback
source
@[reducible, inline, deprecated Std.DHashMap.Raw.Const.getD_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.Const.getD_emptyc {α : Type u_1} [BEq α] [Hashable α] {β : Type u_2} {a : α} {fallback : β} :
getD ∅ a fallback = fallback
Equations

- @Std.DHashMap.Raw.Const.getD_emptyc = @Std.DHashMap.Raw.Const.getD_empty

Instances For

source
theorem Std.DHashMap.Raw.Const.getD_of_isEmpty {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
m.isEmpty = true → getD m a fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getD_insert {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {fallback v : β} :
getD (m.insert k v) a fallback = if (k == a) = true then v else getD m a fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_insert_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {fallback v : β} :
getD (m.insert k v) k fallback = v
source
theorem Std.DHashMap.Raw.Const.getD_eq_fallback_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
m.contains a = false → getD m a fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getD_eq_fallback {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
¬a ∈ m → getD m a fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getD_erase {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {fallback : β} :
getD (m.erase k) a fallback = if (k == a) = true then fallback else getD m a fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_erase_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {fallback : β} :
getD (m.erase k) k fallback = fallback
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_getD_of_contains {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
m.contains a = true → get? m a = some (getD m a fallback)
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_getD {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
a ∈ m → get? m a = some (getD m a fallback)
source
theorem Std.DHashMap.Raw.Const.getD_eq_getD_get? {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} :
getD m a fallback = (get? m a).getD fallback
source
theorem Std.DHashMap.Raw.Const.get_eq_getD {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {fallback : β} {h✝ : a ∈ m} :
get m a h✝ = getD m a fallback
source
theorem Std.DHashMap.Raw.Const.get!_eq_getD_default {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {a : α} :
get! m a = getD m a default
source
theorem Std.DHashMap.Raw.Const.getD_eq_getD {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] (h : m.WF) {a : α} {fallback : β} :
getD m a fallback = m.getD a fallback
source
theorem Std.DHashMap.Raw.Const.getD_congr {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {a b : α} {fallback : β} (hab : (a == b) = true) :
getD m a fallback = getD m b fallback
source
@[simp]
theorem Std.DHashMap.Raw.getKey?_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} {c : Nat} :
(emptyWithCapacity c).getKey? a = none
source
@[simp]
theorem Std.DHashMap.Raw.getKey?_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a : α} :
∅.getKey? a = none
source
@[reducible, inline, deprecated Std.DHashMap.Raw.getKey?_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.getKey?_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {a : α} :
∅.getKey? a = none
Equations

- @Std.DHashMap.Raw.getKey?_emptyc = @Std.DHashMap.Raw.getKey?_empty

Instances For

source
theorem Std.DHashMap.Raw.getKey?_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.isEmpty = true → m.getKey? a = none
source
theorem Std.DHashMap.Raw.getKey?_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a k : α} {v : β k} :
(m.insert k v).getKey? a = if (k == a) = true then some k else m.getKey? a
source
@[simp]
theorem Std.DHashMap.Raw.getKey?_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).getKey? k = some k
source
theorem Std.DHashMap.Raw.contains_eq_isSome_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.contains a = (m.getKey? a).isSome
source
@[simp]
theorem Std.DHashMap.Raw.isSome_getKey?_eq_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
(m.getKey? a).isSome = m.contains a
source
theorem Std.DHashMap.Raw.mem_iff_isSome_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
a ∈ m ↔ (m.getKey? a).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.isSome_getKey?_iff_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
(m.getKey? a).isSome = true ↔ a ∈ m
source
theorem Std.DHashMap.Raw.mem_of_getKey?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {a a' : α} (h : m.WF) :
m.getKey? a = some a' → a' ∈ m
source
theorem Std.DHashMap.Raw.getKey?_eq_some_iff {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {k k' : α} (h : m.WF) :
m.getKey? k = some k' ↔ ∃ (h : k ∈ m), m.getKey k h = k'
source
theorem Std.DHashMap.Raw.getKey?_eq_none_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
m.contains a = false → m.getKey? a = none
source
theorem Std.DHashMap.Raw.getKey?_eq_none {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
¬a ∈ m → m.getKey? a = none
source
theorem Std.DHashMap.Raw.getKey?_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
(m.erase k).getKey? a = if (k == a) = true then none else m.getKey? a
source
@[simp]
theorem Std.DHashMap.Raw.getKey?_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
(m.erase k).getKey? k = none
source
theorem Std.DHashMap.Raw.getKey?_beq {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} :
Option.all (fun (x : α) => x == a) (m.getKey? a) = true
source
theorem Std.DHashMap.Raw.getKey?_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k k' : α} (h' : (k == k') = true) :
m.getKey? k = m.getKey? k'
source
theorem Std.DHashMap.Raw.getKey?_eq_some_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} :
m.contains k = true → m.getKey? k = some k
source
theorem Std.DHashMap.Raw.getKey?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} :
k ∈ m → m.getKey? k = some k
source
theorem Std.DHashMap.Raw.getKey_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
@[simp]
theorem Std.DHashMap.Raw.getKey_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).getKey k ⋯ = k
source
@[simp]
theorem Std.DHashMap.Raw.getKey_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {h' : k ∈ m.erase a} :
(m.erase a).getKey k h' = m.getKey k ⋯
source
theorem Std.DHashMap.Raw.getKey?_eq_some_getKey {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} (h✝ : a ∈ m) :
m.getKey? a = some (m.getKey a h✝)
source
theorem Std.DHashMap.Raw.getKey_eq_get_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h' : a ∈ m} :
m.getKey a h' = (m.getKey? a).get ⋯
source
@[simp]
theorem Std.DHashMap.Raw.get_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h' : (m.getKey? a).isSome = true} :
(m.getKey? a).get h' = m.getKey a ⋯
source
theorem Std.DHashMap.Raw.getKey_beq {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} (h' : a ∈ m) :
(m.getKey a h' == a) = true
source
theorem Std.DHashMap.Raw.getKey_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k₁ k₂ : α} (h' : (k₁ == k₂) = true) (h₁ : k₁ ∈ m) :
m.getKey k₁ h₁ = m.getKey k₂ ⋯
source
@[simp]
theorem Std.DHashMap.Raw.getKey_eq {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} (h' : k ∈ m) :
m.getKey k h' = k
source
@[simp]
theorem Std.DHashMap.Raw.getKey!_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [Inhabited α] {a : α} {c : Nat} :
(emptyWithCapacity c).getKey! a = default
source
@[simp]
theorem Std.DHashMap.Raw.getKey!_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [Inhabited α] {a : α} :
∅.getKey! a = default
source
@[reducible, inline, deprecated Std.DHashMap.Raw.getKey!_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.getKey!_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] [Inhabited α] {a : α} :
∅.getKey! a = default
Equations

- @Std.DHashMap.Raw.getKey!_emptyc = @Std.DHashMap.Raw.getKey!_empty

Instances For

source
theorem Std.DHashMap.Raw.getKey!_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
m.isEmpty = true → m.getKey! a = default
source
theorem Std.DHashMap.Raw.getKey!_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k a : α} {v : β k} :
(m.insert k v).getKey! a = if (k == a) = true then k else m.getKey! a
source
@[simp]
theorem Std.DHashMap.Raw.getKey!_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k : α} {v : β k} :
(m.insert k v).getKey! k = k
source
theorem Std.DHashMap.Raw.getKey!_eq_default_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
m.contains a = false → m.getKey! a = default
source
theorem Std.DHashMap.Raw.getKey!_eq_default {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
¬a ∈ m → m.getKey! a = default
source
theorem Std.DHashMap.Raw.getKey!_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k a : α} :
(m.erase k).getKey! a = if (k == a) = true then default else m.getKey! a
source
@[simp]
theorem Std.DHashMap.Raw.getKey!_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k : α} :
(m.erase k).getKey! k = default
source
theorem Std.DHashMap.Raw.getKey?_eq_some_getKey!_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
m.contains a = true → m.getKey? a = some (m.getKey! a)
source
theorem Std.DHashMap.Raw.getKey?_eq_some_getKey! {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
a ∈ m → m.getKey? a = some (m.getKey! a)
source
theorem Std.DHashMap.Raw.getKey!_eq_get!_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
m.getKey! a = (m.getKey? a).get!
source
theorem Std.DHashMap.Raw.getKey_eq_getKey! {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} {h✝ : a ∈ m} :
m.getKey a h✝ = m.getKey! a
source
theorem Std.DHashMap.Raw.getKey!_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k₁ k₂ : α} (h' : (k₁ == k₂) = true) :
m.getKey! k₁ = m.getKey! k₂
source
theorem Std.DHashMap.Raw.getKey!_eq_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] [Inhabited α] (h : m.WF) {k : α} :
m.contains k = true → m.getKey! k = k
source
theorem Std.DHashMap.Raw.getKey!_eq_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] [Inhabited α] (h : m.WF) {k : α} :
k ∈ m → m.getKey! k = k
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_emptyWithCapacity {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a fallback : α} {c : Nat} :
(emptyWithCapacity c).getKeyD a fallback = fallback
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {a fallback : α} :
∅.getKeyD a fallback = fallback
source
@[reducible, inline, deprecated Std.DHashMap.Raw.getKeyD_empty (since := "2025-03-11")]
abbrev Std.DHashMap.Raw.getKeyD_emptyc {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {a fallback : α} :
∅.getKeyD a fallback = fallback
Equations

- @Std.DHashMap.Raw.getKeyD_emptyc = @Std.DHashMap.Raw.getKeyD_empty

Instances For

source
theorem Std.DHashMap.Raw.getKeyD_of_isEmpty {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
m.isEmpty = true → m.getKeyD a fallback = fallback
source
theorem Std.DHashMap.Raw.getKeyD_insert {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a fallback : α} {v : β k} :
(m.insert k v).getKeyD a fallback = if (k == a) = true then k else m.getKeyD a fallback
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_insert_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} {b : β a} :
(m.insert a b).getKeyD a fallback = a
source
theorem Std.DHashMap.Raw.getKeyD_eq_fallback_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
m.contains a = false → m.getKeyD a fallback = fallback
source
theorem Std.DHashMap.Raw.getKeyD_eq_fallback {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
¬a ∈ m → m.getKeyD a fallback = fallback
source
theorem Std.DHashMap.Raw.getKeyD_erase {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a fallback : α} :
(m.erase k).getKeyD a fallback = if (k == a) = true then fallback else m.getKeyD a fallback
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_erase_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k fallback : α} :
(m.erase k).getKeyD k fallback = fallback
source
theorem Std.DHashMap.Raw.getKey?_eq_some_getKeyD_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
m.contains a = true → m.getKey? a = some (m.getKeyD a fallback)
source
theorem Std.DHashMap.Raw.getKey?_eq_some_getKeyD {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
a ∈ m → m.getKey? a = some (m.getKeyD a fallback)
source
theorem Std.DHashMap.Raw.getKeyD_eq_getD_getKey? {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} :
m.getKeyD a fallback = (m.getKey? a).getD fallback
source
theorem Std.DHashMap.Raw.getKey_eq_getKeyD {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {a fallback : α} {h✝ : a ∈ m} :
m.getKey a h✝ = m.getKeyD a fallback
source
theorem Std.DHashMap.Raw.getKey!_eq_getKeyD_default {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {a : α} :
m.getKey! a = m.getKeyD a default
source
theorem Std.DHashMap.Raw.getKeyD_congr {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k₁ k₂ fallback : α} (h' : (k₁ == k₂) = true) :
m.getKeyD k₁ fallback = m.getKeyD k₂ fallback
source
theorem Std.DHashMap.Raw.getKeyD_eq_of_contains {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k fallback : α} :
m.contains k = true → m.getKeyD k fallback = k
source
theorem Std.DHashMap.Raw.getKeyD_eq_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k fallback : α} :
k ∈ m → m.getKeyD k fallback = k
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insertIfNew k v).isEmpty = false
source
@[simp]
theorem Std.DHashMap.Raw.contains_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
(m.insertIfNew k v).contains a = (k == a || m.contains a)
source
@[simp]
theorem Std.DHashMap.Raw.mem_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
a ∈ m.insertIfNew k v ↔ (k == a) = true ∨ a ∈ m
source
theorem Std.DHashMap.Raw.contains_insertIfNew_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insertIfNew k v).contains k = true
source
theorem Std.DHashMap.Raw.mem_insertIfNew_self {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
k ∈ m.insertIfNew k v
source
theorem Std.DHashMap.Raw.contains_of_contains_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
(m.insertIfNew k v).contains a = true → (k == a) = false → m.contains a = true
source
theorem Std.DHashMap.Raw.mem_of_mem_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
a ∈ m.insertIfNew k v → (k == a) = false → a ∈ m
source
theorem Std.DHashMap.Raw.contains_of_contains_insertIfNew' {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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_of_contains_insertIfNew` that is written to exactly match the proof obligation in the statement of `get_insertIfNew`.

source
theorem Std.DHashMap.Raw.mem_of_mem_insertIfNew' {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
a ∈ m.insertIfNew k v → ¬((k == a) = true ∧ ¬k ∈ m) → a ∈ m

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

source
theorem Std.DHashMap.Raw.size_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insertIfNew k v).size = if k ∈ m then m.size else m.size + 1
source
theorem Std.DHashMap.Raw.size_le_size_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
m.size ≤ (m.insertIfNew k v).size
source
theorem Std.DHashMap.Raw.size_insertIfNew_le {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β k} :
(m.insertIfNew k v).size ≤ m.size + 1
source
theorem Std.DHashMap.Raw.get?_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.get_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.get!_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getD_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.get?_insertIfNew {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β} :
get? (m.insertIfNew k v) a = if (k == a) = true ∧ ¬k ∈ m then some v else get? m a
source
theorem Std.DHashMap.Raw.Const.get_insertIfNew {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.Const.get!_insertIfNew {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {k a : α} {v : β} :
get! (m.insertIfNew k v) a = if (k == a) = true ∧ ¬k ∈ m then v else get! m a
source
theorem Std.DHashMap.Raw.Const.getD_insertIfNew {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {fallback v : β} :
getD (m.insertIfNew k v) a fallback = if (k == a) = true ∧ ¬k ∈ m then v else getD m a fallback
source
theorem Std.DHashMap.Raw.getKey?_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} {v : β k} :
(m.insertIfNew k v).getKey? a = if (k == a) = true ∧ ¬k ∈ m then some k else m.getKey? a
source
theorem Std.DHashMap.Raw.getKey_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.getKey!_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {k a : α} {v : β k} :
(m.insertIfNew k v).getKey! a = if (k == a) = true ∧ ¬k ∈ m then k else m.getKey! a
source
theorem Std.DHashMap.Raw.getKeyD_insertIfNew {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
@[simp]
theorem Std.DHashMap.Raw.getThenInsertIfNew?_fst {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
(m.getThenInsertIfNew? k v).fst = m.get? k
source
@[simp]
theorem Std.DHashMap.Raw.getThenInsertIfNew?_snd {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
(m.getThenInsertIfNew? k v).snd = m.insertIfNew k v
source
@[simp]
theorem Std.DHashMap.Raw.Const.getThenInsertIfNew?_fst {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {k : α} {v : β} :
(getThenInsertIfNew? m k v).fst = get? m k
source
@[simp]
theorem Std.DHashMap.Raw.Const.getThenInsertIfNew?_snd {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {k : α} {v : β} :
(getThenInsertIfNew? m k v).snd = m.insertIfNew k v
source
@[simp]
theorem Std.DHashMap.Raw.length_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.keys.length = m.size
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.keys.isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.contains_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
m.keys.contains k = m.contains k
source
@[simp]
theorem Std.DHashMap.Raw.mem_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} :
k ∈ m.keys ↔ k ∈ m
source
theorem Std.DHashMap.Raw.mem_of_mem_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {k : α} (h : m.WF) (h' : k ∈ m.keys) :
k ∈ m
source
theorem Std.DHashMap.Raw.distinct_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.Pairwise (fun (a b : α) => (a == b) = false) m.keys
source
theorem Std.DHashMap.Raw.nodup_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.keys.Nodup
source
@[simp]
theorem Std.DHashMap.Raw.map_fst_toList_eq_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.map Sigma.fst m.toList = m.keys
source
@[simp]
theorem Std.DHashMap.Raw.toArray_keys {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) :
m.keys.toArray = m.keysArray
source
@[simp]
theorem Std.DHashMap.Raw.toList_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) :
m.keysArray.toList = m.keys
source
@[simp]
theorem Std.DHashMap.Raw.size_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.keysArray.size = m.size
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.keysArray.isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.contains_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {k : α} (h : m.WF) :
m.keysArray.contains k = m.contains k
source
@[simp]
theorem Std.DHashMap.Raw.mem_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] {k : α} (h : m.WF) :
k ∈ m.keysArray ↔ k ∈ m
source
theorem Std.DHashMap.Raw.forall_mem_keysArray_iff_forall_mem_getKey {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {p : α → Prop} (h : m.WF) :
(∀ (k : α), k ∈ m.keysArray → p k) ↔ ∀ (k : α) (h : k ∈ m), p (m.getKey k h)
source
theorem Std.DHashMap.Raw.contains_of_mem_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} (h' : k ∈ m.keysArray) :
m.contains k = true
source
@[simp]
theorem Std.DHashMap.Raw.length_toList {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.toList.length = m.size
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_toList {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.toList.isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.mem_toList_iff_get?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
⟨k, v⟩ ∈ m.toList ↔ m.get? k = some v
source
theorem Std.DHashMap.Raw.find?_toList_eq_some_iff_get?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {k : α} {v : β k} :
List.find? (fun (x : (a : α) × β a) => x.fst == k) m.toList = some ⟨k, v⟩ ↔ m.get? k = some v
source
theorem Std.DHashMap.Raw.find?_toList_eq_none_iff_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
List.find? (fun (x : (a : α) × β a) => x.fst == k) m.toList = none ↔ m.contains k = false
source
@[simp]
theorem Std.DHashMap.Raw.find?_toList_eq_none_iff_not_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
List.find? (fun (x : (a : α) × β a) => x.fst == k) m.toList = none ↔ ¬k ∈ m
source
theorem Std.DHashMap.Raw.distinct_keys_toList {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) m.toList
source
@[simp]
theorem Std.DHashMap.Raw.Const.map_fst_toList_eq_keys {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.map Prod.fst (toList m) = m.keys
source
@[simp]
theorem Std.DHashMap.Raw.Const.length_toList {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
(toList m).length = m.size
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_toList {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
(toList m).isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_toList_iff_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] (h : m.WF) {k : α} {v : β} :
(k, v) ∈ toList m ↔ get? m k = some v
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_toList_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
(k, v) ∈ toList m ↔ m.getKey? k = some k ∧ get? m k = some v
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_iff_exists_beq_and_mem_toList {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
get? m k = some v ↔ ∃ (k' : α), (k == k') = true ∧ (k', v) ∈ toList m
source
theorem Std.DHashMap.Raw.Const.find?_toList_eq_some_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k k' : α} {v : β} :
List.find? (fun (a : α × β) => a.fst == k) (toList m) = some (k', v) ↔ m.getKey? k = some k' ∧ get? m k = some v
source
theorem Std.DHashMap.Raw.Const.find?_toList_eq_none_iff_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
List.find? (fun (x : α × β) => x.fst == k) (toList m) = none ↔ m.contains k = false
source
@[simp]
theorem Std.DHashMap.Raw.Const.find?_toList_eq_none_iff_not_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
List.find? (fun (x : α × β) => x.fst == k) (toList m) = none ↔ ¬k ∈ m
source
theorem Std.DHashMap.Raw.Const.distinct_keys_toList {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) (toList m)
source
@[simp]
theorem Std.DHashMap.Raw.toArray_toList {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) :
m.toList.toArray = m.toArray
source
@[simp]
theorem Std.DHashMap.Raw.toList_toArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] (h : m.WF) :
m.toArray.toList = m.toList
source
@[simp]
theorem Std.DHashMap.Raw.map_fst_toArray_eq_keysArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
Array.map Sigma.fst m.toArray = m.keysArray
source
@[simp]
theorem Std.DHashMap.Raw.size_toArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.toArray.size = m.size
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_toArray {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.toArray.isEmpty = m.isEmpty
source
theorem Std.DHashMap.Raw.mem_toArray_iff_get?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] {k : α} {v : β k} (h : m.WF) :
⟨k, v⟩ ∈ m.toArray ↔ m.get? k = some v
source
theorem Std.DHashMap.Raw.find?_toArray_eq_some_iff_get?_eq_some {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] {k : α} {v : β k} (h : m.WF) :
Array.find? (fun (x : (a : α) × β a) => x.fst == k) m.toArray = some ⟨k, v⟩ ↔ m.get? k = some v
source
theorem Std.DHashMap.Raw.find?_toArray_eq_none_iff_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {k : α} (h : m.WF) :
Array.find? (fun (x : (a : α) × β a) => x.fst == k) m.toArray = none ↔ m.contains k = false
source
@[simp]
theorem Std.DHashMap.Raw.Const.toArray_toList {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) :
(toList m).toArray = toArray m
source
@[simp]
theorem Std.DHashMap.Raw.Const.toList_toArray {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) :
(toArray m).toList = toList m
source
@[simp]
theorem Std.DHashMap.Raw.Const.map_fst_toArray_eq_keysArray {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
Array.map Prod.fst (toArray m) = m.keysArray
source
@[simp]
theorem Std.DHashMap.Raw.Const.size_toArray {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
(toArray m).size = m.size
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_toArray {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
(toArray m).isEmpty = m.isEmpty
source
theorem Std.DHashMap.Raw.Const.mem_toArray_iff_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {v : β} (h : m.WF) :
(k, v) ∈ toArray m ↔ get? m k = some v
source
theorem Std.DHashMap.Raw.Const.get?_eq_some_iff_exists_beq_and_mem_toArray {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {v : β} (h : m.WF) :
get? m k = some v ↔ ∃ (k' : α), (k == k') = true ∧ (k', v) ∈ toArray m
source
theorem Std.DHashMap.Raw.Const.find?_toArray_eq_some_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k k' : α} {v : β} :
Array.find? (fun (a : α × β) => a.fst == k) (toArray m) = some (k', v) ↔ m.getKey? k = some k' ∧ get? m k = some v
source
theorem Std.DHashMap.Raw.Const.find?_toArray_eq_none_iff_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} (h : m.WF) :
Array.find? (fun (x : α × β) => x.fst == k) (toArray m) = none ↔ m.contains k = false
source
theorem Std.DHashMap.Raw.Const.mem_toArray_iff_getKey?_eq_some_and_get?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} {v : β} :
(k, v) ∈ toArray m ↔ m.getKey? k = some k ∧ get? m k = some v
source
theorem Std.DHashMap.Raw.foldM_eq_foldlM_toList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : δ → (a : α) → β a → m' δ} {init : δ} :
foldM f init m = List.foldlM (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init m.toList
source
theorem Std.DHashMap.Raw.fold_eq_foldl_toList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} (h : m.WF) {f : δ → (a : α) → β a → δ} {init : δ} :
fold f init m = List.foldl (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init m.toList
source
@[simp]
theorem Std.DHashMap.Raw.forM_eq_forM {α : Type u} {β : α → Type v} {m : Raw α β} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : (a : α) → β a → m' PUnit} :
forM f m = ForM.forM m fun (a : (a : α) × β a) => f a.fst a.snd
source
theorem Std.DHashMap.Raw.forM_eq_forM_toList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : (a : α) × β a → m' PUnit} :
ForM.forM m f = m.toList.forM f
source
@[simp]
theorem Std.DHashMap.Raw.forIn_eq_forIn {α : Type u} {β : α → Type v} {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : (a : α) → β a → δ → m' (ForInStep δ)} {init : δ} :
forIn f init m = ForIn.forIn m init fun (a : (a : α) × β a) (b : δ) => f a.fst a.snd b
source
theorem Std.DHashMap.Raw.forIn_eq_forIn_toList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : (a : α) × β a → δ → m' (ForInStep δ)} {init : δ} (h : m.WF) :
ForIn.forIn m init f = ForIn.forIn m.toList init f
source
theorem Std.DHashMap.Raw.foldM_eq_foldlM_keys {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : δ → α → m' δ} {init : δ} :
foldM (fun (d : δ) (a : α) (x : β a) => f d a) init m = List.foldlM f init m.keys
source
theorem Std.DHashMap.Raw.fold_eq_foldl_keys {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} (h : m.WF) {f : δ → α → δ} {init : δ} :
fold (fun (d : δ) (a : α) (x : β a) => f d a) init m = List.foldl f init m.keys
source
theorem Std.DHashMap.Raw.forM_eq_forM_keys {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : α → m' PUnit} :
(ForM.forM m fun (a : (a : α) × β a) => f a.fst) = m.keys.forM f
source
theorem Std.DHashMap.Raw.forIn_eq_forIn_keys {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : α → δ → m' (ForInStep δ)} {init : δ} :
(ForIn.forIn m init fun (a : (a : α) × β a) (d : δ) => f a.fst d) = ForIn.forIn m.keys init f
source
theorem Std.DHashMap.Raw.Const.foldM_eq_foldlM_toList {α : Type u} [BEq α] [Hashable α] {δ : Type w} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : δ → α → β → m' δ} {init : δ} :
foldM f init m = List.foldlM (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toList m)
source
theorem Std.DHashMap.Raw.Const.fold_eq_foldl_toList {α : Type u} [BEq α] [Hashable α] {δ : Type w} {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {f : δ → α → β → δ} {init : δ} :
fold f init m = List.foldl (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toList m)
source
theorem Std.DHashMap.Raw.Const.forM_eq_forMUncurried {α : Type u} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] {f : α → β → m' PUnit} :
forM f m = forMUncurried (fun (a : α × β) => f a.fst a.snd) m
source
theorem Std.DHashMap.Raw.Const.forMUncurried_eq_forM_toList {α : Type u} [BEq α] [Hashable α] {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : α × β → m' PUnit} :
forMUncurried f m = (toList m).forM f
source
@[simp]
theorem Std.DHashMap.Raw.Const.forIn_eq_forInUncurried {α : Type u} {δ : Type w} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] {f : α → β → δ → m' (ForInStep δ)} {init : δ} :
forIn f init m = forInUncurried (fun (a : α × β) (b : δ) => f a.fst a.snd b) init m
source
theorem Std.DHashMap.Raw.Const.forInUncurried_eq_forIn_toList {α : Type u} [BEq α] [Hashable α] {δ : Type w} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] (h : m.WF) {f : α × β → δ → m' (ForInStep δ)} {init : δ} :
forInUncurried f init m = ForIn.forIn (toList m) init f
source
theorem Std.DHashMap.Raw.foldM_eq_foldlM_toArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : δ → (a : α) → β a → m' δ} {init : δ} (h : m.WF) :
foldM f init m = Array.foldlM (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init m.toArray
source
theorem Std.DHashMap.Raw.fold_eq_foldl_toArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {f : δ → (a : α) → β a → δ} {init : δ} (h : m.WF) :
fold f init m = Array.foldl (fun (a : δ) (b : (a : α) × β a) => f a b.fst b.snd) init m.toArray
source
theorem Std.DHashMap.Raw.forM_eq_forM_toArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : (a : α) → β a → m' PUnit} (h : m.WF) :
forM f m = Array.forM (fun (a : (a : α) × β a) => f a.fst a.snd) m.toArray
source
theorem Std.DHashMap.Raw.forIn_eq_forIn_toArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : (a : α) → β a → δ → m' (ForInStep δ)} {init : δ} (h : m.WF) :
forIn f init m = ForIn.forIn m.toArray init fun (a : (a : α) × β a) (b : δ) => f a.fst a.snd b
source
theorem Std.DHashMap.Raw.foldM_eq_foldlM_keysArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : δ → α → m' δ} {init : δ} (h : m.WF) :
foldM (fun (d : δ) (a : α) (x : β a) => f d a) init m = Array.foldlM f init m.keysArray
source
theorem Std.DHashMap.Raw.fold_eq_foldl_keysArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {f : δ → α → δ} {init : δ} (h : m.WF) :
fold (fun (d : δ) (a : α) (x : β a) => f d a) init m = Array.foldl f init m.keysArray
source
theorem Std.DHashMap.Raw.forM_eq_forM_keysArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : α → m' PUnit} (h : m.WF) :
forM (fun (a : α) (x : β a) => f a) m = Array.forM f m.keysArray
source
theorem Std.DHashMap.Raw.forIn_eq_forIn_keysArray {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {δ : Type w} {m' : Type w → Type w'} [Monad m'] [LawfulMonad m'] {f : α → δ → m' (ForInStep δ)} {init : δ} (h : m.WF) :
forIn (fun (a : α) (x : β a) (d : δ) => f a d) init m = ForIn.forIn m.keysArray init f
source
theorem Std.DHashMap.Raw.Const.foldM_eq_foldlM_toArray {α : Type u} [BEq α] [Hashable α] {δ : Type w} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] {f : δ → α → β → m' δ} {init : δ} (h : m.WF) :
foldM f init m = Array.foldlM (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toArray m)
source
theorem Std.DHashMap.Raw.Const.fold_eq_foldl_toArray {α : Type u} [BEq α] [Hashable α] {δ : Type w} {β : Type v} {m : Raw α fun (x : α) => β} {f : δ → α → β → δ} {init : δ} (h : m.WF) :
fold f init m = Array.foldl (fun (a : δ) (b : α × β) => f a b.fst b.snd) init (toArray m)
source
theorem Std.DHashMap.Raw.Const.forM_eq_forM_toArray {α : Type u} [BEq α] [Hashable α] {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] {f : α → β → m' PUnit} (h : m.WF) :
forM f m = Array.forM (fun (a : α × β) => f a.fst a.snd) (toArray m)
source
theorem Std.DHashMap.Raw.Const.forIn_eq_forIn_toArray {α : Type u} [BEq α] [Hashable α] {δ : Type w} {m' : Type w → Type w'} {β : Type v} {m : Raw α fun (x : α) => β} [Monad m'] [LawfulMonad m'] {f : α → β → δ → m' (ForInStep δ)} {init : δ} (h : m.WF) :
forIn f init m = ForIn.forIn (toArray m) init fun (a : α × β) (b : δ) => f a.fst a.snd b
source
@[simp]
theorem Std.DHashMap.Raw.insertMany_nil {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.insertMany [] = m
source
@[simp]
theorem Std.DHashMap.Raw.insertMany_list_singleton {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {k : α} {v : β k} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.insertMany [⟨k, v⟩] = m.insert k v
source
theorem Std.DHashMap.Raw.insertMany_cons {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {l : List ((a : α) × β a)} {k : α} {v : β k} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.insertMany (⟨k, v⟩ :: l) = (m.insert k v).insertMany l
source
theorem Std.DHashMap.Raw.insertMany_append {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l₁ l₂ : List ((a : α) × β a)} :
m.insertMany (l₁ ++ l₂) = (m.insertMany l₁).insertMany l₂
source
theorem Std.DHashMap.Raw.insertMany_ind {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {ρ : Type w} [ForIn Id ρ ((a : α) × β a)] {motive : Raw α β → Prop} (m : Raw α β) (l : ρ) (init : motive m) (insert : ∀ (m : Raw α β) (a : α) (b : β a), motive m → motive (m.insert a b)) :
motive (m.insertMany l)
source
@[simp]
theorem Std.DHashMap.Raw.contains_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} :
(m.insertMany l).contains k = (m.contains k || (List.map Sigma.fst l).contains k)
source
@[simp]
theorem Std.DHashMap.Raw.mem_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} :
k ∈ m.insertMany l ↔ k ∈ m ∨ (List.map Sigma.fst l).contains k = true
source
theorem Std.DHashMap.Raw.mem_of_mem_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} :
k ∈ m.insertMany l → (List.map Sigma.fst l).contains k = false → k ∈ m
source
theorem Std.DHashMap.Raw.mem_insertMany_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {ρ : Type w} [ForIn Id ρ ((a : α) × β a)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} {k : α} :
k ∈ m → k ∈ m.insertMany l
source
theorem Std.DHashMap.Raw.get?_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).get? k = m.get? k
source
theorem Std.DHashMap.Raw.get?_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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)
source
theorem Std.DHashMap.Raw.get_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.get_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.get!_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.get!_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getD_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getD_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [LawfulBEq α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getKey?_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).getKey? k = m.getKey? k
source
theorem Std.DHashMap.Raw.getKey?_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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' = some k
source
theorem Std.DHashMap.Raw.getKey_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.getKey_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getKey!_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(m.insertMany l).getKey! k = m.getKey! k
source
theorem Std.DHashMap.Raw.getKey!_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.getKeyD_insertMany_list_of_mem {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.size_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.size_le_size_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} :
m.size ≤ (m.insertMany l).size
source
theorem Std.DHashMap.Raw.size_le_size_insertMany {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {ρ : Type w} [ForIn Id ρ ((a : α) × β a)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
m.size ≤ (m.insertMany l).size
source
theorem Std.DHashMap.Raw.size_insertMany_list_le {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} :
(m.insertMany l).size ≤ m.size + l.length
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_insertMany_list {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List ((a : α) × β a)} :
(m.insertMany l).isEmpty = (m.isEmpty && l.isEmpty)
source
theorem Std.DHashMap.Raw.isEmpty_of_isEmpty_insertMany {α : Type u} {β : α → Type v} {m : Raw α β} [BEq α] [Hashable α] {ρ : Type w} [ForIn Id ρ ((a : α) × β a)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
(m.insertMany l).isEmpty = true → m.isEmpty = true
source
@[simp]
theorem Std.DHashMap.Raw.union_eq {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} :
m₁.union m₂ = m₁ ∪ m₂
source
@[simp]
theorem Std.DHashMap.Raw.contains_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
(m₁ ∪ m₂).contains k = (m₁.contains k || m₂.contains k)
source
theorem Std.DHashMap.Raw.mem_union_of_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
k ∈ m₁ → k ∈ m₁ ∪ m₂
source
theorem Std.DHashMap.Raw.mem_union_of_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
k ∈ m₂ → k ∈ m₁ ∪ m₂
source
@[simp]
theorem Std.DHashMap.Raw.mem_union_iff {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
k ∈ m₁ ∪ m₂ ↔ k ∈ m₁ ∨ k ∈ m₂
source
theorem Std.DHashMap.Raw.mem_of_mem_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
k ∈ m₁ ∪ m₂ → ¬k ∈ m₂ → k ∈ m₁
source
theorem Std.DHashMap.Raw.mem_of_mem_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
k ∈ m₁ ∪ m₂ → ¬k ∈ m₁ → k ∈ m₂
source
theorem Std.DHashMap.Raw.union_insert_right_equiv_union_insert {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {p : (a : α) × β a} (h₁ : m₁.WF) (h₂ : m₂.WF) :
(m₁ ∪ m₂.insert p.fst p.snd).Equiv ((m₁ ∪ m₂).insert p.fst p.snd)
source
theorem Std.DHashMap.Raw.get?_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
(m₁ ∪ m₂).get? k = (m₂.get? k).or (m₁.get? k)
source
theorem Std.DHashMap.Raw.get?_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).get? k = m₂.get? k
source
theorem Std.DHashMap.Raw.get?_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).get? k = m₁.get? k
source
theorem Std.DHashMap.Raw.get_union_of_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (mem : k ∈ m₂) :
(m₁ ∪ m₂).get k ⋯ = m₂.get k mem
source
theorem Std.DHashMap.Raw.get_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) {h' : k ∈ m₁ ∪ m₂} :
(m₁ ∪ m₂).get k h' = m₂.get k ⋯
source
theorem Std.DHashMap.Raw.get_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) {h' : k ∈ m₁ ∪ m₂} :
(m₁ ∪ m₂).get k h' = m₁.get k ⋯
source
theorem Std.DHashMap.Raw.getD_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β k} :
(m₁ ∪ m₂).getD k fallback = m₂.getD k (m₁.getD k fallback)
source
theorem Std.DHashMap.Raw.getD_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β k} (not_mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).getD k fallback = m₂.getD k fallback
source
theorem Std.DHashMap.Raw.getD_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β k} (not_mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).getD k fallback = m₁.getD k fallback
source
theorem Std.DHashMap.Raw.get!_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} [Inhabited (β k)] :
(m₁ ∪ m₂).get! k = m₂.getD k (m₁.get! k)
source
theorem Std.DHashMap.Raw.get!_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} [Inhabited (β k)] (not_mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).get! k = m₂.get! k
source
theorem Std.DHashMap.Raw.get!_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} [Inhabited (β k)] (not_mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).get! k = m₁.get! k
source
theorem Std.DHashMap.Raw.getKey?_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
(m₁ ∪ m₂).getKey? k = (m₂.getKey? k).or (m₁.getKey? k)
source
theorem Std.DHashMap.Raw.getKey?_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).getKey? k = m₂.getKey? k
source
theorem Std.DHashMap.Raw.getKey?_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).getKey? k = m₁.getKey? k
source
theorem Std.DHashMap.Raw.getKey_union_of_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (mem : k ∈ m₂) :
(m₁ ∪ m₂).getKey k ⋯ = m₂.getKey k mem
source
theorem Std.DHashMap.Raw.getKey_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) {h' : k ∈ m₁ ∪ m₂} :
(m₁ ∪ m₂).getKey k h' = m₂.getKey k ⋯
source
theorem Std.DHashMap.Raw.getKey_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) {h' : k ∈ m₁ ∪ m₂} :
(m₁ ∪ m₂).getKey k h' = m₁.getKey k ⋯
source
theorem Std.DHashMap.Raw.getKeyD_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k fallback : α} :
(m₁ ∪ m₂).getKeyD k fallback = m₂.getKeyD k (m₁.getKeyD k fallback)
source
theorem Std.DHashMap.Raw.getKeyD_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k fallback : α} (mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).getKeyD k fallback = m₂.getKeyD k fallback
source
theorem Std.DHashMap.Raw.getKeyD_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k fallback : α} (mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).getKeyD k fallback = m₁.getKeyD k fallback
source
theorem Std.DHashMap.Raw.getKey!_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
(m₁ ∪ m₂).getKey! k = m₂.getKeyD k (m₁.getKey! k)
source
theorem Std.DHashMap.Raw.getKey!_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [Inhabited α] [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) :
(m₁ ∪ m₂).getKey! k = m₂.getKey! k
source
theorem Std.DHashMap.Raw.getKey!_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [Inhabited α] [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) :
(m₁ ∪ m₂).getKey! k = m₁.getKey! k
source
theorem Std.DHashMap.Raw.size_union_of_not_mem {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (a : α), a ∈ m₁ → ¬a ∈ m₂) → (m₁ ∪ m₂).size = m₁.size + m₂.size
source
theorem Std.DHashMap.Raw.size_left_le_size_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
m₁.size ≤ (m₁ ∪ m₂).size
source
theorem Std.DHashMap.Raw.size_right_le_size_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
m₂.size ≤ (m₁ ∪ m₂).size
source
theorem Std.DHashMap.Raw.size_union_le_size_add_size {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(m₁ ∪ m₂).size ≤ m₁.size + m₂.size
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_union {α : Type u} [BEq α] [Hashable α] {β : α → Type v} {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(m₁ ∪ m₂).isEmpty = (m₁.isEmpty && m₂.isEmpty)
source
theorem Std.DHashMap.Raw.Const.get?_union {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
get? (m₁ ∪ m₂) k = (get? m₂ k).or (get? m₁ k)
source
theorem Std.DHashMap.Raw.Const.get?_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) :
get? (m₁ ∪ m₂) k = get? m₂ k
source
theorem Std.DHashMap.Raw.Const.get?_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) :
get? (m₁ ∪ m₂) k = get? m₁ k
source
theorem Std.DHashMap.Raw.Const.get_union_of_mem_right {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (mem : k ∈ m₂) :
get (m₁ ∪ m₂) k ⋯ = get m₂ k mem
source
theorem Std.DHashMap.Raw.Const.get_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) {h' : k ∈ m₁ ∪ m₂} :
get (m₁ ∪ m₂) k h' = get m₂ k ⋯
source
theorem Std.DHashMap.Raw.Const.get_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) {h' : k ∈ m₁ ∪ m₂} :
get (m₁ ∪ m₂) k h' = get m₁ k ⋯
source
theorem Std.DHashMap.Raw.Const.getD_union {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β} :
getD (m₁ ∪ m₂) k fallback = getD m₂ k (getD m₁ k fallback)
source
theorem Std.DHashMap.Raw.Const.getD_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β} (not_mem : ¬k ∈ m₁) :
getD (m₁ ∪ m₂) k fallback = getD m₂ k fallback
source
theorem Std.DHashMap.Raw.Const.getD_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} {fallback : β} (not_mem : ¬k ∈ m₂) :
getD (m₁ ∪ m₂) k fallback = getD m₁ k fallback
source
theorem Std.DHashMap.Raw.Const.get!_union {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} :
get! (m₁ ∪ m₂) k = getD m₂ k (get! m₁ k)
source
theorem Std.DHashMap.Raw.Const.get!_union_of_not_mem_left {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₁) :
get! (m₁ ∪ m₂) k = get! m₂ k
source
theorem Std.DHashMap.Raw.Const.get!_union_of_not_mem_right {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h₁ : m₁.WF) (h₂ : m₂.WF) {k : α} (not_mem : ¬k ∈ m₂) :
get! (m₁ ∪ m₂) k = get! m₁ k
source
@[simp]
theorem Std.DHashMap.Raw.Const.insertMany_nil {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) :
insertMany m [] = m
source
@[simp]
theorem Std.DHashMap.Raw.Const.insertMany_list_singleton {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {k : α} {v : β} :
insertMany m [(k, v)] = m.insert k v
source
theorem Std.DHashMap.Raw.Const.insertMany_cons {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {l : List (α × β)} {k : α} {v : β} :
insertMany m ((k, v) :: l) = insertMany (m.insert k v) l
source
theorem Std.DHashMap.Raw.Const.insertMany_append {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} (h : m.WF) {l₁ l₂ : List (α × β)} :
insertMany m (l₁ ++ l₂) = insertMany (insertMany m l₁) l₂
source
theorem Std.DHashMap.Raw.Const.insertMany_ind {α : Type u} [BEq α] [Hashable α] {β : Type v} {ρ : Type w} [ForIn Id ρ (α × β)] {motive : (Raw α fun (x : α) => β) → Prop} (m : Raw α fun (x : α) => β) (l : ρ) (init : motive m) (insert : ∀ (m : Raw α fun (x : α) => β) (a : α) (b : β), motive m → motive (m.insert a b)) :
motive (insertMany m l)
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} :
(insertMany m l).contains k = (m.contains k || (List.map Prod.fst l).contains k)
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} :
k ∈ insertMany m l ↔ k ∈ m ∨ (List.map Prod.fst l).contains k = true
source
theorem Std.DHashMap.Raw.Const.mem_of_mem_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} :
k ∈ insertMany m l → (List.map Prod.fst l).contains k = false → k ∈ m
source
theorem Std.DHashMap.Raw.Const.mem_insertMany_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} {ρ : Type w} [ForIn Id ρ (α × β)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} {k : α} :
k ∈ m → k ∈ insertMany m l
source
theorem Std.DHashMap.Raw.Const.getKey?_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany m l).getKey? k = m.getKey? k
source
theorem Std.DHashMap.Raw.Const.getKey?_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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' = some k
source
theorem Std.DHashMap.Raw.Const.getKey_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.Const.getKey_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.getKey!_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(insertMany m l).getKey! k = m.getKey! k
source
theorem Std.DHashMap.Raw.Const.getKey!_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.getKeyD_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.getKeyD_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.size_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.size_le_size_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} :
m.size ≤ (insertMany m l).size
source
theorem Std.DHashMap.Raw.Const.size_le_size_insertMany {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} {ρ : Type w} [ForIn Id ρ (α × β)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
m.size ≤ (insertMany m l).size
source
theorem Std.DHashMap.Raw.Const.size_insertMany_list_le {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} :
(insertMany m l).size ≤ m.size + l.length
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} :
(insertMany m l).isEmpty = (m.isEmpty && l.isEmpty)
source
theorem Std.DHashMap.Raw.Const.isEmpty_of_isEmpty_insertMany {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} {ρ : Type w} [ForIn Id ρ (α × β)] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
(insertMany m l).isEmpty = true → m.isEmpty = true
source
theorem Std.DHashMap.Raw.Const.get?_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get? (insertMany m l) k = get? m k
source
theorem Std.DHashMap.Raw.Const.get?_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.get?_insertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List (α × β)} {k : α} :
get? (insertMany m l) k = (List.findSomeRev? (fun (x : α × β) => match x with | (a, b) => if (a == k) = true then some b else none) l).or (get? m k)
source
theorem Std.DHashMap.Raw.Const.get_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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 ⋯
source
theorem Std.DHashMap.Raw.Const.get_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.get!_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get! (insertMany m l) k = get! m k
source
theorem Std.DHashMap.Raw.Const.get!_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.getD_insertMany_list_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
theorem Std.DHashMap.Raw.Const.getD_insertMany_list_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h : m.WF) {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
source
@[simp]
theorem Std.DHashMap.Raw.Const.insertManyIfNewUnit_nil {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} (h : m.WF) :
insertManyIfNewUnit m [] = m
source
@[simp]
theorem Std.DHashMap.Raw.Const.insertManyIfNewUnit_list_singleton {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {k : α} (h : m.WF) :
insertManyIfNewUnit m [k] = m.insertIfNew k ()
source
theorem Std.DHashMap.Raw.Const.insertManyIfNewUnit_cons {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} (h : m.WF) {l : List α} {k : α} :
insertManyIfNewUnit m (k :: l) = insertManyIfNewUnit (m.insertIfNew k ()) l
source
theorem Std.DHashMap.Raw.Const.insertManyIfNewUnit_ind {α : Type u} [BEq α] [Hashable α] {ρ : Type w} [ForIn Id ρ α] {motive : (Raw α fun (x : α) => Unit) → Prop} (m : Raw α fun (x : α) => Unit) (l : ρ) (init : motive m) (insert : ∀ (m : Raw α fun (x : α) => Unit) (a : α), motive m → motive (m.insertIfNew a ())) :
motive (insertManyIfNewUnit m l)
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} :
(insertManyIfNewUnit m l).contains k = (m.contains k || l.contains k)
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} :
k ∈ insertManyIfNewUnit m l ↔ k ∈ m ∨ l.contains k = true
source
theorem Std.DHashMap.Raw.Const.mem_of_mem_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
k ∈ insertManyIfNewUnit m l → k ∈ m
source
theorem Std.DHashMap.Raw.Const.mem_insertManyIfNewUnit_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {ρ : Type w} [ForIn Id ρ α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} {k : α} :
k ∈ m → k ∈ insertManyIfNewUnit m l
source
theorem Std.DHashMap.Raw.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} :
¬k ∈ m → l.contains k = false → (insertManyIfNewUnit m l).getKey? k = none
source
theorem Std.DHashMap.Raw.Const.getKey?_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) :
¬k ∈ m → List.Pairwise (fun (a b : α) => (a == b) = false) l → k ∈ l → (insertManyIfNewUnit m l).getKey? k' = some k
source
theorem Std.DHashMap.Raw.Const.getKey?_insertManyIfNewUnit_list_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} :
k ∈ m → (insertManyIfNewUnit m l).getKey? k = m.getKey? k
source
theorem Std.DHashMap.Raw.Const.getKey_insertManyIfNewUnit_list_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} {h' : k ∈ insertManyIfNewUnit m l} (mem : k ∈ m) :
(insertManyIfNewUnit m l).getKey k h' = m.getKey k mem
source
theorem Std.DHashMap.Raw.Const.getKey_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) {h' : k' ∈ insertManyIfNewUnit m l} :
¬k ∈ m → List.Pairwise (fun (a b : α) => (a == b) = false) l → k ∈ l → (insertManyIfNewUnit m l).getKey k' h' = k
source
theorem Std.DHashMap.Raw.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List α} {k : α} :
¬k ∈ m → l.contains k = false → (insertManyIfNewUnit m l).getKey! k = default
source
theorem Std.DHashMap.Raw.Const.getKey!_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) :
¬k ∈ m → List.Pairwise (fun (a b : α) => (a == b) = false) l → k ∈ l → (insertManyIfNewUnit m l).getKey! k' = k
source
theorem Std.DHashMap.Raw.Const.getKey!_insertManyIfNewUnit_list_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List α} {k : α} :
k ∈ m → (insertManyIfNewUnit m l).getKey! k = m.getKey! k
source
theorem Std.DHashMap.Raw.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k fallback : α} :
¬k ∈ m → l.contains k = false → (insertManyIfNewUnit m l).getKeyD k fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getKeyD_insertManyIfNewUnit_list_of_not_mem_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' fallback : α} (k_beq : (k == k') = true) :
¬k ∈ m → List.Pairwise (fun (a b : α) => (a == b) = false) l → k ∈ l → (insertManyIfNewUnit m l).getKeyD k' fallback = k
source
theorem Std.DHashMap.Raw.Const.getKeyD_insertManyIfNewUnit_list_of_mem {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k fallback : α} :
k ∈ m → (insertManyIfNewUnit m l).getKeyD k fallback = m.getKeyD k fallback
source
theorem Std.DHashMap.Raw.Const.size_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) :
(∀ (a : α), a ∈ m → l.contains a = false) → (insertManyIfNewUnit m l).size = m.size + l.length
source
theorem Std.DHashMap.Raw.Const.size_le_size_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} :
m.size ≤ (insertManyIfNewUnit m l).size
source
theorem Std.DHashMap.Raw.Const.size_le_size_insertManyIfNewUnit {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {ρ : Type w} [ForIn Id ρ α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
m.size ≤ (insertManyIfNewUnit m l).size
source
theorem Std.DHashMap.Raw.Const.size_insertManyIfNewUnit_list_le {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} :
(insertManyIfNewUnit m l).size ≤ m.size + l.length
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} :
(insertManyIfNewUnit m l).isEmpty = (m.isEmpty && l.isEmpty)
source
theorem Std.DHashMap.Raw.Const.isEmpty_of_isEmpty_insertManyIfNewUnit {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {ρ : Type w} [ForIn Id ρ α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} :
(insertManyIfNewUnit m l).isEmpty = true → m.isEmpty = true
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} :
get? (insertManyIfNewUnit m l) k = if k ∈ m ∨ l.contains k = true then some () else none
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {l : List α} {k : α} {h : k ∈ insertManyIfNewUnit m l} :
get (insertManyIfNewUnit m l) k h = ()
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {l : List α} {k : α} :
get! (insertManyIfNewUnit m l) k = ()
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_insertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] {m : Raw α fun (x : α) => Unit} {l : List α} {k : α} {fallback : Unit} :
getD (insertManyIfNewUnit m l) k fallback = ()
source
@[simp]
theorem Std.DHashMap.Raw.ofList_nil {α : Type u} {β : α → Type v} [BEq α] [Hashable α] :
ofList [] = ∅
source
@[simp]
theorem Std.DHashMap.Raw.ofList_singleton {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {k : α} {v : β k} :
ofList [⟨k, v⟩] = ∅.insert k v
source
theorem Std.DHashMap.Raw.ofList_cons {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {k : α} {v : β k} {tl : List ((a : α) × β a)} :
ofList (⟨k, v⟩ :: tl) = (∅.insert k v).insertMany tl
source
theorem Std.DHashMap.Raw.ofList_eq_insertMany_empty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {l : List ((a : α) × β a)} :
ofList l = ∅.insertMany l
source
@[simp]
theorem Std.DHashMap.Raw.contains_ofList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
(ofList l).contains k = (List.map Sigma.fst l).contains k
source
@[simp]
theorem Std.DHashMap.Raw.mem_ofList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} :
k ∈ ofList l ↔ (List.map Sigma.fst l).contains k = true
source
theorem Std.DHashMap.Raw.get?_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).get? k = none
source
theorem Std.DHashMap.Raw.get?_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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)
source
theorem Std.DHashMap.Raw.get_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.get!_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [LawfulBEq α] {l : List ((a : α) × β a)} {k : α} [Inhabited (β k)] (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).get! k = default
source
theorem Std.DHashMap.Raw.get!_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getD_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getD_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getKey?_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).getKey? k = none
source
theorem Std.DHashMap.Raw.getKey?_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getKey_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getKey!_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List ((a : α) × β a)} {k : α} (contains_eq_false : (List.map Sigma.fst l).contains k = false) :
(ofList l).getKey! k = default
source
theorem Std.DHashMap.Raw.getKey!_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getKeyD_ofList_of_contains_eq_false {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.getKeyD_ofList_of_mem {α : Type u} {β : α → Type v} [BEq α] [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
source
theorem Std.DHashMap.Raw.size_ofList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} (distinct : List.Pairwise (fun (a b : (a : α) × β a) => (a.fst == b.fst) = false) l) :
(ofList l).size = l.length
source
theorem Std.DHashMap.Raw.size_ofList_le {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
(ofList l).size ≤ l.length
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_ofList {α : Type u} {β : α → Type v} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List ((a : α) × β a)} :
(ofList l).isEmpty = l.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.Const.ofList_nil {α : Type u} [BEq α] [Hashable α] {β : Type v} :
ofList [] = ∅
source
@[simp]
theorem Std.DHashMap.Raw.Const.ofList_singleton {α : Type u} [BEq α] [Hashable α] {β : Type v} {k : α} {v : β} :
ofList [(k, v)] = ∅.insert k v
source
theorem Std.DHashMap.Raw.Const.ofList_cons {α : Type u} [BEq α] [Hashable α] {β : Type v} {k : α} {v : β} {tl : List (α × β)} :
ofList ((k, v) :: tl) = insertMany (∅.insert k v) tl
source
theorem Std.DHashMap.Raw.Const.ofList_eq_insertMany_empty {α : Type u} [BEq α] [Hashable α] {β : Type v} {l : List (α × β)} :
ofList l = insertMany ∅ l
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_ofList {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
(ofList l).contains k = (List.map Prod.fst l).contains k
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_ofList {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} :
k ∈ ofList l ↔ (List.map Prod.fst l).contains k = true
source
theorem Std.DHashMap.Raw.Const.get?_ofList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get? (ofList l) k = none
source
theorem Std.DHashMap.Raw.Const.get?_ofList_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} [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? (ofList l) k' = some v
source
theorem Std.DHashMap.Raw.Const.get_ofList_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} [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' ∈ ofList l} :
get (ofList l) k' h = v
source
theorem Std.DHashMap.Raw.Const.get!_ofList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} [Inhabited β] (contains_eq_false : (List.map Prod.fst l).contains k = false) :
get! (ofList l) k = default
source
theorem Std.DHashMap.Raw.Const.get!_ofList_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {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
source
theorem Std.DHashMap.Raw.Const.getD_ofList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} {fallback : β} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
getD (ofList l) k fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getD_ofList_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} [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 (ofList l) k' fallback = v
source
theorem Std.DHashMap.Raw.Const.getKey?_ofList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l).getKey? k = none
source
theorem Std.DHashMap.Raw.Const.getKey?_ofList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.getKey_ofList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.getKey!_ofList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List (α × β)} {k : α} (contains_eq_false : (List.map Prod.fst l).contains k = false) :
(ofList l).getKey! k = default
source
theorem Std.DHashMap.Raw.Const.getKey!_ofList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.getKeyD_ofList_of_contains_eq_false {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.getKeyD_ofList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.size_ofList {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} (distinct : List.Pairwise (fun (a b : α × β) => (a.fst == b.fst) = false) l) :
(ofList l).size = l.length
source
theorem Std.DHashMap.Raw.Const.size_ofList_le {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
(ofList l).size ≤ l.length
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_ofList {α : Type u} [BEq α] [Hashable α] {β : Type v} [EquivBEq α] [LawfulHashable α] {l : List (α × β)} :
(ofList l).isEmpty = l.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.Const.unitOfList_nil {α : Type u} [BEq α] [Hashable α] :
unitOfList [] = ∅
source
@[simp]
theorem Std.DHashMap.Raw.Const.unitOfList_singleton {α : Type u} [BEq α] [Hashable α] {k : α} :
unitOfList [k] = ∅.insertIfNew k ()
source
theorem Std.DHashMap.Raw.Const.unitOfList_cons {α : Type u} [BEq α] [Hashable α] {hd : α} {tl : List α} :
unitOfList (hd :: tl) = insertManyIfNewUnit (∅.insertIfNew hd ()) tl
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_unitOfList {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
(unitOfList l).contains k = l.contains k
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_unitOfList {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
k ∈ unitOfList l ↔ l.contains k = true
source
theorem Std.DHashMap.Raw.Const.getKey?_unitOfList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
(unitOfList l).getKey? k = none
source
theorem Std.DHashMap.Raw.Const.getKey?_unitOfList_of_mem {α : Type u} [BEq α] [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) :
(unitOfList l).getKey? k' = some k
source
theorem Std.DHashMap.Raw.Const.getKey_unitOfList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.getKey!_unitOfList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] {l : List α} {k : α} (contains_eq_false : l.contains k = false) :
(unitOfList l).getKey! k = default
source
theorem Std.DHashMap.Raw.Const.getKey!_unitOfList_of_mem {α : Type u} [BEq α] [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) :
(unitOfList l).getKey! k' = k
source
theorem Std.DHashMap.Raw.Const.getKeyD_unitOfList_of_contains_eq_false {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} {k fallback : α} (contains_eq_false : l.contains k = false) :
(unitOfList l).getKeyD k fallback = fallback
source
theorem Std.DHashMap.Raw.Const.getKeyD_unitOfList_of_mem {α : Type u} [BEq α] [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
source
theorem Std.DHashMap.Raw.Const.size_unitOfList {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) :
(unitOfList l).size = l.length
source
theorem Std.DHashMap.Raw.Const.size_unitOfList_le {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} :
(unitOfList l).size ≤ l.length
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_unitOfList {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} :
(unitOfList l).isEmpty = l.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_unitOfList {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {l : List α} {k : α} :
get? (unitOfList l) k = if l.contains k = true then some () else none
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_unitOfList {α : Type u} [BEq α] [Hashable α] {l : List α} {k : α} {h : k ∈ unitOfList l} :
get (unitOfList l) k h = ()
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_unitOfList {α : Type u} [BEq α] [Hashable α] {l : List α} {k : α} :
get! (unitOfList l) k = ()
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_unitOfList {α : Type u} [BEq α] [Hashable α] {l : List α} {k : α} {fallback : Unit} :
getD (unitOfList l) k fallback = ()
source
theorem Std.DHashMap.Raw.isEmpty_alter_eq_isEmpty_erase {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).isEmpty = ((m.erase k).isEmpty && (f (m.get? k)).isNone)
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).isEmpty = ((m.isEmpty || m.size == 1 && m.contains k) && (f (m.get? k)).isNone)
source
theorem Std.DHashMap.Raw.contains_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).contains k' = if (k == k') = true then (f (m.get? k)).isSome else m.contains k'
source
theorem Std.DHashMap.Raw.mem_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
k' ∈ m.alter k f ↔ if (k == k') = true then (f (m.get? k)).isSome = true else k' ∈ m
source
theorem Std.DHashMap.Raw.mem_alter_of_beq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) (he : (k == k') = true) :
k' ∈ m.alter k f ↔ (f (m.get? k)).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.contains_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).contains k = (f (m.get? k)).isSome
source
@[simp]
theorem Std.DHashMap.Raw.mem_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
k ∈ m.alter k f ↔ (f (m.get? k)).isSome = true
source
theorem Std.DHashMap.Raw.contains_alter_of_beq_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) (he : (k == k') = false) :
(m.alter k f).contains k' = m.contains k'
source
theorem Std.DHashMap.Raw.mem_alter_of_beq_eq_false {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) (he : (k == k') = false) :
k' ∈ m.alter k f ↔ k' ∈ m
source
theorem Std.DHashMap.Raw.size_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).size = if k ∈ m ∧ (f (m.get? k)).isNone = true then m.size - 1 else if ¬k ∈ m ∧ (f (m.get? k)).isSome = true then m.size + 1 else m.size
source
theorem Std.DHashMap.Raw.size_alter_eq_add_one {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) (h₁ : ¬k ∈ m) (h₂ : (f (m.get? k)).isSome = true) :
(m.alter k f).size = m.size + 1
source
theorem Std.DHashMap.Raw.size_alter_eq_sub_one {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) (h₁ : k ∈ m) (h₂ : (f (m.get? k)).isNone = true) :
(m.alter k f).size = m.size - 1
source
theorem Std.DHashMap.Raw.size_alter_eq_self_of_not_mem {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) (h₁ : ¬k ∈ m) (h₂ : (f (m.get? k)).isNone = true) :
(m.alter k f).size = m.size
source
theorem Std.DHashMap.Raw.size_alter_eq_self_of_mem {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) (h₁ : k ∈ m) (h₂ : (f (m.get? k)).isSome = true) :
(m.alter k f).size = m.size
source
theorem Std.DHashMap.Raw.size_alter_le_size {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).size ≤ m.size + 1
source
theorem Std.DHashMap.Raw.size_le_size_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
m.size - 1 ≤ (m.alter k f).size
source
theorem Std.DHashMap.Raw.get?_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).get? k' = if h : (k == k') = true then cast ⋯ (f (m.get? k)) else m.get? k'
source
@[simp]
theorem Std.DHashMap.Raw.get?_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).get? k = f (m.get? k)
source
theorem Std.DHashMap.Raw.get_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) {hc : k' ∈ m.alter k f} :
(m.alter k f).get k' hc = if heq : (k == k') = true then cast ⋯ ((f (m.get? k)).get ⋯) else m.get k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.get_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) {hc : k ∈ m.alter k f} :
(m.alter k f).get k hc = (f (m.get? k)).get ⋯
source
theorem Std.DHashMap.Raw.get!_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} [hi : Inhabited (β k')] {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).get! k' = if heq : (k == k') = true then (Option.map (cast ⋯) (f (m.get? k))).get! else m.get! k'
source
@[simp]
theorem Std.DHashMap.Raw.get!_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} [Inhabited (β k)] {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).get! k = (f (m.get? k)).get!
source
theorem Std.DHashMap.Raw.getD_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {fallback : β k'} {f : Option (β k) → Option (β k)} (h : m.WF) :
(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
source
@[simp]
theorem Std.DHashMap.Raw.getD_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {fallback : β k} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).getD k fallback = (f (m.get? k)).getD fallback
source
theorem Std.DHashMap.Raw.getKey?_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(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'
source
theorem Std.DHashMap.Raw.getKey?_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).getKey? k = if (f (m.get? k)).isSome = true then some k else none
source
theorem Std.DHashMap.Raw.getKey!_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(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'
source
theorem Std.DHashMap.Raw.getKey!_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).getKey! k = if (f (m.get? k)).isSome = true then k else default
source
theorem Std.DHashMap.Raw.getKey_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : Option (β k) → Option (β k)} (h : m.WF) {hc : k' ∈ m.alter k f} :
(m.alter k f).getKey k' hc = if heq : (k == k') = true then k else m.getKey k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.getKey_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k : α} {f : Option (β k) → Option (β k)} (h : m.WF) {hc : k ∈ m.alter k f} :
(m.alter k f).getKey k hc = k
source
theorem Std.DHashMap.Raw.getKeyD_alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' fallback : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(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
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_alter_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k fallback : α} {f : Option (β k) → Option (β k)} (h : m.WF) :
(m.alter k f).getKeyD k fallback = if (f (m.get? k)).isSome = true then k else fallback
source
theorem Std.DHashMap.Raw.Const.isEmpty_alter_eq_isEmpty_erase {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).isEmpty = ((m.erase k).isEmpty && (f (get? m k)).isNone)
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).isEmpty = ((m.isEmpty || m.size == 1 && m.contains k) && (f (get? m k)).isNone)
source
theorem Std.DHashMap.Raw.Const.contains_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).contains k' = if (k == k') = true then (f (get? m k)).isSome else m.contains k'
source
theorem Std.DHashMap.Raw.Const.mem_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) :
k' ∈ alter m k f ↔ if (k == k') = true then (f (get? m k)).isSome = true else k' ∈ m
source
theorem Std.DHashMap.Raw.Const.mem_alter_of_beq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) (he : (k == k') = true) :
k' ∈ alter m k f ↔ (f (get? m k)).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).contains k = (f (get? m k)).isSome
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
k ∈ alter m k f ↔ (f (get? m k)).isSome = true
source
theorem Std.DHashMap.Raw.Const.contains_alter_of_beq_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) (he : (k == k') = false) :
(alter m k f).contains k' = m.contains k'
source
theorem Std.DHashMap.Raw.Const.mem_alter_of_beq_eq_false {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) (he : (k == k') = false) :
k' ∈ alter m k f ↔ k' ∈ m
source
theorem Std.DHashMap.Raw.Const.size_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).size = if k ∈ m ∧ (f (get? m k)).isNone = true then m.size - 1 else if ¬k ∈ m ∧ (f (get? m k)).isSome = true then m.size + 1 else m.size
source
theorem Std.DHashMap.Raw.Const.size_alter_eq_add_one {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) (h₁ : ¬k ∈ m) (h₂ : (f (get? m k)).isSome = true) :
(alter m k f).size = m.size + 1
source
theorem Std.DHashMap.Raw.Const.size_alter_eq_sub_one {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) (h₁ : k ∈ m) (h₂ : (f (get? m k)).isNone = true) :
(alter m k f).size = m.size - 1
source
theorem Std.DHashMap.Raw.Const.size_alter_eq_self_of_not_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) (h₁ : ¬k ∈ m) (h₂ : (f (get? m k)).isNone = true) :
(alter m k f).size = m.size
source
theorem Std.DHashMap.Raw.Const.size_alter_eq_self_of_mem {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) (h₁ : k ∈ m) (h₂ : (f (get? m k)).isSome = true) :
(alter m k f).size = m.size
source
theorem Std.DHashMap.Raw.Const.size_alter_le_size {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).size ≤ m.size + 1
source
theorem Std.DHashMap.Raw.Const.size_le_size_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {k : α} {f : Option β → Option β} (h : m.WF) :
m.size - 1 ≤ (alter m k f).size
source
theorem Std.DHashMap.Raw.Const.get?_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) :
get? (alter m k f) k' = if (k == k') = true then f (get? m k) else get? m k'
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
get? (alter m k f) k = f (get? m k)
source
theorem Std.DHashMap.Raw.Const.get_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) {hc : k' ∈ alter m k f} :
get (alter m k f) k' hc = if heq : (k == k') = true then (f (get? m k)).get ⋯ else get m k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) {hc : k ∈ alter m k f} :
get (alter m k f) k hc = (f (get? m k)).get ⋯
source
theorem Std.DHashMap.Raw.Const.get!_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} [Inhabited β] {f : Option β → Option β} (h : m.WF) :
get! (alter m k f) k' = if (k == k') = true then (f (get? m k)).get! else get! m k'
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} [Inhabited β] {f : Option β → Option β} (h : m.WF) :
get! (alter m k f) k = (f (get? m k)).get!
source
theorem Std.DHashMap.Raw.Const.getD_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {fallback : β} {f : Option β → Option β} (h : m.WF) :
getD (alter m k f) k' fallback = if (k == k') = true then (f (get? m k)).getD fallback else getD m k' fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} {f : Option β → Option β} (h : m.WF) :
getD (alter m k f) k fallback = (f (get? m k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.getKey?_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : Option β → Option β} (h : m.WF) :
(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'
source
theorem Std.DHashMap.Raw.Const.getKey?_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).getKey? k = if (f (get? m k)).isSome = true then some k else none
source
theorem Std.DHashMap.Raw.Const.getKey!_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : Option β → Option β} (h : m.WF) :
(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'
source
theorem Std.DHashMap.Raw.Const.getKey!_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).getKey! k = if (f (get? m k)).isSome = true then k else default
source
theorem Std.DHashMap.Raw.Const.getKey_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : Option β → Option β} (h : m.WF) {hc : k' ∈ alter m k f} :
(alter m k f).getKey k' hc = if heq : (k == k') = true then k else m.getKey k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.Const.getKey_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : Option β → Option β} (h : m.WF) {hc : k ∈ alter m k f} :
(alter m k f).getKey k hc = k
source
theorem Std.DHashMap.Raw.Const.getKeyD_alter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' fallback : α} {f : Option β → Option β} (h : m.WF) :
(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
source
theorem Std.DHashMap.Raw.Const.getKeyD_alter_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k fallback : α} {f : Option β → Option β} (h : m.WF) :
(alter m k f).getKeyD k fallback = if (f (get? m k)).isSome = true then k else fallback
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.contains_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).contains k' = m.contains k'
source
@[simp]
theorem Std.DHashMap.Raw.mem_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : β k → β k} (h : m.WF) :
k' ∈ m.modify k f ↔ k' ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.size_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).size = m.size
source
theorem Std.DHashMap.Raw.get?_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).get? k' = if h : (k == k') = true then cast ⋯ (Option.map f (m.get? k)) else m.get? k'
source
@[simp]
theorem Std.DHashMap.Raw.get?_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).get? k = Option.map f (m.get? k)
source
theorem Std.DHashMap.Raw.get_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : β k → β k} (h : m.WF) {hc : k' ∈ m.modify k f} :
(m.modify k f).get k' hc = if heq : (k == k') = true then cast ⋯ (f (m.get k ⋯)) else m.get k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.get_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : β k → β k} (h : m.WF) {hc : k ∈ m.modify k f} :
(m.modify k f).get k hc = f (m.get k ⋯)
source
theorem Std.DHashMap.Raw.get!_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} [hi : Inhabited (β k')] {f : β k → β k} (h : m.WF) :
(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'
source
@[simp]
theorem Std.DHashMap.Raw.get!_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} [Inhabited (β k)] {f : β k → β k} (h : m.WF) :
(m.modify k f).get! k = (Option.map f (m.get? k)).get!
source
theorem Std.DHashMap.Raw.getD_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {fallback : β k'} {f : β k → β k} (h : m.WF) :
(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
source
@[simp]
theorem Std.DHashMap.Raw.getD_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {fallback : β k} {f : β k → β k} (h : m.WF) :
(m.modify k f).getD k fallback = (Option.map f (m.get? k)).getD fallback
source
theorem Std.DHashMap.Raw.getKey?_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKey? k' = if (k == k') = true then if k ∈ m then some k else none else m.getKey? k'
source
theorem Std.DHashMap.Raw.getKey?_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKey? k = if k ∈ m then some k else none
source
theorem Std.DHashMap.Raw.getKey!_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k k' : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKey! k' = if (k == k') = true then if k ∈ m then k else default else m.getKey! k'
source
theorem Std.DHashMap.Raw.getKey!_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKey! k = if k ∈ m then k else default
source
@[simp]
theorem Std.DHashMap.Raw.getKey_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k : α} {f : β k → β k} (h : m.WF) {hc : k ∈ m.modify k f} :
(m.modify k f).getKey k hc = k
source
theorem Std.DHashMap.Raw.getKeyD_modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {k k' fallback : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKeyD k' fallback = if (k == k') = true then if k ∈ m then k else fallback else m.getKeyD k' fallback
source
theorem Std.DHashMap.Raw.getKeyD_modify_self {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {k fallback : α} {f : β k → β k} (h : m.WF) :
(m.modify k f).getKeyD k fallback = if k ∈ m then k else fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.isEmpty_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : β → β} (h : m.WF) :
(modify m k f).isEmpty = m.isEmpty
source
@[simp]
theorem Std.DHashMap.Raw.Const.contains_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : β → β} (h : m.WF) :
(modify m k f).contains k' = m.contains k'
source
@[simp]
theorem Std.DHashMap.Raw.Const.mem_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : β → β} (h : m.WF) :
k' ∈ modify m k f ↔ k' ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.Const.size_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : β → β} (h : m.WF) :
(modify m k f).size = m.size
source
theorem Std.DHashMap.Raw.Const.get?_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : β → β} (h : m.WF) :
get? (modify m k f) k' = if (k == k') = true then Option.map f (get? m k) else get? m k'
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : β → β} (h : m.WF) :
get? (modify m k f) k = Option.map f (get? m k)
source
theorem Std.DHashMap.Raw.Const.get_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : β → β} (h : m.WF) {hc : k' ∈ modify m k f} :
get (modify m k f) k' hc = if heq : (k == k') = true then f (get m k ⋯) else get m k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : β → β} (h : m.WF) {hc : k ∈ modify m k f} :
get (modify m k f) k hc = f (get m k ⋯)
source
theorem Std.DHashMap.Raw.Const.get!_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} [Inhabited β] {f : β → β} (h : m.WF) :
get! (modify m k f) k' = if (k == k') = true then (Option.map f (get? m k)).get! else get! m k'
source
@[simp]
theorem Std.DHashMap.Raw.Const.get!_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} [Inhabited β] {f : β → β} (h : m.WF) :
get! (modify m k f) k = (Option.map f (get? m k)).get!
source
theorem Std.DHashMap.Raw.Const.getD_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {fallback : β} {f : β → β} (h : m.WF) :
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
source
@[simp]
theorem Std.DHashMap.Raw.Const.getD_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} {f : β → β} (h : m.WF) :
getD (modify m k f) k fallback = (Option.map f (get? m k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.getKey?_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' : α} {f : β → β} (h : m.WF) :
(modify m k f).getKey? k' = if (k == k') = true then if k ∈ m then some k else none else m.getKey? k'
source
theorem Std.DHashMap.Raw.Const.getKey?_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {f : β → β} (h : m.WF) :
(modify m k f).getKey? k = if k ∈ m then some k else none
source
theorem Std.DHashMap.Raw.Const.getKey!_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : β → β} (h : m.WF) :
(modify m k f).getKey! k' = if (k == k') = true then if k ∈ m then k else default else m.getKey! k'
source
theorem Std.DHashMap.Raw.Const.getKey!_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : β → β} (h : m.WF) :
(modify m k f).getKey! k = if k ∈ m then k else default
source
theorem Std.DHashMap.Raw.Const.getKey_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k k' : α} {f : β → β} (h : m.WF) {hc : k' ∈ modify m k f} :
(modify m k f).getKey k' hc = if (k == k') = true then k else m.getKey k' ⋯
source
@[simp]
theorem Std.DHashMap.Raw.Const.getKey_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} {f : β → β} (h : m.WF) {hc : k ∈ modify m k f} :
(modify m k f).getKey k hc = k
source
theorem Std.DHashMap.Raw.Const.getKeyD_modify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k k' fallback : α} {f : β → β} (h : m.WF) :
(modify m k f).getKeyD k' fallback = if (k == k') = true then if k ∈ m then k else fallback else m.getKeyD k' fallback
source
theorem Std.DHashMap.Raw.Const.getKeyD_modify_self {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k fallback : α} {f : β → β} (h : m.WF) :
(modify m k f).getKeyD k fallback = if k ∈ m then k else fallback
source
@[simp]
theorem Std.DHashMap.Raw.Equiv.refl {α : Type u} {β : α → Type v} (m : Raw α β) :
m.Equiv m
source
theorem Std.DHashMap.Raw.Equiv.rfl {α : Type u} {β : α → Type v} {m : Raw α β} :
m.Equiv m
source
theorem Std.DHashMap.Raw.Equiv.symm {α : Type u} {β : α → Type v} {m₁ m₂ : Raw α β} :
m₁.Equiv m₂ → m₂.Equiv m₁
source
theorem Std.DHashMap.Raw.Equiv.trans {α : Type u} {β : α → Type v} {m₁ m₂ m₃ : Raw α β} :
m₁.Equiv m₂ → m₂.Equiv m₃ → m₁.Equiv m₃
source
instance Std.DHashMap.Raw.Equiv.instTrans {α : Type u} {β : α → Type v} :
Trans Equiv Equiv Equiv
Equations

- Std.DHashMap.Raw.Equiv.instTrans = { trans := ⋯ }

source
theorem Std.DHashMap.Raw.Equiv.comm {α : Type u} {β : α → Type v} {m₁ m₂ : Raw α β} :
m₁.Equiv m₂ ↔ m₂.Equiv m₁
source
theorem Std.DHashMap.Raw.Equiv.congr_left {α : Type u} {β : α → Type v} {m₁ m₂ m₃ : Raw α β} (h : m₁.Equiv m₂) :
m₁.Equiv m₃ ↔ m₂.Equiv m₃
source
theorem Std.DHashMap.Raw.Equiv.congr_right {α : Type u} {β : α → Type v} {m₁ m₂ m₃ : Raw α β} (h : m₁.Equiv m₂) :
m₃.Equiv m₁ ↔ m₃.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.toList_perm {α : Type u} {β : α → Type v} {m₁ m₂ : Raw α β} (h : m₁.Equiv m₂) :
m₁.toList.Perm m₂.toList
source
theorem Std.DHashMap.Raw.Equiv.of_toList_perm {α : Type u} {β : α → Type v} {m₁ m₂ : Raw α β} (h : m₁.toList.Perm m₂.toList) :
m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.keys_perm {α : Type u} {β : α → Type v} {m₁ m₂ : Raw α β} (h : m₁.Equiv m₂) :
m₁.keys.Perm m₂.keys
source
theorem Std.DHashMap.Raw.Equiv.constToList_perm {α : Type u} {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} (h : m₁.Equiv m₂) :
(Const.toList m₁).Perm (Const.toList m₂)
source
theorem Std.DHashMap.Raw.Equiv.of_constToList_perm {α : Type u} {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} (h : (Const.toList m₁).Perm (Const.toList m₂)) :
m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.of_keys_unit_perm {α : Type u} {m₁ m₂ : Raw α fun (x : α) => Unit} (h : m₁.keys.Perm m₂.keys) :
m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.isEmpty_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.isEmpty = m₂.isEmpty
source
theorem Std.DHashMap.Raw.Equiv.size_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.size = m₂.size
source
theorem Std.DHashMap.Raw.Equiv.contains_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.contains k = m₂.contains k
source
theorem Std.DHashMap.Raw.Equiv.mem_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
k ∈ m₁ ↔ k ∈ m₂
source
theorem Std.DHashMap.Raw.Equiv.get?_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.get? k = m₂.get? k
source
theorem Std.DHashMap.Raw.Equiv.get_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (hk : k ∈ m₁) (h : m₁.Equiv m₂) :
m₁.get k hk = m₂.get k ⋯
source
theorem Std.DHashMap.Raw.Equiv.get!_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] {k : α} [Inhabited (β k)] (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.get! k = m₂.get! k
source
theorem Std.DHashMap.Raw.Equiv.getD_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] {k : α} {fallback : β k} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.getD k fallback = m₂.getD k fallback
source
theorem Std.DHashMap.Raw.Equiv.getKey?_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.getKey? k = m₂.getKey? k
source
theorem Std.DHashMap.Raw.Equiv.getKey_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (hk : k ∈ m₁) (h : m₁.Equiv m₂) :
m₁.getKey k hk = m₂.getKey k ⋯
source
theorem Std.DHashMap.Raw.Equiv.getKey!_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.getKey! k = m₂.getKey! k
source
theorem Std.DHashMap.Raw.Equiv.getKeyD_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] {k fallback : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
m₁.getKeyD k fallback = m₂.getKeyD k fallback
source
theorem Std.DHashMap.Raw.Equiv.insert {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (v : β k) (h : m₁.Equiv m₂) :
(m₁.insert k v).Equiv (m₂.insert k v)
source
theorem Std.DHashMap.Raw.Equiv.erase {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (h : m₁.Equiv m₂) :
(m₁.erase k).Equiv (m₂.erase k)
source
theorem Std.DHashMap.Raw.Equiv.insertIfNew {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (v : β k) (h : m₁.Equiv m₂) :
(m₁.insertIfNew k v).Equiv (m₂.insertIfNew k v)
source
theorem Std.DHashMap.Raw.Equiv.insertMany_list {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (l : List ((a : α) × β a)) (h : m₁.Equiv m₂) :
(m₁.insertMany l).Equiv (m₂.insertMany l)
source
theorem Std.DHashMap.Raw.Equiv.alter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (f : Option (β k) → Option (β k)) (h : m₁.Equiv m₂) :
(m₁.alter k f).Equiv (m₂.alter k f)
source
theorem Std.DHashMap.Raw.Equiv.modify {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (f : β k → β k) (h : m₁.Equiv m₂) :
(m₁.modify k f).Equiv (m₂.modify k f)
source
theorem Std.DHashMap.Raw.Equiv.filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} (h₁ : m₁.WF) (h₂ : m₂.WF) (f : (a : α) → β a → Bool) (h : m₁.Equiv m₂) :
(Raw.filter f m₁).Equiv (Raw.filter f m₂)
source
theorem Std.DHashMap.Raw.Equiv.map {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} (h₁ : m₁.WF) (h₂ : m₂.WF) (f : (a : α) → β a → γ a) (h : m₁.Equiv m₂) :
(Raw.map f m₁).Equiv (Raw.map f m₂)
source
theorem Std.DHashMap.Raw.Equiv.filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} (h₁ : m₁.WF) (h₂ : m₂.WF) (f : (a : α) → β a → Option (γ a)) (h : m₁.Equiv m₂) :
(Raw.filterMap f m₁).Equiv (Raw.filterMap f m₂)
source
theorem Std.DHashMap.Raw.Equiv.of_forall_get?_eq {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) (h : ∀ (k : α), m₁.get? k = m₂.get? k) :
m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.constGet?_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
Const.get? m₁ k = Const.get? m₂ k
source
theorem Std.DHashMap.Raw.Equiv.constGet_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (hk : k ∈ m₁) (h : m₁.Equiv m₂) :
Const.get m₁ k hk = Const.get m₂ k ⋯
source
theorem Std.DHashMap.Raw.Equiv.constGet!_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {k : α} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
Const.get! m₁ k = Const.get! m₂ k
source
theorem Std.DHashMap.Raw.Equiv.constGetD_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {k : α} {fallback : β} (h₁ : m₁.WF) (h₂ : m₂.WF) (h : m₁.Equiv m₂) :
Const.getD m₁ k fallback = Const.getD m₂ k fallback
source
theorem Std.DHashMap.Raw.Equiv.constInsertMany_list {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (l : List (α × β)) (h : m₁.Equiv m₂) :
(Const.insertMany m₁ l).Equiv (Const.insertMany m₂ l)
source
theorem Std.DHashMap.Raw.Equiv.constInsertManyIfNewUnit_list {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {m₁ m₂ : Raw α fun (x : α) => Unit} (h₁ : m₁.WF) (h₂ : m₂.WF) (l : List α) (h : m₁.Equiv m₂) :
(Const.insertManyIfNewUnit m₁ l).Equiv (Const.insertManyIfNewUnit m₂ l)
source
theorem Std.DHashMap.Raw.Equiv.constAlter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (f : Option β → Option β) (h : m₁.Equiv m₂) :
(Const.alter m₁ k f).Equiv (Const.alter m₂ k f)
source
theorem Std.DHashMap.Raw.Equiv.constModify {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (k : α) (f : β → β) (h : m₁.Equiv m₂) :
(Const.modify m₁ k f).Equiv (Const.modify m₂ k f)
source
theorem Std.DHashMap.Raw.Equiv.of_forall_getKey_eq_of_forall_constGet?_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α) (hk : k ∈ m₁) (hk' : k ∈ m₂), m₁.getKey k hk = m₂.getKey k hk') → (∀ (k : α), Const.get? m₁ k = Const.get? m₂ k) → m₁.Equiv m₂
source
@[deprecated Std.DHashMap.Raw.Equiv.of_forall_getKey_eq_of_forall_constGet?_eq (since := "2025-04-25")]
theorem Std.DHashMap.Raw.Equiv.of_forall_getKey?_eq_of_forall_constGet?_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α), m₁.getKey? k = m₂.getKey? k) → (∀ (k : α), Const.get? m₁ k = Const.get? m₂ k) → m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.of_forall_constGet?_eq {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [LawfulBEq α] (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α), Const.get? m₁ k = Const.get? m₂ k) → m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.of_forall_getKey?_unit_eq {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {m₁ m₂ : Raw α fun (x : α) => Unit} (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α), m₁.getKey? k = m₂.getKey? k) → m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.of_forall_contains_unit_eq {α : Type u} [BEq α] [Hashable α] [LawfulBEq α] {m₁ m₂ : Raw α fun (x : α) => Unit} (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α), m₁.contains k = m₂.contains k) → m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.Equiv.of_forall_mem_unit_iff {α : Type u} [BEq α] [Hashable α] [LawfulBEq α] {m₁ m₂ : Raw α fun (x : α) => Unit} (h₁ : m₁.WF) (h₂ : m₂.WF) :
(∀ (k : α), k ∈ m₁ ↔ k ∈ m₂) → m₁.Equiv m₂
source
theorem Std.DHashMap.Raw.equiv_emptyWithCapacity_iff_isEmpty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {c : Nat} (h : m.WF) :
m.Equiv (emptyWithCapacity c) ↔ m.isEmpty = true
source
theorem Std.DHashMap.Raw.equiv_empty_iff_isEmpty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.Equiv ∅ ↔ m.isEmpty = true
source
@[reducible, inline, deprecated Std.DHashMap.Raw.equiv_empty_iff_isEmpty (since := "2025-03-12")]
abbrev Std.DHashMap.Raw.equiv_emptyc_iff_isEmpty {α : Type u_1} {β : α → Type u_2} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
m.Equiv ∅ ↔ m.isEmpty = true
Equations

- @Std.DHashMap.Raw.equiv_emptyc_iff_isEmpty = @Std.DHashMap.Raw.equiv_empty_iff_isEmpty

Instances For

source
theorem Std.DHashMap.Raw.emptyWithCapacity_equiv_iff_isEmpty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {c : Nat} (h : m.WF) :
(emptyWithCapacity c).Equiv m ↔ m.isEmpty = true
source
theorem Std.DHashMap.Raw.empty_equiv_iff_isEmpty {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] (h : m.WF) :
∅.Equiv m ↔ m.isEmpty = true
source
theorem Std.DHashMap.Raw.equiv_iff_toList_perm {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m₁ m₂ : Raw α β} [EquivBEq α] [LawfulHashable α] :
m₁.Equiv m₂ ↔ m₁.toList.Perm m₂.toList
source
theorem Std.DHashMap.Raw.Const.equiv_iff_toList_perm {α : Type u} [BEq α] [Hashable α] {β : Type v} {m₁ m₂ : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] :
m₁.Equiv m₂ ↔ (toList m₁).Perm (toList m₂)
source
theorem Std.DHashMap.Raw.Const.equiv_iff_keys_unit_perm {α : Type u} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {m₁ m₂ : Raw α fun (x : α) => Unit} :
m₁.Equiv m₂ ↔ m₁.keys.Perm m₂.keys
source
theorem Std.DHashMap.Raw.toList_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} {f : (a : α) → β a → Option (γ a)} (h : m.WF) :
(filterMap f m).toList.Perm (List.filterMap (fun (p : (a : α) × β a) => Option.map (fun (x : γ p.fst) => ⟨p.fst, x⟩) (f p.fst p.snd)) m.toList)
source
theorem Std.DHashMap.Raw.isEmpty_filterMap_iff {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} (h : m.WF) :
(filterMap f m).isEmpty = true ↔ ∀ (k : α) (h : k ∈ m), f k (m.get k h) = none
source
theorem Std.DHashMap.Raw.isEmpty_filterMap_eq_false_iff {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} (h : m.WF) :
(filterMap f m).isEmpty = false ↔ ∃ (k : α), ∃ (h : k ∈ m), (f k (m.get k h)).isSome = true
source
theorem Std.DHashMap.Raw.contains_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
(filterMap f m).contains k = Option.any (fun (x : β k) => (f k x).isSome) (m.get? k)
source
theorem Std.DHashMap.Raw.mem_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
k ∈ filterMap f m ↔ ∃ (h : k ∈ m), (f k (m.get k h)).isSome = true
source
theorem Std.DHashMap.Raw.contains_of_contains_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
(filterMap f m).contains k = true → m.contains k = true
source
theorem Std.DHashMap.Raw.mem_of_mem_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
k ∈ filterMap f m → k ∈ m
source
theorem Std.DHashMap.Raw.size_filterMap_le_size {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Option (γ a)} (h : m.WF) :
(filterMap f m).size ≤ m.size
source
theorem Std.DHashMap.Raw.size_filterMap_eq_size_iff {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} (h : m.WF) :
(filterMap f m).size = m.size ↔ ∀ (a : α) (h : a ∈ m), (f a (m.get a h)).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.get?_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
(filterMap f m).get? k = (m.get? k).bind (f k)
source
theorem Std.DHashMap.Raw.isSome_apply_of_mem_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) (h' : k ∈ filterMap f m) :
(f k (m.get k ⋯)).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.get_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} {h' : k ∈ filterMap f m} (h : m.WF) :
(filterMap f m).get k h' = (f k (m.get k ⋯)).get ⋯
source
theorem Std.DHashMap.Raw.get!_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} [Inhabited (γ k)] (h : m.WF) :
(filterMap f m).get! k = ((m.get? k).bind (f k)).get!
source
theorem Std.DHashMap.Raw.getD_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} {fallback : γ k} (h : m.WF) :
(filterMap f m).getD k fallback = ((m.get? k).bind (f k)).getD fallback
source
theorem Std.DHashMap.Raw.getKey?_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
(filterMap f m).getKey? k = (m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (m.get x ⋯)).isSome
source
@[simp]
theorem Std.DHashMap.Raw.getKey_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Option (γ a)} {k : α} {h' : k ∈ filterMap f m} (h : m.WF) :
(filterMap f m).getKey k h' = m.getKey k ⋯
source
theorem Std.DHashMap.Raw.getKey!_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {f : (a : α) → β a → Option (γ a)} {k : α} (h : m.WF) :
(filterMap f m).getKey! k = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (m.get x ⋯)).isSome).get!
source
theorem Std.DHashMap.Raw.getKeyD_filterMap {α : Type u} {β : α → Type v} {γ : α → Type w} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Option (γ a)} {k fallback : α} (h : m.WF) :
(filterMap f m).getKeyD k fallback = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (m.get x ⋯)).isSome).getD fallback
source
theorem Std.DHashMap.Raw.Const.isEmpty_filterMap_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} (h : m.WF) :
(filterMap f m).isEmpty = true ↔ ∀ (k : α) (h : k ∈ m), f (m.getKey k h) (get m k h) = none
source
theorem Std.DHashMap.Raw.Const.isEmpty_filterMap_eq_false_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} (h : m.WF) :
(filterMap f m).isEmpty = false ↔ ∃ (k : α), ∃ (h : k ∈ m), (f (m.getKey k h) (get m k h)).isSome = true
source
theorem Std.DHashMap.Raw.Const.mem_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} (h : m.WF) :
k ∈ filterMap f m ↔ ∃ (h : k ∈ m), (f (m.getKey k h) (get m k h)).isSome = true
source
theorem Std.DHashMap.Raw.Const.size_filterMap_eq_size_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} (h : m.WF) :
(filterMap f m).size = m.size ↔ ∀ (k : α) (h : k ∈ m), (f (m.getKey k h) (get m k h)).isSome = true
source
theorem Std.DHashMap.Raw.Const.get?_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} (h : m.WF) :
get? (filterMap f m) k = (get? m k).pbind fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_filterMap' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → Option γ} {k : α} (h : m.WF) :
get? (filterMap f m) k = (get? m k).bind (f k)

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

source
theorem Std.DHashMap.Raw.Const.get?_filterMap_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get? (filterMap f m) k = (get? m k).bind (f k')
source
theorem Std.DHashMap.Raw.Const.isSome_apply_of_mem_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} (h : m.WF) (h' : k ∈ filterMap f m) :
(f (m.getKey k ⋯) (get m k ⋯)).isSome = true
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} {h' : k ∈ filterMap f m} (h : m.WF) :
get (filterMap f m) k h' = (f (m.getKey k ⋯) (get m k ⋯)).get ⋯
source
theorem Std.DHashMap.Raw.Const.get!_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited γ] {f : α → β → Option γ} {k : α} (h : m.WF) :
get! (filterMap f m) k = ((get? m k).pbind fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x).get!
source
theorem Std.DHashMap.Raw.Const.get!_filterMap' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] [Inhabited γ] {f : α → β → Option γ} {k : α} (h : m.WF) :
get! (filterMap f m) k = ((get? m k).bind (f k)).get!

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

source
theorem Std.DHashMap.Raw.Const.get!_filterMap_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited γ] {f : α → β → Option γ} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get! (filterMap f m) k = ((get? m k).bind fun (x : β) => f k' x).get!
source
theorem Std.DHashMap.Raw.Const.getD_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} {fallback : γ} (h : m.WF) :
getD (filterMap f m) k fallback = ((get? m k).pbind fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x).getD fallback
source
theorem Std.DHashMap.Raw.Const.getD_filterMap' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → Option γ} {k : α} {fallback : γ} (h : m.WF) :
getD (filterMap f m) k fallback = ((get? m k).bind (f k)).getD fallback

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

source
theorem Std.DHashMap.Raw.Const.getD_filterMap_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k k' : α} {fallback : γ} (h : m.WF) :
m.getKey? k = some k' → getD (filterMap f m) k fallback = ((get? m k).bind fun (x : β) => f k' x).getD fallback
source
theorem Std.DHashMap.Raw.Const.toList_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} {f : α → β → Option γ} (h : m.WF) :
(toList (filterMap f m)).Perm (List.filterMap (fun (p : α × β) => Option.map (fun (x : γ) => (p.fst, x)) (f p.fst p.snd)) (toList m))
source
theorem Std.DHashMap.Raw.Const.getKey?_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} (h : m.WF) :
(filterMap f m).getKey? k = (m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (get m x ⋯)).isSome
source
@[simp]
theorem Std.DHashMap.Raw.Const.getKey_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k : α} {h' : k ∈ filterMap f m} (h : m.WF) :
(filterMap f m).getKey k h' = m.getKey k ⋯
source
theorem Std.DHashMap.Raw.Const.getKey!_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {f : α → β → Option γ} {k : α} (h : m.WF) :
(filterMap f m).getKey! k = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (get m x ⋯)).isSome).get!
source
theorem Std.DHashMap.Raw.Const.getKeyD_filterMap {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Option γ} {k fallback : α} (h : m.WF) :
(filterMap f m).getKeyD k fallback = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => (f x (get m x ⋯)).isSome).getD fallback
source
theorem Std.DHashMap.Raw.filterMap_equiv_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {f : (a : α) → β a → Bool} (h : m.WF) :
(filterMap (fun (k : α) => Option.guard fun (v : β k) => f k v) m).Equiv (filter f m)
source
theorem Std.DHashMap.Raw.toList_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).toList.Perm (List.filter (fun (p : (a : α) × β a) => f p.fst p.snd) m.toList)
source
theorem Std.DHashMap.Raw.keys_filter_key {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {f : α → Bool} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).keys.Perm (List.filter f m.keys)
source
theorem Std.DHashMap.Raw.isEmpty_filter_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).isEmpty = true ↔ ∀ (k : α) (h : k ∈ m), f k (m.get k h) = false
source
theorem Std.DHashMap.Raw.isEmpty_filter_eq_false_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).isEmpty = false ↔ ∃ (k : α), ∃ (h : k ∈ m), f k (m.get k h) = true
source
theorem Std.DHashMap.Raw.isEmpty_filter_key_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} (h : m.WF) :
(filter (fun (a : α) (x : β a) => f a) m).isEmpty = true ↔ ∀ (k : α) (h : k ∈ m), f (m.getKey k h) = false
source
theorem Std.DHashMap.Raw.isEmpty_filter_key_eq_false_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} (h : m.WF) :
(filter (fun (a : α) (x : β a) => f a) m).isEmpty = false ↔ ∃ (k : α), ∃ (h : k ∈ m), f (m.getKey k h) = true
source
theorem Std.DHashMap.Raw.contains_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
(filter f m).contains k = Option.any (f k) (m.get? k)
source
theorem Std.DHashMap.Raw.mem_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
k ∈ filter f m ↔ Option.any (f k) (m.get? k) = true
source
theorem Std.DHashMap.Raw.mem_filter_key {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} {k : α} (h : m.WF) :
k ∈ filter (fun (a : α) (x : β a) => f a) m ↔ ∃ (h : k ∈ m), f (m.getKey k h) = true
source
theorem Std.DHashMap.Raw.contains_of_contains_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
(filter f m).contains k = true → m.contains k = true
source
theorem Std.DHashMap.Raw.mem_of_mem_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
k ∈ filter f m → k ∈ m
source
theorem Std.DHashMap.Raw.size_filter_le_size {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).size ≤ m.size
source
theorem Std.DHashMap.Raw.size_filter_eq_size_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).size = m.size ↔ ∀ (k : α) (h : k ∈ m), f k (m.get k h) = true
source
theorem Std.DHashMap.Raw.filter_equiv_self_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).Equiv m ↔ ∀ (k : α) (h : k ∈ m), f k (m.get k h) = true
source
theorem Std.DHashMap.Raw.filter_key_equiv_self_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).Equiv m ↔ ∀ (k : α) (h : k ∈ m), f (m.getKey k h) = true
source
theorem Std.DHashMap.Raw.size_filter_key_eq_size_iff {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).size = m.size ↔ ∀ (k : α) (h : k ∈ m), f (m.getKey k h) = true
source
@[simp]
theorem Std.DHashMap.Raw.get?_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
(filter f m).get? k = Option.filter (f k) (m.get? k)
source
@[simp]
theorem Std.DHashMap.Raw.get_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} {h' : k ∈ filter f m} (h : m.WF) :
(filter f m).get k h' = m.get k ⋯
source
theorem Std.DHashMap.Raw.get!_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} [Inhabited (β k)] (h : m.WF) :
(filter f m).get! k = (Option.filter (f k) (m.get? k)).get!
source
theorem Std.DHashMap.Raw.getD_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} {fallback : β k} (h : m.WF) :
(filter f m).getD k fallback = (Option.filter (f k) (m.get? k)).getD fallback
source
theorem Std.DHashMap.Raw.keys_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} (h : m.WF) :
(filter f m).keys.Perm (List.filter (fun (x : { x : α // x ∈ m.keys }) => match x with | ⟨x, h'⟩ => f x (m.get x ⋯)) m.keys.attach).unattach
source
theorem Std.DHashMap.Raw.getKey?_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
(filter f m).getKey? k = (m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (m.get x ⋯)
source
theorem Std.DHashMap.Raw.getKey?_filter_key {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} {k : α} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).getKey? k = Option.filter f (m.getKey? k)
source
@[simp]
theorem Std.DHashMap.Raw.getKey_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → Bool} {k : α} {h' : k ∈ filter f m} (h : m.WF) :
(filter f m).getKey k h' = m.getKey k ⋯
source
theorem Std.DHashMap.Raw.getKey!_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] [Inhabited α] {f : (a : α) → β a → Bool} {k : α} (h : m.WF) :
(filter f m).getKey! k = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (m.get x ⋯)).get!
source
theorem Std.DHashMap.Raw.getKey!_filter_key {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {f : α → Bool} {k : α} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).getKey! k = (Option.filter f (m.getKey? k)).get!
source
theorem Std.DHashMap.Raw.getKeyD_filter {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [LawfulBEq α] {f : (a : α) → β a → Bool} {k fallback : α} (h : m.WF) :
(filter f m).getKeyD k fallback = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (m.get x ⋯)).getD fallback
source
theorem Std.DHashMap.Raw.getKeyD_filter_key {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} [EquivBEq α] [LawfulHashable α] {f : α → Bool} {k fallback : α} (h : m.WF) :
(filter (fun (k : α) (x : β k) => f k) m).getKeyD k fallback = (Option.filter f (m.getKey? k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.isEmpty_filter_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).isEmpty = true ↔ ∀ (k : α) (h : k ∈ m), f (m.getKey k h) (get m k h) = false
source
theorem Std.DHashMap.Raw.Const.isEmpty_filter_eq_false_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).isEmpty = false ↔ ∃ (k : α), ∃ (h : k ∈ m), f (m.getKey k h) (get m k h) = true
source
theorem Std.DHashMap.Raw.Const.mem_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k : α} (h : m.WF) :
k ∈ filter f m ↔ ∃ (h' : k ∈ m), f (m.getKey k h') (get m k h') = true
source
theorem Std.DHashMap.Raw.Const.size_filter_le_size {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).size ≤ m.size
source
theorem Std.DHashMap.Raw.Const.size_filter_eq_size_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).size = m.size ↔ ∀ (a : α) (h : a ∈ m), f (m.getKey a h) (get m a h) = true
source
theorem Std.DHashMap.Raw.Const.filter_equiv_self_iff {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).Equiv m ↔ ∀ (a : α) (h : a ∈ m), f (m.getKey a h) (get m a h) = true
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k : α} (h : m.WF) :
get? (filter f m) k = (get? m k).pfilter fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x
source
theorem Std.DHashMap.Raw.Const.get?_filter' {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → Bool} {k : α} (h : m.WF) :
get? (filter f m) k = Option.filter (f k) (get? m k)

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

source
theorem Std.DHashMap.Raw.Const.get?_filter_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get? (filter f m) k = Option.filter (fun (x : β) => f k' x) (get? m k)
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k : α} {h' : k ∈ filter f m} (h : m.WF) :
get (filter f m) k h' = get m k ⋯
source
theorem Std.DHashMap.Raw.Const.get!_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {f : α → β → Bool} {k : α} (h : m.WF) :
get! (filter f m) k = ((get? m k).pfilter fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x).get!
source
theorem Std.DHashMap.Raw.Const.get!_filter' {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] [Inhabited β] {f : α → β → Bool} {k : α} (h : m.WF) :
get! (filter f m) k = (Option.filter (f k) (get? m k)).get!

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

source
theorem Std.DHashMap.Raw.Const.get!_filter_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited β] {f : α → β → Bool} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get! (filter f m) k = (Option.filter (fun (x : β) => f k' x) (get? m k)).get!
source
theorem Std.DHashMap.Raw.Const.getD_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k : α} {fallback : β} (h : m.WF) :
getD (filter f m) k fallback = ((get? m k).pfilter fun (x : β) (h' : get? m k = some x) => f (m.getKey k ⋯) x).getD fallback
source
theorem Std.DHashMap.Raw.Const.getD_filter' {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → Bool} {k : α} {fallback : β} (h : m.WF) :
getD (filter f m) k fallback = (Option.filter (f k) (get? m k)).getD fallback

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

source
theorem Std.DHashMap.Raw.Const.getD_filter_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k k' : α} {fallback : β} (h : m.WF) :
m.getKey? k = some k' → getD (filter f m) k fallback = (Option.filter (fun (x : β) => f k' x) (get? m k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.toList_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} {f : α → β → Bool} (h : m.WF) :
(toList (filter f m)).Perm (List.filter (fun (p : α × β) => f p.fst p.snd) (toList m))
source
theorem Std.DHashMap.Raw.Const.keys_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} (h : m.WF) :
(filter f m).keys.Perm (List.filter (fun (x : { x : α // x ∈ m.keys }) => match x with | ⟨x, h'⟩ => f x (get m x ⋯)) m.keys.attach).unattach
source
theorem Std.DHashMap.Raw.Const.getKey?_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k : α} (h : m.WF) :
(filter f m).getKey? k = (m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (get m x ⋯)
source
theorem Std.DHashMap.Raw.Const.getKey!_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited α] {f : α → β → Bool} {k : α} (h : m.WF) :
(filter f m).getKey! k = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (get m x ⋯)).get!
source
theorem Std.DHashMap.Raw.Const.getKeyD_filter {α : Type u} [BEq α] [Hashable α] {β : Type v} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → Bool} {k fallback : α} (h : m.WF) :
(filter f m).getKeyD k fallback = ((m.getKey? k).pfilter fun (x : α) (h' : m.getKey? k = some x) => f x (get m x ⋯)).getD fallback
source
theorem Std.DHashMap.Raw.map_id_equiv {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} (h : m.WF) :
(map (fun (x : α) (v : β x) => v) m).Equiv m
source
theorem Std.DHashMap.Raw.map_map_equiv {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} {δ : α → Type w'} {f : (a : α) → β a → γ a} {g : (a : α) → γ a → δ a} (h : m.WF) :
(map g (map f m)).Equiv (map (fun (k : α) (v : β k) => g k (f k v)) m)
source
theorem Std.DHashMap.Raw.toList_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} {f : (a : α) → β a → γ a} (h : m.WF) :
(map f m).toList.Perm (List.map (fun (p : (a : α) × β a) => ⟨p.fst, f p.fst p.snd⟩) m.toList)
source
theorem Std.DHashMap.Raw.keys_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} {f : (a : α) → β a → γ a} (h : m.WF) :
(map f m).keys.Perm m.keys
source
theorem Std.DHashMap.Raw.filterMap_equiv_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} (h : m.WF) :
(filterMap (fun (k : α) (v : β k) => some (f k v)) m).Equiv (map f m)
source
@[simp]
theorem Std.DHashMap.Raw.isEmpty_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} (h : m.WF) :
(map f m).isEmpty = m.isEmpty
source
theorem Std.DHashMap.Raw.contains_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
(map f m).contains k = m.contains k
source
theorem Std.DHashMap.Raw.contains_of_contains_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
(map f m).contains k = true → m.contains k = true
source
@[simp]
theorem Std.DHashMap.Raw.mem_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
k ∈ map f m ↔ k ∈ m
source
theorem Std.DHashMap.Raw.mem_of_mem_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
k ∈ map f m → k ∈ m
source
@[simp]
theorem Std.DHashMap.Raw.size_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} (h : m.WF) :
(map f m).size = m.size
source
@[simp]
theorem Std.DHashMap.Raw.get?_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [LawfulBEq α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
(map f m).get? k = Option.map (f k) (m.get? k)
source
@[simp]
theorem Std.DHashMap.Raw.get_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [LawfulBEq α] {f : (a : α) → β a → γ a} {k : α} {h' : k ∈ map f m} (h : m.WF) :
(map f m).get k h' = f k (m.get k ⋯)
source
theorem Std.DHashMap.Raw.get!_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [LawfulBEq α] {f : (a : α) → β a → γ a} {k : α} [Inhabited (γ k)] (h : m.WF) :
(map f m).get! k = (Option.map (f k) (m.get? k)).get!
source
theorem Std.DHashMap.Raw.getD_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [LawfulBEq α] {f : (a : α) → β a → γ a} {k : α} {fallback : γ k} (h : m.WF) :
(map f m).getD k fallback = (Option.map (f k) (m.get? k)).getD fallback
source
@[simp]
theorem Std.DHashMap.Raw.getKey?_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
(map f m).getKey? k = m.getKey? k
source
@[simp]
theorem Std.DHashMap.Raw.getKey_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k : α} {h' : k ∈ map f m} (h : m.WF) :
(map f m).getKey k h' = m.getKey k ⋯
source
@[simp]
theorem Std.DHashMap.Raw.getKey!_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] [Inhabited α] {f : (a : α) → β a → γ a} {k : α} (h : m.WF) :
(map f m).getKey! k = m.getKey! k
source
@[simp]
theorem Std.DHashMap.Raw.getKeyD_map {α : Type u} {β : α → Type v} [BEq α] [Hashable α] {m : Raw α β} {γ : α → Type w} [EquivBEq α] [LawfulHashable α] {f : (a : α) → β a → γ a} {k fallback : α} (h : m.WF) :
(map f m).getKeyD k fallback = m.getKeyD k fallback
source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_map' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → γ} {k : α} (h : m.WF) :
get? (map f m) k = Option.pmap (fun (v : β) (h' : k ∈ m) => f (m.getKey k h') v) (get? m k) ⋯

Variant of `get?_map` that holds with `EquivBEq` (i.e. without `LawfulBEq`).

source
@[simp]
theorem Std.DHashMap.Raw.Const.get?_map {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → γ} {k : α} (h : m.WF) :
get? (map f m) k = Option.map (f k) (get? m k)
source
theorem Std.DHashMap.Raw.Const.get?_map_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → γ} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get? (map f m) k = Option.map (f k') (get? m k)
source
@[simp]
theorem Std.DHashMap.Raw.Const.get_map' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → γ} {k : α} {h' : k ∈ map f m} (h : m.WF) :
get (map f m) k h' = f (m.getKey k ⋯) (get m k ⋯)

Variant of `get_map` that holds with `EquivBEq` (i.e. without `LawfulBEq`).

source
@[simp]
theorem Std.DHashMap.Raw.Const.get_map {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → γ} {k : α} (h : m.WF) {h' : k ∈ map f m} :
get (map f m) k h' = f k (get m k ⋯)
source
theorem Std.DHashMap.Raw.Const.get!_map' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited γ] {f : α → β → γ} {k : α} (h : m.WF) :
get! (map f m) k = (Option.pmap (fun (v : β) (h : k ∈ m) => f (m.getKey k h) v) (get? m k) ⋯).get!

Variant of `get!_map` that holds with `EquivBEq` (i.e. without `LawfulBEq`).

source
theorem Std.DHashMap.Raw.Const.get!_map {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] [Inhabited γ] {f : α → β → γ} {k : α} (h : m.WF) :
get! (map f m) k = (Option.map (f k) (get? m k)).get!
source
theorem Std.DHashMap.Raw.Const.get!_map_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] [Inhabited γ] {f : α → β → γ} {k k' : α} (h : m.WF) :
m.getKey? k = some k' → get! (map f m) k = (Option.map (f k') (get? m k)).get!
source
theorem Std.DHashMap.Raw.Const.getD_map' {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → γ} {k : α} {fallback : γ} (h : m.WF) :
getD (map f m) k fallback = (Option.pmap (fun (v : β) (h : k ∈ m) => f (m.getKey k h) v) (get? m k) ⋯).getD fallback

Variant of `getD_map` that holds with `EquivBEq` (i.e. without `LawfulBEq`).

source
theorem Std.DHashMap.Raw.Const.getD_map {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [LawfulBEq α] {f : α → β → γ} {k : α} {fallback : γ} (h : m.WF) :
getD (map f m) k fallback = (Option.map (f k) (get? m k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.getD_map_of_getKey?_eq_some {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} [EquivBEq α] [LawfulHashable α] {f : α → β → γ} {k k' : α} {fallback : γ} (h : m.WF) :
m.getKey? k = some k' → getD (map f m) k fallback = (Option.map (f k') (get? m k)).getD fallback
source
theorem Std.DHashMap.Raw.Const.toList_map {α : Type u} [BEq α] [Hashable α] {β : Type v} {γ : Type w} {m : Raw α fun (x : α) => β} {f : α → β → γ} (h : m.WF) :
(toList (map f m)).Perm (List.map (fun (p : α × β) => (p.fst, f p.fst p.snd)) (toList m))