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: proof that all hash map operations preserve WFImp
to show WF.out : WF → WFImp
@[simp]
@[simp]
theorem
Std.DHashMap.Internal.computeSize_eq
{α : Type u}
{β : α → Type v}
{buckets : Array (AssocList α β)}
:
theorem
Std.DHashMap.Internal.Raw.fold_eq
{α : Type u}
{β : α → Type v}
{γ : Type w}
{l : Raw α β}
{f : γ → (a : α) → β a → γ}
{init : γ}
:
Raw.fold f init l = Array.foldl (fun (acc : γ) (l : AssocList α β) => AssocList.foldl f acc l) init l.buckets
theorem
Std.DHashMap.Internal.Raw.foldRev_eq
{α : Type u}
{β : α → Type v}
{γ : Type w}
{l : Raw α β}
{f : γ → (a : α) → β a → γ}
{init : γ}
:
Raw.foldRev f init l = Array.foldr (fun (l : AssocList α β) (acc : γ) => AssocList.foldr (fun (a : α) (b : β a) (g : γ) => f g a b) acc l)
init l.buckets
theorem
Std.DHashMap.Internal.Raw.foldRev_cons_apply
{α : Type u}
{β : α → Type v}
{γ : Type w}
{l : Raw α β}
{acc : List γ}
(f : (a : α) → β a → γ)
:
Raw.foldRev (fun (acc : List γ) (k : α) (v : β k) => f k v :: acc) acc l = List.map (fun (p : (a : α) × β a) => f p.fst p.snd) (toListModel l.buckets) ++ acc
theorem
Std.DHashMap.Internal.Raw.foldRev_cons
{α : Type u}
{β : α → Type v}
{l : Raw α β}
{acc : List ((a : α) × β a)}
:
Raw.foldRev (fun (acc : List ((a : α) × β a)) (k : α) (v : β k) => ⟨k, v⟩ :: acc) acc l = toListModel l.buckets ++ acc
theorem
Std.DHashMap.Internal.Raw.foldRev_cons_key
{α : Type u}
{β : α → Type v}
{l : Raw α β}
{acc : List α}
:
Raw.foldRev (fun (acc : List α) (k : α) (x : β k) => k :: acc) acc l = List.keys (toListModel l.buckets) ++ acc
theorem
Std.DHashMap.Internal.Raw.toList_perm_toListModel
{α : Type u}
{β : α → Type v}
{m : Raw α β}
:
m.toList.Perm (toListModel m.buckets)
theorem
Std.DHashMap.Internal.Raw.keys_perm_keys_toListModel
{α : Type u}
{β : α → Type v}
{m : Raw α β}
:
m.keys.Perm (List.keys (toListModel m.buckets))
theorem
Std.DHashMap.Internal.Raw.pairwise_keys_iff_pairwise_keys
{α : Type u}
{β : α → Type v}
[BEq α]
[PartialEquivBEq α]
{m : Raw α β}
:
List.Pairwise (fun (a b : α) => (a == b) = false) m.keys ↔ List.Pairwise (fun (a b : α) => (a == b) = false) (List.keys (toListModel m.buckets))
Raw₀.empty #
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_reinsertAux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(data : { d : Array (AssocList α β) // 0 < d.size })
(a : α)
(b : β a)
(h : IsHashSelf data.val)
:
IsHashSelf (reinsertAux hash data a b).val
expandIfNecessary #
theorem
Std.DHashMap.Internal.Raw₀.toListModel_reinsertAux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
(data : { d : Array (AssocList α β) // 0 < d.size })
(a : α)
(b : β a)
:
(toListModel (reinsertAux hash data a b).val).Perm (⟨a, b⟩ :: toListModel data.val)
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_foldl_reinsertAux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(l : List ((a : α) × β a))
(target : { d : Array (AssocList α β) // 0 < d.size })
:
IsHashSelf target.val →
IsHashSelf
(List.foldl
(fun (acc : { d : Array (AssocList α β) // 0 < d.size }) (p : (a : α) × β a) =>
reinsertAux hash acc p.fst p.snd)
target l).val
theorem
Std.DHashMap.Internal.Raw₀.toListModel_foldl_reinsertAux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
(l : List ((a : α) × β a))
(target : { d : Array (AssocList α β) // 0 < d.size })
:
(toListModel
(List.foldl
(fun (acc : { d : Array (AssocList α β) // 0 < d.size }) (p : (a : α) × β a) =>
reinsertAux hash acc p.fst p.snd)
target l).val).Perm
(l ++ toListModel target.val)
theorem
Std.DHashMap.Internal.Raw₀.expand.go_pos
{α : Type u}
{β : α → Type v}
[Hashable α]
{i : Nat}
{source : Array (AssocList α β)}
{target : { d : Array (AssocList α β) // 0 < d.size }}
(h : i < source.size)
:
go i source target = go (i + 1) (source.set i AssocList.nil h) (AssocList.foldl (reinsertAux hash) target source[i])
theorem
Std.DHashMap.Internal.Raw₀.toListModel_expandIfNecessary
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
(m : Raw₀ α β)
:
theorem
Std.DHashMap.Internal.Raw₀.wfImp_expandIfNecessary
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(h : Raw.WFImp m.val)
:
Access operations #
theorem
Std.DHashMap.Internal.Raw₀.containsₘ_eq_containsKey
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.contains_eq_containsKey
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?ₘ_eq_getKey?
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKey?_eq_getKey?
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyDₘ_eq_getKeyD
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.getKeyD_eq_getKeyD
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(hm : Raw.WFImp m.val)
{a fallback : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get?ₘ_eq_getValue?
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get?_eq_getValue?
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.getₘ_eq_getValue
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
{h : m.containsₘ a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get_eq_getValue
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
{h : m.contains a = true}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get!ₘ_eq_getValue!
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
[Inhabited β]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.get!_eq_getValue!
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
[Inhabited β]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.getDₘ_eq_getValueD
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
{fallback : β}
:
theorem
Std.DHashMap.Internal.Raw₀.Const.getD_eq_getValueD
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(hm : Raw.WFImp m.val)
{a : α}
{fallback : β}
:
replaceₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_replaceₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(h : Raw.WFImp m.val)
(a : α)
(b : β a)
:
(toListModel (m.replaceₘ a b).val.buckets).Perm (List.replaceEntry a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_replaceₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(h : Raw.WFImp m.val)
(a : α)
(b : β a)
:
IsHashSelf (m.replaceₘ a b).val.buckets
insertₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_consₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[PartialEquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(h : Raw.WFImp m.val)
(a : α)
(b : β a)
:
(toListModel (m.consₘ a b).val.buckets).Perm (⟨a, b⟩ :: toListModel m.val.buckets)
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_consₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(h : Raw.WFImp m.val)
(a : α)
(b : β a)
:
IsHashSelf (m.consₘ a b).val.buckets
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insertₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.insertₘ a b).val.buckets).Perm (List.insertEntry a b (toListModel m.val.buckets))
insert
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insert
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.insert a b).val.buckets).Perm (List.insertEntry a b (toListModel m.val.buckets))
alter
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_updateBucket_alter
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option (β a) → Option (β a)}
:
(toListModel (updateBucket m.val.buckets ⋯ a (AssocList.alter a f))).Perm
(List.alterKey a f (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_updateBucket_alter
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option (β a) → Option (β a)}
:
IsHashSelf (updateBucket m.val.buckets ⋯ a (AssocList.alter a f))
theorem
Std.DHashMap.Internal.Raw₀.wfImp_updateBucket_alter
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option (β a) → Option (β a)}
:
Raw.WFImp (withComputedSize (updateBucket m.val.buckets ⋯ a (AssocList.alter a f)))
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_updateBucket_alter
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option β → Option β}
:
(toListModel (updateBucket m.val.buckets ⋯ a (AssocList.Const.alter a f))).Perm
(List.Const.alterKey a f (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.Const.isHashSelf_updateBucket_alter
{α : Type u}
{β : Type v}
[BEq α]
[EquivBEq α]
[Hashable α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option β → Option β}
:
IsHashSelf (updateBucket m.val.buckets ⋯ a (AssocList.Const.alter a f))
theorem
Std.DHashMap.Internal.Raw₀.Const.wfImp_updateBucket_alter
{α : Type u}
{β : Type v}
[BEq α]
[EquivBEq α]
[Hashable α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option β → Option β}
:
Raw.WFImp (withComputedSize (updateBucket m.val.buckets ⋯ a (AssocList.Const.alter a f)))
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_alterₘ
{α : Type u}
{β : Type v}
[BEq α]
[EquivBEq α]
[Hashable α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option β → Option β}
:
(toListModel (alterₘ m a f).val.buckets).Perm (List.Const.alterKey a f (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_alter
{α : Type u}
{β : Type v}
[BEq α]
[EquivBEq α]
[Hashable α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
(h : Raw.WFImp m.val)
{a : α}
{f : Option β → Option β}
:
(toListModel (alter m a f).val.buckets).Perm (List.Const.alterKey a f (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.toListModel_modify
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{f : β a → β a}
:
(toListModel (m.modify a f).val.buckets).Perm (List.modifyKey a f (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_modify
{α : Type u}
{β : Type v}
{m : Raw₀ α fun (x : α) => β}
[BEq α]
[EquivBEq α]
[Hashable α]
[LawfulHashable α]
(h : Raw.WFImp m.val)
{a : α}
{f : β → β}
:
(toListModel (modify m a f).val.buckets).Perm (List.Const.modifyKey a f (toListModel m.val.buckets))
containsThenInsert
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_containsThenInsert
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.containsThenInsert a b).snd.val.buckets).Perm (List.insertEntry a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.wfImp_containsThenInsert
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
Raw.WFImp (m.containsThenInsert a b).snd.val
insertIfNewₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insertIfNewₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.insertIfNewₘ a b).val.buckets).Perm (List.insertEntryIfNew a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.wfImp_insertIfNewₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
Raw.WFImp (m.insertIfNewₘ a b).val
insertIfNew
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insertIfNew
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.insertIfNew a b).val.buckets).Perm (List.insertEntryIfNew a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.wfImp_insertIfNew
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
Raw.WFImp (m.insertIfNew a b).val
containsThenInsertIfNew
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_containsThenInsertIfNew
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
(toListModel (m.containsThenInsertIfNew a b).snd.val.buckets).Perm
(List.insertEntryIfNew a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.wfImp_containsThenInsertIfNew
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
(h : Raw.WFImp m.val)
{a : α}
{b : β a}
:
Raw.WFImp (m.containsThenInsertIfNew a b).snd.val
getThenInsertIfNew?
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_getThenInsertIfNew?
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[LawfulBEq α]
{m : Raw₀ α β}
{a : α}
{b : β a}
(h : Raw.WFImp m.val)
:
(toListModel (m.getThenInsertIfNew? a b).snd.val.buckets).Perm (List.insertEntryIfNew a b (toListModel m.val.buckets))
Const.getThenInsertIfNew?
#
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_getThenInsertIfNew?
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
{a : α}
{b : β}
(h : Raw.WFImp m.val)
:
(toListModel (getThenInsertIfNew? m a b).snd.val.buckets).Perm (List.insertEntryIfNew a b (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.Const.wfImp_getThenInsertIfNew?
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
{a : α}
{b : β}
(h : Raw.WFImp m.val)
:
Raw.WFImp (getThenInsertIfNew? m a b).snd.val
eraseₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_eraseₘaux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(a : α)
(h : Raw.WFImp m.val)
:
(toListModel (m.eraseₘaux a).val.buckets).Perm (List.eraseKey a (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_eraseₘaux
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(a : α)
(h : Raw.WFImp m.val)
:
IsHashSelf (m.eraseₘaux a).val.buckets
theorem
Std.DHashMap.Internal.Raw₀.toListModel_perm_eraseKey_of_containsₘ_eq_false
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(m : Raw₀ α β)
(a : α)
(h : Raw.WFImp m.val)
(h' : m.containsₘ a = false)
:
(toListModel m.val.buckets).Perm (List.eraseKey a (toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.toListModel_eraseₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
{a : α}
(h : Raw.WFImp m.val)
:
(toListModel (m.eraseₘ a).val.buckets).Perm (List.eraseKey a (toListModel m.val.buckets))
erase
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_erase
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
{a : α}
(h : Raw.WFImp m.val)
:
(toListModel (m.erase a).val.buckets).Perm (List.eraseKey a (toListModel m.val.buckets))
filterMapₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_filterMapₘ
{α : Type u}
{β : α → Type v}
{δ : α → Type w}
{m : Raw₀ α β}
{f : (a : α) → β a → Option (δ a)}
:
(toListModel (m.filterMapₘ f).val.buckets).Perm
(List.filterMap (fun (p : (a : α) × β a) => Option.map (fun (x : δ p.fst) => ⟨p.fst, x⟩) (f p.fst p.snd))
(toListModel m.val.buckets))
theorem
Std.DHashMap.Internal.Raw₀.isHashSelf_filterMapₘ
{α : Type u}
{β : α → Type v}
{δ : α → Type w}
[BEq α]
[Hashable α]
[ReflBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
{f : (a : α) → β a → Option (δ a)}
(h : Raw.WFImp m.val)
:
IsHashSelf (m.filterMapₘ f).val.buckets
filterMap
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_filterMap
{α : Type u}
{β : α → Type v}
{δ : α → Type w}
{m : Raw₀ α β}
{f : (a : α) → β a → Option (δ a)}
:
(toListModel (filterMap f m).val.buckets).Perm
(List.filterMap (fun (p : (a : α) × β a) => Option.map (fun (x : δ p.fst) => ⟨p.fst, x⟩) (f p.fst p.snd))
(toListModel m.val.buckets))
mapₘ
#
map
#
filterₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_filterₘ
{α : Type u}
{β : α → Type v}
{m : Raw₀ α β}
{f : (a : α) → β a → Bool}
:
(toListModel (m.filterₘ f).val.buckets).Perm
(List.filter (fun (p : (a : α) × β a) => f p.fst p.snd) (toListModel m.val.buckets))
filter
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_filter
{α : Type u}
{β : α → Type v}
{m : Raw₀ α β}
{f : (a : α) → β a → Bool}
:
(toListModel (filter f m).val.buckets).Perm
(List.filter (fun (p : (a : α) × β a) => f p.fst p.snd) (toListModel m.val.buckets))
insertListₘ
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insertListₘ
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
{l : List ((a : α) × β a)}
(h : Raw.WFImp m.val)
:
(toListModel (m.insertListₘ l).val.buckets).Perm (List.insertList (toListModel m.val.buckets) l)
insertMany
#
theorem
Std.DHashMap.Internal.Raw₀.toListModel_insertMany_list
{α : Type u}
{β : α → Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α β}
{l : List ((a : α) × β a)}
(h : Raw.WFImp m.val)
:
(toListModel (m.insertMany l).val.val.buckets).Perm (List.insertList (toListModel m.val.buckets) l)
Const.insertListₘ
#
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_insertListₘ
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
{l : List (α × β)}
(h : Raw.WFImp m.val)
:
(toListModel (insertListₘ m l).val.buckets).Perm (List.insertListConst (toListModel m.val.buckets) l)
Const.insertMany
#
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_insertMany_list
{α : Type u}
{β : Type v}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => β}
{l : List (α × β)}
(h : Raw.WFImp m.val)
:
(toListModel (insertMany m l).val.val.buckets).Perm (List.insertListConst (toListModel m.val.buckets) l)
Const.insertListIfNewUnitₘ
#
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_insertListIfNewUnitₘ
{α : Type u}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => Unit}
{l : List α}
(h : Raw.WFImp m.val)
:
(toListModel (insertListIfNewUnitₘ m l).val.buckets).Perm (List.insertListIfNewUnit (toListModel m.val.buckets) l)
Const.insertManyIfNewUnit
#
theorem
Std.DHashMap.Internal.Raw₀.Const.toListModel_insertManyIfNewUnit_list
{α : Type u}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
{m : Raw₀ α fun (x : α) => Unit}
{l : List α}
(h : Raw.WFImp m.val)
:
(toListModel (insertManyIfNewUnit m l).val.val.buckets).Perm (List.insertListIfNewUnit (toListModel m.val.buckets) l)