equal
deleted
inserted
replaced
79 apply (rule_tac [2] DERIV_pow) |
79 apply (rule_tac [2] DERIV_pow) |
80 prefer 3 apply (simp add: fact_diff_Suc) |
80 prefer 3 apply (simp add: fact_diff_Suc) |
81 prefer 2 apply simp |
81 prefer 2 apply simp |
82 apply (frule less_iff_Suc_add [THEN iffD1], clarify) |
82 apply (frule less_iff_Suc_add [THEN iffD1], clarify) |
83 apply (simp del: setsum_op_ivl_Suc) |
83 apply (simp del: setsum_op_ivl_Suc) |
84 apply (insert sumr_offset4 [of 1]) |
84 apply (insert sumr_offset4 [of "Suc 0"]) |
85 apply (simp del: setsum_op_ivl_Suc fact_Suc realpow_Suc) |
85 apply (simp del: setsum_op_ivl_Suc fact_Suc realpow_Suc) |
86 apply (rule lemma_DERIV_subst) |
86 apply (rule lemma_DERIV_subst) |
87 apply (rule DERIV_add) |
87 apply (rule DERIV_add) |
88 apply (rule_tac [2] DERIV_const) |
88 apply (rule_tac [2] DERIV_const) |
89 apply (rule DERIV_sumr, clarify) |
89 apply (rule DERIV_sumr, clarify) |
122 (setsum (%m. (diff m 0 / real(fact m)) * t^m) {0..<n} |
122 (setsum (%m. (diff m 0 / real(fact m)) * t^m) {0..<n} |
123 + (B * (t^n / real(fact n)))))" by blast |
123 + (B * (t^n / real(fact n)))))" by blast |
124 |
124 |
125 have g2: "g 0 = 0 & g h = 0" |
125 have g2: "g 0 = 0 & g h = 0" |
126 apply (simp add: m f_h g_def del: setsum_op_ivl_Suc) |
126 apply (simp add: m f_h g_def del: setsum_op_ivl_Suc) |
127 apply (cut_tac n = m and k = 1 in sumr_offset2) |
127 apply (cut_tac n = m and k = "Suc 0" in sumr_offset2) |
128 apply (simp add: eq_diff_eq' diff_0 del: setsum_op_ivl_Suc) |
128 apply (simp add: eq_diff_eq' diff_0 del: setsum_op_ivl_Suc) |
129 done |
129 done |
130 |
130 |
131 obtain difg where difg_def: "difg = (%m t. diff m t - |
131 obtain difg where difg_def: "difg = (%m t. diff m t - |
132 (setsum (%p. (diff (m + p) 0 / real (fact p)) * (t ^ p)) {0..<n-m} |
132 (setsum (%p. (diff (m + p) 0 / real (fact p)) * (t ^ p)) {0..<n-m} |
142 have difg_eq_0: "\<forall>m. m < n --> difg m 0 = 0" |
142 have difg_eq_0: "\<forall>m. m < n --> difg m 0 = 0" |
143 apply clarify |
143 apply clarify |
144 apply (simp add: m difg_def) |
144 apply (simp add: m difg_def) |
145 apply (frule less_iff_Suc_add [THEN iffD1], clarify) |
145 apply (frule less_iff_Suc_add [THEN iffD1], clarify) |
146 apply (simp del: setsum_op_ivl_Suc) |
146 apply (simp del: setsum_op_ivl_Suc) |
147 apply (insert sumr_offset4 [of 1]) |
147 apply (insert sumr_offset4 [of "Suc 0"]) |
148 apply (simp del: setsum_op_ivl_Suc fact_Suc realpow_Suc) |
148 apply (simp del: setsum_op_ivl_Suc fact_Suc realpow_Suc) |
149 done |
149 done |
150 |
150 |
151 have isCont_difg: "\<And>m x. \<lbrakk>m < n; 0 \<le> x; x \<le> h\<rbrakk> \<Longrightarrow> isCont (difg m) x" |
151 have isCont_difg: "\<And>m x. \<lbrakk>m < n; 0 \<le> x; x \<le> h\<rbrakk> \<Longrightarrow> isCont (difg m) x" |
152 by (rule DERIV_isCont [OF difg_Suc [rule_format]]) simp |
152 by (rule DERIV_isCont [OF difg_Suc [rule_format]]) simp |
549 (* ------------------------------------------------------------------------- *) |
549 (* ------------------------------------------------------------------------- *) |
550 |
550 |
551 lemma sin_bound_lemma: |
551 lemma sin_bound_lemma: |
552 "[|x = y; abs u \<le> (v::real) |] ==> \<bar>(x + u) - y\<bar> \<le> v" |
552 "[|x = y; abs u \<le> (v::real) |] ==> \<bar>(x + u) - y\<bar> \<le> v" |
553 by auto |
553 by auto |
|
554 |
|
555 text {* TODO: move to Parity.thy *} |
|
556 lemma nat_odd_1 [simp]: "odd (1::nat)" |
|
557 unfolding even_nat_def by simp |
554 |
558 |
555 lemma Maclaurin_sin_bound: |
559 lemma Maclaurin_sin_bound: |
556 "abs(sin x - (\<Sum>m=0..<n. (if even m then 0 else (-1 ^ ((m - Suc 0) div 2)) / real (fact m)) * |
560 "abs(sin x - (\<Sum>m=0..<n. (if even m then 0 else (-1 ^ ((m - Suc 0) div 2)) / real (fact m)) * |
557 x ^ m)) \<le> inverse(real (fact n)) * \<bar>x\<bar> ^ n" |
561 x ^ m)) \<le> inverse(real (fact n)) * \<bar>x\<bar> ^ n" |
558 proof - |
562 proof - |