author | paulson |
Thu, 19 Feb 2004 10:40:28 +0100 | |
changeset 14395 | cc96cc06abf9 |
parent 14371 | c78c7da09519 |
permissions | -rw-r--r-- |
13958 | 1 |
(* Title : HLog.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 2000,2001 University of Edinburgh |
|
4 |
Description : hyperreal base logarithms |
|
5 |
*) |
|
6 |
||
7 |
Goalw [powhr_def] |
|
8 |
"(Abs_hypreal(hyprel `` {X})) powhr (Abs_hypreal(hyprel `` {Y})) = \ |
|
9 |
\ Abs_hypreal(hyprel `` {%n. (X n) powr (Y n)})"; |
|
10 |
by (auto_tac (claset(),simpset() addsimps [starfun,hypreal_mult, |
|
11 |
powr_def])); |
|
12 |
qed "powhr"; |
|
13 |
||
14 |
Goal "1 powhr a = 1"; |
|
15 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
16 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_one_num])); |
|
17 |
qed "powhr_one_eq_one"; |
|
18 |
Addsimps [powhr_one_eq_one]; |
|
19 |
||
20 |
Goal "[| 0 < x; 0 < y |] ==> (x * y) powhr a = (x powhr a) * (y powhr a)"; |
|
21 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
22 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
23 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
24 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_zero_num, |
|
25 |
hypreal_mult,hypreal_less])); |
|
26 |
by (ultra_tac (claset(),simpset() addsimps [powr_mult]) 1); |
|
27 |
qed "powhr_mult"; |
|
28 |
||
29 |
Goalw [hypreal_zero_def] "0 < x powhr a"; |
|
30 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
31 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
32 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_less,hypreal_zero_num])); |
|
33 |
qed "powhr_gt_zero"; |
|
34 |
Addsimps [powhr_gt_zero]; |
|
35 |
||
36 |
Goal "x powhr a ~= 0"; |
|
37 |
by (rtac ((powhr_gt_zero RS hypreal_not_refl2) RS not_sym) 1); |
|
38 |
qed "powhr_not_zero"; |
|
39 |
Addsimps [powhr_not_zero]; |
|
40 |
||
41 |
Goalw [hypreal_divide_def] |
|
42 |
"(Abs_hypreal(hyprel `` {X}))/(Abs_hypreal(hyprel `` {Y})) = \ |
|
43 |
\ (Abs_hypreal(hyprel `` {%n. (X n)/(Y n)}))"; |
|
44 |
by (case_tac "Abs_hypreal (hyprel `` {Y}) = 0" 1); |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
45 |
by (auto_tac (claset(), |
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
46 |
simpset() addsimps [hypreal_zero_num,hypreal_inverse,hypreal_mult])); |
13958 | 47 |
by (ALLGOALS(ultra_tac (claset(),simpset() addsimps [real_divide_def]))); |
48 |
qed "hypreal_divide"; |
|
49 |
||
50 |
Goal "[| 0 < x; 0 < y |] ==> (x / y) powhr a = (x powhr a)/(y powhr a)"; |
|
51 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
52 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
53 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
54 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_divide, |
|
55 |
hypreal_zero_num,hypreal_less])); |
|
56 |
by (ultra_tac (claset(),simpset() addsimps [powr_divide]) 1); |
|
57 |
qed "powhr_divide"; |
|
58 |
||
59 |
Goal "x powhr (a + b) = (x powhr a) * (x powhr b)"; |
|
60 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
61 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
62 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
63 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_add,hypreal_mult, |
|
64 |
powr_add])); |
|
65 |
qed "powhr_add"; |
|
66 |
||
67 |
Goal "(x powhr a) powhr b = x powhr (a * b)"; |
|
68 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
69 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
70 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
71 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_mult, |
|
72 |
powr_powr])); |
|
73 |
qed "powhr_powhr"; |
|
74 |
||
75 |
Goal "(x powhr a) powhr b = (x powhr b) powhr a"; |
|
76 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
77 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
78 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
79 |
by (auto_tac (claset(),simpset() addsimps [powhr,powr_powr_swap])); |
|
80 |
qed "powhr_powhr_swap"; |
|
81 |
||
82 |
Goal "x powhr (-a) = inverse (x powhr a)"; |
|
83 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
84 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
85 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_minus, |
|
86 |
hypreal_inverse,hypreal_less,powr_minus])); |
|
87 |
qed "powhr_minus"; |
|
88 |
||
89 |
Goalw [hypreal_divide_def] "x powhr (-a) = 1/(x powhr a)"; |
|
90 |
by (simp_tac (simpset() addsimps [powhr_minus]) 1); |
|
91 |
qed "powhr_minus_divide"; |
|
92 |
||
93 |
Goal "[| a < b; 1 < x |] ==> x powhr a < x powhr b"; |
|
94 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
95 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
96 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
97 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_one_num, |
|
98 |
hypreal_less])); |
|
99 |
by (ultra_tac (claset(),simpset() addsimps [powr_less_mono]) 1); |
|
100 |
qed "powhr_less_mono"; |
|
101 |
||
102 |
Goal "[| x powhr a < x powhr b; 1 < x |] ==> a < b"; |
|
103 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
104 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
105 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
106 |
by (auto_tac (claset(),simpset() addsimps [powhr,hypreal_one_num, |
|
107 |
hypreal_less])); |
|
108 |
by (ultra_tac (claset() addDs [powr_less_cancel],simpset()) 1); |
|
109 |
qed "powhr_less_cancel"; |
|
110 |
||
111 |
Goal "1 < x ==> (x powhr a < x powhr b) = (a < b)"; |
|
112 |
by (blast_tac (claset() addIs [powhr_less_cancel,powhr_less_mono]) 1); |
|
113 |
qed "powhr_less_cancel_iff"; |
|
114 |
Addsimps [powhr_less_cancel_iff]; |
|
115 |
||
116 |
Goal "1 < x ==> (x powhr a <= x powhr b) = (a <= b)"; |
|
14370 | 117 |
by (auto_tac (claset(),simpset() addsimps [linorder_not_less RS sym])); |
13958 | 118 |
qed "powhr_le_cancel_iff"; |
119 |
Addsimps [powhr_le_cancel_iff]; |
|
120 |
||
121 |
Goalw [hlog_def] |
|
122 |
"hlog (Abs_hypreal(hyprel `` {X})) (Abs_hypreal(hyprel `` {Y})) = \ |
|
123 |
\ Abs_hypreal(hyprel `` {%n. log (X n) (Y n)})"; |
|
124 |
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1); |
|
14299 | 125 |
by Auto_tac; |
126 |
by (Ultra_tac 1); |
|
13958 | 127 |
qed "hlog"; |
128 |
||
129 |
Goal "( *f* ln) x = hlog (( *f* exp) 1) x"; |
|
130 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
131 |
by (auto_tac (claset(),simpset() addsimps [starfun,hlog,log_ln, |
|
132 |
hypreal_one_num])); |
|
133 |
qed "hlog_starfun_ln"; |
|
134 |
||
135 |
Goal "[| 0 < a; a ~= 1; 0 < x |] ==> a powhr (hlog a x) = x"; |
|
136 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
137 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
138 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num, |
|
139 |
hypreal_less,hypreal_one_num])); |
|
140 |
by (Ultra_tac 1); |
|
141 |
qed "powhr_hlog_cancel"; |
|
142 |
Addsimps [powhr_hlog_cancel]; |
|
143 |
||
144 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a (a powhr y) = y"; |
|
145 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
146 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
147 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num, |
|
148 |
hypreal_less,hypreal_one_num])); |
|
149 |
by (ultra_tac (claset() addIs [log_powr_cancel],simpset()) 1); |
|
150 |
qed "hlog_powhr_cancel"; |
|
151 |
Addsimps [hlog_powhr_cancel]; |
|
152 |
||
153 |
Goal "[| 0 < a; a ~= 1; 0 < x; 0 < y |] \ |
|
154 |
\ ==> hlog a (x * y) = hlog a x + hlog a y"; |
|
155 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
156 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
157 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
158 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num, |
|
159 |
hypreal_one_num,hypreal_less,hypreal_add,hypreal_mult])); |
|
160 |
by (ultra_tac (claset(),simpset() addsimps [log_mult]) 1); |
|
161 |
qed "hlog_mult"; |
|
162 |
||
163 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a x = ( *f* ln) x / ( *f* ln) a"; |
|
164 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
165 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
166 |
by (auto_tac (claset(),simpset() addsimps [hlog,starfun, |
|
167 |
hypreal_zero_num,hypreal_one_num,hypreal_divide,log_def])); |
|
168 |
qed "hlog_as_starfun"; |
|
169 |
||
170 |
Goal "[| 0 < a; a ~= 1; 0 < b; b ~= 1; 0 < x |] \ |
|
171 |
\ ==> hlog a x = (( *f* ln) b/( *f*ln) a) * hlog b x"; |
|
172 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
173 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
174 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1); |
|
175 |
by (auto_tac (claset(),simpset() addsimps [hlog,starfun, |
|
176 |
hypreal_zero_num,hypreal_one_num,hypreal_less, |
|
177 |
hypreal_divide,hypreal_mult])); |
|
178 |
by (ultra_tac (claset() addDs [log_eq_div_ln_mult_log],simpset()) 1); |
|
179 |
qed "hlog_eq_div_starfun_ln_mult_hlog"; |
|
180 |
||
181 |
Goal "x powhr a = ( *f* exp) (a * ( *f* ln) x)"; |
|
182 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
183 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
184 |
by (auto_tac (claset(),simpset() addsimps [powhr,starfun, |
|
185 |
hypreal_mult,powr_def])); |
|
186 |
qed "powhr_as_starfun"; |
|
187 |
||
188 |
Goal "[| x : HInfinite; 0 < x; a : HFinite - Infinitesimal; \ |
|
189 |
\ 0 < a |] ==> x powhr a : HInfinite"; |
|
190 |
by (auto_tac (claset() addSIs [starfun_ln_ge_zero, |
|
191 |
starfun_ln_HInfinite,HInfinite_HFinite_not_Infinitesimal_mult2, |
|
192 |
starfun_exp_HInfinite],simpset() addsimps [order_less_imp_le, |
|
193 |
HInfinite_gt_zero_gt_one,powhr_as_starfun, |
|
14331 | 194 |
zero_le_mult_iff])); |
13958 | 195 |
qed "HInfinite_powhr"; |
196 |
||
197 |
Goal "[| x : HFinite - Infinitesimal; a : HInfinite; 0 < a |] \ |
|
198 |
\ ==> hlog a (abs x) : Infinitesimal"; |
|
199 |
by (ftac HInfinite_gt_zero_gt_one 1); |
|
200 |
by (auto_tac (claset() addSIs [starfun_ln_HFinite_not_Infinitesimal, |
|
201 |
HInfinite_inverse_Infinitesimal,Infinitesimal_HFinite_mult2], |
|
202 |
simpset() addsimps [starfun_ln_HInfinite,not_Infinitesimal_not_zero, |
|
203 |
hlog_as_starfun,hypreal_not_refl2 RS not_sym,hypreal_divide_def])); |
|
204 |
qed "hlog_hrabs_HInfinite_Infinitesimal"; |
|
205 |
||
206 |
Goal "[| a : HInfinite; 0 < a |] ==> hlog a x = ( *f* ln) x / ( *f* ln) a"; |
|
207 |
by (rtac hlog_as_starfun 1); |
|
208 |
by Auto_tac; |
|
209 |
qed "hlog_HInfinite_as_starfun"; |
|
210 |
||
211 |
Goal "hlog a 1 = 0"; |
|
212 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
213 |
by (auto_tac (claset(),simpset() addsimps [hypreal_one_num, |
|
214 |
hypreal_zero_num,hlog])); |
|
215 |
qed "hlog_one"; |
|
216 |
Addsimps [hlog_one]; |
|
217 |
||
218 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a a = 1"; |
|
219 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
220 |
by (auto_tac (claset(),simpset() addsimps [hypreal_one_num, |
|
221 |
hypreal_zero_num,hlog,hypreal_less])); |
|
222 |
by (ultra_tac (claset() addIs [log_eq_one],simpset()) 1); |
|
223 |
qed "hlog_eq_one"; |
|
224 |
Addsimps [hlog_eq_one]; |
|
225 |
||
226 |
Goal "[| 0 < a; a ~= 1; 0 < x |] ==> hlog a (inverse x) = - hlog a x"; |
|
14331 | 227 |
by (res_inst_tac [("a1","hlog a x")] (add_left_cancel RS iffD1) 1); |
13958 | 228 |
by (auto_tac (claset(),simpset() addsimps [hypreal_not_refl2 RS not_sym, |
14334 | 229 |
hlog_mult RS sym,positive_imp_inverse_positive])); |
13958 | 230 |
qed "hlog_inverse"; |
231 |
||
232 |
Goal "[| 0 < a; a ~= 1; 0 < x; 0 < y|] \ |
|
233 |
\ ==> hlog a (x/y) = hlog a x - hlog a y"; |
|
14331 | 234 |
by (auto_tac (claset(), |
14334 | 235 |
simpset() addsimps [positive_imp_inverse_positive,hlog_mult, hlog_inverse,hypreal_diff_def,hypreal_divide_def])); |
13958 | 236 |
qed "hlog_divide"; |
237 |
||
238 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (hlog a x < hlog a y) = (x < y)"; |
|
239 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1); |
|
240 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
241 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1); |
|
242 |
by (auto_tac (claset(),simpset() addsimps [hlog,hypreal_less, |
|
243 |
hypreal_zero_num,hypreal_one_num])); |
|
244 |
by (ALLGOALS(Ultra_tac)); |
|
245 |
qed "hlog_less_cancel_iff"; |
|
246 |
Addsimps [hlog_less_cancel_iff]; |
|
247 |
||
248 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (hlog a x <= hlog a y) = (x <= y)"; |
|
14370 | 249 |
by (auto_tac (claset(),simpset() addsimps [linorder_not_less RS sym])); |
13958 | 250 |
qed "hlog_le_cancel_iff"; |
251 |
Addsimps [hlog_le_cancel_iff]; |
|
252 |
||
253 |
(* should be in NSA.ML *) |
|
254 |
goalw HLog.thy [epsilon_def] "0 <= epsilon"; |
|
255 |
by (auto_tac (claset(),simpset() addsimps [hypreal_zero_num,hypreal_le])); |
|
256 |
qed "epsilon_ge_zero"; |
|
257 |
Addsimps [epsilon_ge_zero]; |
|
258 |
||
259 |
goal HLog.thy "epsilon : {x. 0 <= x & x : HFinite}"; |
|
260 |
by Auto_tac; |
|
261 |
qed "hpfinite_witness"; |
|
262 |