2014-08-15 20:04:32 +00:00
|
|
|
-- 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
|
2014-08-28 01:39:55 +00:00
|
|
|
import .inhabited
|
2014-09-03 23:00:38 +00:00
|
|
|
open inhabited
|
2014-08-20 02:32:44 +00:00
|
|
|
|
2014-08-15 20:04:32 +00:00
|
|
|
inductive nonempty (A : Type) : Prop :=
|
2014-09-04 23:36:06 +00:00
|
|
|
intro : A → nonempty A
|
2014-08-15 20:04:32 +00:00
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
namespace nonempty
|
|
|
|
definition elim [protected] {A : Type} {B : Prop} (H1 : nonempty A) (H2 : A → B) : B :=
|
|
|
|
rec H2 H1
|
2014-08-20 02:32:44 +00:00
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
theorem inhabited_imp_nonempty [instance] {A : Type} (H : inhabited A) : nonempty A :=
|
|
|
|
intro (default A)
|
2014-08-20 02:32:44 +00:00
|
|
|
end nonempty
|