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 include "nat/times.ma".
16 include "nat/minus.ma".
18 (* if gcd is compiled before this, the applys will take too much *)
20 theorem times_plus_l: \forall n,m,p:nat. (n+m)*p = n*p + m*p.
22 apply (trans_eq ? ? (p*(n+m))).
24 apply (trans_eq ? ? (p*n+p*m)).
25 apply distr_times_plus.
31 theorem times_minus_l: \forall n,m,p:nat. (n-m)*p = n*p - m*p.
33 apply (trans_eq ? ? (p*(n-m))).
35 apply (trans_eq ? ? (p*n-p*m)).
36 apply distr_times_minus.
42 theorem times_plus_plus: \forall n,m,p,q:nat. (n + m)*(p + q) =
43 n*p + n*q + m*p + m*q.
45 apply (trans_eq nat ? ((n*(p+q) + m*(p+q)))).
47 rewrite > distr_times_plus.
48 rewrite > distr_times_plus.
49 rewrite < assoc_plus.reflexivity.
52 theorem eq_pred_to_eq:
53 ∀n,m. O < n → O < m → pred n = pred m → n = m.
55 generalize in match (eq_f ? ? S ? ? H2);
57 rewrite < S_pred in H3;
58 rewrite < S_pred in H3;