@[simp]
theorem
Std.DHashMap.nodup_toList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
:
@[simp]
theorem
Std.DHashMap.ofList_toList_equiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
:
@[instance_reducible]
instance
Std.DHashMap.instHasEquiv_projects
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
Equations
theorem
Std.DHashMap.equiv_def
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m₁ m₂ : DHashMap α β}
:
def
Std.DHashMap.toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
(m : DHashMap α β)
:
List ((i : α) × β i)
Equations
Instances For
theorem
Std.DHashMap.toSortedList_eq_of
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
(h : m₁.Equiv m₂)
:
@[simp]
theorem
Std.DHashMap.toSortedList_eq
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
:
@[simp]
theorem
Std.DHashMap.nodup_toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.pairwise_toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
List.Pairwise (fun (x1 x2 : (i : α) × β i) => x1.fst ≤ x2.fst) mp.toSortedList
theorem
Std.DHashMap.fold_assoc_aux
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{γ : Type u_4}
{m₁ m₂ : DHashMap α β}
{xs ys : List ((a : α) × β a)}
{f : γ → (i : α) → β i → γ}
(h : ∀ {acc : γ} {i : α} {x : β i} {j : α} {y : β j}, i ≠ j → f (f acc i x) j y = f (f acc j y) i x)
(hx : m₁.toList = xs)
(hy : m₂.toList = ys)
{acc : γ}
{x y : (a : α) × β a}
:
theorem
Std.DHashMap.fold_eq_fold_of_equiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{γ : Type u_4}
{f : γ → (i : α) → β i → γ}
{z : γ}
{m₁ m₂ : DHashMap α β}
(h_assoc : ∀ {acc : γ} {i : α} {x : β i} {j : α} {y : β j}, i ≠ j → f (f acc i x) j y = f (f acc j y) i x)
(h : m₁.Equiv m₂)
:
def
Std.DHashMap.decideEquiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[(i : α) → DecidableEq (β i)]
(m₁ m₂ : DHashMap α β)
:
Equations
Instances For
theorem
Std.DHashMap.equiv_iff_decideEquiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : (i : α) → DecidableEq (β i)]
{m₁ m₂ : DHashMap α β}
:
@[instance_reducible]
instance
Std.DHashMap.instDecidableEquivOfDecidableEq_projects
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hh : (i : α) → DecidableEq (β i)]
{m₁ m₂ : DHashMap α β}
:
Equations
- Std.DHashMap.instDecidableEquivOfDecidableEq_projects = match h : m₁.decideEquiv m₂ with | true => isTrue ⋯ | false => isFalse ⋯
@[simp]
theorem
Std.DHashMap.decideEquiv_eq
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hh : (i : α) → DecidableEq (β i)]
{m₁ m₂ : DHashMap α β}
:
def
Std.DHashMap.toSortedKeys
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
(m : DHashMap α β)
:
List α
Equations
- m.toSortedKeys = List.map (fun (x : (i : α) × β i) => x.fst) m.toSortedList
Instances For
@[simp]
theorem
Std.DHashMap.nodup_toSortedKeys
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.sortedLE_toSortedKeys
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.toSortedList_perm_toList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
mp.toSortedList.Perm mp.toList
@[simp]
theorem
Std.DHashMap.toList_perm_toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
mp.toList.Perm mp.toSortedList
@[simp]
theorem
Std.DHashMap.mem_toSortedList_iff
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
{x : (i : α) × β i}
[LinearOrder α]
:
theorem
Std.DHashMap.equiv_iff_toSortedList_perm
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
:
@[simp]
theorem
Std.DHashMap.nodup_map_fst_toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
(List.map (fun (x : (i : α) × β i) => x.fst) mp.toSortedList).Nodup
@[simp]
theorem
Std.DHashMap.mem_toSortedKeys
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
{i : α}
[LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.toSortedList_perm_iff
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
:
theorem
Std.DHashMap.toSortedKeys_eq_of_equiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
(h : m₁.Equiv m₂)
:
@[simp]
theorem
Std.DHashMap.toSortedKeys_eq_iff_of_subsingleton
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DHashMap α β}
[hb : ∀ (i : α), Subsingleton (β i)]
:
@[simp]
theorem
Std.DHashMap.toSortedList_eq_nil_iff
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.toSortedKeys_eq_nil_iff
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[LinearOrder α]
:
def
Std.DHashMap.modifyMany
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : DHashMap α β)
:
Equations
- mp.modifyMany [] = mp
- mp.modifyMany (⟨i, f⟩ :: xs) = (mp.modify i f).modifyMany xs
Instances For
theorem
Std.DHashMap.modifyMany_equiv_modifyMany_of_equiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m₁ m₂ : DHashMap α β}
{xs : List ((i : α) × (β i → β i))}
(h : m₁.Equiv m₂)
:
(m₁.modifyMany xs).Equiv (m₂.modifyMany xs)
theorem
Std.DHashMap.ofList_equiv_ofList_of_nodup_and_perm
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{xs ys : List ((i : α) × β i)}
(hx : (List.map (fun (x : (i : α) × β i) => x.fst) xs).Nodup)
(hy : (List.map (fun (x : (i : α) × β i) => x.fst) ys).Nodup)
(h : xs.Perm ys)
:
@[simp]
theorem
Std.DHashMap.ofList_toSortedList_equiv
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[ha : LinearOrder α]
:
(ofList mp.toSortedList).Equiv mp
theorem
Std.DHashMap.Internal.distinctKeys_def
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
{xs : List ((i : α) × β i)}
:
Internal.List.DistinctKeys xs ↔ List.Pairwise (fun (a b : α) => (a == b) = false) (Internal.List.keys xs)
theorem
Std.DHashMap.Internal.distinctKeys_iff
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
{xs : List ((i : α) × β i)}
:
def
Std.DHashMap.Internal.AssocList.foldlWith
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
{γ : Sort u_4}
(xs : AssocList α β)
(f : γ → (i : α) → (x : β i) → getCast? i xs = some x → γ)
(z : γ)
(h : (List.map (fun (x : (a : α) × β a) => x.fst) xs.toList).Nodup)
:
γ
Equations
- Std.DHashMap.Internal.AssocList.nil.foldlWith f_2 z h_2 = z
- (Std.DHashMap.Internal.AssocList.cons i x ys).foldlWith f_2 z h_2 = ys.foldlWith (fun (acc : γ) (j : α) (y : β j) (h₂ : Std.DHashMap.Internal.AssocList.getCast? j ys = some y) => f_2 acc j y ⋯) (f_2 z i x ⋯) ⋯
Instances For
theorem
Std.DHashMap.Internal.foldlWith_eq_foldl
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
{γ : Type u_4}
[hb : (i : α) → DecidableEq (β i)]
{xs : AssocList α β}
{f : γ → (i : α) → (x : β i) → AssocList.getCast? i xs = some x → γ}
{z : γ}
(h : (List.map (fun (x : (a : α) × β a) => x.fst) xs.toList).Nodup)
:
xs.foldlWith f z h = AssocList.foldl (fun (acc : γ) (i : α) (x : β i) => if h : AssocList.getCast? i xs = some x then f acc i x h else z) z
xs
@[simp]
theorem
Std.DHashMap.Raw.fold_empty
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{γ : Type u_4}
{z : γ}
{f : γ → (i : α) → β i → γ}
:
theorem
Std.DHashMap.ind
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{p : DHashMap α β → Prop}
(h₁ : ∀ (mp : DHashMap α β), mp.isEmpty = true → p mp)
(h₂ : ∀ (mp₁ mp₂ : DHashMap α β) (i : α) (x : β i), i ∉ mp₁ → (mp₁.insert i x).Equiv mp₂ → p mp₁ → p mp₂)
(mp : DHashMap α β)
:
p mp
@[simp]
theorem
Std.DHashMap.fold_empty
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{γ : Type u_4}
{f : γ → (i : α) → β i → γ}
{z : γ}
:
theorem
Std.DHashMap.filter_insert_equiv_of_not_mem
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
{p : (a : α) → β a → Bool}
{i : α}
{x : β i}
(h : i ∉ mp)
:
theorem
Std.DHashMap.get?_eq_some_iff_toList_eq_append
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
{i : α}
{x : β i}
:
@[simp]
theorem
Std.DHashMap.count_empty
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{p : (i : α) → β i → Bool}
:
@[simp]
theorem
Std.DHashMap.length_toSortedList
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Std.DHashMap.length_toSortedKeys
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
[ha : LinearOrder α]
:
theorem
Std.DHashMap.Raw.of_getCast?_eq_some
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
{xs : Internal.AssocList α β}
{k : α}
{x : β k}
(h : Internal.AssocList.getCast? k xs = some x)
:
@[simp]
theorem
Std.DHashMap.empty_union
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
:
@[simp]
theorem
Std.DHashMap.union_empty
{α : Type u_1}
{β : α → Type u_2}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DHashMap α β}
: