@@ -586,33 +586,34 @@ lemma finite.card_to_finset {s : set α} [fintype s] (h : s.finite) :
586
586
by { rw [← finset.card_attach, finset.attach_eq_univ, ← fintype.card], congr' 2 , funext,
587
587
rw set.finite.mem_to_finset }
588
588
589
- section
590
-
591
- local attribute [instance, priority 1 ] classical.prop_decidable
589
+ section decidable_eq
592
590
593
- lemma to_finset_compl {α : Type *} [fintype α] (s : set α) :
594
- sᶜ.to_finset = (s.to_finset)ᶜ :=
591
+ lemma to_finset_compl {α : Type *} [fintype α] [decidable_eq α]
592
+ (s : set α) [fintype (sᶜ : set α)] [fintype s] : sᶜ.to_finset = (s.to_finset)ᶜ :=
595
593
by ext; simp
596
594
597
- lemma to_finset_inter {α : Type *} [fintype α] (s t : set α) :
598
- (s ∩ t).to_finset = s.to_finset ∩ t.to_finset :=
595
+ lemma to_finset_inter {α : Type *} [decidable_eq α] (s t : set α) [fintype (s ∩ t : set α)]
596
+ [fintype s] [fintype t] : (s ∩ t).to_finset = s.to_finset ∩ t.to_finset :=
599
597
by ext; simp
600
598
601
- lemma to_finset_union {α : Type *} [fintype α] (s t : set α) :
602
- (s ∪ t).to_finset = s.to_finset ∪ t.to_finset :=
599
+ lemma to_finset_union {α : Type *} [decidable_eq α] (s t : set α) [fintype (s ∪ t : set α)]
600
+ [fintype s] [fintype t] : (s ∪ t).to_finset = s.to_finset ∪ t.to_finset :=
603
601
by ext; simp
604
602
605
- lemma to_finset_ne_eq_erase {α : Type *} [fintype α] (a : α) :
606
- {x : α | x ≠ a}.to_finset = finset.univ.erase a :=
603
+ lemma to_finset_ne_eq_erase {α : Type *} [decidable_eq α] [ fintype α] (a : α)
604
+ [fintype {x : α | x ≠ a}] : {x : α | x ≠ a}.to_finset = finset.univ.erase a :=
607
605
by ext; simp
608
606
609
- lemma card_ne_eq [fintype α] (a : α) :
607
+ lemma card_ne_eq [fintype α] (a : α) [fintype {x : α | x ≠ a}] :
610
608
fintype.card {x : α | x ≠ a} = fintype.card α - 1 :=
611
- by rw [←to_finset_card, to_finset_ne_eq_erase, finset.card_erase_of_mem (finset.mem_univ _),
612
- finset.card_univ, nat.pred_eq_sub_one]
613
-
609
+ begin
610
+ haveI := classical.dec_eq α,
611
+ rw [←to_finset_card, to_finset_ne_eq_erase, finset.card_erase_of_mem (finset.mem_univ _),
612
+ finset.card_univ, nat.pred_eq_sub_one],
614
613
end
615
614
615
+ end decidable_eq
616
+
616
617
section
617
618
618
619
variables [semilattice_sup α] [nonempty α] {s : set α}
0 commit comments