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 (λx.P) ?);
44 (* perche' non napply (False_ind ??); !!! *)
45 nchange with (match true with [ true ⇒ False | false ⇒ True]);
49 ##| ##3: napply (False_ind (λx.P) ?);
50 (* perche' non napply (False_ind ??); !!! *)
51 nchange with (match true with [ true ⇒ False | false ⇒ True]);
55 ##| ##1,4: napply (λx:P.x)
59 nlemma symmetric_eqbool : symmetricT bool bool eq_bool.
67 nlemma symmetric_andbool : symmetricT bool bool and_bool.
75 nlemma associative_andbool : ∀b1,b2,b3.((b1 ⊗ b2) ⊗ b3) = (b1 ⊗ (b2 ⊗ b3)).
84 nlemma symmetric_orbool : symmetricT bool bool or_bool.
92 nlemma associative_orbool : ∀b1,b2,b3.((b1 ⊕ b2) ⊕ b3) = (b1 ⊕ (b2 ⊕ b3)).
101 nlemma symmetric_xorbool : symmetricT bool bool xor_bool.
109 nlemma associative_xorbool : ∀b1,b2,b3.((b1 ⊙ b2) ⊙ b3) = (b1 ⊙ (b2 ⊙ b3)).
118 nlemma eqbool_to_eq : ∀b1,b2:bool.(eq_bool b1 b2 = true) → (b1 = b2).
123 ##[ ##1,4: #H; napply (refl_eq ??)
124 ##| ##*: #H; napply (bool_destruct ??? H)
128 nlemma eq_to_eqbool : ∀b1,b2.b1 = b2 → eq_bool b1 b2 = true.
133 ##[ ##1,4: #H; napply (refl_eq ??)
134 ##| ##*: #H; napply (bool_destruct ??? H)
138 nlemma andb_true_true_l: ∀b1,b2.(b1 ⊗ b2) = true → b1 = true.
143 ##[ ##1,2: #H; napply (refl_eq ??)
144 ##| ##*: #H; napply (bool_destruct ??? H)
148 nlemma andb_true_true_r: ∀b1,b2.(b1 ⊗ b2) = true → b2 = true.
153 ##[ ##1,3: #H; napply (refl_eq ??)
154 ##| ##*: #H; napply (bool_destruct ??? H)
158 nlemma orb_false_false_l : ∀b1,b2:bool.(b1 ⊕ b2) = false → b1 = false.
163 ##[ ##4: #H; napply (refl_eq ??)
164 ##| ##*: #H; napply (bool_destruct ??? H)
168 nlemma orb_false_false_r : ∀b1,b2:bool.(b1 ⊕ b2) = false → b2 = false.
173 ##[ ##4: #H; napply (refl_eq ??)
174 ##| ##*: #H; napply (bool_destruct ??? H)