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