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]
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_insertIfNew
.
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
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 α}
: