author | paulson |
Fri, 19 Dec 2003 17:13:28 +0100 | |
changeset 14305 | f17ca9f6dc8c |
parent 14294 | f4d806fd72ce |
child 14309 | f508492af9b4 |
permissions | -rw-r--r-- |
12196 | 1 |
(* Title : Transcendental.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998,1999 University of Cambridge |
|
4 |
1999 University of Edinburgh |
|
5 |
Description : Power Series |
|
6 |
*) |
|
7 |
||
14268
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
8 |
fun multr_by_tac x i = |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
9 |
let val cancel_thm = |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
10 |
CLAIM "[| (0::real)<z; x*z<y*z |] ==> x<y" |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
11 |
in |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
12 |
res_inst_tac [("z",x)] cancel_thm i |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
13 |
end; |
5cf13e80be0e
Removal of Hyperreal/ExtraThms2.ML, sending the material to the correct files.
paulson
parents:
14266
diff
changeset
|
14 |
|
14288 | 15 |
val mult_less_cancel_left = thm"mult_less_cancel_left"; |
16 |
||
12196 | 17 |
Goalw [root_def] "root (Suc n) 0 = 0"; |
18 |
by (safe_tac (claset() addSIs [some_equality,realpow_zero] |
|
19 |
addSEs [realpow_zero_zero])); |
|
20 |
qed "real_root_zero"; |
|
21 |
Addsimps [real_root_zero]; |
|
22 |
||
23 |
Goalw [root_def] |
|
24 |
"0 < x ==> (root(Suc n) x) ^ (Suc n) = x"; |
|
25 |
by (dres_inst_tac [("n","n")] realpow_pos_nth2 1); |
|
26 |
by (auto_tac (claset() addIs [someI2],simpset())); |
|
27 |
qed "real_root_pow_pos"; |
|
28 |
||
29 |
Goal "0 <= x ==> (root(Suc n) x) ^ (Suc n) = x"; |
|
30 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
|
31 |
addDs [real_root_pow_pos],simpset())); |
|
32 |
qed "real_root_pow_pos2"; |
|
33 |
||
34 |
Goalw [root_def] |
|
35 |
"0 < x ==> root(Suc n) (x ^ (Suc n)) = x"; |
|
36 |
by (rtac some_equality 1); |
|
37 |
by (forw_inst_tac [("n","n")] realpow_gt_zero 2); |
|
38 |
by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff])); |
|
39 |
by (res_inst_tac [("R1.0","u"),("R2.0","x")] real_linear_less2 1); |
|
14265
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
13958
diff
changeset
|
40 |
by (dres_inst_tac [("n1","n"),("x","u")] (zero_less_Suc RSN (3, realpow_less)) 1); |
95b42e69436c
HOL: installation of Ring_and_Field as the basis for Naturals and Reals
paulson
parents:
13958
diff
changeset
|
41 |
by (dres_inst_tac [("n1","n"),("x","x")] (zero_less_Suc RSN (3, realpow_less)) 4); |
12196 | 42 |
by (auto_tac (claset(),simpset() addsimps [real_less_not_refl])); |
43 |
qed "real_root_pos"; |
|
44 |
||
45 |
Goal "0 <= x ==> root(Suc n) (x ^ (Suc n)) = x"; |
|
46 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq, |
|
47 |
real_root_pos],simpset())); |
|
48 |
qed "real_root_pos2"; |
|
49 |
||
50 |
Goalw [root_def] |
|
51 |
"0 < x ==> 0 <= root(Suc n) x"; |
|
52 |
by (dres_inst_tac [("n","n")] realpow_pos_nth2 1); |
|
53 |
by (Safe_tac THEN rtac someI2 1); |
|
54 |
by (auto_tac (claset() addSIs [order_less_imp_le] |
|
55 |
addDs [realpow_gt_zero],simpset() addsimps [real_0_less_mult_iff])); |
|
56 |
qed "real_root_pos_pos"; |
|
57 |
||
58 |
Goal "0 <= x ==> 0 <= root(Suc n) x"; |
|
59 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
|
60 |
addDs [real_root_pos_pos],simpset())); |
|
61 |
qed "real_root_pos_pos_le"; |
|
62 |
||
63 |
Goalw [root_def] "root (Suc n) 1 = 1"; |
|
64 |
by (rtac some_equality 1); |
|
65 |
by Auto_tac; |
|
66 |
by (rtac ccontr 1); |
|
67 |
by (res_inst_tac [("R1.0","u"),("R2.0","1")] real_linear_less2 1); |
|
68 |
by (dres_inst_tac [("n","n")] realpow_Suc_less_one 1); |
|
69 |
by (dres_inst_tac [("n","n")] realpow_Suc_gt_one 4); |
|
70 |
by (auto_tac (claset(),simpset() addsimps [real_less_not_refl])); |
|
71 |
qed "real_root_one"; |
|
72 |
Addsimps [real_root_one]; |
|
73 |
||
74 |
(*----------------------------------------------------------------------*) |
|
75 |
(* Square root *) |
|
76 |
(*----------------------------------------------------------------------*) |
|
77 |
||
78 |
(*lcp: needed now because 2 is a binary numeral!*) |
|
79 |
Goal "root 2 = root (Suc (Suc 0))"; |
|
80 |
by (simp_tac (simpset() delsimps [numeral_0_eq_0, numeral_1_eq_1] |
|
81 |
addsimps [numeral_0_eq_0 RS sym]) 1); |
|
82 |
qed "root_2_eq"; |
|
83 |
Addsimps [root_2_eq]; |
|
84 |
||
85 |
Goalw [sqrt_def] "sqrt 0 = 0"; |
|
86 |
by (Auto_tac); |
|
87 |
qed "real_sqrt_zero"; |
|
88 |
Addsimps [real_sqrt_zero]; |
|
89 |
||
90 |
Goalw [sqrt_def] "sqrt 1 = 1"; |
|
91 |
by (Auto_tac); |
|
92 |
qed "real_sqrt_one"; |
|
93 |
Addsimps [real_sqrt_one]; |
|
94 |
||
95 |
Goalw [sqrt_def] "(sqrt(x) ^ 2 = x) = (0 <= x)"; |
|
96 |
by (Step_tac 1); |
|
97 |
by (cut_inst_tac [("r","root 2 x")] realpow_two_le 1); |
|
98 |
by (stac numeral_2_eq_2 2); |
|
99 |
by (rtac real_root_pow_pos2 2); |
|
100 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
101 |
qed "real_sqrt_pow2_iff"; |
|
102 |
Addsimps [real_sqrt_pow2_iff]; |
|
103 |
||
104 |
||
105 |
Addsimps [realpow_two_le_add_order RS (real_sqrt_pow2_iff RS iffD2)]; |
|
106 |
Addsimps [simplify (simpset()) (realpow_two_le_add_order RS |
|
107 |
(real_sqrt_pow2_iff RS iffD2))]; |
|
108 |
||
109 |
Goalw [sqrt_def] "0 < x ==> sqrt(x) ^ 2 = x"; |
|
110 |
by (stac numeral_2_eq_2 1); |
|
111 |
by (etac real_root_pow_pos 1); |
|
112 |
qed "real_sqrt_gt_zero_pow2"; |
|
113 |
||
114 |
Goal "(sqrt(abs(x)) ^ 2 = abs x)"; |
|
115 |
by (rtac (real_sqrt_pow2_iff RS iffD2) 1); |
|
116 |
by (arith_tac 1); |
|
117 |
qed "real_sqrt_abs_abs"; |
|
118 |
Addsimps [real_sqrt_abs_abs]; |
|
119 |
||
120 |
Goalw [sqrt_def] |
|
121 |
"0 <= x ==> sqrt(x) ^ 2 = sqrt(x ^ 2)"; |
|
122 |
by (stac numeral_2_eq_2 1); |
|
123 |
by (auto_tac (claset() addIs [real_root_pow_pos2 |
|
124 |
RS ssubst, real_root_pos2 RS ssubst], |
|
125 |
simpset() delsimps [realpow_Suc])); |
|
126 |
qed "real_pow_sqrt_eq_sqrt_pow"; |
|
127 |
||
128 |
Goal "0 <= x ==> sqrt(x) ^ 2 = sqrt(abs(x ^ 2))"; |
|
129 |
by (asm_full_simp_tac (simpset() addsimps [real_pow_sqrt_eq_sqrt_pow]) 1); |
|
130 |
by (stac numeral_2_eq_2 1); |
|
131 |
by (asm_full_simp_tac (simpset()delsimps [realpow_Suc]) 1); |
|
132 |
qed "real_pow_sqrt_eq_sqrt_abs_pow"; |
|
133 |
||
134 |
Goal "0 <= x ==> sqrt(x) ^ 2 = sqrt(abs(x) ^ 2)"; |
|
135 |
by (asm_full_simp_tac (simpset() addsimps [real_pow_sqrt_eq_sqrt_abs_pow]) 1); |
|
136 |
by (stac numeral_2_eq_2 1); |
|
137 |
by (asm_full_simp_tac (simpset()delsimps [realpow_Suc]) 1); |
|
138 |
qed "real_pow_sqrt_eq_sqrt_abs_pow2"; |
|
139 |
||
140 |
Goal "0 <= x ==> sqrt(x) ^ 2 = abs(x)"; |
|
141 |
by (rtac (real_sqrt_abs_abs RS subst) 1); |
|
142 |
by (res_inst_tac [("x1","x")] |
|
143 |
(real_pow_sqrt_eq_sqrt_abs_pow2 RS ssubst) 1); |
|
144 |
by (rtac (real_pow_sqrt_eq_sqrt_pow RS sym) 2); |
|
145 |
by (assume_tac 1 THEN arith_tac 1); |
|
146 |
qed "real_sqrt_pow_abs"; |
|
147 |
||
148 |
Goal "(~ (0::real) < x*x) = (x = 0)"; |
|
149 |
by Auto_tac; |
|
150 |
by (rtac ccontr 1); |
|
14269 | 151 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
12196 | 152 |
by Auto_tac; |
153 |
by (ftac (real_mult_order) 2); |
|
154 |
by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff]) 1); |
|
155 |
by Auto_tac; |
|
156 |
qed "not_real_square_gt_zero"; |
|
157 |
Addsimps [not_real_square_gt_zero]; |
|
158 |
||
159 |
||
160 |
(* proof used to be simpler *) |
|
161 |
Goalw [sqrt_def,root_def] |
|
162 |
"[| 0 < x; 0 < y |] ==>sqrt(x*y) = sqrt(x) * sqrt(y)"; |
|
163 |
by (dres_inst_tac [("n","1")] realpow_pos_nth2 1); |
|
164 |
by (dres_inst_tac [("n","1")] realpow_pos_nth2 1); |
|
165 |
by (asm_full_simp_tac (simpset() delsimps [realpow_Suc] |
|
166 |
addsimps [numeral_2_eq_2]) 1); |
|
167 |
by (Step_tac 1); |
|
168 |
by (rtac someI2 1 THEN Step_tac 1 THEN Blast_tac 2); |
|
169 |
by (Asm_full_simp_tac 1 THEN Asm_full_simp_tac 1); |
|
170 |
by (rtac someI2 1 THEN Step_tac 1 THEN Blast_tac 2); |
|
171 |
by (Asm_full_simp_tac 1 THEN Asm_full_simp_tac 1); |
|
172 |
by (res_inst_tac [("a","xa * x")] someI2 1); |
|
173 |
by (auto_tac (claset() addEs [real_less_asym], |
|
174 |
simpset() addsimps real_mult_ac@[realpow_mult RS sym,realpow_two_disj, |
|
175 |
realpow_gt_zero, real_mult_order] delsimps [realpow_Suc])); |
|
176 |
qed "real_sqrt_mult_distrib"; |
|
177 |
||
178 |
Goal "[|0<=x; 0<=y |] ==> sqrt(x*y) = sqrt(x) * sqrt(y)"; |
|
179 |
by (auto_tac (claset() addIs [ real_sqrt_mult_distrib], |
|
180 |
simpset() addsimps [real_le_less])); |
|
181 |
qed "real_sqrt_mult_distrib2"; |
|
182 |
||
183 |
Goal "(r * r = 0) = (r = (0::real))"; |
|
184 |
by Auto_tac; |
|
185 |
qed "real_mult_self_eq_zero_iff"; |
|
186 |
Addsimps [real_mult_self_eq_zero_iff]; |
|
187 |
||
188 |
Goalw [sqrt_def,root_def] "0 < x ==> 0 < sqrt(x)"; |
|
189 |
by (stac numeral_2_eq_2 1); |
|
190 |
by (dtac realpow_pos_nth2 1 THEN Step_tac 1); |
|
191 |
by (rtac someI2 1 THEN Step_tac 1 THEN Blast_tac 2); |
|
192 |
by Auto_tac; |
|
193 |
qed "real_sqrt_gt_zero"; |
|
194 |
||
195 |
Goal "0 <= x ==> 0 <= sqrt(x)"; |
|
196 |
by (auto_tac (claset() addIs [real_sqrt_gt_zero], |
|
197 |
simpset() addsimps [real_le_less])); |
|
198 |
qed "real_sqrt_ge_zero"; |
|
199 |
||
200 |
Goal "0 <= sqrt (x ^ 2 + y ^ 2)"; |
|
201 |
by (auto_tac (claset() addSIs [real_sqrt_ge_zero],simpset())); |
|
202 |
qed "real_sqrt_sum_squares_ge_zero"; |
|
203 |
Addsimps [real_sqrt_sum_squares_ge_zero]; |
|
204 |
||
205 |
Goal "0 <= sqrt ((x ^ 2 + y ^ 2)*(xa ^ 2 + ya ^ 2))"; |
|
206 |
by (auto_tac (claset() addSIs [real_sqrt_ge_zero],simpset() |
|
207 |
addsimps [real_0_le_mult_iff])); |
|
208 |
qed "real_sqrt_sum_squares_mult_ge_zero"; |
|
209 |
Addsimps [real_sqrt_sum_squares_mult_ge_zero]; |
|
210 |
||
211 |
Goal "sqrt ((x ^ 2 + y ^ 2) * (xa ^ 2 + ya ^ 2)) ^ 2 = \ |
|
212 |
\ (x ^ 2 + y ^ 2) * (xa ^ 2 + ya ^ 2)"; |
|
213 |
by (auto_tac (claset(),simpset() addsimps [real_sqrt_pow2_iff, |
|
214 |
real_0_le_mult_iff] delsimps [realpow_Suc])); |
|
215 |
qed "real_sqrt_sum_squares_mult_squared_eq"; |
|
216 |
Addsimps [real_sqrt_sum_squares_mult_squared_eq]; |
|
217 |
||
218 |
Goal "sqrt(x ^ 2) = abs(x)"; |
|
219 |
by (rtac (abs_realpow_two RS subst) 1); |
|
220 |
by (rtac (real_sqrt_abs_abs RS subst) 1); |
|
12486 | 221 |
by (stac real_pow_sqrt_eq_sqrt_pow 1); |
13097 | 222 |
by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2, abs_mult])); |
12196 | 223 |
qed "real_sqrt_abs"; |
224 |
Addsimps [real_sqrt_abs]; |
|
225 |
||
226 |
Goal "sqrt(x*x) = abs(x)"; |
|
227 |
by (rtac (realpow_two RS subst) 1); |
|
228 |
by (stac (numeral_2_eq_2 RS sym) 1); |
|
229 |
by (rtac real_sqrt_abs 1); |
|
230 |
qed "real_sqrt_abs2"; |
|
231 |
Addsimps [real_sqrt_abs2]; |
|
232 |
||
233 |
Goal "0 < x ==> 0 < sqrt(x) ^ 2"; |
|
234 |
by (asm_full_simp_tac (simpset() addsimps [real_sqrt_gt_zero_pow2]) 1); |
|
235 |
qed "real_sqrt_pow2_gt_zero"; |
|
236 |
||
237 |
Goal "0 < x ==> sqrt x ~= 0"; |
|
12486 | 238 |
by (ftac real_sqrt_pow2_gt_zero 1); |
12196 | 239 |
by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2, real_less_not_refl])); |
240 |
qed "real_sqrt_not_eq_zero"; |
|
241 |
||
242 |
Goal "0 < x ==> inverse (sqrt(x)) ^ 2 = inverse x"; |
|
12486 | 243 |
by (ftac real_sqrt_not_eq_zero 1); |
12196 | 244 |
by (cut_inst_tac [("n1","2"),("r1","sqrt x")] (realpow_inverse RS sym) 1); |
245 |
by (auto_tac (claset() addDs [real_sqrt_gt_zero_pow2],simpset())); |
|
246 |
qed "real_inv_sqrt_pow2"; |
|
247 |
||
248 |
Goal "[| 0 <= x; sqrt(x) = 0|] ==> x = 0"; |
|
249 |
by (dtac real_le_imp_less_or_eq 1); |
|
250 |
by (auto_tac (claset() addDs [real_sqrt_not_eq_zero],simpset())); |
|
251 |
qed "real_sqrt_eq_zero_cancel"; |
|
252 |
||
253 |
Goal "0 <= x ==> ((sqrt x = 0) = (x = 0))"; |
|
254 |
by (auto_tac (claset(),simpset() addsimps [real_sqrt_eq_zero_cancel])); |
|
255 |
qed "real_sqrt_eq_zero_cancel_iff"; |
|
256 |
Addsimps [real_sqrt_eq_zero_cancel_iff]; |
|
257 |
||
258 |
Goal "x <= sqrt(x ^ 2 + y ^ 2)"; |
|
259 |
by (subgoal_tac "x <= 0 | 0 <= x" 1); |
|
260 |
by (Step_tac 1); |
|
261 |
by (rtac real_le_trans 1); |
|
262 |
by (auto_tac (claset(),simpset() delsimps [realpow_Suc])); |
|
263 |
by (res_inst_tac [("n","1")] realpow_increasing 1); |
|
264 |
by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2 RS sym] |
|
265 |
delsimps [realpow_Suc])); |
|
266 |
qed "real_sqrt_sum_squares_ge1"; |
|
267 |
Addsimps [real_sqrt_sum_squares_ge1]; |
|
268 |
||
269 |
Goal "y <= sqrt(z ^ 2 + y ^ 2)"; |
|
270 |
by (simp_tac (simpset() addsimps [real_add_commute] |
|
271 |
delsimps [realpow_Suc]) 1); |
|
272 |
qed "real_sqrt_sum_squares_ge2"; |
|
273 |
Addsimps [real_sqrt_sum_squares_ge2]; |
|
274 |
||
275 |
Goal "1 <= x ==> 1 <= sqrt x"; |
|
276 |
by (res_inst_tac [("n","1")] realpow_increasing 1); |
|
277 |
by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2 RS sym, real_sqrt_gt_zero_pow2, |
|
278 |
real_sqrt_ge_zero] delsimps [realpow_Suc])); |
|
279 |
qed "real_sqrt_ge_one"; |
|
280 |
||
281 |
(*-------------------------------------------------------------------------*) |
|
282 |
(* Exponential function *) |
|
283 |
(*-------------------------------------------------------------------------*) |
|
284 |
||
285 |
Goal "summable (%n. inverse (real (fact n)) * x ^ n)"; |
|
286 |
by (cut_facts_tac [real_zero_less_one RS real_dense] 1); |
|
287 |
by (Step_tac 1); |
|
288 |
by (cut_inst_tac [("x","r")] reals_Archimedean3 1); |
|
289 |
by Auto_tac; |
|
14288 | 290 |
by (dres_inst_tac [("x","abs x")] spec 1 THEN Safe_tac); |
12196 | 291 |
by (res_inst_tac [("N","n"),("c","r")] ratio_test 1); |
292 |
by (auto_tac (claset(),simpset() addsimps [abs_mult,real_mult_assoc RS sym] |
|
293 |
delsimps [fact_Suc])); |
|
294 |
by (rtac real_mult_le_le_mono2 1); |
|
14288 | 295 |
by (res_inst_tac [("b1","abs x")] (mult_commute RS ssubst) 2); |
12486 | 296 |
by (stac fact_Suc 2); |
297 |
by (stac real_of_nat_mult 2); |
|
13097 | 298 |
by (auto_tac (claset(),simpset() addsimps [abs_mult,real_inverse_distrib])); |
12196 | 299 |
by (auto_tac (claset(), simpset() addsimps |
14288 | 300 |
[mult_assoc RS sym, abs_eqI2, real_inverse_gt_0])); |
301 |
by (rtac order_less_imp_le 1); |
|
12196 | 302 |
by (res_inst_tac [("z1","real (Suc na)")] (real_mult_less_iff1 |
303 |
RS iffD1) 1); |
|
304 |
by (auto_tac (claset(),simpset() addsimps [real_not_refl2 RS not_sym, |
|
14288 | 305 |
mult_assoc,abs_inverse])); |
306 |
by (etac order_less_trans 1); |
|
307 |
by (auto_tac (claset(),simpset() addsimps [mult_less_cancel_left]@mult_ac)); |
|
12196 | 308 |
qed "summable_exp"; |
309 |
||
310 |
Addsimps [real_of_nat_fact_gt_zero, |
|
311 |
real_of_nat_fact_ge_zero,inv_real_of_nat_fact_gt_zero, |
|
312 |
inv_real_of_nat_fact_ge_zero]; |
|
313 |
||
314 |
Goalw [real_divide_def] |
|
315 |
"summable (%n. \ |
|
316 |
\ (if even n then 0 \ |
|
317 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) * \ |
|
318 |
\ x ^ n)"; |
|
319 |
by (res_inst_tac [("g","(%n. inverse (real (fact n)) * abs(x) ^ n)")] |
|
320 |
summable_comparison_test 1); |
|
321 |
by (rtac summable_exp 2); |
|
322 |
by (res_inst_tac [("x","0")] exI 1); |
|
12330 | 323 |
by (auto_tac (claset(), simpset() addsimps [realpow_abs RS sym, |
13097 | 324 |
abs_mult,real_0_le_mult_iff])); |
12196 | 325 |
by (auto_tac (claset() addIs [real_mult_le_le_mono2], |
13097 | 326 |
simpset() addsimps [real_inverse_gt_0,abs_eqI2])); |
12196 | 327 |
qed "summable_sin"; |
328 |
||
329 |
Goalw [real_divide_def] |
|
330 |
"summable (%n. \ |
|
331 |
\ (if even n then \ |
|
332 |
\ (- 1) ^ (n div 2)/(real (fact n)) else 0) * x ^ n)"; |
|
333 |
by (res_inst_tac [("g","(%n. inverse (real (fact n)) * abs(x) ^ n)")] |
|
334 |
summable_comparison_test 1); |
|
335 |
by (rtac summable_exp 2); |
|
336 |
by (res_inst_tac [("x","0")] exI 1); |
|
13097 | 337 |
by (auto_tac (claset(), simpset() addsimps [realpow_abs RS sym,abs_mult, |
12196 | 338 |
real_0_le_mult_iff])); |
339 |
by (auto_tac (claset() addSIs [real_mult_le_le_mono2], |
|
13097 | 340 |
simpset() addsimps [real_inverse_gt_0,abs_eqI2])); |
12196 | 341 |
qed "summable_cos"; |
342 |
||
343 |
Goal "(if even n then 0 \ |
|
344 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) * 0 ^ n = 0"; |
|
345 |
by (induct_tac "n" 1); |
|
346 |
by (Auto_tac); |
|
347 |
val lemma_STAR_sin = result(); |
|
348 |
Addsimps [lemma_STAR_sin]; |
|
349 |
||
350 |
Goal "0 < n --> \ |
|
351 |
\ (- 1) ^ (n div 2)/(real (fact n)) * 0 ^ n = 0"; |
|
352 |
by (induct_tac "n" 1); |
|
353 |
by (Auto_tac); |
|
354 |
val lemma_STAR_cos = result(); |
|
355 |
Addsimps [lemma_STAR_cos]; |
|
356 |
||
357 |
Goal "0 < n --> \ |
|
358 |
\ (-1) ^ (n div 2)/(real (fact n)) * 0 ^ n = 0"; |
|
359 |
by (induct_tac "n" 1); |
|
360 |
by (Auto_tac); |
|
361 |
val lemma_STAR_cos1 = result(); |
|
362 |
Addsimps [lemma_STAR_cos1]; |
|
363 |
||
364 |
Goal "sumr 1 n (%n. if even n \ |
|
365 |
\ then (- 1) ^ (n div 2)/(real (fact n)) * \ |
|
366 |
\ 0 ^ n \ |
|
367 |
\ else 0) = 0"; |
|
368 |
by (induct_tac "n" 1); |
|
369 |
by (case_tac "n" 2); |
|
370 |
by (Auto_tac); |
|
371 |
val lemma_STAR_cos2 = result(); |
|
372 |
Addsimps [lemma_STAR_cos2]; |
|
373 |
||
374 |
Goalw [exp_def] "(%n. inverse (real (fact n)) * x ^ n) sums exp(x)"; |
|
375 |
by (rtac (summable_exp RS summable_sums) 1); |
|
376 |
qed "exp_converges"; |
|
377 |
||
378 |
Goalw [sin_def] |
|
379 |
"(%n. (if even n then 0 \ |
|
380 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) * \ |
|
381 |
\ x ^ n) sums sin(x)"; |
|
382 |
by (rtac (summable_sin RS summable_sums) 1); |
|
383 |
qed "sin_converges"; |
|
384 |
||
385 |
Goalw [cos_def] |
|
386 |
"(%n. (if even n then \ |
|
387 |
\ (- 1) ^ (n div 2)/(real (fact n)) \ |
|
388 |
\ else 0) * x ^ n) sums cos(x)"; |
|
389 |
by (rtac (summable_cos RS summable_sums) 1); |
|
390 |
qed "cos_converges"; |
|
391 |
||
392 |
Goal "p <= n --> y ^ (Suc n - p) = ((y::real) ^ (n - p)) * y"; |
|
393 |
by (induct_tac "n" 1 THEN Auto_tac); |
|
394 |
by (subgoal_tac "p = Suc n" 1); |
|
395 |
by (Asm_simp_tac 1 THEN Auto_tac); |
|
396 |
by (dtac sym 1 THEN asm_full_simp_tac (simpset() addsimps |
|
397 |
[Suc_diff_le,real_mult_commute,realpow_Suc RS sym] |
|
398 |
delsimps [realpow_Suc]) 1); |
|
399 |
qed_spec_mp "lemma_realpow_diff"; |
|
400 |
||
401 |
(*--------------------------------------------------------------------------*) |
|
402 |
(* Properties of power series *) |
|
403 |
(*--------------------------------------------------------------------------*) |
|
404 |
||
405 |
Goal "sumr 0 (Suc n) (%p. (x ^ p) * y ^ ((Suc n) - p)) = \ |
|
406 |
\ y * sumr 0 (Suc n) (%p. (x ^ p) * (y ^ (n - p)))"; |
|
407 |
by (auto_tac (claset(),simpset() addsimps [sumr_mult] delsimps [sumr_Suc])); |
|
408 |
by (rtac sumr_subst 1); |
|
409 |
by (strip_tac 1); |
|
12486 | 410 |
by (stac lemma_realpow_diff 1); |
12196 | 411 |
by (auto_tac (claset(),simpset() addsimps real_mult_ac)); |
412 |
qed "lemma_realpow_diff_sumr"; |
|
413 |
||
414 |
Goal "x ^ (Suc n) - y ^ (Suc n) = \ |
|
415 |
\ (x - y) * sumr 0 (Suc n) (%p. (x ^ p) * (y ^(n - p)))"; |
|
416 |
by (induct_tac "n" 1); |
|
417 |
by (auto_tac (claset(),simpset() delsimps [sumr_Suc])); |
|
12486 | 418 |
by (stac sumr_Suc 1); |
12196 | 419 |
by (dtac sym 1); |
420 |
by (auto_tac (claset(),simpset() addsimps [lemma_realpow_diff_sumr, |
|
421 |
real_add_mult_distrib2,real_diff_def] @ |
|
422 |
real_mult_ac delsimps [sumr_Suc])); |
|
423 |
qed "lemma_realpow_diff_sumr2"; |
|
424 |
||
425 |
Goal "sumr 0 (Suc n) (%p. (x ^ p) * (y ^ (n - p))) = \ |
|
426 |
\ sumr 0 (Suc n) (%p. (x ^ (n - p)) * (y ^ p))"; |
|
427 |
by (case_tac "x = y" 1); |
|
428 |
by (auto_tac (claset(),simpset() addsimps [real_mult_commute, |
|
429 |
realpow_add RS sym] delsimps [sumr_Suc])); |
|
430 |
by (res_inst_tac [("c1","x - y")] (real_mult_left_cancel RS iffD1) 1); |
|
431 |
by (rtac (real_minus_minus RS subst) 2); |
|
12486 | 432 |
by (stac real_minus_mult_eq1 2); |
12196 | 433 |
by (auto_tac (claset(),simpset() addsimps [lemma_realpow_diff_sumr2 |
434 |
RS sym] delsimps [sumr_Suc])); |
|
435 |
qed "lemma_realpow_rev_sumr"; |
|
436 |
||
437 |
(* ------------------------------------------------------------------------ *) |
|
438 |
(* Power series has a `circle` of convergence, *) |
|
439 |
(* i.e. if it sums for x, then it sums absolutely for z with |z| < |x|. *) |
|
440 |
(* ------------------------------------------------------------------------ *) |
|
441 |
||
442 |
Goalw [real_divide_def] "1/(x::real) = inverse x"; |
|
443 |
by (Simp_tac 1); |
|
444 |
qed "real_divide_eq_inverse"; |
|
445 |
||
446 |
Goal "[| summable (%n. f(n) * (x ^ n)); abs(z) < abs(x) |] \ |
|
447 |
\ ==> summable (%n. abs(f(n)) * (z ^ n))"; |
|
448 |
by (dtac summable_LIMSEQ_zero 1); |
|
449 |
by (dtac convergentI 1); |
|
450 |
by (asm_full_simp_tac (simpset() addsimps [Cauchy_convergent_iff RS sym]) 1); |
|
451 |
by (dtac Cauchy_Bseq 1); |
|
452 |
by (asm_full_simp_tac (simpset() addsimps [Bseq_def]) 1); |
|
453 |
by (Step_tac 1); |
|
454 |
by (res_inst_tac [("g","%n. K * abs(z ^ n) * inverse (abs(x ^ n))")] |
|
455 |
summable_comparison_test 1); |
|
456 |
by (res_inst_tac [("x","0")] exI 1 THEN Step_tac 1); |
|
457 |
by (subgoal_tac "0 < abs (x ^ n)" 1); |
|
458 |
by (res_inst_tac [("z","abs (x ^ n)")] (CLAIM_SIMP |
|
14305
f17ca9f6dc8c
tidying first part of HyperArith0.ML, using generic lemmas
paulson
parents:
14294
diff
changeset
|
459 |
"[| (0::real) <z; x*z<=y*z |] ==> x<=y" [mult_le_cancel_left]) 1); |
12196 | 460 |
by (auto_tac (claset(), |
12330 | 461 |
simpset() addsimps [real_mult_assoc,realpow_abs])); |
12196 | 462 |
by (dres_inst_tac [("x","0")] spec 2 THEN Force_tac 2); |
13097 | 463 |
by (auto_tac (claset(),simpset() addsimps [abs_mult,realpow_abs] @ real_mult_ac)); |
14294
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
464 |
by (res_inst_tac [("a2","z ^ n")] (abs_ge_zero RS real_le_imp_less_or_eq |
12196 | 465 |
RS disjE) 1 THEN dtac sym 2); |
466 |
by (auto_tac (claset() addSIs [real_mult_le_le_mono2], |
|
467 |
simpset() addsimps [real_mult_assoc RS sym, |
|
12330 | 468 |
realpow_abs,summable_def])); |
12196 | 469 |
by (res_inst_tac [("x","K * inverse(1 - (abs(z) * inverse(abs x)))")] exI 1); |
470 |
by (auto_tac (claset() addSIs [sums_mult],simpset() addsimps [real_mult_assoc])); |
|
471 |
by (subgoal_tac |
|
472 |
"abs(z ^ n) * inverse(abs x ^ n) = (abs(z) * inverse(abs x)) ^ n" 1); |
|
12330 | 473 |
by (auto_tac (claset(),simpset() addsimps [realpow_abs RS sym])); |
12196 | 474 |
by (subgoal_tac "x ~= 0" 1); |
475 |
by (subgoal_tac "x ~= 0" 3); |
|
14294
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
476 |
by (auto_tac (claset(), |
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
477 |
simpset() delsimps [abs_inverse] |
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
478 |
addsimps [abs_inverse RS sym, realpow_not_zero, abs_mult RS sym, |
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
479 |
realpow_inverse, realpow_mult RS sym])); |
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
480 |
by (auto_tac (claset() addSIs [geometric_sums], |
f4d806fd72ce
absolute value theorems moved to HOL/Ring_and_Field
paulson
parents:
14288
diff
changeset
|
481 |
simpset() addsimps |
12330 | 482 |
[realpow_abs,real_divide_eq_inverse RS sym])); |
12196 | 483 |
by (res_inst_tac [("z","abs(x)")] (CLAIM_SIMP |
14305
f17ca9f6dc8c
tidying first part of HyperArith0.ML, using generic lemmas
paulson
parents:
14294
diff
changeset
|
484 |
"[|(0::real)<z; x*z<y*z |] ==> x<y" [mult_less_cancel_left]) 1); |
13097 | 485 |
by (auto_tac (claset(),simpset() addsimps [abs_mult RS sym,real_mult_assoc])); |
12196 | 486 |
qed "powser_insidea"; |
487 |
||
488 |
Goal "[| summable (%n. f(n) * (x ^ n)); abs(z) < abs(x) |] \ |
|
489 |
\ ==> summable (%n. f(n) * (z ^ n))"; |
|
490 |
by (dres_inst_tac [("z","abs z")] powser_insidea 1); |
|
491 |
by (auto_tac (claset() addIs [summable_rabs_cancel], |
|
12330 | 492 |
simpset() addsimps [realpow_abs RS sym,abs_mult RS sym])); |
12196 | 493 |
qed "powser_inside"; |
494 |
||
495 |
(* ------------------------------------------------------------------------ *) |
|
496 |
(* Differentiation of power series *) |
|
497 |
(* ------------------------------------------------------------------------ *) |
|
498 |
||
499 |
(* Lemma about distributing negation over it *) |
|
500 |
Goalw [diffs_def] "diffs (%n. - c n) = (%n. - diffs c n)"; |
|
501 |
by Auto_tac; |
|
502 |
qed "diffs_minus"; |
|
503 |
||
504 |
(* ------------------------------------------------------------------------ *) |
|
505 |
(* Show that we can shift the terms down one *) |
|
506 |
(* ------------------------------------------------------------------------ *) |
|
507 |
||
508 |
Goal "sumr 0 n (%n. (diffs c)(n) * (x ^ n)) = \ |
|
509 |
\ sumr 0 n (%n. real n * c(n) * (x ^ (n - Suc 0))) + \ |
|
510 |
\ (real n * c(n) * x ^ (n - Suc 0))"; |
|
511 |
by (induct_tac "n" 1); |
|
512 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc, |
|
513 |
real_add_assoc RS sym,diffs_def])); |
|
514 |
qed "lemma_diffs"; |
|
515 |
||
516 |
Goal "sumr 0 n (%n. real n * c(n) * (x ^ (n - Suc 0))) = \ |
|
517 |
\ sumr 0 n (%n. (diffs c)(n) * (x ^ n)) - \ |
|
518 |
\ (real n * c(n) * x ^ (n - Suc 0))"; |
|
519 |
by (auto_tac (claset(),simpset() addsimps [lemma_diffs])); |
|
520 |
qed "lemma_diffs2"; |
|
521 |
||
522 |
Goal "summable (%n. (diffs c)(n) * (x ^ n)) ==> \ |
|
523 |
\ (%n. real n * c(n) * (x ^ (n - Suc 0))) sums \ |
|
524 |
\ (suminf(%n. (diffs c)(n) * (x ^ n)))"; |
|
525 |
by (ftac summable_LIMSEQ_zero 1); |
|
526 |
by (subgoal_tac "(%n. real n * c(n) * (x ^ (n - Suc 0))) ----> 0" 1); |
|
527 |
by (rtac LIMSEQ_imp_Suc 2); |
|
528 |
by (dtac summable_sums 1); |
|
529 |
by (auto_tac (claset(),simpset() addsimps [sums_def])); |
|
530 |
by (thin_tac "(%n. diffs c n * x ^ n) ----> 0" 1); |
|
531 |
by (rotate_tac 1 1); |
|
532 |
by (dtac LIMSEQ_diff 1); |
|
533 |
by (auto_tac (claset(),simpset() addsimps [lemma_diffs2 RS sym, |
|
534 |
symmetric diffs_def])); |
|
535 |
by (asm_full_simp_tac (simpset() addsimps [diffs_def]) 1); |
|
536 |
qed "diffs_equiv"; |
|
537 |
||
538 |
(* -------------------------------------------------------------------------*) |
|
539 |
(* Term-by-term differentiability of power series *) |
|
540 |
(* -------------------------------------------------------------------------*) |
|
541 |
||
542 |
Goal "sumr 0 m (%p. (((z + h) ^ (m - p)) * (z ^ p)) - (z ^ m)) = \ |
|
543 |
\ sumr 0 m (%p. (z ^ p) * \ |
|
544 |
\ (((z + h) ^ (m - p)) - (z ^ (m - p))))"; |
|
545 |
by (rtac sumr_subst 1); |
|
546 |
by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2, |
|
547 |
real_diff_def,realpow_add RS sym] |
|
548 |
@ real_mult_ac)); |
|
549 |
qed "lemma_termdiff1"; |
|
550 |
||
551 |
(* proved elsewhere? *) |
|
552 |
Goal "m < n --> (EX d. n = m + d + Suc 0)"; |
|
553 |
by (induct_tac "m" 1 THEN Auto_tac); |
|
554 |
by (case_tac "n" 1); |
|
555 |
by (case_tac "d" 3); |
|
556 |
by (Auto_tac); |
|
557 |
qed_spec_mp "less_add_one"; |
|
558 |
||
559 |
Goal " h ~= 0 ==> \ |
|
560 |
\ (((z + h) ^ n) - (z ^ n)) * inverse h - \ |
|
561 |
\ real n * (z ^ (n - Suc 0)) = \ |
|
562 |
\ h * sumr 0 (n - Suc 0) (%p. (z ^ p) * \ |
|
563 |
\ sumr 0 ((n - Suc 0) - p) \ |
|
564 |
\ (%q. ((z + h) ^ q) * (z ^ (((n - 2) - p) - q))))"; |
|
565 |
by (rtac (real_mult_left_cancel RS iffD1) 1 THEN Asm_simp_tac 1); |
|
566 |
by (asm_full_simp_tac (simpset() addsimps [real_diff_mult_distrib2] |
|
567 |
@ real_mult_ac) 1); |
|
568 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1); |
|
569 |
by (case_tac "n" 1 THEN auto_tac (claset(),simpset() |
|
570 |
addsimps [lemma_realpow_diff_sumr2, |
|
571 |
real_diff_mult_distrib2 RS sym,real_mult_assoc] |
|
572 |
delsimps [realpow_Suc,sumr_Suc])); |
|
573 |
by (auto_tac (claset(),simpset() addsimps [lemma_realpow_rev_sumr] |
|
574 |
delsimps [sumr_Suc])); |
|
575 |
by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc,sumr_diff_mult_const, |
|
576 |
real_add_mult_distrib,CLAIM "(a + b) - (c + d) = a - c + b - (d::real)", |
|
577 |
lemma_termdiff1,sumr_mult])); |
|
578 |
by (auto_tac (claset() addSIs [sumr_subst],simpset() addsimps |
|
579 |
[real_diff_def,real_add_assoc])); |
|
580 |
by (fold_tac [real_diff_def] THEN dtac less_add_one 1); |
|
581 |
by (auto_tac (claset(),simpset() addsimps [sumr_mult,lemma_realpow_diff_sumr2] |
|
582 |
@ real_mult_ac delsimps [sumr_Suc,realpow_Suc])); |
|
583 |
qed "lemma_termdiff2"; |
|
584 |
||
585 |
Goal "[| h ~= 0; abs z <= K; abs (z + h) <= K |] \ |
|
586 |
\ ==> abs (((z + h) ^ n - z ^ n) * inverse h - real n * z ^ (n - Suc 0)) \ |
|
587 |
\ <= real n * real (n - Suc 0) * K ^ (n - 2) * abs h"; |
|
12486 | 588 |
by (stac lemma_termdiff2 1); |
12196 | 589 |
by (asm_full_simp_tac (simpset() addsimps [abs_mult,real_mult_commute]) 2); |
590 |
by (stac real_mult_commute 2); |
|
591 |
by (rtac (sumr_rabs RS real_le_trans) 2); |
|
592 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 2); |
|
593 |
by (rtac (real_mult_commute RS subst) 2); |
|
13097 | 594 |
by (auto_tac (claset() addSIs [sumr_bound2],simpset() addsimps [abs_mult])); |
12196 | 595 |
by (case_tac "n" 1 THEN Auto_tac); |
596 |
by (dtac less_add_one 1); |
|
597 |
by (auto_tac (claset(),simpset() addsimps [realpow_add,real_add_assoc RS sym, |
|
598 |
CLAIM_SIMP "(a * b) * c = a * (c * (b::real))" real_mult_ac] |
|
599 |
delsimps [sumr_Suc])); |
|
13097 | 600 |
by (auto_tac (claset() addSIs [real_mult_le_mono],simpset()delsimps [sumr_Suc])); |
12196 | 601 |
by (auto_tac (claset() addSIs [realpow_le2],simpset() addsimps |
13097 | 602 |
[realpow_abs] delsimps [sumr_Suc] )); |
12196 | 603 |
by (res_inst_tac [("j","real (Suc d) * (K ^ d)")] real_le_trans 1); |
604 |
by (subgoal_tac "0 <= K" 2); |
|
605 |
by (arith_tac 3); |
|
606 |
by (dres_inst_tac [("n","d")] realpow_ge_zero2 2); |
|
13097 | 607 |
by (auto_tac (claset(),simpset() delsimps [sumr_Suc] )); |
12196 | 608 |
by (rtac (sumr_rabs RS real_le_trans) 1); |
609 |
by (rtac sumr_bound2 1 THEN auto_tac (claset() addSDs [less_add_one] |
|
13097 | 610 |
addSIs [real_mult_le_mono],simpset() addsimps [abs_mult, realpow_add])); |
12196 | 611 |
by (auto_tac (claset() addSIs [realpow_le2,realpow_ge_zero],simpset() addsimps |
13097 | 612 |
[realpow_abs])); |
12196 | 613 |
by (ALLGOALS(arith_tac)); |
614 |
qed "lemma_termdiff3"; |
|
615 |
||
616 |
Goalw [LIM_def] |
|
617 |
"[| 0 < k; \ |
|
618 |
\ (ALL h. 0 < abs(h) & abs(h) < k --> abs(f h) <= K * abs(h)) |] \ |
|
619 |
\ ==> f -- 0 --> 0"; |
|
620 |
by (Auto_tac); |
|
621 |
by (subgoal_tac "0 <= K" 1); |
|
622 |
by (dres_inst_tac [("x","k*inverse 2")] spec 2); |
|
623 |
by (ftac real_less_half_sum 2); |
|
624 |
by (dtac real_gt_half_sum 2); |
|
625 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI2])); |
|
626 |
by (res_inst_tac [("z","k/2")] (CLAIM_SIMP |
|
14305
f17ca9f6dc8c
tidying first part of HyperArith0.ML, using generic lemmas
paulson
parents:
14294
diff
changeset
|
627 |
"[| (0::real) <z; x*z<=y*z |] ==> x<=y" [mult_le_cancel_left]) 2); |
12196 | 628 |
by (auto_tac (claset() addIs [abs_ge_zero RS real_le_trans],simpset())); |
629 |
by (dtac real_le_imp_less_or_eq 1); |
|
630 |
by Auto_tac; |
|
631 |
by (subgoal_tac "0 < (r * inverse K) * inverse 2" 1); |
|
632 |
by (REPEAT(rtac (real_mult_order) 2)); |
|
633 |
by (dres_inst_tac [("d1.0","r * inverse K * inverse 2"),("d2.0","k")] |
|
634 |
real_lbound_gt_zero 1); |
|
635 |
by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0, |
|
636 |
real_0_less_mult_iff])); |
|
637 |
by (rtac real_le_trans 2 THEN assume_tac 3 THEN Auto_tac); |
|
638 |
by (res_inst_tac [("x","e")] exI 1 THEN Auto_tac); |
|
639 |
by (res_inst_tac [("y","K * abs x")] order_le_less_trans 1); |
|
640 |
by (res_inst_tac [("R2.0","K * e")] real_less_trans 2); |
|
641 |
by (res_inst_tac [("z","inverse K")] (CLAIM_SIMP |
|
14305
f17ca9f6dc8c
tidying first part of HyperArith0.ML, using generic lemmas
paulson
parents:
14294
diff
changeset
|
642 |
"[|(0::real) <z; z*x<z*y |] ==> x<y" [mult_less_cancel_left]) 3); |
14288 | 643 |
by (asm_full_simp_tac (simpset() addsimps [mult_assoc RS sym]) 4); |
644 |
by (Force_tac 1); |
|
645 |
by (asm_full_simp_tac (simpset() addsimps [mult_less_cancel_left]) 1); |
|
646 |
by (auto_tac (claset(),simpset() addsimps mult_ac)); |
|
12196 | 647 |
qed "lemma_termdiff4"; |
648 |
||
649 |
Goal "[| 0 < k; \ |
|
650 |
\ summable f; \ |
|
651 |
\ ALL h. 0 < abs(h) & abs(h) < k --> \ |
|
652 |
\ (ALL n. abs(g(h) (n::nat)) <= (f(n) * abs(h))) |] \ |
|
653 |
\ ==> (%h. suminf(g h)) -- 0 --> 0"; |
|
654 |
by (dtac summable_sums 1); |
|
655 |
by (subgoal_tac "ALL h. 0 < abs h & abs h < k --> \ |
|
656 |
\ abs(suminf (g h)) <= suminf f * abs h" 1); |
|
657 |
by (Auto_tac); |
|
658 |
by (subgoal_tac "summable (%n. f n * abs h)" 2); |
|
659 |
by (simp_tac (simpset() addsimps [summable_def]) 3); |
|
660 |
by (res_inst_tac [("x","suminf f * abs h")] exI 3); |
|
661 |
by (dres_inst_tac [("c","abs h")] sums_mult 3); |
|
662 |
by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 3); |
|
663 |
by (subgoal_tac "summable (%n. abs(g(h::real)(n::nat)))" 2); |
|
664 |
by (res_inst_tac [("g","%n. f(n::nat) * abs(h)")] summable_comparison_test 3); |
|
665 |
by (res_inst_tac [("x","0")] exI 3); |
|
666 |
by Auto_tac; |
|
667 |
by (res_inst_tac [("j","suminf(%n. abs(g h n))")] real_le_trans 2); |
|
668 |
by (auto_tac (claset() addIs [summable_rabs,summable_le],simpset() addsimps |
|
669 |
[sums_summable RS suminf_mult])); |
|
670 |
by (auto_tac (claset() addSIs [lemma_termdiff4],simpset() addsimps |
|
671 |
[(sums_summable RS suminf_mult) RS sym])); |
|
672 |
qed "lemma_termdiff5"; |
|
673 |
||
674 |
(* FIXME: Long proof *) |
|
675 |
Goalw [deriv_def] |
|
676 |
"[| summable(%n. c(n) * (K ^ n)); \ |
|
677 |
\ summable(%n. (diffs c)(n) * (K ^ n)); \ |
|
678 |
\ summable(%n. (diffs(diffs c))(n) * (K ^ n)); \ |
|
679 |
\ abs(x) < abs(K) |] \ |
|
680 |
\ ==> DERIV (%x. suminf (%n. c(n) * (x ^ n))) x :> \ |
|
681 |
\ suminf (%n. (diffs c)(n) * (x ^ n))"; |
|
682 |
||
683 |
by (res_inst_tac [("g","%h. suminf(%n. ((c(n) * ((x + h) ^ n)) - \ |
|
684 |
\ (c(n) * (x ^ n))) * inverse h)")] LIM_trans 1); |
|
685 |
by (asm_full_simp_tac (simpset() addsimps [LIM_def]) 1); |
|
686 |
by (Step_tac 1); |
|
687 |
by (res_inst_tac [("x","abs K - abs x")] exI 1); |
|
14270 | 688 |
by (auto_tac (claset(),simpset() addsimps [less_diff_eq])); |
12196 | 689 |
by (dtac (abs_triangle_ineq RS order_le_less_trans) 1); |
690 |
by (res_inst_tac [("y","0")] order_le_less_trans 1); |
|
691 |
by Auto_tac; |
|
692 |
by (subgoal_tac "(%n. (c n) * (x ^ n)) sums \ |
|
693 |
\ (suminf(%n. (c n) * (x ^ n))) & \ |
|
694 |
\ (%n. (c n) * ((x + xa) ^ n)) sums \ |
|
695 |
\ (suminf(%n. (c n) * ((x + xa) ^ n)))" 1); |
|
696 |
by (auto_tac (claset() addSIs [summable_sums],simpset())); |
|
697 |
by (rtac powser_inside 2 THEN rtac powser_inside 4); |
|
698 |
by (auto_tac (claset(),simpset() addsimps [real_add_commute])); |
|
699 |
by (EVERY1[rotate_tac 8, dtac sums_diff, assume_tac]); |
|
700 |
by (dres_inst_tac [("x","(%n. c n * (xa + x) ^ n - c n * x ^ n)"), |
|
701 |
("c","inverse xa")] sums_mult 1); |
|
702 |
by (rtac (sums_unique RS sym) 1); |
|
703 |
by (asm_full_simp_tac (simpset() addsimps [real_diff_def, |
|
704 |
real_divide_def] @ real_add_ac @ real_mult_ac) 1); |
|
705 |
by (rtac LIM_zero_cancel 1); |
|
706 |
by (res_inst_tac [("g","%h. suminf (%n. c(n) * (((((x + h) ^ n) - \ |
|
707 |
\ (x ^ n)) * inverse h) - (real n * (x ^ (n - Suc 0)))))")] LIM_trans 1); |
|
708 |
by (asm_full_simp_tac (simpset() addsimps [LIM_def]) 1); |
|
709 |
by (Step_tac 1); |
|
710 |
by (res_inst_tac [("x","abs K - abs x")] exI 1); |
|
14270 | 711 |
by (auto_tac (claset(),simpset() addsimps [less_diff_eq])); |
12196 | 712 |
by (dtac (abs_triangle_ineq RS order_le_less_trans) 1); |
713 |
by (res_inst_tac [("y","0")] order_le_less_trans 1); |
|
714 |
by Auto_tac; |
|
715 |
by (subgoal_tac "summable(%n. (diffs c)(n) * (x ^ n))" 1); |
|
716 |
by (rtac powser_inside 2); |
|
717 |
by (Auto_tac); |
|
718 |
by (dres_inst_tac [("c","c"),("x","x")] diffs_equiv 1); |
|
719 |
by (ftac sums_unique 1 THEN Auto_tac); |
|
720 |
by (subgoal_tac "(%n. (c n) * (x ^ n)) sums \ |
|
721 |
\ (suminf(%n. (c n) * (x ^ n))) & \ |
|
722 |
\ (%n. (c n) * ((x + xa) ^ n)) sums \ |
|
723 |
\ (suminf(%n. (c n) * ((x + xa) ^ n)))" 1); |
|
724 |
by (Step_tac 1); |
|
725 |
by (auto_tac (claset() addSIs [summable_sums],simpset())); |
|
726 |
by (rtac powser_inside 2 THEN rtac powser_inside 4); |
|
727 |
by (auto_tac (claset(),simpset() addsimps [real_add_commute])); |
|
728 |
by (forw_inst_tac [("x","(%n. c n * (xa + x) ^ n)"), |
|
729 |
("y","(%n. c n * x ^ n)")] sums_diff 1 THEN assume_tac 1); |
|
730 |
by (asm_full_simp_tac (simpset() addsimps [[sums_summable,sums_summable] |
|
731 |
MRS suminf_diff,real_diff_mult_distrib2 RS sym]) 1); |
|
732 |
by (forw_inst_tac [("x","(%n. c n * ((xa + x) ^ n - x ^ n))"), |
|
733 |
("c","inverse xa")] sums_mult 1); |
|
734 |
by (asm_full_simp_tac (simpset() addsimps [sums_summable RS suminf_mult2]) 1); |
|
735 |
by (forw_inst_tac [("x","(%n. inverse xa * (c n * ((xa + x) ^ n - x ^ n)))"), |
|
736 |
("y","(%n. real n * c n * x ^ (n - Suc 0))")] sums_diff 1); |
|
737 |
by (assume_tac 1); |
|
738 |
by (rtac (ARITH_PROVE "z - y = x ==> - x = (y::real) - z") 1); |
|
739 |
by (asm_full_simp_tac (simpset() addsimps [[sums_summable,sums_summable] |
|
740 |
MRS suminf_diff] @ real_add_ac @ real_mult_ac ) 1); |
|
741 |
by (res_inst_tac [("f","suminf")] arg_cong 1); |
|
742 |
by (rtac ext 1); |
|
743 |
by (asm_full_simp_tac (simpset() addsimps [real_diff_def, |
|
744 |
real_add_mult_distrib2] @ real_add_ac @ real_mult_ac) 1); |
|
745 |
(* 46 *) |
|
746 |
by (dtac real_dense 1 THEN Step_tac 1); |
|
747 |
by (ftac (real_less_sum_gt_zero) 1); |
|
748 |
by (dres_inst_tac [("f","%n. abs(c n) * real n * \ |
|
749 |
\ real (n - Suc 0) * (r ^ (n - 2))"), |
|
750 |
("g","%h n. c(n) * (((((x + h) ^ n) - (x ^ n)) * inverse h) - \ |
|
751 |
\ (real n * (x ^ (n - Suc 0))))")] lemma_termdiff5 1); |
|
752 |
by (auto_tac (claset(),simpset() addsimps [real_add_commute])); |
|
753 |
by (subgoal_tac "summable(%n. abs(diffs(diffs c) n) * (r ^ n))" 1); |
|
754 |
by (res_inst_tac [("x","K")] powser_insidea 2 THEN Auto_tac); |
|
755 |
by (subgoal_tac "abs r = r" 2 THEN Auto_tac); |
|
756 |
by (res_inst_tac [("j1","abs x")] (real_le_trans RS abs_eqI1) 2); |
|
757 |
by Auto_tac; |
|
758 |
by (asm_full_simp_tac (simpset() addsimps [diffs_def,abs_mult, |
|
759 |
real_mult_assoc RS sym]) 1); |
|
760 |
by (subgoal_tac "ALL n. real (Suc n) * real (Suc(Suc n)) * \ |
|
761 |
\ abs(c(Suc(Suc n))) * (r ^ n) = diffs(diffs (%n. abs(c n))) n * (r ^ n)" 1); |
|
762 |
by (dres_inst_tac [("P","summable")] |
|
763 |
(CLAIM "[|ALL n. f(n) = g(n); P(%n. f n)|] ==> P(%n. g(n))") 1); |
|
764 |
by (Auto_tac); |
|
765 |
by (asm_full_simp_tac (simpset() addsimps [diffs_def]) 2 |
|
766 |
THEN asm_full_simp_tac (simpset() addsimps [diffs_def]) 2); |
|
767 |
by (dtac diffs_equiv 1); |
|
768 |
by (dtac sums_summable 1); |
|
769 |
by (asm_full_simp_tac (simpset() addsimps [diffs_def] @ real_mult_ac) 1); |
|
770 |
by (subgoal_tac "(%n. real n * (real (Suc n) * (abs(c(Suc n)) * \ |
|
771 |
\ (r ^ (n - Suc 0))))) = (%n. diffs(%m. real (m - Suc 0) * \ |
|
772 |
\ abs(c m) * inverse r) n * (r ^ n))" 1); |
|
773 |
by (Auto_tac); |
|
774 |
by (rtac ext 2); |
|
775 |
by (asm_full_simp_tac (simpset() addsimps [diffs_def]) 2); |
|
776 |
by (case_tac "n" 2); |
|
777 |
by Auto_tac; |
|
778 |
(* 69 *) |
|
779 |
by (dtac (abs_ge_zero RS order_le_less_trans) 2); |
|
780 |
by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 2); |
|
781 |
by (dtac diffs_equiv 1); |
|
782 |
by (dtac sums_summable 1); |
|
783 |
by (res_inst_tac [("a","summable (%n. real n * \ |
|
784 |
\ (real (n - Suc 0) * abs (c n) * inverse r) * r ^ (n - Suc 0))")] |
|
785 |
(CLAIM "(a = b) ==> a ==> b") 1 THEN assume_tac 2); |
|
786 |
by (res_inst_tac [("f","summable")] arg_cong 1 THEN rtac ext 1); |
|
14266 | 787 |
by (dtac (abs_ge_zero RS order_le_less_trans) 2); |
788 |
by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 2); |
|
789 |
(* 77 *) |
|
12196 | 790 |
by (case_tac "n" 1); |
791 |
by Auto_tac; |
|
792 |
by (case_tac "nat" 1); |
|
793 |
by Auto_tac; |
|
794 |
by (dtac (abs_ge_zero RS order_le_less_trans) 1); |
|
795 |
by (auto_tac (claset(),simpset() addsimps [CLAIM_SIMP |
|
796 |
"(a::real) * (b * (c * d)) = a * (b * c) * d" |
|
797 |
real_mult_ac])); |
|
798 |
by (dtac (abs_ge_zero RS order_le_less_trans) 1); |
|
799 |
by (asm_full_simp_tac (simpset() addsimps [abs_mult,real_mult_assoc]) 1); |
|
800 |
by (rtac real_mult_le_le_mono1 1); |
|
801 |
by (rtac (real_add_commute RS subst) 2); |
|
802 |
by (simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 2); |
|
803 |
by (rtac lemma_termdiff3 2); |
|
804 |
by (auto_tac (claset() addIs [(abs_triangle_ineq RS real_le_trans)], |
|
805 |
simpset())); |
|
806 |
by (arith_tac 1); |
|
807 |
qed "termdiffs"; |
|
808 |
||
809 |
(* ------------------------------------------------------------------------ *) |
|
810 |
(* Formal derivatives of exp, sin, and cos series *) |
|
811 |
(* ------------------------------------------------------------------------ *) |
|
812 |
||
813 |
Goalw [diffs_def] |
|
814 |
"diffs (%n. inverse(real (fact n))) = (%n. inverse(real (fact n)))"; |
|
815 |
by (rtac ext 1); |
|
12486 | 816 |
by (stac fact_Suc 1); |
817 |
by (stac real_of_nat_mult 1); |
|
818 |
by (stac real_inverse_distrib 1); |
|
12196 | 819 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym])); |
820 |
qed "exp_fdiffs"; |
|
821 |
||
822 |
Goalw [diffs_def,real_divide_def] |
|
823 |
"diffs(%n. if even n then 0 \ |
|
824 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) \ |
|
825 |
\ = (%n. if even n then \ |
|
826 |
\ (- 1) ^ (n div 2)/(real (fact n)) \ |
|
827 |
\ else 0)"; |
|
828 |
by (rtac ext 1); |
|
12486 | 829 |
by (stac fact_Suc 1); |
830 |
by (stac real_of_nat_mult 1); |
|
831 |
by (stac even_Suc 1); |
|
832 |
by (stac real_inverse_distrib 1); |
|
12196 | 833 |
by Auto_tac; |
834 |
qed "sin_fdiffs"; |
|
835 |
||
836 |
Goalw [diffs_def,real_divide_def] |
|
837 |
"diffs(%n. if even n then 0 \ |
|
838 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) n \ |
|
839 |
\ = (if even n then \ |
|
840 |
\ (- 1) ^ (n div 2)/(real (fact n)) \ |
|
841 |
\ else 0)"; |
|
12486 | 842 |
by (stac fact_Suc 1); |
843 |
by (stac real_of_nat_mult 1); |
|
844 |
by (stac even_Suc 1); |
|
845 |
by (stac real_inverse_distrib 1); |
|
12196 | 846 |
by Auto_tac; |
847 |
qed "sin_fdiffs2"; |
|
848 |
||
849 |
(* thms in EvenOdd needed *) |
|
850 |
Goalw [diffs_def,real_divide_def] |
|
851 |
"diffs(%n. if even n then \ |
|
852 |
\ (- 1) ^ (n div 2)/(real (fact n)) else 0) \ |
|
853 |
\ = (%n. - (if even n then 0 \ |
|
854 |
\ else (- 1) ^ ((n - Suc 0)div 2)/(real (fact n))))"; |
|
855 |
by (rtac ext 1); |
|
12486 | 856 |
by (stac fact_Suc 1); |
857 |
by (stac real_of_nat_mult 1); |
|
858 |
by (stac even_Suc 1); |
|
859 |
by (stac real_inverse_distrib 1); |
|
12196 | 860 |
by (res_inst_tac [("z1","real (Suc n)")] (real_mult_commute RS ssubst) 1); |
861 |
by (res_inst_tac [("z1","inverse(real (Suc n))")] |
|
862 |
(real_mult_commute RS ssubst) 1); |
|
863 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc, |
|
864 |
odd_not_even RS sym,odd_Suc_mult_two_ex])); |
|
865 |
qed "cos_fdiffs"; |
|
866 |
||
867 |
||
868 |
Goalw [diffs_def,real_divide_def] |
|
869 |
"diffs(%n. if even n then \ |
|
870 |
\ (- 1) ^ (n div 2)/(real (fact n)) else 0) n\ |
|
871 |
\ = - (if even n then 0 \ |
|
872 |
\ else (- 1) ^ ((n - Suc 0)div 2)/(real (fact n)))"; |
|
12486 | 873 |
by (stac fact_Suc 1); |
874 |
by (stac real_of_nat_mult 1); |
|
875 |
by (stac even_Suc 1); |
|
876 |
by (stac real_inverse_distrib 1); |
|
12196 | 877 |
by (res_inst_tac [("z1","real (Suc n)")] (real_mult_commute RS ssubst) 1); |
878 |
by (res_inst_tac [("z1","inverse (real (Suc n))")] |
|
879 |
(real_mult_commute RS ssubst) 1); |
|
880 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc, |
|
881 |
odd_not_even RS sym,odd_Suc_mult_two_ex])); |
|
882 |
qed "cos_fdiffs2"; |
|
883 |
||
884 |
(* ------------------------------------------------------------------------ *) |
|
885 |
(* Now at last we can get the derivatives of exp, sin and cos *) |
|
886 |
(* ------------------------------------------------------------------------ *) |
|
887 |
||
888 |
Goal "- sin x = suminf(%n. - ((if even n then 0 \ |
|
889 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) * x ^ n))"; |
|
890 |
by (auto_tac (claset() addSIs [sums_unique,sums_minus,sin_converges], |
|
891 |
simpset())); |
|
892 |
qed "lemma_sin_minus"; |
|
893 |
||
894 |
Goal "exp = (%x. suminf (%n. inverse (real (fact n)) * x ^ n))"; |
|
895 |
by (auto_tac (claset() addSIs [ext],simpset() addsimps [exp_def])); |
|
896 |
val lemma_exp_ext = result(); |
|
897 |
||
898 |
Goalw [exp_def] "DERIV exp x :> exp(x)"; |
|
12486 | 899 |
by (stac lemma_exp_ext 1); |
12196 | 900 |
by (subgoal_tac "DERIV (%u. suminf (%n. inverse (real (fact n)) * u ^ n)) x \ |
901 |
\ :> suminf (%n. diffs (%n. inverse (real (fact n))) n * x ^ n)" 1); |
|
902 |
by (res_inst_tac [("K","1 + abs(x)")] termdiffs 2); |
|
903 |
by (auto_tac (claset() addIs [exp_converges RS sums_summable], |
|
904 |
simpset() addsimps [exp_fdiffs])); |
|
905 |
by (arith_tac 1); |
|
906 |
qed "DERIV_exp"; |
|
907 |
Addsimps [DERIV_exp]; |
|
908 |
||
909 |
Goal "sin = (%x. suminf(%n. (if even n then 0 \ |
|
910 |
\ else (- 1) ^ ((n - Suc 0) div 2)/(real (fact n))) * \ |
|
911 |
\ x ^ n))"; |
|
912 |
by (auto_tac (claset() addSIs [ext],simpset() addsimps [sin_def])); |
|
913 |
val lemma_sin_ext = result(); |
|
914 |
||
915 |
Goal "cos = (%x. suminf(%n. (if even n then \ |
|
916 |
\ (- 1) ^ (n div 2)/(real (fact n)) \ |
|
917 |
\ else 0) * x ^ n))"; |
|
918 |
by (auto_tac (claset() addSIs [ext],simpset() addsimps [cos_def])); |
|
919 |
val lemma_cos_ext = result(); |
|
920 |
||
921 |
Goalw [cos_def] "DERIV sin x :> cos(x)"; |
|
12486 | 922 |
by (stac lemma_sin_ext 1); |
12196 | 923 |
by (auto_tac (claset(),simpset() addsimps [sin_fdiffs2 RS sym])); |
924 |
by (res_inst_tac [("K","1 + abs(x)")] termdiffs 1); |
|
925 |
by (auto_tac (claset() addIs [sin_converges, cos_converges, sums_summable] |
|
926 |
addSIs [sums_minus RS sums_summable], |
|
927 |
simpset() addsimps [cos_fdiffs,sin_fdiffs])); |
|
928 |
by (arith_tac 1); |
|
929 |
qed "DERIV_sin"; |
|
930 |
Addsimps [DERIV_sin]; |
|
931 |
||
932 |
Goal "DERIV cos x :> -sin(x)"; |
|
12486 | 933 |
by (stac lemma_cos_ext 1); |
12196 | 934 |
by (auto_tac (claset(),simpset() addsimps [lemma_sin_minus, |
935 |
cos_fdiffs2 RS sym,real_minus_mult_eq1])); |
|
936 |
by (res_inst_tac [("K","1 + abs(x)")] termdiffs 1); |
|
937 |
by (auto_tac (claset() addIs [sin_converges,cos_converges, sums_summable] |
|
938 |
addSIs [sums_minus RS sums_summable], |
|
939 |
simpset() addsimps [cos_fdiffs,sin_fdiffs,diffs_minus])); |
|
940 |
by (arith_tac 1); |
|
941 |
qed "DERIV_cos"; |
|
942 |
Addsimps [DERIV_cos]; |
|
943 |
||
944 |
(* ------------------------------------------------------------------------ *) |
|
945 |
(* Properties of the exponential function *) |
|
946 |
(* ------------------------------------------------------------------------ *) |
|
947 |
||
948 |
Goalw [exp_def] "exp 0 = 1"; |
|
949 |
by (rtac (CLAIM_SIMP "sumr 0 1 (%n. inverse (real (fact n)) * 0 ^ n) = 1" |
|
950 |
[real_of_nat_one] RS subst) 1); |
|
951 |
by (rtac ((series_zero RS sums_unique) RS sym) 1); |
|
952 |
by (Step_tac 1); |
|
953 |
by (case_tac "m" 1); |
|
954 |
by (Auto_tac); |
|
955 |
qed "exp_zero"; |
|
956 |
Addsimps [exp_zero]; |
|
957 |
||
958 |
Goal "0 <= x ==> (1 + x) <= exp(x)"; |
|
959 |
by (dtac real_le_imp_less_or_eq 1 THEN Auto_tac); |
|
960 |
by (rewtac exp_def); |
|
961 |
by (rtac real_le_trans 1); |
|
962 |
by (res_inst_tac [("n","2"),("f","(%n. inverse (real (fact n)) * x ^ n)")] |
|
963 |
series_pos_le 2); |
|
964 |
by (auto_tac (claset() addIs [summable_exp],simpset() |
|
965 |
addsimps [numeral_2_eq_2,realpow_ge_zero,real_0_le_mult_iff])); |
|
966 |
qed "exp_ge_add_one_self"; |
|
967 |
Addsimps [exp_ge_add_one_self]; |
|
968 |
||
969 |
Goal "0 < x ==> 1 < exp x"; |
|
970 |
by (rtac order_less_le_trans 1); |
|
971 |
by (rtac exp_ge_add_one_self 2); |
|
972 |
by (Auto_tac); |
|
973 |
qed "exp_gt_one"; |
|
974 |
Addsimps [exp_gt_one]; |
|
975 |
||
976 |
Goal "DERIV (%x. exp (x + y)) x :> exp(x + y)"; |
|
977 |
by (auto_tac (claset(),simpset() addsimps |
|
978 |
[CLAIM_SIMP "(%x. exp (x + y)) = exp o (%x. x + y)" [ext]])); |
|
979 |
by (rtac (real_mult_1_right RS subst) 1); |
|
980 |
by (rtac DERIV_chain 1); |
|
981 |
by (rtac (real_add_zero_right RS subst) 2); |
|
982 |
by (rtac DERIV_add 2); |
|
983 |
by Auto_tac; |
|
984 |
qed "DERIV_exp_add_const"; |
|
985 |
Addsimps [DERIV_exp_add_const]; |
|
986 |
||
987 |
Goal "DERIV (%x. exp (-x)) x :> - exp(-x)"; |
|
988 |
by (auto_tac (claset(),simpset() addsimps |
|
989 |
[CLAIM_SIMP "(%x. exp(-x)) = exp o (%x. - x)" [ext]])); |
|
990 |
by (rtac (real_mult_1_right RS subst) 1); |
|
991 |
by (rtac (real_minus_mult_eq1 RS subst) 1); |
|
12486 | 992 |
by (stac real_minus_mult_eq2 1); |
12196 | 993 |
by (rtac DERIV_chain 1); |
994 |
by (rtac DERIV_minus 2); |
|
995 |
by Auto_tac; |
|
996 |
qed "DERIV_exp_minus"; |
|
997 |
Addsimps [DERIV_exp_minus]; |
|
998 |
||
999 |
Goal "DERIV (%x. exp (x + y) * exp (- x)) x :> 0"; |
|
1000 |
by (cut_inst_tac [("x","x"),("y2","y")] ([DERIV_exp_add_const, |
|
1001 |
DERIV_exp_minus] MRS DERIV_mult) 1); |
|
1002 |
by (auto_tac (claset(),simpset() addsimps real_mult_ac)); |
|
1003 |
qed "DERIV_exp_exp_zero"; |
|
1004 |
Addsimps [DERIV_exp_exp_zero]; |
|
1005 |
||
1006 |
Goal "exp(x + y)*exp(-x) = exp(y)"; |
|
1007 |
by (cut_inst_tac [("x","x"),("y2","y"),("y","0")] |
|
1008 |
((CLAIM "ALL x. DERIV (%x. exp (x + y) * exp (- x)) x :> 0") RS |
|
1009 |
DERIV_isconst_all) 1); |
|
1010 |
by (Auto_tac); |
|
1011 |
qed "exp_add_mult_minus"; |
|
1012 |
Addsimps [exp_add_mult_minus]; |
|
1013 |
||
1014 |
Goal "exp(x)*exp(-x) = 1"; |
|
1015 |
by (cut_inst_tac [("x","x"),("y","0")] exp_add_mult_minus 1); |
|
1016 |
by (Asm_full_simp_tac 1); |
|
1017 |
qed "exp_mult_minus"; |
|
1018 |
Addsimps [exp_mult_minus]; |
|
1019 |
||
1020 |
Goal "exp(-x)*exp(x) = 1"; |
|
1021 |
by (simp_tac (simpset() addsimps [real_mult_commute]) 1); |
|
1022 |
qed "exp_mult_minus2"; |
|
1023 |
Addsimps [exp_mult_minus2]; |
|
1024 |
||
1025 |
Goal "exp(-x) = inverse(exp(x))"; |
|
1026 |
by (auto_tac (claset() addIs [real_inverse_unique],simpset())); |
|
1027 |
qed "exp_minus"; |
|
1028 |
||
1029 |
Goal "exp(x + y) = exp(x) * exp(y)"; |
|
1030 |
by (cut_inst_tac [("x1","x"),("y1","y"),("z","exp x")] |
|
1031 |
(exp_add_mult_minus RS (CLAIM "x = y ==> z * y = z * (x::real)")) 1); |
|
14266 | 1032 |
by (asm_full_simp_tac HOL_ss 1); |
12196 | 1033 |
by (asm_full_simp_tac (simpset() delsimps [exp_add_mult_minus] |
1034 |
addsimps real_mult_ac) 1); |
|
1035 |
qed "exp_add"; |
|
1036 |
||
1037 |
Goal "0 <= exp x"; |
|
1038 |
by (res_inst_tac [("t","x")] (real_sum_of_halves RS subst) 1); |
|
12486 | 1039 |
by (stac exp_add 1 THEN Auto_tac); |
12196 | 1040 |
qed "exp_ge_zero"; |
1041 |
Addsimps [exp_ge_zero]; |
|
1042 |
||
1043 |
Goal "exp x ~= 0"; |
|
1044 |
by (cut_inst_tac [("x","x")] exp_mult_minus2 1); |
|
1045 |
by (auto_tac (claset(),simpset() delsimps [exp_mult_minus2])); |
|
1046 |
qed "exp_not_eq_zero"; |
|
1047 |
Addsimps [exp_not_eq_zero]; |
|
1048 |
||
1049 |
Goal "0 < exp x"; |
|
1050 |
by (simp_tac (simpset() addsimps |
|
1051 |
[CLAIM_SIMP "(x < y) = (x <= y & y ~= (x::real))" [real_le_less]]) 1); |
|
1052 |
qed "exp_gt_zero"; |
|
1053 |
Addsimps [exp_gt_zero]; |
|
1054 |
||
1055 |
Goal "0 < inverse(exp x)"; |
|
1056 |
by (auto_tac (claset() addIs [real_inverse_gt_0],simpset())); |
|
1057 |
qed "inv_exp_gt_zero"; |
|
1058 |
Addsimps [inv_exp_gt_zero]; |
|
1059 |
||
1060 |
Goal "abs(exp x) = exp x"; |
|
1061 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI2])); |
|
1062 |
qed "abs_exp_cancel"; |
|
1063 |
Addsimps [abs_exp_cancel]; |
|
1064 |
||
1065 |
Goal "exp(real n * x) = exp(x) ^ n"; |
|
1066 |
by (induct_tac "n" 1); |
|
1067 |
by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc, |
|
1068 |
real_add_mult_distrib2,exp_add,real_mult_commute])); |
|
1069 |
qed "exp_real_of_nat_mult"; |
|
1070 |
||
1071 |
Goalw [real_diff_def,real_divide_def] |
|
1072 |
"exp(x - y) = exp(x)/(exp y)"; |
|
1073 |
by (simp_tac (simpset() addsimps [exp_add,exp_minus]) 1); |
|
1074 |
qed "exp_diff"; |
|
1075 |
||
1076 |
Goal "x < y ==> exp x < exp y"; |
|
1077 |
by (dtac ((real_less_sum_gt_zero) RS exp_gt_one) 1); |
|
1078 |
by (multr_by_tac "inverse(exp x)" 1); |
|
1079 |
by (auto_tac (claset(),simpset() addsimps [exp_add,exp_minus])); |
|
1080 |
qed "exp_less_mono"; |
|
1081 |
||
1082 |
Goal "exp x < exp y ==> x < y"; |
|
1083 |
by (EVERY1[rtac ccontr, dtac real_leI, dtac real_le_imp_less_or_eq]); |
|
1084 |
by (auto_tac (claset() addDs [exp_less_mono],simpset())); |
|
1085 |
qed "exp_less_cancel"; |
|
1086 |
||
1087 |
Goal "(exp(x) < exp(y)) = (x < y)"; |
|
1088 |
by (auto_tac (claset() addIs [exp_less_mono,exp_less_cancel],simpset())); |
|
1089 |
qed "exp_less_cancel_iff"; |
|
1090 |
AddIffs [exp_less_cancel_iff]; |
|
1091 |
||
1092 |
Goalw [real_le_def] "(exp(x) <= exp(y)) = (x <= y)"; |
|
1093 |
by (Auto_tac); |
|
1094 |
qed "exp_le_cancel_iff"; |
|
1095 |
AddIffs [exp_le_cancel_iff]; |
|
1096 |
||
1097 |
Goal "(exp x = exp y) = (x = y)"; |
|
1098 |
by (auto_tac (claset(),simpset() addsimps |
|
1099 |
[CLAIM "(x = (y::real)) = (x <= y & y <= x)"])); |
|
1100 |
qed "exp_inj_iff"; |
|
1101 |
AddIffs [exp_inj_iff]; |
|
1102 |
||
1103 |
Goal "1 <= y ==> EX x. 0 <= x & x <= y - 1 & exp(x) = y"; |
|
1104 |
by (rtac IVT 1); |
|
14270 | 1105 |
by (auto_tac (claset() addIs [DERIV_exp RS DERIV_isCont], |
1106 |
simpset() addsimps [le_diff_eq])); |
|
1107 |
by (dtac (CLAIM_SIMP "x <= y ==> (0::real) <= y - x" [le_diff_eq]) 1); |
|
12196 | 1108 |
by (dtac exp_ge_add_one_self 1); |
1109 |
by (Asm_full_simp_tac 1); |
|
1110 |
qed "lemma_exp_total"; |
|
1111 |
||
1112 |
Goal "0 < y ==> EX x. exp x = y"; |
|
1113 |
by (res_inst_tac [("R1.0","1"),("R2.0","y")] real_linear_less2 1); |
|
1114 |
by (dtac (order_less_imp_le RS lemma_exp_total) 1); |
|
1115 |
by (res_inst_tac [("x","0")] exI 2); |
|
1116 |
by (ftac real_inverse_gt_one 3); |
|
1117 |
by (dtac (order_less_imp_le RS lemma_exp_total) 4); |
|
1118 |
by (Step_tac 3); |
|
1119 |
by (res_inst_tac [("x","-x")] exI 3); |
|
1120 |
by (auto_tac (claset(),simpset() addsimps [exp_minus])); |
|
1121 |
qed "exp_total"; |
|
1122 |
||
1123 |
(* ------------------------------------------------------------------------ *) |
|
1124 |
(* Properties of the logarithmic function *) |
|
1125 |
(* ------------------------------------------------------------------------ *) |
|
1126 |
||
1127 |
Goalw [ln_def] "ln(exp x) = x"; |
|
1128 |
by (Simp_tac 1); |
|
1129 |
qed "ln_exp"; |
|
1130 |
Addsimps [ln_exp]; |
|
1131 |
||
1132 |
Goal "(exp(ln x) = x) = (0 < x)"; |
|
1133 |
by (auto_tac (claset() addDs [exp_total],simpset())); |
|
1134 |
by (dtac subst 1); |
|
1135 |
by (Auto_tac); |
|
1136 |
qed "exp_ln_iff"; |
|
1137 |
Addsimps [exp_ln_iff]; |
|
1138 |
||
1139 |
Goal "[| 0 < x; 0 < y |] ==> ln(x * y) = ln(x) + ln(y)"; |
|
1140 |
by (rtac (exp_inj_iff RS iffD1) 1); |
|
1141 |
by (ftac (real_mult_order) 1); |
|
1142 |
by (auto_tac (claset(),simpset() addsimps [exp_add,exp_ln_iff RS sym] |
|
1143 |
delsimps [exp_inj_iff,exp_ln_iff])); |
|
1144 |
qed "ln_mult"; |
|
1145 |
||
1146 |
Goal "[| 0 < x; 0 < y |] ==> (ln x = ln y) = (x = y)"; |
|
13601 | 1147 |
by (auto_tac (claset() addSDs [(exp_ln_iff RS iffD2 RS sym)],simpset())); |
12196 | 1148 |
qed "ln_inj_iff"; |
1149 |
Addsimps [ln_inj_iff]; |
|
1150 |
||
1151 |
Goal "ln 1 = 0"; |
|
1152 |
by (rtac (exp_inj_iff RS iffD1) 1); |
|
1153 |
by Auto_tac; |
|
1154 |
qed "ln_one"; |
|
1155 |
Addsimps [ln_one]; |
|
1156 |
||
1157 |
Goal "0 < x ==> ln(inverse x) = - ln x"; |
|
1158 |
by (res_inst_tac [("x1","ln x")] (real_add_left_cancel RS iffD1) 1); |
|
1159 |
by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0,ln_mult RS sym])); |
|
1160 |
qed "ln_inverse"; |
|
1161 |
||
1162 |
Goalw [real_divide_def] |
|
1163 |
"[|0 < x; 0 < y|] ==> ln(x/y) = ln x - ln y"; |
|
1164 |
by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0, |
|
1165 |
ln_mult,ln_inverse])); |
|
1166 |
qed "ln_div"; |
|
1167 |
||
1168 |
Goal "[| 0 < x; 0 < y|] ==> (ln x < ln y) = (x < y)"; |
|
1169 |
by (REPEAT(dtac (exp_ln_iff RS iffD2) 1)); |
|
1170 |
by (REPEAT(dtac subst 1 THEN assume_tac 2)); |
|
1171 |
by (Simp_tac 1); |
|
1172 |
qed "ln_less_cancel_iff"; |
|
1173 |
Addsimps [ln_less_cancel_iff]; |
|
1174 |
||
1175 |
Goalw [real_le_def] "[| 0 < x; 0 < y|] ==> (ln x <= ln y) = (x <= y)"; |
|
1176 |
by (Auto_tac); |
|
1177 |
qed "ln_le_cancel_iff"; |
|
1178 |
Addsimps [ln_le_cancel_iff]; |
|
1179 |
||
1180 |
Goal "0 < x ==> ln(x ^ n) = real n * ln(x)"; |
|
1181 |
by (auto_tac (claset() addSDs [exp_total],simpset() |
|
1182 |
addsimps [exp_real_of_nat_mult RS sym])); |
|
1183 |
qed "ln_realpow"; |
|
1184 |
||
1185 |
Goal "0 <= x ==> ln(1 + x) <= x"; |
|
1186 |
by (rtac (ln_exp RS subst) 1); |
|
1187 |
by (rtac (ln_le_cancel_iff RS iffD2) 1); |
|
1188 |
by Auto_tac; |
|
1189 |
qed "ln_add_one_self_le_self"; |
|
1190 |
Addsimps [ln_add_one_self_le_self]; |
|
1191 |
||
1192 |
Goal "0 < x ==> ln x < x"; |
|
1193 |
by (rtac order_less_le_trans 1); |
|
1194 |
by (rtac ln_add_one_self_le_self 2); |
|
1195 |
by (rtac (ln_less_cancel_iff RS iffD2) 1); |
|
1196 |
by Auto_tac; |
|
1197 |
qed "ln_less_self"; |
|
1198 |
Addsimps [ln_less_self]; |
|
1199 |
||
1200 |
Goal "1 <= x ==> 0 <= ln x"; |
|
1201 |
by (subgoal_tac "0 < x" 1); |
|
1202 |
by (rtac order_less_le_trans 2 THEN assume_tac 3); |
|
1203 |
by (rtac (exp_le_cancel_iff RS iffD1) 1); |
|
1204 |
by (auto_tac (claset(),simpset() addsimps |
|
1205 |
[exp_ln_iff RS sym] delsimps [exp_ln_iff])); |
|
1206 |
qed "ln_ge_zero"; |
|
1207 |
Addsimps [ln_ge_zero]; |
|
1208 |
||
1209 |
Goal "1 < x ==> 0 < ln x"; |
|
1210 |
by (rtac (exp_less_cancel_iff RS iffD1) 1); |
|
1211 |
by (rtac (exp_ln_iff RS iffD2 RS ssubst) 1); |
|
1212 |
by Auto_tac; |
|
1213 |
qed "ln_gt_zero"; |
|
1214 |
Addsimps [ln_gt_zero]; |
|
1215 |
||
1216 |
Goal "[| 0 < x; x ~= 1 |] ==> ln x ~= 0"; |
|
1217 |
by (Step_tac 1); |
|
1218 |
by (dtac (exp_inj_iff RS iffD2) 1); |
|
1219 |
by (dtac (exp_ln_iff RS iffD2) 1); |
|
1220 |
by Auto_tac; |
|
1221 |
qed "ln_not_eq_zero"; |
|
1222 |
Addsimps [ln_not_eq_zero]; |
|
1223 |
||
1224 |
Goal "[| 0 < x; x < 1 |] ==> ln x < 0"; |
|
1225 |
by (rtac (exp_less_cancel_iff RS iffD1) 1); |
|
1226 |
by (auto_tac (claset(),simpset() addsimps [exp_ln_iff RS sym] |
|
1227 |
delsimps [exp_ln_iff])); |
|
1228 |
qed "ln_less_zero"; |
|
1229 |
||
1230 |
Goal "exp u = x ==> ln x = u"; |
|
1231 |
by Auto_tac; |
|
1232 |
qed "exp_ln_eq"; |
|
1233 |
||
1234 |
Addsimps [hypreal_less_not_refl]; |
|
1235 |
||
1236 |
(* ------------------------------------------------------------------------ *) |
|
1237 |
(* Basic properties of the trig functions *) |
|
1238 |
(* ------------------------------------------------------------------------ *) |
|
1239 |
||
1240 |
Goalw [sin_def] "sin 0 = 0"; |
|
1241 |
by (auto_tac (claset() addSIs [(sums_unique RS sym), |
|
1242 |
LIMSEQ_const],simpset() addsimps [sums_def])); |
|
1243 |
qed "sin_zero"; |
|
1244 |
Addsimps [sin_zero]; |
|
1245 |
||
1246 |
Goal "(ALL m. n <= m --> f m = 0) --> f sums sumr 0 n f"; |
|
1247 |
by (auto_tac (claset() addIs [series_zero],simpset())); |
|
1248 |
qed "lemma_series_zero2"; |
|
1249 |
||
1250 |
Goalw [cos_def] "cos 0 = 1"; |
|
1251 |
by (rtac (sums_unique RS sym) 1); |
|
1252 |
by (cut_inst_tac [("n","1"),("f","(%n. (if even n then (- 1) ^ (n div 2)/ \ |
|
1253 |
\ (real (fact n)) else 0) * 0 ^ n)")] lemma_series_zero2 1); |
|
1254 |
by Auto_tac; |
|
1255 |
qed "cos_zero"; |
|
1256 |
Addsimps [cos_zero]; |
|
1257 |
||
1258 |
Goal "DERIV (%x. sin(x)*sin(x)) x :> cos(x) * sin(x) + cos(x) * sin(x)"; |
|
1259 |
by (rtac DERIV_mult 1 THEN Auto_tac); |
|
1260 |
qed "DERIV_sin_sin_mult"; |
|
1261 |
Addsimps [DERIV_sin_sin_mult]; |
|
1262 |
||
1263 |
Goal "DERIV (%x. sin(x)*sin(x)) x :> 2 * cos(x) * sin(x)"; |
|
1264 |
by (cut_inst_tac [("x","x")] DERIV_sin_sin_mult 1); |
|
1265 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc])); |
|
1266 |
qed "DERIV_sin_sin_mult2"; |
|
1267 |
Addsimps [DERIV_sin_sin_mult2]; |
|
1268 |
||
1269 |
Goal "DERIV (%x. sin(x) ^ 2) x :> cos(x) * sin(x) + cos(x) * sin(x)"; |
|
1270 |
by (auto_tac (claset(), |
|
1271 |
simpset() addsimps [numeral_2_eq_2, real_mult_assoc RS sym])); |
|
1272 |
qed "DERIV_sin_realpow2"; |
|
1273 |
Addsimps [DERIV_sin_realpow2]; |
|
1274 |
||
1275 |
Goal "DERIV (%x. sin(x) ^ 2) x :> 2 * cos(x) * sin(x)"; |
|
1276 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1277 |
qed "DERIV_sin_realpow2a"; |
|
1278 |
Addsimps [ DERIV_sin_realpow2a]; |
|
1279 |
||
1280 |
Goal "DERIV (%x. cos(x)*cos(x)) x :> -sin(x) * cos(x) + -sin(x) * cos(x)"; |
|
1281 |
by (rtac DERIV_mult 1 THEN Auto_tac); |
|
1282 |
qed "DERIV_cos_cos_mult"; |
|
1283 |
Addsimps [DERIV_cos_cos_mult]; |
|
1284 |
||
1285 |
Goal "DERIV (%x. cos(x)*cos(x)) x :> -2 * cos(x) * sin(x)"; |
|
1286 |
by (cut_inst_tac [("x","x")] DERIV_cos_cos_mult 1); |
|
1287 |
by (auto_tac (claset(),simpset() addsimps real_mult_ac)); |
|
1288 |
qed "DERIV_cos_cos_mult2"; |
|
1289 |
Addsimps [DERIV_cos_cos_mult2]; |
|
1290 |
||
1291 |
Goal "DERIV (%x. cos(x) ^ 2) x :> -sin(x) * cos(x) + -sin(x) * cos(x)"; |
|
1292 |
by (auto_tac (claset(), |
|
1293 |
simpset() addsimps [numeral_2_eq_2, real_mult_assoc RS sym])); |
|
1294 |
qed "DERIV_cos_realpow2"; |
|
1295 |
Addsimps [DERIV_cos_realpow2]; |
|
1296 |
||
1297 |
Goal "DERIV (%x. cos(x) ^ 2) x :> -2 * cos(x) * sin(x)"; |
|
1298 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1299 |
qed "DERIV_cos_realpow2a"; |
|
1300 |
Addsimps [DERIV_cos_realpow2a]; |
|
1301 |
||
1302 |
Goal "[| DERIV f x :> D; D = E |] ==> DERIV f x :> E"; |
|
1303 |
by (Auto_tac); |
|
1304 |
val lemma_DERIV_subst = result(); |
|
1305 |
||
1306 |
Goal "DERIV (%x. cos(x) ^ 2) x :> -(2 * cos(x) * sin(x))"; |
|
1307 |
by (rtac lemma_DERIV_subst 1); |
|
1308 |
by (rtac DERIV_cos_realpow2a 1); |
|
1309 |
by Auto_tac; |
|
1310 |
qed "DERIV_cos_realpow2b"; |
|
1311 |
||
1312 |
(* most useful *) |
|
1313 |
Goal "DERIV (%x. cos(x)*cos(x)) x :> -(2 * cos(x) * sin(x))"; |
|
1314 |
by (rtac lemma_DERIV_subst 1); |
|
1315 |
by (rtac DERIV_cos_cos_mult2 1); |
|
1316 |
by Auto_tac; |
|
1317 |
qed "DERIV_cos_cos_mult3"; |
|
1318 |
Addsimps [DERIV_cos_cos_mult3]; |
|
1319 |
||
1320 |
Goalw [real_diff_def] |
|
1321 |
"ALL x. DERIV (%x. sin(x) ^ 2 + cos(x) ^ 2) x :> \ |
|
1322 |
\ (2*cos(x)*sin(x) - 2*cos(x)*sin(x))"; |
|
1323 |
by (Step_tac 1); |
|
1324 |
by (rtac DERIV_add 1); |
|
1325 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1326 |
qed "DERIV_sin_circle_all"; |
|
1327 |
||
1328 |
Goal "ALL x. DERIV (%x. sin(x) ^ 2 + cos(x) ^ 2) x :> 0"; |
|
1329 |
by (cut_facts_tac [DERIV_sin_circle_all] 1); |
|
1330 |
by Auto_tac; |
|
1331 |
qed "DERIV_sin_circle_all_zero"; |
|
1332 |
Addsimps [DERIV_sin_circle_all_zero]; |
|
1333 |
||
1334 |
Goal "(sin(x) ^ 2) + (cos(x) ^ 2) = 1"; |
|
1335 |
by (cut_inst_tac [("x","x"),("y","0")] |
|
1336 |
(DERIV_sin_circle_all_zero RS DERIV_isconst_all) 1); |
|
1337 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1338 |
qed "sin_cos_squared_add"; |
|
1339 |
Addsimps [sin_cos_squared_add]; |
|
1340 |
||
1341 |
Goal "(cos(x) ^ 2) + (sin(x) ^ 2) = 1"; |
|
12486 | 1342 |
by (stac real_add_commute 1); |
12196 | 1343 |
by (simp_tac (simpset() delsimps [realpow_Suc]) 1); |
1344 |
qed "sin_cos_squared_add2"; |
|
1345 |
Addsimps [sin_cos_squared_add2]; |
|
1346 |
||
1347 |
Goal "cos x * cos x + sin x * sin x = 1"; |
|
1348 |
by (cut_inst_tac [("x","x")] sin_cos_squared_add2 1); |
|
1349 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1350 |
qed "sin_cos_squared_add3"; |
|
1351 |
Addsimps [sin_cos_squared_add3]; |
|
1352 |
||
1353 |
Goal "(sin(x) ^ 2) = 1 - (cos(x) ^ 2)"; |
|
1354 |
by (res_inst_tac [("x1","(cos(x) ^ 2)")] (real_add_right_cancel RS iffD1) 1); |
|
1355 |
by (simp_tac (simpset() delsimps [realpow_Suc]) 1); |
|
1356 |
qed "sin_squared_eq"; |
|
1357 |
||
1358 |
Goal "(cos(x) ^ 2) = 1 - (sin(x) ^ 2)"; |
|
1359 |
by (res_inst_tac [("x1","(sin(x) ^ 2)")] (real_add_right_cancel RS iffD1) 1); |
|
1360 |
by (simp_tac (simpset() delsimps [realpow_Suc]) 1); |
|
1361 |
qed "cos_squared_eq"; |
|
1362 |
||
1363 |
Goal "[| 1 < x; 0 <= y |] ==> 1 < x + (y::real)"; |
|
1364 |
by (arith_tac 1); |
|
1365 |
qed "real_gt_one_ge_zero_add_less"; |
|
1366 |
||
1367 |
Goalw [real_le_def] "abs(sin x) <= 1"; |
|
1368 |
by (rtac notI 1); |
|
1369 |
by (dtac realpow_two_gt_one 1); |
|
1370 |
by (auto_tac (claset(),simpset() delsimps [realpow_Suc])); |
|
1371 |
by (dres_inst_tac [("r1","cos x")] (realpow_two_le RSN |
|
1372 |
(2, real_gt_one_ge_zero_add_less)) 1); |
|
1373 |
by (asm_full_simp_tac (simpset() addsimps [numeral_2_eq_2 RS sym] |
|
1374 |
delsimps [realpow_Suc]) 1); |
|
1375 |
qed "abs_sin_le_one"; |
|
1376 |
Addsimps [abs_sin_le_one]; |
|
1377 |
||
1378 |
Goal "- 1 <= sin x"; |
|
1379 |
by (full_simp_tac (simpset() addsimps [simplify (simpset()) (abs_sin_le_one RS |
|
1380 |
(abs_le_interval_iff RS iffD1))]) 1); |
|
1381 |
qed "sin_ge_minus_one"; |
|
1382 |
Addsimps [sin_ge_minus_one]; |
|
1383 |
||
1384 |
Goal "-1 <= sin x"; |
|
1385 |
by (rtac (simplify (simpset()) sin_ge_minus_one) 1); |
|
1386 |
qed "sin_ge_minus_one2"; |
|
1387 |
Addsimps [sin_ge_minus_one2]; |
|
1388 |
||
1389 |
Goal "sin x <= 1"; |
|
1390 |
by (full_simp_tac (simpset() addsimps [abs_sin_le_one RS |
|
1391 |
(abs_le_interval_iff RS iffD1)]) 1); |
|
1392 |
qed "sin_le_one"; |
|
1393 |
Addsimps [sin_le_one]; |
|
1394 |
||
1395 |
Goalw [real_le_def] "abs(cos x) <= 1"; |
|
1396 |
by (rtac notI 1); |
|
1397 |
by (dtac realpow_two_gt_one 1); |
|
1398 |
by (auto_tac (claset(),simpset() delsimps [realpow_Suc])); |
|
1399 |
by (dres_inst_tac [("r1","sin x")] (realpow_two_le RSN |
|
1400 |
(2, real_gt_one_ge_zero_add_less)) 1); |
|
1401 |
by (asm_full_simp_tac (simpset() addsimps [numeral_2_eq_2 RS sym] |
|
1402 |
delsimps [realpow_Suc]) 1); |
|
1403 |
qed "abs_cos_le_one"; |
|
1404 |
Addsimps [abs_cos_le_one]; |
|
1405 |
||
1406 |
Goal "- 1 <= cos x"; |
|
1407 |
by (full_simp_tac (simpset() addsimps [simplify (simpset())(abs_cos_le_one RS |
|
1408 |
(abs_le_interval_iff RS iffD1))]) 1); |
|
1409 |
qed "cos_ge_minus_one"; |
|
1410 |
Addsimps [cos_ge_minus_one]; |
|
1411 |
||
1412 |
Goal "-1 <= cos x"; |
|
1413 |
by (rtac (simplify (simpset()) cos_ge_minus_one) 1); |
|
1414 |
qed "cos_ge_minus_one2"; |
|
1415 |
Addsimps [cos_ge_minus_one2]; |
|
1416 |
||
1417 |
Goal "cos x <= 1"; |
|
1418 |
by (full_simp_tac (simpset() addsimps [abs_cos_le_one RS |
|
1419 |
(abs_le_interval_iff RS iffD1)]) 1); |
|
1420 |
qed "cos_le_one"; |
|
1421 |
Addsimps [cos_le_one]; |
|
1422 |
||
1423 |
Goal "DERIV g x :> m ==> \ |
|
1424 |
\ DERIV (%x. (g x) ^ n) x :> real n * (g x) ^ (n - 1) * m"; |
|
1425 |
by (rtac lemma_DERIV_subst 1); |
|
1426 |
by (res_inst_tac [("f","(%x. x ^ n)")] DERIV_chain2 1); |
|
1427 |
by (rtac DERIV_pow 1 THEN Auto_tac); |
|
1428 |
qed "DERIV_fun_pow"; |
|
1429 |
||
1430 |
Goal "DERIV g x :> m ==> DERIV (%x. exp(g x)) x :> exp(g x) * m"; |
|
1431 |
by (rtac lemma_DERIV_subst 1); |
|
1432 |
by (res_inst_tac [("f","exp")] DERIV_chain2 1); |
|
1433 |
by (rtac DERIV_exp 1 THEN Auto_tac); |
|
1434 |
qed "DERIV_fun_exp"; |
|
1435 |
||
1436 |
Goal "DERIV g x :> m ==> DERIV (%x. sin(g x)) x :> cos(g x) * m"; |
|
1437 |
by (rtac lemma_DERIV_subst 1); |
|
1438 |
by (res_inst_tac [("f","sin")] DERIV_chain2 1); |
|
1439 |
by (rtac DERIV_sin 1 THEN Auto_tac); |
|
1440 |
qed "DERIV_fun_sin"; |
|
1441 |
||
1442 |
Goal "DERIV g x :> m ==> DERIV (%x. cos(g x)) x :> -sin(g x) * m"; |
|
1443 |
by (rtac lemma_DERIV_subst 1); |
|
1444 |
by (res_inst_tac [("f","cos")] DERIV_chain2 1); |
|
1445 |
by (rtac DERIV_cos 1 THEN Auto_tac); |
|
1446 |
qed "DERIV_fun_cos"; |
|
1447 |
||
1448 |
(* FIXME: remove this quick, crude tactic *) |
|
1449 |
exception DERIV_name; |
|
1450 |
fun get_fun_name (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _)) = f |
|
1451 |
| get_fun_name (_ $ (_ $ (Const ("Lim.deriv",_) $ Abs(_,_, Const (f,_) $ _) $ _ $ _))) = f |
|
1452 |
| get_fun_name _ = raise DERIV_name; |
|
1453 |
||
1454 |
val deriv_rulesI = [DERIV_Id,DERIV_const,DERIV_cos,DERIV_cmult, |
|
1455 |
DERIV_sin, DERIV_exp, DERIV_inverse,DERIV_pow, |
|
1456 |
DERIV_add, DERIV_diff, DERIV_mult, DERIV_minus, |
|
1457 |
DERIV_inverse_fun,DERIV_quotient,DERIV_fun_pow, |
|
1458 |
DERIV_fun_exp,DERIV_fun_sin,DERIV_fun_cos, |
|
1459 |
DERIV_Id,DERIV_const,DERIV_cos]; |
|
1460 |
||
1461 |
||
1462 |
fun deriv_tac i = (resolve_tac deriv_rulesI i) ORELSE |
|
1463 |
((rtac (read_instantiate [("f",get_fun_name (getgoal i))] |
|
1464 |
DERIV_chain2) i) handle DERIV_name => no_tac); |
|
1465 |
||
1466 |
val DERIV_tac = ALLGOALS(fn i => REPEAT(deriv_tac i)); |
|
1467 |
||
1468 |
(* lemma *) |
|
1469 |
Goal "ALL x. \ |
|
1470 |
\ DERIV (%x. (sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 + \ |
|
1471 |
\ (cos (x + y) - (cos x * cos y - sin x * sin y)) ^ 2) x :> 0"; |
|
1472 |
by (Step_tac 1 THEN rtac lemma_DERIV_subst 1); |
|
1473 |
by DERIV_tac; |
|
1474 |
by (auto_tac (claset(),simpset() addsimps [real_diff_def, |
|
1475 |
real_add_mult_distrib,real_add_mult_distrib2] @ |
|
1476 |
real_mult_ac @ real_add_ac)); |
|
1477 |
val lemma_DERIV_sin_cos_add = result(); |
|
1478 |
||
1479 |
Goal "(sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 + \ |
|
1480 |
\ (cos (x + y) - (cos x * cos y - sin x * sin y)) ^ 2 = 0"; |
|
1481 |
by (cut_inst_tac [("y","0"),("x","x"),("y7","y")] |
|
1482 |
(lemma_DERIV_sin_cos_add RS DERIV_isconst_all) 1); |
|
1483 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1484 |
qed "sin_cos_add"; |
|
1485 |
Addsimps [sin_cos_add]; |
|
1486 |
||
1487 |
Goal "sin (x + y) = sin x * cos y + cos x * sin y"; |
|
1488 |
by (cut_inst_tac [("x","x"),("y","y")] sin_cos_add 1); |
|
1489 |
by (auto_tac (claset() addSDs [real_sum_squares_cancel_a], |
|
1490 |
simpset() addsimps [numeral_2_eq_2] delsimps [sin_cos_add])); |
|
1491 |
qed "sin_add"; |
|
1492 |
||
1493 |
Goal "cos (x + y) = cos x * cos y - sin x * sin y"; |
|
1494 |
by (cut_inst_tac [("x","x"),("y","y")] sin_cos_add 1); |
|
1495 |
by (auto_tac (claset() addSDs [real_sum_squares_cancel_a],simpset() addsimps [numeral_2_eq_2] delsimps [sin_cos_add])); |
|
1496 |
qed "cos_add"; |
|
1497 |
||
1498 |
Goal "ALL x. \ |
|
1499 |
\ DERIV (%x. (sin(-x) + (sin x)) ^ 2 + (cos(-x) - (cos x)) ^ 2) x :> 0"; |
|
1500 |
by (Step_tac 1 THEN rtac lemma_DERIV_subst 1); |
|
1501 |
by DERIV_tac; |
|
1502 |
by (auto_tac (claset(),simpset() addsimps [real_diff_def, |
|
1503 |
real_add_mult_distrib,real_add_mult_distrib2] |
|
1504 |
@ real_mult_ac @ real_add_ac)); |
|
1505 |
val lemma_DERIV_sin_cos_minus = result(); |
|
1506 |
||
1507 |
Goal "(sin(-x) + (sin x)) ^ 2 + (cos(-x) - (cos x)) ^ 2 = 0"; |
|
1508 |
by (cut_inst_tac [("y","0"),("x","x")] |
|
1509 |
(lemma_DERIV_sin_cos_minus RS DERIV_isconst_all) 1); |
|
1510 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1511 |
qed "sin_cos_minus"; |
|
1512 |
Addsimps [sin_cos_minus]; |
|
1513 |
||
1514 |
Goal "sin (-x) = -sin(x)"; |
|
1515 |
by (cut_inst_tac [("x","x")] sin_cos_minus 1); |
|
1516 |
by (auto_tac (claset() addSDs [real_sum_squares_cancel_a], |
|
1517 |
simpset() addsimps [numeral_2_eq_2] delsimps [sin_cos_minus])); |
|
1518 |
qed "sin_minus"; |
|
1519 |
Addsimps [sin_minus]; |
|
1520 |
||
1521 |
Goal "cos (-x) = cos(x)"; |
|
1522 |
by (cut_inst_tac [("x","x")] sin_cos_minus 1); |
|
1523 |
by (auto_tac (claset() addSDs [real_sum_squares_cancel_a], |
|
1524 |
simpset() addsimps [numeral_2_eq_2] delsimps [sin_cos_minus])); |
|
1525 |
qed "cos_minus"; |
|
1526 |
Addsimps [cos_minus]; |
|
1527 |
||
1528 |
Goalw [real_diff_def] "sin (x - y) = sin x * cos y - cos x * sin y"; |
|
1529 |
by (simp_tac (simpset() addsimps [sin_add]) 1); |
|
1530 |
qed "sin_diff"; |
|
1531 |
||
1532 |
Goal "sin (x - y) = cos y * sin x - sin y * cos x"; |
|
1533 |
by (simp_tac (simpset() addsimps [sin_diff,real_mult_commute]) 1); |
|
1534 |
qed "sin_diff2"; |
|
1535 |
||
1536 |
Goalw [real_diff_def] "cos (x - y) = cos x * cos y + sin x * sin y"; |
|
1537 |
by (simp_tac (simpset() addsimps [cos_add]) 1); |
|
1538 |
qed "cos_diff"; |
|
1539 |
||
1540 |
Goal "cos (x - y) = cos y * cos x + sin y * sin x"; |
|
1541 |
by (simp_tac (simpset() addsimps [cos_diff,real_mult_commute]) 1); |
|
1542 |
qed "cos_diff2"; |
|
1543 |
||
1544 |
Goal "sin(2 * x) = 2* sin x * cos x"; |
|
1545 |
by (cut_inst_tac [("x","x"),("y","x")] sin_add 1); |
|
1546 |
by Auto_tac; |
|
1547 |
qed "sin_double"; |
|
1548 |
||
1549 |
Addsimps [sin_double]; |
|
1550 |
||
1551 |
Goal "cos(2* x) = (cos(x) ^ 2) - (sin(x) ^ 2)"; |
|
1552 |
by (cut_inst_tac [("x","x"),("y","x")] cos_add 1); |
|
1553 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1554 |
qed "cos_double"; |
|
1555 |
||
1556 |
(* ------------------------------------------------------------------------ *) |
|
1557 |
(* Show that there's a least positive x with cos(x) = 0; hence define pi *) |
|
1558 |
(* ------------------------------------------------------------------------ *) |
|
1559 |
||
1560 |
Goal "(%n. (- 1) ^ n /(real (fact (2 * n + 1))) * \ |
|
1561 |
\ x ^ (2 * n + 1)) sums sin x"; |
|
1562 |
by (cut_inst_tac [("x2","x")] (CLAIM "0 < (2::nat)" RS ((sin_converges |
|
1563 |
RS sums_summable) RS sums_group)) 1); |
|
1564 |
by (auto_tac (claset(),simpset() addsimps mult_ac@[sin_def])); |
|
1565 |
qed "sin_paired"; |
|
1566 |
||
1567 |
Goal "real (Suc (Suc (Suc (Suc 2)))) = \ |
|
1568 |
\ real (2::nat) * real (Suc 2)"; |
|
1569 |
by (simp_tac (simpset() addsimps [numeral_2_eq_2, real_of_nat_Suc]) 1); |
|
1570 |
val lemma_real_of_nat_six_mult = result(); |
|
1571 |
||
1572 |
Goal "[|0 < x; x < 2 |] ==> 0 < sin x"; |
|
1573 |
by (cut_inst_tac [("x2","x")] (CLAIM "0 < (2::nat)" RS ((sin_paired |
|
1574 |
RS sums_summable) RS sums_group)) 1); |
|
1575 |
by (rotate_tac 2 1); |
|
1576 |
by (dtac ((sin_paired RS sums_unique) RS ssubst) 1); |
|
1577 |
by (auto_tac (claset(),simpset() delsimps [fact_Suc,realpow_Suc])); |
|
1578 |
by (ftac sums_unique 1); |
|
1579 |
by (auto_tac (claset(),simpset() delsimps [fact_Suc,realpow_Suc])); |
|
1580 |
by (res_inst_tac [("n1","0")] (series_pos_less RSN (2,order_le_less_trans)) 1); |
|
1581 |
by (auto_tac (claset(),simpset() delsimps [fact_Suc,realpow_Suc])); |
|
1582 |
by (etac sums_summable 1); |
|
1583 |
by (case_tac "m=0" 1); |
|
1584 |
by (Asm_simp_tac 1); |
|
14288 | 1585 |
by (subgoal_tac "6 * (x * (x * x) / real (Suc (Suc (Suc (Suc (Suc (Suc 0))))))) < 6 * x" 1); |
1586 |
by (asm_full_simp_tac (HOL_ss addsimps [mult_less_cancel_left]) 1); |
|
1587 |
by (asm_full_simp_tac (simpset() addsimps []) 1); |
|
1588 |
by (asm_simp_tac (simpset() addsimps [numeral_2_eq_2 RS sym, real_mult_assoc RS sym]) 1); |
|
1589 |
by (stac (CLAIM "6 = 2 * (3::real)") 1); |
|
1590 |
by (rtac real_mult_less_mono 1); |
|
12196 | 1591 |
by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc] delsimps [fact_Suc])); |
12486 | 1592 |
by (stac fact_Suc 1); |
1593 |
by (stac fact_Suc 1); |
|
1594 |
by (stac fact_Suc 1); |
|
1595 |
by (stac fact_Suc 1); |
|
1596 |
by (stac real_of_nat_mult 1); |
|
1597 |
by (stac real_of_nat_mult 1); |
|
1598 |
by (stac real_of_nat_mult 1); |
|
1599 |
by (stac real_of_nat_mult 1); |
|
12196 | 1600 |
by (simp_tac (simpset() addsimps [real_divide_def, |
1601 |
real_inverse_distrib] delsimps [fact_Suc]) 1); |
|
1602 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym] |
|
1603 |
delsimps [fact_Suc])); |
|
1604 |
by (multr_by_tac "real (Suc (Suc (4*m)))" 1); |
|
1605 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc] |
|
1606 |
delsimps [fact_Suc])); |
|
1607 |
by (multr_by_tac "real (Suc (Suc (Suc (4*m))))" 1); |
|
14288 | 1608 |
by (auto_tac (claset(),simpset() addsimps [mult_assoc,mult_less_cancel_left] |
12196 | 1609 |
delsimps [fact_Suc])); |
14288 | 1610 |
by (auto_tac (claset(),simpset() addsimps [ |
1611 |
CLAIM "x * (x * x ^ (4*m)) = (x ^ (4*m)) * (x * (x::real))"] |
|
12196 | 1612 |
delsimps [fact_Suc])); |
14288 | 1613 |
by (subgoal_tac "0 < x ^ (4 * m)" 1); |
1614 |
by (asm_simp_tac (simpset() addsimps [realpow_gt_zero]) 2); |
|
1615 |
by (asm_simp_tac (simpset() addsimps [mult_less_cancel_left]) 1); |
|
12196 | 1616 |
by (rtac real_mult_less_mono 1); |
1617 |
by (ALLGOALS(Asm_simp_tac)); |
|
1618 |
by (TRYALL(rtac real_less_trans)); |
|
1619 |
by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc] delsimps [fact_Suc])); |
|
1620 |
by (res_inst_tac [("y","0")] order_less_le_trans 1); |
|
1621 |
by (ALLGOALS(Asm_simp_tac)); |
|
1622 |
qed "sin_gt_zero"; |
|
1623 |
||
1624 |
Goal "[|0 < x; x < 2 |] ==> 0 < sin x"; |
|
1625 |
by (auto_tac (claset() addIs [sin_gt_zero],simpset())); |
|
1626 |
qed "sin_gt_zero1"; |
|
1627 |
||
1628 |
Goal "[| 0 < x; x < 2 |] ==> cos (2 * x) < 1"; |
|
1629 |
by (auto_tac (claset(),simpset() addsimps [cos_squared_eq, |
|
1630 |
real_minus_add_distrib RS sym, real_minus_zero_less_iff2,sin_gt_zero1, |
|
1631 |
real_add_order,realpow_gt_zero,cos_double] delsimps |
|
1632 |
[realpow_Suc,real_minus_add_distrib])); |
|
1633 |
qed "cos_double_less_one"; |
|
1634 |
||
1635 |
Goal "(%n. (- 1) ^ n /(real (fact (2 * n))) * x ^ (2 * n)) \ |
|
1636 |
\ sums cos x"; |
|
1637 |
by (cut_inst_tac [("x2","x")] (CLAIM "0 < (2::nat)" RS ((cos_converges |
|
1638 |
RS sums_summable) RS sums_group)) 1); |
|
1639 |
by (auto_tac (claset(),simpset() addsimps mult_ac@[cos_def])); |
|
1640 |
qed "cos_paired"; |
|
1641 |
||
1642 |
Addsimps [realpow_gt_zero]; |
|
1643 |
||
1644 |
Goal "cos (2) < 0"; |
|
1645 |
by (cut_inst_tac [("x","2")] cos_paired 1); |
|
1646 |
by (dtac sums_minus 1); |
|
1647 |
by (rtac (CLAIM "- x < -y ==> (y::real) < x") 1); |
|
1648 |
by (ftac sums_unique 1 THEN Auto_tac); |
|
1649 |
by (res_inst_tac [("R2.0", |
|
1650 |
"sumr 0 (Suc (Suc (Suc 0))) (%n. -((- 1) ^ n /(real (fact(2 * n))) \ |
|
1651 |
\ * 2 ^ (2 * n)))")] real_less_trans 1); |
|
1652 |
by (simp_tac (simpset() addsimps [fact_num_eq_if,realpow_num_eq_if] |
|
1653 |
delsimps [fact_Suc,realpow_Suc]) 1); |
|
1654 |
by (simp_tac (simpset() addsimps [real_mult_assoc] |
|
1655 |
delsimps [sumr_Suc]) 1); |
|
1656 |
by (rtac sumr_pos_lt_pair 1); |
|
1657 |
by (etac sums_summable 1); |
|
1658 |
by (Step_tac 1); |
|
1659 |
by (simp_tac (simpset() addsimps [real_divide_def,real_mult_assoc RS sym] |
|
1660 |
delsimps [fact_Suc]) 1); |
|
1661 |
by (rtac real_mult_inverse_cancel2 1); |
|
1662 |
by (TRYALL(rtac (real_of_nat_fact_gt_zero))); |
|
1663 |
by (simp_tac (simpset() addsimps [real_mult_assoc RS sym] |
|
1664 |
delsimps [fact_Suc]) 1); |
|
1665 |
by (rtac ((CLAIM "real(n::nat) * 4 = real(4 * n)") RS ssubst) 1); |
|
12486 | 1666 |
by (stac fact_Suc 1); |
1667 |
by (stac real_of_nat_mult 1); |
|
1668 |
by (stac real_of_nat_mult 1); |
|
12196 | 1669 |
by (rtac real_mult_less_mono 1); |
1670 |
by (Force_tac 1); |
|
1671 |
by (Force_tac 2); |
|
1672 |
by (rtac real_of_nat_fact_gt_zero 2); |
|
1673 |
by (rtac (real_of_nat_less_iff RS iffD2) 1); |
|
1674 |
by (rtac fact_less_mono 1); |
|
1675 |
by Auto_tac; |
|
1676 |
qed "cos_two_less_zero"; |
|
1677 |
Addsimps [cos_two_less_zero]; |
|
1678 |
Addsimps [cos_two_less_zero RS real_not_refl2]; |
|
1679 |
Addsimps [cos_two_less_zero RS order_less_imp_le]; |
|
1680 |
||
1681 |
Goal "EX! x. 0 <= x & x <= 2 & cos x = 0"; |
|
1682 |
by (subgoal_tac "EX x. 0 <= x & x <= 2 & cos x = 0" 1); |
|
1683 |
by (rtac IVT2 2); |
|
1684 |
by (auto_tac (claset() addIs [DERIV_isCont,DERIV_cos],simpset ())); |
|
14269 | 1685 |
by (cut_inst_tac [("x","xa"),("y","y")] linorder_less_linear 1); |
12196 | 1686 |
by (rtac ccontr 1); |
1687 |
by (subgoal_tac "(ALL x. cos differentiable x) & \ |
|
1688 |
\ (ALL x. isCont cos x)" 1); |
|
1689 |
by (auto_tac (claset() addIs [DERIV_cos,DERIV_isCont],simpset() |
|
1690 |
addsimps [differentiable_def])); |
|
1691 |
by (dres_inst_tac [("f","cos")] Rolle 1); |
|
1692 |
by (dres_inst_tac [("f","cos")] Rolle 5); |
|
1693 |
by (auto_tac (claset() addSDs [DERIV_cos RS DERIV_unique], |
|
1694 |
simpset() addsimps [differentiable_def])); |
|
1695 |
by (dres_inst_tac [("y1","xa")] (order_le_less_trans RS sin_gt_zero) 1); |
|
1696 |
by (assume_tac 1 THEN rtac order_less_le_trans 1); |
|
1697 |
by (dres_inst_tac [("y1","y")] (order_le_less_trans RS sin_gt_zero) 4); |
|
1698 |
by (assume_tac 4 THEN rtac order_less_le_trans 4); |
|
1699 |
by (assume_tac 1 THEN assume_tac 3); |
|
1700 |
by (ALLGOALS (Asm_full_simp_tac)); |
|
1701 |
qed "cos_is_zero"; |
|
1702 |
||
1703 |
Goalw [pi_def] "pi/2 = (@x. 0 <= x & x <= 2 & cos x = 0)"; |
|
1704 |
by Auto_tac; |
|
1705 |
qed "pi_half"; |
|
1706 |
||
1707 |
Goal "cos (pi / 2) = 0"; |
|
1708 |
by (rtac (cos_is_zero RS ex1E) 1); |
|
1709 |
by (auto_tac (claset() addSIs [someI2], |
|
1710 |
simpset() addsimps [pi_half])); |
|
1711 |
qed "cos_pi_half"; |
|
1712 |
Addsimps [cos_pi_half]; |
|
1713 |
||
1714 |
Goal "0 < pi / 2"; |
|
1715 |
by (rtac (cos_is_zero RS ex1E) 1); |
|
1716 |
by (auto_tac (claset(),simpset() addsimps [pi_half])); |
|
1717 |
by (rtac someI2 1); |
|
1718 |
by (Blast_tac 1); |
|
1719 |
by (Step_tac 1); |
|
1720 |
by (dres_inst_tac [("y","xa")] real_le_imp_less_or_eq 1); |
|
1721 |
by (Step_tac 1 THEN Asm_full_simp_tac 1); |
|
1722 |
qed "pi_half_gt_zero"; |
|
1723 |
Addsimps [pi_half_gt_zero]; |
|
1724 |
Addsimps [(pi_half_gt_zero RS real_not_refl2) RS not_sym]; |
|
1725 |
Addsimps [pi_half_gt_zero RS order_less_imp_le]; |
|
1726 |
||
1727 |
Goal "pi / 2 < 2"; |
|
1728 |
by (rtac (cos_is_zero RS ex1E) 1); |
|
1729 |
by (auto_tac (claset(),simpset() addsimps [pi_half])); |
|
1730 |
by (rtac someI2 1); |
|
1731 |
by (Blast_tac 1); |
|
1732 |
by (Step_tac 1); |
|
1733 |
by (dres_inst_tac [("x","xa")] order_le_imp_less_or_eq 1); |
|
1734 |
by (Step_tac 1 THEN Asm_full_simp_tac 1); |
|
1735 |
qed "pi_half_less_two"; |
|
1736 |
Addsimps [pi_half_less_two]; |
|
1737 |
Addsimps [pi_half_less_two RS real_not_refl2]; |
|
1738 |
Addsimps [pi_half_less_two RS order_less_imp_le]; |
|
1739 |
||
1740 |
Goal "0 < pi"; |
|
1741 |
by (multr_by_tac "inverse 2" 1); |
|
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1742 |
by (Simp_tac 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1743 |
by (cut_facts_tac [pi_half_gt_zero] 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1744 |
by (full_simp_tac (HOL_ss addsimps [thm"mult_left_zero", real_divide_def]) 1); |
12196 | 1745 |
qed "pi_gt_zero"; |
1746 |
Addsimps [pi_gt_zero]; |
|
1747 |
Addsimps [(pi_gt_zero RS real_not_refl2) RS not_sym]; |
|
1748 |
Addsimps [pi_gt_zero RS CLAIM "(x::real) < y ==> ~ y < x"]; |
|
1749 |
||
1750 |
Goal "0 <= pi"; |
|
1751 |
by (auto_tac (claset() addIs [order_less_imp_le],simpset())); |
|
1752 |
qed "pi_ge_zero"; |
|
1753 |
Addsimps [pi_ge_zero]; |
|
1754 |
||
1755 |
Goal "-(pi/2) < 0"; |
|
1756 |
by Auto_tac; |
|
1757 |
qed "minus_pi_half_less_zero"; |
|
1758 |
Addsimps [minus_pi_half_less_zero]; |
|
1759 |
||
1760 |
Goal "sin(pi/2) = 1"; |
|
1761 |
by (cut_inst_tac [("x","pi/2")] sin_cos_squared_add2 1); |
|
1762 |
by (cut_facts_tac [[pi_half_gt_zero,pi_half_less_two] MRS sin_gt_zero] 1); |
|
1763 |
by (auto_tac (claset(), simpset() addsimps [numeral_2_eq_2])); |
|
1764 |
qed "sin_pi_half"; |
|
1765 |
Addsimps [sin_pi_half]; |
|
1766 |
||
1767 |
Goal "cos pi = - 1"; |
|
1768 |
by (cut_inst_tac [("x","pi/2"),("y","pi/2")] cos_add 1); |
|
1769 |
by (Asm_full_simp_tac 1); |
|
1770 |
qed "cos_pi"; |
|
1771 |
Addsimps [cos_pi]; |
|
1772 |
||
1773 |
Goal "sin pi = 0"; |
|
1774 |
by (cut_inst_tac [("x","pi/2"),("y","pi/2")] sin_add 1); |
|
1775 |
by (Asm_full_simp_tac 1); |
|
1776 |
qed "sin_pi"; |
|
1777 |
Addsimps [sin_pi]; |
|
1778 |
||
1779 |
Goalw [real_diff_def] "sin x = cos (pi/2 - x)"; |
|
1780 |
by (simp_tac (simpset() addsimps [cos_add]) 1); |
|
1781 |
qed "sin_cos_eq"; |
|
1782 |
||
1783 |
Goal "-sin x = cos (x + pi/2)"; |
|
1784 |
by (simp_tac (simpset() addsimps [cos_add]) 1); |
|
1785 |
qed "minus_sin_cos_eq"; |
|
1786 |
Addsimps [minus_sin_cos_eq RS sym]; |
|
1787 |
||
1788 |
Goalw [real_diff_def] "cos x = sin (pi/2 - x)"; |
|
1789 |
by (simp_tac (simpset() addsimps [sin_add]) 1); |
|
1790 |
qed "cos_sin_eq"; |
|
1791 |
Addsimps [sin_cos_eq RS sym, cos_sin_eq RS sym]; |
|
1792 |
||
1793 |
Goal "sin (x + pi) = - sin x"; |
|
1794 |
by (simp_tac (simpset() addsimps [sin_add]) 1); |
|
1795 |
qed "sin_periodic_pi"; |
|
1796 |
Addsimps [sin_periodic_pi]; |
|
1797 |
||
1798 |
Goal "sin (pi + x) = - sin x"; |
|
1799 |
by (simp_tac (simpset() addsimps [sin_add]) 1); |
|
1800 |
qed "sin_periodic_pi2"; |
|
1801 |
Addsimps [sin_periodic_pi2]; |
|
1802 |
||
1803 |
Goal "cos (x + pi) = - cos x"; |
|
1804 |
by (simp_tac (simpset() addsimps [cos_add]) 1); |
|
1805 |
qed "cos_periodic_pi"; |
|
1806 |
Addsimps [cos_periodic_pi]; |
|
1807 |
||
1808 |
Goal "sin (x + 2*pi) = sin x"; |
|
1809 |
by (simp_tac (simpset() addsimps [sin_add,cos_double,numeral_2_eq_2]) 1); |
|
1810 |
(*FIXME: just needs x^n for literals!*) |
|
1811 |
qed "sin_periodic"; |
|
1812 |
Addsimps [sin_periodic]; |
|
1813 |
||
1814 |
Goal "cos (x + 2*pi) = cos x"; |
|
1815 |
by (simp_tac (simpset() addsimps [cos_add,cos_double,numeral_2_eq_2]) 1); |
|
1816 |
(*FIXME: just needs x^n for literals!*) |
|
1817 |
qed "cos_periodic"; |
|
1818 |
Addsimps [cos_periodic]; |
|
1819 |
||
1820 |
Goal "cos (real n * pi) = (-(1::real)) ^ n"; |
|
1821 |
by (induct_tac "n" 1); |
|
1822 |
by (auto_tac (claset(),simpset() addsimps |
|
1823 |
[real_of_nat_Suc,real_add_mult_distrib])); |
|
1824 |
qed "cos_npi"; |
|
1825 |
Addsimps [cos_npi]; |
|
1826 |
||
1827 |
Goal "sin (real (n::nat) * pi) = 0"; |
|
1828 |
by (induct_tac "n" 1); |
|
1829 |
by (auto_tac (claset(),simpset() addsimps |
|
1830 |
[real_of_nat_Suc,real_add_mult_distrib])); |
|
1831 |
qed "sin_npi"; |
|
1832 |
Addsimps [sin_npi]; |
|
1833 |
||
1834 |
Goal "sin (pi * real (n::nat)) = 0"; |
|
1835 |
by (cut_inst_tac [("n","n")] sin_npi 1); |
|
1836 |
by (auto_tac (claset(),simpset() addsimps [real_mult_commute] |
|
1837 |
delsimps [sin_npi])); |
|
1838 |
qed "sin_npi2"; |
|
1839 |
Addsimps [sin_npi2]; |
|
1840 |
||
1841 |
Goal "cos (2 * pi) = 1"; |
|
1842 |
by (simp_tac (simpset() addsimps [cos_double,numeral_2_eq_2]) 1); |
|
1843 |
(*FIXME: just needs x^n for literals!*) |
|
1844 |
qed "cos_two_pi"; |
|
1845 |
Addsimps [cos_two_pi]; |
|
1846 |
||
1847 |
Goal "sin (2 * pi) = 0"; |
|
1848 |
by (Simp_tac 1); |
|
1849 |
qed "sin_two_pi"; |
|
1850 |
Addsimps [sin_two_pi]; |
|
1851 |
||
1852 |
Goal "[| 0 < x; x < pi/2 |] ==> 0 < sin x"; |
|
1853 |
by (rtac sin_gt_zero 1); |
|
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1854 |
by (assume_tac 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1855 |
by (rtac real_less_trans 1 THEN assume_tac 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1856 |
by (rtac pi_half_less_two 1); |
12196 | 1857 |
qed "sin_gt_zero2"; |
1858 |
||
1859 |
Goal "[| - pi/2 < x; x < 0 |] ==> sin x < 0"; |
|
1860 |
by (rtac (CLAIM "(0::real) < - x ==> x < 0") 1); |
|
1861 |
by (rtac (sin_minus RS subst) 1); |
|
1862 |
by (rtac sin_gt_zero2 1); |
|
1863 |
by (rtac (CLAIM "-y < x ==> -x < (y::real)") 2); |
|
1864 |
by Auto_tac; |
|
1865 |
qed "sin_less_zero"; |
|
1866 |
||
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1867 |
Goal "pi < 4"; |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1868 |
by (cut_facts_tac [pi_half_less_two] 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1869 |
by Auto_tac; |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1870 |
qed "pi_less_4"; |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1871 |
|
12196 | 1872 |
Goal "[| 0 < x; x < pi/2 |] ==> 0 < cos x"; |
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1873 |
by (cut_facts_tac [pi_less_4] 1); |
12196 | 1874 |
by (cut_inst_tac [("f","cos"),("a","0"),("b","x"),("y","0")] IVT2_objl 1); |
1875 |
by (Step_tac 1); |
|
1876 |
by (cut_facts_tac [cos_is_zero] 5); |
|
1877 |
by (Step_tac 5); |
|
1878 |
by (dres_inst_tac [("x","xa")] spec 5); |
|
1879 |
by (dres_inst_tac [("x","pi/2")] spec 5); |
|
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1880 |
by (force_tac (claset(), simpset() addsimps []) 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1881 |
by (force_tac (claset(), simpset() addsimps []) 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
1882 |
by (force_tac (claset(), simpset() addsimps []) 1); |
12196 | 1883 |
by (auto_tac (claset() addSDs [ pi_half_less_two RS order_less_trans, |
1884 |
CLAIM "~ m <= n ==> n < (m::real)"] |
|
1885 |
addIs [DERIV_isCont,DERIV_cos],simpset())); |
|
1886 |
qed "cos_gt_zero"; |
|
1887 |
||
1888 |
Goal "[| -(pi/2) < x; x < pi/2 |] ==> 0 < cos x"; |
|
1889 |
by (res_inst_tac [("R1.0","x"),("R2.0","0")] real_linear_less2 1); |
|
1890 |
by (rtac (cos_minus RS subst) 1); |
|
1891 |
by (rtac cos_gt_zero 1); |
|
1892 |
by (rtac (CLAIM "-y < x ==> -x < (y::real)") 2); |
|
1893 |
by (auto_tac (claset() addIs [cos_gt_zero],simpset())); |
|
1894 |
qed "cos_gt_zero_pi"; |
|
1895 |
||
1896 |
Goal "[| -(pi/2) <= x; x <= pi/2 |] ==> 0 <= cos x"; |
|
1897 |
by (auto_tac (claset(),HOL_ss addsimps [real_le_less, |
|
1898 |
cos_gt_zero_pi])); |
|
1899 |
by Auto_tac; |
|
1900 |
qed "cos_ge_zero"; |
|
1901 |
||
1902 |
Goal "[| 0 < x; x < pi |] ==> 0 < sin x"; |
|
12486 | 1903 |
by (stac sin_cos_eq 1); |
12196 | 1904 |
by (rotate_tac 1 1); |
1905 |
by (dtac (real_sum_of_halves RS ssubst) 1); |
|
1906 |
by (auto_tac (claset() addSIs [cos_gt_zero_pi], |
|
1907 |
simpset() delsimps [sin_cos_eq RS sym])); |
|
1908 |
qed "sin_gt_zero_pi"; |
|
1909 |
||
1910 |
Goal "[| 0 <= x; x <= pi |] ==> 0 <= sin x"; |
|
1911 |
by (auto_tac (claset(),simpset() addsimps [real_le_less, |
|
1912 |
sin_gt_zero_pi])); |
|
1913 |
qed "sin_ge_zero"; |
|
1914 |
||
1915 |
Goal "[| - 1 <= y; y <= 1 |] ==> EX! x. 0 <= x & x <= pi & (cos x = y)"; |
|
1916 |
by (subgoal_tac "EX x. 0 <= x & x <= pi & cos x = y" 1); |
|
1917 |
by (rtac IVT2 2); |
|
1918 |
by (auto_tac (claset() addIs [order_less_imp_le,DERIV_isCont,DERIV_cos], |
|
1919 |
simpset ())); |
|
14269 | 1920 |
by (cut_inst_tac [("x","xa"),("y","y")] linorder_less_linear 1); |
12196 | 1921 |
by (rtac ccontr 1 THEN Auto_tac); |
1922 |
by (dres_inst_tac [("f","cos")] Rolle 1); |
|
1923 |
by (dres_inst_tac [("f","cos")] Rolle 5); |
|
1924 |
by (auto_tac (claset() addIs [order_less_imp_le,DERIV_isCont,DERIV_cos] |
|
1925 |
addSDs [DERIV_cos RS DERIV_unique],simpset() addsimps [differentiable_def])); |
|
1926 |
by (auto_tac (claset() addDs [[order_le_less_trans,order_less_le_trans] MRS |
|
1927 |
sin_gt_zero_pi],simpset())); |
|
1928 |
qed "cos_total"; |
|
1929 |
||
1930 |
Goal "[| - 1 <= y; y <= 1 |] ==> \ |
|
1931 |
\ EX! x. -(pi/2) <= x & x <= pi/2 & (sin x = y)"; |
|
1932 |
by (rtac ccontr 1); |
|
1933 |
by (subgoal_tac "ALL x. (-(pi/2) <= x & x <= pi/2 & (sin x = y)) \ |
|
1934 |
\ = (0 <= (x + pi/2) & (x + pi/2) <= pi & \ |
|
1935 |
\ (cos(x + pi/2) = -y))" 1); |
|
1936 |
by (etac swap 1); |
|
1937 |
by (asm_full_simp_tac (simpset() delsimps [minus_sin_cos_eq RS sym]) 1); |
|
1938 |
by (dtac (CLAIM "(x::real) <= y ==> -y <= -x") 1); |
|
1939 |
by (dtac (CLAIM "(x::real) <= y ==> -y <= -x") 1); |
|
1940 |
by (dtac cos_total 1); |
|
1941 |
by (Asm_full_simp_tac 1); |
|
1942 |
by (etac ex1E 1); |
|
1943 |
by (res_inst_tac [("a","x - (pi/2)")] ex1I 1); |
|
1944 |
by (simp_tac (simpset() addsimps [real_add_assoc]) 1); |
|
1945 |
by (rotate_tac 3 1); |
|
1946 |
by (dres_inst_tac [("x","xa + pi/2")] spec 1); |
|
1947 |
by (Step_tac 1); |
|
1948 |
by (TRYALL(Asm_full_simp_tac)); |
|
1949 |
by (auto_tac (claset(),simpset() addsimps [CLAIM "(-x <= y) = (-y <= (x::real))"])); |
|
1950 |
qed "sin_total"; |
|
1951 |
||
1952 |
Goal "(EX n. P (n::nat)) = (EX n. P n & (ALL m. m < n --> ~ P m))"; |
|
1953 |
by (rtac iffI 1); |
|
1954 |
by (rtac contrapos_pp 1 THEN assume_tac 1); |
|
1955 |
by (EVERY1[Simp_tac, rtac allI, rtac nat_less_induct]); |
|
1956 |
by (Auto_tac); |
|
1957 |
qed "less_induct_ex_iff"; |
|
1958 |
||
1959 |
Goal "[| 0 < y; 0 <= x |] ==> \ |
|
1960 |
\ EX n. real n * y <= x & x < real (Suc n) * y"; |
|
1961 |
by (auto_tac (claset() addSDs [reals_Archimedean3],simpset())); |
|
1962 |
by (dres_inst_tac [("x","x")] spec 1); |
|
1963 |
by (dtac (less_induct_ex_iff RS iffD1) 1 THEN Step_tac 1); |
|
1964 |
by (case_tac "n" 1); |
|
1965 |
by (res_inst_tac [("x","nat")] exI 2); |
|
1966 |
by Auto_tac; |
|
1967 |
qed "reals_Archimedean4"; |
|
1968 |
||
1969 |
(* Pre Isabelle99-2 proof was simpler- numerals arithmetic |
|
1970 |
now causes some unwanted re-arrangements of literals! *) |
|
1971 |
Goal "[| 0 <= x; cos x = 0 |] ==> \ |
|
1972 |
\ EX n. ~even n & x = real n * (pi/2)"; |
|
1973 |
by (dtac (pi_gt_zero RS reals_Archimedean4) 1); |
|
1974 |
by (Step_tac 1); |
|
1975 |
by (subgoal_tac |
|
1976 |
"0 <= x - real n * pi & (x - real n * pi) <= pi & \ |
|
1977 |
\ (cos(x - real n * pi) = 0)" 1); |
|
1978 |
by (Step_tac 1); |
|
1979 |
by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc, |
|
1980 |
real_add_mult_distrib]) 2); |
|
1981 |
by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 1); |
|
1982 |
by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 2); |
|
1983 |
by (subgoal_tac "EX! x. 0 <= x & x <= pi & cos x = 0" 1); |
|
1984 |
by (rtac cos_total 2); |
|
1985 |
by (Step_tac 1); |
|
1986 |
by (dres_inst_tac [("x","x - real n * pi")] spec 1); |
|
1987 |
by (dres_inst_tac [("x","pi/2")] spec 1); |
|
1988 |
by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 1); |
|
1989 |
by (res_inst_tac [("x","Suc (2 * n)")] exI 1); |
|
1990 |
by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc, |
|
1991 |
real_add_mult_distrib]) 1); |
|
1992 |
by Auto_tac; |
|
1993 |
qed "cos_zero_lemma"; |
|
1994 |
||
1995 |
Goal "[| 0 <= x; sin x = 0 |] ==> \ |
|
1996 |
\ EX n. even n & x = real n * (pi/2)"; |
|
1997 |
by (subgoal_tac |
|
1998 |
"EX n. ~ even n & x + pi/2 = real n * (pi/2)" 1); |
|
1999 |
by (rtac cos_zero_lemma 2); |
|
2000 |
by (Step_tac 1); |
|
2001 |
by (res_inst_tac [("x","n - 1")] exI 1); |
|
2002 |
by (rtac (CLAIM "-y <= x ==> -x <= (y::real)") 2); |
|
2003 |
by (rtac real_le_trans 2 THEN assume_tac 3); |
|
2004 |
by (auto_tac (claset(),simpset() addsimps [odd_not_even RS sym, |
|
2005 |
odd_Suc_mult_two_ex,real_of_nat_Suc, |
|
2006 |
real_add_mult_distrib,real_mult_assoc RS sym])); |
|
2007 |
qed "sin_zero_lemma"; |
|
2008 |
||
2009 |
(* also spoilt by numeral arithmetic *) |
|
2010 |
Goal "(cos x = 0) = \ |
|
2011 |
\ ((EX n. ~even n & (x = real n * (pi/2))) | \ |
|
2012 |
\ (EX n. ~even n & (x = -(real n * (pi/2)))))"; |
|
2013 |
by (rtac iffI 1); |
|
2014 |
by (cut_inst_tac [("x","x")] (CLAIM "0 <= (x::real) | x <= 0") 1); |
|
2015 |
by (Step_tac 1); |
|
2016 |
by (dtac cos_zero_lemma 1); |
|
2017 |
by (dtac (CLAIM "(x::real) <= 0 ==> 0 <= -x") 3); |
|
2018 |
by (dtac cos_zero_lemma 3); |
|
2019 |
by (Step_tac 1); |
|
2020 |
by (dtac (CLAIM "-x = y ==> x = -(y::real)") 2); |
|
2021 |
by (auto_tac (claset(),HOL_ss addsimps [odd_not_even RS sym, |
|
2022 |
odd_Suc_mult_two_ex,real_of_nat_Suc,real_add_mult_distrib])); |
|
2023 |
by (auto_tac (claset(),simpset() addsimps [cos_add])); |
|
2024 |
qed "cos_zero_iff"; |
|
2025 |
||
2026 |
(* ditto: but to a lesser extent *) |
|
2027 |
Goal "(sin x = 0) = \ |
|
2028 |
\ ((EX n. even n & (x = real n * (pi/2))) | \ |
|
2029 |
\ (EX n. even n & (x = -(real n * (pi/2)))))"; |
|
2030 |
by (rtac iffI 1); |
|
2031 |
by (cut_inst_tac [("x","x")] (CLAIM "0 <= (x::real) | x <= 0") 1); |
|
2032 |
by (Step_tac 1); |
|
2033 |
by (dtac sin_zero_lemma 1); |
|
2034 |
by (dtac (CLAIM "(x::real) <= 0 ==> 0 <= -x") 3); |
|
2035 |
by (dtac sin_zero_lemma 3); |
|
2036 |
by (Step_tac 1); |
|
2037 |
by (dtac (CLAIM "-x = y ==> x = -(y::real)") 2); |
|
2038 |
by (auto_tac (claset(),simpset() addsimps [even_mult_two_ex])); |
|
2039 |
qed "sin_zero_iff"; |
|
2040 |
||
2041 |
(* ------------------------------------------------------------------------ *) |
|
2042 |
(* Tangent *) |
|
2043 |
(* ------------------------------------------------------------------------ *) |
|
2044 |
||
2045 |
Goalw [tan_def] "tan 0 = 0"; |
|
2046 |
by (Simp_tac 1); |
|
2047 |
qed "tan_zero"; |
|
2048 |
Addsimps [tan_zero]; |
|
2049 |
||
2050 |
Goalw [tan_def] "tan pi = 0"; |
|
2051 |
by (Simp_tac 1); |
|
2052 |
qed "tan_pi"; |
|
2053 |
Addsimps [tan_pi]; |
|
2054 |
||
2055 |
Goalw [tan_def] "tan (real (n::nat) * pi) = 0"; |
|
2056 |
by (Simp_tac 1); |
|
2057 |
qed "tan_npi"; |
|
2058 |
Addsimps [tan_npi]; |
|
2059 |
||
2060 |
Goalw [tan_def] "tan (-x) = - tan x"; |
|
2061 |
by (simp_tac (simpset() addsimps [real_minus_mult_eq1]) 1); |
|
2062 |
qed "tan_minus"; |
|
2063 |
Addsimps [tan_minus]; |
|
2064 |
||
2065 |
Goalw [tan_def] "tan (x + 2*pi) = tan x"; |
|
2066 |
by (Simp_tac 1); |
|
2067 |
qed "tan_periodic"; |
|
2068 |
Addsimps [tan_periodic]; |
|
2069 |
||
2070 |
Goalw [tan_def,real_divide_def] |
|
2071 |
"[| cos x ~= 0; cos y ~= 0 |] \ |
|
2072 |
\ ==> 1 - tan(x)*tan(y) = cos (x + y)/(cos x * cos y)"; |
|
14270 | 2073 |
by (auto_tac (claset(), |
2074 |
simpset() delsimps [thm"Ring_and_Field.inverse_mult_distrib"] |
|
2075 |
addsimps [real_inverse_distrib RS sym] @ real_mult_ac)); |
|
12196 | 2076 |
by (res_inst_tac [("c1","cos x * cos y")] (real_mult_right_cancel RS subst) 1); |
14270 | 2077 |
by (auto_tac (claset(), |
2078 |
simpset() delsimps [thm"Ring_and_Field.inverse_mult_distrib"] |
|
2079 |
addsimps [real_mult_assoc, |
|
12196 | 2080 |
real_mult_not_zero,real_diff_mult_distrib,cos_add])); |
2081 |
val lemma_tan_add1 = result(); |
|
2082 |
Addsimps [lemma_tan_add1]; |
|
2083 |
||
2084 |
Goalw [tan_def] |
|
2085 |
"[| cos x ~= 0; cos y ~= 0 |] \ |
|
2086 |
\ ==> tan x + tan y = sin(x + y)/(cos x * cos y)"; |
|
2087 |
by (res_inst_tac [("c1","cos x * cos y")] (real_mult_right_cancel RS subst) 1); |
|
2088 |
by (auto_tac (claset(), simpset() addsimps [real_mult_assoc, |
|
2089 |
real_mult_not_zero,real_add_mult_distrib])); |
|
2090 |
by (simp_tac (simpset() addsimps [sin_add]) 1); |
|
2091 |
qed "add_tan_eq"; |
|
2092 |
||
2093 |
Goal "[| cos x ~= 0; cos y ~= 0; cos (x + y) ~= 0 |] \ |
|
2094 |
\ ==> tan(x + y) = (tan(x) + tan(y))/(1 - tan(x) * tan(y))"; |
|
2095 |
by (asm_simp_tac (simpset() addsimps [add_tan_eq]) 1); |
|
2096 |
by (simp_tac (simpset() addsimps [tan_def]) 1); |
|
2097 |
qed "tan_add"; |
|
2098 |
||
2099 |
Goal "[| cos x ~= 0; cos (2 * x) ~= 0 |] \ |
|
2100 |
\ ==> tan (2 * x) = (2 * tan x)/(1 - (tan(x) ^ 2))"; |
|
2101 |
by (auto_tac (claset(),simpset() addsimps [asm_full_simplify |
|
2102 |
(simpset() addsimps [real_mult_2 RS sym] delsimps [lemma_tan_add1]) |
|
2103 |
(read_instantiate [("x","x"),("y","x")] tan_add),numeral_2_eq_2] |
|
2104 |
delsimps [lemma_tan_add1])); |
|
2105 |
qed "tan_double"; |
|
2106 |
||
2107 |
Goalw [tan_def,real_divide_def] "[| 0 < x; x < pi/2 |] ==> 0 < tan x"; |
|
2108 |
by (auto_tac (claset() addSIs [sin_gt_zero2,cos_gt_zero_pi] |
|
2109 |
addSIs [real_mult_order, |
|
2110 |
real_inverse_gt_0],simpset())); |
|
2111 |
qed "tan_gt_zero"; |
|
2112 |
||
2113 |
Goal "[| - pi/2 < x; x < 0 |] ==> tan x < 0"; |
|
2114 |
by (rtac (CLAIM "(0::real) < - x ==> x < 0") 1); |
|
2115 |
by (rtac (tan_minus RS subst) 1); |
|
2116 |
by (rtac tan_gt_zero 1); |
|
2117 |
by (rtac (CLAIM "-x < y ==> -y < (x::real)") 2 THEN Auto_tac); |
|
2118 |
qed "tan_less_zero"; |
|
2119 |
||
2120 |
Goal "cos x ~= 0 ==> DERIV (%x. sin(x)/cos(x)) x :> inverse(cos x ^ 2)"; |
|
2121 |
by (rtac lemma_DERIV_subst 1); |
|
2122 |
by DERIV_tac; |
|
2123 |
by (auto_tac (claset(),simpset() addsimps [real_divide_def,numeral_2_eq_2])); |
|
2124 |
qed "lemma_DERIV_tan"; |
|
2125 |
||
2126 |
Goal "cos x ~= 0 ==> DERIV tan x :> inverse(cos(x) ^ 2)"; |
|
2127 |
by (auto_tac (claset() addDs [lemma_DERIV_tan],simpset() |
|
2128 |
addsimps [(tan_def RS meta_eq_to_obj_eq) RS sym])); |
|
2129 |
qed "DERIV_tan"; |
|
2130 |
Addsimps [DERIV_tan]; |
|
2131 |
||
2132 |
Goalw [real_divide_def] |
|
2133 |
"(%x. cos(x)/sin(x)) -- pi/2 --> 0"; |
|
2134 |
by (res_inst_tac [("z1","1")] ((real_mult_0) RS subst) 1); |
|
2135 |
by (rtac LIM_mult2 1); |
|
2136 |
by (rtac ((real_inverse_1) RS subst) 2); |
|
2137 |
by (rtac LIM_inverse 2); |
|
2138 |
by (fold_tac [real_divide_def]); |
|
2139 |
by (auto_tac (claset() addSIs [DERIV_isCont],simpset() |
|
2140 |
addsimps [(isCont_def RS meta_eq_to_obj_eq) |
|
2141 |
RS sym, cos_pi_half RS sym, sin_pi_half RS sym] |
|
2142 |
delsimps [cos_pi_half,sin_pi_half])); |
|
2143 |
by (DERIV_tac THEN Auto_tac); |
|
2144 |
qed "LIM_cos_div_sin"; |
|
2145 |
Addsimps [LIM_cos_div_sin]; |
|
2146 |
||
2147 |
Goal "0 < y ==> EX x. 0 < x & x < pi/2 & y < tan x"; |
|
2148 |
by (cut_facts_tac [LIM_cos_div_sin] 1); |
|
2149 |
by (asm_full_simp_tac (HOL_ss addsimps [LIM_def]) 1); |
|
2150 |
by (dres_inst_tac [("x","inverse y")] spec 1); |
|
2151 |
by (Step_tac 1); |
|
2152 |
by (Force_tac 1); |
|
2153 |
by (dres_inst_tac [("d1.0","s")] |
|
2154 |
(pi_half_gt_zero RSN (2,real_lbound_gt_zero)) 1); |
|
2155 |
by (Step_tac 1); |
|
2156 |
by (res_inst_tac [("x","(pi/2) - e")] exI 1); |
|
2157 |
by (Asm_simp_tac 1); |
|
2158 |
by (dres_inst_tac [("x","(pi/2) - e")] spec 1); |
|
2159 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI2,tan_def])); |
|
2160 |
by (rtac (real_inverse_less_iff RS iffD1) 1); |
|
2161 |
by (auto_tac (claset(),simpset() addsimps [real_divide_def])); |
|
2162 |
by (rtac (real_mult_order) 1); |
|
2163 |
by (subgoal_tac "0 < sin e" 3); |
|
2164 |
by (subgoal_tac "0 < cos e" 3); |
|
2165 |
by (auto_tac (claset() addIs [cos_gt_zero,sin_gt_zero2],simpset() |
|
2166 |
addsimps [real_inverse_distrib,abs_mult])); |
|
2167 |
by (dres_inst_tac [("x","cos e")] (real_inverse_gt_0) 1); |
|
2168 |
by (dres_inst_tac [("x","inverse (cos e)")] abs_eqI2 1); |
|
2169 |
by (auto_tac (claset() addSDs [abs_eqI2],simpset() addsimps real_mult_ac)); |
|
2170 |
qed "lemma_tan_total"; |
|
2171 |
||
2172 |
||
2173 |
Goal "0 <= y ==> EX x. 0 <= x & x < pi/2 & tan x = y"; |
|
2174 |
by (ftac real_le_imp_less_or_eq 1); |
|
2175 |
by (Step_tac 1 THEN Force_tac 2); |
|
2176 |
by (dtac lemma_tan_total 1 THEN Step_tac 1); |
|
2177 |
by (cut_inst_tac [("f","tan"),("a","0"),("b","x"),("y","y")] IVT_objl 1); |
|
2178 |
by (auto_tac (claset() addSIs [DERIV_tan RS DERIV_isCont],simpset())); |
|
2179 |
by (dres_inst_tac [("y","xa")] order_le_imp_less_or_eq 1); |
|
2180 |
by (auto_tac (claset() addDs [cos_gt_zero],simpset())); |
|
2181 |
qed "tan_total_pos"; |
|
2182 |
||
2183 |
Goal "EX x. -(pi/2) < x & x < (pi/2) & tan x = y"; |
|
2184 |
by (cut_inst_tac [("y","y")] (CLAIM "0 <= (y::real) | 0 <= -y") 1); |
|
2185 |
by (Step_tac 1); |
|
2186 |
by (dtac tan_total_pos 1); |
|
2187 |
by (dtac tan_total_pos 2); |
|
2188 |
by (Step_tac 1); |
|
2189 |
by (res_inst_tac [("x","-x")] exI 2); |
|
2190 |
by (auto_tac (claset() addSIs [exI],simpset())); |
|
2191 |
qed "lemma_tan_total1"; |
|
2192 |
||
2193 |
Goal "EX! x. -(pi/2) < x & x < (pi/2) & tan x = y"; |
|
2194 |
by (cut_inst_tac [("y","y")] lemma_tan_total1 1); |
|
2195 |
by (Auto_tac); |
|
14269 | 2196 |
by (cut_inst_tac [("x","xa"),("y","y")] linorder_less_linear 1); |
12196 | 2197 |
by (Auto_tac); |
2198 |
by (subgoal_tac "EX z. xa < z & z < y & DERIV tan z :> 0" 1); |
|
2199 |
by (subgoal_tac "EX z. y < z & z < xa & DERIV tan z :> 0" 3); |
|
2200 |
by (rtac Rolle 2); |
|
2201 |
by (rtac Rolle 7); |
|
2202 |
by (auto_tac (claset() addSIs [DERIV_tan,DERIV_isCont,exI],simpset() |
|
2203 |
addsimps [differentiable_def])); |
|
2204 |
by (TRYALL(rtac DERIV_tan)); |
|
2205 |
by (TRYALL(dtac (DERIV_tan RSN (2,DERIV_unique)))); |
|
2206 |
by (TRYALL(rtac (real_not_refl2 RS not_sym))); |
|
2207 |
by (auto_tac (claset() addSIs [cos_gt_zero_pi],simpset())); |
|
2208 |
by (ALLGOALS(subgoal_tac "0 < cos z")); |
|
2209 |
by (Force_tac 1 THEN Force_tac 2); |
|
2210 |
by (ALLGOALS(thin_tac "cos z = 0")); |
|
2211 |
by (auto_tac (claset() addSIs [cos_gt_zero_pi],simpset())); |
|
2212 |
qed "tan_total"; |
|
2213 |
||
2214 |
Goal "[| - 1 <= y; y <= 1 |] \ |
|
2215 |
\ ==> -(pi/2) <= arcsin y & arcsin y <= pi & sin(arcsin y) = y"; |
|
2216 |
by (dtac sin_total 1); |
|
2217 |
by (etac ex1E 2); |
|
2218 |
by (rewtac arcsin_def); |
|
2219 |
by (rtac someI2 2); |
|
2220 |
by (EVERY1[assume_tac, Blast_tac, Step_tac]); |
|
2221 |
by (rtac real_le_trans 1 THEN assume_tac 1); |
|
2222 |
by (Force_tac 1); |
|
2223 |
qed "arcsin_pi"; |
|
2224 |
||
2225 |
Goal "[| - 1 <= y; y <= 1 |] \ |
|
2226 |
\ ==> -(pi/2) <= arcsin y & \ |
|
2227 |
\ arcsin y <= pi/2 & sin(arcsin y) = y"; |
|
2228 |
by (dtac sin_total 1 THEN assume_tac 1); |
|
2229 |
by (etac ex1E 1); |
|
2230 |
by (rewtac arcsin_def); |
|
2231 |
by (rtac someI2 1); |
|
2232 |
by (ALLGOALS(Blast_tac)); |
|
2233 |
qed "arcsin"; |
|
2234 |
||
2235 |
Goal "[| - 1 <= y; y <= 1 |] ==> sin(arcsin y) = y"; |
|
2236 |
by (blast_tac (claset() addDs [arcsin]) 1); |
|
2237 |
qed "sin_arcsin"; |
|
2238 |
Addsimps [sin_arcsin]; |
|
2239 |
||
2240 |
Goal "[| -1 <= y; y <= 1 |] ==> sin(arcsin y) = y"; |
|
2241 |
by (auto_tac (claset() addIs [sin_arcsin],simpset())); |
|
2242 |
qed "sin_arcsin2"; |
|
2243 |
Addsimps [sin_arcsin2]; |
|
2244 |
||
2245 |
Goal "[| - 1 <= y; y <= 1 |] \ |
|
2246 |
\ ==> -(pi/2) <= arcsin y & arcsin y <= pi/2"; |
|
2247 |
by (blast_tac (claset() addDs [arcsin]) 1); |
|
2248 |
qed "arcsin_bounded"; |
|
2249 |
||
2250 |
Goal "[| - 1 <= y; y <= 1 |] ==> -(pi/2) <= arcsin y"; |
|
2251 |
by (blast_tac (claset() addDs [arcsin]) 1); |
|
2252 |
qed "arcsin_lbound"; |
|
2253 |
||
2254 |
Goal "[| - 1 <= y; y <= 1 |] ==> arcsin y <= pi/2"; |
|
2255 |
by (blast_tac (claset() addDs [arcsin]) 1); |
|
2256 |
qed "arcsin_ubound"; |
|
2257 |
||
2258 |
Goal "[| - 1 < y; y < 1 |] \ |
|
2259 |
\ ==> -(pi/2) < arcsin y & arcsin y < pi/2"; |
|
2260 |
by (ftac order_less_imp_le 1); |
|
2261 |
by (forw_inst_tac [("y","y")] order_less_imp_le 1); |
|
2262 |
by (ftac arcsin_bounded 1); |
|
2263 |
by (Step_tac 1 THEN Asm_full_simp_tac 1); |
|
2264 |
by (dres_inst_tac [("y","arcsin y")] order_le_imp_less_or_eq 1); |
|
2265 |
by (dres_inst_tac [("y","pi/2")] order_le_imp_less_or_eq 2); |
|
2266 |
by (Step_tac 1); |
|
2267 |
by (ALLGOALS(dres_inst_tac [("f","sin")] arg_cong)); |
|
2268 |
by (Auto_tac); |
|
2269 |
qed "arcsin_lt_bounded"; |
|
2270 |
||
2271 |
Goalw [arcsin_def] |
|
2272 |
"[|-(pi/2) <= x; x <= pi/2 |] ==> arcsin(sin x) = x"; |
|
2273 |
by (rtac some1_equality 1); |
|
2274 |
by (rtac sin_total 1); |
|
2275 |
by Auto_tac; |
|
2276 |
qed "arcsin_sin"; |
|
2277 |
||
2278 |
Goal "[| - 1 <= y; y <= 1 |] \ |
|
2279 |
\ ==> 0 <= arcos y & arcos y <= pi & cos(arcos y) = y"; |
|
2280 |
by (dtac cos_total 1 THEN assume_tac 1); |
|
2281 |
by (etac ex1E 1); |
|
2282 |
by (rewtac arcos_def); |
|
2283 |
by (rtac someI2 1); |
|
2284 |
by (ALLGOALS(Blast_tac)); |
|
2285 |
qed "arcos"; |
|
2286 |
||
2287 |
Goal "[| - 1 <= y; y <= 1 |] ==> cos(arcos y) = y"; |
|
2288 |
by (blast_tac (claset() addDs [arcos]) 1); |
|
2289 |
qed "cos_arcos"; |
|
2290 |
Addsimps [cos_arcos]; |
|
2291 |
||
2292 |
Goal "[| -1 <= y; y <= 1 |] ==> cos(arcos y) = y"; |
|
2293 |
by (auto_tac (claset() addIs [cos_arcos],simpset())); |
|
2294 |
qed "cos_arcos2"; |
|
2295 |
Addsimps [cos_arcos2]; |
|
2296 |
||
2297 |
Goal "[| - 1 <= y; y <= 1 |] ==> 0 <= arcos y & arcos y <= pi"; |
|
2298 |
by (blast_tac (claset() addDs [arcos]) 1); |
|
2299 |
qed "arcos_bounded"; |
|
2300 |
||
2301 |
Goal "[| - 1 <= y; y <= 1 |] ==> 0 <= arcos y"; |
|
2302 |
by (blast_tac (claset() addDs [arcos]) 1); |
|
2303 |
qed "arcos_lbound"; |
|
2304 |
||
2305 |
Goal "[| - 1 <= y; y <= 1 |] ==> arcos y <= pi"; |
|
2306 |
by (blast_tac (claset() addDs [arcos]) 1); |
|
2307 |
qed "arcos_ubound"; |
|
2308 |
||
2309 |
Goal "[| - 1 < y; y < 1 |] \ |
|
2310 |
\ ==> 0 < arcos y & arcos y < pi"; |
|
2311 |
by (ftac order_less_imp_le 1); |
|
2312 |
by (forw_inst_tac [("y","y")] order_less_imp_le 1); |
|
2313 |
by (ftac arcos_bounded 1); |
|
2314 |
by (Auto_tac); |
|
2315 |
by (dres_inst_tac [("y","arcos y")] order_le_imp_less_or_eq 1); |
|
2316 |
by (dres_inst_tac [("y","pi")] order_le_imp_less_or_eq 2); |
|
2317 |
by (Auto_tac); |
|
2318 |
by (ALLGOALS(dres_inst_tac [("f","cos")] arg_cong)); |
|
2319 |
by (Auto_tac); |
|
2320 |
qed "arcos_lt_bounded"; |
|
2321 |
||
2322 |
Goalw [arcos_def] "[|0 <= x; x <= pi |] ==> arcos(cos x) = x"; |
|
2323 |
by (auto_tac (claset() addSIs [some1_equality,cos_total],simpset())); |
|
2324 |
qed "arcos_cos"; |
|
2325 |
||
2326 |
Goalw [arcos_def] "[|x <= 0; -pi <= x |] ==> arcos(cos x) = -x"; |
|
2327 |
by (auto_tac (claset() addSIs [some1_equality,cos_total],simpset())); |
|
2328 |
qed "arcos_cos2"; |
|
2329 |
||
2330 |
Goal "- (pi/2) < arctan y & \ |
|
2331 |
\ arctan y < pi/2 & tan (arctan y) = y"; |
|
2332 |
by (cut_inst_tac [("y","y")] tan_total 1); |
|
2333 |
by (etac ex1E 1); |
|
2334 |
by (rewtac arctan_def); |
|
2335 |
by (rtac someI2 1); |
|
2336 |
by (ALLGOALS(Blast_tac)); |
|
2337 |
qed "arctan"; |
|
2338 |
Addsimps [arctan]; |
|
2339 |
||
2340 |
Goal "tan(arctan y) = y"; |
|
2341 |
by (Auto_tac); |
|
2342 |
qed "tan_arctan"; |
|
2343 |
||
2344 |
Goal "- (pi/2) < arctan y & arctan y < pi/2"; |
|
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2345 |
by (asm_full_simp_tac (HOL_ss addsimps [arctan]) 1); |
12196 | 2346 |
qed "arctan_bounded"; |
2347 |
||
2348 |
Goal "- (pi/2) < arctan y"; |
|
2349 |
by (Auto_tac); |
|
2350 |
qed "arctan_lbound"; |
|
2351 |
||
2352 |
Goal "arctan y < pi/2"; |
|
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2353 |
by (asm_full_simp_tac (HOL_ss addsimps [arctan]) 1); |
12196 | 2354 |
qed "arctan_ubound"; |
2355 |
||
2356 |
Goalw [arctan_def] |
|
2357 |
"[|-(pi/2) < x; x < pi/2 |] ==> arctan(tan x) = x"; |
|
2358 |
by (rtac some1_equality 1); |
|
2359 |
by (rtac tan_total 1); |
|
2360 |
by Auto_tac; |
|
2361 |
qed "arctan_tan"; |
|
2362 |
||
2363 |
Goal "arctan 0 = 0"; |
|
2364 |
by (rtac (asm_full_simplify (simpset()) |
|
2365 |
(read_instantiate [("x","0")] arctan_tan)) 1); |
|
2366 |
qed "arctan_zero_zero"; |
|
2367 |
Addsimps [arctan_zero_zero]; |
|
2368 |
||
2369 |
(* ------------------------------------------------------------------------- *) |
|
2370 |
(* Differentiation of arctan. *) |
|
2371 |
(* ------------------------------------------------------------------------- *) |
|
2372 |
||
2373 |
Goal "cos(arctan x) ~= 0"; |
|
2374 |
by (auto_tac (claset(),simpset() addsimps [cos_zero_iff])); |
|
2375 |
by (case_tac "n" 1); |
|
2376 |
by (case_tac "n" 3); |
|
2377 |
by (cut_inst_tac [("y","x")] arctan_ubound 2); |
|
2378 |
by (cut_inst_tac [("y","x")] arctan_lbound 4); |
|
2379 |
by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc, |
|
2380 |
real_add_mult_distrib,real_le_def, |
|
2381 |
real_mult_less_0_iff] delsimps [arctan])); |
|
2382 |
qed "cos_arctan_not_zero"; |
|
2383 |
Addsimps [cos_arctan_not_zero]; |
|
2384 |
||
2385 |
Goal "cos x ~= 0 ==> 1 + tan(x) ^ 2 = inverse(cos x) ^ 2"; |
|
2386 |
by (rtac (realpow_inverse RS subst) 1); |
|
2387 |
by (res_inst_tac [("c1","cos(x) ^ 2")] (real_mult_right_cancel RS iffD1) 1); |
|
2388 |
by (auto_tac (claset() addDs [realpow_not_zero], simpset() addsimps |
|
2389 |
[realpow_mult,real_add_mult_distrib,realpow_divide, |
|
2390 |
tan_def,real_mult_assoc,realpow_inverse RS sym] |
|
2391 |
delsimps [realpow_Suc])); |
|
2392 |
qed "tan_sec"; |
|
2393 |
||
2394 |
||
2395 |
(*--------------------------------------------------------------------------*) |
|
2396 |
(* Some more theorems- developed while at ICASE (07/2001) *) |
|
2397 |
(*--------------------------------------------------------------------------*) |
|
2398 |
||
2399 |
Goal "sin (xa + 1 / 2 * real (Suc m) * pi) = \ |
|
2400 |
\ cos (xa + 1 / 2 * real (m) * pi)"; |
|
2401 |
by (simp_tac (HOL_ss addsimps [cos_add,sin_add, |
|
2402 |
real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1); |
|
2403 |
by Auto_tac; |
|
2404 |
qed "lemma_sin_cos_eq"; |
|
2405 |
Addsimps [lemma_sin_cos_eq]; |
|
2406 |
||
2407 |
Goal "sin (xa + real (Suc m) * pi / 2) = \ |
|
2408 |
\ cos (xa + real (m) * pi / 2)"; |
|
2409 |
by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def, |
|
2410 |
real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1); |
|
2411 |
by Auto_tac; |
|
2412 |
qed "lemma_sin_cos_eq2"; |
|
2413 |
Addsimps [lemma_sin_cos_eq2]; |
|
2414 |
||
2415 |
Goal "DERIV (%x. sin (x + k)) xa :> cos (xa + k)"; |
|
2416 |
by (rtac lemma_DERIV_subst 1); |
|
2417 |
by (res_inst_tac [("f","sin"),("g","%x. x + k")] DERIV_chain2 1); |
|
2418 |
by DERIV_tac; |
|
2419 |
by (Simp_tac 1); |
|
2420 |
qed "DERIV_sin_add"; |
|
2421 |
Addsimps [DERIV_sin_add]; |
|
2422 |
||
2423 |
(* which further simplifies to (- 1 ^ m) !! *) |
|
2424 |
Goal "sin ((real m + 1/2) * pi) = cos (real m * pi)"; |
|
2425 |
by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2, |
|
2426 |
sin_add,real_add_mult_distrib] @ real_mult_ac)); |
|
2427 |
qed "sin_cos_npi"; |
|
2428 |
Addsimps [sin_cos_npi]; |
|
2429 |
||
2430 |
Goal "sin (real (Suc (2 * n)) * pi / 2) = (- 1) ^ n"; |
|
2431 |
by (cut_inst_tac [("m","n")] sin_cos_npi 1); |
|
2432 |
by (auto_tac (claset(),HOL_ss addsimps [real_of_nat_Suc, |
|
2433 |
real_add_mult_distrib,real_divide_def])); |
|
2434 |
by Auto_tac; |
|
2435 |
qed "sin_cos_npi2"; |
|
2436 |
Addsimps [ sin_cos_npi2]; |
|
2437 |
||
2438 |
Goal "cos (2 * real (n::nat) * pi) = 1"; |
|
2439 |
by (auto_tac (claset(),simpset() addsimps [cos_double, |
|
2440 |
real_mult_assoc,realpow_add RS sym,numeral_2_eq_2])); |
|
2441 |
(*FIXME: just needs x^n for literals!*) |
|
2442 |
qed "cos_2npi"; |
|
2443 |
Addsimps [cos_2npi]; |
|
2444 |
||
2445 |
Goal "cos (3 / 2 * pi) = 0"; |
|
2446 |
by (rtac (CLAIM "(1::real) + 1/2 = 3/2" RS subst) 1); |
|
12486 | 2447 |
by (stac real_add_mult_distrib 1); |
12196 | 2448 |
by (auto_tac (claset(),simpset() addsimps [cos_add] @ real_mult_ac)); |
2449 |
qed "cos_3over2_pi"; |
|
2450 |
Addsimps [cos_3over2_pi]; |
|
2451 |
||
2452 |
Goal "sin (2 * real (n::nat) * pi) = 0"; |
|
2453 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc])); |
|
2454 |
qed "sin_2npi"; |
|
2455 |
Addsimps [sin_2npi]; |
|
2456 |
||
2457 |
Goal "sin (3 / 2 * pi) = - 1"; |
|
2458 |
by (rtac (CLAIM "(1::real) + 1/2 = 3/2" RS subst) 1); |
|
12486 | 2459 |
by (stac real_add_mult_distrib 1); |
12196 | 2460 |
by (auto_tac (claset(),simpset() addsimps [sin_add] @real_mult_ac)); |
2461 |
qed "sin_3over2_pi"; |
|
2462 |
Addsimps [sin_3over2_pi]; |
|
2463 |
||
2464 |
Goal "cos(xa + 1 / 2 * real (Suc m) * pi) = \ |
|
2465 |
\ -sin (xa + 1 / 2 * real (m) * pi)"; |
|
2466 |
by (simp_tac (HOL_ss addsimps [cos_add,sin_add, |
|
2467 |
real_of_nat_Suc,real_add_mult_distrib2,real_add_mult_distrib, |
|
2468 |
real_minus_mult_eq2]) 1); |
|
2469 |
by Auto_tac; |
|
2470 |
qed "lemma_cos_sin_eq"; |
|
2471 |
Addsimps [lemma_cos_sin_eq]; |
|
2472 |
||
2473 |
Goal "cos (xa + real (Suc m) * pi / 2) = \ |
|
2474 |
\ -sin (xa + real (m) * pi / 2)"; |
|
2475 |
by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def, |
|
2476 |
real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1); |
|
2477 |
by Auto_tac; |
|
2478 |
qed "lemma_cos_sin_eq2"; |
|
2479 |
Addsimps [lemma_cos_sin_eq2]; |
|
2480 |
||
2481 |
Goal "cos (pi * real (Suc (2 * m)) / 2) = 0"; |
|
2482 |
by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def, |
|
2483 |
real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1); |
|
2484 |
by Auto_tac; |
|
2485 |
qed "cos_pi_eq_zero"; |
|
2486 |
Addsimps [cos_pi_eq_zero]; |
|
2487 |
||
2488 |
Goal "DERIV (%x. cos (x + k)) xa :> - sin (xa + k)"; |
|
2489 |
by (rtac lemma_DERIV_subst 1); |
|
2490 |
by (res_inst_tac [("f","cos"),("g","%x. x + k")] DERIV_chain2 1); |
|
2491 |
by DERIV_tac; |
|
2492 |
by (Simp_tac 1); |
|
2493 |
qed "DERIV_cos_add"; |
|
2494 |
Addsimps [DERIV_cos_add]; |
|
2495 |
||
2496 |
Goal "isCont cos x"; |
|
2497 |
by (rtac (DERIV_cos RS DERIV_isCont) 1); |
|
2498 |
qed "isCont_cos"; |
|
2499 |
||
2500 |
Goal "isCont sin x"; |
|
2501 |
by (rtac (DERIV_sin RS DERIV_isCont) 1); |
|
2502 |
qed "isCont_sin"; |
|
2503 |
||
2504 |
Goal "isCont exp x"; |
|
2505 |
by (rtac (DERIV_exp RS DERIV_isCont) 1); |
|
2506 |
qed "isCont_exp"; |
|
2507 |
||
2508 |
val isCont_simp = [isCont_exp,isCont_sin,isCont_cos]; |
|
2509 |
Addsimps isCont_simp; |
|
2510 |
||
2511 |
(** more theorems: e.g. used in complex geometry **) |
|
2512 |
||
2513 |
Goal "sin x = 0 ==> abs(cos x) = 1"; |
|
2514 |
by (auto_tac (claset(),simpset() addsimps [sin_zero_iff,even_mult_two_ex])); |
|
2515 |
qed "sin_zero_abs_cos_one"; |
|
2516 |
||
2517 |
Goal "(exp x = 1) = (x = 0)"; |
|
2518 |
by Auto_tac; |
|
2519 |
by (dres_inst_tac [("f","ln")] arg_cong 1); |
|
2520 |
by Auto_tac; |
|
2521 |
qed "exp_eq_one_iff"; |
|
2522 |
Addsimps [exp_eq_one_iff]; |
|
2523 |
||
2524 |
Goal "cos x = 1 ==> sin x = 0"; |
|
2525 |
by (cut_inst_tac [("x","x")] sin_cos_squared_add3 1); |
|
2526 |
by Auto_tac; |
|
2527 |
qed "cos_one_sin_zero"; |
|
2528 |
||
2529 |
(*-------------------------------------------------------------------------------*) |
|
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2530 |
(* A few extra theorems *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2531 |
(*-------------------------------------------------------------------------------*) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2532 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2533 |
Goal "[| 0 <= x; x < y |] ==> root(Suc n) x < root(Suc n) y"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2534 |
by (ftac order_le_less_trans 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2535 |
by (assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2536 |
by (forw_inst_tac [("n1","n")] (real_root_pow_pos2 RS ssubst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2537 |
by (rotate_tac 1 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2538 |
by (assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2539 |
by (forw_inst_tac [("n1","n")] (real_root_pow_pos RS ssubst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2540 |
by (rotate_tac 3 1 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2541 |
by (dres_inst_tac [("y","root (Suc n) y ^ Suc n")] order_less_imp_le 1 ); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2542 |
by (forw_inst_tac [("n","n")] real_root_pos_pos_le 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2543 |
by (forw_inst_tac [("n","n")] real_root_pos_pos 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2544 |
by (dres_inst_tac [("x","root (Suc n) x"), |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2545 |
("y","root (Suc n) y")] realpow_increasing 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2546 |
by (assume_tac 1 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2547 |
by (dres_inst_tac [("x","root (Suc n) x")] order_le_imp_less_or_eq 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2548 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2549 |
by (dres_inst_tac [("f","%x. x ^ (Suc n)")] arg_cong 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2550 |
by (auto_tac (claset(),simpset() addsimps [real_root_pow_pos2] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2551 |
delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2552 |
qed "real_root_less_mono"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2553 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2554 |
Goal "[| 0 <= x; x <= y |] ==> root(Suc n) x <= root(Suc n) y"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2555 |
by (dres_inst_tac [("y","y")] order_le_imp_less_or_eq 1 ); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2556 |
by (auto_tac (claset() addDs [real_root_less_mono] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2557 |
addIs [order_less_imp_le],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2558 |
qed "real_root_le_mono"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2559 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2560 |
Goal "[| 0 <= x; 0 <= y |] ==> (root(Suc n) x < root(Suc n) y) = (x < y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2561 |
by (auto_tac (claset() addIs [real_root_less_mono],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2562 |
by (rtac ccontr 1 THEN dtac real_leI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2563 |
by (dres_inst_tac [("x","y"),("n","n")] real_root_le_mono 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2564 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2565 |
qed "real_root_less_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2566 |
Addsimps [real_root_less_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2567 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2568 |
Goal "[| 0 <= x; 0 <= y |] ==> (root(Suc n) x <= root(Suc n) y) = (x <= y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2569 |
by (auto_tac (claset() addIs [real_root_le_mono],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2570 |
by (simp_tac (simpset() addsimps [real_le_def]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2571 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2572 |
by (dres_inst_tac [("x","y"),("n","n")] real_root_less_mono 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2573 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2574 |
qed "real_root_le_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2575 |
Addsimps [real_root_le_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2576 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2577 |
Goal "[| 0 <= x; 0 <= y |] ==> (root(Suc n) x = root(Suc n) y) = (x = y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2578 |
by (auto_tac (claset() addSIs [real_le_anti_sym],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2579 |
by (res_inst_tac [("n1","n")] (real_root_le_iff RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2580 |
by (res_inst_tac [("n1","n")] (real_root_le_iff RS iffD1) 4); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2581 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2582 |
qed "real_root_eq_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2583 |
Addsimps [real_root_eq_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2584 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2585 |
Goal "[| 0 <= x; 0 <= y; y ^ (Suc n) = x |] ==> root (Suc n) x = y"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2586 |
by (auto_tac (claset() addDs [real_root_pos2], |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2587 |
simpset() delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2588 |
qed "real_root_pos_unique"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2589 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2590 |
Goal "[| 0 <= x; 0 <= y |]\ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2591 |
\ ==> root(Suc n) (x * y) = root(Suc n) x * root(Suc n) y"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2592 |
by (rtac real_root_pos_unique 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2593 |
by (auto_tac (claset() addSIs [real_root_pos_pos_le],simpset() |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2594 |
addsimps [realpow_mult,real_0_le_mult_iff, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2595 |
real_root_pow_pos2] delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2596 |
qed "real_root_mult"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2597 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2598 |
Goal "0 <= x ==> (root(Suc n) (inverse x) = inverse(root(Suc n) x))"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2599 |
by (rtac real_root_pos_unique 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2600 |
by (auto_tac (claset() addIs [real_root_pos_pos_le],simpset() |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2601 |
addsimps [realpow_inverse RS sym,real_root_pow_pos2] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2602 |
delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2603 |
qed "real_root_inverse"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2604 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2605 |
Goalw [real_divide_def] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2606 |
"[| 0 <= x; 0 <= y |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2607 |
\ ==> (root(Suc n) (x / y) = root(Suc n) x / root(Suc n) y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2608 |
by (auto_tac (claset(),simpset() addsimps [real_root_mult, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2609 |
real_root_inverse])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2610 |
qed "real_root_divide"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2611 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2612 |
Goalw [sqrt_def] "[| 0 <= x; x < y |] ==> sqrt(x) < sqrt(y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2613 |
by (auto_tac (claset() addIs [real_root_less_mono],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2614 |
qed "real_sqrt_less_mono"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2615 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2616 |
Goalw [sqrt_def] "[| 0 <= x; x <= y |] ==> sqrt(x) <= sqrt(y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2617 |
by (auto_tac (claset() addIs [real_root_le_mono],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2618 |
qed "real_sqrt_le_mono"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2619 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2620 |
Goalw [sqrt_def] "[| 0 <= x; 0 <= y |] ==> (sqrt(x) < sqrt(y)) = (x < y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2621 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2622 |
qed "real_sqrt_less_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2623 |
Addsimps [real_sqrt_less_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2624 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2625 |
Goalw [sqrt_def] "[| 0 <= x; 0 <= y |] ==> (sqrt(x) <= sqrt(y)) = (x <= y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2626 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2627 |
qed "real_sqrt_le_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2628 |
Addsimps [real_sqrt_le_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2629 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2630 |
Goalw [sqrt_def] "[| 0 <= x; 0 <= y |] ==> (sqrt(x) = sqrt(y)) = (x = y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2631 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2632 |
qed "real_sqrt_eq_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2633 |
Addsimps [real_sqrt_eq_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2634 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2635 |
Goal "(sqrt(x ^ 2 + y ^ 2) < 1) = (x ^ 2 + y ^ 2 < 1)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2636 |
by (rtac (real_sqrt_one RS subst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2637 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2638 |
by (rtac real_sqrt_less_mono 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2639 |
by (dtac (rotate_prems 2 (real_sqrt_less_iff RS iffD1)) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2640 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2641 |
qed "real_sqrt_sos_less_one_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2642 |
Addsimps [real_sqrt_sos_less_one_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2643 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2644 |
Goal "(sqrt(x ^ 2 + y ^ 2) = 1) = (x ^ 2 + y ^ 2 = 1)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2645 |
by (rtac (real_sqrt_one RS subst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2646 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2647 |
by (dtac (rotate_prems 2 (real_sqrt_eq_iff RS iffD1)) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2648 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2649 |
qed "real_sqrt_sos_eq_one_iff"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2650 |
Addsimps [real_sqrt_sos_eq_one_iff]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2651 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2652 |
Goalw [real_divide_def] "(((r::real) * a) / (r * r)) = a / r"; |
14269 | 2653 |
by (case_tac "r=0" 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2654 |
by (auto_tac (claset(),simpset() addsimps [real_inverse_distrib] @ real_mult_ac)); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2655 |
qed "real_divide_square_eq"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2656 |
Addsimps [real_divide_square_eq]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2657 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2658 |
(*-------------------------------------------------------------------------------*) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2659 |
(* More theorems about sqrt, transcendental functions etc. needed in Complex.ML *) |
12196 | 2660 |
(*-------------------------------------------------------------------------------*) |
2661 |
||
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2662 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2663 |
goal Real.thy "2 = Suc (Suc 0)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2664 |
by (Simp_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2665 |
qed "two_eq_Suc_Suc"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2666 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2667 |
val realpow_num_two = CLAIM "2 = Suc(Suc 0)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2668 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2669 |
Goal "x ^ 2 = x * (x::real)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2670 |
by (auto_tac (claset(),simpset() addsimps [CLAIM "2 = Suc(Suc 0)"])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2671 |
qed "realpow_two_eq_mult"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2672 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2673 |
Goalw [real_divide_def] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2674 |
"0 < x ==> 0 <= x/(sqrt (x * x + y * y))"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2675 |
by (ftac ((real_sqrt_sum_squares_ge1 RSN (2,order_less_le_trans)) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2676 |
RS (CLAIM "0 < x ==> 0 < inverse (x::real)")) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2677 |
by (rtac (real_mult_order RS order_less_imp_le) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2678 |
by (auto_tac (claset(),simpset() addsimps [realpow_num_two])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2679 |
qed "lemma_real_divide_sqrt"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2680 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2681 |
Goal "0 < x ==> -(1::real) <= x/(sqrt (x * x + y * y))"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2682 |
by (rtac real_le_trans 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2683 |
by (rtac lemma_real_divide_sqrt 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2684 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2685 |
qed "lemma_real_divide_sqrt_ge_minus_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2686 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2687 |
Goal "x < 0 ==> 0 < sqrt (x * x + y * y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2688 |
by (rtac real_sqrt_gt_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2689 |
by (rtac (ARITH_PROVE "[| 0 < x; 0 <= y |] ==> (0::real) < x + y") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2690 |
by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2691 |
qed "real_sqrt_sum_squares_gt_zero1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2692 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2693 |
Goal "0 < x ==> 0 < sqrt (x * x + y * y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2694 |
by (rtac real_sqrt_gt_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2695 |
by (rtac (ARITH_PROVE "[| 0 < x; 0 <= y |] ==> (0::real) < x + y") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2696 |
by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2697 |
qed "real_sqrt_sum_squares_gt_zero2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2698 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2699 |
Goal "x ~= 0 ==> 0 < sqrt(x ^ 2 + y ^ 2)"; |
14269 | 2700 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2701 |
by (auto_tac (claset() addIs [real_sqrt_sum_squares_gt_zero2, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2702 |
real_sqrt_sum_squares_gt_zero1],simpset() addsimps [realpow_num_two])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2703 |
qed "real_sqrt_sum_squares_gt_zero3"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2704 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2705 |
Goal "y ~= 0 ==> 0 < sqrt(x ^ 2 + y ^ 2)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2706 |
by (dres_inst_tac [("y","x")] real_sqrt_sum_squares_gt_zero3 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2707 |
by (auto_tac (claset(),simpset() addsimps [real_add_commute])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2708 |
qed "real_sqrt_sum_squares_gt_zero3a"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2709 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2710 |
Goal "sqrt(x ^ 2 + y ^ 2) = x ==> y = 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2711 |
by (rtac ccontr 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2712 |
by (forw_inst_tac [("x","x")] real_sum_squares_not_zero2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2713 |
by (dres_inst_tac [("f","%x. x ^ 2")] arg_cong 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2714 |
by (forw_inst_tac [("x","x"),("y","y")] real_sum_square_gt_zero2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2715 |
by (dtac real_sqrt_gt_zero_pow2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2716 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2717 |
qed "real_sqrt_sum_squares_eq_cancel"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2718 |
Addsimps [real_sqrt_sum_squares_eq_cancel]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2719 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2720 |
Goal "sqrt(x ^ 2 + y ^ 2) = y ==> x = 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2721 |
by (res_inst_tac [("x","y")] real_sqrt_sum_squares_eq_cancel 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2722 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2723 |
qed "real_sqrt_sum_squares_eq_cancel2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2724 |
Addsimps [real_sqrt_sum_squares_eq_cancel2]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2725 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2726 |
Goal "x < 0 ==> x/(sqrt (x * x + y * y)) <= 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2727 |
by (dtac (ARITH_PROVE "x < 0 ==> (0::real) < -x") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2728 |
by (dres_inst_tac [("y","y")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2729 |
lemma_real_divide_sqrt_ge_minus_one 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2730 |
by (dtac (ARITH_PROVE "x <= y ==> -y <= -(x::real)") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2731 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2732 |
qed "lemma_real_divide_sqrt_le_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2733 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2734 |
Goal "x < 0 ==> -(1::real) <= x/(sqrt (x * x + y * y))"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2735 |
by (case_tac "y = 0" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2736 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2737 |
by (ftac abs_minus_eqI2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2738 |
by (auto_tac (claset(),simpset() addsimps [real_minus_inverse])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2739 |
by (rtac order_less_imp_le 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2740 |
by (res_inst_tac [("z1","sqrt(x * x + y * y)")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2741 |
(real_mult_less_iff1 RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2742 |
by (forw_inst_tac [("y2","y")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2743 |
(real_sqrt_sum_squares_gt_zero1 RS real_not_refl2 |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2744 |
RS not_sym) 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2745 |
by (auto_tac (claset() addIs [real_sqrt_sum_squares_gt_zero1], |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2746 |
simpset() addsimps real_mult_ac)); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2747 |
by (rtac (ARITH_PROVE "-x < y ==> -y < (x::real)") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2748 |
by (cut_inst_tac [("x","-x"),("y","y")] real_sqrt_sum_squares_ge1 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2749 |
by (dtac real_le_imp_less_or_eq 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2750 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2751 |
by (asm_full_simp_tac (simpset() addsimps [realpow_num_two]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2752 |
by (dtac (sym RS real_sqrt_sum_squares_eq_cancel) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2753 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2754 |
qed "lemma_real_divide_sqrt_ge_minus_one2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2755 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2756 |
Goal "0 < x ==> x/(sqrt (x * x + y * y)) <= 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2757 |
by (dtac (ARITH_PROVE "0 < x ==> -x < (0::real)") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2758 |
by (dres_inst_tac [("y","y")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2759 |
lemma_real_divide_sqrt_ge_minus_one2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2760 |
by (dtac (ARITH_PROVE "x <= y ==> -y <= -(x::real)") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2761 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2762 |
qed "lemma_real_divide_sqrt_le_one2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2763 |
(* was qed "lemma_real_mult_self_rinv_sqrt_squared5" *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2764 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2765 |
Goal "-(1::real)<= x / sqrt (x * x + y * y)"; |
14269 | 2766 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2767 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2768 |
by (rtac lemma_real_divide_sqrt_ge_minus_one2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2769 |
by (rtac lemma_real_divide_sqrt_ge_minus_one 3); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2770 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2771 |
qed "cos_x_y_ge_minus_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2772 |
Addsimps [cos_x_y_ge_minus_one]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2773 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2774 |
Goal "-(1::real)<= y / sqrt (x * x + y * y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2775 |
by (cut_inst_tac [("x","y"),("y","x")] cos_x_y_ge_minus_one 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2776 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2777 |
qed "cos_x_y_ge_minus_one1a"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2778 |
Addsimps [cos_x_y_ge_minus_one1a, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2779 |
simplify (simpset()) cos_x_y_ge_minus_one1a]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2780 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2781 |
Goal "x / sqrt (x * x + y * y) <= 1"; |
14269 | 2782 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2783 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2784 |
by (rtac lemma_real_divide_sqrt_le_one 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2785 |
by (rtac lemma_real_divide_sqrt_le_one2 3); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2786 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2787 |
qed "cos_x_y_le_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2788 |
Addsimps [cos_x_y_le_one]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2789 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2790 |
Goal "y / sqrt (x * x + y * y) <= 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2791 |
by (cut_inst_tac [("x","y"),("y","x")] cos_x_y_le_one 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2792 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2793 |
qed "cos_x_y_le_one2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2794 |
Addsimps [cos_x_y_le_one2]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2795 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2796 |
Addsimps [[cos_x_y_ge_minus_one,cos_x_y_le_one] MRS cos_arcos]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2797 |
Addsimps [[cos_x_y_ge_minus_one,cos_x_y_le_one] MRS arcos_bounded]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2798 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2799 |
Addsimps [[cos_x_y_ge_minus_one1a,cos_x_y_le_one2] MRS cos_arcos]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2800 |
Addsimps [[cos_x_y_ge_minus_one1a,cos_x_y_le_one2] MRS arcos_bounded]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2801 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2802 |
Goal "-(1::real) <= abs(x) / sqrt (x * x + y * y)"; |
14269 | 2803 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2804 |
by (auto_tac (claset(),simpset() addsimps [abs_minus_eqI2,abs_eqI2])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2805 |
by (dtac lemma_real_divide_sqrt_ge_minus_one 1 THEN Force_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2806 |
qed "cos_rabs_x_y_ge_minus_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2807 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2808 |
Addsimps [cos_rabs_x_y_ge_minus_one, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2809 |
simplify (simpset()) cos_rabs_x_y_ge_minus_one]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2810 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2811 |
Goal "abs(x) / sqrt (x * x + y * y) <= 1"; |
14269 | 2812 |
by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2813 |
by (auto_tac (claset(),simpset() addsimps [abs_minus_eqI2,abs_eqI2])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2814 |
by (dtac lemma_real_divide_sqrt_ge_minus_one2 1 THEN Force_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2815 |
qed "cos_rabs_x_y_le_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2816 |
Addsimps [cos_rabs_x_y_le_one]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2817 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2818 |
Addsimps [[cos_rabs_x_y_ge_minus_one,cos_rabs_x_y_le_one] MRS cos_arcos]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2819 |
Addsimps [[cos_rabs_x_y_ge_minus_one,cos_rabs_x_y_le_one] MRS arcos_bounded]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2820 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2821 |
Goal "-pi < 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2822 |
by (Simp_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2823 |
qed "minus_pi_less_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2824 |
Addsimps [minus_pi_less_zero]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2825 |
Addsimps [minus_pi_less_zero RS order_less_imp_le]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2826 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2827 |
Goal "[| -(1::real) <= y; y <= 1 |] ==> -pi <= arcos y"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2828 |
by (rtac real_le_trans 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2829 |
by (rtac arcos_lbound 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2830 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2831 |
qed "arcos_ge_minus_pi"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2832 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2833 |
Addsimps [[cos_x_y_ge_minus_one,cos_x_y_le_one] MRS arcos_ge_minus_pi]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2834 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2835 |
(* How tedious! *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2836 |
Goal "[| x + (y::real) ~= 0; 1 - z = x/(x + y) \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2837 |
\ |] ==> z = y/(x + y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2838 |
by (res_inst_tac [("c1","x + y")] (real_mult_right_cancel RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2839 |
by (forw_inst_tac [("c1","x + y")] (real_mult_right_cancel RS iffD2) 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2840 |
by (assume_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2841 |
by (rotate_tac 2 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2842 |
by (dtac (real_mult_assoc RS subst) 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2843 |
by (rotate_tac 2 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2844 |
by (ftac (real_mult_inv_left RS subst) 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2845 |
by (assume_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2846 |
by (thin_tac "(1 - z) * (x + y) = x /(x + y) * (x + y)" 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2847 |
by (thin_tac "1 - z = x /(x + y)" 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2848 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2849 |
by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2850 |
real_diff_mult_distrib])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2851 |
qed "lemma_divide_rearrange"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2852 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2853 |
Goal "[| 0 < x * x + y * y; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2854 |
\ 1 - sin xa ^ 2 = (x / sqrt (x * x + y * y)) ^ 2 \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2855 |
\ |] ==> sin xa ^ 2 = (y / sqrt (x * x + y * y)) ^ 2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2856 |
by (auto_tac (claset() addIs [lemma_divide_rearrange],simpset() |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2857 |
addsimps [realpow_divide,real_sqrt_gt_zero_pow2, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2858 |
realpow_two_eq_mult RS sym])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2859 |
qed "lemma_cos_sin_eq"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2860 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2861 |
Goal "[| 0 < x * x + y * y; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2862 |
\ 1 - cos xa ^ 2 = (y / sqrt (x * x + y * y)) ^ 2 \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2863 |
\ |] ==> cos xa ^ 2 = (x / sqrt (x * x + y * y)) ^ 2"; |
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2864 |
by (auto_tac (claset(), |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2865 |
simpset() addsimps [realpow_divide, |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2866 |
real_sqrt_gt_zero_pow2,realpow_two_eq_mult RS sym])); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2867 |
by (rtac (real_add_commute RS subst) 1); |
14284
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2868 |
by (rtac lemma_divide_rearrange 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2869 |
by (asm_full_simp_tac (simpset() addsimps []) 1); |
f1abe67c448a
re-organisation of Real/RealArith0.ML; more `Isar scripts
paulson
parents:
14277
diff
changeset
|
2870 |
by (asm_full_simp_tac (simpset() addsimps [add_commute]) 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2871 |
qed "lemma_sin_cos_eq"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2872 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2873 |
Goal "[| x ~= 0; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2874 |
\ cos xa = x / sqrt (x * x + y * y) \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2875 |
\ |] ==> sin xa = y / sqrt (x * x + y * y) | \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2876 |
\ sin xa = - y / sqrt (x * x + y * y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2877 |
by (dres_inst_tac [("f","%x. x ^ 2")] arg_cong 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2878 |
by (forw_inst_tac [("y","y")] real_sum_square_gt_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2879 |
by (asm_full_simp_tac (simpset() addsimps [cos_squared_eq]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2880 |
by (subgoal_tac "sin xa ^ 2 = (y / sqrt (x * x + y * y)) ^ 2" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2881 |
by (rtac lemma_cos_sin_eq 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2882 |
by (Force_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2883 |
by (Asm_full_simp_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2884 |
by (auto_tac (claset(),simpset() addsimps [realpow_two_disj,realpow_num_two] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2885 |
delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2886 |
qed "sin_x_y_disj"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2887 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2888 |
Goal "y ~= 0 ==> x / sqrt (x * x + y * y) ~= -(1::real)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2889 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2890 |
by (dres_inst_tac [("f","%x. x ^ 2")] arg_cong 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2891 |
by (auto_tac (claset(),simpset() addsimps [realpow_divide, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2892 |
realpow_two_eq_mult RS sym])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2893 |
by (forw_inst_tac [("x","x")] real_sum_squares_not_zero2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2894 |
by (asm_full_simp_tac (HOL_ss addsimps [realpow_two_eq_mult RS sym]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2895 |
by (forw_inst_tac [("c1","x ^ 2 + y ^ 2")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2896 |
(real_mult_right_cancel RS iffD2) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2897 |
by (assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2898 |
by (dres_inst_tac [("y","x ^ 2 + y ^ 2"),("x","x ^ 2")] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2899 |
(CLAIM "y ~= (0::real) ==> (x/y) * y= x") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2900 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2901 |
qed "cos_not_eq_minus_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2902 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2903 |
Goalw [arcos_def] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2904 |
"arcos (x / sqrt (x * x + y * y)) = pi ==> y = 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2905 |
by (rtac ccontr 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2906 |
by (rtac swap 1 THEN assume_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2907 |
by (rtac (([cos_x_y_ge_minus_one,cos_x_y_le_one] MRS cos_total) RS |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2908 |
((CLAIM "EX! x. P x ==> EX x. P x") RS someI2_ex)) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2909 |
by (auto_tac (claset() addDs [cos_not_eq_minus_one],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2910 |
qed "arcos_eq_pi_cancel"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2911 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2912 |
Goalw [real_divide_def] "x ~= 0 ==> x / sqrt (x * x + y * y) ~= 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2913 |
by (forw_inst_tac [("y3","y")] (real_sqrt_sum_squares_gt_zero3 |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2914 |
RS real_not_refl2 RS not_sym RS real_inverse_not_zero) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2915 |
by (auto_tac (claset(),simpset() addsimps [realpow_two_eq_mult])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2916 |
qed "lemma_cos_not_eq_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2917 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2918 |
Goal "[| x ~= 0; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2919 |
\ sin xa = y / sqrt (x * x + y * y) \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2920 |
\ |] ==> cos xa = x / sqrt (x * x + y * y) | \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2921 |
\ cos xa = - x / sqrt (x * x + y * y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2922 |
by (dres_inst_tac [("f","%x. x ^ 2")] arg_cong 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2923 |
by (forw_inst_tac [("y","y")] real_sum_square_gt_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2924 |
by (asm_full_simp_tac (simpset() addsimps [sin_squared_eq] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2925 |
delsimps [realpow_Suc]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2926 |
by (subgoal_tac "cos xa ^ 2 = (x / sqrt (x * x + y * y)) ^ 2" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2927 |
by (rtac lemma_sin_cos_eq 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2928 |
by (Force_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2929 |
by (Asm_full_simp_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2930 |
by (auto_tac (claset(),simpset() addsimps [realpow_two_disj, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2931 |
realpow_num_two] delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2932 |
qed "cos_x_y_disj"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2933 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2934 |
Goal "0 < y ==> - y / sqrt (x * x + y * y) < 0"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2935 |
by (case_tac "x = 0" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2936 |
by (auto_tac (claset(),simpset() addsimps [abs_eqI2])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2937 |
by (dres_inst_tac [("y","y")] real_sqrt_sum_squares_gt_zero3 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2938 |
by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2939 |
real_divide_def,realpow_two_eq_mult])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2940 |
qed "real_sqrt_divide_less_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2941 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2942 |
Goal "[| x ~= 0; 0 < y |] ==> EX r a. x = r * cos a & y = r * sin a"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2943 |
by (res_inst_tac [("x","sqrt(x ^ 2 + y ^ 2)")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2944 |
by (res_inst_tac [("x","arcos(x / sqrt (x * x + y * y))")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2945 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2946 |
by (dres_inst_tac [("y2","y")] (real_sqrt_sum_squares_gt_zero3 |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2947 |
RS real_not_refl2 RS not_sym) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2948 |
by (auto_tac (claset(),simpset() addsimps [realpow_two_eq_mult])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2949 |
by (rewtac arcos_def); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2950 |
by (cut_inst_tac [("x1","x"),("y1","y")] ([cos_x_y_ge_minus_one,cos_x_y_le_one] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2951 |
MRS cos_total) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2952 |
by (rtac someI2_ex 1 THEN Blast_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2953 |
by (thin_tac |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2954 |
"EX! xa. 0 <= xa & xa <= pi & cos xa = x / sqrt (x * x + y * y)" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2955 |
by (ftac sin_x_y_disj 1 THEN Blast_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2956 |
by (dres_inst_tac [("y2","y")] (real_sqrt_sum_squares_gt_zero3 |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2957 |
RS real_not_refl2 RS not_sym) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2958 |
by (auto_tac (claset(),simpset() addsimps [realpow_two_eq_mult])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2959 |
by (dtac sin_ge_zero 1 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2960 |
by (dres_inst_tac [("x","x")] real_sqrt_divide_less_zero 1 THEN Auto_tac); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2961 |
qed "polar_ex1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2962 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2963 |
Goal "x * x = -(y * y) ==> y = (0::real)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2964 |
by (auto_tac (claset() addIs [real_sum_squares_cancel],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2965 |
qed "real_sum_squares_cancel2a"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2966 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2967 |
Goal "[| x ~= 0; y < 0 |] ==> EX r a. x = r * cos a & y = r * sin a"; |
14269 | 2968 |
by (cut_inst_tac [("x","0"),("y","x")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2969 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2970 |
by (res_inst_tac [("x","sqrt(x ^ 2 + y ^ 2)")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2971 |
by (res_inst_tac [("x","arcsin(y / sqrt (x * x + y * y))")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2972 |
by (auto_tac (claset() addDs [real_sum_squares_cancel2a], |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2973 |
simpset() addsimps [realpow_two_eq_mult])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2974 |
by (rewtac arcsin_def); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2975 |
by (cut_inst_tac [("x1","x"),("y1","y")] ([cos_x_y_ge_minus_one1a, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2976 |
cos_x_y_le_one2] MRS sin_total) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2977 |
by (rtac someI2_ex 1 THEN Blast_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2978 |
by (thin_tac "EX! xa. - (pi/2) <= xa & \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2979 |
\ xa <= pi/2 & sin xa = y / sqrt (x * x + y * y)" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2980 |
by (ftac ((CLAIM "0 < x ==> (x::real) ~= 0") RS cos_x_y_disj) 1 THEN Blast_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2981 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2982 |
by (dtac cos_ge_zero 1 THEN Force_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2983 |
by (dres_inst_tac [("x","y")] real_sqrt_divide_less_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2984 |
by (auto_tac (claset(),simpset() addsimps [real_add_commute])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2985 |
by (dtac (ARITH_PROVE "(y::real) < 0 ==> 0 < - y") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2986 |
by (dtac (CLAIM "x < (0::real) ==> x ~= 0" RS polar_ex1) 1 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2987 |
by (REPEAT(etac exE 1)); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2988 |
by (res_inst_tac [("x","r")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2989 |
by (res_inst_tac [("x","-a")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2990 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2991 |
qed "polar_ex2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2992 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2993 |
Goal "EX r a. x = r * cos a & y = r * sin a"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2994 |
by (case_tac "x = 0" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2995 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2996 |
by (res_inst_tac [("x","y")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2997 |
by (res_inst_tac [("x","pi/2")] exI 1 THEN Auto_tac); |
14269 | 2998 |
by (cut_inst_tac [("x","0"),("y","y")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
2999 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3000 |
by (res_inst_tac [("x","x")] exI 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3001 |
by (res_inst_tac [("x","0")] exI 2 THEN Auto_tac); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3002 |
by (ALLGOALS(blast_tac (claset() addIs [polar_ex1,polar_ex2]))); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3003 |
qed "polar_Ex"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3004 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3005 |
Goal "abs x <= sqrt (x ^ 2 + y ^ 2)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3006 |
by (res_inst_tac [("n","1")] realpow_increasing 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3007 |
by (auto_tac (claset(),simpset() addsimps [two_eq_Suc_Suc RS sym])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3008 |
by (simp_tac (simpset() addsimps [two_eq_Suc_Suc]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3009 |
qed "real_sqrt_ge_abs1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3010 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3011 |
Goal "abs y <= sqrt (x ^ 2 + y ^ 2)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3012 |
by (rtac (real_add_commute RS subst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3013 |
by (rtac real_sqrt_ge_abs1 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3014 |
qed "real_sqrt_ge_abs2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3015 |
Addsimps [real_sqrt_ge_abs1,real_sqrt_ge_abs2]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3016 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3017 |
Goal "0 < sqrt 2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3018 |
by (auto_tac (claset() addIs [real_sqrt_gt_zero],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3019 |
qed "real_sqrt_two_gt_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3020 |
Addsimps [real_sqrt_two_gt_zero]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3021 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3022 |
Goal "0 <= sqrt 2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3023 |
by (auto_tac (claset() addIs [real_sqrt_ge_zero],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3024 |
qed "real_sqrt_two_ge_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3025 |
Addsimps [real_sqrt_two_ge_zero]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3026 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3027 |
Goal "1 < sqrt 2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3028 |
by (res_inst_tac [("y","7/5")] order_less_le_trans 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3029 |
by (res_inst_tac [("n","1")] realpow_increasing 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3030 |
by (auto_tac (claset(),simpset() addsimps [real_sqrt_gt_zero_pow2,two_eq_Suc_Suc RS sym] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3031 |
delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3032 |
by (simp_tac (simpset() addsimps [two_eq_Suc_Suc]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3033 |
qed "real_sqrt_two_gt_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3034 |
Addsimps [real_sqrt_two_gt_one]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3035 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3036 |
Goal "0 < u ==> u / sqrt 2 < u"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3037 |
by (res_inst_tac [("z1","inverse u")] (real_mult_less_iff1 RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3038 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3039 |
by (res_inst_tac [("z1","sqrt 2")] (real_mult_less_iff1 RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3040 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3041 |
qed "lemma_real_divide_sqrt_less"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3042 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3043 |
(* needed for infinitely close relation over the nonstandard complex numbers *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3044 |
Goal "[| 0 < u; x < u/2; y < u/2; 0 <= x; 0 <= y |] ==> sqrt (x ^ 2 + y ^ 2) < u"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3045 |
by (res_inst_tac [("y","u/sqrt 2")] order_le_less_trans 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3046 |
by (etac lemma_real_divide_sqrt_less 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3047 |
by (res_inst_tac [("n","1")] realpow_increasing 1); |
14277
ad66687ece6e
more field division lemmas transferred from Real to Ring_and_Field
paulson
parents:
14270
diff
changeset
|
3048 |
by (auto_tac (claset(), |
ad66687ece6e
more field division lemmas transferred from Real to Ring_and_Field
paulson
parents:
14270
diff
changeset
|
3049 |
simpset() addsimps [real_0_le_divide_iff,realpow_divide, |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3050 |
real_sqrt_gt_zero_pow2,two_eq_Suc_Suc RS sym] delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3051 |
by (res_inst_tac [("t","u ^ 2")] (real_sum_of_halves RS subst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3052 |
by (rtac real_add_le_mono 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3053 |
by (auto_tac (claset(),simpset() delsimps [realpow_Suc])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3054 |
by (ALLGOALS(rtac ((CLAIM "(2::real) ^ 2 = 4") RS subst))); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3055 |
by (ALLGOALS(rtac (realpow_mult RS subst))); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3056 |
by (ALLGOALS(rtac realpow_le)); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3057 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3058 |
qed "lemma_sqrt_hcomplex_capprox"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3059 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3060 |
Addsimps [real_sqrt_sum_squares_ge_zero RS abs_eqI1]; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3061 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3062 |
(* A few theorems involving ln and derivatives, etc *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3063 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3064 |
Goal "DERIV ln z :> l ==> DERIV (%x. exp (ln x)) z :> exp (ln z) * l"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3065 |
by (etac DERIV_fun_exp 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3066 |
qed "lemma_DERIV_ln"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3067 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3068 |
Goal "0 < z ==> ( *f* (%x. exp (ln x))) z = z"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3069 |
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3070 |
by (auto_tac (claset(),simpset() addsimps [starfun, |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3071 |
hypreal_zero_def,hypreal_less])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3072 |
qed "STAR_exp_ln"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3073 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3074 |
Goal "[|e : Infinitesimal; 0 < x |] ==> 0 < hypreal_of_real x + e"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3075 |
by (res_inst_tac [("z1","-e")] (hypreal_add_right_cancel_less RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3076 |
by (auto_tac (claset() addIs [Infinitesimal_less_SReal],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3077 |
qed "hypreal_add_Infinitesimal_gt_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3078 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3079 |
Goalw [nsderiv_def,NSLIM_def] "0 < z ==> NSDERIV (%x. exp (ln x)) z :> 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3080 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3081 |
by (rtac ccontr 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3082 |
by (subgoal_tac "0 < hypreal_of_real z + h" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3083 |
by (dtac STAR_exp_ln 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3084 |
by (rtac hypreal_add_Infinitesimal_gt_zero 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3085 |
by (dtac (CLAIM "h ~= 0 ==> h/h = (1::hypreal)") 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3086 |
by (auto_tac (claset(),simpset() addsimps [exp_ln_iff RS sym] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3087 |
delsimps [exp_ln_iff])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3088 |
qed "NSDERIV_exp_ln_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3089 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3090 |
Goal "0 < z ==> DERIV (%x. exp (ln x)) z :> 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3091 |
by (auto_tac (claset() addIs [NSDERIV_exp_ln_one], |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3092 |
simpset() addsimps [NSDERIV_DERIV_iff RS sym])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3093 |
qed "DERIV_exp_ln_one"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3094 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3095 |
Goal "[| 0 < z; DERIV ln z :> l |] ==> exp (ln z) * l = 1"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3096 |
by (rtac DERIV_unique 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3097 |
by (rtac lemma_DERIV_ln 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3098 |
by (rtac DERIV_exp_ln_one 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3099 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3100 |
qed "lemma_DERIV_ln2"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3101 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3102 |
Goal "[| 0 < z; DERIV ln z :> l |] ==> l = 1/(exp (ln z))"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3103 |
by (res_inst_tac [("c1","exp(ln z)")] (real_mult_left_cancel RS iffD1) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3104 |
by (auto_tac (claset() addIs [lemma_DERIV_ln2],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3105 |
qed "lemma_DERIV_ln3"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3106 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3107 |
Goal "[| 0 < z; DERIV ln z :> l |] ==> l = 1/z"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3108 |
by (res_inst_tac [("t","z")] (exp_ln_iff RS iffD2 RS subst) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3109 |
by (auto_tac (claset() addIs [lemma_DERIV_ln3],simpset())); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3110 |
qed "lemma_DERIV_ln4"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3111 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3112 |
(* need to rename second isCont_inverse *) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3113 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3114 |
Goal "[| 0 < d; ALL z. abs(z - x) <= d --> g(f(z)) = z; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3115 |
\ ALL z. abs(z - x) <= d --> isCont f z |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3116 |
\ ==> isCont g (f x)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3117 |
by (simp_tac (simpset() addsimps [isCont_iff,LIM_def]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3118 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3119 |
by (dres_inst_tac [("d1.0","r")] real_lbound_gt_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3120 |
by (assume_tac 1 THEN Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3121 |
by (subgoal_tac "ALL z. abs(z - x) <= e --> (g(f z) = z)" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3122 |
by (Force_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3123 |
by (subgoal_tac "ALL z. abs(z - x) <= e --> isCont f z" 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3124 |
by (Force_tac 2); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3125 |
by (dres_inst_tac [("d","e")] isCont_inj_range 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3126 |
by (assume_tac 2 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3127 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3128 |
by (res_inst_tac [("x","ea")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3129 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3130 |
by (rotate_tac 4 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3131 |
by (dres_inst_tac [("x","f(x) + xa")] spec 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3132 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3133 |
by (dtac sym 1 THEN Auto_tac); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3134 |
by (arith_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3135 |
qed "isCont_inv_fun"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3136 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3137 |
(* |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3138 |
Goalw [isCont_def] |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3139 |
"[| isCont f x; f x ~= 0 |] ==> isCont (%x. inverse (f x)) x"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3140 |
by (blast_tac (claset() addIs [LIM_inverse]) 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3141 |
qed "isCont_inverse"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3142 |
*) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3143 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3144 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3145 |
Goal "[| 0 < d; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3146 |
\ ALL z. abs(z - x) <= d --> g(f(z)) = z; \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3147 |
\ ALL z. abs(z - x) <= d --> isCont f z |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3148 |
\ ==> EX e. 0 < (e::real) & \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3149 |
\ (ALL y. 0 < abs(y - f(x::real)) & abs(y - f(x)) < e --> f(g(y)) = y)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3150 |
by (dtac isCont_inj_range 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3151 |
by (assume_tac 2 THEN assume_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3152 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3153 |
by (res_inst_tac [("x","e")] exI 1 THEN Auto_tac); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3154 |
by (rotate_tac 2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3155 |
by (dres_inst_tac [("x","y")] spec 1 THEN Auto_tac); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3156 |
qed "isCont_inv_fun_inv"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3157 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3158 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3159 |
(* Bartle/Sherbert: Introduction to Real Analysis, Theorem 4.2.9, p. 110*) |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3160 |
Goal "[| f -- c --> l; 0 < l |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3161 |
\ ==> EX r. 0 < r & (ALL x. x ~= c & abs (c - x) < r --> 0 < f x)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3162 |
by (auto_tac (claset(),simpset() addsimps [LIM_def])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3163 |
by (dres_inst_tac [("x","l/2")] spec 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3164 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3165 |
by (Force_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3166 |
by (res_inst_tac [("x","s")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3167 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3168 |
by (rotate_tac 2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3169 |
by (dres_inst_tac [("x","x")] spec 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3170 |
by (auto_tac (claset(),HOL_ss addsimps [abs_interval_iff])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3171 |
by (auto_tac (claset(),simpset() addsimps [CLAIM "(l::real) + -(l/2) = l/2", |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3172 |
CLAIM "(a < f + - l) = (l + a < (f::real))"])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3173 |
qed "LIM_fun_gt_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3174 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3175 |
Goal "[| f -- c --> l; l < 0 |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3176 |
\ ==> EX r. 0 < r & (ALL x. x ~= c & abs (c - x) < r --> f x < 0)"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3177 |
by (auto_tac (claset(),simpset() addsimps [LIM_def])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3178 |
by (dres_inst_tac [("x","-l/2")] spec 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3179 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3180 |
by (Force_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3181 |
by (res_inst_tac [("x","s")] exI 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3182 |
by (Step_tac 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3183 |
by (rotate_tac 2 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3184 |
by (dres_inst_tac [("x","x")] spec 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3185 |
by (auto_tac (claset(),HOL_ss addsimps [abs_interval_iff])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3186 |
by (auto_tac (claset(),simpset() addsimps [CLAIM "(l::real) + -(l/2) = l/2", |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3187 |
CLAIM "(f + - l < a) = ((f::real) < l + a)"])); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3188 |
qed "LIM_fun_less_zero"; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3189 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3190 |
|
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3191 |
Goal "[| f -- c --> l; l ~= 0 |] \ |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3192 |
\ ==> EX r. 0 < r & (ALL x. x ~= c & abs (c - x) < r --> f x ~= 0)"; |
14269 | 3193 |
by (cut_inst_tac [("x","l"),("y","0")] linorder_less_linear 1); |
13958
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3194 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3195 |
by (dtac LIM_fun_less_zero 1); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3196 |
by (dtac LIM_fun_gt_zero 3); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3197 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3198 |
by (ALLGOALS(res_inst_tac [("x","r")] exI)); |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3199 |
by Auto_tac; |
c1c67582c9b5
New material on integration, etc. Moving Hyperreal/ex
paulson
parents:
13601
diff
changeset
|
3200 |
qed "LIM_fun_not_zero"; |