- inner : Std.ExtDHashMap α fun (x : α) => β
Instances For
@[instance_reducible]
instance
instInhabitedMap
{a✝ : Type u_1}
{a✝¹ : Type u_2}
{a✝² : DecidableEq a✝}
{a✝³ : Hashable a✝}
:
Equations
- instInhabitedMap = { default := instInhabitedMap.default }
@[instance_reducible]
instance
Map.instEmptyCollection
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
EmptyCollection (Map α β)
Equations
- Map.instEmptyCollection = { emptyCollection := Map.empty }
@[instance_reducible]
Equations
- Map.instInsertProd = { insert := Map.insertP }
def
Map.ofList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(xs : List (α × β))
:
Map α β
Equations
- Map.ofList xs = { inner := Std.ExtDHashMap.ofList (List.map Prod.toSigma xs) }
Instances For
@[instance_reducible]
instance
Map.instMembership
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
Membership α (Map α β)
Equations
- Map.instMembership = { mem := Map.mem }
@[instance_reducible]
instance
Map.instDecidableMem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
:
Equations
@[instance_reducible]
instance
Map.instDecidableMem_1
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
:
Equations
theorem
Map.get?_eq_none_of_not_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
(h : i ∉ mp)
:
theorem
Map.get?_map
{α : Type u}
{β : Type v}
{γ : Type w}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{f : α → β → γ}
{i : α}
:
def
Map.toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : Map α β)
:
Equations
- mp.toList = Std.ExtDHashMap.lift (fun (m : Std.DHashMap α fun (i : α) => β) => List.map Sigma.toProd m.toSortedList) ⋯ mp.inner
Instances For
@[simp]
theorem
Map.toList_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
:
theorem
Map.eq_empty_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
:
@[simp]
theorem
Map.not_mem_empty'
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
@[simp]
theorem
Map.not_mem_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
i ∉ ∅
@[simp]
@[simp]
theorem
Map.mem_range
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Fintype α]
{f : α → β}
{i : α}
:
@[simp]
theorem
Map.nodup_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
:
@[simp]
theorem
Map.pairwise_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
:
List.Pairwise (fun (x1 x2 : α × β) => x1.1 ≤ x2.1) mp.toList
@[simp]
theorem
Map.mem_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
{x : α × β}
:
@[simp]
theorem
Map.toList_eq_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : Map α β}
:
@[simp]
theorem
Map.toList_eq_nil_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
:
@[instance_reducible]
instance
Map.instDecidableEq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hh : DecidableEq β]
:
DecidableEq (Map α β)
def
Map.values
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : Map α β)
:
List β
Instances For
@[simp]
theorem
Map.all_def
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
{p : α → β → Bool}
:
def
Map.modifyMany
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : Map α β)
(xs : List (α × (β → β)))
:
Map α β
Equations
- mp.modifyMany xs = { inner := mp.inner.modifyMany (List.map (fun (x : α × (β → β)) => x.toSigma) xs) }
Instances For
@[simp]
theorem
Map.modifyMany_nil
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
:
@[simp]
theorem
Map.modifyMany_cons
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
{x : β → β}
{xs : List (α × (β → β))}
:
def
Map.insertMany
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : Map α β)
(xs : List (α × β))
:
Map α β
Equations
- mp.insertMany xs = { inner := mp.inner.insertMany (List.map (fun (x : α × β) => x.toSigma) xs) }
Instances For
@[simp]
theorem
Map.insertMany_nil
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
:
@[simp]
theorem
Map.insertMany_cons
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
{x : β}
{xs : List (α × β)}
:
@[simp]
theorem
Map.mem_values
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[LinearOrder α]
{x : β}
:
@[instance_reducible]
instance
Map.instFintype
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Fintype α]
[hb : Fintype β]
:
Equations
- Map.instFintype = { elems := Finset.map { toFun := Map.mk, inj' := ⋯ } Fintype.elems, complete := ⋯ }
instance
Map.instFinite
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Finite α]
[hb : Finite β]
:
theorem
Map.fold_eq_foldl_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{γ : Type u_1}
{z : γ}
{f : γ → α → β → γ}
{h_assoc : ∀ {acc : γ} {i : α} {x : β} {j : α} {y : β}, i ≠ j → f (f acc i x) j y = f (f acc j y) i x}
:
theorem
Map.eq_iff_toList_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{m₁ m₂ : Map α β}
:
@[simp]
theorem
Map.ofList_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
theorem
Map.toList_ofList_perm
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{xs : List (α × β)}
(h : (List.map (fun (x : α × β) => x.1) xs).Nodup)
:
@[simp]
theorem
Map.sortedLE_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.sortedLT_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
theorem
Map.keys_eq_map_fst_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
def
Map.minKey?
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : Map α β)
:
Option α
Instances For
def
Map.maxKey?
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : Map α β)
:
Option α
Instances For
def
Map.minKey!
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
[Inhabited α]
(mp : Map α β)
:
α
Instances For
def
Map.maxKey!
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
[Inhabited α]
(mp : Map α β)
:
α
Instances For
theorem
Map.minKey?_eq_head?_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
theorem
Map.maxKey?_eq_getLast?_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.minKey?_eq_none_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.maxKey?_eq_none_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
theorem
Map.not_mem_of_lt_minKey?
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.minKey? = some m)
(h₂ : x < m)
:
x ∉ mp
theorem
Map.not_mem_of_maxKey?_lt
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.maxKey? = some m)
(h₂ : m < x)
:
x ∉ mp
theorem
Map.not_mem_of_lt_minKey!
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x < mp.minKey!)
:
x ∉ mp
theorem
Map.not_mem_of_maxKey!_lt
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : mp.maxKey! < x)
:
x ∉ mp
theorem
Map.minKey?_le_of_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.minKey? = some m)
(h₂ : x ∈ mp)
:
theorem
Map.le_maxKey?_of_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.maxKey? = some m)
(h₂ : x ∈ mp)
:
theorem
Map.minKey!_le_of_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x ∈ mp)
:
theorem
Map.le_maxKey!_of_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x ∈ mp)
:
theorem
Map.fold_insert
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{γ : Type u_1}
{f : γ → α → β → γ}
{z : γ}
{h : ∀ {acc : γ} {i : α} {x : β} {j : α} {y : β}, i ≠ j → f (f acc i x) j y = f (f acc j y) i x}
{i : α}
{x : β}
(h₁ : i ∉ mp)
:
def
Map.filter
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : Map α β)
(p : α → β → Bool)
:
Map α β
Instances For
@[simp]
theorem
Map.count_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{p : α → β → Bool}
:
@[simp]
theorem
Map.length_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
theorem
Map.mem_iff_mem_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{k : α}
:
@[simp]
theorem
Map.modifyMany_snoc
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{xs : List (α × (β → β))}
{i : α}
{f : β → β}
:
@[simp]
theorem
Map.modify_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
{f : β → β}
:
@[simp]
theorem
Map.mem_mk_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Std.ExtDHashMap α fun (x : α) => β}
{i : α}
:
theorem
Map.modify_of_notMem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
{i : α}
{f : β → β}
(h : i ∉ mp)
:
@[simp]
theorem
Map.toList_mk
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{mp : Std.ExtDHashMap α fun (x : α) => β}
:
theorem
Map.values_insert_perm_of_notMem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{i : α}
{x : β}
(h : i ∉ mp)
:
theorem
Map.countP_values_modify_eq_of
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{p : β → Bool}
{i : α}
{f : β → β}
(h : ∀ (x : β), p (f x) = p x)
:
theorem
Map.countP_values_modifyMany_eq_of
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{p : β → Bool}
{xs : List (α × (β → β))}
(h : ∀ (k : α) (f : β → β) (x : β), (k, f) ∈ xs → p (f x) = p x)
:
@[simp]
theorem
Map.nodup_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.mem_keys_iff_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{k : α}
:
@[simp]
theorem
Map.length_keys
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.keys_modify
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{i : α}
{f : β → β}
:
@[simp]
theorem
Map.pairwise_toList'
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
List.Pairwise (fun (x1 x2 : α × β) => x1.1 < x2.1) mp.toList
theorem
Map.values_eq_map_snd_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
:
def
Map.keyIdx
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : Map α β)
(i : α)
:
Equations
- mp.keyIdx i = List.idxOf i mp.keys
Instances For
theorem
Map.keyIdx_lt_size
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{i : α}
(h : i ∈ mp)
:
theorem
Map.values_modify_eq_list_modify
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{i : α}
{f : β → β}
(h : i ∈ mp)
:
theorem
Map.countP_values_modify_eq_ite_of_get?
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{p : β → Bool}
{i : α}
{x : β}
{f : β → β}
(h : get? i mp = some x)
:
@[instance_reducible]
Equations
- Map.instUnion = { union := Map.union }
theorem
Map.union_def
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m₁ m₂ : Map α β}
:
@[simp]
@[simp]
theorem
Map.empty_union
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
:
@[simp]
theorem
Map.union_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
:
@[simp]
theorem
Map.get?_mk
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Std.ExtDHashMap α fun (x : α) => β}
{i : α}
:
@[simp]
theorem
Map.inner_ofList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{xs : List (α × β)}
:
theorem
Map.get?_ofList_of_nodup
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{xs : List (α × β)}
{i : α}
(h : (List.map (fun (x : α × β) => x.1) xs).Nodup)
:
get? i (ofList xs) = Option.map (fun (x : α × β) => x.2) (List.find? (fun (x : α × β) => decide (x.1 = i)) xs)
theorem
Map.get!_ofList_of_nodup
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : Inhabited β]
{xs : List (α × β)}
{i : α}
(h : (List.map (fun (x : α × β) => x.1) xs).Nodup)
:
get! i (ofList xs) = (Option.map (fun (x : α × β) => x.2) (List.find? (fun (x : α × β) => decide (x.1 = i)) xs)).get!
@[simp]
theorem
Map.keys_mk
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{mp : Std.ExtDHashMap α fun (x : α) => β}
:
@[simp]
theorem
Map.insert_mk
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Std.ExtDHashMap α fun (x : α) => β}
{i : α}
{x : β}
:
@[simp]
theorem
Map.erase_mk
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Std.ExtDHashMap α fun (x : α) => β}
{i : α}
:
@[simp]
theorem
Map.union_self
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
:
@[instance_reducible]
Equations
- Map.instSDiff = { sdiff := Map.diff }
theorem
Map.diff_def
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m₁ m₂ : Map α β}
:
theorem
Map.toList_ofList_subset
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{xs : List (α × β)}
:
theorem
Map.mem_of_mem_toList_ofList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{xs : List (α × β)}
{p : α × β}
(h : p ∈ (ofList xs).toList)
:
theorem
Map.ofList_eq_foldl
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{xs : List (α × β)}
:
theorem
Map.keys_insert_of_mem
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : Map α β}
[ha : LinearOrder α]
{i : α}
{x : β}
(h : i ∈ mp)
:
@[simp]
theorem
Map.keys_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
: