]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/datatypes/bool.ma
The library grows...
[helm.git] / helm / matita / library / datatypes / bool.ma
index cac5ebbe97c2fdad3b421bd98d522c0525c4e413..d99456dc89e1b02ee4522c26ee90cc5ab6930ded 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-set "baseuri" "cic:/matita/bool/".
+set "baseuri" "cic:/matita/datatypes/bool/".
+
+include "logic/equality.ma".
 
 inductive bool : Set \def 
   | true : bool
   | false : bool.
+  
+theorem not_eq_true_false : \lnot true = false.
+simplify.intro.
+change with 
+match true with
+[ true \Rightarrow False
+| flase \Rightarrow True].
+rewrite > H.simplify.exact I.
+qed.
 
 definition notb : bool \to bool \def
 \lambda b:bool. 
  match b with 
  [ true \Rightarrow false
  | false \Rightarrow true ].
+theorem notb_elim: \forall b:bool.\forall P:bool \to Prop.
+match b with
+[ true \Rightarrow P false
+| false \Rightarrow P true] \to P (notb b).
+intros 2.elim b.exact H. exact H.
+qed.
 
 (*CSC: the URI must disappear: there is a bug now *)
 interpretation "boolean not" 'not x = (cic:/matita/datatypes/bool/notb.con x).
@@ -30,19 +48,31 @@ interpretation "boolean not" 'not x = (cic:/matita/datatypes/bool/notb.con x).
 definition andb : bool \to bool \to bool\def
 \lambda b1,b2:bool. 
  match b1 with 
- [ true \Rightarrow 
-       match b2 with [true \Rightarrow true | false \Rightarrow false]
+ [ true \Rightarrow b2
  | false \Rightarrow false ].
 
+theorem andb_elim: \forall b1,b2:bool. \forall P:bool \to Prop.
+match b1 with
+[ true \Rightarrow P b2
+| false \Rightarrow P false] \to P (andb b1 b2).
+intros 3.elim b1.exact H. exact H.
+qed.
+
 (*CSC: the URI must disappear: there is a bug now *)
 interpretation "boolean and" 'and x y = (cic:/matita/datatypes/bool/andb.con x y).
 
 definition orb : bool \to bool \to bool\def
 \lambda b1,b2:bool. 
  match b1 with 
- [ true \Rightarrow 
-       match b2 with [true \Rightarrow true | false \Rightarrow false]
- | false \Rightarrow false ].
+ [ true \Rightarrow true
+ | false \Rightarrow b2].
+
+theorem orb_elim: \forall b1,b2:bool. \forall P:bool \to Prop.
+match b1 with
+[ true \Rightarrow P true
+| false \Rightarrow P b2] \to P (orb b1 b2).
+intros 3.elim b1.exact H. exact H.
+qed.
 
 (*CSC: the URI must disappear: there is a bug now *)
 interpretation "boolean or" 'or x y = (cic:/matita/datatypes/bool/orb.con x y).