Skip to content

Commit

Permalink
chore(data/quot): rename nonempty_of_trunc to enable dot notation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Apr 5, 2021
1 parent c7d7d83 commit 530e7e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/data/fintype/basic.lean
Expand Up @@ -210,7 +210,7 @@ quot.rec_on_subsingleton (@univ α _).1
mem_univ_val univ.2

theorem exists_equiv_fin (α) [fintype α] : ∃ n, nonempty (α ≃ fin n) :=
by haveI := classical.dec_eq α; exact ⟨card α, nonempty_of_trunc (equiv_fin α)⟩
by haveI := classical.dec_eq α; exact ⟨card α, (equiv_fin α).nonempty

instance (α : Type*) : subsingleton (fintype α) :=
⟨λ ⟨s₁, h₁⟩ ⟨s₂, h₂⟩, by congr; simp [finset.ext_iff, h₁, h₂]⟩
Expand Down
6 changes: 3 additions & 3 deletions src/data/quot.lean
Expand Up @@ -326,10 +326,10 @@ noncomputable def out : trunc α → α := quot.out

@[simp] theorem out_eq (q : trunc α) : mk q.out = q := trunc.eq _ _

end trunc
protected theorem nonempty (q : trunc α) : nonempty α :=
nonempty_of_exists q.exists_rep

theorem nonempty_of_trunc (q : trunc α) : nonempty α :=
let ⟨a, _⟩ := q.exists_rep in ⟨a⟩
end trunc

namespace quotient
variables {γ : Sort*} {φ : Sort*}
Expand Down
2 changes: 1 addition & 1 deletion src/data/set/countable.lean
Expand Up @@ -166,7 +166,7 @@ lemma countable.insert {s : set α} (a : α) (h : countable s) : countable (inse
by { rw [set.insert_eq], exact (countable_singleton _).union h }

lemma finite.countable {s : set α} : finite s → countable s
| ⟨h⟩ := nonempty_of_trunc (by exactI trunc_encodable_of_fintype s)
| ⟨h⟩ := trunc.nonempty (by exactI trunc_encodable_of_fintype s)

/-- The set of finite subsets of a countable set is countable. -/
lemma countable_set_of_finite_subset {s : set α} : countable s →
Expand Down

0 comments on commit 530e7e3

Please sign in to comment.