2014-12-22 19:54:01 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Author: Leonardo de Moura
|
2015-04-08 23:28:13 +00:00
|
|
|
|
|
|
|
Excluded middle + Hilbert implies every proposition is decidable.
|
2014-12-22 19:54:01 +00:00
|
|
|
-/
|
2015-06-15 00:33:22 +00:00
|
|
|
import logic.axioms.prop_complete logic.axioms.hilbert data.sum
|
|
|
|
open decidable inhabited nonempty sum
|
2014-07-19 19:09:47 +00:00
|
|
|
|
2015-07-29 15:58:34 +00:00
|
|
|
noncomputable definition decidable_inhabited [instance] [priority 0] (a : Prop) : inhabited (decidable a) :=
|
2014-12-22 19:54:01 +00:00
|
|
|
inhabited_of_nonempty
|
2014-09-05 04:25:21 +00:00
|
|
|
(or.elim (em a)
|
2014-09-04 23:36:06 +00:00
|
|
|
(assume Ha, nonempty.intro (inl Ha))
|
|
|
|
(assume Hna, nonempty.intro (inr Hna)))
|
2014-07-19 19:09:47 +00:00
|
|
|
|
2015-07-29 15:58:34 +00:00
|
|
|
noncomputable definition prop_decidable [instance] [priority 0] (a : Prop) : decidable a :=
|
2015-04-08 23:28:13 +00:00
|
|
|
arbitrary (decidable a)
|
2015-06-15 00:33:22 +00:00
|
|
|
|
2015-07-29 15:58:34 +00:00
|
|
|
noncomputable definition type_decidable (A : Type) : A + (A → false) :=
|
2015-06-15 00:33:22 +00:00
|
|
|
match prop_decidable (nonempty A) with
|
|
|
|
| inl Hp := sum.inl (inhabited.value (inhabited_of_nonempty Hp))
|
|
|
|
| inr Hn := sum.inr (λ a, absurd (nonempty.intro a) Hn)
|
|
|
|
end
|