Skip to content

Commit

Permalink
feat: lemmas about Finset.card (#7605)
Browse files Browse the repository at this point in the history
Co-authored-by: qawbecrdtey <[email protected]>
Co-authored-by: qawbecrdtey <[email protected]>
  • Loading branch information
3 people authored and grunweg committed Dec 15, 2023
1 parent 03f206b commit 7933122
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Mathlib/Data/Finset/Card.lean
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,16 @@ theorem card_sdiff_add_card : (s \ t).card + t.card = (s ∪ t).card := by
lemma card_sdiff_comm (h : s.card = t.card) : (s \ t).card = (t \ s).card :=
add_left_injective t.card $ by simp_rw [card_sdiff_add_card, ←h, card_sdiff_add_card, union_comm]

@[simp]
lemma card_sdiff_add_card_inter (s t : Finset α) :
(s \ t).card + (s ∩ t).card = s.card := by
rw [← card_disjoint_union (disjoint_sdiff_inter _ _), sdiff_union_inter]

@[simp]
lemma card_inter_add_card_sdiff (s t : Finset α) :
(s ∩ t).card + (s \ t).card = s.card := by
rw [add_comm, card_sdiff_add_card_inter]

end Lattice

theorem filter_card_add_filter_neg_card_eq_card
Expand Down

0 comments on commit 7933122

Please sign in to comment.