structure
DMap
(α : Type u)
(β : α → Type v)
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
Type (max u v)
- inner : Std.ExtDHashMap α β
Instances For
@[instance_reducible]
instance
instInhabitedDMap
{a✝ : Type u_1}
{a✝¹ : a✝ → Type u_2}
{a✝² : DecidableEq a✝}
{a✝³ : Hashable a✝}
:
Equations
- instInhabitedDMap = { default := instInhabitedDMap.default }
Equations
- DMap.empty = { inner := ∅ }
Instances For
@[instance_reducible]
instance
DMap.instEmptyCollection
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
EmptyCollection (DMap α β)
Equations
- DMap.instEmptyCollection = { emptyCollection := DMap.empty }
def
DMap.insertP
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(x : (i : α) × β i)
(mp : DMap α β)
:
DMap α β
Instances For
@[instance_reducible]
instance
DMap.instInsertSigma
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
Equations
- DMap.instInsertSigma = { insert := DMap.insertP }
def
DMap.ofList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(xs : List ((i : α) × β i))
:
DMap α β
Equations
- DMap.ofList xs = { inner := Std.ExtDHashMap.ofList xs }
Instances For
@[instance_reducible]
instance
DMap.instMembership
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
:
Membership α (DMap α β)
Equations
- DMap.instMembership = { mem := DMap.mem }
@[instance_reducible]
instance
DMap.instDecidableMem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{i : α}
:
Equations
@[instance_reducible]
instance
DMap.instDecidableMem_1
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{i : α}
:
Equations
theorem
DMap.get?_eq_none_of_not_mem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{i : α}
(h : i ∉ mp)
:
theorem
DMap.get?_map
{α : Type u}
{β : α → Type v}
{γ : α → Type w}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{f : (i : α) → β i → γ i}
{i : α}
:
def
DMap.toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : DMap α β)
:
List ((i : α) × β i)
Equations
Instances For
@[simp]
theorem
DMap.toList_empty
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
:
theorem
DMap.eq_empty_iff
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
:
@[simp]
theorem
DMap.not_mem_empty'
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
@[simp]
theorem
DMap.not_mem_empty
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
i ∉ ∅
@[simp]
theorem
DMap.get?_empty
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
def
DMap.range
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Fintype α]
(f : (i : α) → β i)
:
DMap α β
Equations
- DMap.range f = { inner := Std.ExtDHashMap.range f }
Instances For
@[simp]
theorem
DMap.mem_range
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Fintype α]
{f : (i : α) → β i}
{i : α}
:
@[simp]
theorem
DMap.nonempty_insert
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{x : (i : α) × β i}
:
@[simp]
theorem
DMap.nodup_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[LinearOrder α]
:
@[simp]
theorem
DMap.pairwise_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[LinearOrder α]
:
List.Pairwise (fun (x1 x2 : (i : α) × β i) => x1.fst ≤ x2.fst) mp.toList
@[simp]
theorem
DMap.toList_eq_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[LinearOrder α]
{m₁ m₂ : DMap α β}
:
@[simp]
theorem
DMap.toList_eq_nil_iff
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[LinearOrder α]
:
@[instance_reducible]
instance
DMap.instDecidableEq
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hh : (i : α) → DecidableEq (β i)]
:
DecidableEq (DMap α β)
def
DMap.modifyMany
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : DMap α β)
(xs : List ((i : α) × (β i → β i)))
:
DMap α β
Equations
- mp.modifyMany xs = { inner := mp.inner.modifyMany xs }
Instances For
@[simp]
theorem
DMap.modifyMany_nil
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
:
@[simp]
theorem
DMap.modifyMany_cons
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{i : α}
{x : β i → β i}
{xs : List ((i : α) × (β i → β i))}
:
def
DMap.insertMany
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : DMap α β)
(xs : List ((i : α) × β i))
:
DMap α β
Equations
- mp.insertMany xs = { inner := mp.inner.insertMany xs }
Instances For
@[simp]
theorem
DMap.insertMany_nil
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
:
@[simp]
theorem
DMap.insertMany_cons
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{i : α}
{x : β i}
{xs : List ((i : α) × β i)}
:
@[instance_reducible]
instance
DMap.instFintype
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Fintype α]
[hb : (i : α) → Fintype (β i)]
:
Equations
- DMap.instFintype = { elems := Finset.map { toFun := DMap.mk, inj' := ⋯ } Fintype.elems, complete := ⋯ }
instance
DMap.instFinite
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : Finite α]
[hb : ∀ (i : α), Finite (β i)]
:
theorem
DMap.fold_eq_foldl_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{γ : Type u_1}
{z : γ}
{f : γ → (i : α) → β i → γ}
{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}
:
theorem
DMap.eq_iff_toList_eq
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{m₁ m₂ : DMap α β}
:
@[simp]
theorem
DMap.ofList_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
theorem
DMap.toList_ofList_perm
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{xs : List ((i : α) × β i)}
(h : (List.map (fun (x : (i : α) × β i) => x.fst) xs).Nodup)
:
@[simp]
theorem
DMap.sortedLE_keys
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
@[simp]
theorem
DMap.sortedLT_keys
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
theorem
DMap.keys_eq_map_fst_toList
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
def
DMap.minKey?
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : DMap α β)
:
Option α
Instances For
def
DMap.maxKey?
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
(mp : DMap α β)
:
Option α
Instances For
def
DMap.minKey!
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
[Inhabited α]
(mp : DMap α β)
:
α
Instances For
def
DMap.maxKey!
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
[Inhabited α]
(mp : DMap α β)
:
α
Instances For
theorem
DMap.minKey?_eq_head?_keys
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
theorem
DMap.maxKey?_eq_getLast?_keys
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
@[simp]
theorem
DMap.minKey?_eq_none_iff
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
@[simp]
theorem
DMap.maxKey?_eq_none_iff
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
:
theorem
DMap.not_mem_of_lt_minKey?
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.minKey? = some m)
(h₂ : x < m)
:
x ∉ mp
theorem
DMap.not_mem_of_maxKey?_lt
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.maxKey? = some m)
(h₂ : m < x)
:
x ∉ mp
theorem
DMap.not_mem_of_lt_minKey!
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x < mp.minKey!)
:
x ∉ mp
theorem
DMap.not_mem_of_maxKey!_lt
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : mp.maxKey! < x)
:
x ∉ mp
theorem
DMap.minKey?_le_of_mem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.minKey? = some m)
(h₂ : x ∈ mp)
:
theorem
DMap.le_maxKey?_of_mem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{m x : α}
(h₁ : mp.maxKey? = some m)
(h₂ : x ∈ mp)
:
theorem
DMap.minKey!_le_of_mem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x ∈ mp)
:
theorem
DMap.le_maxKey!_of_mem
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha₁ : Inhabited α]
[ha₂ : LinearOrder α]
{x : α}
(h : x ∈ mp)
:
theorem
DMap.fold_insert
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
{γ : Type u_1}
{f : γ → (i : α) → β i → γ}
{z : γ}
{h : ∀ {acc : γ} {i : α} {x : β i} {j : α} {y : β j}, i ≠ j → f (f acc i x) j y = f (f acc j y) i x}
{i : α}
{x : β i}
(h₁ : i ∉ mp)
:
def
DMap.filter
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
(mp : DMap α β)
(p : (i : α) → β i → Bool)
:
DMap α β
Instances For
@[simp]
theorem
DMap.count_empty
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{p : (i : α) → β i → Bool}
:
theorem
DMap.mem_iff_mem_keys
{α : Type u}
{β : α → Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{mp : DMap α β}
[ha : LinearOrder α]
{k : α}
: