fix(library/logic/axioms/prop_decidable): fixes #704

This commit is contained in:
Leonardo de Moura 2015-06-26 19:14:36 -07:00
parent 1886b71c17
commit 97b3fd45ce
3 changed files with 8 additions and 2 deletions

View file

@ -8,13 +8,13 @@ Excluded middle + Hilbert implies every proposition is decidable.
import logic.axioms.prop_complete logic.axioms.hilbert data.sum import logic.axioms.prop_complete logic.axioms.hilbert data.sum
open decidable inhabited nonempty sum open decidable inhabited nonempty sum
theorem decidable_inhabited [instance] (a : Prop) : inhabited (decidable a) := theorem decidable_inhabited [instance] [priority 0] (a : Prop) : inhabited (decidable a) :=
inhabited_of_nonempty inhabited_of_nonempty
(or.elim (em a) (or.elim (em a)
(assume Ha, nonempty.intro (inl Ha)) (assume Ha, nonempty.intro (inl Ha))
(assume Hna, nonempty.intro (inr Hna))) (assume Hna, nonempty.intro (inr Hna)))
theorem prop_decidable [instance] (a : Prop) : decidable a := theorem prop_decidable [instance] [priority 0] (a : Prop) : decidable a :=
arbitrary (decidable a) arbitrary (decidable a)
theorem type_decidable (A : Type) : A + (A → false) := theorem type_decidable (A : Type) : A + (A → false) :=

4
tests/lean/704.lean Normal file
View file

@ -0,0 +1,4 @@
import classical
eval if true then 1 else 0
attribute prop_decidable [priority 0]
eval if true then 1 else 0

View file

@ -0,0 +1,2 @@
1
1