Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit dff0ffd

Browse files
committed
refactor(data/finset): fix formatting issues
1 parent 7df585e commit dff0ffd

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

data/finset/basic.lean

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Finite sets.
99
import data.list.set data.list.perm tactic.finish
1010
open list subtype nat
1111

12-
def nodup_list (A : Type) := {l : list A // nodup l}
12+
universe u
1313

14-
variable {α : Type}
14+
def nodup_list (α : Type u) := {l : list α // nodup l}
15+
16+
variable {α : Type u}
1517

1618
def to_nodup_list_of_nodup {l : list α} (n : nodup l) : nodup_list α :=
1719
⟨l, n⟩
@@ -33,10 +35,10 @@ perm.symm
3335
private def eqv.trans {l₁ l₂ l₃ : nodup_list α} : l₁ ~ l₂ → l₂ ~ l₃ → l₁ ~ l₃ :=
3436
perm.trans
3537

36-
instance finset.nodup_list_setoid (α : Type) : setoid (nodup_list α) :=
38+
instance finset.nodup_list_setoid (α : Type u) : setoid (nodup_list α) :=
3739
setoid.mk (@eqv α) (mk_equivalence (@eqv α) (@eqv.refl α) (@eqv.symm α) (@eqv.trans α))
3840

39-
def finset (α : Type) : Type :=
41+
def finset (α : Type u) : Type u :=
4042
quotient (finset.nodup_list_setoid α)
4143

4244
namespace finset
@@ -63,7 +65,7 @@ instance has_decidable_eq [decidable_eq α] : decidable_eq (finset α) :=
6365
match perm.decidable_perm l₁.1 l₂.1 with
6466
| decidable.is_true e := decidable.is_true (quot.sound e)
6567
| decidable.is_false n := decidable.is_false (λ e : ⟦l₁⟧ = ⟦l₂⟧, absurd (quotient.exact e) n)
66-
end)
68+
end)
6769

6870
def mem (a : α) (s : finset α) : Prop :=
6971
quot.lift_on s (λ l, a ∈ l.1)
@@ -104,12 +106,10 @@ to_finset_of_nodup [] nodup_nil
104106

105107
instance : has_emptyc (finset α) := ⟨empty⟩
106108

107-
attribute [simp]
108-
theorem not_mem_empty (a : α) : a ∉ (∅ : finset α) :=
109+
@[simp] theorem not_mem_empty (a : α) : a ∉ (∅ : finset α) :=
109110
λ aine, aine
110111

111-
attribute [simp]
112-
theorem mem_empty_iff (x : α) : x ∈ (∅ : finset α) ↔ false :=
112+
@[simp] theorem mem_empty_iff (x : α) : x ∈ (∅ : finset α) ↔ false :=
113113
iff_false_intro (not_mem_empty _)
114114

115115
theorem mem_empty_eq (x : α) : x ∈ (∅ : finset α) = false :=
@@ -227,8 +227,7 @@ else by rewrite [card_insert_of_not_mem H]
227227
theorem perm_insert_cons_of_not_mem [decidable_eq α] {a : α} {l : list α} (h : a ∉ l) : perm (list.insert a l) (a :: l) :=
228228
have list.insert a l = a :: l, from if_neg h, by rw this
229229

230-
attribute [recursor 6]
231-
protected theorem induction {P : finset α → Prop}
230+
@[recursor 6] protected theorem induction {P : finset α → Prop}
232231
(H1 : P empty)
233232
(H2 : ∀ ⦃a : α⦄, ∀{s : finset α}, a ∉ s → P s → P (insert a s)) :
234233
∀s, P s :=
@@ -506,7 +505,7 @@ theorem union_distrib_right (s t u : finset α) : (s ∩ t) ∪ u = (s ∪ u)
506505
ext (λ x, by rw [mem_union_eq]; repeat {rw mem_inter_eq}; repeat {rw mem_union_eq}; apply iff.intro; repeat {finish})
507506

508507
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₂
510509

511510
/- subset -/
512511
def subset (s₁ s₂ : finset α) : Prop :=

0 commit comments

Comments
 (0)