| author | wenzelm | 
| Sun, 14 Oct 2001 20:06:13 +0200 | |
| changeset 11757 | 122be3f5b4b7 | 
| parent 11713 | 883d559b0b8c | 
| child 12018 | ec054019c910 | 
| 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
9  | 
Goal "(Numeral0::hypreal) ^ (Suc n) = 0";  | 
| 10751 | 10  | 
by (Auto_tac);  | 
11  | 
qed "hrealpow_zero";  | 
|
12  | 
Addsimps [hrealpow_zero];  | 
|
13  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
14  | 
Goal "r ~= (Numeral0::hypreal) --> r ^ n ~= 0";  | 
| 10751 | 15  | 
by (induct_tac "n" 1);  | 
16  | 
by Auto_tac;  | 
|
17  | 
qed_spec_mp "hrealpow_not_zero";  | 
|
18  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
19  | 
Goal "r ~= (Numeral0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
36  | 
Goal "(r::hypreal) ^ Suc 0 = r";  | 
| 10751 | 37  | 
by (Simp_tac 1);  | 
38  | 
qed "hrealpow_one";  | 
|
39  | 
Addsimps [hrealpow_one];  | 
|
40  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
41  | 
Goal "(r::hypreal) ^ Suc (Suc 0) = r * r";  | 
| 10751 | 42  | 
by (Simp_tac 1);  | 
43  | 
qed "hrealpow_two";  | 
|
44  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
45  | 
Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r ^ n";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
50  | 
Goal "(Numeral0::hypreal) < r --> Numeral0 < r ^ n";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
55  | 
Goal "x <= y & (Numeral0::hypreal) < x --> x ^ n <= y ^ n";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
61  | 
Goal "x < y & (Numeral0::hypreal) < x & 0 < n --> x ^ n < y ^ n";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
67  | 
Goal "Numeral1 ^ n = (Numeral1::hypreal)";  | 
| 10751 | 68  | 
by (induct_tac "n" 1);  | 
69  | 
by (Auto_tac);  | 
|
70  | 
qed "hrealpow_eq_one";  | 
|
71  | 
Addsimps [hrealpow_eq_one];  | 
|
72  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
73  | 
Goal "abs(-(Numeral1 ^ n)) = (Numeral1::hypreal)";  | 
| 10751 | 74  | 
by Auto_tac;  | 
75  | 
qed "hrabs_minus_hrealpow_one";  | 
|
76  | 
Addsimps [hrabs_minus_hrealpow_one];  | 
|
77  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
78  | 
Goal "abs(-1 ^ n) = (Numeral1::hypreal)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
89  | 
Goal "(Numeral0::hypreal) <= r ^Suc (Suc 0)";  | 
| 10751 | 90  | 
by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));  | 
91  | 
qed "hrealpow_two_le";  | 
|
92  | 
Addsimps [hrealpow_two_le];  | 
|
93  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
94  | 
Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
100  | 
Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
106  | 
Goal "(x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = (Numeral0::hypreal)) = (x = Numeral0 & y = Numeral0 & z = Numeral0)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
112  | 
Goal "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
118  | 
Goal "abs(x) ^ Suc (Suc 0) = (x::hypreal) ^ Suc (Suc 0)";  | 
| 10751 | 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  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
124  | 
Goal "(Numeral1::hypreal) < r ==> Numeral1 < r ^ Suc (Suc 0)";  | 
| 10751 | 125  | 
by (auto_tac (claset(), simpset() addsimps [hrealpow_two]));  | 
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
126  | 
by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
 | 
| 10751 | 127  | 
by (rtac hypreal_mult_less_mono 2);  | 
128  | 
by Auto_tac;  | 
|
129  | 
qed "hrealpow_two_gt_one";  | 
|
130  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
131  | 
Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r ^ Suc (Suc 0)";  | 
| 10751 | 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  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
137  | 
Goal "(Numeral1::hypreal) <= 2 ^ n";  | 
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
138  | 
by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
 | 
| 10751 | 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  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
143  | 
Goal "hypreal_of_nat n < 2 ^ n";  | 
| 10751 | 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  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
152  | 
Goal "-1 ^ (2*n) = (Numeral1::hypreal)";  | 
| 10751 | 153  | 
by (induct_tac "n" 1);  | 
154  | 
by (Auto_tac);  | 
|
155  | 
qed "hrealpow_minus_one";  | 
|
156  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
157  | 
Goal "n+n = (2*n::nat)";  | 
| 
11377
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
158  | 
by Auto_tac;  | 
| 
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
159  | 
qed "double_lemma";  | 
| 
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
160  | 
|
| 
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
161  | 
(*ugh: need to get rid fo the n+n*)  | 
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
162  | 
Goal "-1 ^ (n + n) = (Numeral1::hypreal)";  | 
| 
11377
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
163  | 
by (auto_tac (claset(),  | 
| 
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
164  | 
simpset() addsimps [double_lemma, hrealpow_minus_one]));  | 
| 10751 | 165  | 
qed "hrealpow_minus_one2";  | 
166  | 
Addsimps [hrealpow_minus_one2];  | 
|
167  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
168  | 
Goal "(-(x::hypreal)) ^ Suc (Suc 0) = x ^ Suc (Suc 0)";  | 
| 10751 | 169  | 
by (Auto_tac);  | 
170  | 
qed "hrealpow_minus_two";  | 
|
171  | 
Addsimps [hrealpow_minus_two];  | 
|
172  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
173  | 
Goal "(Numeral0::hypreal) < r & r < Numeral1 --> r ^ Suc n < r ^ n";  | 
| 10751 | 174  | 
by (induct_tac "n" 1);  | 
175  | 
by (auto_tac (claset(),  | 
|
176  | 
simpset() addsimps [hypreal_mult_less_mono2]));  | 
|
177  | 
qed_spec_mp "hrealpow_Suc_less";  | 
|
178  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
179  | 
Goal "(Numeral0::hypreal) <= r & r < Numeral1 --> r ^ Suc n <= r ^ n";  | 
| 10751 | 180  | 
by (induct_tac "n" 1);  | 
181  | 
by (auto_tac (claset() addIs [order_less_imp_le]  | 
|
182  | 
addSDs [order_le_imp_less_or_eq,hrealpow_Suc_less],  | 
|
183  | 
simpset() addsimps [hypreal_mult_less_mono2]));  | 
|
184  | 
qed_spec_mp "hrealpow_Suc_le";  | 
|
185  | 
||
| 10834 | 186  | 
Goal "Abs_hypreal(hyprel``{%n. X n}) ^ m = Abs_hypreal(hyprel``{%n. (X n) ^ m})";
 | 
| 10751 | 187  | 
by (induct_tac "m" 1);  | 
188  | 
by (auto_tac (claset(),  | 
|
189  | 
simpset() delsimps [one_eq_numeral_1]  | 
|
190  | 
addsimps [hypreal_one_def, hypreal_mult,  | 
|
191  | 
one_eq_numeral_1 RS sym]));  | 
|
192  | 
qed "hrealpow";  | 
|
193  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
194  | 
Goal "(x + (y::hypreal)) ^ Suc (Suc 0) = \  | 
| 
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
195  | 
\ x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + (hypreal_of_nat (Suc (Suc 0)))*x*y";  | 
| 
10778
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
196  | 
by (simp_tac (simpset() addsimps  | 
| 
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
197  | 
[hypreal_add_mult_distrib2, hypreal_add_mult_distrib,  | 
| 
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
198  | 
hypreal_of_nat_zero, hypreal_of_nat_Suc]) 1);  | 
| 10751 | 199  | 
qed "hrealpow_sum_square_expand";  | 
200  | 
||
201  | 
(*---------------------------------------------------------------  | 
|
202  | 
we'll prove the following theorem by going down to the  | 
|
203  | 
level of the ultrafilter and relying on the analogous  | 
|
204  | 
property for the real rather than prove it directly  | 
|
205  | 
using induction: proof is much simpler this way!  | 
|
206  | 
---------------------------------------------------------------*)  | 
|
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
207  | 
Goal "[|(Numeral0::hypreal) <= x; Numeral0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";  | 
| 10784 | 208  | 
by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 209  | 
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
 | 
210  | 
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
 | 
|
211  | 
by (auto_tac (claset(),  | 
|
212  | 
simpset() addsimps [hrealpow,hypreal_le,hypreal_mult]));  | 
|
213  | 
by (ultra_tac (claset() addIs [realpow_increasing], simpset()) 1);  | 
|
214  | 
qed "hrealpow_increasing";  | 
|
215  | 
||
216  | 
(*By antisymmetry with the above we conclude x=y, replacing the deleted  | 
|
217  | 
theorem hrealpow_Suc_cancel_eq*)  | 
|
218  | 
||
219  | 
Goal "x : HFinite --> x ^ n : HFinite";  | 
|
220  | 
by (induct_tac "n" 1);  | 
|
221  | 
by (auto_tac (claset() addIs [HFinite_mult], simpset()));  | 
|
222  | 
qed_spec_mp "hrealpow_HFinite";  | 
|
223  | 
||
224  | 
(*---------------------------------------------------------------  | 
|
225  | 
Hypernaturals Powers  | 
|
226  | 
--------------------------------------------------------------*)  | 
|
227  | 
Goalw [congruent_def]  | 
|
228  | 
"congruent hyprel \  | 
|
| 10834 | 229  | 
\    (%X Y. hyprel``{%n. ((X::nat=>real) n ^ (Y::nat=>nat) n)})";
 | 
| 10751 | 230  | 
by (safe_tac (claset() addSIs [ext]));  | 
231  | 
by (ALLGOALS(Fuf_tac));  | 
|
232  | 
qed "hyperpow_congruent";  | 
|
233  | 
||
234  | 
Goalw [hyperpow_def]  | 
|
| 10834 | 235  | 
  "Abs_hypreal(hyprel``{%n. X n}) pow Abs_hypnat(hypnatrel``{%n. Y n}) = \
 | 
236  | 
\  Abs_hypreal(hyprel``{%n. X n ^ Y n})";
 | 
|
| 10751 | 237  | 
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
 | 
238  | 
by (auto_tac (claset() addSIs [lemma_hyprel_refl,bexI],  | 
|
239  | 
simpset() addsimps [hyprel_in_hypreal RS  | 
|
240  | 
Abs_hypreal_inverse,equiv_hyprel,hyperpow_congruent]));  | 
|
241  | 
by (Fuf_tac 1);  | 
|
242  | 
qed "hyperpow";  | 
|
243  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
244  | 
Goalw [hypnat_one_def] "(Numeral0::hypreal) pow (n + (1::hypnat)) = Numeral0";  | 
| 10784 | 245  | 
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 246  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
247  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow,hypnat_add]));  | 
|
248  | 
qed "hyperpow_zero";  | 
|
249  | 
Addsimps [hyperpow_zero];  | 
|
250  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
251  | 
Goal "r ~= (Numeral0::hypreal) --> r pow n ~= Numeral0";  | 
| 10784 | 252  | 
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 253  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
254  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
255  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow]));  | 
|
256  | 
by (dtac FreeUltrafilterNat_Compl_mem 1);  | 
|
257  | 
by (fuf_empty_tac (claset() addIs [realpow_not_zero RS notE],  | 
|
258  | 
simpset()) 1);  | 
|
259  | 
qed_spec_mp "hyperpow_not_zero";  | 
|
260  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
261  | 
Goal "r ~= (Numeral0::hypreal) --> inverse(r pow n) = (inverse r) pow n";  | 
| 10784 | 262  | 
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 263  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
264  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
265  | 
by (auto_tac (claset() addSDs [FreeUltrafilterNat_Compl_mem],  | 
|
266  | 
simpset() addsimps [hypreal_inverse,hyperpow]));  | 
|
267  | 
by (rtac FreeUltrafilterNat_subset 1);  | 
|
268  | 
by (auto_tac (claset() addDs [realpow_not_zero]  | 
|
269  | 
addIs [realpow_inverse],  | 
|
270  | 
simpset()));  | 
|
271  | 
qed "hyperpow_inverse";  | 
|
272  | 
||
273  | 
Goal "abs r pow n = abs (r pow n)";  | 
|
274  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
275  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
276  | 
by (auto_tac (claset(),  | 
|
277  | 
simpset() addsimps [hypreal_hrabs, hyperpow,realpow_abs]));  | 
|
278  | 
qed "hyperpow_hrabs";  | 
|
279  | 
||
280  | 
Goal "r pow (n + m) = (r pow n) * (r pow m)";  | 
|
281  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
282  | 
by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
 | 
|
283  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
284  | 
by (auto_tac (claset(),  | 
|
285  | 
simpset() addsimps [hyperpow,hypnat_add, hypreal_mult,realpow_add]));  | 
|
286  | 
qed "hyperpow_add";  | 
|
287  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
288  | 
Goalw [hypnat_one_def] "r pow (1::hypnat) = r";  | 
| 10751 | 289  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
290  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow]));  | 
|
291  | 
qed "hyperpow_one";  | 
|
292  | 
Addsimps [hyperpow_one];  | 
|
293  | 
||
294  | 
Goalw [hypnat_one_def]  | 
|
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
295  | 
"r pow ((1::hypnat) + (1::hypnat)) = r * r";  | 
| 10751 | 296  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
297  | 
by (auto_tac (claset(),  | 
|
| 10784 | 298  | 
simpset() addsimps [hyperpow,hypnat_add, hypreal_mult]));  | 
| 10751 | 299  | 
qed "hyperpow_two";  | 
300  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
301  | 
Goal "(Numeral0::hypreal) < r --> Numeral0 < r pow n";  | 
| 10784 | 302  | 
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 303  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
304  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
305  | 
by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_gt_zero],  | 
|
306  | 
simpset() addsimps [hyperpow,hypreal_less, hypreal_le]));  | 
|
307  | 
qed_spec_mp "hyperpow_gt_zero";  | 
|
308  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
309  | 
Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r pow n";  | 
| 10784 | 310  | 
by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 311  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
312  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
| 10784 | 313  | 
by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_ge_zero],  | 
| 10751 | 314  | 
simpset() addsimps [hyperpow,hypreal_le]));  | 
| 10784 | 315  | 
qed "hyperpow_ge_zero";  | 
| 10751 | 316  | 
|
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
317  | 
Goal "(Numeral0::hypreal) < x & x <= y --> x pow n <= y pow n";  | 
| 10784 | 318  | 
by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);  | 
| 10751 | 319  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
320  | 
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
 | 
|
321  | 
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
 | 
|
| 10784 | 322  | 
by (auto_tac (claset(),  | 
323  | 
simpset() addsimps [hyperpow,hypreal_le,hypreal_less]));  | 
|
324  | 
by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1  | 
|
325  | 
THEN assume_tac 1);  | 
|
326  | 
by (auto_tac (claset() addIs [realpow_le], simpset()));  | 
|
| 10751 | 327  | 
qed_spec_mp "hyperpow_le";  | 
328  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
329  | 
Goal "Numeral1 pow n = (Numeral1::hypreal)";  | 
| 10751 | 330  | 
by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);  | 
331  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
332  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow]));  | 
|
333  | 
qed "hyperpow_eq_one";  | 
|
334  | 
Addsimps [hyperpow_eq_one];  | 
|
335  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
336  | 
Goal "abs(-(Numeral1 pow n)) = (Numeral1::hypreal)";  | 
| 10751 | 337  | 
by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);  | 
338  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
339  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow,hypreal_hrabs]));  | 
|
340  | 
qed "hrabs_minus_hyperpow_one";  | 
|
341  | 
Addsimps [hrabs_minus_hyperpow_one];  | 
|
342  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
343  | 
Goal "abs(-1 pow n) = (Numeral1::hypreal)";  | 
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
344  | 
by (subgoal_tac "abs((- (1::hypreal)) pow n) = (1::hypreal)" 1);  | 
| 10751 | 345  | 
by (Asm_full_simp_tac 1);  | 
346  | 
by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);  | 
|
347  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
348  | 
by (auto_tac (claset(),  | 
|
349  | 
simpset() addsimps [hyperpow,hypreal_minus,hypreal_hrabs]));  | 
|
350  | 
qed "hrabs_hyperpow_minus_one";  | 
|
351  | 
Addsimps [hrabs_hyperpow_minus_one];  | 
|
352  | 
||
353  | 
Goal "(r * s) pow n = (r pow n) * (s pow n)";  | 
|
354  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
355  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
356  | 
by (res_inst_tac [("z","s")] eq_Abs_hypreal 1);
 | 
|
357  | 
by (auto_tac (claset(),  | 
|
358  | 
simpset() addsimps [hyperpow, hypreal_mult,realpow_mult]));  | 
|
359  | 
qed "hyperpow_mult";  | 
|
360  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
361  | 
Goal "(Numeral0::hypreal) <= r pow ((1::hypnat) + (1::hypnat))";  | 
| 10751 | 362  | 
by (auto_tac (claset(),  | 
363  | 
simpset() addsimps [hyperpow_two, hypreal_0_le_mult_iff]));  | 
|
364  | 
qed "hyperpow_two_le";  | 
|
365  | 
Addsimps [hyperpow_two_le];  | 
|
366  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
367  | 
Goal "abs(x pow ((1::hypnat) + (1::hypnat))) = x pow ((1::hypnat) + (1::hypnat))";  | 
| 10751 | 368  | 
by (simp_tac (simpset() addsimps [hrabs_eqI1]) 1);  | 
369  | 
qed "hrabs_hyperpow_two";  | 
|
370  | 
Addsimps [hrabs_hyperpow_two];  | 
|
371  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
372  | 
Goal "abs(x) pow ((1::hypnat) + (1::hypnat)) = x pow ((1::hypnat) + (1::hypnat))";  | 
| 10751 | 373  | 
by (simp_tac (simpset() addsimps [hyperpow_hrabs,hrabs_eqI1]) 1);  | 
374  | 
qed "hyperpow_two_hrabs";  | 
|
375  | 
Addsimps [hyperpow_two_hrabs];  | 
|
376  | 
||
377  | 
(*? very similar to hrealpow_two_gt_one *)  | 
|
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
378  | 
Goal "(Numeral1::hypreal) < r ==> Numeral1 < r pow ((1::hypnat) + (1::hypnat))";  | 
| 10751 | 379  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow_two]));  | 
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
380  | 
by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
 | 
| 10751 | 381  | 
by (rtac hypreal_mult_less_mono 2);  | 
382  | 
by Auto_tac;  | 
|
383  | 
qed "hyperpow_two_gt_one";  | 
|
384  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
385  | 
Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r pow ((1::hypnat) + (1::hypnat))";  | 
| 10751 | 386  | 
by (auto_tac (claset() addSDs [order_le_imp_less_or_eq]  | 
387  | 
addIs [hyperpow_two_gt_one,order_less_imp_le],  | 
|
388  | 
simpset()));  | 
|
389  | 
qed "hyperpow_two_ge_one";  | 
|
390  | 
||
| 
11704
 
3c50a2cd6f00
* sane numerals (stage 2): plain "num" syntax (removed "#");
 
wenzelm 
parents: 
11701 
diff
changeset
 | 
391  | 
Goal "(Numeral1::hypreal) <= 2 pow n";  | 
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
392  | 
by (res_inst_tac [("y","Numeral1 pow n")] order_trans 1);
 | 
| 10751 | 393  | 
by (rtac hyperpow_le 2);  | 
| 
10778
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
394  | 
by Auto_tac;  | 
| 10751 | 395  | 
qed "two_hyperpow_ge_one";  | 
396  | 
Addsimps [two_hyperpow_ge_one];  | 
|
397  | 
||
398  | 
Addsimps [simplify (simpset()) realpow_minus_one];  | 
|
399  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
400  | 
Goal "-1 pow (((1::hypnat) + (1::hypnat))*n) = (Numeral1::hypreal)";  | 
| 
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
401  | 
by (subgoal_tac "(-((1::hypreal))) pow (((1::hypnat) + (1::hypnat))*n) = (1::hypreal)" 1);  | 
| 10751 | 402  | 
by (Asm_full_simp_tac 1);  | 
403  | 
by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);  | 
|
404  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
405  | 
by (auto_tac (claset(),  | 
|
| 
11377
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
406  | 
simpset() addsimps [double_lemma, hyperpow, hypnat_add,  | 
| 
 
0f16ad464c62
Simprocs for type "nat" no longer introduce numerals unless they are already
 
paulson 
parents: 
10919 
diff
changeset
 | 
407  | 
hypreal_minus]));  | 
| 10751 | 408  | 
qed "hyperpow_minus_one2";  | 
409  | 
Addsimps [hyperpow_minus_one2];  | 
|
410  | 
||
411  | 
Goalw [hypnat_one_def]  | 
|
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
412  | 
"(Numeral0::hypreal) < r & r < Numeral1 --> r pow (n + (1::hypnat)) < r pow n";  | 
| 10751 | 413  | 
by (full_simp_tac  | 
414  | 
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,  | 
|
415  | 
one_eq_numeral_1 RS sym, hypreal_one_def]) 1);  | 
|
416  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
417  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
418  | 
by (auto_tac (claset() addSDs [conjI RS realpow_Suc_less]  | 
|
419  | 
addEs [FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset],  | 
|
420  | 
simpset() addsimps [hyperpow,hypreal_less,hypnat_add]));  | 
|
421  | 
qed_spec_mp "hyperpow_Suc_less";  | 
|
422  | 
||
423  | 
Goalw [hypnat_one_def]  | 
|
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
424  | 
"Numeral0 <= r & r < (Numeral1::hypreal) --> r pow (n + (1::hypnat)) <= r pow n";  | 
| 10751 | 425  | 
by (full_simp_tac  | 
426  | 
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,  | 
|
427  | 
one_eq_numeral_1 RS sym, hypreal_one_def]) 1);  | 
|
428  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
429  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
430  | 
by (auto_tac (claset() addSDs [conjI RS realpow_Suc_le] addEs  | 
|
431  | 
[FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset ],  | 
|
432  | 
simpset() addsimps [hyperpow,hypreal_le,hypnat_add,  | 
|
433  | 
hypreal_less]));  | 
|
434  | 
qed_spec_mp "hyperpow_Suc_le";  | 
|
435  | 
||
436  | 
Goalw [hypnat_one_def]  | 
|
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
437  | 
"(Numeral0::hypreal) <= r & r < Numeral1 & n < N --> r pow N <= r pow n";  | 
| 10751 | 438  | 
by (full_simp_tac  | 
439  | 
(HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,  | 
|
440  | 
one_eq_numeral_1 RS sym, hypreal_one_def]) 1);  | 
|
441  | 
by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
 | 
|
442  | 
by (res_inst_tac [("z","N")] eq_Abs_hypnat 1);
 | 
|
443  | 
by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
 | 
|
444  | 
by (auto_tac (claset(),  | 
|
445  | 
simpset() addsimps [hyperpow, hypreal_le,hypreal_less,hypnat_less]));  | 
|
446  | 
by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1);  | 
|
447  | 
by (etac FreeUltrafilterNat_Int 1);  | 
|
448  | 
by (auto_tac (claset() addSDs [conjI RS realpow_less_le],  | 
|
449  | 
simpset()));  | 
|
450  | 
qed_spec_mp "hyperpow_less_le";  | 
|
451  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
452  | 
Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] \  | 
| 10751 | 453  | 
\ ==> ALL N n. n < N --> r pow N <= r pow n";  | 
454  | 
by (blast_tac (claset() addSIs [hyperpow_less_le]) 1);  | 
|
455  | 
qed "hyperpow_less_le2";  | 
|
456  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
457  | 
Goal "[| Numeral0 <= r; r < (Numeral1::hypreal); N : HNatInfinite |] \  | 
| 
10919
 
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
 
paulson 
parents: 
10834 
diff
changeset
 | 
458  | 
\ ==> ALL n: Nats. r pow N <= r pow n";  | 
| 10751 | 459  | 
by (auto_tac (claset() addSIs [hyperpow_less_le],  | 
460  | 
simpset() addsimps [HNatInfinite_iff]));  | 
|
461  | 
qed "hyperpow_SHNat_le";  | 
|
462  | 
||
463  | 
Goalw [hypreal_of_real_def,hypnat_of_nat_def]  | 
|
464  | 
"(hypreal_of_real r) pow (hypnat_of_nat n) = hypreal_of_real (r ^ n)";  | 
|
465  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow]));  | 
|
466  | 
qed "hyperpow_realpow";  | 
|
467  | 
||
468  | 
Goalw [SReal_def]  | 
|
| 
10919
 
144ede948e58
renamings: real_of_nat, real_of_int -> (overloaded) real
 
paulson 
parents: 
10834 
diff
changeset
 | 
469  | 
"(hypreal_of_real r) pow (hypnat_of_nat n) : Reals";  | 
| 10751 | 470  | 
by (auto_tac (claset(), simpset() addsimps [hyperpow_realpow]));  | 
471  | 
qed "hyperpow_SReal";  | 
|
472  | 
Addsimps [hyperpow_SReal];  | 
|
473  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
474  | 
Goal "N : HNatInfinite ==> (Numeral0::hypreal) pow N = 0";  | 
| 10751 | 475  | 
by (dtac HNatInfinite_is_Suc 1);  | 
476  | 
by (Auto_tac);  | 
|
477  | 
qed "hyperpow_zero_HNatInfinite";  | 
|
478  | 
Addsimps [hyperpow_zero_HNatInfinite];  | 
|
479  | 
||
| 
11701
 
3d51fbf81c17
sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
 
wenzelm 
parents: 
11468 
diff
changeset
 | 
480  | 
Goal "[| (Numeral0::hypreal) <= r; r < Numeral1; n <= N |] ==> r pow N <= r pow n";  | 
| 10751 | 481  | 
by (dres_inst_tac [("y","N")] hypnat_le_imp_less_or_eq 1);
 | 
482  | 
by (auto_tac (claset() addIs [hyperpow_less_le], simpset()));  | 
|
483  | 
qed "hyperpow_le_le";  | 
|
484  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
485  | 
Goal "[| (Numeral0::hypreal) < r; r < Numeral1 |] ==> r pow (n + (1::hypnat)) <= r";  | 
| 
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
486  | 
by (dres_inst_tac [("n","(1::hypnat)")] (order_less_imp_le RS hyperpow_le_le) 1);
 | 
| 10751 | 487  | 
by (Auto_tac);  | 
488  | 
qed "hyperpow_Suc_le_self";  | 
|
489  | 
||
| 
11713
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
490  | 
Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] ==> r pow (n + (1::hypnat)) <= r";  | 
| 
 
883d559b0b8c
sane numerals (stage 3): provide generic "1" on all number types;
 
wenzelm 
parents: 
11704 
diff
changeset
 | 
491  | 
by (dres_inst_tac [("n","(1::hypnat)")] hyperpow_le_le 1);
 | 
| 10751 | 492  | 
by (Auto_tac);  | 
493  | 
qed "hyperpow_Suc_le_self2";  | 
|
494  | 
||
495  | 
Goalw [Infinitesimal_def]  | 
|
| 
10778
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
496  | 
"[| x : Infinitesimal; 0 < N |] ==> abs (x pow N) <= abs x";  | 
| 10751 | 497  | 
by (auto_tac (claset() addSIs [hyperpow_Suc_le_self2],  | 
| 
10778
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
498  | 
simpset() addsimps [hyperpow_hrabs RS sym,  | 
| 
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
499  | 
hypnat_gt_zero_iff2, hrabs_ge_zero]));  | 
| 10751 | 500  | 
qed "lemma_Infinitesimal_hyperpow";  | 
501  | 
||
502  | 
Goal "[| x : Infinitesimal; 0 < N |] ==> x pow N : Infinitesimal";  | 
|
503  | 
by (rtac hrabs_le_Infinitesimal 1);  | 
|
| 
10778
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
504  | 
by (rtac lemma_Infinitesimal_hyperpow 2);  | 
| 
 
2c6605049646
more tidying, especially to remove real_of_posnat
 
paulson 
parents: 
10751 
diff
changeset
 | 
505  | 
by Auto_tac;  | 
| 10751 | 506  | 
qed "Infinitesimal_hyperpow";  | 
507  | 
||
508  | 
Goalw [hypnat_of_nat_def]  | 
|
509  | 
"(x ^ n : Infinitesimal) = (x pow (hypnat_of_nat n) : Infinitesimal)";  | 
|
510  | 
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
 | 
|
511  | 
by (auto_tac (claset(), simpset() addsimps [hrealpow, hyperpow]));  | 
|
512  | 
qed "hrealpow_hyperpow_Infinitesimal_iff";  | 
|
513  | 
||
514  | 
Goal "[| x : Infinitesimal; 0 < n |] ==> x ^ n : Infinitesimal";  | 
|
515  | 
by (auto_tac (claset() addSIs [Infinitesimal_hyperpow],  | 
|
516  | 
simpset() addsimps [hrealpow_hyperpow_Infinitesimal_iff,  | 
|
517  | 
hypnat_of_nat_less_iff,hypnat_of_nat_zero]  | 
|
518  | 
delsimps [hypnat_of_nat_less_iff RS sym]));  | 
|
519  | 
qed "Infinitesimal_hrealpow";  |