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 < (empty c).val.buckets.size}
:
(empty c).val.buckets[i] = AssocList.nil
@[simp]
theorem
Std.DHashMap.Internal.Raw.buckets_empty
{α : Type u}
{β : α → Type v}
{c i : Nat}
{h : i < (Raw.empty c).buckets.size}
:
(Raw.empty c).buckets[i] = AssocList.nil
@[simp]
theorem
Std.DHashMap.Internal.Raw.buckets_emptyc
{α : Type u}
{β : α → Type v}
{i : Nat}
{h : i < ∅.buckets.size}
:
∅.buckets[i] = AssocList.nil
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
theorem
Std.DHashMap.Internal.Raw₀.size_le_size_insert
{α : Type u}
{β : α → Type v}
(m : 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_erase_le
{α : Type u}
{β : α → Type v}
(m : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
(m.erase k).val.size ≤ m.val.size
theorem
Std.DHashMap.Internal.Raw₀.Const.get_insert
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
{h₁ : (m.insert k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_eq_isSome_getKey?
{α : Type u}
{β : α → Type v}
(m : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{a : α}
:
m.contains a = (m.getKey? a).isSome
theorem
Std.DHashMap.Internal.Raw₀.getKey_insert
{α : Type u}
{β : α → Type v}
(m : 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 : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
{v : β k}
:
(m.insert k v).getKey k ⋯ = k
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_insert_self
{α : Type u}
{β : α → Type v}
(m : 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_erase_self
{α : Type u}
{β : α → Type v}
(m : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k fallback : α}
:
(m.erase k).getKeyD k fallback = fallback
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_eq_getD_getKey?
{α : Type u}
{β : α → Type v}
(m : 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₀.contains_of_contains_insertIfNew'
{α : Type u}
{β : α → Type v}
(m : 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_le_size_insertIfNew
{α : Type u}
{β : α → Type v}
(m : 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₀.Const.get_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{v : β}
{h₁ : (m.insertIfNew k v).contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
[Inhabited β]
(h : m.val.WF)
{k a : α}
{v : β}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_insertIfNew
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a : α}
{fallback v : β}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey_insertIfNew
{α : Type u}
{β : α → Type v}
(m : 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 : 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 : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k a fallback : α}
{v : β k}
:
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.Const.getThenInsertIfNew?_fst
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
{k : α}
{v : β}
:
(getThenInsertIfNew? m k v).fst = get? m k
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.Const.getThenInsertIfNew?_snd
{α : Type u}
[BEq α]
[Hashable α]
{β : Type v}
(m : Raw₀ α fun (x : α) => β)
{k : α}
{v : β}
:
(getThenInsertIfNew? m k v).snd = m.insertIfNew k v
@[simp]
theorem
Std.DHashMap.Internal.Raw₀.length_keys
{α : Type u}
{β : α → Type v}
(m : 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 : 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 : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
{k : α}
:
m.val.keys.contains k = m.contains k
theorem
Std.DHashMap.Internal.Raw₀.distinct_keys
{α : Type u}
{β : α → Type v}
(m : Raw₀ α β)
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.val.WF)
:
List.Pairwise (fun (a b : α) => (a == b) = false) m.val.keys