X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Fnat%2Ftimes.ma;h=2ae5ffd749b745783a2cf8c3eded7166cc4f8108;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=24a756dc5c3b458b790eee6fa6d336ac991c54bd;hpb=3eff4cc36820df9faddb3cb16390717851db499c;p=helm.git diff --git a/helm/matita/library/nat/times.ma b/helm/matita/library/nat/times.ma index 24a756dc5..2ae5ffd74 100644 --- a/helm/matita/library/nat/times.ma +++ b/helm/matita/library/nat/times.ma @@ -1,5 +1,5 @@ (**************************************************************************) -(* ___ *) +(* __ *) (* ||M|| *) (* ||A|| A project by Andrea Asperti *) (* ||T|| *) @@ -14,15 +14,14 @@ set "baseuri" "cic:/matita/nat/times". -include "logic/equality.ma". -include "nat/nat.ma". include "nat/plus.ma". let rec times n m \def match n with [ O \Rightarrow O - | (S p) \Rightarrow (m+(times p m)) ]. + | (S p) \Rightarrow m+(times p m) ]. +(*CSC: the URI must disappear: there is a bug now *) interpretation "natural times" 'times x y = (cic:/matita/nat/times/times.con x y). theorem times_n_O: \forall n:nat. O = n*O. @@ -32,7 +31,7 @@ simplify.assumption. qed. theorem times_n_Sm : -\forall n,m:nat.n+n*m = n*(S m). +\forall n,m:nat. n+(n*m) = n*(S m). intros.elim n. simplify.reflexivity. simplify.apply eq_f.rewrite < H. @@ -44,25 +43,45 @@ reflexivity. apply assoc_plus. qed. -(* same problem with symmetric: see plus -theorem symmetric_times : symmetric nat times. *) +theorem times_n_SO : \forall n:nat. n = n * S O. +intros. +rewrite < times_n_Sm. +rewrite < times_n_O. +rewrite < plus_n_O. +reflexivity. +qed. -theorem sym_times : -\forall n,m:nat.n*m = m*n. -intros.elim n. +theorem symmetric_times : symmetric nat times. +unfold symmetric. +intros.elim x. simplify.apply times_n_O. simplify.rewrite > H.apply times_n_Sm. qed. +variant sym_times : \forall n,m:nat. n*m = m*n \def +symmetric_times. + theorem distributive_times_plus : distributive nat times plus. -simplify. +unfold distributive. intros.elim x. simplify.reflexivity. simplify.rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus. -apply eq_f.rewrite < assoc_plus. rewrite < sym_plus ? z. +apply eq_f.rewrite < assoc_plus. rewrite < (sym_plus ? z). rewrite > assoc_plus.reflexivity. qed. -variant times_plus_distr: \forall n,m,p:nat. n*(m+p)=n*m+n*p +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. +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.