File tree Expand file tree Collapse file tree 6 files changed +16
-8
lines changed
Expand file tree Collapse file tree 6 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -1965,9 +1965,10 @@ theorem getKey!_union_of_not_mem_right [Inhabited α]
19651965
19661966/- size -/
19671967theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] :
1968- (∀ (a : α), m₁.contains a → m₂.contains a = false) →
1969- (m₁ ∪ m₂).size = m₁.size + m₂.size :=
1970- @Raw₀.size_union_of_not_mem _ _ _ _ ⟨m₁.1 , m₁.2 .size_buckets_pos⟩ ⟨m₂.1 , m₂.2 .size_buckets_pos⟩ _ _ m₁.2 m₂.2
1968+ (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂) →
1969+ (m₁ ∪ m₂).size = m₁.size + m₂.size := by
1970+ simp only [← contains_eq_false_iff_not_mem]
1971+ exact @Raw₀.size_union_of_not_mem _ _ _ _ ⟨m₁.1 , m₁.2 .size_buckets_pos⟩ ⟨m₂.1 , m₂.2 .size_buckets_pos⟩ _ _ m₁.2 m₂.2
19711972
19721973theorem size_left_le_size_union [EquivBEq α] [LawfulHashable α] : m₁.size ≤ (m₁ ∪ m₂).size :=
19731974 @Raw₀.size_left_le_size_union α β _ _ ⟨m₁.1 , m₁.2 .size_buckets_pos⟩ ⟨m₂.1 , m₂.2 .size_buckets_pos⟩ _ _ m₁.2 m₂.2
Original file line number Diff line number Diff line change @@ -2149,8 +2149,15 @@ theorem getKey!_union_of_not_mem_right [Inhabited α]
21492149
21502150/- size -/
21512151theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF)
2152- (h₂ : m₂.WF) : (∀ (a : α), m₁.contains a → m₂.contains a = false ) →
2152+ (h₂ : m₂.WF) : (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂ ) →
21532153 (m₁ ∪ m₂).size = m₁.size + m₂.size := by
2154+ intro hyp
2155+ conv at hyp =>
2156+ ext
2157+ lhs
2158+ rw [mem_iff_contains]
2159+ simp only [← contains_eq_false_iff_not_mem] at hyp
2160+ revert hyp
21542161 simp only [Union.union]
21552162 simp_to_raw using Raw₀.size_union_of_not_mem
21562163
Original file line number Diff line number Diff line change @@ -1482,7 +1482,7 @@ theorem getKey!_union_of_not_mem_right [Inhabited α]
14821482
14831483/- size -/
14841484theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] :
1485- (∀ (a : α), m₁.contains a → m₂.contains a = false ) →
1485+ (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂ ) →
14861486 (m₁ ∪ m₂).size = m₁.size + m₂.size :=
14871487 @DHashMap.size_union_of_not_mem _ _ _ _ m₁.inner m₂.inner _ _
14881488
Original file line number Diff line number Diff line change @@ -1460,7 +1460,7 @@ theorem getKey!_union_of_not_mem_right [Inhabited α]
14601460
14611461/- size -/
14621462theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF)
1463- (h₂ : m₂.WF) : (∀ (a : α), m₁.contains a → m₂.contains a = false ) →
1463+ (h₂ : m₂.WF) : (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂ ) →
14641464 (m₁ ∪ m₂).size = m₁.size + m₂.size :=
14651465 @DHashMap.Raw.size_union_of_not_mem _ _ _ _ m₁.inner m₂.inner _ _ h₁.out h₂.out
14661466
Original file line number Diff line number Diff line change @@ -858,7 +858,7 @@ theorem get!_union_of_not_mem_right [Inhabited α]
858858
859859/- size -/
860860theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] :
861- (∀ (a : α), m₁.contains a → m₂.contains a = false ) →
861+ (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂ ) →
862862 (m₁ ∪ m₂).size = m₁.size + m₂.size :=
863863 @HashMap.size_union_of_not_mem _ _ _ _ m₁.inner m₂.inner _ _
864864
Original file line number Diff line number Diff line change @@ -894,7 +894,7 @@ theorem get!_union_of_not_mem_right [Inhabited α]
894894
895895/- size -/
896896theorem size_union_of_not_mem [EquivBEq α] [LawfulHashable α] (h₁ : m₁.WF)
897- (h₂ : m₂.WF) : (∀ (a : α), m₁.contains a → m₂.contains a = false ) →
897+ (h₂ : m₂.WF) : (∀ (a : α), a ∈ m₁ → ¬a ∈ m₂ ) →
898898 (m₁ ∪ m₂).size = m₁.size + m₂.size :=
899899 @HashMap.Raw.size_union_of_not_mem _ _ _ _ m₁.inner m₂.inner _ _ h₁.out h₂.out
900900
You can’t perform that action at this time.
0 commit comments