2014-08-12 00:35:25 +00:00
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
2014-09-05 16:31:27 +00:00
|
|
|
-- Author: Jeremy Avigad, Floris van Doorn
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
|
|
-- Empty type
|
|
|
|
-- ----------
|
2014-12-01 04:34:12 +00:00
|
|
|
import logic.cast logic.subsingleton
|
2014-08-12 00:35:25 +00:00
|
|
|
|
2014-09-05 05:31:52 +00:00
|
|
|
namespace empty
|
2014-09-19 22:04:52 +00:00
|
|
|
protected theorem elim (A : Type) (H : empty) : A :=
|
2014-09-05 05:31:52 +00:00
|
|
|
rec (λe, A) H
|
2014-10-09 01:41:18 +00:00
|
|
|
|
|
|
|
protected theorem subsingleton [instance] : subsingleton empty :=
|
|
|
|
subsingleton.intro (λ a b, !elim a)
|
2014-09-05 05:31:52 +00:00
|
|
|
end empty
|
2014-11-09 01:55:42 +00:00
|
|
|
|
2014-12-01 04:34:12 +00:00
|
|
|
protected definition empty.has_decidable_eq [instance] : decidable_eq empty :=
|
|
|
|
take (a b : empty), decidable.inl (!empty.elim a)
|
|
|
|
|
2014-11-09 01:55:42 +00:00
|
|
|
definition tneg.tneg (A : Type) := A → empty
|
|
|
|
prefix `~` := tneg.tneg
|
|
|
|
namespace tneg
|
|
|
|
variables {A B : Type}
|
|
|
|
protected definition intro (H : A → empty) : ~A := H
|
|
|
|
protected definition elim (H1 : ~A) (H2 : A) : empty := H1 H2
|
|
|
|
protected definition empty : ~empty := λH : empty, H
|
|
|
|
definition tabsurd (H1 : A) (H2 : ~A) : B := !empty.elim (H2 H1)
|
|
|
|
definition tneg_tneg_intro (H : A) : ~~A := λH2 : ~A, tneg.elim H2 H
|
|
|
|
definition tmt (H1 : A → B) (H2 : ~B) : ~A := λHA : A, tabsurd (H1 HA) H2
|
|
|
|
|
|
|
|
definition tneg_pi_left {B : A → Type} (H : ~Πa, B a) : ~~A :=
|
|
|
|
λHnA : ~A, tneg.elim H (λHA : A, tabsurd HA HnA)
|
|
|
|
|
|
|
|
definition tneg_function_right (H : ~(A → B)) : ~B :=
|
|
|
|
λHB : B, tneg.elim H (λHA : A, HB)
|
|
|
|
|
|
|
|
|
|
|
|
end tneg
|