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.
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
theorem
Function.Surjective.nonempty
{α : Sort u_3}
{β : Sort u_2}
[h : Nonempty β]
{f : α → β}
(hf : Function.Surjective f)
:
Nonempty α