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-08-15 20:04:32 +00:00
|
|
|
|
2014-08-20 02:32:44 +00:00
|
|
|
using inhabited
|
|
|
|
|
|
|
|
namespace nonempty
|
|
|
|
|
2014-08-15 20:04:32 +00:00
|
|
|
inductive nonempty (A : Type) : Prop :=
|
2014-08-22 22:46:10 +00:00
|
|
|
nonempty_intro : A → nonempty A
|
2014-08-15 20:04:32 +00:00
|
|
|
|
2014-08-28 00:46:07 +00:00
|
|
|
definition nonempty_elim {A : Type} {B : Prop} (H1 : nonempty A) (H2 : A → B) : B :=
|
2014-08-15 20:04:32 +00:00
|
|
|
nonempty_rec H2 H1
|
|
|
|
|
|
|
|
theorem inhabited_imp_nonempty [instance] {A : Type} (H : inhabited A) : nonempty A :=
|
|
|
|
nonempty_intro (default A)
|
2014-08-20 02:32:44 +00:00
|
|
|
|
|
|
|
end nonempty
|