src/HOL/MacLaurin.thy
changeset 32038 4127b89f48ab
parent 31882 3578434d645d
child 32047 c141f139ce26
     1.1 --- a/src/HOL/MacLaurin.thy	Fri Jul 10 10:45:49 2009 -0400
     1.2 +++ b/src/HOL/MacLaurin.thy	Fri Jul 10 12:55:06 2009 -0400
     1.3 @@ -27,6 +27,10 @@
     1.4  lemma eq_diff_eq': "(x = y - z) = (y = x + (z::real))"
     1.5  by arith
     1.6  
     1.7 +lemma fact_diff_Suc [rule_format]:
     1.8 +  "n < Suc m ==> fact (Suc m - n) = (Suc m - n) * fact (m - n)"
     1.9 +  by (subst fact_reduce_nat, auto)
    1.10 +
    1.11  lemma Maclaurin_lemma2:
    1.12    assumes diff: "\<forall>m t. m < n \<and> 0\<le>t \<and> t\<le>h \<longrightarrow> DERIV (diff m) t :> diff (Suc m) t"
    1.13    assumes n: "n = Suc k"
    1.14 @@ -47,22 +51,24 @@
    1.15     apply (rule_tac [2] DERIV_quotient)
    1.16       apply (rule_tac [3] DERIV_const)
    1.17      apply (rule_tac [2] DERIV_pow)
    1.18 -   prefer 3 apply (simp add: fact_diff_Suc)
    1.19 +   prefer 3 
    1.20 +
    1.21 +apply (simp add: fact_diff_Suc)
    1.22    prefer 2 apply simp
    1.23   apply (frule less_iff_Suc_add [THEN iffD1], clarify)
    1.24   apply (simp del: setsum_op_ivl_Suc)
    1.25   apply (insert sumr_offset4 [of "Suc 0"])
    1.26 - apply (simp del: setsum_op_ivl_Suc fact_Suc power_Suc)
    1.27 + apply (simp del: setsum_op_ivl_Suc fact_Suc_nat power_Suc)
    1.28   apply (rule lemma_DERIV_subst)
    1.29    apply (rule DERIV_add)
    1.30     apply (rule_tac [2] DERIV_const)
    1.31    apply (rule DERIV_sumr, clarify)
    1.32    prefer 2 apply simp
    1.33 - apply (simp (no_asm) add: divide_inverse mult_assoc del: fact_Suc power_Suc)
    1.34 + apply (simp (no_asm) add: divide_inverse mult_assoc del: fact_Suc_nat power_Suc)
    1.35   apply (rule DERIV_cmult)
    1.36   apply (rule lemma_DERIV_subst)
    1.37    apply (best intro!: DERIV_intros)
    1.38 - apply (subst fact_Suc)
    1.39 + apply (subst fact_Suc_nat)
    1.40   apply (subst real_of_nat_mult)
    1.41   apply (simp add: mult_ac)
    1.42  done
    1.43 @@ -114,7 +120,7 @@
    1.44      apply (frule less_iff_Suc_add [THEN iffD1], clarify)
    1.45      apply (simp del: setsum_op_ivl_Suc)
    1.46      apply (insert sumr_offset4 [of "Suc 0"])
    1.47 -    apply (simp del: setsum_op_ivl_Suc fact_Suc)
    1.48 +    apply (simp del: setsum_op_ivl_Suc fact_Suc_nat)
    1.49      done
    1.50  
    1.51    have isCont_difg: "\<And>m x. \<lbrakk>m < n; 0 \<le> x; x \<le> h\<rbrakk> \<Longrightarrow> isCont (difg m) x"
    1.52 @@ -174,7 +180,7 @@
    1.53        (\<Sum>m = 0..<n. diff m 0 / real (fact m) * h ^ m) +
    1.54        diff n t / real (fact n) * h ^ n"
    1.55        using `difg (Suc m) t = 0`
    1.56 -      by (simp add: m f_h difg_def del: fact_Suc)
    1.57 +      by (simp add: m f_h difg_def del: fact_Suc_nat)
    1.58    qed
    1.59  
    1.60  qed