| author | haftmann | 
| Wed, 30 Aug 2006 15:11:17 +0200 | |
| changeset 20439 | 1bf42b262a38 | 
| parent 20217 | 25b068a99d2b | 
| child 20552 | 2c31dd358c21 | 
| permissions | -rw-r--r-- | 
| 13958 | 1 | (* Title : HTranscendental.thy | 
| 2 | Author : Jacques D. Fleuriot | |
| 3 | Copyright : 2001 University of Edinburgh | |
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 4 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 5 | Converted to Isar and polished by lcp | 
| 13958 | 6 | *) | 
| 7 | ||
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 8 | header{*Nonstandard Extensions of Transcendental Functions*}
 | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 9 | |
| 15131 | 10 | theory HTranscendental | 
| 15140 | 11 | imports Transcendental Integration | 
| 15131 | 12 | begin | 
| 13958 | 13 | |
| 15013 | 14 | text{*really belongs in Transcendental*}
 | 
| 15 | lemma sqrt_divide_self_eq: | |
| 16 | assumes nneg: "0 \<le> x" | |
| 17 | shows "sqrt x / x = inverse (sqrt x)" | |
| 18 | proof cases | |
| 19 | assume "x=0" thus ?thesis by simp | |
| 20 | next | |
| 21 | assume nz: "x\<noteq>0" | |
| 22 | hence pos: "0<x" using nneg by arith | |
| 23 | show ?thesis | |
| 24 | proof (rule right_inverse_eq [THEN iffD1, THEN sym]) | |
| 25 | show "sqrt x / x \<noteq> 0" by (simp add: divide_inverse nneg nz) | |
| 26 | show "inverse (sqrt x) / (sqrt x / x) = 1" | |
| 27 | by (simp add: divide_inverse mult_assoc [symmetric] | |
| 28 | power2_eq_square [symmetric] real_inv_sqrt_pow2 pos nz) | |
| 29 | qed | |
| 30 | qed | |
| 31 | ||
| 32 | ||
| 19765 | 33 | definition | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 34 | exphr :: "real => hypreal" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 35 |     --{*define exponential function using standard part *}
 | 
| 19765 | 36 | "exphr x = st(sumhr (0, whn, %n. inverse(real (fact n)) * (x ^ n)))" | 
| 13958 | 37 | |
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 38 | sinhr :: "real => hypreal" | 
| 19765 | 39 | "sinhr x = st(sumhr (0, whn, %n. (if even(n) then 0 else | 
| 13958 | 40 | ((-1) ^ ((n - 1) div 2))/(real (fact n))) * (x ^ n)))" | 
| 41 | ||
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 42 | coshr :: "real => hypreal" | 
| 19765 | 43 | "coshr x = st(sumhr (0, whn, %n. (if even(n) then | 
| 13958 | 44 | ((-1) ^ (n div 2))/(real (fact n)) else 0) * x ^ n))" | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 45 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 46 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 47 | subsection{*Nonstandard Extension of Square Root Function*}
 | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 48 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 49 | lemma STAR_sqrt_zero [simp]: "( *f* sqrt) 0 = 0" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 50 | by (simp add: starfun star_n_zero_num) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 51 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 52 | lemma STAR_sqrt_one [simp]: "( *f* sqrt) 1 = 1" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 53 | by (simp add: starfun star_n_one_num) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 54 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 55 | lemma hypreal_sqrt_pow2_iff: "(( *f* sqrt)(x) ^ 2 = x) = (0 \<le> x)" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 56 | apply (cases x) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 57 | apply (auto simp add: star_n_le star_n_zero_num starfun hrealpow star_n_eq_iff | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 58 | simp del: hpowr_Suc realpow_Suc) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 59 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 60 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 61 | lemma hypreal_sqrt_gt_zero_pow2: "!!x. 0 < x ==> ( *f* sqrt) (x) ^ 2 = x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 62 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 63 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 64 | lemma hypreal_sqrt_pow2_gt_zero: "0 < x ==> 0 < ( *f* sqrt) (x) ^ 2" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 65 | by (frule hypreal_sqrt_gt_zero_pow2, auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 66 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 67 | lemma hypreal_sqrt_not_zero: "0 < x ==> ( *f* sqrt) (x) \<noteq> 0" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 68 | apply (frule hypreal_sqrt_pow2_gt_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 69 | apply (auto simp add: numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 70 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 71 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 72 | lemma hypreal_inverse_sqrt_pow2: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 73 | "0 < x ==> inverse (( *f* sqrt)(x)) ^ 2 = inverse x" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 74 | apply (cut_tac n1 = 2 and a1 = "( *f* sqrt) x" in power_inverse [symmetric]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 75 | apply (auto dest: hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 76 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 77 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 78 | lemma hypreal_sqrt_mult_distrib: | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 79 | "!!x y. [|0 < x; 0 <y |] ==> | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 80 | ( *f* sqrt)(x*y) = ( *f* sqrt)(x) * ( *f* sqrt)(y)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 81 | apply transfer | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 82 | apply (auto intro: real_sqrt_mult_distrib) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 83 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 84 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 85 | lemma hypreal_sqrt_mult_distrib2: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 86 | "[|0\<le>x; 0\<le>y |] ==> | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 87 | ( *f* sqrt)(x*y) = ( *f* sqrt)(x) * ( *f* sqrt)(y)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 88 | by (auto intro: hypreal_sqrt_mult_distrib simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 89 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 90 | lemma hypreal_sqrt_approx_zero [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 91 | "0 < x ==> (( *f* sqrt)(x) @= 0) = (x @= 0)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 92 | apply (auto simp add: mem_infmal_iff [symmetric]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 93 | apply (rule hypreal_sqrt_gt_zero_pow2 [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 94 | apply (auto intro: Infinitesimal_mult | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 95 | dest!: hypreal_sqrt_gt_zero_pow2 [THEN ssubst] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 96 | simp add: numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 97 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 98 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 99 | lemma hypreal_sqrt_approx_zero2 [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 100 | "0 \<le> x ==> (( *f* sqrt)(x) @= 0) = (x @= 0)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 101 | by (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 102 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 103 | lemma hypreal_sqrt_sum_squares [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 104 | "(( *f* sqrt)(x*x + y*y + z*z) @= 0) = (x*x + y*y + z*z @= 0)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 105 | apply (rule hypreal_sqrt_approx_zero2) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 106 | apply (rule add_nonneg_nonneg)+ | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 107 | apply (auto simp add: zero_le_square) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 108 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 109 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 110 | lemma hypreal_sqrt_sum_squares2 [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 111 | "(( *f* sqrt)(x*x + y*y) @= 0) = (x*x + y*y @= 0)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 112 | apply (rule hypreal_sqrt_approx_zero2) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 113 | apply (rule add_nonneg_nonneg) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 114 | apply (auto simp add: zero_le_square) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 115 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 116 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 117 | lemma hypreal_sqrt_gt_zero: "!!x. 0 < x ==> 0 < ( *f* sqrt)(x)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 118 | apply transfer | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 119 | apply (auto intro: real_sqrt_gt_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 120 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 121 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 122 | lemma hypreal_sqrt_ge_zero: "0 \<le> x ==> 0 \<le> ( *f* sqrt)(x)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 123 | by (auto intro: hypreal_sqrt_gt_zero simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 124 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 125 | lemma hypreal_sqrt_hrabs [simp]: "!!x. ( *f* sqrt)(x ^ 2) = abs(x)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 126 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 127 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 128 | lemma hypreal_sqrt_hrabs2 [simp]: "!!x. ( *f* sqrt)(x*x) = abs(x)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 129 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 130 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 131 | lemma hypreal_sqrt_hyperpow_hrabs [simp]: | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 132 | "!!x. ( *f* sqrt)(x pow (hypnat_of_nat 2)) = abs(x)" | 
| 17332 
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
 huffman parents: 
17318diff
changeset | 133 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 134 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 135 | lemma star_sqrt_HFinite: "\<lbrakk>x \<in> HFinite; 0 \<le> x\<rbrakk> \<Longrightarrow> ( *f* sqrt) x \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 136 | apply (rule HFinite_square_iff [THEN iffD1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 137 | apply (simp only: hypreal_sqrt_mult_distrib2 [symmetric], simp) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 138 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 139 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 140 | lemma st_hypreal_sqrt: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 141 | "[| x \<in> HFinite; 0 \<le> x |] ==> st(( *f* sqrt) x) = ( *f* sqrt)(st x)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 142 | apply (rule power_inject_base [where n=1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 143 | apply (auto intro!: st_zero_le hypreal_sqrt_ge_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 144 | apply (rule st_mult [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 145 | apply (rule_tac [3] hypreal_sqrt_mult_distrib2 [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 146 | apply (rule_tac [5] hypreal_sqrt_mult_distrib2 [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 147 | apply (auto simp add: st_hrabs st_zero_le star_sqrt_HFinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 148 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 149 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 150 | lemma hypreal_sqrt_sum_squares_ge1 [simp]: "!!x y. x \<le> ( *f* sqrt)(x ^ 2 + y ^ 2)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 151 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 152 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 153 | lemma HFinite_hypreal_sqrt: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 154 | "[| 0 \<le> x; x \<in> HFinite |] ==> ( *f* sqrt) x \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 155 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 156 | apply (rule HFinite_square_iff [THEN iffD1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 157 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 158 | apply (simp add: numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 159 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 160 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 161 | lemma HFinite_hypreal_sqrt_imp_HFinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 162 | "[| 0 \<le> x; ( *f* sqrt) x \<in> HFinite |] ==> x \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 163 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 164 | apply (drule HFinite_square_iff [THEN iffD2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 165 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 166 | apply (simp add: numeral_2_eq_2 del: HFinite_square_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 167 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 168 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 169 | lemma HFinite_hypreal_sqrt_iff [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 170 | "0 \<le> x ==> (( *f* sqrt) x \<in> HFinite) = (x \<in> HFinite)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 171 | by (blast intro: HFinite_hypreal_sqrt HFinite_hypreal_sqrt_imp_HFinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 172 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 173 | lemma HFinite_sqrt_sum_squares [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 174 | "(( *f* sqrt)(x*x + y*y) \<in> HFinite) = (x*x + y*y \<in> HFinite)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 175 | apply (rule HFinite_hypreal_sqrt_iff) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 176 | apply (rule add_nonneg_nonneg) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 177 | apply (auto simp add: zero_le_square) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 178 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 179 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 180 | lemma Infinitesimal_hypreal_sqrt: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 181 | "[| 0 \<le> x; x \<in> Infinitesimal |] ==> ( *f* sqrt) x \<in> Infinitesimal" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 182 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 183 | apply (rule Infinitesimal_square_iff [THEN iffD2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 184 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 185 | apply (simp add: numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 186 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 187 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 188 | lemma Infinitesimal_hypreal_sqrt_imp_Infinitesimal: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 189 | "[| 0 \<le> x; ( *f* sqrt) x \<in> Infinitesimal |] ==> x \<in> Infinitesimal" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 190 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 191 | apply (drule Infinitesimal_square_iff [THEN iffD1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 192 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 193 | apply (simp add: numeral_2_eq_2 del: Infinitesimal_square_iff [symmetric]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 194 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 195 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 196 | lemma Infinitesimal_hypreal_sqrt_iff [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 197 | "0 \<le> x ==> (( *f* sqrt) x \<in> Infinitesimal) = (x \<in> Infinitesimal)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 198 | by (blast intro: Infinitesimal_hypreal_sqrt_imp_Infinitesimal Infinitesimal_hypreal_sqrt) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 199 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 200 | lemma Infinitesimal_sqrt_sum_squares [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 201 | "(( *f* sqrt)(x*x + y*y) \<in> Infinitesimal) = (x*x + y*y \<in> Infinitesimal)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 202 | apply (rule Infinitesimal_hypreal_sqrt_iff) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 203 | apply (rule add_nonneg_nonneg) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 204 | apply (auto simp add: zero_le_square) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 205 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 206 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 207 | lemma HInfinite_hypreal_sqrt: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 208 | "[| 0 \<le> x; x \<in> HInfinite |] ==> ( *f* sqrt) x \<in> HInfinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 209 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 210 | apply (rule HInfinite_square_iff [THEN iffD1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 211 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 212 | apply (simp add: numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 213 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 214 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 215 | lemma HInfinite_hypreal_sqrt_imp_HInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 216 | "[| 0 \<le> x; ( *f* sqrt) x \<in> HInfinite |] ==> x \<in> HInfinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 217 | apply (auto simp add: order_le_less) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 218 | apply (drule HInfinite_square_iff [THEN iffD2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 219 | apply (drule hypreal_sqrt_gt_zero_pow2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 220 | apply (simp add: numeral_2_eq_2 del: HInfinite_square_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 221 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 222 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 223 | lemma HInfinite_hypreal_sqrt_iff [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 224 | "0 \<le> x ==> (( *f* sqrt) x \<in> HInfinite) = (x \<in> HInfinite)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 225 | by (blast intro: HInfinite_hypreal_sqrt HInfinite_hypreal_sqrt_imp_HInfinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 226 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 227 | lemma HInfinite_sqrt_sum_squares [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 228 | "(( *f* sqrt)(x*x + y*y) \<in> HInfinite) = (x*x + y*y \<in> HInfinite)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 229 | apply (rule HInfinite_hypreal_sqrt_iff) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 230 | apply (rule add_nonneg_nonneg) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 231 | apply (auto simp add: zero_le_square) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 232 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 233 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 234 | lemma HFinite_exp [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 235 | "sumhr (0, whn, %n. inverse (real (fact n)) * x ^ n) \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 236 | by (auto intro!: NSBseq_HFinite_hypreal NSconvergent_NSBseq | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 237 | simp add: starfunNat_sumr [symmetric] starfun hypnat_omega_def | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 238 | convergent_NSconvergent_iff [symmetric] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 239 | summable_convergent_sumr_iff [symmetric] summable_exp) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 240 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 241 | lemma exphr_zero [simp]: "exphr 0 = 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 242 | apply (simp add: exphr_def sumhr_split_add | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 243 | [OF hypnat_one_less_hypnat_omega, symmetric]) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 244 | apply (simp add: sumhr star_n_zero_num starfun star_n_one_num star_n_add | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 245 | hypnat_omega_def | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 246 | del: OrderedGroup.add_0) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 247 | apply (simp add: star_n_one_num [symmetric]) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 248 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 249 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 250 | lemma coshr_zero [simp]: "coshr 0 = 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 251 | apply (simp add: coshr_def sumhr_split_add | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 252 | [OF hypnat_one_less_hypnat_omega, symmetric]) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 253 | apply (simp add: sumhr star_n_zero_num star_n_one_num hypnat_omega_def) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 254 | apply (simp add: star_n_one_num [symmetric] star_n_zero_num [symmetric]) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 255 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 256 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 257 | lemma STAR_exp_zero_approx_one [simp]: "( *f* exp) 0 @= 1" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 258 | by (simp add: star_n_zero_num star_n_one_num starfun) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 259 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 260 | lemma STAR_exp_Infinitesimal: "x \<in> Infinitesimal ==> ( *f* exp) x @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 261 | apply (case_tac "x = 0") | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 262 | apply (cut_tac [2] x = 0 in DERIV_exp) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 263 | apply (auto simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 264 | apply (drule_tac x = x in bspec, auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 265 | apply (drule_tac c = x in approx_mult1) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 266 | apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 267 | simp add: mult_assoc) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 268 | apply (rule approx_add_right_cancel [where d="-1"]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 269 | apply (rule approx_sym [THEN [2] approx_trans2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 270 | apply (auto simp add: mem_infmal_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 271 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 272 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 273 | lemma STAR_exp_epsilon [simp]: "( *f* exp) epsilon @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 274 | by (auto intro: STAR_exp_Infinitesimal) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 275 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 276 | lemma STAR_exp_add: "!!x y. ( *f* exp)(x + y) = ( *f* exp) x * ( *f* exp) y" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 277 | by (transfer, rule exp_add) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 278 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 279 | lemma exphr_hypreal_of_real_exp_eq: "exphr x = hypreal_of_real (exp x)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 280 | apply (simp add: exphr_def) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 281 | apply (rule st_hypreal_of_real [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 282 | apply (rule approx_st_eq, auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 283 | apply (rule approx_minus_iff [THEN iffD2]) | 
| 17299 | 284 | apply (simp only: mem_infmal_iff [symmetric]) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 285 | apply (auto simp add: mem_infmal_iff [symmetric] star_of_def star_n_zero_num hypnat_omega_def sumhr star_n_minus star_n_add) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 286 | apply (rule NSLIMSEQ_zero_Infinitesimal_hypreal) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 287 | apply (insert exp_converges [of x]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 288 | apply (simp add: sums_def) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 289 | apply (drule LIMSEQ_const [THEN [2] LIMSEQ_add, where b = "- exp x"]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 290 | apply (simp add: LIMSEQ_NSLIMSEQ_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 291 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 292 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 293 | lemma starfun_exp_ge_add_one_self [simp]: "!!x. 0 \<le> x ==> (1 + x) \<le> ( *f* exp) x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 294 | by (transfer, rule exp_ge_add_one_self_aux) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 295 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 296 | (* exp (oo) is infinite *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 297 | lemma starfun_exp_HInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 298 | "[| x \<in> HInfinite; 0 \<le> x |] ==> ( *f* exp) x \<in> HInfinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 299 | apply (frule starfun_exp_ge_add_one_self) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 300 | apply (rule HInfinite_ge_HInfinite, assumption) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 301 | apply (rule order_trans [of _ "1+x"], auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 302 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 303 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 304 | lemma starfun_exp_minus: "!!x. ( *f* exp) (-x) = inverse(( *f* exp) x)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 305 | by (transfer, rule exp_minus) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 306 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 307 | (* exp (-oo) is infinitesimal *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 308 | lemma starfun_exp_Infinitesimal: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 309 | "[| x \<in> HInfinite; x \<le> 0 |] ==> ( *f* exp) x \<in> Infinitesimal" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 310 | apply (subgoal_tac "\<exists>y. x = - y") | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 311 | apply (rule_tac [2] x = "- x" in exI) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 312 | apply (auto intro!: HInfinite_inverse_Infinitesimal starfun_exp_HInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 313 | simp add: starfun_exp_minus HInfinite_minus_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 314 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 315 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 316 | lemma starfun_exp_gt_one [simp]: "!!x. 0 < x ==> 1 < ( *f* exp) x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 317 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 318 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 319 | (* needs derivative of inverse function | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 320 | TRY a NS one today!!! | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 321 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 322 | Goal "x @= 1 ==> ( *f* ln) x @= 1" | 
| 17298 | 323 | by (res_inst_tac [("z","x")] eq_Abs_star 1);
 | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 324 | by (auto_tac (claset(),simpset() addsimps [hypreal_one_def])); | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 325 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 326 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 327 | Goalw [nsderiv_def] "0r < x ==> NSDERIV ln x :> inverse x"; | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 328 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 329 | *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 330 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 331 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 332 | lemma starfun_ln_exp [simp]: "!!x. ( *f* ln) (( *f* exp) x) = x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 333 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 334 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 335 | lemma starfun_exp_ln_iff [simp]: "!!x. (( *f* exp)(( *f* ln) x) = x) = (0 < x)" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 336 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 337 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 338 | lemma starfun_exp_ln_eq: "( *f* exp) u = x ==> ( *f* ln) x = u" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 339 | by auto | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 340 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 341 | lemma starfun_ln_less_self [simp]: "!!x. 0 < x ==> ( *f* ln) x < x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 342 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 343 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 344 | lemma starfun_ln_ge_zero [simp]: "!!x. 1 \<le> x ==> 0 \<le> ( *f* ln) x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 345 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 346 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 347 | lemma starfun_ln_gt_zero [simp]: "!!x .1 < x ==> 0 < ( *f* ln) x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 348 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 349 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 350 | lemma starfun_ln_not_eq_zero [simp]: "!!x. [| 0 < x; x \<noteq> 1 |] ==> ( *f* ln) x \<noteq> 0" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 351 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 352 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 353 | lemma starfun_ln_HFinite: "[| x \<in> HFinite; 1 \<le> x |] ==> ( *f* ln) x \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 354 | apply (rule HFinite_bounded) | 
| 15234 
ec91a90c604e
simplification tweaks for better arithmetic reasoning
 paulson parents: 
15229diff
changeset | 355 | apply assumption | 
| 
ec91a90c604e
simplification tweaks for better arithmetic reasoning
 paulson parents: 
15229diff
changeset | 356 | apply (simp_all add: starfun_ln_less_self order_less_imp_le) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 357 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 358 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 359 | lemma starfun_ln_inverse: "!!x. 0 < x ==> ( *f* ln) (inverse x) = -( *f* ln) x" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 360 | by (transfer, rule ln_inverse) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 361 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 362 | lemma starfun_exp_HFinite: "x \<in> HFinite ==> ( *f* exp) x \<in> HFinite" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 363 | apply (cases x) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 364 | apply (auto simp add: starfun HFinite_FreeUltrafilterNat_iff) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 365 | apply (rule bexI [OF _ Rep_star_star_n], auto) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 366 | apply (rule_tac x = "exp u" in exI) | 
| 20217 
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
 webertj parents: 
19765diff
changeset | 367 | apply ultra | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 368 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 369 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 370 | lemma starfun_exp_add_HFinite_Infinitesimal_approx: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 371 | "[|x \<in> Infinitesimal; z \<in> HFinite |] ==> ( *f* exp) (z + x) @= ( *f* exp) z" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 372 | apply (simp add: STAR_exp_add) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 373 | apply (frule STAR_exp_Infinitesimal) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 374 | apply (drule approx_mult2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 375 | apply (auto intro: starfun_exp_HFinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 376 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 377 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 378 | (* using previous result to get to result *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 379 | lemma starfun_ln_HInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 380 | "[| x \<in> HInfinite; 0 < x |] ==> ( *f* ln) x \<in> HInfinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 381 | apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 382 | apply (drule starfun_exp_HFinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 383 | apply (simp add: starfun_exp_ln_iff [THEN iffD2] HFinite_HInfinite_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 384 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 385 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 386 | lemma starfun_exp_HInfinite_Infinitesimal_disj: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 387 | "x \<in> HInfinite ==> ( *f* exp) x \<in> HInfinite | ( *f* exp) x \<in> Infinitesimal" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 388 | apply (insert linorder_linear [of x 0]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 389 | apply (auto intro: starfun_exp_HInfinite starfun_exp_Infinitesimal) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 390 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 391 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 392 | (* check out this proof!!! *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 393 | lemma starfun_ln_HFinite_not_Infinitesimal: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 394 | "[| x \<in> HFinite - Infinitesimal; 0 < x |] ==> ( *f* ln) x \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 395 | apply (rule ccontr, drule HInfinite_HFinite_iff [THEN iffD2]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 396 | apply (drule starfun_exp_HInfinite_Infinitesimal_disj) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 397 | apply (simp add: starfun_exp_ln_iff [symmetric] HInfinite_HFinite_iff | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 398 | del: starfun_exp_ln_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 399 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 400 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 401 | (* we do proof by considering ln of 1/x *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 402 | lemma starfun_ln_Infinitesimal_HInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 403 | "[| x \<in> Infinitesimal; 0 < x |] ==> ( *f* ln) x \<in> HInfinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 404 | apply (drule Infinitesimal_inverse_HInfinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 405 | apply (frule positive_imp_inverse_positive) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 406 | apply (drule_tac [2] starfun_ln_HInfinite) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 407 | apply (auto simp add: starfun_ln_inverse HInfinite_minus_iff) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 408 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 409 | |
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 410 | lemma starfun_ln_less_zero: "!!x. [| 0 < x; x < 1 |] ==> ( *f* ln) x < 0" | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 411 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 412 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 413 | lemma starfun_ln_Infinitesimal_less_zero: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 414 | "[| x \<in> Infinitesimal; 0 < x |] ==> ( *f* ln) x < 0" | 
| 15229 | 415 | by (auto intro!: starfun_ln_less_zero simp add: Infinitesimal_def) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 416 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 417 | lemma starfun_ln_HInfinite_gt_zero: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 418 | "[| x \<in> HInfinite; 0 < x |] ==> 0 < ( *f* ln) x" | 
| 15229 | 419 | by (auto intro!: starfun_ln_gt_zero simp add: HInfinite_def) | 
| 420 | ||
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 421 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 422 | (* | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 423 | Goalw [NSLIM_def] "(%h. ((x powr h) - 1) / h) -- 0 --NS> ln x" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 424 | *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 425 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 426 | lemma HFinite_sin [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 427 | "sumhr (0, whn, %n. (if even(n) then 0 else | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 428 | ((- 1) ^ ((n - 1) div 2))/(real (fact n))) * x ^ n) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 429 | \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 430 | apply (auto intro!: NSBseq_HFinite_hypreal NSconvergent_NSBseq | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 431 | simp add: starfunNat_sumr [symmetric] starfun hypnat_omega_def | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 432 | convergent_NSconvergent_iff [symmetric] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 433 | summable_convergent_sumr_iff [symmetric]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 434 | apply (simp only: One_nat_def summable_sin) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 435 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 436 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 437 | lemma STAR_sin_zero [simp]: "( *f* sin) 0 = 0" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 438 | by (transfer, simp) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 439 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 440 | lemma STAR_sin_Infinitesimal [simp]: "x \<in> Infinitesimal ==> ( *f* sin) x @= x" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 441 | apply (case_tac "x = 0") | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 442 | apply (cut_tac [2] x = 0 in DERIV_sin) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 443 | apply (auto simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 444 | apply (drule bspec [where x = x], auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 445 | apply (drule approx_mult1 [where c = x]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 446 | apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 447 | simp add: mult_assoc) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 448 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 449 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 450 | lemma HFinite_cos [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 451 | "sumhr (0, whn, %n. (if even(n) then | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 452 | ((- 1) ^ (n div 2))/(real (fact n)) else | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 453 | 0) * x ^ n) \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 454 | by (auto intro!: NSBseq_HFinite_hypreal NSconvergent_NSBseq | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 455 | simp add: starfunNat_sumr [symmetric] starfun hypnat_omega_def | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 456 | convergent_NSconvergent_iff [symmetric] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 457 | summable_convergent_sumr_iff [symmetric] summable_cos) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 458 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 459 | lemma STAR_cos_zero [simp]: "( *f* cos) 0 = 1" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 460 | by (simp add: starfun star_n_zero_num star_n_one_num) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 461 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 462 | lemma STAR_cos_Infinitesimal [simp]: "x \<in> Infinitesimal ==> ( *f* cos) x @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 463 | apply (case_tac "x = 0") | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 464 | apply (cut_tac [2] x = 0 in DERIV_cos) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 465 | apply (auto simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 466 | apply (drule bspec [where x = x]) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 467 | apply auto | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 468 | apply (drule approx_mult1 [where c = x]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 469 | apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 470 | simp add: mult_assoc) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 471 | apply (rule approx_add_right_cancel [where d = "-1"], auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 472 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 473 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 474 | lemma STAR_tan_zero [simp]: "( *f* tan) 0 = 0" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 475 | by (simp add: starfun star_n_zero_num) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 476 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 477 | lemma STAR_tan_Infinitesimal: "x \<in> Infinitesimal ==> ( *f* tan) x @= x" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 478 | apply (case_tac "x = 0") | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 479 | apply (cut_tac [2] x = 0 in DERIV_tan) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 480 | apply (auto simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 481 | apply (drule bspec [where x = x], auto) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 482 | apply (drule approx_mult1 [where c = x]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 483 | apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 484 | simp add: mult_assoc) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 485 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 486 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 487 | lemma STAR_sin_cos_Infinitesimal_mult: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 488 | "x \<in> Infinitesimal ==> ( *f* sin) x * ( *f* cos) x @= x" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 489 | apply (insert approx_mult_HFinite [of "( *f* sin) x" _ "( *f* cos) x" 1]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 490 | apply (simp add: Infinitesimal_subset_HFinite [THEN subsetD]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 491 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 492 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 493 | lemma HFinite_pi: "hypreal_of_real pi \<in> HFinite" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 494 | by simp | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 495 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 496 | (* lemmas *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 497 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 498 | lemma lemma_split_hypreal_of_real: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 499 | "N \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 500 | ==> hypreal_of_real a = | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 501 | hypreal_of_hypnat N * (inverse(hypreal_of_hypnat N) * hypreal_of_real a)" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 502 | by (simp add: mult_assoc [symmetric] HNatInfinite_not_eq_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 503 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 504 | lemma STAR_sin_Infinitesimal_divide: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 505 | "[|x \<in> Infinitesimal; x \<noteq> 0 |] ==> ( *f* sin) x/x @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 506 | apply (cut_tac x = 0 in DERIV_sin) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 507 | apply (simp add: NSDERIV_DERIV_iff [symmetric] nsderiv_def) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 508 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 509 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 510 | (*------------------------------------------------------------------------*) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 511 | (* sin* (1/n) * 1/(1/n) @= 1 for n = oo *) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 512 | (*------------------------------------------------------------------------*) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 513 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 514 | lemma lemma_sin_pi: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 515 | "n \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 516 | ==> ( *f* sin) (inverse (hypreal_of_hypnat n))/(inverse (hypreal_of_hypnat n)) @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 517 | apply (rule STAR_sin_Infinitesimal_divide) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 518 | apply (auto simp add: HNatInfinite_not_eq_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 519 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 520 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 521 | lemma STAR_sin_inverse_HNatInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 522 | "n \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 523 | ==> ( *f* sin) (inverse (hypreal_of_hypnat n)) * hypreal_of_hypnat n @= 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 524 | apply (frule lemma_sin_pi) | 
| 14430 
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
 paulson parents: 
14420diff
changeset | 525 | apply (simp add: divide_inverse) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 526 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 527 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 528 | lemma Infinitesimal_pi_divide_HNatInfinite: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 529 | "N \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 530 | ==> hypreal_of_real pi/(hypreal_of_hypnat N) \<in> Infinitesimal" | 
| 14430 
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
 paulson parents: 
14420diff
changeset | 531 | apply (simp add: divide_inverse) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 532 | apply (auto intro: Infinitesimal_HFinite_mult2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 533 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 534 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 535 | lemma pi_divide_HNatInfinite_not_zero [simp]: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 536 | "N \<in> HNatInfinite ==> hypreal_of_real pi/(hypreal_of_hypnat N) \<noteq> 0" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 537 | by (simp add: HNatInfinite_not_eq_zero) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 538 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 539 | lemma STAR_sin_pi_divide_HNatInfinite_approx_pi: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 540 | "n \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 541 | ==> ( *f* sin) (hypreal_of_real pi/(hypreal_of_hypnat n)) * hypreal_of_hypnat n | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 542 | @= hypreal_of_real pi" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 543 | apply (frule STAR_sin_Infinitesimal_divide | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 544 | [OF Infinitesimal_pi_divide_HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 545 | pi_divide_HNatInfinite_not_zero]) | 
| 15539 | 546 | apply (auto) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 547 | apply (rule approx_SReal_mult_cancel [of "inverse (hypreal_of_real pi)"]) | 
| 14430 
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
 paulson parents: 
14420diff
changeset | 548 | apply (auto intro: SReal_inverse simp add: divide_inverse mult_ac) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 549 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 550 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 551 | lemma STAR_sin_pi_divide_HNatInfinite_approx_pi2: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 552 | "n \<in> HNatInfinite | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 553 | ==> hypreal_of_hypnat n * | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 554 | ( *f* sin) (hypreal_of_real pi/(hypreal_of_hypnat n)) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 555 | @= hypreal_of_real pi" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 556 | apply (rule mult_commute [THEN subst]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 557 | apply (erule STAR_sin_pi_divide_HNatInfinite_approx_pi) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 558 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 559 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 560 | lemma starfunNat_pi_divide_n_Infinitesimal: | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 561 | "N \<in> HNatInfinite ==> ( *f* (%x. pi / real x)) N \<in> Infinitesimal" | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 562 | by (auto intro!: Infinitesimal_HFinite_mult2 | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 563 | simp add: starfun_mult [symmetric] divide_inverse | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 564 | starfun_inverse [symmetric] starfunNat_real_of_nat) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 565 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 566 | lemma STAR_sin_pi_divide_n_approx: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 567 | "N \<in> HNatInfinite ==> | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 568 | ( *f* sin) (( *f* (%x. pi / real x)) N) @= | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 569 | hypreal_of_real pi/(hypreal_of_hypnat N)" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 570 | apply (simp add: starfunNat_real_of_nat [symmetric]) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 571 | apply (rule STAR_sin_Infinitesimal) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 572 | apply (simp add: divide_inverse) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 573 | apply (rule Infinitesimal_HFinite_mult2) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 574 | apply (subst starfun_inverse) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 575 | apply (erule starfunNat_inverse_real_of_nat_Infinitesimal) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 576 | apply simp | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 577 | done | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 578 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 579 | lemma NSLIMSEQ_sin_pi: "(%n. real n * sin (pi / real n)) ----NS> pi" | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 580 | apply (auto simp add: NSLIMSEQ_def starfun_mult [symmetric] starfunNat_real_of_nat) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 581 | apply (rule_tac f1 = sin in starfun_o2 [THEN subst]) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 582 | apply (auto simp add: starfun_mult [symmetric] starfunNat_real_of_nat divide_inverse) | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 583 | apply (rule_tac f1 = inverse in starfun_o2 [THEN subst]) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 584 | apply (auto dest: STAR_sin_pi_divide_HNatInfinite_approx_pi | 
| 14430 
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
 paulson parents: 
14420diff
changeset | 585 | simp add: starfunNat_real_of_nat mult_commute divide_inverse) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 586 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 587 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 588 | lemma NSLIMSEQ_cos_one: "(%n. cos (pi / real n))----NS> 1" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 589 | apply (simp add: NSLIMSEQ_def, auto) | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 590 | apply (rule_tac f1 = cos in starfun_o2 [THEN subst]) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 591 | apply (rule STAR_cos_Infinitesimal) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 592 | apply (auto intro!: Infinitesimal_HFinite_mult2 | 
| 17318 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 593 | simp add: starfun_mult [symmetric] divide_inverse | 
| 
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
 huffman parents: 
17299diff
changeset | 594 | starfun_inverse [symmetric] starfunNat_real_of_nat) | 
| 14420 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 595 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 596 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 597 | lemma NSLIMSEQ_sin_cos_pi: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 598 | "(%n. real n * sin (pi / real n) * cos (pi / real n)) ----NS> pi" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 599 | by (insert NSLIMSEQ_mult [OF NSLIMSEQ_sin_pi NSLIMSEQ_cos_one], simp) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 600 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 601 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 602 | text{*A familiar approximation to @{term "cos x"} when @{term x} is small*}
 | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 603 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 604 | lemma STAR_cos_Infinitesimal_approx: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 605 | "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - x ^ 2" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 606 | apply (rule STAR_cos_Infinitesimal [THEN approx_trans]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 607 | apply (auto simp add: Infinitesimal_approx_minus [symmetric] | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 608 | diff_minus add_assoc [symmetric] numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 609 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 610 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 611 | lemma STAR_cos_Infinitesimal_approx2: | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 612 | "x \<in> Infinitesimal ==> ( *f* cos) x @= 1 - (x ^ 2)/2" | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 613 | apply (rule STAR_cos_Infinitesimal [THEN approx_trans]) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 614 | apply (auto intro: Infinitesimal_SReal_divide | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 615 | simp add: Infinitesimal_approx_minus [symmetric] numeral_2_eq_2) | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 616 | done | 
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 617 | |
| 
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
 paulson parents: 
13958diff
changeset | 618 | end |