lean2/library/standard/bool_decidable.lean
Leonardo de Moura 29b6d1081c feat(library/standard/bool_decidable): cleanup bool_decidable, and remove the artificial dependency to bit
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-21 02:42:11 +01:00

18 lines
792 B
Text

-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
import classical hilbert decidable
using decidable
-- Excluded middle + Hilbert implies every proposition is decidable
-- First, we show that (decidable a) is inhabited for any 'a' using the excluded middle
theorem inhabited_decidable [instance] (a : Bool) : inhabited (decidable a)
:= or_elim (em a)
(assume Ha, inhabited_intro (inl Ha))
(assume Hna, inhabited_intro (inr Hna))
-- Note that inhabited_decidable is marked as an instance, and it is silently used
-- for synthesizing the implicit argument in the following 'epsilon'
theorem bool_decidable [instance] (a : Bool) : decidable a
:= epsilon (λ d, true)