X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fnat%2Fexp.ma;h=c6e2a008ba565a043360d1bad656b1fe037b7141;hb=7288b45eacf9f7dcd118b3b89b81ff19ae9d6ce5;hp=193478c0fd6706ddc075aa2d6402051f553489e8;hpb=06a19bec47845ecffe3bf9d9a95d3d4dadf76861;p=helm.git diff --git a/helm/software/matita/library/nat/exp.ma b/helm/software/matita/library/nat/exp.ma index 193478c0f..c6e2a008b 100644 --- a/helm/software/matita/library/nat/exp.ma +++ b/helm/software/matita/library/nat/exp.ma @@ -12,8 +12,6 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/nat/exp". - include "nat/div_and_mod.ma". include "nat/lt_arith.ma". @@ -22,7 +20,7 @@ let rec exp n m on m\def [ O \Rightarrow (S O) | (S p) \Rightarrow (times n (exp n p)) ]. -interpretation "natural exponent" 'exp a b = (cic:/matita/nat/exp/exp.con a b). +interpretation "natural exponent" 'exp a b = (exp a b). theorem exp_plus_times : \forall n,p,q:nat. n \sup (p + q) = (n \sup p) * (n \sup q). @@ -40,6 +38,19 @@ theorem exp_n_SO : \forall n:nat. n = n \sup (S O). intro.simplify.rewrite < times_n_SO.reflexivity. qed. +theorem exp_SO_n : \forall n:nat. S O = (S O) \sup n. +intro.elim n + [reflexivity + |simplify.rewrite < plus_n_O.assumption + ] +qed. + +theorem exp_SSO: \forall n. exp n (S(S O)) = n*n. +intro.simplify. +rewrite < times_n_SO. +reflexivity. +qed. + theorem exp_exp_times : \forall n,p,q:nat. (n \sup p) \sup q = n \sup (p * q). intros. @@ -140,6 +151,15 @@ apply nat_elim2 ] qed. +theorem lt_exp1: \forall n,m,p:nat. O < p \to n < m \to exp n p < exp m p. +intros. +elim H + [rewrite < exp_n_SO.rewrite < exp_n_SO.assumption + |simplify. + apply lt_times;assumption + ] +qed. + theorem le_exp_to_le: \forall a,n,m. S O < a \to exp a n \le exp a m \to n \le m. intro. @@ -164,8 +184,69 @@ apply nat_elim2;intros ] qed. +theorem le_exp_to_le1 : \forall n,m,p.O < p \to exp n p \leq exp m p \to n \leq m. +intros;apply not_lt_to_le;intro;apply (lt_to_not_le ? ? ? H1); +apply lt_exp1;assumption. +qed. + +theorem lt_exp_to_lt: +\forall a,n,m. S O < a \to exp a n < exp a m \to n < m. +intros. +elim (le_to_or_lt_eq n m) + [assumption + |apply False_ind. + apply (lt_to_not_eq ? ? H1). + rewrite < H2. + reflexivity + |apply (le_exp_to_le a) + [assumption + |apply lt_to_le. + assumption + ] + ] +qed. +theorem lt_exp_to_lt1: +\forall a,n,m. O < a \to exp n a < exp m a \to n < m. +intros. +elim (le_to_or_lt_eq n m) + [assumption + |apply False_ind. + apply (lt_to_not_eq ? ? H1). + rewrite < H2. + reflexivity + |apply (le_exp_to_le1 ? ? a) + [assumption + |apply lt_to_le. + assumption + ] + ] +qed. - +theorem times_exp: +\forall n,m,p. exp n p * exp m p = exp (n*m) p. +intros.elim p + [simplify.reflexivity + |simplify. + rewrite > assoc_times. + rewrite < assoc_times in ⊢ (? ? (? ? %) ?). + rewrite < sym_times in ⊢ (? ? (? ? (? % ?)) ?). + rewrite > assoc_times in ⊢ (? ? (? ? %) ?). + rewrite < assoc_times. + rewrite < H. + reflexivity + ] +qed. + +theorem monotonic_exp1: \forall n. +monotonic nat le (\lambda x.(exp x n)). +unfold monotonic. intros. +simplify.elim n + [apply le_n + |simplify. + apply le_times;assumption + ] +qed. + \ No newline at end of file