]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/library/nat/sigma_and_pi.ma
permutation.ma added to the repository.
[helm.git] / helm / matita / library / nat / sigma_and_pi.ma
1 (**************************************************************************)
2 (*       ___                                                                *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||       A.Asperti, C.Sacerdoti Coen,                          *)
8 (*      ||A||       E.Tassi, S.Zacchiroli                                 *)
9 (*      \   /                                                             *)
10 (*       \ /        Matita is distributed under the terms of the          *)
11 (*        v         GNU Lesser General Public License Version 2.1         *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 set "baseuri" "cic:/matita/nat/sigma_and_pi".
16
17 include "nat/lt_arith.ma".
18
19 let rec sigma n f \def
20   match n with 
21   [ O \Rightarrow O
22   | (S p) \Rightarrow (f p)+(sigma p f)].
23
24 let rec pi n f \def
25   match n with 
26   [ O \Rightarrow (S O)
27   | (S p) \Rightarrow (f p)*(pi p f)].
28   
29 theorem eq_sigma: \forall f,g:nat \to nat.
30 \forall n:nat. (\forall m:nat. m < n \to f m = g m) \to
31 (sigma n f) = (sigma n g).
32 intros 3.elim n.
33 simplify.reflexivity.
34 simplify.
35 apply eq_f2.apply H1.simplify. apply le_n.
36 apply H.intros.apply H1.
37 apply trans_lt ? n1.assumption.simplify.apply le_n.
38 qed.
39
40 theorem eq_pi: \forall f,g:nat \to nat.
41 \forall n:nat. (\forall m:nat. m < n \to f m = g m) \to
42 (pi n f) = (pi n g).
43 intros 3.elim n.
44 simplify.reflexivity.
45 simplify.
46 apply eq_f2.apply H1.simplify. apply le_n.
47 apply H.intros.apply H1.
48 apply trans_lt ? n1.assumption.simplify.apply le_n.
49 qed.