Nonempty types #
This file proves a few extra facts about Nonempty
, which is defined in core Lean.
Main declarations #
Nonempty.some
: Extracts a witness of nonemptiness using choice. TakesNonempty α
explicitly.Classical.arbitrary
: Extracts a witness of nonemptiness using choice. TakesNonempty α
as an instance.
Equations
Equations
Using Classical.choice
, lifts a (Prop
-valued) Nonempty
instance to a (Type
-valued)
Inhabited
instance. Classical.inhabited_of_nonempty
already exists, in
Init/Classical.lean
, but the assumption is not a type class argument,
which makes it unsuitable for some applications.
Equations
- Classical.inhabited_of_nonempty' = { default := Classical.choice h }
Instances For
Equations
instance
Pi.Nonempty
{ι : Sort u_2}
{α : ι → Sort u_3}
[∀ (i : ι), Nonempty (α i)]
:
Nonempty ((i : ι) → α i)
Equations
theorem
Function.Surjective.nonempty
{α : Sort u_3}
{β : Sort u_2}
[h : Nonempty β]
{f : α → β}
(hf : Function.Surjective f)
:
Nonempty α