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