@@ -9,9 +9,11 @@ Finite sets.
9
9
import data.list.set data.list.perm tactic.finish
10
10
open list subtype nat
11
11
12
- def nodup_list (A : Type ) := {l : list A // nodup l}
12
+ universe u
13
13
14
- variable {α : Type }
14
+ def nodup_list (α : Type u) := {l : list α // nodup l}
15
+
16
+ variable {α : Type u}
15
17
16
18
def to_nodup_list_of_nodup {l : list α} (n : nodup l) : nodup_list α :=
17
19
⟨l, n⟩
@@ -33,10 +35,10 @@ perm.symm
33
35
private def eqv.trans {l₁ l₂ l₃ : nodup_list α} : l₁ ~ l₂ → l₂ ~ l₃ → l₁ ~ l₃ :=
34
36
perm.trans
35
37
36
- instance finset.nodup_list_setoid (α : Type ) : setoid (nodup_list α) :=
38
+ instance finset.nodup_list_setoid (α : Type u ) : setoid (nodup_list α) :=
37
39
setoid.mk (@eqv α) (mk_equivalence (@eqv α) (@eqv.refl α) (@eqv.symm α) (@eqv.trans α))
38
40
39
- def finset (α : Type ) : Type :=
41
+ def finset (α : Type u ) : Type u :=
40
42
quotient (finset.nodup_list_setoid α)
41
43
42
44
namespace finset
@@ -63,7 +65,7 @@ instance has_decidable_eq [decidable_eq α] : decidable_eq (finset α) :=
63
65
match perm.decidable_perm l₁.1 l₂.1 with
64
66
| decidable.is_true e := decidable.is_true (quot.sound e)
65
67
| decidable.is_false n := decidable.is_false (λ e : ⟦l₁⟧ = ⟦l₂⟧, absurd (quotient.exact e) n)
66
- end )
68
+ end )
67
69
68
70
def mem (a : α) (s : finset α) : Prop :=
69
71
quot.lift_on s (λ l, a ∈ l.1 )
@@ -104,12 +106,10 @@ to_finset_of_nodup [] nodup_nil
104
106
105
107
instance : has_emptyc (finset α) := ⟨empty⟩
106
108
107
- attribute [simp]
108
- theorem not_mem_empty (a : α) : a ∉ (∅ : finset α) :=
109
+ @[simp] theorem not_mem_empty (a : α) : a ∉ (∅ : finset α) :=
109
110
λ aine, aine
110
111
111
- attribute [simp]
112
- theorem mem_empty_iff (x : α) : x ∈ (∅ : finset α) ↔ false :=
112
+ @[simp] theorem mem_empty_iff (x : α) : x ∈ (∅ : finset α) ↔ false :=
113
113
iff_false_intro (not_mem_empty _)
114
114
115
115
theorem mem_empty_eq (x : α) : x ∈ (∅ : finset α) = false :=
@@ -227,8 +227,7 @@ else by rewrite [card_insert_of_not_mem H]
227
227
theorem perm_insert_cons_of_not_mem [decidable_eq α] {a : α} {l : list α} (h : a ∉ l) : perm (list.insert a l) (a :: l) :=
228
228
have list.insert a l = a :: l, from if_neg h, by rw this
229
229
230
- attribute [recursor 6 ]
231
- protected theorem induction {P : finset α → Prop }
230
+ @[recursor 6 ] protected theorem induction {P : finset α → Prop }
232
231
(H1 : P empty)
233
232
(H2 : ∀ ⦃a : α⦄, ∀{s : finset α}, a ∉ s → P s → P (insert a s)) :
234
233
∀s, P s :=
@@ -506,7 +505,7 @@ theorem union_distrib_right (s t u : finset α) : (s ∩ t) ∪ u = (s ∪ u)
506
505
ext (λ x, by rw [mem_union_eq]; repeat {rw mem_inter_eq}; repeat {rw mem_union_eq}; apply iff.intro; repeat {finish})
507
506
508
507
end inter
509
- def subset_aux {T : Type } (l₁ l₂ : list T ) := ∀ ⦃a : T ⦄, a ∈ l₁ → a ∈ l₂
508
+ def subset_aux {α : Type u } (l₁ l₂ : list α ) := ∀ ⦃a : α ⦄, a ∈ l₁ → a ∈ l₂
510
509
511
510
/- subset -/
512
511
def subset (s₁ s₂ : finset α) : Prop :=
0 commit comments