X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fnat%2Ftimes.ma;h=f59622218e84c38535f862a7f8917fd7a5b4d87d;hb=e880d6eab5e1700f4a625ddcd7d0fa8f0cce2dcc;hp=ec0f861998c2314536888bae8882de035fb21682;hpb=3f5a0152427fd9a89e7239befd259d27b97aaef5;p=helm.git diff --git a/helm/software/matita/library/nat/times.ma b/helm/software/matita/library/nat/times.ma index ec0f86199..f59622218 100644 --- a/helm/software/matita/library/nat/times.ma +++ b/helm/software/matita/library/nat/times.ma @@ -1,3 +1,4 @@ + (**************************************************************************) (* __ *) (* ||M|| *) @@ -12,8 +13,6 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/nat/times". - include "nat/plus.ma". let rec times n m \def @@ -21,7 +20,12 @@ let rec times n m \def [ O \Rightarrow O | (S p) \Rightarrow m+(times p m) ]. -interpretation "natural times" 'times x y = (cic:/matita/nat/times/times.con x y). +interpretation "natural times" 'times x y = (times x y). + +theorem times_Sn_m: +\forall n,m:nat. m+n*m = S n*m. +intros. reflexivity. +qed. theorem times_n_O: \forall n:nat. O = n*O. intros.elim n. @@ -33,13 +37,17 @@ theorem times_n_Sm : \forall n,m:nat. n+(n*m) = n*(S m). intros.elim n. simplify.reflexivity. -simplify.apply eq_f.rewrite < H. +simplify. +demodulate all. +(* +apply eq_f.rewrite < H. transitivity ((n1+m)+n1*m).symmetry.apply assoc_plus. transitivity ((m+n1)+n1*m). apply eq_f2. apply sym_plus. reflexivity. apply assoc_plus. +*) qed. theorem times_O_to_O: \forall n,m:nat.n*m = O \to n = O \lor m= O. @@ -53,11 +61,11 @@ apply nat_elim2;intros qed. theorem times_n_SO : \forall n:nat. n = n * S O. -intros. +intros. demodulate. reflexivity. (* rewrite < times_n_Sm. rewrite < times_n_O. rewrite < plus_n_O. -reflexivity. +reflexivity.*) qed. theorem times_SSO_n : \forall n:nat. n + n = S (S O) * n. @@ -90,9 +98,11 @@ qed. theorem symmetric_times : symmetric nat times. unfold symmetric. -intros.elim x. -simplify.apply times_n_O. -simplify.rewrite > H.apply times_n_Sm. +intros.elim x; + [ simplify. apply times_n_O. + | demodulate. reflexivity. (* +(* applyS times_n_Sm. *) +simplify.rewrite > H.apply times_n_Sm.*)] qed. variant sym_times : \forall n,m:nat. n*m = m*n \def @@ -102,23 +112,38 @@ theorem distributive_times_plus : distributive nat times plus. unfold distributive. intros.elim x. simplify.reflexivity. -simplify.rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus. +simplify. +demodulate all. +(* +rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus. apply eq_f.rewrite < assoc_plus. rewrite < (sym_plus ? z). -rewrite > assoc_plus.reflexivity. +rewrite > assoc_plus.reflexivity. *) qed. variant distr_times_plus: \forall n,m,p:nat. n*(m+p) = n*m + n*p \def distributive_times_plus. theorem associative_times: associative nat times. -unfold associative.intros. -elim x.simplify.apply refl_eq. -simplify.rewrite < sym_times. +unfold associative. +intros. +elim x. simplify.apply refl_eq. +simplify. +demodulate all. +(* +rewrite < sym_times. rewrite > distr_times_plus. rewrite < sym_times. rewrite < (sym_times (times n y) z). rewrite < H.apply refl_eq. +*) qed. variant assoc_times: \forall n,m,p:nat. (n*m)*p = n*(m*p) \def associative_times. + +lemma times_times: ∀x,y,z. x*(y*z) = y*(x*z). +intros. +demodulate. reflexivity. +(* autobatch paramodulation. *) +qed. +