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-09-03 16:00:38 -07:00
|
|
|
open inhabited
|
2014-08-19 19:32:44 -07:00
|
|
|
|
2014-10-07 18:02:15 -07:00
|
|
|
inductive nonempty [class] (A : Type) : Prop :=
|
2014-09-04 16:36:06 -07:00
|
|
|
intro : A → nonempty A
|
2014-08-15 13:04:32 -07:00
|
|
|
|
2014-09-04 16:36:06 -07:00
|
|
|
namespace nonempty
|
2014-09-19 15:04:52 -07:00
|
|
|
protected definition elim {A : Type} {B : Prop} (H1 : nonempty A) (H2 : A → B) : B :=
|
2014-09-04 16:36:06 -07:00
|
|
|
rec H2 H1
|
2014-08-19 19:32:44 -07:00
|
|
|
|
2014-09-04 16:36:06 -07:00
|
|
|
theorem inhabited_imp_nonempty [instance] {A : Type} (H : inhabited A) : nonempty A :=
|
|
|
|
intro (default A)
|
2014-08-19 19:32:44 -07:00
|
|
|
end nonempty
|