conversion of Hyperreal/MacLaurin_lemmas to Isar script
authorpaulson
Wed Jul 28 10:49:29 2004 +0200 (2004-07-28)
changeset 150792ef899e4526d
parent 15078 8beb68a7afd9
child 15080 7912ace86f31
conversion of Hyperreal/MacLaurin_lemmas to Isar script
src/HOL/HOL.thy
src/HOL/Hyperreal/Integration.ML
src/HOL/Hyperreal/Lim.thy
src/HOL/Hyperreal/MacLaurin.thy
src/HOL/Hyperreal/MacLaurin_lemmas.ML
src/HOL/Hyperreal/Transcendental.thy
src/HOL/IsaMakefile
     1.1 --- a/src/HOL/HOL.thy	Tue Jul 27 15:39:59 2004 +0200
     1.2 +++ b/src/HOL/HOL.thy	Wed Jul 28 10:49:29 2004 +0200
     1.3 @@ -818,6 +818,9 @@
     1.4    apply (insert linorder_linear, blast)
     1.5    done
     1.6  
     1.7 +lemma linorder_le_less_linear: "!!x::'a::linorder. x\<le>y | y<x"
     1.8 +  by (simp add: order_le_less linorder_less_linear)
     1.9 +
    1.10  lemma linorder_le_cases [case_names le ge]:
    1.11      "((x::'a::linorder) \<le> y ==> P) ==> (y \<le> x ==> P) ==> P"
    1.12    by (insert linorder_linear, blast)
     2.1 --- a/src/HOL/Hyperreal/Integration.ML	Tue Jul 27 15:39:59 2004 +0200
     2.2 +++ b/src/HOL/Hyperreal/Integration.ML	Wed Jul 28 10:49:29 2004 +0200
     2.3 @@ -7,6 +7,9 @@
     2.4  val mult_2 = thm"mult_2";
     2.5  val mult_2_right = thm"mult_2_right";
     2.6  
     2.7 +fun ARITH_PROVE str = prove_goal thy str
     2.8 +                      (fn prems => [cut_facts_tac prems 1,arith_tac 1]);
     2.9 +
    2.10  Goalw [psize_def] "a = b ==> psize (%n. if n = 0 then a else b) = 0";
    2.11  by Auto_tac;
    2.12  qed "partition_zero";
     3.1 --- a/src/HOL/Hyperreal/Lim.thy	Tue Jul 27 15:39:59 2004 +0200
     3.2 +++ b/src/HOL/Hyperreal/Lim.thy	Wed Jul 28 10:49:29 2004 +0200
     3.3 @@ -35,11 +35,11 @@
     3.4  
     3.5    (* differentiation: D is derivative of function f at x *)
     3.6    deriv:: "[real=>real,real,real] => bool"
     3.7 -			    ("(DERIV (_)/ (_)/ :> (_))" [60, 60, 60] 60)
     3.8 +			    ("(DERIV (_)/ (_)/ :> (_))" [0, 0, 60] 60)
     3.9    "DERIV f x :> D == ((%h. (f(x + h) + -f x)/h) -- 0 --> D)"
    3.10  
    3.11    nsderiv :: "[real=>real,real,real] => bool"
    3.12 -			    ("(NSDERIV (_)/ (_)/ :> (_))" [60, 60, 60] 60)
    3.13 +			    ("(NSDERIV (_)/ (_)/ :> (_))" [0, 0, 60] 60)
    3.14    "NSDERIV f x :> D == (\<forall>h \<in> Infinitesimal - {0}.
    3.15  			(( *f* f)(hypreal_of_real x + h) +
    3.16  			 - hypreal_of_real (f x))/h @= hypreal_of_real D)"
     4.1 --- a/src/HOL/Hyperreal/MacLaurin.thy	Tue Jul 27 15:39:59 2004 +0200
     4.2 +++ b/src/HOL/Hyperreal/MacLaurin.thy	Wed Jul 28 10:49:29 2004 +0200
     4.3 @@ -2,48 +2,614 @@
     4.4      Author      : Jacques D. Fleuriot
     4.5      Copyright   : 2001 University of Edinburgh
     4.6      Description : MacLaurin series
     4.7 +    Conversion to Isar and new proofs by Lawrence C Paulson, 2004
     4.8  *)
     4.9  
    4.10 -theory MacLaurin = Log
    4.11 -files ("MacLaurin_lemmas.ML"):
    4.12 +theory MacLaurin = Log:
    4.13 +
    4.14 +lemma sumr_offset: "sumr 0 n (%m. f (m+k)) = sumr 0 (n+k) f - sumr 0 k f"
    4.15 +by (induct_tac "n", auto)
    4.16 +
    4.17 +lemma sumr_offset2: "\<forall>f. sumr 0 n (%m. f (m+k)) = sumr 0 (n+k) f - sumr 0 k f"
    4.18 +by (induct_tac "n", auto)
    4.19 +
    4.20 +lemma sumr_offset3: "sumr 0 (n+k) f = sumr 0 n (%m. f (m+k)) + sumr 0 k f"
    4.21 +by (simp  add: sumr_offset)
    4.22 +
    4.23 +lemma sumr_offset4: "\<forall>n f. sumr 0 (n+k) f = sumr 0 n (%m. f (m+k)) + sumr 0 k f"
    4.24 +by (simp add: sumr_offset)
    4.25 +
    4.26 +lemma sumr_from_1_from_0: "0 < n ==>
    4.27 +      sumr (Suc 0) (Suc n) (%n. (if even(n) then 0 else
    4.28 +             ((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n) =
    4.29 +      sumr 0 (Suc n) (%n. (if even(n) then 0 else
    4.30 +             ((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n)"
    4.31 +by (rule_tac n1 = 1 in sumr_split_add [THEN subst], auto)
    4.32 +
    4.33 +
    4.34 +subsection{*Maclaurin's Theorem with Lagrange Form of Remainder*}
    4.35 +
    4.36 +text{*This is a very long, messy proof even now that it's been broken down
    4.37 +into lemmas.*}
    4.38 +
    4.39 +lemma Maclaurin_lemma:
    4.40 +    "0 < h ==>
    4.41 +     \<exists>B. f h = sumr 0 n (%m. (j m / real (fact m)) * (h^m)) +
    4.42 +               (B * ((h^n) / real(fact n)))"
    4.43 +by (rule_tac x = "(f h - sumr 0 n (%m. (j m / real (fact m)) * h^m)) *
    4.44 +                 real(fact n) / (h^n)"
    4.45 +       in exI, auto)
    4.46 +
    4.47 +
    4.48 +lemma eq_diff_eq': "(x = y - z) = (y = x + (z::real))"
    4.49 +by arith
    4.50 +
    4.51 +text{*A crude tactic to differentiate by proof.*}
    4.52 +ML
    4.53 +{*
    4.54 +exception DERIV_name;
    4.55 +fun get_fun_name (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _)) = f
    4.56 +|   get_fun_name (_ $ (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _))) = f
    4.57 +|   get_fun_name _ = raise DERIV_name;
    4.58 +
    4.59 +val deriv_rulesI = [DERIV_Id,DERIV_const,DERIV_cos,DERIV_cmult,
    4.60 +                    DERIV_sin, DERIV_exp, DERIV_inverse,DERIV_pow,
    4.61 +                    DERIV_add, DERIV_diff, DERIV_mult, DERIV_minus,
    4.62 +                    DERIV_inverse_fun,DERIV_quotient,DERIV_fun_pow,
    4.63 +                    DERIV_fun_exp,DERIV_fun_sin,DERIV_fun_cos,
    4.64 +                    DERIV_Id,DERIV_const,DERIV_cos];
    4.65 +
    4.66 +val deriv_tac =
    4.67 +  SUBGOAL (fn (prem,i) =>
    4.68 +   (resolve_tac deriv_rulesI i) ORELSE
    4.69 +    ((rtac (read_instantiate [("f",get_fun_name prem)]
    4.70 +                     DERIV_chain2) i) handle DERIV_name => no_tac));;
    4.71 +
    4.72 +val DERIV_tac = ALLGOALS(fn i => REPEAT(deriv_tac i));
    4.73 +*}
    4.74 +
    4.75 +lemma Maclaurin_lemma2:
    4.76 +      "[| \<forall>m t. m < n \<and> 0\<le>t \<and> t\<le>h \<longrightarrow> DERIV (diff m) t :> diff (Suc m) t;
    4.77 +          n = Suc k;
    4.78 +        difg =
    4.79 +        (\<lambda>m t. diff m t -
    4.80 +               ((\<Sum>p = 0..<n - m. diff (m + p) 0 / real (fact p) * t ^ p) +
    4.81 +                B * (t ^ (n - m) / real (fact (n - m)))))|] ==>
    4.82 +        \<forall>m t. m < n & 0 \<le> t & t \<le> h -->
    4.83 +                    DERIV (difg m) t :> difg (Suc m) t"
    4.84 +apply clarify
    4.85 +apply (rule DERIV_diff)
    4.86 +apply (simp (no_asm_simp))
    4.87 +apply (tactic DERIV_tac)
    4.88 +apply (tactic DERIV_tac)
    4.89 +apply (rule_tac [2] lemma_DERIV_subst)
    4.90 +apply (rule_tac [2] DERIV_quotient)
    4.91 +apply (rule_tac [3] DERIV_const)
    4.92 +apply (rule_tac [2] DERIV_pow)
    4.93 +  prefer 3 apply (simp add: fact_diff_Suc)
    4.94 + prefer 2 apply simp
    4.95 +apply (frule_tac m = m in less_add_one, clarify)
    4.96 +apply (simp del: sumr_Suc)
    4.97 +apply (insert sumr_offset4 [of 1])
    4.98 +apply (simp del: sumr_Suc fact_Suc realpow_Suc)
    4.99 +apply (rule lemma_DERIV_subst)
   4.100 +apply (rule DERIV_add)
   4.101 +apply (rule_tac [2] DERIV_const)
   4.102 +apply (rule DERIV_sumr, clarify)
   4.103 + prefer 2 apply simp
   4.104 +apply (simp (no_asm) add: divide_inverse mult_assoc del: fact_Suc realpow_Suc)
   4.105 +apply (rule DERIV_cmult)
   4.106 +apply (rule lemma_DERIV_subst)
   4.107 +apply (best intro: DERIV_chain2 intro!: DERIV_intros)
   4.108 +apply (subst fact_Suc)
   4.109 +apply (subst real_of_nat_mult)
   4.110 +apply (simp add: inverse_mult_distrib mult_ac)
   4.111 +done
   4.112 +
   4.113 +
   4.114 +lemma Maclaurin_lemma3:
   4.115 +     "[|\<forall>k t. k < Suc m \<and> 0\<le>t & t\<le>h \<longrightarrow> DERIV (difg k) t :> difg (Suc k) t;
   4.116 +        \<forall>k<Suc m. difg k 0 = 0; DERIV (difg n) t :> 0;  n < m; 0 < t;
   4.117 +        t < h|]
   4.118 +     ==> \<exists>ta. 0 < ta & ta < t & DERIV (difg (Suc n)) ta :> 0"
   4.119 +apply (rule Rolle, assumption, simp)
   4.120 +apply (drule_tac x = n and P="%k. k<Suc m --> difg k 0 = 0" in spec)
   4.121 +apply (rule DERIV_unique)
   4.122 +prefer 2 apply assumption
   4.123 +apply force
   4.124 +apply (subgoal_tac "\<forall>ta. 0 \<le> ta & ta \<le> t --> (difg (Suc n)) differentiable ta")
   4.125 +apply (simp add: differentiable_def)
   4.126 +apply (blast dest!: DERIV_isCont)
   4.127 +apply (simp add: differentiable_def, clarify)
   4.128 +apply (rule_tac x = "difg (Suc (Suc n)) ta" in exI)
   4.129 +apply force
   4.130 +apply (simp add: differentiable_def, clarify)
   4.131 +apply (rule_tac x = "difg (Suc (Suc n)) x" in exI)
   4.132 +apply force
   4.133 +done
   4.134  
   4.135 -use "MacLaurin_lemmas.ML"
   4.136 +lemma Maclaurin:
   4.137 +   "[| 0 < h; 0 < n; diff 0 = f;
   4.138 +       \<forall>m t. m < n & 0 \<le> t & t \<le> h --> DERIV (diff m) t :> diff (Suc m) t |]
   4.139 +    ==> \<exists>t. 0 < t &
   4.140 +              t < h &
   4.141 +              f h =
   4.142 +              sumr 0 n (%m. (diff m 0 / real (fact m)) * h ^ m) +
   4.143 +              (diff n t / real (fact n)) * h ^ n"
   4.144 +apply (case_tac "n = 0", force)
   4.145 +apply (drule not0_implies_Suc)
   4.146 +apply (erule exE)
   4.147 +apply (frule_tac f=f and n=n and j="%m. diff m 0" in Maclaurin_lemma)
   4.148 +apply (erule exE)
   4.149 +apply (subgoal_tac "\<exists>g.
   4.150 +     g = (%t. f t - (sumr 0 n (%m. (diff m 0 / real(fact m)) * t^m) + (B * (t^n / real(fact n)))))")
   4.151 + prefer 2 apply blast
   4.152 +apply (erule exE)
   4.153 +apply (subgoal_tac "g 0 = 0 & g h =0")
   4.154 + prefer 2
   4.155 + apply (simp del: sumr_Suc)
   4.156 + apply (cut_tac n = m and k = 1 in sumr_offset2)
   4.157 + apply (simp add: eq_diff_eq' del: sumr_Suc)
   4.158 +apply (subgoal_tac "\<exists>difg. difg = (%m t. diff m t - (sumr 0 (n - m) (%p. (diff (m + p) 0 / real (fact p)) * (t ^ p)) + (B * ((t ^ (n - m)) / real (fact (n - m))))))")
   4.159 + prefer 2 apply blast
   4.160 +apply (erule exE)
   4.161 +apply (subgoal_tac "difg 0 = g")
   4.162 + prefer 2 apply simp
   4.163 +apply (frule Maclaurin_lemma2, assumption+)
   4.164 +apply (subgoal_tac "\<forall>ma. ma < n --> (\<exists>t. 0 < t & t < h & difg (Suc ma) t = 0) ")
   4.165 +apply (drule_tac x = m and P="%m. m<n --> (\<exists>t. ?QQ m t)" in spec)
   4.166 +apply (erule impE)
   4.167 +apply (simp (no_asm_simp))
   4.168 +apply (erule exE)
   4.169 +apply (rule_tac x = t in exI)
   4.170 +apply (simp del: realpow_Suc fact_Suc)
   4.171 +apply (subgoal_tac "\<forall>m. m < n --> difg m 0 = 0")
   4.172 + prefer 2
   4.173 + apply clarify
   4.174 + apply simp
   4.175 + apply (frule_tac m = ma in less_add_one, clarify)
   4.176 + apply (simp del: sumr_Suc)
   4.177 +apply (insert sumr_offset4 [of 1])
   4.178 +apply (simp del: sumr_Suc fact_Suc realpow_Suc)
   4.179 +apply (subgoal_tac "\<forall>m. m < n --> (\<exists>t. 0 < t & t < h & DERIV (difg m) t :> 0) ")
   4.180 +apply (rule allI, rule impI)
   4.181 +apply (drule_tac x = ma and P="%m. m<n --> (\<exists>t. ?QQ m t)" in spec)
   4.182 +apply (erule impE, assumption)
   4.183 +apply (erule exE)
   4.184 +apply (rule_tac x = t in exI)
   4.185 +(* do some tidying up *)
   4.186 +apply (erule_tac [!] V= "difg = (%m t. diff m t - (sumr 0 (n - m) (%p. diff (m + p) 0 / real (fact p) * t ^ p) + B * (t ^ (n - m) / real (fact (n - m)))))"
   4.187 +       in thin_rl)
   4.188 +apply (erule_tac [!] V="g = (%t. f t - (sumr 0 n (%m. diff m 0 / real (fact m) * t ^ m) + B * (t ^ n / real (fact n))))"
   4.189 +       in thin_rl)
   4.190 +apply (erule_tac [!] V="f h = sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + B * (h ^ n / real (fact n))"
   4.191 +       in thin_rl)
   4.192 +(* back to business *)
   4.193 +apply (simp (no_asm_simp))
   4.194 +apply (rule DERIV_unique)
   4.195 +prefer 2 apply blast
   4.196 +apply force
   4.197 +apply (rule allI, induct_tac "ma")
   4.198 +apply (rule impI, rule Rolle, assumption, simp, simp)
   4.199 +apply (subgoal_tac "\<forall>t. 0 \<le> t & t \<le> h --> g differentiable t")
   4.200 +apply (simp add: differentiable_def)
   4.201 +apply (blast dest: DERIV_isCont)
   4.202 +apply (simp add: differentiable_def, clarify)
   4.203 +apply (rule_tac x = "difg (Suc 0) t" in exI)
   4.204 +apply force
   4.205 +apply (simp add: differentiable_def, clarify)
   4.206 +apply (rule_tac x = "difg (Suc 0) x" in exI)
   4.207 +apply force
   4.208 +apply safe
   4.209 +apply force
   4.210 +apply (frule Maclaurin_lemma3, assumption+, safe)
   4.211 +apply (rule_tac x = ta in exI, force)
   4.212 +done
   4.213 +
   4.214 +lemma Maclaurin_objl:
   4.215 +     "0 < h & 0 < n & diff 0 = f &
   4.216 +       (\<forall>m t. m < n & 0 \<le> t & t \<le> h --> DERIV (diff m) t :> diff (Suc m) t)
   4.217 +    --> (\<exists>t. 0 < t &
   4.218 +              t < h &
   4.219 +              f h =
   4.220 +              sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) +
   4.221 +              diff n t / real (fact n) * h ^ n)"
   4.222 +by (blast intro: Maclaurin)
   4.223 +
   4.224 +
   4.225 +lemma Maclaurin2:
   4.226 +   "[| 0 < h; diff 0 = f;
   4.227 +       \<forall>m t.
   4.228 +          m < n & 0 \<le> t & t \<le> h --> DERIV (diff m) t :> diff (Suc m) t |]
   4.229 +    ==> \<exists>t. 0 < t &
   4.230 +              t \<le> h &
   4.231 +              f h =
   4.232 +              sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) +
   4.233 +              diff n t / real (fact n) * h ^ n"
   4.234 +apply (case_tac "n", auto)
   4.235 +apply (drule Maclaurin, auto)
   4.236 +done
   4.237 +
   4.238 +lemma Maclaurin2_objl:
   4.239 +     "0 < h & diff 0 = f &
   4.240 +       (\<forall>m t.
   4.241 +          m < n & 0 \<le> t & t \<le> h --> DERIV (diff m) t :> diff (Suc m) t)
   4.242 +    --> (\<exists>t. 0 < t &
   4.243 +              t \<le> h &
   4.244 +              f h =
   4.245 +              sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) +
   4.246 +              diff n t / real (fact n) * h ^ n)"
   4.247 +by (blast intro: Maclaurin2)
   4.248 +
   4.249 +lemma Maclaurin_minus:
   4.250 +   "[| h < 0; 0 < n; diff 0 = f;
   4.251 +       \<forall>m t. m < n & h \<le> t & t \<le> 0 --> DERIV (diff m) t :> diff (Suc m) t |]
   4.252 +    ==> \<exists>t. h < t &
   4.253 +              t < 0 &
   4.254 +              f h =
   4.255 +              sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) +
   4.256 +              diff n t / real (fact n) * h ^ n"
   4.257 +apply (cut_tac f = "%x. f (-x)"
   4.258 +        and diff = "%n x. ((- 1) ^ n) * diff n (-x)"
   4.259 +        and h = "-h" and n = n in Maclaurin_objl)
   4.260 +apply simp
   4.261 +apply safe
   4.262 +apply (subst minus_mult_right)
   4.263 +apply (rule DERIV_cmult)
   4.264 +apply (rule lemma_DERIV_subst)
   4.265 +apply (rule DERIV_chain2 [where g=uminus])
   4.266 +apply (rule_tac [2] DERIV_minus, rule_tac [2] DERIV_Id)
   4.267 +prefer 2 apply force
   4.268 +apply force
   4.269 +apply (rule_tac x = "-t" in exI, auto)
   4.270 +apply (subgoal_tac "(\<Sum>m = 0..<n. -1 ^ m * diff m 0 * (-h)^m / real(fact m)) =
   4.271 +                    (\<Sum>m = 0..<n. diff m 0 * h ^ m / real(fact m))")
   4.272 +apply (rule_tac [2] sumr_fun_eq)
   4.273 +apply (auto simp add: divide_inverse power_mult_distrib [symmetric])
   4.274 +done
   4.275 +
   4.276 +lemma Maclaurin_minus_objl:
   4.277 +     "(h < 0 & 0 < n & diff 0 = f &
   4.278 +       (\<forall>m t.
   4.279 +          m < n & h \<le> t & t \<le> 0 --> DERIV (diff m) t :> diff (Suc m) t))
   4.280 +    --> (\<exists>t. h < t &
   4.281 +              t < 0 &
   4.282 +              f h =
   4.283 +              sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) +
   4.284 +              diff n t / real (fact n) * h ^ n)"
   4.285 +by (blast intro: Maclaurin_minus)
   4.286 +
   4.287 +
   4.288 +subsection{*More Convenient "Bidirectional" Version.*}
   4.289 +
   4.290 +(* not good for PVS sin_approx, cos_approx *)
   4.291 +
   4.292 +lemma Maclaurin_bi_le_lemma [rule_format]:
   4.293 +     "0 < n \<longrightarrow>
   4.294 +       diff 0 0 =
   4.295 +       (\<Sum>m = 0..<n. diff m 0 * 0 ^ m / real (fact m)) +
   4.296 +       diff n 0 * 0 ^ n / real (fact n)"
   4.297 +by (induct_tac "n", auto)
   4.298  
   4.299 -lemma Maclaurin_sin_bound: 
   4.300 -  "abs(sin x - sumr 0 n (%m. (if even m then 0 else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) * 
   4.301 -  x ^ m))  <= inverse(real (fact n)) * abs(x) ^ n"
   4.302 +lemma Maclaurin_bi_le:
   4.303 +   "[| diff 0 = f;
   4.304 +       \<forall>m t. m < n & abs t \<le> abs x --> DERIV (diff m) t :> diff (Suc m) t |]
   4.305 +    ==> \<exists>t. abs t \<le> abs x &
   4.306 +              f x =
   4.307 +              sumr 0 n (%m. diff m 0 / real (fact m) * x ^ m) +
   4.308 +              diff n t / real (fact n) * x ^ n"
   4.309 +apply (case_tac "n = 0", force)
   4.310 +apply (case_tac "x = 0")
   4.311 +apply (rule_tac x = 0 in exI)
   4.312 +apply (force simp add: Maclaurin_bi_le_lemma)
   4.313 +apply (cut_tac x = x and y = 0 in linorder_less_linear, auto)
   4.314 +txt{*Case 1, where @{term "x < 0"}*}
   4.315 +apply (cut_tac f = "diff 0" and diff = diff and h = x and n = n in Maclaurin_minus_objl, safe)
   4.316 +apply (simp add: abs_if)
   4.317 +apply (rule_tac x = t in exI)
   4.318 +apply (simp add: abs_if)
   4.319 +txt{*Case 2, where @{term "0 < x"}*}
   4.320 +apply (cut_tac f = "diff 0" and diff = diff and h = x and n = n in Maclaurin_objl, safe)
   4.321 +apply (simp add: abs_if)
   4.322 +apply (rule_tac x = t in exI)
   4.323 +apply (simp add: abs_if)
   4.324 +done
   4.325 +
   4.326 +lemma Maclaurin_all_lt:
   4.327 +     "[| diff 0 = f;
   4.328 +         \<forall>m x. DERIV (diff m) x :> diff(Suc m) x;
   4.329 +        x ~= 0; 0 < n
   4.330 +      |] ==> \<exists>t. 0 < abs t & abs t < abs x &
   4.331 +               f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) +
   4.332 +                     (diff n t / real (fact n)) * x ^ n"
   4.333 +apply (rule_tac x = x and y = 0 in linorder_cases)
   4.334 +prefer 2 apply blast
   4.335 +apply (drule_tac [2] diff=diff in Maclaurin)
   4.336 +apply (drule_tac diff=diff in Maclaurin_minus, simp_all, safe)
   4.337 +apply (rule_tac [!] x = t in exI, auto, arith+)
   4.338 +done
   4.339 +
   4.340 +lemma Maclaurin_all_lt_objl:
   4.341 +     "diff 0 = f &
   4.342 +      (\<forall>m x. DERIV (diff m) x :> diff(Suc m) x) &
   4.343 +      x ~= 0 & 0 < n
   4.344 +      --> (\<exists>t. 0 < abs t & abs t < abs x &
   4.345 +               f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) +
   4.346 +                     (diff n t / real (fact n)) * x ^ n)"
   4.347 +by (blast intro: Maclaurin_all_lt)
   4.348 +
   4.349 +lemma Maclaurin_zero [rule_format]:
   4.350 +     "x = (0::real)
   4.351 +      ==> 0 < n -->
   4.352 +          sumr 0 n (%m. (diff m (0::real) / real (fact m)) * x ^ m) =
   4.353 +          diff 0 0"
   4.354 +by (induct n, auto)
   4.355 +
   4.356 +lemma Maclaurin_all_le: "[| diff 0 = f;
   4.357 +        \<forall>m x. DERIV (diff m) x :> diff (Suc m) x
   4.358 +      |] ==> \<exists>t. abs t \<le> abs x &
   4.359 +              f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) +
   4.360 +                    (diff n t / real (fact n)) * x ^ n"
   4.361 +apply (insert linorder_le_less_linear [of n 0])
   4.362 +apply (erule disjE, force)
   4.363 +apply (case_tac "x = 0")
   4.364 +apply (frule_tac diff = diff and n = n in Maclaurin_zero, assumption)
   4.365 +apply (drule gr_implies_not0 [THEN not0_implies_Suc])
   4.366 +apply (rule_tac x = 0 in exI, force)
   4.367 +apply (frule_tac diff = diff and n = n in Maclaurin_all_lt, auto)
   4.368 +apply (rule_tac x = t in exI, auto)
   4.369 +done
   4.370 +
   4.371 +lemma Maclaurin_all_le_objl: "diff 0 = f &
   4.372 +      (\<forall>m x. DERIV (diff m) x :> diff (Suc m) x)
   4.373 +      --> (\<exists>t. abs t \<le> abs x &
   4.374 +              f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) +
   4.375 +                    (diff n t / real (fact n)) * x ^ n)"
   4.376 +by (blast intro: Maclaurin_all_le)
   4.377 +
   4.378 +
   4.379 +subsection{*Version for Exponential Function*}
   4.380 +
   4.381 +lemma Maclaurin_exp_lt: "[| x ~= 0; 0 < n |]
   4.382 +      ==> (\<exists>t. 0 < abs t &
   4.383 +                abs t < abs x &
   4.384 +                exp x = sumr 0 n (%m. (x ^ m) / real (fact m)) +
   4.385 +                        (exp t / real (fact n)) * x ^ n)"
   4.386 +by (cut_tac diff = "%n. exp" and f = exp and x = x and n = n in Maclaurin_all_lt_objl, auto)
   4.387 +
   4.388 +
   4.389 +lemma Maclaurin_exp_le:
   4.390 +     "\<exists>t. abs t \<le> abs x &
   4.391 +            exp x = sumr 0 n (%m. (x ^ m) / real (fact m)) +
   4.392 +                       (exp t / real (fact n)) * x ^ n"
   4.393 +by (cut_tac diff = "%n. exp" and f = exp and x = x and n = n in Maclaurin_all_le_objl, auto)
   4.394 +
   4.395 +
   4.396 +subsection{*Version for Sine Function*}
   4.397 +
   4.398 +lemma MVT2:
   4.399 +     "[| a < b; \<forall>x. a \<le> x & x \<le> b --> DERIV f x :> f'(x) |]
   4.400 +      ==> \<exists>z. a < z & z < b & (f b - f a = (b - a) * f'(z))"
   4.401 +apply (drule MVT)
   4.402 +apply (blast intro: DERIV_isCont)
   4.403 +apply (force dest: order_less_imp_le simp add: differentiable_def)
   4.404 +apply (blast dest: DERIV_unique order_less_imp_le)
   4.405 +done
   4.406 +
   4.407 +lemma mod_exhaust_less_4:
   4.408 +     "m mod 4 = 0 | m mod 4 = 1 | m mod 4 = 2 | m mod 4 = (3::nat)"
   4.409 +by (case_tac "m mod 4", auto, arith)
   4.410 +
   4.411 +lemma Suc_Suc_mult_two_diff_two [rule_format, simp]:
   4.412 +     "0 < n --> Suc (Suc (2 * n - 2)) = 2*n"
   4.413 +by (induct_tac "n", auto)
   4.414 +
   4.415 +lemma lemma_Suc_Suc_4n_diff_2 [rule_format, simp]:
   4.416 +     "0 < n --> Suc (Suc (4*n - 2)) = 4*n"
   4.417 +by (induct_tac "n", auto)
   4.418 +
   4.419 +lemma Suc_mult_two_diff_one [rule_format, simp]:
   4.420 +      "0 < n --> Suc (2 * n - 1) = 2*n"
   4.421 +by (induct_tac "n", auto)
   4.422 +
   4.423 +lemma Maclaurin_sin_expansion:
   4.424 +     "\<exists>t. sin x =
   4.425 +       (sumr 0 n (%m. (if even m then 0
   4.426 +                       else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) *
   4.427 +                       x ^ m))
   4.428 +      + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.429 +apply (cut_tac f = sin and n = n and x = x and diff = "%n x. sin (x + 1/2*real (n) *pi)" in Maclaurin_all_lt_objl)
   4.430 +apply safe
   4.431 +apply (simp (no_asm))
   4.432 +apply (simp (no_asm))
   4.433 +apply (case_tac "n", clarify, simp)
   4.434 +apply (drule_tac x = 0 in spec, simp, simp)
   4.435 +apply (rule ccontr, simp)
   4.436 +apply (drule_tac x = x in spec, simp)
   4.437 +apply (erule ssubst)
   4.438 +apply (rule_tac x = t in exI, simp)
   4.439 +apply (rule sumr_fun_eq)
   4.440 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.441 +apply (auto simp add: even_mult_two_ex simp del: fact_Suc realpow_Suc)
   4.442 +(*Could sin_zero_iff help?*)
   4.443 +done
   4.444 +
   4.445 +lemma Maclaurin_sin_expansion2:
   4.446 +     "\<exists>t. abs t \<le> abs x &
   4.447 +       sin x =
   4.448 +       (sumr 0 n (%m. (if even m then 0
   4.449 +                       else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) *
   4.450 +                       x ^ m))
   4.451 +      + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.452 +apply (cut_tac f = sin and n = n and x = x
   4.453 +        and diff = "%n x. sin (x + 1/2*real n * pi)" in Maclaurin_all_lt_objl)
   4.454 +apply safe
   4.455 +apply (simp (no_asm))
   4.456 +apply (simp (no_asm))
   4.457 +apply (case_tac "n", clarify, simp, simp)
   4.458 +apply (rule ccontr, simp)
   4.459 +apply (drule_tac x = x in spec, simp)
   4.460 +apply (erule ssubst)
   4.461 +apply (rule_tac x = t in exI, simp)
   4.462 +apply (rule sumr_fun_eq)
   4.463 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.464 +apply (auto simp add: even_mult_two_ex simp del: fact_Suc realpow_Suc)
   4.465 +done
   4.466 +
   4.467 +lemma Maclaurin_sin_expansion3:
   4.468 +     "[| 0 < n; 0 < x |] ==>
   4.469 +       \<exists>t. 0 < t & t < x &
   4.470 +       sin x =
   4.471 +       (sumr 0 n (%m. (if even m then 0
   4.472 +                       else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) *
   4.473 +                       x ^ m))
   4.474 +      + ((sin(t + 1/2 * real(n) *pi) / real (fact n)) * x ^ n)"
   4.475 +apply (cut_tac f = sin and n = n and h = x and diff = "%n x. sin (x + 1/2*real (n) *pi)" in Maclaurin_objl)
   4.476 +apply safe
   4.477 +apply simp
   4.478 +apply (simp (no_asm))
   4.479 +apply (erule ssubst)
   4.480 +apply (rule_tac x = t in exI, simp)
   4.481 +apply (rule sumr_fun_eq)
   4.482 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.483 +apply (auto simp add: even_mult_two_ex simp del: fact_Suc realpow_Suc)
   4.484 +done
   4.485 +
   4.486 +lemma Maclaurin_sin_expansion4:
   4.487 +     "0 < x ==>
   4.488 +       \<exists>t. 0 < t & t \<le> x &
   4.489 +       sin x =
   4.490 +       (sumr 0 n (%m. (if even m then 0
   4.491 +                       else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) *
   4.492 +                       x ^ m))
   4.493 +      + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.494 +apply (cut_tac f = sin and n = n and h = x and diff = "%n x. sin (x + 1/2*real (n) *pi)" in Maclaurin2_objl)
   4.495 +apply safe
   4.496 +apply simp
   4.497 +apply (simp (no_asm))
   4.498 +apply (erule ssubst)
   4.499 +apply (rule_tac x = t in exI, simp)
   4.500 +apply (rule sumr_fun_eq)
   4.501 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.502 +apply (auto simp add: even_mult_two_ex simp del: fact_Suc realpow_Suc)
   4.503 +done
   4.504 +
   4.505 +
   4.506 +subsection{*Maclaurin Expansion for Cosine Function*}
   4.507 +
   4.508 +lemma sumr_cos_zero_one [simp]:
   4.509 +     "sumr 0 (Suc n)
   4.510 +         (%m. (if even m
   4.511 +               then (- 1) ^ (m div 2)/(real  (fact m))
   4.512 +               else 0) *
   4.513 +              0 ^ m) = 1"
   4.514 +by (induct_tac "n", auto)
   4.515 +
   4.516 +lemma Maclaurin_cos_expansion:
   4.517 +     "\<exists>t. abs t \<le> abs x &
   4.518 +       cos x =
   4.519 +       (sumr 0 n (%m. (if even m
   4.520 +                       then (- 1) ^ (m div 2)/(real (fact m))
   4.521 +                       else 0) *
   4.522 +                       x ^ m))
   4.523 +      + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.524 +apply (cut_tac f = cos and n = n and x = x and diff = "%n x. cos (x + 1/2*real (n) *pi)" in Maclaurin_all_lt_objl)
   4.525 +apply safe
   4.526 +apply (simp (no_asm))
   4.527 +apply (simp (no_asm))
   4.528 +apply (case_tac "n", simp)
   4.529 +apply (simp del: sumr_Suc)
   4.530 +apply (rule ccontr, simp)
   4.531 +apply (drule_tac x = x in spec, simp)
   4.532 +apply (erule ssubst)
   4.533 +apply (rule_tac x = t in exI, simp)
   4.534 +apply (rule sumr_fun_eq)
   4.535 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.536 +apply (auto simp add: even_mult_two_ex left_distrib cos_add simp del: fact_Suc realpow_Suc)
   4.537 +apply (simp add: mult_commute [of _ pi])
   4.538 +done
   4.539 +
   4.540 +lemma Maclaurin_cos_expansion2:
   4.541 +     "[| 0 < x; 0 < n |] ==>
   4.542 +       \<exists>t. 0 < t & t < x &
   4.543 +       cos x =
   4.544 +       (sumr 0 n (%m. (if even m
   4.545 +                       then (- 1) ^ (m div 2)/(real (fact m))
   4.546 +                       else 0) *
   4.547 +                       x ^ m))
   4.548 +      + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.549 +apply (cut_tac f = cos and n = n and h = x and diff = "%n x. cos (x + 1/2*real (n) *pi)" in Maclaurin_objl)
   4.550 +apply safe
   4.551 +apply simp
   4.552 +apply (simp (no_asm))
   4.553 +apply (erule ssubst)
   4.554 +apply (rule_tac x = t in exI, simp)
   4.555 +apply (rule sumr_fun_eq)
   4.556 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.557 +apply (auto simp add: even_mult_two_ex left_distrib cos_add simp del: fact_Suc realpow_Suc)
   4.558 +apply (simp add: mult_commute [of _ pi])
   4.559 +done
   4.560 +
   4.561 +lemma Maclaurin_minus_cos_expansion: "[| x < 0; 0 < n |] ==>
   4.562 +       \<exists>t. x < t & t < 0 &
   4.563 +       cos x =
   4.564 +       (sumr 0 n (%m. (if even m
   4.565 +                       then (- 1) ^ (m div 2)/(real (fact m))
   4.566 +                       else 0) *
   4.567 +                       x ^ m))
   4.568 +      + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)"
   4.569 +apply (cut_tac f = cos and n = n and h = x and diff = "%n x. cos (x + 1/2*real (n) *pi)" in Maclaurin_minus_objl)
   4.570 +apply safe
   4.571 +apply simp
   4.572 +apply (simp (no_asm))
   4.573 +apply (erule ssubst)
   4.574 +apply (rule_tac x = t in exI, simp)
   4.575 +apply (rule sumr_fun_eq)
   4.576 +apply (auto simp add: odd_Suc_mult_two_ex)
   4.577 +apply (auto simp add: even_mult_two_ex left_distrib cos_add simp del: fact_Suc realpow_Suc)
   4.578 +apply (simp add: mult_commute [of _ pi])
   4.579 +done
   4.580 +
   4.581 +(* ------------------------------------------------------------------------- *)
   4.582 +(* Version for ln(1 +/- x). Where is it??                                    *)
   4.583 +(* ------------------------------------------------------------------------- *)
   4.584 +
   4.585 +lemma sin_bound_lemma:
   4.586 +    "[|x = y; abs u \<le> (v::real) |] ==> abs ((x + u) - y) \<le> v"
   4.587 +by auto
   4.588 +
   4.589 +lemma Maclaurin_sin_bound:
   4.590 +  "abs(sin x - sumr 0 n (%m. (if even m then 0 else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) *
   4.591 +  x ^ m))  \<le> inverse(real (fact n)) * abs(x) ^ n"
   4.592  proof -
   4.593 -  have "!! x (y::real). x <= 1 \<Longrightarrow> 0 <= y \<Longrightarrow> x * y \<le> 1 * y" 
   4.594 +  have "!! x (y::real). x \<le> 1 \<Longrightarrow> 0 \<le> y \<Longrightarrow> x * y \<le> 1 * y"
   4.595      by (rule_tac mult_right_mono,simp_all)
   4.596    note est = this[simplified]
   4.597    show ?thesis
   4.598 -    apply (cut_tac f=sin and n=n and x=x and 
   4.599 +    apply (cut_tac f=sin and n=n and x=x and
   4.600        diff = "%n x. if n mod 4 = 0 then sin(x) else if n mod 4 = 1 then cos(x) else if n mod 4 = 2 then -sin(x) else -cos(x)"
   4.601        in Maclaurin_all_le_objl)
   4.602 -    apply (tactic{* (Step_tac 1) *})
   4.603 -    apply (simp)
   4.604 +    apply safe
   4.605 +    apply simp
   4.606      apply (subst mod_Suc_eq_Suc_mod)
   4.607 -    apply (tactic{* cut_inst_tac [("m1","m")] (CLAIM "0 < (4::nat)" RS mod_less_divisor RS lemma_exhaust_less_4) 1*})
   4.608 -    apply (tactic{* Step_tac 1 *})
   4.609 -    apply (simp)+
   4.610 +    apply (cut_tac m=m in mod_exhaust_less_4, safe, simp+)
   4.611      apply (rule DERIV_minus, simp+)
   4.612      apply (rule lemma_DERIV_subst, rule DERIV_minus, rule DERIV_cos, simp)
   4.613 -    apply (tactic{* dtac ssubst 1 THEN assume_tac 2 *})
   4.614 -    apply (tactic {* rtac (ARITH_PROVE "[|x = y; abs u <= (v::real) |] ==> abs ((x + u) - y) <= v") 1 *})
   4.615 -    apply (rule sumr_fun_eq)
   4.616 -    apply (tactic{* Step_tac 1 *})
   4.617 -    apply (tactic{*rtac (CLAIM "x = y ==> x * z = y * (z::real)") 1*})
   4.618 +    apply (erule ssubst)
   4.619 +    apply (rule sin_bound_lemma)
   4.620 +    apply (rule sumr_fun_eq, safe)
   4.621 +    apply (rule_tac f = "%u. u * (x^r)" in arg_cong)
   4.622      apply (subst even_even_mod_4_iff)
   4.623 -    apply (tactic{* cut_inst_tac [("m1","r")] (CLAIM "0 < (4::nat)" RS mod_less_divisor RS lemma_exhaust_less_4) 1 *})
   4.624 -    apply (tactic{* Step_tac 1 *})
   4.625 -    apply (simp)
   4.626 +    apply (cut_tac m=r in mod_exhaust_less_4, simp, safe)
   4.627      apply (simp_all add:even_num_iff)
   4.628      apply (drule lemma_even_mod_4_div_2[simplified])
   4.629 -    apply(simp add: numeral_2_eq_2 real_divide_def)
   4.630 -    apply (drule lemma_odd_mod_4_div_2 );
   4.631 -    apply (simp add: numeral_2_eq_2 real_divide_def)
   4.632 -    apply (auto intro: real_mult_le_lemma mult_right_mono simp add: est mult_pos_le mult_ac real_divide_def abs_mult abs_inverse power_abs[symmetric])
   4.633 +    apply(simp add: numeral_2_eq_2 divide_inverse)
   4.634 +    apply (drule lemma_odd_mod_4_div_2)
   4.635 +    apply (simp add: numeral_2_eq_2 divide_inverse)
   4.636 +    apply (auto intro: mult_right_mono [where b=1, simplified] mult_right_mono
   4.637 +                   simp add: est mult_pos_le mult_ac divide_inverse
   4.638 +                          power_abs [symmetric])
   4.639      done
   4.640  qed
   4.641  
   4.642 -end
   4.643 \ No newline at end of file
   4.644 +end
     5.1 --- a/src/HOL/Hyperreal/MacLaurin_lemmas.ML	Tue Jul 27 15:39:59 2004 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,724 +0,0 @@
     5.4 -(*  Title       : MacLaurin.thy
     5.5 -    Author      : Jacques D. Fleuriot
     5.6 -    Copyright   : 2001 University of Edinburgh
     5.7 -    Description : MacLaurin series
     5.8 -*)
     5.9 -
    5.10 -val DERIV_intros = thms"DERIV_intros";
    5.11 -
    5.12 -val lemma_DERIV_subst = thm"lemma_DERIV_subst";
    5.13 -
    5.14 -fun ARITH_PROVE str = prove_goal thy str
    5.15 -                      (fn prems => [cut_facts_tac prems 1,arith_tac 1]);
    5.16 -
    5.17 -
    5.18 -(* FIXME: remove this quick, crude tactic *)
    5.19 -exception DERIV_name;
    5.20 -fun get_fun_name (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _)) = f
    5.21 -|   get_fun_name (_ $ (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _))) = f
    5.22 -|   get_fun_name _ = raise DERIV_name;
    5.23 -
    5.24 -val deriv_rulesI = [DERIV_Id,DERIV_const,DERIV_cos,DERIV_cmult,
    5.25 -                    DERIV_sin, DERIV_exp, DERIV_inverse,DERIV_pow,
    5.26 -                    DERIV_add, DERIV_diff, DERIV_mult, DERIV_minus,
    5.27 -                    DERIV_inverse_fun,DERIV_quotient,DERIV_fun_pow,
    5.28 -                    DERIV_fun_exp,DERIV_fun_sin,DERIV_fun_cos,
    5.29 -                    DERIV_Id,DERIV_const,DERIV_cos];
    5.30 -
    5.31 -
    5.32 -fun deriv_tac i = (resolve_tac deriv_rulesI i) ORELSE 
    5.33 -                   ((rtac (read_instantiate [("f",get_fun_name (getgoal i))] 
    5.34 -                     DERIV_chain2) i) handle DERIV_name => no_tac);
    5.35 -
    5.36 -val DERIV_tac = ALLGOALS(fn i => REPEAT(deriv_tac i));
    5.37 -
    5.38 -
    5.39 -Goal "sumr 0 n (%m. f (m + k)) = sumr 0 (n + k) f - sumr 0 k f";
    5.40 -by (induct_tac "n" 1);
    5.41 -by Auto_tac;
    5.42 -qed "sumr_offset";
    5.43 -
    5.44 -Goal "ALL f. sumr 0 n (%m. f (m + k)) = sumr 0 (n + k) f - sumr 0 k f";
    5.45 -by (induct_tac "n" 1);
    5.46 -by Auto_tac;
    5.47 -qed "sumr_offset2";
    5.48 -
    5.49 -Goal "sumr 0 (n + k) f = sumr 0 n (%m. f (m + k)) + sumr 0 k f";
    5.50 -by (simp_tac (simpset() addsimps [sumr_offset]) 1);
    5.51 -qed "sumr_offset3";
    5.52 -
    5.53 -Goal "ALL n f. sumr 0 (n + k) f = sumr 0 n (%m. f (m + k)) + sumr 0 k f";
    5.54 -by (simp_tac (simpset() addsimps [sumr_offset]) 1);
    5.55 -qed "sumr_offset4";
    5.56 -
    5.57 -Goal "0 < n ==> \
    5.58 -\     sumr (Suc 0) (Suc n) (%n. (if even(n) then 0 else \
    5.59 -\            ((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n) = \
    5.60 -\     sumr 0 (Suc n) (%n. (if even(n) then 0 else \
    5.61 -\            ((- 1) ^ ((n - (Suc 0)) div 2))/(real (fact n))) * a ^ n)";
    5.62 -by (res_inst_tac [("n1","1")] (sumr_split_add RS subst) 1);
    5.63 -by Auto_tac;
    5.64 -qed "sumr_from_1_from_0";
    5.65 -
    5.66 -(*---------------------------------------------------------------------------*)
    5.67 -(* Maclaurin's theorem with Lagrange form of remainder                       *)
    5.68 -(*---------------------------------------------------------------------------*)
    5.69 -
    5.70 -
    5.71 -
    5.72 -(* FIXME: remove this quick, crude tactic *)
    5.73 -exception DERIV_name;
    5.74 -fun get_fun_name (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _)) = f
    5.75 -|   get_fun_name (_ $ (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _))) = f
    5.76 -|   get_fun_name _ = raise DERIV_name;
    5.77 -
    5.78 -val deriv_rulesI = [DERIV_Id,DERIV_const,DERIV_cos,DERIV_cmult,
    5.79 -                    DERIV_sin, DERIV_exp, DERIV_inverse,DERIV_pow,
    5.80 -                    DERIV_add, DERIV_diff, DERIV_mult, DERIV_minus,
    5.81 -                    DERIV_inverse_fun,DERIV_quotient,DERIV_fun_pow,
    5.82 -                    DERIV_fun_exp,DERIV_fun_sin,DERIV_fun_cos,
    5.83 -                    DERIV_Id,DERIV_const,DERIV_cos];
    5.84 -
    5.85 -
    5.86 -fun deriv_tac i = (resolve_tac deriv_rulesI i) ORELSE 
    5.87 -                   ((rtac (read_instantiate [("f",get_fun_name (getgoal i))] 
    5.88 -                     DERIV_chain2) i) handle DERIV_name => no_tac);
    5.89 -
    5.90 -val DERIV_tac = ALLGOALS(fn i => REPEAT(deriv_tac i));
    5.91 -
    5.92 -
    5.93 -(* Annoying: Proof is now even longer due mostly to 
    5.94 -   change in behaviour of simplifier  since Isabelle99 *)
    5.95 -Goal " [| 0 < h; 0 < n; diff 0 = f; \
    5.96 -\      ALL m t. \
    5.97 -\         m < n & 0 <= t & t <= h --> DERIV (diff m) t :> diff (Suc m) t |] \
    5.98 -\   ==> EX t. 0 < t & \
    5.99 -\             t < h & \
   5.100 -\             f h = \
   5.101 -\             sumr 0 n (%m. (diff m 0 / real (fact m)) * h ^ m) + \
   5.102 -\             (diff n t / real (fact n)) * h ^ n";
   5.103 -by (case_tac "n = 0" 1);
   5.104 -by (Force_tac 1);
   5.105 -by (dtac not0_implies_Suc 1);
   5.106 -by (etac exE 1);
   5.107 -by (subgoal_tac 
   5.108 -     "EX B. f h = sumr 0 n (%m. (diff m 0 / real (fact m)) * (h ^ m)) \
   5.109 -\                  + (B * ((h ^ n) / real (fact n)))" 1);
   5.110 -
   5.111 -by (simp_tac (HOL_ss addsimps [real_add_commute, real_divide_def,
   5.112 -    ARITH_PROVE "(x = z + (y::real)) = (x - y = z)"]) 2);
   5.113 -by (res_inst_tac 
   5.114 -  [("x","(f(h) - sumr 0 n (%m. (diff(m)(0) / real (fact m)) * (h ^ m))) \
   5.115 -\        * real (fact n) / (h ^ n)")] exI 2);
   5.116 -by (simp_tac (HOL_ss addsimps [real_mult_assoc,real_divide_def]) 2);
   5.117 - by (rtac (CLAIM "x = (1::real) ==>  a = a * (x::real)") 2);
   5.118 -by (asm_simp_tac (HOL_ss addsimps 
   5.119 -    [CLAIM "(a::real) * (b * (c * d)) = (d * a) * (b * c)"]
   5.120 -     delsimps [realpow_Suc]) 2);
   5.121 -by (stac left_inverse 2);
   5.122 -by (stac left_inverse 3);
   5.123 -by (rtac (real_not_refl2 RS not_sym) 2);
   5.124 -by (etac zero_less_power 2);
   5.125 -by (rtac real_of_nat_fact_not_zero 2);
   5.126 -by (Simp_tac 2);
   5.127 -by (etac exE 1);
   5.128 -by (cut_inst_tac [("b","%t. f t - \
   5.129 -\      (sumr 0 n (%m. (diff m 0 / real (fact m)) * (t ^ m)) + \
   5.130 -\                       (B * ((t ^ n) / real (fact n))))")] 
   5.131 -    (CLAIM "EX g. g = b") 1);
   5.132 -by (etac exE 1);
   5.133 -by (subgoal_tac "g 0 = 0 & g h =0" 1);
   5.134 -by (asm_simp_tac (simpset() addsimps 
   5.135 -    [ARITH_PROVE "(x - y = z) = (x = z + (y::real))"]
   5.136 -    delsimps [sumr_Suc]) 2);
   5.137 -by (cut_inst_tac [("n","m"),("k","1")] sumr_offset2 2);
   5.138 -by (asm_full_simp_tac (simpset() addsimps 
   5.139 -    [ARITH_PROVE "(x = y - z) = (y = x + (z::real))"]
   5.140 -    delsimps [sumr_Suc]) 2);
   5.141 -by (cut_inst_tac [("b","%m t. diff m t - \
   5.142 -\      (sumr 0 (n - m) (%p. (diff (m + p) 0 / real (fact p)) * (t ^ p)) \
   5.143 -\       + (B * ((t ^ (n - m)) / real (fact(n - m)))))")] 
   5.144 -    (CLAIM "EX difg. difg = b") 1);
   5.145 -by (etac exE 1);
   5.146 -by (subgoal_tac "difg 0 = g" 1);
   5.147 -by (asm_simp_tac (simpset() delsimps [realpow_Suc,fact_Suc]) 2);
   5.148 -by (subgoal_tac "ALL m t. m < n & 0 <= t & t <= h --> \
   5.149 -\                   DERIV (difg m) t :> difg (Suc m) t" 1);
   5.150 -by (Clarify_tac 2);
   5.151 -by (rtac DERIV_diff 2);
   5.152 -by (Asm_simp_tac 2);
   5.153 -by DERIV_tac;
   5.154 -by DERIV_tac;
   5.155 -by (rtac lemma_DERIV_subst 3);
   5.156 -by (rtac DERIV_quotient 3);
   5.157 -by (rtac DERIV_const 4);
   5.158 -by (rtac DERIV_pow 3);
   5.159 -by (asm_simp_tac (simpset() addsimps [inverse_mult_distrib,
   5.160 -    CLAIM_SIMP "(a::real) * b * c * (d * e) = a * b * (c * d) * e" 
   5.161 -    mult_ac,fact_diff_Suc]) 4);
   5.162 -by (Asm_simp_tac 3);
   5.163 -by (forw_inst_tac [("m","ma")] less_add_one 2);
   5.164 -by (Clarify_tac 2);
   5.165 -by (asm_simp_tac (simpset() addsimps 
   5.166 -    [CLAIM "Suc m = ma + d + 1 ==> m - ma = d"]
   5.167 -    delsimps [sumr_Suc]) 2);
   5.168 -by (asm_simp_tac (simpset() addsimps [(simplify (simpset() delsimps [sumr_Suc])
   5.169 -          (read_instantiate [("k","1")] sumr_offset4))] 
   5.170 -    delsimps [sumr_Suc,fact_Suc,realpow_Suc]) 2);
   5.171 -by (rtac lemma_DERIV_subst 2);
   5.172 -by (rtac DERIV_add 2);
   5.173 -by (rtac DERIV_const 3);
   5.174 -by (rtac DERIV_sumr 2);
   5.175 -by (Clarify_tac 2);
   5.176 -by (Simp_tac 3);
   5.177 -by (simp_tac (simpset() addsimps [real_divide_def,real_mult_assoc] 
   5.178 -    delsimps [fact_Suc,realpow_Suc]) 2);
   5.179 -by (rtac DERIV_cmult 2);
   5.180 -by (rtac lemma_DERIV_subst 2);
   5.181 -by (best_tac (claset() addIs [DERIV_chain2] addSIs DERIV_intros) 2);
   5.182 -by (stac fact_Suc 2);
   5.183 -by (stac real_of_nat_mult 2);
   5.184 -by (simp_tac (simpset() addsimps [inverse_mult_distrib] @
   5.185 -    mult_ac) 2);
   5.186 -by (subgoal_tac "ALL ma. ma < n --> \
   5.187 -\        (EX t. 0 < t & t < h & difg (Suc ma) t = 0)" 1);
   5.188 -by (rotate_tac 11 1);
   5.189 -by (dres_inst_tac [("x","m")] spec 1);
   5.190 -by (etac impE 1);
   5.191 -by (Asm_simp_tac 1);
   5.192 -by (etac exE 1);
   5.193 -by (res_inst_tac [("x","t")] exI 1);
   5.194 -by (asm_full_simp_tac (simpset() addsimps 
   5.195 -     [ARITH_PROVE "(x - y = 0) = (y = (x::real))"] 
   5.196 -      delsimps [realpow_Suc,fact_Suc]) 1);
   5.197 -by (subgoal_tac "ALL m. m < n --> difg m 0 = 0" 1);
   5.198 -by (Clarify_tac 2);
   5.199 -by (Asm_simp_tac 2);
   5.200 -by (forw_inst_tac [("m","ma")] less_add_one 2);
   5.201 -by (Clarify_tac 2);
   5.202 -by (asm_simp_tac (simpset() delsimps [sumr_Suc]) 2);
   5.203 -by (asm_simp_tac (simpset() addsimps [(simplify (simpset() delsimps [sumr_Suc]) 
   5.204 -          (read_instantiate [("k","1")] sumr_offset4))] 
   5.205 -    delsimps [sumr_Suc,fact_Suc,realpow_Suc]) 2);
   5.206 -by (subgoal_tac "ALL m. m < n --> (EX t. 0 < t & t < h & \
   5.207 -\                DERIV (difg m) t :> 0)" 1);
   5.208 -by (rtac allI 1 THEN rtac impI 1);
   5.209 -by (rotate_tac 12 1);
   5.210 -by (dres_inst_tac [("x","ma")] spec 1);
   5.211 -by (etac impE 1 THEN assume_tac 1);
   5.212 -by (etac exE 1);
   5.213 -by (res_inst_tac [("x","t")] exI 1);
   5.214 -(* do some tidying up *)
   5.215 -by (ALLGOALS(thin_tac "difg = \
   5.216 -\          (%m t. diff m t - \
   5.217 -\                 (sumr 0 (n - m) \
   5.218 -\                   (%p. diff (m + p) 0 / real (fact p) * t ^ p) + \
   5.219 -\                  B * (t ^ (n - m) / real (fact (n - m)))))"));
   5.220 -by (ALLGOALS(thin_tac "g = \
   5.221 -\          (%t. f t - \
   5.222 -\               (sumr 0 n (%m. diff m 0 / real  (fact m) * t ^ m) + \
   5.223 -\                B * (t ^ n / real (fact n))))"));
   5.224 -by (ALLGOALS(thin_tac "f h = \
   5.225 -\          sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.226 -\          B * (h ^ n / real (fact n))"));
   5.227 -(* back to business *)
   5.228 -by (Asm_simp_tac 1);
   5.229 -by (rtac DERIV_unique 1);
   5.230 -by (Blast_tac 2);
   5.231 -by (Force_tac 1);
   5.232 -by (rtac allI 1 THEN induct_tac "ma" 1);
   5.233 -by (rtac impI 1 THEN rtac Rolle 1);
   5.234 -by (assume_tac 1);
   5.235 -by (Asm_full_simp_tac 1);
   5.236 -by (Asm_full_simp_tac 1);
   5.237 -by (subgoal_tac "ALL t. 0 <= t & t <= h --> g differentiable t" 1);
   5.238 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 1);
   5.239 -by (blast_tac (claset() addDs [DERIV_isCont]) 1);
   5.240 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 1);
   5.241 -by (Clarify_tac 1);
   5.242 -by (res_inst_tac [("x","difg (Suc 0) t")] exI 1);
   5.243 -by (Force_tac 1);
   5.244 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 1);
   5.245 -by (Clarify_tac 1);
   5.246 -by (res_inst_tac [("x","difg (Suc 0) x")] exI 1);
   5.247 -by (Force_tac 1);
   5.248 -by (Step_tac 1);
   5.249 -by (Force_tac 1);
   5.250 -by (subgoal_tac "EX ta. 0 < ta & ta < t & \
   5.251 -\                DERIV difg (Suc n) ta :> 0" 1);
   5.252 -by (rtac Rolle 2 THEN assume_tac 2);
   5.253 -by (Asm_full_simp_tac 2);
   5.254 -by (rotate_tac 2 2);
   5.255 -by (dres_inst_tac [("x","n")] spec 2);
   5.256 -by (ftac (ARITH_PROVE "n < m  ==> n < Suc m") 2);
   5.257 -by (rtac DERIV_unique 2);
   5.258 -by (assume_tac 3);
   5.259 -by (Force_tac 2);
   5.260 -by (subgoal_tac 
   5.261 -    "ALL ta. 0 <= ta & ta <= t --> (difg (Suc n)) differentiable ta" 2);
   5.262 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 2);
   5.263 -by (blast_tac (claset() addSDs [DERIV_isCont]) 2);
   5.264 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 2);
   5.265 -by (Clarify_tac 2);
   5.266 -by (res_inst_tac [("x","difg (Suc (Suc n)) ta")] exI 2);
   5.267 -by (Force_tac 2);
   5.268 -by (asm_full_simp_tac (simpset() addsimps [differentiable_def]) 2);
   5.269 -by (Clarify_tac 2);
   5.270 -by (res_inst_tac [("x","difg (Suc (Suc n)) x")] exI 2);
   5.271 -by (Force_tac 2);
   5.272 -by (Step_tac 1);
   5.273 -by (res_inst_tac [("x","ta")] exI 1);
   5.274 -by (Force_tac 1);
   5.275 -qed "Maclaurin";
   5.276 -
   5.277 -Goal "0 < h & 0 < n & diff 0 = f & \
   5.278 -\      (ALL m t. \
   5.279 -\         m < n & 0 <= t & t <= h --> DERIV (diff m) t :> diff (Suc m) t) \
   5.280 -\   --> (EX t. 0 < t & \
   5.281 -\             t < h & \
   5.282 -\             f h = \
   5.283 -\             sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.284 -\             diff n t / real (fact n) * h ^ n)";
   5.285 -by (blast_tac (claset() addIs [Maclaurin]) 1);
   5.286 -qed "Maclaurin_objl";
   5.287 -
   5.288 -Goal " [| 0 < h; diff 0 = f; \
   5.289 -\      ALL m t. \
   5.290 -\         m < n & 0 <= t & t <= h --> DERIV (diff m) t :> diff (Suc m) t |] \
   5.291 -\   ==> EX t. 0 < t & \
   5.292 -\             t <= h & \
   5.293 -\             f h = \
   5.294 -\             sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.295 -\             diff n t / real (fact n) * h ^ n";
   5.296 -by (case_tac "n" 1);
   5.297 -by Auto_tac;
   5.298 -by (dtac Maclaurin 1 THEN Auto_tac);
   5.299 -qed "Maclaurin2";
   5.300 -
   5.301 -Goal "0 < h & diff 0 = f & \
   5.302 -\      (ALL m t. \
   5.303 -\         m < n & 0 <= t & t <= h --> DERIV (diff m) t :> diff (Suc m) t) \
   5.304 -\   --> (EX t. 0 < t & \
   5.305 -\             t <= h & \
   5.306 -\             f h = \
   5.307 -\             sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.308 -\             diff n t / real (fact n) * h ^ n)";
   5.309 -by (blast_tac (claset() addIs [Maclaurin2]) 1);
   5.310 -qed "Maclaurin2_objl";
   5.311 -
   5.312 -Goal " [| h < 0; 0 < n; diff 0 = f; \
   5.313 -\      ALL m t. \
   5.314 -\         m < n & h <= t & t <= 0 --> DERIV (diff m) t :> diff (Suc m) t |] \
   5.315 -\   ==> EX t. h < t & \
   5.316 -\             t < 0 & \
   5.317 -\             f h = \
   5.318 -\             sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.319 -\             diff n t / real (fact n) * h ^ n";
   5.320 -by (cut_inst_tac [("f","%x. f (-x)"),
   5.321 -                 ("diff","%n x. ((- 1) ^ n) * diff n (-x)"),
   5.322 -                 ("h","-h"),("n","n")] Maclaurin_objl 1);
   5.323 -by (Asm_full_simp_tac 1);
   5.324 -by (etac impE 1 THEN Step_tac 1);
   5.325 -by (stac minus_mult_right 1);
   5.326 -by (rtac DERIV_cmult 1);
   5.327 -by (rtac lemma_DERIV_subst 1);
   5.328 -by (rtac (read_instantiate [("g","uminus")] DERIV_chain2) 1);
   5.329 -by (rtac DERIV_minus 2 THEN rtac DERIV_Id 2);
   5.330 -by (Force_tac 2);
   5.331 -by (Force_tac 1);
   5.332 -by (res_inst_tac [("x","-t")] exI 1);
   5.333 -by Auto_tac;
   5.334 -by (rtac (CLAIM "[| x = x'; y = y' |] ==> x + y = x' + (y'::real)") 1);
   5.335 -by (rtac sumr_fun_eq 1);
   5.336 -by (Asm_full_simp_tac 1);
   5.337 -by (auto_tac (claset(),simpset() addsimps [real_divide_def,
   5.338 -    CLAIM "((a * b) * c) * d = (b * c) * (a * (d::real))",
   5.339 -    power_mult_distrib RS sym]));
   5.340 -qed "Maclaurin_minus";
   5.341 -
   5.342 -Goal "(h < 0 & 0 < n & diff 0 = f & \
   5.343 -\      (ALL m t. \
   5.344 -\         m < n & h <= t & t <= 0 --> DERIV (diff m) t :> diff (Suc m) t))\
   5.345 -\   --> (EX t. h < t & \
   5.346 -\             t < 0 & \
   5.347 -\             f h = \
   5.348 -\             sumr 0 n (%m. diff m 0 / real (fact m) * h ^ m) + \
   5.349 -\             diff n t / real (fact n) * h ^ n)";
   5.350 -by (blast_tac (claset() addIs [Maclaurin_minus]) 1);
   5.351 -qed "Maclaurin_minus_objl";
   5.352 -
   5.353 -(* ------------------------------------------------------------------------- *)
   5.354 -(* More convenient "bidirectional" version.                                  *)
   5.355 -(* ------------------------------------------------------------------------- *)
   5.356 -
   5.357 -(* not good for PVS sin_approx, cos_approx *)
   5.358 -Goal " [| diff 0 = f; \
   5.359 -\      ALL m t. \
   5.360 -\         m < n & abs t <= abs x --> DERIV (diff m) t :> diff (Suc m) t |] \
   5.361 -\   ==> EX t. abs t <= abs x & \
   5.362 -\             f x = \
   5.363 -\             sumr 0 n (%m. diff m 0 / real (fact m) * x ^ m) + \
   5.364 -\             diff n t / real (fact n) * x ^ n";
   5.365 -by (case_tac "n = 0" 1);
   5.366 -by (Force_tac 1);
   5.367 -by (case_tac "x = 0" 1);
   5.368 -by (res_inst_tac [("x","0")] exI 1);
   5.369 -by (Asm_full_simp_tac 1);
   5.370 -by (res_inst_tac [("P","0 < n")] impE 1);
   5.371 -by (assume_tac 2 THEN assume_tac 2);
   5.372 -by (induct_tac "n" 1);
   5.373 -by (Simp_tac 1);
   5.374 -by Auto_tac;
   5.375 -by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1);
   5.376 -by Auto_tac;
   5.377 -by (cut_inst_tac [("f","diff 0"),
   5.378 -                 ("diff","diff"),
   5.379 -                 ("h","x"),("n","n")] Maclaurin_objl 2);
   5.380 -by (Step_tac 2);
   5.381 -by (blast_tac (claset() addDs 
   5.382 -    [ARITH_PROVE "[|(0::real) <= t;t <= x |] ==> abs t <= abs x"]) 2);
   5.383 -by (res_inst_tac [("x","t")] exI 2);
   5.384 -by (force_tac (claset() addIs 
   5.385 -    [ARITH_PROVE "[| 0 < t; (t::real) < x|] ==> abs t <= abs x"],simpset()) 2);
   5.386 -by (cut_inst_tac [("f","diff 0"),
   5.387 -                 ("diff","diff"),
   5.388 -                 ("h","x"),("n","n")] Maclaurin_minus_objl 1);
   5.389 -by (Step_tac 1);
   5.390 -by (blast_tac (claset() addDs 
   5.391 -    [ARITH_PROVE "[|x <= t;t <= (0::real) |] ==> abs t <= abs x"]) 1);
   5.392 -by (res_inst_tac [("x","t")] exI 1);
   5.393 -by (force_tac (claset() addIs 
   5.394 -    [ARITH_PROVE "[| x < t; (t::real) < 0|] ==> abs t <= abs x"],simpset()) 1);
   5.395 -qed "Maclaurin_bi_le";
   5.396 -
   5.397 -Goal "[| diff 0 = f; \
   5.398 -\        ALL m x. DERIV (diff m) x :> diff(Suc m) x; \ 
   5.399 -\       x ~= 0; 0 < n \
   5.400 -\     |] ==> EX t. 0 < abs t & abs t < abs x & \
   5.401 -\              f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) + \
   5.402 -\                    (diff n t / real (fact n)) * x ^ n";
   5.403 -by (res_inst_tac [("x","x"),("y","0")] linorder_cases 1);
   5.404 -by (Blast_tac 2);
   5.405 -by (dtac Maclaurin_minus 1);
   5.406 -by (dtac Maclaurin 5);
   5.407 -by (TRYALL(assume_tac));
   5.408 -by (Blast_tac 1);
   5.409 -by (Blast_tac 2);
   5.410 -by (Step_tac 1);
   5.411 -by (ALLGOALS(res_inst_tac [("x","t")] exI));
   5.412 -by (Step_tac 1);
   5.413 -by (ALLGOALS(arith_tac));
   5.414 -qed "Maclaurin_all_lt";
   5.415 -
   5.416 -Goal "diff 0 = f & \
   5.417 -\     (ALL m x. DERIV (diff m) x :> diff(Suc m) x) & \
   5.418 -\     x ~= 0 & 0 < n \
   5.419 -\     --> (EX t. 0 < abs t & abs t < abs x & \
   5.420 -\              f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) + \
   5.421 -\                    (diff n t / real (fact n)) * x ^ n)";
   5.422 -by (blast_tac (claset() addIs [Maclaurin_all_lt]) 1);
   5.423 -qed "Maclaurin_all_lt_objl";
   5.424 -
   5.425 -Goal "x = (0::real)  \
   5.426 -\     ==> 0 < n --> \
   5.427 -\         sumr 0 n (%m. (diff m (0::real) / real (fact m)) * x ^ m) = \
   5.428 -\         diff 0 0";
   5.429 -by (Asm_simp_tac 1);
   5.430 -by (induct_tac "n" 1);
   5.431 -by Auto_tac; 
   5.432 -qed_spec_mp "Maclaurin_zero";
   5.433 -
   5.434 -Goal "[| diff 0 = f; \
   5.435 -\       ALL m x. DERIV (diff m) x :> diff (Suc m) x \
   5.436 -\     |] ==> EX t. abs t <= abs x & \
   5.437 -\             f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) + \
   5.438 -\                   (diff n t / real (fact n)) * x ^ n";
   5.439 -by (cut_inst_tac [("n","n"),("m","0")] 
   5.440 -       (ARITH_PROVE "n <= m | m < (n::nat)") 1);
   5.441 -by (etac disjE 1);
   5.442 -by (Force_tac 1);
   5.443 -by (case_tac "x = 0" 1);
   5.444 -by (forw_inst_tac [("diff","diff"),("n","n")] Maclaurin_zero 1);
   5.445 -by (assume_tac 1);
   5.446 -by (dtac (gr_implies_not0 RS  not0_implies_Suc) 1);
   5.447 -by (res_inst_tac [("x","0")] exI 1);
   5.448 -by (Force_tac 1);
   5.449 -by (forw_inst_tac [("diff","diff"),("n","n")] Maclaurin_all_lt 1);
   5.450 -by (TRYALL(assume_tac));
   5.451 -by (Step_tac 1);
   5.452 -by (res_inst_tac [("x","t")] exI 1);
   5.453 -by Auto_tac;
   5.454 -qed "Maclaurin_all_le";
   5.455 -
   5.456 -Goal "diff 0 = f & \
   5.457 -\     (ALL m x. DERIV (diff m) x :> diff (Suc m) x)  \
   5.458 -\     --> (EX t. abs t <= abs x & \
   5.459 -\             f x = sumr 0 n (%m. (diff m 0 / real (fact m)) * x ^ m) + \
   5.460 -\                   (diff n t / real (fact n)) * x ^ n)";
   5.461 -by (blast_tac (claset() addIs [Maclaurin_all_le]) 1);
   5.462 -qed "Maclaurin_all_le_objl";
   5.463 -
   5.464 -(* ------------------------------------------------------------------------- *)
   5.465 -(* Version for exp.                                                          *)
   5.466 -(* ------------------------------------------------------------------------- *)
   5.467 -
   5.468 -Goal "[| x ~= 0; 0 < n |] \
   5.469 -\     ==> (EX t. 0 < abs t & \
   5.470 -\               abs t < abs x & \
   5.471 -\               exp x = sumr 0 n (%m. (x ^ m) / real (fact m)) + \
   5.472 -\                       (exp t / real (fact n)) * x ^ n)";
   5.473 -by (cut_inst_tac [("diff","%n. exp"),("f","exp"),("x","x"),("n","n")] 
   5.474 -    Maclaurin_all_lt_objl 1);
   5.475 -by Auto_tac;
   5.476 -qed "Maclaurin_exp_lt";
   5.477 -
   5.478 -Goal "EX t. abs t <= abs x & \
   5.479 -\           exp x = sumr 0 n (%m. (x ^ m) / real (fact m)) + \
   5.480 -\                      (exp t / real (fact n)) * x ^ n";
   5.481 -by (cut_inst_tac [("diff","%n. exp"),("f","exp"),("x","x"),("n","n")] 
   5.482 -    Maclaurin_all_le_objl 1);
   5.483 -by Auto_tac;
   5.484 -qed "Maclaurin_exp_le";
   5.485 -
   5.486 -(* ------------------------------------------------------------------------- *)
   5.487 -(* Version for sin function                                                  *)
   5.488 -(* ------------------------------------------------------------------------- *)
   5.489 -
   5.490 -Goal "[| a < b; ALL x. a <= x & x <= b --> DERIV f x :> f'(x) |] \
   5.491 -\     ==> EX z. a < z & z < b & (f b - f a = (b - a) * f'(z))";
   5.492 -by (dtac MVT 1);
   5.493 -by (blast_tac (claset() addIs [DERIV_isCont]) 1);
   5.494 -by (force_tac (claset() addDs [order_less_imp_le],
   5.495 -    simpset() addsimps [differentiable_def]) 1);
   5.496 -by (blast_tac (claset() addDs [DERIV_unique,order_less_imp_le]) 1);
   5.497 -qed "MVT2";
   5.498 -
   5.499 -Goal "d < (4::nat) ==> d = 0 | d = 1 | d = 2 | d = 3";
   5.500 -by (case_tac "d" 1 THEN Auto_tac);
   5.501 -qed "lemma_exhaust_less_4";
   5.502 -
   5.503 -bind_thm ("real_mult_le_lemma",
   5.504 -          simplify (simpset()) (inst "b" "1" mult_right_mono));
   5.505 -
   5.506 -
   5.507 -Goal "0 < n --> Suc (Suc (2 * n - 2)) = 2*n";
   5.508 -by (induct_tac "n" 1);
   5.509 -by Auto_tac;
   5.510 -qed_spec_mp "Suc_Suc_mult_two_diff_two";
   5.511 -Addsimps [Suc_Suc_mult_two_diff_two];
   5.512 -
   5.513 -Goal "0 < n --> Suc (Suc (4*n - 2)) = 4*n";
   5.514 -by (induct_tac "n" 1);
   5.515 -by Auto_tac;
   5.516 -qed_spec_mp "lemma_Suc_Suc_4n_diff_2";
   5.517 -Addsimps [lemma_Suc_Suc_4n_diff_2];
   5.518 -
   5.519 -Goal "0 < n --> Suc (2 * n - 1) = 2*n";
   5.520 -by (induct_tac "n" 1);
   5.521 -by Auto_tac;
   5.522 -qed_spec_mp "Suc_mult_two_diff_one";
   5.523 -Addsimps [Suc_mult_two_diff_one];
   5.524 -
   5.525 -Goal "EX t. sin x = \
   5.526 -\      (sumr 0 n (%m. (if even m then 0 \
   5.527 -\                      else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) * \
   5.528 -\                      x ^ m)) \
   5.529 -\     + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.530 -by (cut_inst_tac [("f","sin"),("n","n"),("x","x"),
   5.531 -       ("diff","%n x. sin(x + 1/2*real (n)*pi)")] 
   5.532 -       Maclaurin_all_lt_objl 1);
   5.533 -by (Safe_tac);
   5.534 -by (Simp_tac 1);
   5.535 -by (Simp_tac 1);
   5.536 -by (case_tac "n" 1);
   5.537 -by (Clarify_tac 1); 
   5.538 -by (Asm_full_simp_tac 1);
   5.539 -by (dres_inst_tac [("x","0")] spec 1 THEN Asm_full_simp_tac 1);
   5.540 -by (Asm_full_simp_tac 1);
   5.541 -by (rtac ccontr 1);
   5.542 -by (Asm_full_simp_tac 1);
   5.543 -by (dres_inst_tac [("x","x")] spec 1 THEN Asm_full_simp_tac 1);
   5.544 -by (dtac ssubst 1 THEN assume_tac 2);
   5.545 -by (res_inst_tac [("x","t")] exI 1);
   5.546 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.547 -by (rtac sumr_fun_eq 1);
   5.548 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.549 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex] delsimps [fact_Suc,realpow_Suc]));
   5.550 -(*Could sin_zero_iff help?*)
   5.551 -qed "Maclaurin_sin_expansion";
   5.552 -
   5.553 -Goal "EX t. abs t <= abs x &  \
   5.554 -\      sin x = \
   5.555 -\      (sumr 0 n (%m. (if even m then 0 \
   5.556 -\                      else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) * \
   5.557 -\                      x ^ m)) \
   5.558 -\     + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.559 -
   5.560 -by (cut_inst_tac [("f","sin"),("n","n"),("x","x"),
   5.561 -       ("diff","%n x. sin(x + 1/2*real (n)*pi)")] 
   5.562 -       Maclaurin_all_lt_objl 1);
   5.563 -by (Step_tac 1);
   5.564 -by (Simp_tac 1);
   5.565 -by (Simp_tac 1);
   5.566 -by (case_tac "n" 1);
   5.567 -by (Clarify_tac 1); 
   5.568 -by (Asm_full_simp_tac 1);
   5.569 -by (Asm_full_simp_tac 1);
   5.570 -by (rtac ccontr 1);
   5.571 -by (Asm_full_simp_tac 1);
   5.572 -by (dres_inst_tac [("x","x")] spec 1 THEN Asm_full_simp_tac 1);
   5.573 -by (dtac ssubst 1 THEN assume_tac 2);
   5.574 -by (res_inst_tac [("x","t")] exI 1);
   5.575 -by (rtac conjI 1);
   5.576 -by (arith_tac 1);
   5.577 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.578 -by (rtac sumr_fun_eq 1);
   5.579 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.580 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex] delsimps [fact_Suc,realpow_Suc]));
   5.581 -qed "Maclaurin_sin_expansion2";
   5.582 -
   5.583 -Goal "[| 0 < n; 0 < x |] ==> \
   5.584 -\      EX t. 0 < t & t < x & \
   5.585 -\      sin x = \
   5.586 -\      (sumr 0 n (%m. (if even m then 0 \
   5.587 -\                      else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) * \
   5.588 -\                      x ^ m)) \
   5.589 -\     + ((sin(t + 1/2 * real(n) *pi) / real (fact n)) * x ^ n)";
   5.590 -by (cut_inst_tac [("f","sin"),("n","n"),("h","x"),
   5.591 -       ("diff","%n x. sin(x + 1/2*real (n)*pi)")] 
   5.592 -       Maclaurin_objl 1);
   5.593 -by (Step_tac 1);
   5.594 -by (Asm_full_simp_tac 1);
   5.595 -by (Simp_tac 1);
   5.596 -by (dtac ssubst 1 THEN assume_tac 2);
   5.597 -by (res_inst_tac [("x","t")] exI 1);
   5.598 -by (rtac conjI 1 THEN rtac conjI 2);
   5.599 -by (assume_tac 1 THEN assume_tac 1);
   5.600 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.601 -by (rtac sumr_fun_eq 1);
   5.602 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.603 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex] delsimps [fact_Suc,realpow_Suc]));
   5.604 -qed "Maclaurin_sin_expansion3";
   5.605 -
   5.606 -Goal "0 < x ==> \
   5.607 -\      EX t. 0 < t & t <= x & \
   5.608 -\      sin x = \
   5.609 -\      (sumr 0 n (%m. (if even m then 0 \
   5.610 -\                      else ((- 1) ^ ((m - (Suc 0)) div 2)) / real (fact m)) * \
   5.611 -\                      x ^ m)) \
   5.612 -\     + ((sin(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.613 -by (cut_inst_tac [("f","sin"),("n","n"),("h","x"),
   5.614 -       ("diff","%n x. sin(x + 1/2*real (n)*pi)")] 
   5.615 -       Maclaurin2_objl 1);
   5.616 -by (Step_tac 1);
   5.617 -by (Asm_full_simp_tac 1);
   5.618 -by (Simp_tac 1);
   5.619 -by (dtac ssubst 1 THEN assume_tac 2);
   5.620 -by (res_inst_tac [("x","t")] exI 1);
   5.621 -by (rtac conjI 1 THEN rtac conjI 2);
   5.622 -by (assume_tac 1 THEN assume_tac 1);
   5.623 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.624 -by (rtac sumr_fun_eq 1);
   5.625 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.626 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex] delsimps [fact_Suc,realpow_Suc]));
   5.627 -qed "Maclaurin_sin_expansion4";
   5.628 -
   5.629 -(*-----------------------------------------------------------------------------*)
   5.630 -(* Maclaurin expansion for cos                                                 *)
   5.631 -(*-----------------------------------------------------------------------------*)
   5.632 -
   5.633 -Goal "sumr 0 (Suc n) \
   5.634 -\        (%m. (if even m \
   5.635 -\              then (- 1) ^ (m div 2)/(real  (fact m)) \
   5.636 -\              else 0) * \
   5.637 -\             0 ^ m) = 1";
   5.638 -by (induct_tac "n" 1);
   5.639 -by Auto_tac;
   5.640 -qed "sumr_cos_zero_one";
   5.641 -Addsimps [sumr_cos_zero_one];
   5.642 -
   5.643 -Goal "EX t. abs t <= abs x & \
   5.644 -\      cos x = \
   5.645 -\      (sumr 0 n (%m. (if even m \
   5.646 -\                      then (- 1) ^ (m div 2)/(real (fact m)) \
   5.647 -\                      else 0) * \
   5.648 -\                      x ^ m)) \
   5.649 -\     + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.650 -by (cut_inst_tac [("f","cos"),("n","n"),("x","x"),
   5.651 -       ("diff","%n x. cos(x + 1/2*real (n)*pi)")] 
   5.652 -       Maclaurin_all_lt_objl 1);
   5.653 -by (Step_tac 1);
   5.654 -by (Simp_tac 1);
   5.655 -by (Simp_tac 1);
   5.656 -by (case_tac "n" 1);
   5.657 -by (Asm_full_simp_tac 1);
   5.658 -by (asm_full_simp_tac (simpset() delsimps [sumr_Suc]) 1);
   5.659 -by (rtac ccontr 1);
   5.660 -by (Asm_full_simp_tac 1);
   5.661 -by (dres_inst_tac [("x","x")] spec 1 THEN Asm_full_simp_tac 1);
   5.662 -by (dtac ssubst 1 THEN assume_tac 2);
   5.663 -by (res_inst_tac [("x","t")] exI 1);
   5.664 -by (rtac conjI 1);
   5.665 -by (arith_tac 1);
   5.666 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.667 -by (rtac sumr_fun_eq 1);
   5.668 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.669 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex,left_distrib,cos_add]  delsimps 
   5.670 -    [fact_Suc,realpow_Suc]));
   5.671 -by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   5.672 -qed "Maclaurin_cos_expansion";
   5.673 -
   5.674 -Goal "[| 0 < x; 0 < n |] ==> \
   5.675 -\      EX t. 0 < t & t < x & \
   5.676 -\      cos x = \
   5.677 -\      (sumr 0 n (%m. (if even m \
   5.678 -\                      then (- 1) ^ (m div 2)/(real (fact m)) \
   5.679 -\                      else 0) * \
   5.680 -\                      x ^ m)) \
   5.681 -\     + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.682 -by (cut_inst_tac [("f","cos"),("n","n"),("h","x"),
   5.683 -       ("diff","%n x. cos(x + 1/2*real (n)*pi)")] 
   5.684 -       Maclaurin_objl 1);
   5.685 -by (Step_tac 1);
   5.686 -by (Asm_full_simp_tac 1);
   5.687 -by (Simp_tac 1);
   5.688 -by (dtac ssubst 1 THEN assume_tac 2);
   5.689 -by (res_inst_tac [("x","t")] exI 1);
   5.690 -by (rtac conjI 1 THEN rtac conjI 2);
   5.691 -by (assume_tac 1 THEN assume_tac 1);
   5.692 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.693 -by (rtac sumr_fun_eq 1);
   5.694 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.695 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex,left_distrib,cos_add]  delsimps [fact_Suc,realpow_Suc]));
   5.696 -by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   5.697 -qed "Maclaurin_cos_expansion2";
   5.698 -
   5.699 -Goal "[| x < 0; 0 < n |] ==> \
   5.700 -\      EX t. x < t & t < 0 & \
   5.701 -\      cos x = \
   5.702 -\      (sumr 0 n (%m. (if even m \
   5.703 -\                      then (- 1) ^ (m div 2)/(real (fact m)) \
   5.704 -\                      else 0) * \
   5.705 -\                      x ^ m)) \
   5.706 -\     + ((cos(t + 1/2 * real (n) *pi) / real (fact n)) * x ^ n)";
   5.707 -by (cut_inst_tac [("f","cos"),("n","n"),("h","x"),
   5.708 -       ("diff","%n x. cos(x + 1/2*real (n)*pi)")] 
   5.709 -       Maclaurin_minus_objl 1);
   5.710 -by (Step_tac 1);
   5.711 -by (Asm_full_simp_tac 1);
   5.712 -by (Simp_tac 1);
   5.713 -by (dtac ssubst 1 THEN assume_tac 2);
   5.714 -by (res_inst_tac [("x","t")] exI 1);
   5.715 -by (rtac conjI 1 THEN rtac conjI 2);
   5.716 -by (assume_tac 1 THEN assume_tac 1);
   5.717 -by (rtac (CLAIM "[|x = y; x' = y'|] ==> x + x' = y + (y'::real)") 1);
   5.718 -by (rtac sumr_fun_eq 1);
   5.719 -by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex]));
   5.720 -by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex,left_distrib,cos_add]  delsimps [fact_Suc,realpow_Suc]));
   5.721 -by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   5.722 -qed "Maclaurin_minus_cos_expansion";
   5.723 -
   5.724 -(* ------------------------------------------------------------------------- *)
   5.725 -(* Version for ln(1 +/- x). Where is it??                                    *)
   5.726 -(* ------------------------------------------------------------------------- *)
   5.727 -
     6.1 --- a/src/HOL/Hyperreal/Transcendental.thy	Tue Jul 27 15:39:59 2004 +0200
     6.2 +++ b/src/HOL/Hyperreal/Transcendental.thy	Wed Jul 28 10:49:29 2004 +0200
     6.3 @@ -665,7 +665,7 @@
     6.4  apply (drule_tac x="(\<lambda>n. c n * (xa + x) ^ n)" in sums_diff, assumption) 
     6.5  apply (drule_tac x = " (%n. c n * (xa + x) ^ n - c n * x ^ n) " and c = "inverse xa" in sums_mult)
     6.6  apply (rule sums_unique [symmetric])
     6.7 -apply (simp add: diff_def real_divide_def add_ac mult_ac)
     6.8 +apply (simp add: diff_def divide_inverse add_ac mult_ac)
     6.9  apply (rule LIM_zero_cancel)
    6.10  apply (rule_tac g = "%h. suminf (%n. c (n) * ((( ((x + h) ^ n) - (x ^ n)) * inverse h) - (real n * (x ^ (n - Suc 0))))) " in LIM_trans)
    6.11   prefer 2 apply (blast intro: termdiffs_aux) 
    6.12 @@ -1377,7 +1377,7 @@
    6.13  apply (subst real_of_nat_mult)
    6.14  apply (subst real_of_nat_mult)
    6.15  apply (subst real_of_nat_mult)
    6.16 -apply (simp (no_asm) add: real_divide_def inverse_mult_distrib del: fact_Suc)
    6.17 +apply (simp (no_asm) add: divide_inverse inverse_mult_distrib del: fact_Suc)
    6.18  apply (auto simp add: mult_assoc [symmetric] simp del: fact_Suc)
    6.19  apply (rule_tac c="real (Suc (Suc (4*m)))" in mult_less_imp_less_right) 
    6.20  apply (auto simp add: mult_assoc simp del: fact_Suc)
    6.21 @@ -1430,7 +1430,7 @@
    6.22  apply (simp (no_asm) add: mult_assoc del: sumr_Suc)
    6.23  apply (rule sumr_pos_lt_pair)
    6.24  apply (erule sums_summable, safe)
    6.25 -apply (simp (no_asm) add: real_divide_def mult_assoc [symmetric] del: fact_Suc)
    6.26 +apply (simp (no_asm) add: divide_inverse mult_assoc [symmetric] del: fact_Suc)
    6.27  apply (rule real_mult_inverse_cancel2)
    6.28  apply (rule real_of_nat_fact_gt_zero)+
    6.29  apply (simp (no_asm) add: mult_assoc [symmetric] del: fact_Suc)
    6.30 @@ -1788,7 +1788,7 @@
    6.31       "cos x \<noteq> 0 ==> DERIV (%x. sin(x)/cos(x)) x :> inverse((cos x)\<twosuperior>)"
    6.32  apply (rule lemma_DERIV_subst)
    6.33  apply (best intro!: DERIV_intros intro: DERIV_chain2) 
    6.34 -apply (auto simp add: real_divide_def numeral_2_eq_2)
    6.35 +apply (auto simp add: divide_inverse numeral_2_eq_2)
    6.36  done
    6.37  
    6.38  lemma DERIV_tan [simp]: "cos x \<noteq> 0 ==> DERIV tan x :> inverse((cos x)\<twosuperior>)"
    6.39 @@ -1816,7 +1816,7 @@
    6.40  apply (drule_tac x = " (pi/2) - e" in spec)
    6.41  apply (auto simp add: abs_eqI2 tan_def)
    6.42  apply (rule inverse_less_iff_less [THEN iffD1])
    6.43 -apply (auto simp add: real_divide_def)
    6.44 +apply (auto simp add: divide_inverse)
    6.45  apply (rule real_mult_order)
    6.46  apply (subgoal_tac [3] "0 < sin e")
    6.47  apply (subgoal_tac [3] "0 < cos e")
    6.48 @@ -1999,7 +1999,7 @@
    6.49  
    6.50  lemma lemma_sin_cos_eq2 [simp]: "sin (xa + real (Suc m) * pi / 2) =  
    6.51        cos (xa + real (m) * pi / 2)"
    6.52 -apply (simp only: cos_add sin_add real_divide_def real_of_nat_Suc left_distrib right_distrib, auto)
    6.53 +apply (simp only: cos_add sin_add divide_inverse real_of_nat_Suc left_distrib right_distrib, auto)
    6.54  done
    6.55  
    6.56  lemma DERIV_sin_add [simp]: "DERIV (%x. sin (x + k)) xa :> cos (xa + k)"
    6.57 @@ -2015,7 +2015,7 @@
    6.58  
    6.59  lemma sin_cos_npi2 [simp]: "sin (real (Suc (2 * n)) * pi / 2) = (-1) ^ n"
    6.60  apply (cut_tac m = n in sin_cos_npi)
    6.61 -apply (simp only: real_of_nat_Suc left_distrib real_divide_def, auto)
    6.62 +apply (simp only: real_of_nat_Suc left_distrib divide_inverse, auto)
    6.63  done
    6.64  
    6.65  lemma cos_2npi [simp]: "cos (2 * real (n::nat) * pi) = 1"
    6.66 @@ -2043,11 +2043,11 @@
    6.67  
    6.68  (*NEEDED??*)
    6.69  lemma [simp]: "cos (x + real(Suc m) * pi / 2) = -sin (x + real m * pi / 2)"
    6.70 -apply (simp only: cos_add sin_add real_divide_def real_of_nat_Suc left_distrib right_distrib, auto)
    6.71 +apply (simp only: cos_add sin_add divide_inverse real_of_nat_Suc left_distrib right_distrib, auto)
    6.72  done
    6.73  
    6.74  lemma cos_pi_eq_zero [simp]: "cos (pi * real (Suc (2 * m)) / 2) = 0"
    6.75 -by (simp only: cos_add sin_add real_divide_def real_of_nat_Suc left_distrib right_distrib, auto)
    6.76 +by (simp only: cos_add sin_add divide_inverse real_of_nat_Suc left_distrib right_distrib, auto)
    6.77  
    6.78  lemma DERIV_cos_add [simp]: "DERIV (%x. cos (x + k)) xa :> - sin (xa + k)"
    6.79  apply (rule lemma_DERIV_subst)
    6.80 @@ -2373,7 +2373,7 @@
    6.81  apply (case_tac "x = 0")
    6.82  apply (auto simp add: abs_eqI2)
    6.83  apply (drule_tac y = y in real_sqrt_sum_squares_gt_zero3)
    6.84 -apply (auto simp add: zero_less_mult_iff real_divide_def power2_eq_square)
    6.85 +apply (auto simp add: zero_less_mult_iff divide_inverse power2_eq_square)
    6.86  done
    6.87  
    6.88  lemma polar_ex1: "[| x \<noteq> 0; 0 < y |] ==> \<exists>r a. x = r * cos a & y = r * sin a"
     7.1 --- a/src/HOL/IsaMakefile	Tue Jul 27 15:39:59 2004 +0200
     7.2 +++ b/src/HOL/IsaMakefile	Wed Jul 28 10:49:29 2004 +0200
     7.3 @@ -152,7 +152,7 @@
     7.4    Hyperreal/HyperDef.thy Hyperreal/HyperNat.thy\
     7.5    Hyperreal/HyperPow.thy Hyperreal/Hyperreal.thy\
     7.6    Hyperreal/Lim.thy Hyperreal/Log.thy\
     7.7 -  Hyperreal/MacLaurin_lemmas.ML Hyperreal/MacLaurin.thy Hyperreal/NatStar.thy\
     7.8 +  Hyperreal/MacLaurin.thy Hyperreal/NatStar.thy\
     7.9    Hyperreal/NSA.thy Hyperreal/NthRoot.thy Hyperreal/Poly.thy\
    7.10    Hyperreal/SEQ.ML Hyperreal/SEQ.thy Hyperreal/Series.thy Hyperreal/Star.thy \
    7.11    Hyperreal/Transcendental.thy Hyperreal/fuf.ML Hyperreal/hypreal_arith.ML \