1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Cosimo Oliboni, oliboni@cs.unibo.it *)
21 (* ********************************************************************** *)
23 include "freescale/theory.ma".
24 include "freescale/bool.ma".
30 ndefinition bool_destruct_aux ≝
31 Πb1,b2:bool.ΠP:Prop.b1 = b2 →
33 [ true ⇒ match b2 with [ true ⇒ P → P | false ⇒ P ]
34 | false ⇒ match b2 with [ true ⇒ P | false ⇒ P → P ]
37 ndefinition bool_destruct : bool_destruct_aux.
43 ##[ ##2: napply False_ind;
44 nchange with (match true with [ true ⇒ False | false ⇒ True]);
48 ##| ##3: napply False_ind;
49 nchange with (match true with [ true ⇒ False | false ⇒ True]);
53 ##| ##1,4: napply (λx:P.x)
57 nlemma symmetric_eqbool : symmetricT bool bool eq_bool.
65 nlemma symmetric_andbool : symmetricT bool bool and_bool.
73 nlemma associative_andbool : ∀b1,b2,b3.((b1 ⊗ b2) ⊗ b3) = (b1 ⊗ (b2 ⊗ b3)).
82 nlemma symmetric_orbool : symmetricT bool bool or_bool.
90 nlemma associative_orbool : ∀b1,b2,b3.((b1 ⊕ b2) ⊕ b3) = (b1 ⊕ (b2 ⊕ b3)).
99 nlemma symmetric_xorbool : symmetricT bool bool xor_bool.
107 nlemma associative_xorbool : ∀b1,b2,b3.((b1 ⊙ b2) ⊙ b3) = (b1 ⊙ (b2 ⊙ b3)).
116 nlemma eqbool_to_eq : ∀b1,b2:bool.(eq_bool b1 b2 = true) → (b1 = b2).
121 ##[ ##1,4: #H; napply refl_eq
122 ##| ##*: #H; napply (bool_destruct … H)
126 nlemma eq_to_eqbool : ∀b1,b2.b1 = b2 → eq_bool b1 b2 = true.
131 ##[ ##1,4: #H; napply refl_eq
132 ##| ##*: #H; napply (bool_destruct … H)
136 nlemma andb_true_true_l: ∀b1,b2.(b1 ⊗ b2) = true → b1 = true.
141 ##[ ##1,2: #H; napply refl_eq
142 ##| ##*: #H; napply (bool_destruct … H)
146 nlemma andb_true_true_r: ∀b1,b2.(b1 ⊗ b2) = true → b2 = true.
151 ##[ ##1,3: #H; napply refl_eq
152 ##| ##*: #H; napply (bool_destruct … H)
156 nlemma orb_false_false_l : ∀b1,b2:bool.(b1 ⊕ b2) = false → b1 = false.
161 ##[ ##4: #H; napply refl_eq
162 ##| ##*: #H; napply (bool_destruct … H)
166 nlemma orb_false_false_r : ∀b1,b2:bool.(b1 ⊕ b2) = false → b2 = false.
171 ##[ ##4: #H; napply refl_eq
172 ##| ##*: #H; napply (bool_destruct … H)