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 "logic/equality.ma".
19 include "nat/plus.ma".
21 let rec times n m \def
24 | (S p) \Rightarrow (m+(times p m)) ].
26 (*CSC: the URI must disappear: there is a bug now *)
27 interpretation "natural times" 'times x y = (cic:/matita/nat/times/times.con x y).
29 theorem times_n_O: \forall n:nat. O = n*O.
36 \forall n,m:nat.n+n*m = n*(S m).
39 simplify.apply eq_f.rewrite < H.
40 transitivity ((n1+m)+n1*m).symmetry.apply assoc_plus.
41 transitivity ((m+n1)+n1*m).
48 (* same problem with symmetric: see plus
49 theorem symmetric_times : symmetric nat times. *)
52 \forall n,m:nat.n*m = m*n.
54 simplify.apply times_n_O.
55 simplify.rewrite > H.apply times_n_Sm.
58 theorem distributive_times_plus : distributive nat times plus.
62 simplify.rewrite > H. rewrite > assoc_plus.rewrite > assoc_plus.
63 apply eq_f.rewrite < assoc_plus. rewrite < sym_plus ? z.
64 rewrite > assoc_plus.reflexivity.
67 variant times_plus_distr: \forall n,m,p:nat. n*(m+p)=n*m+n*p
68 \def distributive_times_plus.