feat(library/standard/classes): add nonempty
This commit is contained in:
parent
39c1683546
commit
5b7fb1f61a
1 changed files with 14 additions and 0 deletions
14
library/standard/logic/classes/nonempty.lean
Normal file
14
library/standard/logic/classes/nonempty.lean
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
-- Authors: Leonardo de Moura, Jeremy Avigad
|
||||||
|
|
||||||
|
import logic.connectives.basic .inhabited
|
||||||
|
|
||||||
|
inductive nonempty (A : Type) : Prop :=
|
||||||
|
| nonempty_intro : A → nonempty A
|
||||||
|
|
||||||
|
definition nonempty_elim {A : Type} {B : Type} (H1 : nonempty A) (H2 : A → B) : B :=
|
||||||
|
nonempty_rec H2 H1
|
||||||
|
|
||||||
|
theorem inhabited_imp_nonempty [instance] {A : Type} (H : inhabited A) : nonempty A :=
|
||||||
|
nonempty_intro (default A)
|
Loading…
Reference in a new issue