Skip to content

Commit

Permalink
chore(data/fintype/basic): documenting elaboration bug (#11247)
Browse files Browse the repository at this point in the history
Simplifying an expression and documenting an elaboration bug that it was avoiding.
  • Loading branch information
kmill committed Feb 9, 2022
1 parent 3aa5b8a commit fea68aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/data/fintype/basic.lean
Expand Up @@ -1138,8 +1138,11 @@ instance Prop.fintype : fintype Prop :=
instance subtype.fintype (p : α → Prop) [decidable_pred p] [fintype α] : fintype {x // p x} :=
fintype.subtype (univ.filter p) (by simp)

@[simp] lemma set.to_finset_univ [hu : fintype (set.univ : set α)] [fintype α] :
@set.to_finset _ (set.univ : set α) hu = finset.univ :=
/- TODO Without the coercion arrow (`↥`) there is an elaboration bug;
it essentially infers `fintype.{v} (set.univ.{u} : set α)` with `v` and `u` distinct.
Reported in leanprover-community/lean#672 -/
@[simp] lemma set.to_finset_univ [fintype ↥(set.univ : set α)] [fintype α] :
(set.univ : set α).to_finset = finset.univ :=
by { ext, simp only [set.mem_univ, mem_univ, set.mem_to_finset] }

@[simp] lemma set.to_finset_eq_empty_iff {s : set α} [fintype s] : s.to_finset = ∅ ↔ s = ∅ :=
Expand Down

0 comments on commit fea68aa

Please sign in to comment.