@[simp]
theorem
Map.toList_erase
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
{i : α}
:
@[simp]
theorem
Map.le_sum_values_of_get?_eq_some
{α : Type u}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{m : Map α ℕ}
{i : α}
{x : ℕ}
(h : get? i m = some x)
:
@[simp]
theorem
Map.sum_values_push
{α : Type u}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
{m : Map α ℕ}
{x : α}
:
class
Map.HasNoVal
{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[Hashable α]
(x : β)
(m : Map α β)
:
- not_mem_values' : x ∉ m.values
Instances
def
Map.ofListD
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : DecidableEq β]
(x : β)
(xs : List (α × β))
:
Map α β
Equations
- Map.ofListD x xs = Map.ofList (List.filter (fun (x_1 : α × β) => decide (x_1.2 ≠ x)) xs)
Instances For
def
Map.insertD
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : DecidableEq β]
(x : β)
(m : Map α β)
(i : α)
(y : β)
:
Map α β
Instances For
instance
Map.instHasNoValOfListD
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : DecidableEq β]
{x : β}
{xs : List (α × β)}
:
instance
Map.instHasNoValInsertD
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i : α}
{x y : β}
[h : HasNoVal x m]
:
instance
Map.instHasNoValErase
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{i : α}
{x : β}
[h : HasNoVal x m]
:
theorem
Map.HasNoVal.not_mem_values
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
{x : β}
[h : HasNoVal x m]
:
x ∉ m.values
theorem
Map.get?_eq_find?_toList
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
{i : α}
:
get? i m = Option.map (fun (x : α × β) => x.2) (List.find? (fun (x : α × β) => decide (x.1 = i)) m.toList)
theorem
Map.get?_eq_find?_toList_ext
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[ha : LinearOrder α]
:
get? = fun (i : α) (m : Map α β) =>
Option.map (fun (x : α × β) => x.2) (List.find? (fun (x : α × β) => decide (x.1 = i)) m.toList)
@[simp]
theorem
Map.insertD_insertD_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i : α}
{x y z : β}
:
@[simp]
theorem
Map.ofListD_nil
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : DecidableEq β]
{x : β}
:
@[simp]
theorem
Map.getD_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{x : β}
{i : α}
:
@[simp]
@[simp]
theorem
Map.getD_insert_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{x : β}
{i : α}
{y : β}
:
@[simp]
theorem
Map.insertD_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{x : β}
{i : α}
:
@[simp]
theorem
Map.erase_insertD_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{x : β}
{i : α}
{y : β}
:
@[simp]
theorem
Map.erase_eq_self_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{i : α}
:
@[simp]
theorem
Map.erase_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{i : α}
:
@[simp]
theorem
Map.ofListD_zip_replicte
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
[hb : DecidableEq β]
{x : β}
{xs : List α}
{n : ℕ}
:
theorem
Map.erase_eq_self_of
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{i : α}
(h : i ∉ m)
:
@[simp]
theorem
Map.get?_insertD_of_ne
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i j : α}
{x y : β}
(h : i ≠ j)
:
@[simp]
theorem
Map.getD_insertD_of_ne
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i j : α}
{x y : β}
(h : i ≠ j)
:
@[simp]
theorem
Map.getD_insertD_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i : α}
{x y : β}
:
@[simp]
theorem
Map.keys_eq_nil_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
:
@[simp]
theorem
Map.nil_eq_keys_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
:
theorem
Map.insertD_comm
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i j : α}
{x y z : β}
(h : i ≠ j)
:
theorem
Map.insertD_of_ne
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i : α}
{x y : β}
(h : y ≠ x)
:
theorem
Map.forall_get?_ne_some_iff
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[ha : LinearOrder α]
{x : β}
:
@[simp]
instance
Map.hasNoVal_empty
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{x : β}
:
instance
Map.hasNoVal_insertD
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{x y : β}
{i : α}
[h : HasNoVal x m]
:
instance
Map.hasNoVal_erase
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{x : β}
{i : α}
[h : HasNoVal x m]
:
theorem
Map.getD_insertD_of_eq'
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
[hb : DecidableEq β]
{i j : α}
{x y : β}
(h : j = i)
:
@[simp]
theorem
Map.getD_erase_of_eq
{α : Type u}
{β : Type v}
[hh₁ : DecidableEq α]
[hh₂ : Hashable α]
{m : Map α β}
{i : α}
{x : β}
: