Skip to content

Commit 2e99d8a

Browse files
committed
chore(Data/Finset): drop 2 DecidableEq assumptions (#10575)
In 1 case, golf the proof.
1 parent de992dc commit 2e99d8a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Mathlib/Data/Finset/Basic.lean

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,9 @@ theorem Nonempty.cons_induction {α : Type*} {p : ∀ s : Finset α, s.Nonempty
13101310
· exact h₁ t ha ht (h ht)
13111311
#align finset.nonempty.cons_induction Finset.Nonempty.cons_induction
13121312

1313+
lemma Nonempty.exists_cons_eq (hs : s.Nonempty) : ∃ t a ha, cons a t ha = s :=
1314+
hs.cons_induction (fun a ↦ ⟨∅, a, by simp⟩) fun _ _ _ _ _ ↦ ⟨_, _, _, rfl⟩
1315+
13131316
/-- Inserting an element to a finite set is equivalent to the option type. -/
13141317
def subtypeInsertEquivOption {t : Finset α} {x : α} (h : x ∉ t) :
13151318
{ i // i ∈ insert x t } ≃ Option { i // i ∈ t } := by
@@ -2091,21 +2094,16 @@ theorem erase_injOn' (a : α) : { s : Finset α | a ∈ s }.InjOn fun s => erase
20912094
fun s hs t ht (h : s.erase a = _) => by rw [← insert_erase hs, ← insert_erase ht, h]
20922095
#align finset.erase_inj_on' Finset.erase_injOn'
20932096

2094-
lemma Nonempty.exists_cons_eq (hs : s.Nonempty) : ∃ t a ha, cons a t ha = s := by
2095-
classical
2096-
obtain ⟨a, ha⟩ := hs
2097-
exact ⟨s.erase a, a, not_mem_erase _ _, by simp [insert_erase ha]⟩
2097+
end Erase
20982098

2099-
lemma Nontrivial.exists_cons_eq (hs : s.Nontrivial) :
2099+
lemma Nontrivial.exists_cons_eq {s : Finset α} (hs : s.Nontrivial) :
21002100
∃ t a ha b hb hab, (cons b t hb).cons a (mem_cons.not.2 <| not_or_intro hab ha) = s := by
21012101
classical
21022102
obtain ⟨a, ha, b, hb, hab⟩ := hs
21032103
have : b ∈ s.erase a := mem_erase.2 ⟨hab.symm, hb⟩
21042104
refine ⟨(s.erase a).erase b, a, ?_, b, ?_, ?_, ?_⟩ <;>
21052105
simp [insert_erase this, insert_erase ha, *]
21062106

2107-
end Erase
2108-
21092107
/-! ### sdiff -/
21102108

21112109

0 commit comments

Comments
 (0)