]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/Z/times.ma
Sempre piu' breve
[helm.git] / helm / software / matita / library / Z / times.ma
index 58de9c82737871b27a4a67541268337975649132..742ef5462022e3be9a3cdc0f42f262a947c891fa 100644 (file)
@@ -12,8 +12,6 @@
 (*                                                                        *)
 (**************************************************************************)
 
-set "baseuri" "cic:/matita/Z/times".
-
 include "nat/lt_arith.ma".
 include "Z/plus.ma".
 
@@ -32,8 +30,7 @@ definition Ztimes :Z \to Z \to Z \def
          | (pos n) \Rightarrow (neg (pred ((S m) * (S n))))
          | (neg n) \Rightarrow (pos (pred ((S m) * (S n))))]].
          
-(*CSC: the URI must disappear: there is a bug now *)
-interpretation "integer times" 'times x y = (cic:/matita/Z/times/Ztimes.con x y).
+interpretation "integer times" 'times x y = (Ztimes x y).
 
 theorem Ztimes_z_OZ:  \forall z:Z. z*OZ = OZ.
 intro.elim z.
@@ -42,6 +39,8 @@ simplify.reflexivity.
 simplify.reflexivity.
 qed.
 
+definition Zone \def pos O.
+
 theorem Ztimes_neg_Zopp: \forall n:nat.\forall x:Z.
 neg n * x = - (pos n * x).
 intros.elim x.
@@ -68,6 +67,21 @@ qed.
 variant sym_Ztimes : \forall x,y:Z. x*y = y*x
 \def symmetric_Ztimes.
 
+theorem Ztimes_Zone_l: \forall z:Z. Ztimes Zone z = z.
+intro.unfold Zone.simplify.
+elim z;simplify
+  [reflexivity
+  |rewrite < plus_n_O.reflexivity
+  |rewrite < plus_n_O.reflexivity
+  ]
+qed.
+
+theorem Ztimes_Zone_r: \forall z:Z. Ztimes z Zone = z.
+intro.
+rewrite < sym_Ztimes.
+apply Ztimes_Zone_l.
+qed.
+
 theorem associative_Ztimes: associative Z Ztimes.
 unfold associative.
 intros.elim x.
@@ -234,3 +248,13 @@ qed.
 variant distr_Ztimes_Zplus: \forall x,y,z.
 x * (y + z) = x*y + x*z \def
 distributive_Ztimes_Zplus.
+
+theorem eq_plus_Zplus: \forall n,m:nat. Z_of_nat (n+m) =
+Z_of_nat n + Z_of_nat m.
+intro.cases n;intro
+  [reflexivity
+  |cases m
+    [simplify.rewrite < plus_n_O.reflexivity
+    |simplify.reflexivity.
+    ]]
+qed.