]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/demo/power_derivative.ma
- MatitaMisc: we factorized here the function out_preamble used in matitadep
[helm.git] / helm / software / matita / library / demo / power_derivative.ma
index 10cb21835790765e9e7fe64e39bd5b3f862251fb..bca5bbf0181a941d650e4bd24190706673f4ac36 100644 (file)
@@ -209,40 +209,44 @@ for @{ 'derivative $f }.
 
 interpretation "Rderivative" 'derivative f = (derivative f).
 
-notation "hvbox('x' \sup n)"
+(*  FG: we definitely do not want 'x' as a keyward! 
+ *  Any file that includes this one can not use 'x' as an identifier
+ *)  
+notation "hvbox('X' \sup n)"
   non associative with precedence 60
 for @{ 'monomio $n }.
 
-notation "hvbox('x')"
+notation "hvbox('X')"
   non associative with precedence 60
 for @{ 'monomio 1 }.
 
 interpretation "Rmonomio" 'monomio n = (monomio n).
 
-axiom derivative_x0: D[x \sup 0] = 0.
-axiom derivative_x1: D[x] = 1.
+axiom derivative_x0: D[X \sup 0] = 0.
+axiom derivative_x1: D[X] = 1.
+
 axiom derivative_mult: ∀f,g:R→R. D[f·g] = D[f]·g + f·D[g].
 
 alias symbol "middot" = "Fmult".
 
-theorem derivative_power: ∀n:nat. D[x \sup n] = n·x \sup (pred n).
+theorem derivative_power: ∀n:nat. D[X \sup n] = n·X \sup (pred n).
  assume n:nat.
  (*we proceed by induction on n to prove
- (D[x \sup n] = n · x \sup (pred n)).*)
+ (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)).
+   the thesis becomes (D[X \sup 0] = 0·X \sup (pred 0)).
   done.
  case S (m:nat).
   by induction hypothesis we know
-   (D[x \sup m] = m·x \sup (pred m)) (H).
+   (D[X \sup m] = m·X \sup (pred m)) (H).
   the thesis becomes
-   (D[x \sup (1+m)] = (1+m) · x \sup m).
+   (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).
+   (m · (X \sup (1+ pred m)) = m · X \sup m) (Ppred).
    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).
+   to prove (m · (X \sup (1+ pred m)) = m · X \sup m).
     case left.
       suppose (0 < m) (m_pos).
       using (S_pred ? m_pos) we proved (m = 1 + pred m) (H1).
@@ -251,13 +255,13 @@ theorem derivative_power: ∀n:nat. D[x \sup n] = n·x \sup (pred n).
       suppose (0=m) (m_zero). 
     by m_zero, Fmult_zero_f done.
   conclude
-     (D[x \sup (1+m)])
-   = (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
+     (D[X \sup (1+m)])
+   = (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.
 
@@ -271,30 +275,30 @@ for @{ 'derivative ${default
 interpretation "Rderivative" 'derivative \eta.f = (derivative f).
 *)
 
-notation "hvbox(\frac 'd' ('d' 'x') break p)" with precedence 90
+notation "hvbox(\frac 'd' ('d' 'X') break p)" with precedence 90
 for @{ 'derivative $p}.
 
 interpretation "Rderivative" 'derivative f = (derivative f).
 
-theorem derivative_power': ∀n:nat. D[x \sup (1+n)] = (1+n) · x \sup n.
+theorem derivative_power': ∀n:nat. D[X \sup (1+n)] = (1+n) · X \sup n.
  assume n:nat.
  (*we proceed by induction on n to prove
- (D[x \sup (1+n)] = (1+n) · x \sup n).*) elim n 0.
+ (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).
+   the thesis becomes (D[X \sup 1] = 1 · X \sup 0).
   done.
  case S (m:nat).
   by induction hypothesis we know
-   (D[x \sup (1+m)] = (1+m) · x \sup m) (H).
+   (D[X \sup (1+m)] = (1+m) · X \sup m) (H).
   the thesis becomes
-   (D[x \sup (2+m)] = (2+m) · x \sup (1+m)).
+   (D[X \sup (2+m)] = (2+m) · X \sup (1+m)).
   conclude
-     (D[x \sup (2+m)])
-   = (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,
+     (D[X \sup (2+m)])
+   = (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.