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_auto/nat/times".
17 include "auto/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/library_auto/nat/times/times.con x y).
27 theorem times_n_O: \forall n:nat. O = n*O.
32 | simplify. (* qui auto non funziona: Uncaught exception: Invalid_argument ("List.map2")*)
38 \forall n,m:nat. n+(n*m) = n*(S m).
41 (*simplify.reflexivity.*)
46 transitivity ((n1+m)+n1*m)
49 | transitivity ((m+n1)+n1*m)
60 se non avessi semplificato con auto tutto il secondo ramo della tattica
61 elim n, avrei comunque potuto risolvere direttamente con auto entrambi
62 i rami generati dalla prima applicazione della tattica transitivity
63 (precisamente transitivity ((n1+m)+n1*m)
66 theorem times_n_SO : \forall n:nat. n = n * S O.
69 auto paramodulation. (*termina la dim anche solo con auto*)
70 (*rewrite < times_n_O.
75 theorem times_SSO_n : \forall n:nat. n + n = S (S O) * n.
78 auto paramodulation. (* termina la dim anche solo con auto*)
83 theorem symmetric_times : symmetric nat times.
87 (*simplify.apply times_n_O.*)
90 (*rewrite > H.apply times_n_Sm.*)
94 variant sym_times : \forall n,m:nat. n*m = m*n \def
97 theorem distributive_times_plus : distributive nat times plus.
99 intros.elim x;simplify
103 rewrite > assoc_plus.
104 rewrite > assoc_plus.
106 rewrite < assoc_plus.
107 rewrite < (sym_plus ? z).
108 rewrite > assoc_plus.
113 variant distr_times_plus: \forall n,m,p:nat. n*(m+p) = n*m + n*p
114 \def distributive_times_plus.
116 theorem associative_times: associative nat times.
117 unfold associative.intros.
121 (*rewrite < sym_times.
122 rewrite > distr_times_plus.
124 rewrite < (sym_times (times n y) z).
130 variant assoc_times: \forall n,m,p:nat. (n*m)*p = n*(m*p) \def