Skip to content

Commit

Permalink
Fix: rename Set.to_finset_set_of to Set.toFinset_setOf (#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
urkud committed Feb 16, 2023
1 parent cf6e83b commit 9074225
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Mathlib/Combinatorics/Composition.lean
Expand Up @@ -815,7 +815,7 @@ def compositionAsSetEquiv (n : ℕ) : CompositionAsSet n ≃ Finset (Fin (n - 1)
left_inv := by
intro c
ext i
simp only [add_comm, Set.to_finset_set_of, Finset.mem_univ,
simp only [add_comm, Set.toFinset_setOf, Finset.mem_univ,
forall_true_left, Finset.mem_filter, true_and, exists_prop]
constructor
· rintro (rfl | rfl | ⟨j, hj1, hj2⟩)
Expand Down Expand Up @@ -848,7 +848,7 @@ def compositionAsSetEquiv (n : ℕ) : CompositionAsSet n ≃ Finset (Fin (n - 1)
rw [add_comm]
apply (Nat.succ_pred_eq_of_pos _).symm
exact (zero_le i.val).trans_lt (i.2.trans_le (Nat.sub_le n 1))
simp only [add_comm, Fin.ext_iff, Fin.val_zero, Fin.val_last, exists_prop, Set.to_finset_set_of,
simp only [add_comm, Fin.ext_iff, Fin.val_zero, Fin.val_last, exists_prop, Set.toFinset_setOf,
Finset.mem_univ, forall_true_left, Finset.mem_filter, add_eq_zero_iff, and_false,
add_left_inj, false_or, true_and]
erw [Set.mem_setOf_eq]
Expand Down
7 changes: 3 additions & 4 deletions Mathlib/Data/Fintype/Basic.lean
Expand Up @@ -765,12 +765,11 @@ theorem toFinset_eq_univ [Fintype α] [Fintype s] : s.toFinset = Finset.univ ↔
#align set.to_finset_eq_univ Set.toFinset_eq_univ

@[simp]
theorem to_finset_set_of [Fintype α] (p : α → Prop) [DecidablePred p] [Fintype { x | p x }] :
{ x | p x }.toFinset = Finset.univ.filter p :=
by
theorem toFinset_setOf [Fintype α] (p : α → Prop) [DecidablePred p] [Fintype { x | p x }] :
{ x | p x }.toFinset = Finset.univ.filter p := by
ext
simp
#align set.to_finset_set_of Set.to_finset_set_of
#align set.to_finset_set_of Set.toFinset_setOf

--@[simp] Porting note: removing simp, simp can prove it
theorem toFinset_ssubset_univ [Fintype α] {s : Set α} [Fintype s] :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Finite.lean
Expand Up @@ -1200,7 +1200,7 @@ theorem Finite.card_toFinset {s : Set α} [Fintype s] (h : s.Finite) :
theorem card_ne_eq [Fintype α] (a : α) [Fintype { x : α | x ≠ a }] :
Fintype.card { x : α | x ≠ a } = Fintype.card α - 1 := by
haveI := Classical.decEq α
rw [← toFinset_card, to_finset_set_of, Finset.filter_ne',
rw [← toFinset_card, toFinset_setOf, Finset.filter_ne',
Finset.card_erase_of_mem (Finset.mem_univ _), Finset.card_univ]
#align set.card_ne_eq Set.card_ne_eq

Expand Down

0 comments on commit 9074225

Please sign in to comment.