Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Mathlib/Data/Finset/BooleanAlgebra.lean
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ theorem univ_filter_exists (f : α → β) [Fintype β] [DecidablePred fun y =>
/-- Note this is a special case of `(Finset.image_preimage f univ _).symm`. -/
theorem univ_filter_mem_range (f : α → β) [Fintype β] [DecidablePred fun y => y ∈ Set.range f]
[DecidableEq β] : (Finset.univ.filter fun y => y ∈ Set.range f) = Finset.univ.image f := by
letI : DecidablePred (fun y => ∃ x, f x = y) := by simpa using ‹_›
exact univ_filter_exists f
grind

theorem coe_filter_univ (p : α → Prop) [DecidablePred p] :
(univ.filter p : Set α) = { x | p x } := by simp
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/Data/Finset/Erase.lean
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ theorem coe_erase (a : α) (s : Finset α) : ↑(erase s a) = (s \ {a} : Set α)
theorem erase_idem {a : α} {s : Finset α} : erase (erase s a) a = erase s a := by simp

theorem erase_right_comm {a b : α} {s : Finset α} : erase (erase s a) b = erase (erase s b) a := by
ext x
simp only [mem_erase, ← and_assoc]
rw [@and_comm (x ≠ a)]
grind

theorem erase_inj {x y : α} (s : Finset α) (hx : x ∈ s) : s.erase x = s.erase y ↔ x = y := by
grind [eq_of_mem_of_notMem_erase]
Expand Down
6 changes: 1 addition & 5 deletions Mathlib/Data/Finset/Powerset.lean
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,7 @@ theorem powersetCard_map {β : Type*} (f : α ↪ β) (n : ℕ) (s : Finset α)
constructor
· classical
intro h
have : map f (filter (fun x => (f x ∈ t)) s) = t := by
ext x
simp only [mem_map, mem_filter]
exact ⟨fun ⟨_y, ⟨_hy₁, hy₂⟩, hy₃⟩ => hy₃ ▸ hy₂,
fun hx => let ⟨y, hy⟩ := mem_map.1 (h.1 hx); ⟨y, ⟨hy.1, hy.2 ▸ hx⟩, hy.2⟩⟩
have : map f (filter (fun x => (f x ∈ t)) s) = t := by grind
refine ⟨_, ?_, this⟩
rw [← card_map f, this, h.2]; simp
· rintro ⟨a, ⟨has, rfl⟩, rfl⟩
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Data/Finset/Prod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ theorem offDiag_empty : (∅ : Finset α).offDiag = ∅ :=

@[simp]
theorem diag_union_offDiag : s.diag ∪ s.offDiag = s ×ˢ s := by
conv_rhs => rw [← filter_union_filter_neg_eq (fun a => a.1 = a.2) (s ×ˢ s)]
rfl
grind

@[simp]
theorem disjoint_diag_offDiag : Disjoint s.diag s.offDiag :=
Expand Down