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