From: Claudio Sacerdoti Coen Date: Sat, 2 Jul 2005 14:50:11 +0000 (+0000) Subject: The equality tactics are now exploited. X-Git-Tag: PRE_GETTER_STORAGE~29 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=d1c92207efd70bed92a69014c0264bee717992ba;p=helm.git The equality tactics are now exploited. --- diff --git a/helm/matita/library/equality.ma b/helm/matita/library/equality.ma index cf513734a..d700ddd07 100644 --- a/helm/matita/library/equality.ma +++ b/helm/matita/library/equality.ma @@ -35,11 +35,11 @@ qed. theorem f_equal: \forall A,B:Type.\forall f:A\to B. \forall x,y:A. eq A x y \to eq B (f x) (f y). -intros.elim H.apply refl_equal. +intros.elim H.reflexivity. qed. theorem f_equal2: \forall A,B,C:Type.\forall f:A\to B \to C. \forall x1,x2:A. \forall y1,y2:B. eq A x1 x2\to eq B y1 y2\to eq C (f x1 y1) (f x2 y2). -intros.elim H1.elim H.apply refl_equal. +intros.elim H1.elim H.reflexivity. qed. diff --git a/helm/matita/library/nat.ma b/helm/matita/library/nat.ma index b58004b5a..114f8d1c1 100644 --- a/helm/matita/library/nat.ma +++ b/helm/matita/library/nat.ma @@ -45,14 +45,14 @@ definition pred: nat \to nat \def theorem pred_Sn : \forall n:nat. (eq nat n (pred (S n))). -intros. -apply refl_equal. +intros.reflexivity. qed. theorem injective_S : \forall n,m:nat. (eq nat (S n) (S m)) \to (eq nat n m). intros. -(elim (sym_eq ? ? ? (pred_Sn n))).(elim (sym_eq ? ? ? (pred_Sn m))). +rewrite > pred_Sn n. +rewrite > pred_Sn m. apply f_equal. assumption. qed. @@ -70,7 +70,7 @@ definition not_zero : nat \to Prop \def theorem O_S : \forall n:nat. Not (eq nat O (S n)). intros.simplify.intros. -cut (not_zero O).exact Hcut.elim (sym_eq ? ? ? H). +cut (not_zero O).exact Hcut.rewrite > H. exact I. qed. @@ -78,28 +78,30 @@ theorem n_Sn : \forall n:nat. Not (eq nat n (S n)). intros.elim n.apply O_S.apply not_eq_S.assumption. qed. - let rec plus n m \def match n with [ O \Rightarrow m | (S p) \Rightarrow S (plus p m) ]. theorem plus_n_O: \forall n:nat. eq nat n (plus n O). -intros.elim n.simplify.apply refl_equal.simplify.apply f_equal.assumption. +intros.elim n.simplify.reflexivity. +simplify.apply f_equal.assumption. qed. theorem plus_n_Sm : \forall n,m:nat. eq nat (S (plus n m)) (plus n (S m)). -intros.elim n.simplify.apply refl_equal.simplify.apply f_equal.assumption. +intros.elim n.simplify.reflexivity. +simplify.apply f_equal.assumption. qed. theorem sym_plus: \forall n,m:nat. eq nat (plus n m) (plus m n). intros.elim n.simplify.apply plus_n_O. -simplify.elim (sym_eq ? ? ? H).apply plus_n_Sm. +simplify.rewrite > H.apply plus_n_Sm. qed. theorem assoc_plus: \forall n,m,p:nat. eq nat (plus (plus n m) p) (plus n (plus m p)). -intros.elim n.simplify.apply refl_equal.simplify.apply f_equal.assumption. +intros.elim n.simplify.reflexivity. +simplify.apply f_equal.assumption. qed. let rec times n m \def @@ -108,23 +110,24 @@ let rec times n m \def | (S p) \Rightarrow (plus m (times p m)) ]. theorem times_n_O: \forall n:nat. eq nat O (times n O). -intros.elim n.simplify.apply refl_equal.simplify.assumption. +intros.elim n.simplify.reflexivity. +simplify.assumption. qed. theorem times_n_Sm : \forall n,m:nat. eq nat (plus n (times n m)) (times n (S m)). -intros.elim n.simplify.apply refl_equal. -simplify.apply f_equal.elim H. -apply trans_eq ? ? (plus (plus e m) (times e m)).apply sym_eq. -apply assoc_plus.apply trans_eq ? ? (plus (plus m e) (times e m)). +intros.elim n.simplify.reflexivity. +simplify.apply f_equal.rewrite < H. +transitivity (plus (plus e m) (times e m)).symmetry. +apply assoc_plus.transitivity (plus (plus m e) (times e m)). apply f_equal2. -apply sym_plus.apply refl_equal.apply assoc_plus. +apply sym_plus.reflexivity.apply assoc_plus. qed. theorem sym_times : \forall n,m:nat. eq nat (times n m) (times m n). intros.elim n.simplify.apply times_n_O. -simplify.elim (sym_eq ? ? ? H).apply times_n_Sm. +simplify.rewrite < sym_eq ? ? ? H.apply times_n_Sm. qed. let rec minus n m \def @@ -146,8 +149,8 @@ theorem nat_double_ind : (\forall n:nat. R O n) \to (\forall n:nat. R (S n) O) \to (\forall n,m:nat. R n m \to R (S n) (S m)) \to \forall n,m:nat. R n m. -intros.cut \forall m:nat.R n m.apply Hcut.elim n.apply H. -apply nat_case m1.apply H1.intros.apply H2. apply H3. +intros 5.elim n.apply H. +apply nat_case m.apply H1.intros.apply H2. apply H3. qed. inductive le (n:nat) : nat \to Prop \def @@ -188,12 +191,12 @@ qed. theorem le_n_O_eq : \forall n:nat. (le n O) \to (eq nat O n). intros.cut (le n O) \to (eq nat O n).apply Hcut. assumption. -elim n.apply refl_equal. +elim n.reflexivity. apply False_ind.apply (le_Sn_O ? H2). qed. theorem le_S_n : \forall n,m:nat. le (S n) (S m) \to le n m. -intros.cut le (pred (S n)) (pred (S m)).exact Hcut. +intros.change with le (pred (S n)) (pred (S m)). elim H.apply le_n.apply trans_le ? (pred x).assumption. apply le_pred_n. qed. @@ -208,8 +211,8 @@ intros.cut (le n m) \to (le m n) \to (eq nat n m).exact Hcut H H1. apply nat_double_ind (\lambda n,m.((le n m) \to (le m n) \to eq nat n m)). intros.whd.intros. apply le_n_O_eq.assumption. -intros.whd.intros.apply sym_eq.apply le_n_O_eq.assumption. -intros.whd.intros.apply f_equal.apply H2. +intros.symmetry.apply le_n_O_eq.assumption. +intros.apply f_equal.apply H2. apply le_S_n.assumption. apply le_S_n.assumption. qed. @@ -248,10 +251,10 @@ theorem nat_compare_invert: \forall n,m:nat. eq compare (nat_compare n m) (compare_invert (nat_compare m n)). intros. apply nat_double_ind (\lambda n,m.eq compare (nat_compare n m) (compare_invert (nat_compare m n))). -intros.elim n1.simplify.apply refl_equal. -simplify.apply refl_equal. -intro.elim n1.simplify.apply refl_equal. -simplify.apply refl_equal. -intros.simplify.elim H.apply refl_equal. +intros.elim n1.simplify.reflexivity. +simplify.reflexivity. +intro.elim n1.simplify.reflexivity. +simplify.reflexivity. +intros.simplify.elim H.simplify.reflexivity. qed.