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);
|
|
45 |
by (auto_tac (claset(),simpset() addsimps [HYPREAL_DIVISION_BY_ZERO,
|
|
46 |
hypreal_zero_num,hypreal_inverse,hypreal_mult]));
|
|
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)";
|
|
117 |
by (auto_tac (claset(),simpset() addsimps [hypreal_le_def]));
|
|
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);
|
|
125 |
by (Auto_tac THEN Ultra_tac 1);
|
|
126 |
qed "hlog";
|
|
127 |
|
|
128 |
Goal "( *f* ln) x = hlog (( *f* exp) 1) x";
|
|
129 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
130 |
by (auto_tac (claset(),simpset() addsimps [starfun,hlog,log_ln,
|
|
131 |
hypreal_one_num]));
|
|
132 |
qed "hlog_starfun_ln";
|
|
133 |
|
|
134 |
Goal "[| 0 < a; a ~= 1; 0 < x |] ==> a powhr (hlog a x) = x";
|
|
135 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
136 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
137 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num,
|
|
138 |
hypreal_less,hypreal_one_num]));
|
|
139 |
by (Ultra_tac 1);
|
|
140 |
qed "powhr_hlog_cancel";
|
|
141 |
Addsimps [powhr_hlog_cancel];
|
|
142 |
|
|
143 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a (a powhr y) = y";
|
|
144 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
145 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
146 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num,
|
|
147 |
hypreal_less,hypreal_one_num]));
|
|
148 |
by (ultra_tac (claset() addIs [log_powr_cancel],simpset()) 1);
|
|
149 |
qed "hlog_powhr_cancel";
|
|
150 |
Addsimps [hlog_powhr_cancel];
|
|
151 |
|
|
152 |
Goal "[| 0 < a; a ~= 1; 0 < x; 0 < y |] \
|
|
153 |
\ ==> hlog a (x * y) = hlog a x + hlog a y";
|
|
154 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
155 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
156 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
157 |
by (auto_tac (claset(),simpset() addsimps [hlog,powhr,hypreal_zero_num,
|
|
158 |
hypreal_one_num,hypreal_less,hypreal_add,hypreal_mult]));
|
|
159 |
by (ultra_tac (claset(),simpset() addsimps [log_mult]) 1);
|
|
160 |
qed "hlog_mult";
|
|
161 |
|
|
162 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a x = ( *f* ln) x / ( *f* ln) a";
|
|
163 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
164 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
165 |
by (auto_tac (claset(),simpset() addsimps [hlog,starfun,
|
|
166 |
hypreal_zero_num,hypreal_one_num,hypreal_divide,log_def]));
|
|
167 |
qed "hlog_as_starfun";
|
|
168 |
|
|
169 |
Goal "[| 0 < a; a ~= 1; 0 < b; b ~= 1; 0 < x |] \
|
|
170 |
\ ==> hlog a x = (( *f* ln) b/( *f*ln) a) * hlog b x";
|
|
171 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
172 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
173 |
by (res_inst_tac [("z","b")] eq_Abs_hypreal 1);
|
|
174 |
by (auto_tac (claset(),simpset() addsimps [hlog,starfun,
|
|
175 |
hypreal_zero_num,hypreal_one_num,hypreal_less,
|
|
176 |
hypreal_divide,hypreal_mult]));
|
|
177 |
by (ultra_tac (claset() addDs [log_eq_div_ln_mult_log],simpset()) 1);
|
|
178 |
qed "hlog_eq_div_starfun_ln_mult_hlog";
|
|
179 |
|
|
180 |
Goal "x powhr a = ( *f* exp) (a * ( *f* ln) x)";
|
|
181 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
182 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
183 |
by (auto_tac (claset(),simpset() addsimps [powhr,starfun,
|
|
184 |
hypreal_mult,powr_def]));
|
|
185 |
qed "powhr_as_starfun";
|
|
186 |
|
|
187 |
Goal "[| x : HInfinite; 0 < x; a : HFinite - Infinitesimal; \
|
|
188 |
\ 0 < a |] ==> x powhr a : HInfinite";
|
|
189 |
by (auto_tac (claset() addSIs [starfun_ln_ge_zero,
|
|
190 |
starfun_ln_HInfinite,HInfinite_HFinite_not_Infinitesimal_mult2,
|
|
191 |
starfun_exp_HInfinite],simpset() addsimps [order_less_imp_le,
|
|
192 |
HInfinite_gt_zero_gt_one,powhr_as_starfun,
|
|
193 |
hypreal_0_le_mult_iff]));
|
|
194 |
qed "HInfinite_powhr";
|
|
195 |
|
|
196 |
Goal "[| x : HFinite - Infinitesimal; a : HInfinite; 0 < a |] \
|
|
197 |
\ ==> hlog a (abs x) : Infinitesimal";
|
|
198 |
by (ftac HInfinite_gt_zero_gt_one 1);
|
|
199 |
by (auto_tac (claset() addSIs [starfun_ln_HFinite_not_Infinitesimal,
|
|
200 |
HInfinite_inverse_Infinitesimal,Infinitesimal_HFinite_mult2],
|
|
201 |
simpset() addsimps [starfun_ln_HInfinite,not_Infinitesimal_not_zero,
|
|
202 |
hlog_as_starfun,hypreal_not_refl2 RS not_sym,hypreal_divide_def]));
|
|
203 |
qed "hlog_hrabs_HInfinite_Infinitesimal";
|
|
204 |
|
|
205 |
Goal "[| a : HInfinite; 0 < a |] ==> hlog a x = ( *f* ln) x / ( *f* ln) a";
|
|
206 |
by (rtac hlog_as_starfun 1);
|
|
207 |
by Auto_tac;
|
|
208 |
qed "hlog_HInfinite_as_starfun";
|
|
209 |
|
|
210 |
Goal "hlog a 1 = 0";
|
|
211 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
212 |
by (auto_tac (claset(),simpset() addsimps [hypreal_one_num,
|
|
213 |
hypreal_zero_num,hlog]));
|
|
214 |
qed "hlog_one";
|
|
215 |
Addsimps [hlog_one];
|
|
216 |
|
|
217 |
Goal "[| 0 < a; a ~= 1 |] ==> hlog a a = 1";
|
|
218 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
219 |
by (auto_tac (claset(),simpset() addsimps [hypreal_one_num,
|
|
220 |
hypreal_zero_num,hlog,hypreal_less]));
|
|
221 |
by (ultra_tac (claset() addIs [log_eq_one],simpset()) 1);
|
|
222 |
qed "hlog_eq_one";
|
|
223 |
Addsimps [hlog_eq_one];
|
|
224 |
|
|
225 |
Goal "[| 0 < a; a ~= 1; 0 < x |] ==> hlog a (inverse x) = - hlog a x";
|
|
226 |
by (res_inst_tac [("x1","hlog a x")] (hypreal_add_left_cancel RS iffD1) 1);
|
|
227 |
by (auto_tac (claset(),simpset() addsimps [hypreal_not_refl2 RS not_sym,
|
|
228 |
hlog_mult RS sym,hypreal_inverse_gt_0]));
|
|
229 |
qed "hlog_inverse";
|
|
230 |
|
|
231 |
Goal "[| 0 < a; a ~= 1; 0 < x; 0 < y|] \
|
|
232 |
\ ==> hlog a (x/y) = hlog a x - hlog a y";
|
|
233 |
by (auto_tac (claset(),simpset() addsimps [hypreal_inverse_gt_0,hlog_mult,
|
|
234 |
hlog_inverse,hypreal_diff_def,hypreal_divide_def]));
|
|
235 |
qed "hlog_divide";
|
|
236 |
|
|
237 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (hlog a x < hlog a y) = (x < y)";
|
|
238 |
by (res_inst_tac [("z","a")] eq_Abs_hypreal 1);
|
|
239 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
|
|
240 |
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
|
|
241 |
by (auto_tac (claset(),simpset() addsimps [hlog,hypreal_less,
|
|
242 |
hypreal_zero_num,hypreal_one_num]));
|
|
243 |
by (ALLGOALS(Ultra_tac));
|
|
244 |
qed "hlog_less_cancel_iff";
|
|
245 |
Addsimps [hlog_less_cancel_iff];
|
|
246 |
|
|
247 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (hlog a x <= hlog a y) = (x <= y)";
|
|
248 |
by (auto_tac (claset(),simpset() addsimps [hypreal_le_def]));
|
|
249 |
qed "hlog_le_cancel_iff";
|
|
250 |
Addsimps [hlog_le_cancel_iff];
|
|
251 |
|
|
252 |
(* should be in NSA.ML *)
|
|
253 |
goalw HLog.thy [epsilon_def] "0 <= epsilon";
|
|
254 |
by (auto_tac (claset(),simpset() addsimps [hypreal_zero_num,hypreal_le]));
|
|
255 |
qed "epsilon_ge_zero";
|
|
256 |
Addsimps [epsilon_ge_zero];
|
|
257 |
|
|
258 |
goal HLog.thy "epsilon : {x. 0 <= x & x : HFinite}";
|
|
259 |
by Auto_tac;
|
|
260 |
qed "hpfinite_witness";
|
|
261 |
|