X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fdemo%2Fpower_derivative.ma;h=e8ab55c3595108eb3e08a8d60c49819752831832;hb=0e9f9d6d7a0466ee132553fb7a983eac282fb12f;hp=07e658e0b0c0c373c3ab6fbbbbb8d54d895cdf61;hpb=750d027aedc76aac9def8885dc2bdb6ccdc049d9;p=helm.git diff --git a/helm/software/matita/library/demo/power_derivative.ma b/helm/software/matita/library/demo/power_derivative.ma index 07e658e0b..e8ab55c35 100644 --- a/helm/software/matita/library/demo/power_derivative.ma +++ b/helm/software/matita/library/demo/power_derivative.ma @@ -12,8 +12,6 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/demo/power_derivative". - include "nat/plus.ma". include "nat/orders.ma". include "nat/compare.ma". @@ -90,7 +88,7 @@ let rec inj (n:nat) on n : R ≝ ] ]. -coercion cic:/matita/demo/power_derivative/inj.con. +coercion inj. axiom Rplus_Rzero_x: ∀x:R.0+x=x. axiom Rplus_comm: symmetric ? Rplus. @@ -110,7 +108,7 @@ definition monomio ≝ definition costante : nat → R → R ≝ λa:nat.λx:R.inj a. -coercion cic:/matita/demo/power_derivative/costante.con 1. +coercion costante with 1. axiom f_eq_extensional: ∀f,g:R→R.(∀x:R.f x = g x) → f=g. @@ -121,7 +119,7 @@ lemma Fmult_one_f: ∀f:R→R.1·f=f. simplify; apply f_eq_extensional; intro; - auto. + autobatch. qed. lemma Fmult_zero_f: ∀f:R→R.0·f=0. @@ -130,7 +128,7 @@ lemma Fmult_zero_f: ∀f:R→R.0·f=0. simplify; apply f_eq_extensional; intro; - auto. + autobatch. qed. lemma Fmult_commutative: symmetric ? Fmult. @@ -139,7 +137,7 @@ lemma Fmult_commutative: symmetric ? Fmult. unfold Fmult; apply f_eq_extensional; intros; - auto. + autobatch. qed. lemma Fmult_associative: associative ? Fmult. @@ -149,7 +147,7 @@ lemma Fmult_associative: associative ? Fmult. unfold Fmult; apply f_eq_extensional; intros; - auto. + autobatch. qed. lemma Fmult_Fplus_distr: distributive ? Fmult Fplus. @@ -160,7 +158,7 @@ lemma Fmult_Fplus_distr: distributive ? Fmult Fplus. apply f_eq_extensional; intros; simplify; - auto. + autobatch. qed. lemma monomio_product: @@ -173,13 +171,13 @@ lemma monomio_product: [ simplify; apply f_eq_extensional; intro; - auto + autobatch | simplify; apply f_eq_extensional; intro; cut (x\sup (n1+m) = x \sup n1 · x \sup m); [ rewrite > Hcut; - auto + autobatch | change in ⊢ (? ? % ?) with ((λx:R.x\sup(n1+m)) x); rewrite > H; reflexivity @@ -196,7 +194,7 @@ lemma costante_sum: intros; elim n; [ simplify; - auto + autobatch | simplify; clear x; clear H; @@ -205,19 +203,19 @@ lemma costante_sum: [ simplify; elim m; [ simplify; - auto + autobatch | simplify; rewrite < H; - auto + autobatch ] | simplify; rewrite < H; clear H; elim n; [ simplify; - auto + autobatch | simplify; - auto + autobatch ] ] ]. @@ -256,7 +254,6 @@ theorem derivative_power: ∀n:nat. D[x \sup n] = n·x \sup (pred n). elim n 0. case O. the thesis becomes (D[x \sup 0] = 0·x \sup (pred 0)). - by _ done. case S (m:nat). by induction hypothesis we know @@ -265,25 +262,24 @@ theorem derivative_power: ∀n:nat. D[x \sup n] = n·x \sup (pred n). (D[x \sup (1+m)] = (1+m) · x \sup m). we need to prove (m · (x \sup (1+ pred m)) = m · x \sup m) (Ppred). - by _ we proved (0 < m ∨ 0=m) (cases). + we proved (0 < m ∨ 0=m) (cases). we proceed by induction on cases to prove (m · (x \sup (1+ pred m)) = m · x \sup m). case left. suppose (0 < m) (m_pos). - by (S_pred m m_pos) we proved (m = 1 + pred m) (H1). - by _ + using (S_pred ? m_pos) we proved (m = 1 + pred m) (H1). done. case right. - suppose (0=m) (m_zero). by _ done. + suppose (0=m) (m_zero). + done. conclude (D[x \sup (1+m)]) - = (D[x · x \sup m]) by _. - = (D[x] · x \sup m + x · D[x \sup m]) by _. - = (x \sup m + x · (m · x \sup (pred m))) by _. -clear H. - = (x \sup m + m · (x \sup (1 + pred m))) by _. - = (x \sup m + m · x \sup m) by _. - = ((1+m) · x \sup m) by _ (timeout=30) + = (D[x · x \sup m]). + = (D[x] · x \sup m + x · D[x \sup m]). + = (x \sup m + x · (m · x \sup (pred m))) timeout=30. + = (x \sup m + m · (x \sup (1 + pred m))). + = (x \sup m + m · x \sup m). + = ((1+m) · x \sup m) timeout=30 by Fmult_one_f, Fmult_commutative, Fmult_Fplus_distr, costante_sum done. qed. @@ -298,8 +294,7 @@ interpretation "Rderivative" 'derivative \eta.f = (cic:/matita/demo/power_derivative/derivative.con f). *) -notation "hvbox(\frac 'd' ('d' 'x') break p)" - right associative with precedence 90 +notation "hvbox(\frac 'd' ('d' 'x') break p)" with precedence 90 for @{ 'derivative $p}. interpretation "Rderivative" 'derivative f = @@ -311,7 +306,6 @@ theorem derivative_power': ∀n:nat. D[x \sup (1+n)] = (1+n) · x \sup n. (D[x \sup (1+n)] = (1+n) · x \sup n).*) elim n 0. case O. the thesis becomes (D[x \sup 1] = 1 · x \sup 0). - by _ done. case S (m:nat). by induction hypothesis we know @@ -320,11 +314,11 @@ theorem derivative_power': ∀n:nat. D[x \sup (1+n)] = (1+n) · x \sup n. (D[x \sup (2+m)] = (2+m) · x \sup (1+m)). conclude (D[x \sup (2+m)]) - = (D[x · x \sup (1+m)]) by _. - = (D[x] · x \sup (1+m) + x · D[x \sup (1+m)]) by _. - = (x \sup (1+m) + x · (costante (1+m) · x \sup m)) by _. -clear H. - = (x \sup (1+m) + costante (1+m) · x \sup (1+m)) by _. - = (x \sup (1+m) · (costante (2 + m))) by _ + = (D[x · x \sup (1+m)]). + = (D[x] · x \sup (1+m) + x · D[x \sup (1+m)]). + = (x \sup (1+m) + x · (costante (1+m) · x \sup m)). + = (x \sup (1+m) + costante (1+m) · x \sup (1+m)). + = ((2+m) · x \sup (1+m)) timeout=30 by Fmult_one_f, Fmult_commutative, + Fmult_Fplus_distr, assoc_plus, plus_n_SO, costante_sum done. -qed. \ No newline at end of file +qed.