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 (* \ / Matita is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/nat/sigma_and_pi".
17 include "nat/factorial.ma".
19 include "nat/lt_arith.ma".
21 let rec sigma n f m \def
24 | (S p) \Rightarrow (f (S p+m))+(sigma p f m)].
29 | (S p) \Rightarrow (f (S p+m))*(pi p f m)].
31 theorem eq_sigma: \forall f,g:nat \to nat.
33 (\forall i:nat. m \le i \to i \le m+n \to f i = g i) \to
34 (sigma n f m) = (sigma n g m).
36 simplify.apply H.apply le_n.rewrite < plus_n_O.apply le_n.
39 change with (m \le (S n1)+m).apply le_plus_n.
40 rewrite > (sym_plus m).apply le_n.
41 apply H.intros.apply H1.assumption.
43 apply le_S.assumption.
46 theorem eq_pi: \forall f,g:nat \to nat.
48 (\forall i:nat. m \le i \to i \le m+n \to f i = g i) \to
49 (pi n f m) = (pi n g m).
51 simplify.apply H.apply le_n.rewrite < plus_n_O.apply le_n.
54 change with (m \le (S n1)+m).apply le_plus_n.
55 rewrite > (sym_plus m).apply le_n.
56 apply H.intros.apply H1.assumption.
58 apply le_S.assumption.
61 theorem eq_fact_pi: \forall n. (S n)! = pi n (\lambda m.m) (S O).
64 change with ((S(S n1))*(S n1)! = ((S n1)+(S O))*(pi n1 (\lambda m.m) (S O))).
65 rewrite < plus_n_Sm.rewrite < plus_n_O.
66 apply eq_f.assumption.
69 theorem exp_pi_l: \forall f:nat\to nat.\forall n,m,a:nat.
70 (exp a (S n))*pi n f m= pi n (\lambda p.a*(f p)) m.
71 intros.elim n.simplify.rewrite < times_n_SO.reflexivity.
74 rewrite > assoc_times.
75 rewrite > assoc_times in\vdash (? ? ? %).
76 apply eq_f.rewrite < assoc_times.
77 rewrite < assoc_times.
78 apply eq_f2.apply sym_times.reflexivity.