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]
theorem
Std.HashSet.Raw.isEmpty_empty
{α : Type u}
[BEq α]
[Hashable α]
{c : Nat}
:
(Std.HashSet.Raw.empty c).isEmpty = true
@[simp]
theorem
Std.HashSet.Raw.isEmpty_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{a : α}
:
theorem
Std.HashSet.Raw.mem_iff_contains
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
{a : α}
:
theorem
Std.HashSet.Raw.contains_congr
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{a : α}
{b : α}
(hab : (a == b) = true)
:
m.contains a = m.contains b
theorem
Std.HashSet.Raw.mem_congr
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{a : α}
{b : α}
(hab : (a == b) = true)
:
@[simp]
theorem
Std.HashSet.Raw.contains_empty
{α : Type u}
[BEq α]
[Hashable α]
{a : α}
{c : Nat}
:
(Std.HashSet.Raw.empty c).contains a = false
@[simp]
theorem
Std.HashSet.Raw.contains_of_isEmpty
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{a : α}
:
theorem
Std.HashSet.Raw.not_mem_of_isEmpty
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{a : α}
:
theorem
Std.HashSet.Raw.isEmpty_eq_false_iff_exists_contains_eq_true
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
:
theorem
Std.HashSet.Raw.isEmpty_eq_false_iff_exists_mem
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
:
theorem
Std.HashSet.Raw.isEmpty_iff_forall_contains
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
:
theorem
Std.HashSet.Raw.isEmpty_iff_forall_not_mem
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
:
@[simp]
theorem
Std.HashSet.Raw.contains_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
@[simp]
theorem
Std.HashSet.Raw.mem_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
theorem
Std.HashSet.Raw.contains_of_contains_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
theorem
Std.HashSet.Raw.mem_of_mem_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
@[simp]
theorem
Std.HashSet.Raw.contains_insert_self
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
@[simp]
theorem
Std.HashSet.Raw.mem_insert_self
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
k ∈ m.insert k
theorem
Std.HashSet.Raw.size_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
theorem
Std.HashSet.Raw.size_le_size_insert
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
m.size ≤ (m.insert k).size
theorem
Std.HashSet.Raw.size_insert_le
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
@[simp]
theorem
Std.HashSet.Raw.erase_empty
{α : Type u}
[BEq α]
[Hashable α]
{k : α}
{c : Nat}
:
(Std.HashSet.Raw.empty c).erase k = Std.HashSet.Raw.empty c
@[simp]
theorem
Std.HashSet.Raw.isEmpty_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
@[simp]
theorem
Std.HashSet.Raw.contains_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
@[simp]
theorem
Std.HashSet.Raw.mem_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
theorem
Std.HashSet.Raw.contains_of_contains_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
theorem
Std.HashSet.Raw.mem_of_mem_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
{a : α}
:
theorem
Std.HashSet.Raw.size_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
theorem
Std.HashSet.Raw.size_erase_le
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
(m.erase k).size ≤ m.size
theorem
Std.HashSet.Raw.size_le_size_erase
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
[EquivBEq α]
[LawfulHashable α]
(h : m.WF)
{k : α}
:
@[simp]
theorem
Std.HashSet.Raw.containsThenInsert_fst
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
(h : m.WF)
{k : α}
:
(m.containsThenInsert k).fst = m.contains k
@[simp]
theorem
Std.HashSet.Raw.containsThenInsert_snd
{α : Type u}
{m : Std.HashSet.Raw α}
[BEq α]
[Hashable α]
(h : m.WF)
{k : α}
:
(m.containsThenInsert k).snd = m.insert k