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/library_autobatch/nat/times".
17 include "auto/nat/plus.ma".
19 let rec times n m \def
22 | (S p) \Rightarrow m+(times p m) ].
24 interpretation "natural times" 'times x y = (times x y).
26 theorem times_n_O: \forall n:nat. O = n*O.
31 | simplify. (* qui autobatch non funziona: Uncaught exception: Invalid_argument ("List.map2")*)
37 \forall n,m:nat. n+(n*m) = n*(S m).
40 (*simplify.reflexivity.*)
45 transitivity ((n1+m)+n1*m)
48 | transitivity ((m+n1)+n1*m)
59 se non avessi semplificato con autobatch tutto il secondo ramo della tattica
60 elim n, avrei comunque potuto risolvere direttamente con autobatch entrambi
61 i rami generati dalla prima applicazione della tattica transitivity
62 (precisamente transitivity ((n1+m)+n1*m)
65 theorem times_n_SO : \forall n:nat. n = n * S O.
68 autobatch paramodulation. (*termina la dim anche solo con autobatch*)
69 (*rewrite < times_n_O.
74 theorem times_SSO_n : \forall n:nat. n + n = S (S O) * n.
77 autobatch paramodulation. (* termina la dim anche solo con autobatch*)
82 theorem symmetric_times : symmetric nat times.
86 (*simplify.apply times_n_O.*)
89 (*rewrite > H.apply times_n_Sm.*)
93 variant sym_times : \forall n,m:nat. n*m = m*n \def
96 theorem distributive_times_plus : distributive nat times plus.
98 intros.elim x;simplify
102 rewrite > assoc_plus.
103 rewrite > assoc_plus.
105 rewrite < assoc_plus.
106 rewrite < (sym_plus ? z).
107 rewrite > assoc_plus.
112 variant distr_times_plus: \forall n,m,p:nat. n*(m+p) = n*m + n*p
113 \def distributive_times_plus.
115 theorem associative_times: associative nat times.
116 unfold associative.intros.
120 (*rewrite < sym_times.
121 rewrite > distr_times_plus.
123 rewrite < (sym_times (times n y) z).
129 variant assoc_times: \forall n,m,p:nat. (n*m)*p = n*(m*p) \def