(* *)
(**************************************************************************)
-set "baseuri" "cic:/matita/Z/".
+set "baseuri" "cic:/matita/Z/z".
include "nat/compare.ma".
include "nat/minus.ma".
theorem associative_Zplus: associative Z Zplus.
-change with (\forall x,y,z. eq ?(Zplus (Zplus x y) z) (Zplus x (Zplus y z))).
-(* simplify. *)
+change with \forall x,y,z:Z. eq Z (Zplus (Zplus x y) z) (Zplus x (Zplus y z)).
+(* simplify. *)
intros.elim x.simplify.reflexivity.
elim e1.rewrite < (Zpred_Zplus_neg_O (Zplus y z)).
rewrite < (Zpred_Zplus_neg_O y).
apply eq_f.assumption.
qed.
-variant assoc_Zplus :
-\forall x,y,z:Z. eq Z (Zplus (Zplus x y) z) (Zplus x (Zplus y z))
+variant assoc_Zplus : \forall x,y,z:Z. eq Z (Zplus (Zplus x y) z) (Zplus x (Zplus y z))
\def associative_Zplus.
+(* Zopp *)
+definition Zopp : Z \to Z \def
+\lambda x:Z. match x with
+[ OZ \Rightarrow OZ
+| (pos n) \Rightarrow (neg n)
+| (neg n) \Rightarrow (pos n) ].
+
+theorem Zplus_Zopp: \forall x:Z. (eq Z (Zplus x (Zopp x)) OZ).
+intro.elim x.
+apply refl_eq.
+simplify.
+rewrite > nat_compare_n_n.
+simplify.apply refl_eq.
+simplify.
+rewrite > nat_compare_n_n.
+simplify.apply refl_eq.
+qed.
+