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

Commit 1a45a56

Browse files
committed
feat(logic/basic): subsingleton_of_not_nonempty (#7043)
Also generalize `not_nonempty_iff_imp_false` to `Sort *`.
1 parent 04af8ba commit 1a45a56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/logic/basic.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ iff.intro (λ⟨a, _⟩, ⟨a⟩) (λ⟨a⟩, ⟨a, trivial⟩)
12161216
@[simp] lemma nonempty_Prop {p : Prop} : nonempty p ↔ p :=
12171217
iff.intro (assume ⟨h⟩, h) (assume h, ⟨h⟩)
12181218

1219-
lemma not_nonempty_iff_imp_false : ¬ nonempty α ↔ α → false :=
1219+
lemma not_nonempty_iff_imp_false {α : Sort*} : ¬ nonempty α ↔ α → false :=
12201220
⟨λ h a, h ⟨a⟩, λ h ⟨a⟩, h a⟩
12211221

12221222
@[simp] lemma nonempty_sigma : nonempty (Σa:α, γ a) ↔ (∃a:α, nonempty (γ a)) :=
@@ -1304,6 +1304,9 @@ h.elim $ λ g, h2.elim $ λ g2, ⟨⟨g, g2⟩⟩
13041304

13051305
end nonempty
13061306

1307+
lemma subsingleton_of_not_nonempty {α : Sort*} (h : ¬ nonempty α) : subsingleton α :=
1308+
⟨λ x, false.elim $ not_nonempty_iff_imp_false.mp h x⟩
1309+
13071310
section ite
13081311

13091312
/-- A `dite` whose results do not actually depend on the condition may be reduced to an `ite`. -/

0 commit comments

Comments
 (0)