2014-07-02 15:36:05 +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
|
2014-07-04 21:25:44 +00:00
|
|
|
import logic
|
2014-07-02 15:36:05 +00:00
|
|
|
namespace bit
|
|
|
|
inductive bit : Type :=
|
|
|
|
| b0 : bit
|
|
|
|
| b1 : bit
|
|
|
|
notation `'0` := b0
|
|
|
|
notation `'1` := b1
|
2014-07-04 21:25:44 +00:00
|
|
|
|
|
|
|
theorem inhabited_bit [instance] : inhabited bit
|
|
|
|
:= inhabited_intro b0
|
2014-07-05 05:22:26 +00:00
|
|
|
|
|
|
|
definition cond {A : Type} (b : bit) (t e : A)
|
|
|
|
:= bit_rec e t b
|
|
|
|
|
|
|
|
theorem cond_b0 {A : Type} (t e : A) : cond b0 t e = e
|
|
|
|
:= refl (cond b0 t e)
|
|
|
|
|
|
|
|
theorem cond_b1 {A : Type} (t e : A) : cond b1 t e = t
|
|
|
|
:= refl (cond b1 t e)
|
2014-07-02 15:36:05 +00:00
|
|
|
end
|