author | paulson |
Wed, 10 Jan 2001 17:21:31 +0100 | |
changeset 10857 | 47b1f34ddd09 |
parent 10834 | a7897aebbffc |
child 10919 | 144ede948e58 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : HyperPow.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
4 |
Description : Natural Powers of hyperreals theory |
|
5 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
6 |
Exponentials on the hyperreals |
10751 | 7 |
*) |
8 |
||
9 |
Goal "(#0::hypreal) ^ (Suc n) = 0"; |
|
10 |
by (Auto_tac); |
|
11 |
qed "hrealpow_zero"; |
|
12 |
Addsimps [hrealpow_zero]; |
|
13 |
||
14 |
Goal "r ~= (#0::hypreal) --> r ^ n ~= 0"; |
|
15 |
by (induct_tac "n" 1); |
|
16 |
by Auto_tac; |
|
17 |
qed_spec_mp "hrealpow_not_zero"; |
|
18 |
||
19 |
Goal "r ~= (#0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n"; |
|
20 |
by (induct_tac "n" 1); |
|
21 |
by (Auto_tac); |
|
22 |
by (forw_inst_tac [("n","n")] hrealpow_not_zero 1); |
|
23 |
by (auto_tac (claset(), simpset() addsimps [hypreal_inverse_distrib])); |
|
24 |
qed_spec_mp "hrealpow_inverse"; |
|
25 |
||
26 |
Goal "abs (r::hypreal) ^ n = abs (r ^ n)"; |
|
27 |
by (induct_tac "n" 1); |
|
28 |
by (auto_tac (claset(), simpset() addsimps [hrabs_mult])); |
|
29 |
qed "hrealpow_hrabs"; |
|
30 |
||
31 |
Goal "(r::hypreal) ^ (n + m) = (r ^ n) * (r ^ m)"; |
|
32 |
by (induct_tac "n" 1); |
|
33 |
by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac)); |
|
34 |
qed "hrealpow_add"; |
|
35 |
||
36 |
Goal "(r::hypreal) ^ 1 = r"; |
|
37 |
by (Simp_tac 1); |
|
38 |
qed "hrealpow_one"; |
|
39 |
Addsimps [hrealpow_one]; |
|
40 |
||
41 |
Goal "(r::hypreal) ^ 2 = r * r"; |
|
42 |
by (Simp_tac 1); |
|
43 |
qed "hrealpow_two"; |
|
44 |
||
45 |
Goal "(#0::hypreal) <= r --> #0 <= r ^ n"; |
|
46 |
by (induct_tac "n" 1); |
|
47 |
by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff])); |
|
48 |
qed_spec_mp "hrealpow_ge_zero"; |
|
49 |
||
50 |
Goal "(#0::hypreal) < r --> #0 < r ^ n"; |
|
51 |
by (induct_tac "n" 1); |
|
52 |
by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_mult_iff])); |
|
53 |
qed_spec_mp "hrealpow_gt_zero"; |
|
54 |
||
55 |
Goal "x <= y & (#0::hypreal) < x --> x ^ n <= y ^ n"; |
|
56 |
by (induct_tac "n" 1); |
|
57 |
by (auto_tac (claset() addSIs [hypreal_mult_le_mono], simpset())); |
|
58 |
by (asm_simp_tac (simpset() addsimps [hrealpow_ge_zero]) 1); |
|
59 |
qed_spec_mp "hrealpow_le"; |
|
60 |
||
61 |
Goal "x < y & (#0::hypreal) < x & 0 < n --> x ^ n < y ^ n"; |
|
62 |
by (induct_tac "n" 1); |
|
63 |
by (auto_tac (claset() addIs [hypreal_mult_less_mono,gr0I], |
|
64 |
simpset() addsimps [hrealpow_gt_zero])); |
|
65 |
qed "hrealpow_less"; |
|
66 |
||
67 |
Goal "#1 ^ n = (#1::hypreal)"; |
|
68 |
by (induct_tac "n" 1); |
|
69 |
by (Auto_tac); |
|
70 |
qed "hrealpow_eq_one"; |
|
71 |
Addsimps [hrealpow_eq_one]; |
|
72 |
||
73 |
Goal "abs(-(#1 ^ n)) = (#1::hypreal)"; |
|
74 |
by Auto_tac; |
|
75 |
qed "hrabs_minus_hrealpow_one"; |
|
76 |
Addsimps [hrabs_minus_hrealpow_one]; |
|
77 |
||
78 |
Goal "abs(#-1 ^ n) = (#1::hypreal)"; |
|
79 |
by (induct_tac "n" 1); |
|
80 |
by Auto_tac; |
|
81 |
qed "hrabs_hrealpow_minus_one"; |
|
82 |
Addsimps [hrabs_hrealpow_minus_one]; |
|
83 |
||
84 |
Goal "((r::hypreal) * s) ^ n = (r ^ n) * (s ^ n)"; |
|
85 |
by (induct_tac "n" 1); |
|
86 |
by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac)); |
|
87 |
qed "hrealpow_mult"; |
|
88 |
||
89 |
Goal "(#0::hypreal) <= r ^ 2"; |
|
90 |
by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff])); |
|
91 |
qed "hrealpow_two_le"; |
|
92 |
Addsimps [hrealpow_two_le]; |
|
93 |
||
94 |
Goal "(#0::hypreal) <= u ^ 2 + v ^ 2"; |
|
95 |
by (simp_tac (HOL_ss addsimps [hrealpow_two_le, |
|
96 |
rename_numerals hypreal_le_add_order]) 1); |
|
97 |
qed "hrealpow_two_le_add_order"; |
|
98 |
Addsimps [hrealpow_two_le_add_order]; |
|
99 |
||
100 |
Goal "(#0::hypreal) <= u ^ 2 + v ^ 2 + w ^ 2"; |
|
101 |
by (simp_tac (HOL_ss addsimps [hrealpow_two_le, |
|
102 |
rename_numerals hypreal_le_add_order]) 1); |
|
103 |
qed "hrealpow_two_le_add_order2"; |
|
104 |
Addsimps [hrealpow_two_le_add_order2]; |
|
105 |
||
106 |
Goal "(x ^ 2 + y ^ 2 + z ^ 2 = (#0::hypreal)) = (x = #0 & y = #0 & z = #0)"; |
|
107 |
by (simp_tac (HOL_ss addsimps |
|
108 |
[rename_numerals hypreal_three_squares_add_zero_iff, hrealpow_two]) 1); |
|
109 |
qed "hrealpow_three_squares_add_zero_iff"; |
|
110 |
Addsimps [hrealpow_three_squares_add_zero_iff]; |
|
111 |
||
112 |
Goal "abs(x ^ 2) = (x::hypreal) ^ 2"; |
|
113 |
by (auto_tac (claset(), |
|
114 |
simpset() addsimps [hrabs_def, hypreal_0_le_mult_iff])); |
|
115 |
qed "hrabs_hrealpow_two"; |
|
116 |
Addsimps [hrabs_hrealpow_two]; |
|
117 |
||
118 |
Goal "abs(x) ^ 2 = (x::hypreal) ^ 2"; |
|
119 |
by (simp_tac (simpset() addsimps [hrealpow_hrabs, hrabs_eqI1] |
|
120 |
delsimps [hpowr_Suc]) 1); |
|
121 |
qed "hrealpow_two_hrabs"; |
|
122 |
Addsimps [hrealpow_two_hrabs]; |
|
123 |
||
124 |
Goal "(#1::hypreal) < r ==> #1 < r ^ 2"; |
|
125 |
by (auto_tac (claset(), simpset() addsimps [hrealpow_two])); |
|
126 |
by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1); |
|
127 |
by (rtac hypreal_mult_less_mono 2); |
|
128 |
by Auto_tac; |
|
129 |
qed "hrealpow_two_gt_one"; |
|
130 |
||
131 |
Goal "(#1::hypreal) <= r ==> #1 <= r ^ 2"; |
|
132 |
by (etac (order_le_imp_less_or_eq RS disjE) 1); |
|
133 |
by (etac (hrealpow_two_gt_one RS order_less_imp_le) 1); |
|
134 |
by Auto_tac; |
|
135 |
qed "hrealpow_two_ge_one"; |
|
136 |
||
137 |
Goal "(#1::hypreal) <= #2 ^ n"; |
|
138 |
by (res_inst_tac [("y","#1 ^ n")] order_trans 1); |
|
139 |
by (rtac hrealpow_le 2); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
140 |
by Auto_tac; |
10751 | 141 |
qed "two_hrealpow_ge_one"; |
142 |
||
143 |
Goal "hypreal_of_nat n < #2 ^ n"; |
|
144 |
by (induct_tac "n" 1); |
|
145 |
by (auto_tac (claset(), |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
146 |
simpset() addsimps [hypreal_of_nat_Suc, hypreal_add_mult_distrib])); |
10751 | 147 |
by (cut_inst_tac [("n","n")] two_hrealpow_ge_one 1); |
148 |
by (arith_tac 1); |
|
149 |
qed "two_hrealpow_gt"; |
|
150 |
Addsimps [two_hrealpow_gt,two_hrealpow_ge_one]; |
|
151 |
||
152 |
Goal "#-1 ^ (2*n) = (#1::hypreal)"; |
|
153 |
by (induct_tac "n" 1); |
|
154 |
by (Auto_tac); |
|
155 |
qed "hrealpow_minus_one"; |
|
156 |
||
157 |
Goal "#-1 ^ (n + n) = (#1::hypreal)"; |
|
158 |
by (induct_tac "n" 1); |
|
159 |
by (Auto_tac); |
|
160 |
qed "hrealpow_minus_one2"; |
|
161 |
Addsimps [hrealpow_minus_one2]; |
|
162 |
||
163 |
Goal "(-(x::hypreal)) ^ 2 = x ^ 2"; |
|
164 |
by (Auto_tac); |
|
165 |
qed "hrealpow_minus_two"; |
|
166 |
Addsimps [hrealpow_minus_two]; |
|
167 |
||
168 |
Goal "(#0::hypreal) < r & r < #1 --> r ^ Suc n < r ^ n"; |
|
169 |
by (induct_tac "n" 1); |
|
170 |
by (auto_tac (claset(), |
|
171 |
simpset() addsimps [hypreal_mult_less_mono2])); |
|
172 |
qed_spec_mp "hrealpow_Suc_less"; |
|
173 |
||
174 |
Goal "(#0::hypreal) <= r & r < #1 --> r ^ Suc n <= r ^ n"; |
|
175 |
by (induct_tac "n" 1); |
|
176 |
by (auto_tac (claset() addIs [order_less_imp_le] |
|
177 |
addSDs [order_le_imp_less_or_eq,hrealpow_Suc_less], |
|
178 |
simpset() addsimps [hypreal_mult_less_mono2])); |
|
179 |
qed_spec_mp "hrealpow_Suc_le"; |
|
180 |
||
10834 | 181 |
Goal "Abs_hypreal(hyprel``{%n. X n}) ^ m = Abs_hypreal(hyprel``{%n. (X n) ^ m})"; |
10751 | 182 |
by (induct_tac "m" 1); |
183 |
by (auto_tac (claset(), |
|
184 |
simpset() delsimps [one_eq_numeral_1] |
|
185 |
addsimps [hypreal_one_def, hypreal_mult, |
|
186 |
one_eq_numeral_1 RS sym])); |
|
187 |
qed "hrealpow"; |
|
188 |
||
189 |
Goal "(x + (y::hypreal)) ^ 2 = \ |
|
190 |
\ x ^ 2 + y ^ 2 + (hypreal_of_nat 2)*x*y"; |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
191 |
by (simp_tac (simpset() addsimps |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
192 |
[hypreal_add_mult_distrib2, hypreal_add_mult_distrib, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
193 |
hypreal_of_nat_zero, hypreal_of_nat_Suc]) 1); |
10751 | 194 |
qed "hrealpow_sum_square_expand"; |
195 |
||
196 |
(*--------------------------------------------------------------- |
|
197 |
we'll prove the following theorem by going down to the |
|
198 |
level of the ultrafilter and relying on the analogous |
|
199 |
property for the real rather than prove it directly |
|
200 |
using induction: proof is much simpler this way! |
|
201 |
---------------------------------------------------------------*) |
|
202 |
Goal "[|(#0::hypreal) <= x; #0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y"; |
|
10784 | 203 |
by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 204 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
205 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
206 |
by (auto_tac (claset(), |
|
207 |
simpset() addsimps [hrealpow,hypreal_le,hypreal_mult])); |
|
208 |
by (ultra_tac (claset() addIs [realpow_increasing], simpset()) 1); |
|
209 |
qed "hrealpow_increasing"; |
|
210 |
||
211 |
(*By antisymmetry with the above we conclude x=y, replacing the deleted |
|
212 |
theorem hrealpow_Suc_cancel_eq*) |
|
213 |
||
214 |
Goal "x : HFinite --> x ^ n : HFinite"; |
|
215 |
by (induct_tac "n" 1); |
|
216 |
by (auto_tac (claset() addIs [HFinite_mult], simpset())); |
|
217 |
qed_spec_mp "hrealpow_HFinite"; |
|
218 |
||
219 |
(*--------------------------------------------------------------- |
|
220 |
Hypernaturals Powers |
|
221 |
--------------------------------------------------------------*) |
|
222 |
Goalw [congruent_def] |
|
223 |
"congruent hyprel \ |
|
10834 | 224 |
\ (%X Y. hyprel``{%n. ((X::nat=>real) n ^ (Y::nat=>nat) n)})"; |
10751 | 225 |
by (safe_tac (claset() addSIs [ext])); |
226 |
by (ALLGOALS(Fuf_tac)); |
|
227 |
qed "hyperpow_congruent"; |
|
228 |
||
229 |
Goalw [hyperpow_def] |
|
10834 | 230 |
"Abs_hypreal(hyprel``{%n. X n}) pow Abs_hypnat(hypnatrel``{%n. Y n}) = \ |
231 |
\ Abs_hypreal(hyprel``{%n. X n ^ Y n})"; |
|
10751 | 232 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1); |
233 |
by (auto_tac (claset() addSIs [lemma_hyprel_refl,bexI], |
|
234 |
simpset() addsimps [hyprel_in_hypreal RS |
|
235 |
Abs_hypreal_inverse,equiv_hyprel,hyperpow_congruent])); |
|
236 |
by (Fuf_tac 1); |
|
237 |
qed "hyperpow"; |
|
238 |
||
239 |
Goalw [hypnat_one_def] "(#0::hypreal) pow (n + 1hn) = #0"; |
|
10784 | 240 |
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 241 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
242 |
by (auto_tac (claset(), simpset() addsimps [hyperpow,hypnat_add])); |
|
243 |
qed "hyperpow_zero"; |
|
244 |
Addsimps [hyperpow_zero]; |
|
245 |
||
246 |
Goal "r ~= (#0::hypreal) --> r pow n ~= #0"; |
|
10784 | 247 |
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 248 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
249 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
250 |
by (auto_tac (claset(), simpset() addsimps [hyperpow])); |
|
251 |
by (dtac FreeUltrafilterNat_Compl_mem 1); |
|
252 |
by (fuf_empty_tac (claset() addIs [realpow_not_zero RS notE], |
|
253 |
simpset()) 1); |
|
254 |
qed_spec_mp "hyperpow_not_zero"; |
|
255 |
||
256 |
Goal "r ~= (#0::hypreal) --> inverse(r pow n) = (inverse r) pow n"; |
|
10784 | 257 |
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 258 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
259 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
260 |
by (auto_tac (claset() addSDs [FreeUltrafilterNat_Compl_mem], |
|
261 |
simpset() addsimps [hypreal_inverse,hyperpow])); |
|
262 |
by (rtac FreeUltrafilterNat_subset 1); |
|
263 |
by (auto_tac (claset() addDs [realpow_not_zero] |
|
264 |
addIs [realpow_inverse], |
|
265 |
simpset())); |
|
266 |
qed "hyperpow_inverse"; |
|
267 |
||
268 |
Goal "abs r pow n = abs (r pow n)"; |
|
269 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
270 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
271 |
by (auto_tac (claset(), |
|
272 |
simpset() addsimps [hypreal_hrabs, hyperpow,realpow_abs])); |
|
273 |
qed "hyperpow_hrabs"; |
|
274 |
||
275 |
Goal "r pow (n + m) = (r pow n) * (r pow m)"; |
|
276 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
277 |
by (res_inst_tac [("z","m")] eq_Abs_hypnat 1); |
|
278 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
279 |
by (auto_tac (claset(), |
|
280 |
simpset() addsimps [hyperpow,hypnat_add, hypreal_mult,realpow_add])); |
|
281 |
qed "hyperpow_add"; |
|
282 |
||
283 |
Goalw [hypnat_one_def] "r pow 1hn = r"; |
|
284 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
285 |
by (auto_tac (claset(), simpset() addsimps [hyperpow])); |
|
286 |
qed "hyperpow_one"; |
|
287 |
Addsimps [hyperpow_one]; |
|
288 |
||
289 |
Goalw [hypnat_one_def] |
|
10784 | 290 |
"r pow (1hn + 1hn) = r * r"; |
10751 | 291 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
292 |
by (auto_tac (claset(), |
|
10784 | 293 |
simpset() addsimps [hyperpow,hypnat_add, hypreal_mult])); |
10751 | 294 |
qed "hyperpow_two"; |
295 |
||
296 |
Goal "(#0::hypreal) < r --> #0 < r pow n"; |
|
10784 | 297 |
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 298 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
299 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
300 |
by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_gt_zero], |
|
301 |
simpset() addsimps [hyperpow,hypreal_less, hypreal_le])); |
|
302 |
qed_spec_mp "hyperpow_gt_zero"; |
|
303 |
||
304 |
Goal "(#0::hypreal) <= r --> #0 <= r pow n"; |
|
10784 | 305 |
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 306 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
307 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
10784 | 308 |
by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_ge_zero], |
10751 | 309 |
simpset() addsimps [hyperpow,hypreal_le])); |
10784 | 310 |
qed "hyperpow_ge_zero"; |
10751 | 311 |
|
312 |
Goal "(#0::hypreal) < x & x <= y --> x pow n <= y pow n"; |
|
10784 | 313 |
by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1); |
10751 | 314 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
315 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
316 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
10784 | 317 |
by (auto_tac (claset(), |
318 |
simpset() addsimps [hyperpow,hypreal_le,hypreal_less])); |
|
319 |
by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1 |
|
320 |
THEN assume_tac 1); |
|
321 |
by (auto_tac (claset() addIs [realpow_le], simpset())); |
|
10751 | 322 |
qed_spec_mp "hyperpow_le"; |
323 |
||
324 |
Goal "#1 pow n = (#1::hypreal)"; |
|
325 |
by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); |
|
326 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
327 |
by (auto_tac (claset(), simpset() addsimps [hyperpow])); |
|
328 |
qed "hyperpow_eq_one"; |
|
329 |
Addsimps [hyperpow_eq_one]; |
|
330 |
||
331 |
Goal "abs(-(#1 pow n)) = (#1::hypreal)"; |
|
332 |
by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); |
|
333 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
334 |
by (auto_tac (claset(), simpset() addsimps [hyperpow,hypreal_hrabs])); |
|
335 |
qed "hrabs_minus_hyperpow_one"; |
|
336 |
Addsimps [hrabs_minus_hyperpow_one]; |
|
337 |
||
338 |
Goal "abs(#-1 pow n) = (#1::hypreal)"; |
|
339 |
by (subgoal_tac "abs((-1hr) pow n) = 1hr" 1); |
|
340 |
by (Asm_full_simp_tac 1); |
|
341 |
by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1); |
|
342 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
343 |
by (auto_tac (claset(), |
|
344 |
simpset() addsimps [hyperpow,hypreal_minus,hypreal_hrabs])); |
|
345 |
qed "hrabs_hyperpow_minus_one"; |
|
346 |
Addsimps [hrabs_hyperpow_minus_one]; |
|
347 |
||
348 |
Goal "(r * s) pow n = (r pow n) * (s pow n)"; |
|
349 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
350 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
351 |
by (res_inst_tac [("z","s")] eq_Abs_hypreal 1); |
|
352 |
by (auto_tac (claset(), |
|
353 |
simpset() addsimps [hyperpow, hypreal_mult,realpow_mult])); |
|
354 |
qed "hyperpow_mult"; |
|
355 |
||
356 |
Goal "(#0::hypreal) <= r pow (1hn + 1hn)"; |
|
357 |
by (auto_tac (claset(), |
|
358 |
simpset() addsimps [hyperpow_two, hypreal_0_le_mult_iff])); |
|
359 |
qed "hyperpow_two_le"; |
|
360 |
Addsimps [hyperpow_two_le]; |
|
361 |
||
362 |
Goal "abs(x pow (1hn + 1hn)) = x pow (1hn + 1hn)"; |
|
363 |
by (simp_tac (simpset() addsimps [hrabs_eqI1]) 1); |
|
364 |
qed "hrabs_hyperpow_two"; |
|
365 |
Addsimps [hrabs_hyperpow_two]; |
|
366 |
||
367 |
Goal "abs(x) pow (1hn + 1hn) = x pow (1hn + 1hn)"; |
|
368 |
by (simp_tac (simpset() addsimps [hyperpow_hrabs,hrabs_eqI1]) 1); |
|
369 |
qed "hyperpow_two_hrabs"; |
|
370 |
Addsimps [hyperpow_two_hrabs]; |
|
371 |
||
372 |
(*? very similar to hrealpow_two_gt_one *) |
|
373 |
Goal "(#1::hypreal) < r ==> #1 < r pow (1hn + 1hn)"; |
|
374 |
by (auto_tac (claset(), simpset() addsimps [hyperpow_two])); |
|
375 |
by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1); |
|
376 |
by (rtac hypreal_mult_less_mono 2); |
|
377 |
by Auto_tac; |
|
378 |
qed "hyperpow_two_gt_one"; |
|
379 |
||
380 |
Goal "(#1::hypreal) <= r ==> #1 <= r pow (1hn + 1hn)"; |
|
381 |
by (auto_tac (claset() addSDs [order_le_imp_less_or_eq] |
|
382 |
addIs [hyperpow_two_gt_one,order_less_imp_le], |
|
383 |
simpset())); |
|
384 |
qed "hyperpow_two_ge_one"; |
|
385 |
||
386 |
Goal "(#1::hypreal) <= #2 pow n"; |
|
387 |
by (res_inst_tac [("y","#1 pow n")] order_trans 1); |
|
388 |
by (rtac hyperpow_le 2); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
389 |
by Auto_tac; |
10751 | 390 |
qed "two_hyperpow_ge_one"; |
391 |
Addsimps [two_hyperpow_ge_one]; |
|
392 |
||
393 |
Addsimps [simplify (simpset()) realpow_minus_one]; |
|
394 |
||
395 |
Goal "#-1 pow ((1hn + 1hn)*n) = (#1::hypreal)"; |
|
396 |
by (subgoal_tac "(-(1hr)) pow ((1hn + 1hn)*n) = 1hr" 1); |
|
397 |
by (Asm_full_simp_tac 1); |
|
398 |
by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1); |
|
399 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
400 |
by (auto_tac (claset(), |
|
401 |
simpset() addsimps [hyperpow, hypnat_add,hypreal_minus])); |
|
402 |
qed "hyperpow_minus_one2"; |
|
403 |
Addsimps [hyperpow_minus_one2]; |
|
404 |
||
405 |
Goalw [hypnat_one_def] |
|
406 |
"(#0::hypreal) < r & r < #1 --> r pow (n + 1hn) < r pow n"; |
|
407 |
by (full_simp_tac |
|
408 |
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def, |
|
409 |
one_eq_numeral_1 RS sym, hypreal_one_def]) 1); |
|
410 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
411 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
412 |
by (auto_tac (claset() addSDs [conjI RS realpow_Suc_less] |
|
413 |
addEs [FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset], |
|
414 |
simpset() addsimps [hyperpow,hypreal_less,hypnat_add])); |
|
415 |
qed_spec_mp "hyperpow_Suc_less"; |
|
416 |
||
417 |
Goalw [hypnat_one_def] |
|
418 |
"#0 <= r & r < (#1::hypreal) --> r pow (n + 1hn) <= r pow n"; |
|
419 |
by (full_simp_tac |
|
420 |
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def, |
|
421 |
one_eq_numeral_1 RS sym, hypreal_one_def]) 1); |
|
422 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
423 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
424 |
by (auto_tac (claset() addSDs [conjI RS realpow_Suc_le] addEs |
|
425 |
[FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset ], |
|
426 |
simpset() addsimps [hyperpow,hypreal_le,hypnat_add, |
|
427 |
hypreal_less])); |
|
428 |
qed_spec_mp "hyperpow_Suc_le"; |
|
429 |
||
430 |
Goalw [hypnat_one_def] |
|
431 |
"(#0::hypreal) <= r & r < #1 & n < N --> r pow N <= r pow n"; |
|
432 |
by (full_simp_tac |
|
433 |
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def, |
|
434 |
one_eq_numeral_1 RS sym, hypreal_one_def]) 1); |
|
435 |
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1); |
|
436 |
by (res_inst_tac [("z","N")] eq_Abs_hypnat 1); |
|
437 |
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1); |
|
438 |
by (auto_tac (claset(), |
|
439 |
simpset() addsimps [hyperpow, hypreal_le,hypreal_less,hypnat_less])); |
|
440 |
by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1); |
|
441 |
by (etac FreeUltrafilterNat_Int 1); |
|
442 |
by (auto_tac (claset() addSDs [conjI RS realpow_less_le], |
|
443 |
simpset())); |
|
444 |
qed_spec_mp "hyperpow_less_le"; |
|
445 |
||
446 |
Goal "[| (#0::hypreal) <= r; r < #1 |] \ |
|
447 |
\ ==> ALL N n. n < N --> r pow N <= r pow n"; |
|
448 |
by (blast_tac (claset() addSIs [hyperpow_less_le]) 1); |
|
449 |
qed "hyperpow_less_le2"; |
|
450 |
||
451 |
Goal "[| #0 <= r; r < (#1::hypreal); N : HNatInfinite |] \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
452 |
\ ==> ALL n: SNat. r pow N <= r pow n"; |
10751 | 453 |
by (auto_tac (claset() addSIs [hyperpow_less_le], |
454 |
simpset() addsimps [HNatInfinite_iff])); |
|
455 |
qed "hyperpow_SHNat_le"; |
|
456 |
||
457 |
Goalw [hypreal_of_real_def,hypnat_of_nat_def] |
|
458 |
"(hypreal_of_real r) pow (hypnat_of_nat n) = hypreal_of_real (r ^ n)"; |
|
459 |
by (auto_tac (claset(), simpset() addsimps [hyperpow])); |
|
460 |
qed "hyperpow_realpow"; |
|
461 |
||
462 |
Goalw [SReal_def] |
|
463 |
"(hypreal_of_real r) pow (hypnat_of_nat n) : SReal"; |
|
464 |
by (auto_tac (claset(), simpset() addsimps [hyperpow_realpow])); |
|
465 |
qed "hyperpow_SReal"; |
|
466 |
Addsimps [hyperpow_SReal]; |
|
467 |
||
468 |
Goal "N : HNatInfinite ==> (#0::hypreal) pow N = 0"; |
|
469 |
by (dtac HNatInfinite_is_Suc 1); |
|
470 |
by (Auto_tac); |
|
471 |
qed "hyperpow_zero_HNatInfinite"; |
|
472 |
Addsimps [hyperpow_zero_HNatInfinite]; |
|
473 |
||
474 |
Goal "[| (#0::hypreal) <= r; r < #1; n <= N |] ==> r pow N <= r pow n"; |
|
475 |
by (dres_inst_tac [("y","N")] hypnat_le_imp_less_or_eq 1); |
|
476 |
by (auto_tac (claset() addIs [hyperpow_less_le], simpset())); |
|
477 |
qed "hyperpow_le_le"; |
|
478 |
||
479 |
Goal "[| (#0::hypreal) < r; r < #1 |] ==> r pow (n + 1hn) <= r"; |
|
480 |
by (dres_inst_tac [("n","1hn")] (order_less_imp_le RS hyperpow_le_le) 1); |
|
481 |
by (Auto_tac); |
|
482 |
qed "hyperpow_Suc_le_self"; |
|
483 |
||
484 |
Goal "[| (#0::hypreal) <= r; r < #1 |] ==> r pow (n + 1hn) <= r"; |
|
485 |
by (dres_inst_tac [("n","1hn")] hyperpow_le_le 1); |
|
486 |
by (Auto_tac); |
|
487 |
qed "hyperpow_Suc_le_self2"; |
|
488 |
||
489 |
Goalw [Infinitesimal_def] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
490 |
"[| x : Infinitesimal; 0 < N |] ==> abs (x pow N) <= abs x"; |
10751 | 491 |
by (auto_tac (claset() addSIs [hyperpow_Suc_le_self2], |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
492 |
simpset() addsimps [hyperpow_hrabs RS sym, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
493 |
hypnat_gt_zero_iff2, hrabs_ge_zero])); |
10751 | 494 |
qed "lemma_Infinitesimal_hyperpow"; |
495 |
||
496 |
Goal "[| x : Infinitesimal; 0 < N |] ==> x pow N : Infinitesimal"; |
|
497 |
by (rtac hrabs_le_Infinitesimal 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
498 |
by (rtac lemma_Infinitesimal_hyperpow 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
499 |
by Auto_tac; |
10751 | 500 |
qed "Infinitesimal_hyperpow"; |
501 |
||
502 |
Goalw [hypnat_of_nat_def] |
|
503 |
"(x ^ n : Infinitesimal) = (x pow (hypnat_of_nat n) : Infinitesimal)"; |
|
504 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
505 |
by (auto_tac (claset(), simpset() addsimps [hrealpow, hyperpow])); |
|
506 |
qed "hrealpow_hyperpow_Infinitesimal_iff"; |
|
507 |
||
508 |
Goal "[| x : Infinitesimal; 0 < n |] ==> x ^ n : Infinitesimal"; |
|
509 |
by (auto_tac (claset() addSIs [Infinitesimal_hyperpow], |
|
510 |
simpset() addsimps [hrealpow_hyperpow_Infinitesimal_iff, |
|
511 |
hypnat_of_nat_less_iff,hypnat_of_nat_zero] |
|
512 |
delsimps [hypnat_of_nat_less_iff RS sym])); |
|
513 |
qed "Infinitesimal_hrealpow"; |