Types that are empty #
In this file we define a typeclass is_empty
, which expresses that a type has no elements.
Main declaration #
is_empty
: a typeclass that expresses that a type is empty.
@[class]
- false : α → false
is_empty α
expresses that α
is empty.
Instances
- empty.is_empty
- pempty.is_empty
- false.is_empty
- fin.is_empty
- pi.is_empty
- pprod.is_empty_left
- pprod.is_empty_right
- prod.is_empty_left
- prod.is_empty_right
- psum.is_empty
- sum.is_empty
- subtype.is_empty
- subtype.is_empty_false
- set.has_emptyc.emptyc.is_empty
- mul_opposite.is_empty
- add_opposite.is_empty
- sym.is_empty
- plift.is_empty
- ulift.is_empty
- function.embedding.is_empty
- order.pred_order.is_empty
- order.succ_order.is_empty
- ordinal.α.is_empty
@[protected]
@[protected, instance]
def
pi.is_empty
{α : Sort u_1}
{p : α → Sort u_2}
[h : nonempty α]
[∀ (x : α), is_empty (p x)] :
is_empty (Π (x : α), p x)
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
subtypes of an empty type are empty
subtypes by an all-false predicate are false.
@[protected, instance]
subtypes by false are false.
Eliminate out of a type that is_empty
(without using projection notation).
Equations
- is_empty_elim a = _.elim
@[protected]
Eliminate out of a type that is_empty
(using projection notation).
Equations
- h.elim a = is_empty_elim a
@[protected]
Non-dependent version of is_empty.elim
. Helpful if the elaborator cannot elaborate h.elim a
correctly.
@[protected, instance]
@[simp]
theorem
function.extend_of_empty
{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
[is_empty α]
(f : α → β)
(g : α → γ)
(h : β → γ) :
function.extend f g h = h