Hash set lemmas #
This module contains lemmas about Std.Data.HashSet.Raw. Most of the lemmas require
EquivBEq α and LawfulHashable α for the key type α. The easiest way to obtain these instances
is to provide an instance of LawfulBEq α.
@[simp]
@[simp]
@[simp]
@[simp]
theorem Std.HashSet.Raw.contains_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {a : α} {c : Nat} :
@[simp]
theorem Std.HashSet.Raw.not_mem_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {a : α} {c : Nat} :
@[simp]
theorem Std.HashSet.Raw.contains_of_contains_insert' {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
This is a restatement of contains_insert that is written to exactly match the proof
obligation in the statement of get_insert.
theorem Std.HashSet.Raw.mem_of_mem_insert' {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k a : α} :
This is a restatement of mem_insert that is written to exactly match the proof obligation
in the statement of get_insert.
@[simp]
theorem Std.HashSet.Raw.erase_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {k : α} {c : Nat} :
@[simp]
theorem Std.HashSet.Raw.get?_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {a : α} {c : Nat} :
theorem Std.HashSet.Raw.get?_beq {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {k : α} :
@[simp]
theorem Std.HashSet.Raw.getD_emptyWithCapacity {α : Type u} [BEq α] [Hashable α] {a fallback : α} {c : Nat} :
theorem Std.HashSet.Raw.distinct_toList {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) :
List.Pairwise (fun (a b : α) => (a == b) = false) m.toList
@[simp]
theorem Std.HashSet.Raw.forIn_eq_forIn {α : Type u} {m : Raw α} {δ : Type v} {m' : Type v → Type w} [Monad m'] [LawfulMonad m'] {f : α → δ → m' (ForInStep δ)} {init : δ} :
theorem Std.HashSet.Raw.mem_insertMany_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] {ρ : Type v} [ForIn Id ρ α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : ρ} {k : α} :
k ∈ m → k ∈ m.insertMany l
theorem Std.HashSet.Raw.get?_insertMany_list_of_not_mem_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k ∈ m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k ∈ l) :
theorem Std.HashSet.Raw.get?_insertMany_list_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} (mem : k ∈ m) :
theorem Std.HashSet.Raw.get_insertMany_list_of_not_mem_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k ∈ m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k ∈ l) {h' : k' ∈ m.insertMany l} :
theorem Std.HashSet.Raw.get_insertMany_list_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k : α} (mem : k ∈ m) {h₃ : k ∈ m.insertMany l} :
theorem Std.HashSet.Raw.get!_insertMany_list_of_not_mem_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] [Inhabited α] (h : m.WF) {l : List α} {k k' : α} (k_beq : (k == k') = true) (not_mem : ¬k ∈ m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k ∈ l) :
theorem Std.HashSet.Raw.getD_insertMany_list_of_not_mem_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k k' fallback : α} (k_beq : (k == k') = true) (not_mem : ¬k ∈ m) (distinct : List.Pairwise (fun (a b : α) => (a == b) = false) l) (mem : k ∈ l) :
theorem Std.HashSet.Raw.getD_insertMany_list_of_mem {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} {k fallback : α} (mem : k ∈ m) :
theorem Std.HashSet.Raw.size_le_size_insertMany_list {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] (h : m.WF) {l : List α} :
theorem Std.HashSet.Raw.Equiv.insertMany_list {α : Type u} [BEq α] [Hashable α] {m₁ m₂ : Raw α} [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF) (h₂ : m₂.WF) (l : List α) (h : m₁.Equiv m₂) :
(m₁.insertMany l).Equiv (m₂.insertMany l)
theorem Std.HashSet.Raw.Equiv.filter {α : Type u} [BEq α] [Hashable α] {m₁ m₂ : Raw α} (h₁ : m₁.WF) (h₂ : m₂.WF) (f : α → Bool) (h : m₁.Equiv m₂) :
(Raw.filter f m₁).Equiv (Raw.filter f m₂)
theorem Std.HashSet.Raw.insertMany_list_equiv_foldl {α : Type u} {m : Raw α} [BEq α] [Hashable α] {l : List α} (h : m.WF) :
(m.insertMany l).Equiv (List.foldl (fun (acc : Raw α) (a : α) => acc.insert a) m l)
@[simp]
theorem Std.HashSet.Raw.get?_filter {α : Type u} {m : Raw α} [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {f : α → Bool} {k : α} (h : m.WF) :