2014-08-01 00:48:51 +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-04 02:57:29 +00:00
|
|
|
import logic.connectives.basic
|
2014-08-01 00:48:51 +00:00
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
inductive inhabited (A : Type) : Type :=
|
2014-08-01 00:48:51 +00:00
|
|
|
| inhabited_intro : A → inhabited A
|
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
definition inhabited_elim {A : Type} {B : Type} (H1 : inhabited A) (H2 : A → B) : B :=
|
2014-08-01 00:48:51 +00:00
|
|
|
inhabited_rec H2 H1
|
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
definition inhabited_Prop [instance] : inhabited Prop :=
|
2014-08-01 00:48:51 +00:00
|
|
|
inhabited_intro true
|
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
definition inhabited_fun [instance] (A : Type) {B : Type} (H : inhabited B) : inhabited (A → B) :=
|
2014-08-01 00:48:51 +00:00
|
|
|
inhabited_elim H (take b, inhabited_intro (λa, b))
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
definition default (A : Type) {H : inhabited A} : A := inhabited_elim H (take a, a)
|