X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Fnat%2Fsigma_and_pi.ma;h=6bd6af38c52eae0f4163938fd245f3bfa4e1b657;hb=7273c698dd60c1a8a0f35b44376acb548c6a4a33;hp=29df3a1dfdab2b76f726748897621bd7758dd3d1;hpb=5a702cea95883f7095c16b450e065ccb1714fc5a;p=helm.git diff --git a/helm/matita/library/nat/sigma_and_pi.ma b/helm/matita/library/nat/sigma_and_pi.ma index 29df3a1df..6bd6af38c 100644 --- a/helm/matita/library/nat/sigma_and_pi.ma +++ b/helm/matita/library/nat/sigma_and_pi.ma @@ -14,7 +14,8 @@ set "baseuri" "cic:/matita/nat/sigma_and_pi". -include "nat/times.ma". +include "nat/factorial.ma". +include "nat/lt_arith.ma". let rec sigma n f \def match n with @@ -24,4 +25,33 @@ let rec sigma n f \def let rec pi n f \def match n with [ O \Rightarrow (S O) - | (S p) \Rightarrow (f p)*(pi p f)]. \ No newline at end of file + | (S p) \Rightarrow (f p)*(pi p f)]. + +theorem eq_sigma: \forall f,g:nat \to nat. +\forall n:nat. (\forall m:nat. m < n \to f m = g m) \to +(sigma n f) = (sigma n g). +intros 3.elim n. +simplify.reflexivity. +simplify. +apply eq_f2.apply H1.simplify. apply le_n. +apply H.intros.apply H1. +apply trans_lt ? n1.assumption.simplify.apply le_n. +qed. + +theorem eq_pi: \forall f,g:nat \to nat. +\forall n:nat. (\forall m:nat. m < n \to f m = g m) \to +(pi n f) = (pi n g). +intros 3.elim n. +simplify.reflexivity. +simplify. +apply eq_f2.apply H1.simplify. apply le_n. +apply H.intros.apply H1. +apply trans_lt ? n1.assumption.simplify.apply le_n. +qed. + +theorem eq_fact_pi: \forall n. n! = pi n S. +intro.elim n. +simplify.reflexivity. +change with (S n1)*n1! = (S n1)*(pi n1 S). +apply eq_f.assumption. +qed. \ No newline at end of file