@@ -953,6 +953,14 @@ theorem distinct_keys_toList [EquivBEq α] [LawfulHashable α] (h : m.WF) :
953953 m.toList.Pairwise (fun a b => (a.1 == b.1 ) = false) :=
954954 DHashMap.Raw.Const.distinct_keys_toList h.out
955955
956+ theorem nodup_toList [EquivBEq α] [LawfulHashable α] (h : m.WF) :
957+ m.toList.Nodup := DHashMap.Raw.Const.nodup_toList h.out
958+
959+ theorem mem_toList_insert_of_not_mem [EquivBEq α] [LawfulHashable α] (h : m.WF)
960+ {k : α} {v : β} {x : α × β} : ¬ k ∈ m →
961+ (x ∈ (m.insert k v).toList ↔ x = ⟨k, v⟩ ∨ x ∈ m.toList) :=
962+ DHashMap.Raw.Const.mem_toList_insert_of_not_mem h.out
963+
956964@[simp]
957965theorem toArray_toList (h : m.WF) :
958966 m.toList.toArray = m.toArray :=
@@ -3538,6 +3546,35 @@ theorem getD_map_of_getKey?_eq_some [EquivBEq α] [LawfulHashable α]
35383546 DHashMap.Raw.Const.getD_map_of_getKey?_eq_some h.out h'
35393547
35403548end map
3549+
3550+ @[simp]
3551+ theorem size_fst_partition_add_size_snd_partition_eq_size [EquivBEq α] [LawfulHashable α]
3552+ {p : α → β → Bool} (h : m.WF) :
3553+ (m.partition p).1 .size + (m.partition p).2 .size = m.size :=
3554+ DHashMap.Raw.size_fst_partition_add_size_snd_partition_eq_size h.out
3555+
3556+ @[simp]
3557+ theorem fst_partition_not_eq_snd_partition [EquivBEq α] [LawfulHashable α]
3558+ {p : α → β → Bool} (h : m.WF) :
3559+ (m.partition (fun a b => ! p a b)).fst = (m.partition p).snd := by
3560+ simp [partition, DHashMap.Raw.fst_partition_not_eq_snd_partition h.out]
3561+
3562+ @[simp]
3563+ theorem snd_partition_not_eq_fst_partition [EquivBEq α] [LawfulHashable α]
3564+ {p : α → β → Bool} (h : m.WF) :
3565+ (m.partition (fun a b => ! p a b)).snd = (m.partition p).fst := by
3566+ simp [partition, DHashMap.Raw.snd_partition_not_eq_fst_partition h.out]
3567+
3568+ theorem fst_partition_equiv_filter [EquivBEq α] [LawfulHashable α]
3569+ {p : α → β → Bool} (h : m.WF) :
3570+ (m.partition p).fst ~m m.filter p :=
3571+ ⟨DHashMap.Raw.fst_partition_equiv_filter h.out⟩
3572+
3573+ theorem snd_partition_equiv_filter_not [EquivBEq α] [LawfulHashable α]
3574+ {p : α → β → Bool} (h : m.WF) :
3575+ (m.partition p).snd ~m m.filter (fun a b => ! p a b) :=
3576+ ⟨DHashMap.Raw.snd_partition_equiv_filter_not h.out⟩
3577+
35413578attribute [simp] contains_eq_false_iff_not_mem
35423579end Raw
35433580
0 commit comments