1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/nat/times".
17 include "nat/plus.ma".
19 let rec times n m \def
22 | (S p) \Rightarrow m+(times p m) ].
24 (*CSC: the URI must disappear: there is a bug now *)
25 interpretation "natural times" 'times x y = (cic:/matita/nat/times/times.con x y).
27 theorem times_n_O: \forall n:nat. O = n*O.
34 \forall n,m:nat. n+(n*m) = n*(S m).
37 simplify.apply eq_f.rewrite < H.
38 transitivity ((n1+m)+n1*m).symmetry.apply assoc_plus.
39 transitivity ((m+n1)+n1*m).
46 theorem times_n_SO : \forall n:nat. n = n * S O.
54 theorem times_SSO_n : \forall n:nat. n + n = S (S O) * n.
61 theorem symmetric_times : symmetric nat times.
64 simplify.apply times_n_O.
65 simplify.rewrite > H.apply times_n_Sm.
68 variant sym_times : \forall n,m:nat. n*m = m*n \def
71 theorem distributive_times_plus : distributive nat times plus.
75 simplify.rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus.
76 apply eq_f.rewrite < assoc_plus. rewrite < (sym_plus ? z).
77 rewrite > assoc_plus.reflexivity.
80 variant distr_times_plus: \forall n,m,p:nat. n*(m+p) = n*m + n*p
81 \def distributive_times_plus.
83 theorem associative_times: associative nat times.
84 unfold associative.intros.
85 elim x.simplify.apply refl_eq.
86 simplify.rewrite < sym_times.
87 rewrite > distr_times_plus.
89 rewrite < (sym_times (times n y) z).
90 rewrite < H.apply refl_eq.
93 variant assoc_times: \forall n,m,p:nat. (n*m)*p = n*(m*p) \def