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
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