This is an internal implementation file of the hash map. Users of the hash map should not rely on the contents of this file.
File contents: verification of operations on Raw₀
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.buckets_empty
{α : Type u}
{β : α → Type v}
{c i : Nat}
{h : i < (Std.DHashMap.Internal.Raw₀.empty c).val.buckets.size}
:
(Std.DHashMap.Internal.Raw₀.empty c).val.buckets[i] = Std.DHashMap.Internal.AssocList.nil
@[simp]
theorem
Std.DHashMap.Internal.Raw.buckets_empty
{α : Type u}
{β : α → Type v}
{c i : Nat}
{h : i < (Std.DHashMap.Raw.empty c).buckets.size}
:
(Std.DHashMap.Raw.empty c).buckets[i] = Std.DHashMap.Internal.AssocList.nil
@[simp]
theorem
Std.DHashMap.Internal.buckets_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{c i : Nat}
{h : i < (Std.DHashMap.empty c).val.buckets.size}
:
(Std.DHashMap.empty c).val.buckets[i] = Std.DHashMap.Internal.AssocList.nil
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.size_empty
{α : Type u}
{β : α → Type v}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).val.size = 0
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_eq_size_eq_zero
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
:
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.Raw₀.tacticWf_trivial = Lean.ParserDescr.node `Std.DHashMap.Internal.Raw₀.tacticWf_trivial 1024 (Lean.ParserDescr.nonReservedSymbol "wf_trivial" false)
Instances For
Internal implementation detail of the hash map
Equations
- Std.DHashMap.Internal.Raw₀.tacticEmpty = Lean.ParserDescr.node `Std.DHashMap.Internal.Raw₀.tacticEmpty 1024 (Lean.ParserDescr.nonReservedSymbol "empty" false)
Instances For
Internal implementation detail of the hash map
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).val.isEmpty = true
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_congr
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a b : α}
(hab : (a == b) = true)
:
m.contains a = m.contains b
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.contains_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{a : α}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).contains a = false
theorem
Std.DHashMap.Internal.Raw₀.contains_of_isEmpty
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_eq_false_iff_exists_contains_eq_true
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_iff_forall_contains
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
theorem
Std.DHashMap.Internal.Raw₀.contains_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.size_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.size_le_size_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
m.val.size ≤ (m.insert k v).val.size
theorem
Std.DHashMap.Internal.Raw₀.size_insert_le
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_of_contains_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.size_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
theorem
Std.DHashMap.Internal.Raw₀.size_erase_le
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
(m.erase k).val.size ≤ m.val.size
theorem
Std.DHashMap.Internal.Raw₀.size_le_size_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.containsThenInsert_fst
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
{k : α}
{v : β k}
:
(m.containsThenInsert k v).fst = m.contains k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.containsThenInsert_snd
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
{k : α}
{v : β k}
:
(m.containsThenInsert k v).snd = m.insert k v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.containsThenInsertIfNew_fst
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
{k : α}
{v : β k}
:
(m.containsThenInsertIfNew k v).fst = m.contains k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.containsThenInsertIfNew_snd
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
{k : α}
{v : β k}
:
(m.containsThenInsertIfNew k v).snd = m.insertIfNew k v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.get?_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{a : α}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).get? a = none
theorem
Std.DHashMap.Internal.Raw₀.get?_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_eq_isSome_get?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
:
m.contains a = (m.get? a).isSome
theorem
Std.DHashMap.Internal.Raw₀.get?_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k : α}
:
(m.erase k).get? k = none
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_of_isEmpty
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
m.val.isEmpty = true → Std.DHashMap.Internal.Raw₀.Const.get? m a = none
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_insert
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get? (m.insert k v) a = if (k == a) = true then some v else Std.DHashMap.Internal.Raw₀.Const.get? m a
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_insert_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get? (m.insert k v) k = some v
theorem
Std.DHashMap.Internal.Raw₀.Const.contains_eq_isSome_get?
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
m.contains a = (Std.DHashMap.Internal.Raw₀.Const.get? m a).isSome
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_none
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
m.contains a = false → Std.DHashMap.Internal.Raw₀.Const.get? m a = none
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_erase
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
:
Std.DHashMap.Internal.Raw₀.Const.get? (m.erase k) a = if (k == a) = true then none else Std.DHashMap.Internal.Raw₀.Const.get? m a
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_erase_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
Std.DHashMap.Internal.Raw₀.Const.get? (m.erase k) k = none
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_get?
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[LawfulBEq α]
(h : m.val.WF)
{a : α}
:
Std.DHashMap.Internal.Raw₀.Const.get? m a = m.get? a
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_congr
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a b : α}
(hab : (a == b) = true)
:
theorem
Std.DHashMap.Internal.Raw₀.get_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k a : α}
{v : β k}
{h₁ : (m.insert k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.get_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k : α}
{v : β k}
:
(m.insert k v).get k ⋯ = v
theorem
Std.DHashMap.Internal.Raw₀.Const.get_insert
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
{h₁ : (m.insert k v).contains a = true}
:
Std.DHashMap.Internal.Raw₀.Const.get (m.insert k v) a h₁ = if h₂ : (k == a) = true then v else Std.DHashMap.Internal.Raw₀.Const.get m a ⋯
theorem
Std.DHashMap.Internal.Raw₀.Const.get_insert_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get (m.insert k v) k ⋯ = v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.Const.get_erase
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{h' : (m.erase k).contains a = true}
:
Std.DHashMap.Internal.Raw₀.Const.get (m.erase k) a h' = Std.DHashMap.Internal.Raw₀.Const.get m a ⋯
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_some_get
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{h✝ : m.contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get_eq_get
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[LawfulBEq α]
(h : m.val.WF)
{a : α}
{h✝ : m.contains a = true}
:
Std.DHashMap.Internal.Raw₀.Const.get m a h✝ = m.get a h✝
theorem
Std.DHashMap.Internal.Raw₀.get!_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
[Inhabited (β a)]
{b : β a}
:
(m.insert a b).get! a = b
theorem
Std.DHashMap.Internal.Raw₀.get!_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k : α}
[Inhabited (β k)]
:
(m.erase k).get! k = default
theorem
Std.DHashMap.Internal.Raw₀.get!_eq_get!_get?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
[Inhabited (β a)]
:
m.get! a = (m.get? a).get!
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_of_isEmpty
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
m.val.isEmpty = true → Std.DHashMap.Internal.Raw₀.Const.get! m a = default
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_insert
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k a : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get! (m.insert k v) a = if (k == a) = true then v else Std.DHashMap.Internal.Raw₀.Const.get! m a
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_insert_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get! (m.insert k v) k = v
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_eq_default
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
m.contains a = false → Std.DHashMap.Internal.Raw₀.Const.get! m a = default
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_erase
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k a : α}
:
Std.DHashMap.Internal.Raw₀.Const.get! (m.erase k) a = if (k == a) = true then default else Std.DHashMap.Internal.Raw₀.Const.get! m a
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_erase_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k : α}
:
Std.DHashMap.Internal.Raw₀.Const.get! (m.erase k) k = default
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_some_get!
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
m.contains a = true → Std.DHashMap.Internal.Raw₀.Const.get? m a = some (Std.DHashMap.Internal.Raw₀.Const.get! m a)
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_eq_get!_get?
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get_eq_get!
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
{h✝ : m.contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_eq_get!
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[LawfulBEq α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
Std.DHashMap.Internal.Raw₀.Const.get! m a = m.get! a
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_congr
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a b : α}
(hab : (a == b) = true)
:
theorem
Std.DHashMap.Internal.Raw₀.getD_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{a : α}
{fallback : β a}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).getD a fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.getD_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
{fallback b : β a}
:
(m.insert a b).getD a fallback = b
theorem
Std.DHashMap.Internal.Raw₀.getD_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k : α}
{fallback : β k}
:
(m.erase k).getD k fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.getD_eq_getD_get?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
{fallback : β a}
:
m.getD a fallback = (m.get? a).getD fallback
theorem
Std.DHashMap.Internal.Raw₀.get!_eq_getD_default
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{a : α}
[Inhabited (β a)]
:
m.get! a = m.getD a default
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_empty
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
{a : α}
{fallback : β}
{c : Nat}
:
Std.DHashMap.Internal.Raw₀.Const.getD (Std.DHashMap.Internal.Raw₀.empty c) a fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_of_isEmpty
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{fallback : β}
:
m.val.isEmpty = true → Std.DHashMap.Internal.Raw₀.Const.getD m a fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_insert
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{fallback v : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD (m.insert k v) a fallback = if (k == a) = true then v else Std.DHashMap.Internal.Raw₀.Const.getD m a fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_insert_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{fallback v : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD (m.insert k v) k fallback = v
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_eq_fallback
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{fallback : β}
:
m.contains a = false → Std.DHashMap.Internal.Raw₀.Const.getD m a fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_erase
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{fallback : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD (m.erase k) a fallback = if (k == a) = true then fallback else Std.DHashMap.Internal.Raw₀.Const.getD m a fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_erase_self
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{fallback : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD (m.erase k) k fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_some_getD
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{fallback : β}
:
m.contains a = true →
Std.DHashMap.Internal.Raw₀.Const.get? m a = some (Std.DHashMap.Internal.Raw₀.Const.getD m a fallback)
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_eq_getD_get?
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{fallback : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD m a fallback = (Std.DHashMap.Internal.Raw₀.Const.get? m a).getD fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.get_eq_getD
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{fallback : β}
{h✝ : m.contains a = true}
:
Std.DHashMap.Internal.Raw₀.Const.get m a h✝ = Std.DHashMap.Internal.Raw₀.Const.getD m a fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_eq_getD_default
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_eq_getD
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[LawfulBEq α]
(h : m.val.WF)
{a : α}
{fallback : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD m a fallback = m.getD a fallback
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_congr
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a b : α}
{fallback : β}
(hab : (a == b) = true)
:
Std.DHashMap.Internal.Raw₀.Const.getD m a fallback = Std.DHashMap.Internal.Raw₀.Const.getD m b fallback
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.getKey?_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{a : α}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).getKey? a = none
theorem
Std.DHashMap.Internal.Raw₀.getKey?_of_isEmpty
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_eq_isSome_getKey?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
m.contains a = (m.getKey? a).isSome
theorem
Std.DHashMap.Internal.Raw₀.getKey?_eq_none
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
(m.erase k).getKey? k = none
theorem
Std.DHashMap.Internal.Raw₀.getKey_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
{h₁ : (m.insert k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
(m.insert k v).getKey k ⋯ = k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.getKey_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{h' : (m.erase k).contains a = true}
:
(m.erase k).getKey a h' = m.getKey a ⋯
theorem
Std.DHashMap.Internal.Raw₀.getKey?_eq_some_getKey
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
{h✝ : m.contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{a : α}
[Inhabited α]
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).getKey! a = default
theorem
Std.DHashMap.Internal.Raw₀.getKey!_of_isEmpty
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
{b : β a}
:
(m.insert a b).getKey! a = a
theorem
Std.DHashMap.Internal.Raw₀.getKey!_eq_default
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{k a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{k : α}
:
(m.erase k).getKey! k = default
theorem
Std.DHashMap.Internal.Raw₀.getKey?_eq_some_getKey!
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_eq_get!_getKey?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
:
m.getKey! a = (m.getKey? a).get!
theorem
Std.DHashMap.Internal.Raw₀.getKey_eq_getKey!
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
{h✝ : m.contains a = true}
:
m.getKey a h✝ = m.getKey! a
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_empty
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
{a fallback : α}
{c : Nat}
:
(Std.DHashMap.Internal.Raw₀.empty c).getKeyD a fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_of_isEmpty
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_insert
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a fallback : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_insert_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
{b : β a}
:
(m.insert a b).getKeyD a fallback = a
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_eq_fallback
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_erase
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_erase_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k fallback : α}
:
(m.erase k).getKeyD k fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.getKey?_eq_some_getKeyD
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_eq_getD_getKey?
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
:
m.getKeyD a fallback = (m.getKey? a).getD fallback
theorem
Std.DHashMap.Internal.Raw₀.getKey_eq_getKeyD
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a fallback : α}
{h✝ : m.contains a = true}
:
m.getKey a h✝ = m.getKeyD a fallback
theorem
Std.DHashMap.Internal.Raw₀.getKey!_eq_getKeyD_default
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{a : α}
:
m.getKey! a = m.getKeyD a default
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_insertIfNew_self
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_of_contains_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_of_contains_insertIfNew'
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
This is a restatement of contains_insertIfNew
that is written to exactly match the proof
obligation in the statement of get_insertIfNew
.
theorem
Std.DHashMap.Internal.Raw₀.size_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.size_le_size_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
m.val.size ≤ (m.insertIfNew k v).val.size
theorem
Std.DHashMap.Internal.Raw₀.size_insertIfNew_le
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.get_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k a : α}
{v : β k}
{h₁ : (m.insertIfNew k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.get!_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k a : α}
[Inhabited (β a)]
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getD_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
(h : m.val.WF)
{k a : α}
{fallback : β a}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get? (m.insertIfNew k v) a = if (k == a) = true ∧ m.contains k = false then some v else Std.DHashMap.Internal.Raw₀.Const.get? m a
theorem
Std.DHashMap.Internal.Raw₀.Const.get_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
{h₁ : (m.insertIfNew k v).contains a = true}
:
Std.DHashMap.Internal.Raw₀.Const.get (m.insertIfNew k v) a h₁ = if h₂ : (k == a) = true ∧ m.contains k = false then v else Std.DHashMap.Internal.Raw₀.Const.get m a ⋯
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k a : α}
{v : β}
:
Std.DHashMap.Internal.Raw₀.Const.get! (m.insertIfNew k v) a = if (k == a) = true ∧ m.contains k = false then v else Std.DHashMap.Internal.Raw₀.Const.get! m a
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{fallback v : β}
:
Std.DHashMap.Internal.Raw₀.Const.getD (m.insertIfNew k v) a fallback = if (k == a) = true ∧ m.contains k = false then v else Std.DHashMap.Internal.Raw₀.Const.getD m a fallback
theorem
Std.DHashMap.Internal.Raw₀.getKey?_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β k}
{h₁ : (m.insertIfNew k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey!_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
[Inhabited α]
(h : m.val.WF)
{k a : α}
{v : β k}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_insertIfNew
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a fallback : α}
{v : β k}
:
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.getThenInsertIfNew?_fst
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
{k : α}
{v : β k}
:
(m.getThenInsertIfNew? k v).fst = m.get? k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.getThenInsertIfNew?_snd
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
{k : α}
{v : β k}
:
(m.getThenInsertIfNew? k v).snd = m.insertIfNew k v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.Const.getThenInsertIfNew?_fst
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
{k : α}
{v : β}
:
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.Const.getThenInsertIfNew?_snd
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Std.DHashMap.Internal.Raw₀ α fun (x : α) => β)
{k : α}
{v : β}
:
(Std.DHashMap.Internal.Raw₀.Const.getThenInsertIfNew? m k v).snd = m.insertIfNew k v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.length_keys
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
m.val.keys.length = m.val.size
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.isEmpty_keys
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
m.val.keys.isEmpty = m.val.isEmpty
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.contains_keys
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
m.val.keys.contains k = m.contains k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.mem_keys
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[LawfulBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
theorem
Std.DHashMap.Internal.Raw₀.distinct_keys
{α : Type u}
{β : α → Type v}
(m : Std.DHashMap.Internal.Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
List.Pairwise (fun (a b : α) => (a == b) = false) m.val.keys