author | paulson |
Thu, 04 Jan 2001 10:23:01 +0100 | |
changeset 10778 | 2c6605049646 |
parent 10751 | a81ea5d3dd41 |
child 10797 | 028d22926a41 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : NSA.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
4 |
Description : Infinite numbers, Infinitesimals, |
|
5 |
infinitely close relation etc. |
|
6 |
*) |
|
7 |
||
8 |
fun CLAIM_SIMP str thms = |
|
9 |
prove_goal (the_context()) str |
|
10 |
(fn prems => [cut_facts_tac prems 1, |
|
11 |
auto_tac (claset(),simpset() addsimps thms)]); |
|
12 |
fun CLAIM str = CLAIM_SIMP str []; |
|
13 |
||
14 |
(*-------------------------------------------------------------------- |
|
15 |
Closure laws for members of (embedded) set standard real SReal |
|
16 |
--------------------------------------------------------------------*) |
|
17 |
||
18 |
Goalw [SReal_def] "[| (x::hypreal): SReal; y: SReal |] ==> x + y: SReal"; |
|
19 |
by (Step_tac 1); |
|
20 |
by (res_inst_tac [("x","r + ra")] exI 1); |
|
21 |
by (Simp_tac 1); |
|
22 |
qed "SReal_add"; |
|
23 |
||
24 |
Goalw [SReal_def] "[| (x::hypreal): SReal; y: SReal |] ==> x * y: SReal"; |
|
25 |
by (Step_tac 1); |
|
26 |
by (res_inst_tac [("x","r * ra")] exI 1); |
|
27 |
by (simp_tac (simpset() addsimps [hypreal_of_real_mult]) 1); |
|
28 |
qed "SReal_mult"; |
|
29 |
||
30 |
Goalw [SReal_def] "(x::hypreal): SReal ==> inverse x : SReal"; |
|
31 |
by (blast_tac (claset() addIs [hypreal_of_real_inverse RS sym]) 1); |
|
32 |
qed "SReal_inverse"; |
|
33 |
||
34 |
Goal "[| (x::hypreal): SReal; y: SReal |] ==> x/y: SReal"; |
|
35 |
by (asm_simp_tac (simpset() addsimps [SReal_mult,SReal_inverse, |
|
36 |
hypreal_divide_def]) 1); |
|
37 |
qed "SReal_divide"; |
|
38 |
||
39 |
Goalw [SReal_def] "(x::hypreal): SReal ==> -x : SReal"; |
|
40 |
by (blast_tac (claset() addIs [hypreal_of_real_minus RS sym]) 1); |
|
41 |
qed "SReal_minus"; |
|
42 |
||
43 |
Goal "(-x : SReal) = ((x::hypreal): SReal)"; |
|
44 |
by Auto_tac; |
|
45 |
by (etac SReal_minus 2); |
|
46 |
by (dtac SReal_minus 1); |
|
47 |
by Auto_tac; |
|
48 |
qed "SReal_minus_iff"; |
|
49 |
Addsimps [SReal_minus_iff]; |
|
50 |
||
51 |
Goal "[| (x::hypreal) + y : SReal; y: SReal |] ==> x: SReal"; |
|
52 |
by (dres_inst_tac [("x","y")] SReal_minus 1); |
|
53 |
by (dtac SReal_add 1); |
|
54 |
by (assume_tac 1); |
|
55 |
by Auto_tac; |
|
56 |
qed "SReal_add_cancel"; |
|
57 |
||
58 |
Goalw [SReal_def] "(x::hypreal): SReal ==> abs x : SReal"; |
|
59 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_hrabs])); |
|
60 |
qed "SReal_hrabs"; |
|
61 |
||
62 |
Goalw [SReal_def] "hypreal_of_real x: SReal"; |
|
63 |
by (Blast_tac 1); |
|
64 |
qed "SReal_hypreal_of_real"; |
|
65 |
Addsimps [SReal_hypreal_of_real]; |
|
66 |
||
67 |
Goalw [hypreal_number_of_def] "(number_of w ::hypreal) : SReal"; |
|
68 |
by (rtac SReal_hypreal_of_real 1); |
|
69 |
qed "SReal_number_of"; |
|
70 |
Addsimps [SReal_number_of]; |
|
71 |
||
72 |
Goalw [hypreal_divide_def] "r : SReal ==> r/(number_of w::hypreal) : SReal"; |
|
73 |
by (blast_tac (claset() addSIs [SReal_number_of, SReal_mult, |
|
74 |
SReal_inverse]) 1); |
|
75 |
qed "SReal_divide_number_of"; |
|
76 |
||
77 |
(* Infinitesimal ehr not in SReal *) |
|
78 |
||
79 |
Goalw [SReal_def] "ehr ~: SReal"; |
|
80 |
by (auto_tac (claset(), |
|
81 |
simpset() addsimps [hypreal_of_real_not_eq_epsilon RS not_sym])); |
|
82 |
qed "SReal_epsilon_not_mem"; |
|
83 |
||
84 |
Goalw [SReal_def] "whr ~: SReal"; |
|
85 |
by (auto_tac (claset(), |
|
86 |
simpset() addsimps [hypreal_of_real_not_eq_omega RS not_sym])); |
|
87 |
qed "SReal_omega_not_mem"; |
|
88 |
||
89 |
Goalw [SReal_def] "{x. hypreal_of_real x : SReal} = (UNIV::real set)"; |
|
90 |
by Auto_tac; |
|
91 |
qed "SReal_UNIV_real"; |
|
92 |
||
93 |
Goalw [SReal_def] "(x: SReal) = (EX y. x = hypreal_of_real y)"; |
|
94 |
by Auto_tac; |
|
95 |
qed "SReal_iff"; |
|
96 |
||
97 |
Goalw [SReal_def] "hypreal_of_real ``(UNIV::real set) = SReal"; |
|
98 |
by Auto_tac; |
|
99 |
qed "hypreal_of_real_image"; |
|
100 |
||
101 |
Goalw [SReal_def] "inv hypreal_of_real ``SReal = (UNIV::real set)"; |
|
102 |
by Auto_tac; |
|
103 |
by (rtac (inj_hypreal_of_real RS inv_f_f RS subst) 1); |
|
104 |
by (Blast_tac 1); |
|
105 |
qed "inv_hypreal_of_real_image"; |
|
106 |
||
107 |
Goalw [SReal_def] |
|
108 |
"[| EX x. x: P; P <= SReal |] ==> EX Q. P = hypreal_of_real `` Q"; |
|
109 |
by (Best_tac 1); |
|
110 |
qed "SReal_hypreal_of_real_image"; |
|
111 |
||
112 |
Goal "[| (x::hypreal): SReal; y: SReal; x<y |] ==> EX r: SReal. x<r & r<y"; |
|
113 |
by (auto_tac (claset(), simpset() addsimps [SReal_iff])); |
|
114 |
by (dtac real_dense 1 THEN Step_tac 1); |
|
115 |
by (res_inst_tac [("x","hypreal_of_real r")] bexI 1); |
|
116 |
by Auto_tac; |
|
117 |
qed "SReal_dense"; |
|
118 |
||
119 |
(*------------------------------------------------------------------ |
|
120 |
Completeness of SReal |
|
121 |
------------------------------------------------------------------*) |
|
122 |
Goal "P <= SReal ==> ((EX x:P. y < x) = \ |
|
123 |
\ (EX X. hypreal_of_real X : P & y < hypreal_of_real X))"; |
|
124 |
by (blast_tac (claset() addSDs [SReal_iff RS iffD1]) 1); |
|
125 |
by (flexflex_tac ); |
|
126 |
qed "SReal_sup_lemma"; |
|
127 |
||
128 |
Goal "[| P <= SReal; EX x. x: P; EX y : SReal. ALL x: P. x < y |] \ |
|
129 |
\ ==> (EX X. X: {w. hypreal_of_real w : P}) & \ |
|
130 |
\ (EX Y. ALL X: {w. hypreal_of_real w : P}. X < Y)"; |
|
131 |
by (rtac conjI 1); |
|
132 |
by (fast_tac (claset() addSDs [SReal_iff RS iffD1]) 1); |
|
133 |
by (Auto_tac THEN forward_tac [subsetD] 1 THEN assume_tac 1); |
|
134 |
by (dtac (SReal_iff RS iffD1) 1); |
|
135 |
by (Auto_tac THEN res_inst_tac [("x","ya")] exI 1); |
|
136 |
by Auto_tac; |
|
137 |
qed "SReal_sup_lemma2"; |
|
138 |
||
139 |
(*------------------------------------------------------ |
|
140 |
lifting of ub and property of lub |
|
141 |
-------------------------------------------------------*) |
|
142 |
Goalw [isUb_def,setle_def] |
|
143 |
"(isUb (SReal) (hypreal_of_real `` Q) (hypreal_of_real Y)) = \ |
|
144 |
\ (isUb (UNIV :: real set) Q Y)"; |
|
145 |
by Auto_tac; |
|
146 |
qed "hypreal_of_real_isUb_iff"; |
|
147 |
||
148 |
Goalw [isLub_def,leastP_def] |
|
149 |
"isLub SReal (hypreal_of_real `` Q) (hypreal_of_real Y) \ |
|
150 |
\ ==> isLub (UNIV :: real set) Q Y"; |
|
151 |
by (auto_tac (claset() addIs [hypreal_of_real_isUb_iff RS iffD2], |
|
152 |
simpset() addsimps [hypreal_of_real_isUb_iff, setge_def])); |
|
153 |
qed "hypreal_of_real_isLub1"; |
|
154 |
||
155 |
Goalw [isLub_def,leastP_def] |
|
156 |
"isLub (UNIV :: real set) Q Y \ |
|
157 |
\ ==> isLub SReal (hypreal_of_real `` Q) (hypreal_of_real Y)"; |
|
158 |
by (auto_tac (claset(), |
|
159 |
simpset() addsimps [hypreal_of_real_isUb_iff, setge_def])); |
|
160 |
by (forw_inst_tac [("x2","x")] (isUbD2a RS (SReal_iff RS iffD1) RS exE) 1); |
|
161 |
by (assume_tac 2); |
|
162 |
by (dres_inst_tac [("x","xa")] spec 1); |
|
163 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_isUb_iff])); |
|
164 |
qed "hypreal_of_real_isLub2"; |
|
165 |
||
166 |
Goal "(isLub SReal (hypreal_of_real `` Q) (hypreal_of_real Y)) = \ |
|
167 |
\ (isLub (UNIV :: real set) Q Y)"; |
|
168 |
by (blast_tac (claset() addIs [hypreal_of_real_isLub1, |
|
169 |
hypreal_of_real_isLub2]) 1); |
|
170 |
qed "hypreal_of_real_isLub_iff"; |
|
171 |
||
172 |
(* lemmas *) |
|
173 |
Goalw [isUb_def] |
|
174 |
"isUb SReal P Y ==> EX Yo. isUb SReal P (hypreal_of_real Yo)"; |
|
175 |
by (auto_tac (claset(), simpset() addsimps [SReal_iff])); |
|
176 |
qed "lemma_isUb_hypreal_of_real"; |
|
177 |
||
178 |
Goalw [isLub_def,leastP_def,isUb_def] |
|
179 |
"isLub SReal P Y ==> EX Yo. isLub SReal P (hypreal_of_real Yo)"; |
|
180 |
by (auto_tac (claset(), simpset() addsimps [SReal_iff])); |
|
181 |
qed "lemma_isLub_hypreal_of_real"; |
|
182 |
||
183 |
Goalw [isLub_def,leastP_def,isUb_def] |
|
184 |
"EX Yo. isLub SReal P (hypreal_of_real Yo) ==> EX Y. isLub SReal P Y"; |
|
185 |
by Auto_tac; |
|
186 |
qed "lemma_isLub_hypreal_of_real2"; |
|
187 |
||
188 |
Goal "[| P <= SReal; EX x. x: P; EX Y. isUb SReal P Y |] \ |
|
189 |
\ ==> EX t::hypreal. isLub SReal P t"; |
|
190 |
by (forward_tac [SReal_hypreal_of_real_image] 1); |
|
191 |
by (Auto_tac THEN dtac lemma_isUb_hypreal_of_real 1); |
|
192 |
by (auto_tac (claset() addSIs [reals_complete, lemma_isLub_hypreal_of_real2], |
|
193 |
simpset() addsimps [hypreal_of_real_isLub_iff,hypreal_of_real_isUb_iff])); |
|
194 |
qed "SReal_complete"; |
|
195 |
||
196 |
(*-------------------------------------------------------------------- |
|
197 |
Set of finite elements is a subring of the extended reals |
|
198 |
--------------------------------------------------------------------*) |
|
199 |
Goalw [HFinite_def] "[|x : HFinite; y : HFinite|] ==> (x+y) : HFinite"; |
|
200 |
by (blast_tac (claset() addSIs [SReal_add,hrabs_add_less]) 1); |
|
201 |
qed "HFinite_add"; |
|
202 |
||
203 |
Goalw [HFinite_def] "[|x : HFinite; y : HFinite|] ==> x*y : HFinite"; |
|
204 |
by (Asm_full_simp_tac 1); |
|
205 |
by (blast_tac (claset() addSIs [SReal_mult,hrabs_mult_less]) 1); |
|
206 |
qed "HFinite_mult"; |
|
207 |
||
208 |
Goalw [HFinite_def] "(-x : HFinite) = (x : HFinite)"; |
|
209 |
by (Simp_tac 1); |
|
210 |
qed "HFinite_minus_iff"; |
|
211 |
||
212 |
Goalw [SReal_def,HFinite_def] "SReal <= HFinite"; |
|
213 |
by Auto_tac; |
|
214 |
by (res_inst_tac [("x","#1 + abs(hypreal_of_real r)")] exI 1); |
|
215 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_hrabs])); |
|
216 |
by (res_inst_tac [("x","#1 + abs r")] exI 1); |
|
217 |
by (Simp_tac 1); |
|
218 |
qed "SReal_subset_HFinite"; |
|
219 |
||
220 |
Goal "hypreal_of_real x : HFinite"; |
|
221 |
by (auto_tac (claset() addIs [(SReal_subset_HFinite RS subsetD)], |
|
222 |
simpset())); |
|
223 |
qed "HFinite_hypreal_of_real"; |
|
224 |
||
225 |
Addsimps [HFinite_hypreal_of_real]; |
|
226 |
||
227 |
Goalw [HFinite_def] "x : HFinite ==> EX t: SReal. abs x < t"; |
|
228 |
by Auto_tac; |
|
229 |
qed "HFiniteD"; |
|
230 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
231 |
Goalw [HFinite_def] "(abs x : HFinite) = (x : HFinite)"; |
10751 | 232 |
by (auto_tac (claset(), simpset() addsimps [hrabs_idempotent])); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
233 |
qed "HFinite_hrabs_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
234 |
AddIffs [HFinite_hrabs_iff]; |
10751 | 235 |
|
236 |
Goal "number_of w : HFinite"; |
|
237 |
by (rtac (SReal_number_of RS (SReal_subset_HFinite RS subsetD)) 1); |
|
238 |
qed "HFinite_number_of"; |
|
239 |
Addsimps [HFinite_number_of]; |
|
240 |
||
241 |
Goal "[|x : HFinite; y <= x; #0 <= y |] ==> y: HFinite"; |
|
242 |
by (case_tac "x <= #0" 1); |
|
243 |
by (dres_inst_tac [("y","x")] order_trans 1); |
|
244 |
by (dtac hypreal_le_anti_sym 2); |
|
245 |
by (auto_tac (claset() addSDs [not_hypreal_leE], simpset())); |
|
246 |
by (auto_tac (claset() addSIs [bexI] addIs [order_le_less_trans], |
|
247 |
simpset() addsimps [hrabs_eqI1,hrabs_eqI2,hrabs_minus_eqI1,HFinite_def])); |
|
248 |
qed "HFinite_bounded"; |
|
249 |
||
250 |
(*------------------------------------------------------------------ |
|
251 |
Set of infinitesimals is a subring of the hyperreals |
|
252 |
------------------------------------------------------------------*) |
|
253 |
Goalw [Infinitesimal_def] |
|
254 |
"x : Infinitesimal ==> ALL r: SReal. #0 < r --> abs x < r"; |
|
255 |
by Auto_tac; |
|
256 |
qed "InfinitesimalD"; |
|
257 |
||
258 |
Goalw [Infinitesimal_def] "#0 : Infinitesimal"; |
|
259 |
by (simp_tac (simpset() addsimps [hrabs_zero]) 1); |
|
260 |
qed "Infinitesimal_zero"; |
|
261 |
AddIffs [Infinitesimal_zero]; |
|
262 |
||
263 |
Goal "x/(#2::hypreal) + x/(#2::hypreal) = x"; |
|
264 |
by Auto_tac; |
|
265 |
qed "hypreal_sum_of_halves"; |
|
266 |
||
267 |
Goal "#0 < r ==> #0 < r/(#2::hypreal)"; |
|
268 |
by Auto_tac; |
|
269 |
qed "hypreal_half_gt_zero"; |
|
270 |
||
271 |
Goalw [Infinitesimal_def] |
|
272 |
"[| x : Infinitesimal; y : Infinitesimal |] ==> (x+y) : Infinitesimal"; |
|
273 |
by Auto_tac; |
|
274 |
by (rtac (hypreal_sum_of_halves RS subst) 1); |
|
275 |
by (dtac hypreal_half_gt_zero 1); |
|
276 |
by (blast_tac (claset() addIs [hrabs_add_less, hrabs_add_less, |
|
277 |
SReal_divide_number_of]) 1); |
|
278 |
qed "Infinitesimal_add"; |
|
279 |
||
280 |
Goalw [Infinitesimal_def] "(-x:Infinitesimal) = (x:Infinitesimal)"; |
|
281 |
by (Full_simp_tac 1); |
|
282 |
qed "Infinitesimal_minus_iff"; |
|
283 |
Addsimps [Infinitesimal_minus_iff]; |
|
284 |
||
285 |
Goal "[| x : Infinitesimal; y : Infinitesimal |] ==> x-y : Infinitesimal"; |
|
286 |
by (asm_simp_tac |
|
287 |
(simpset() addsimps [hypreal_diff_def, Infinitesimal_add]) 1); |
|
288 |
qed "Infinitesimal_diff"; |
|
289 |
||
290 |
Goalw [Infinitesimal_def] |
|
291 |
"[| x : Infinitesimal; y : Infinitesimal |] ==> (x * y) : Infinitesimal"; |
|
292 |
by Auto_tac; |
|
293 |
by (case_tac "y=#0" 1); |
|
294 |
by (cut_inst_tac [("u","abs x"),("v","#1"),("x","abs y"),("y","r")] |
|
295 |
hypreal_mult_less_mono 2); |
|
296 |
by Auto_tac; |
|
297 |
qed "Infinitesimal_mult"; |
|
298 |
||
299 |
Goal "[| x : Infinitesimal; y : HFinite |] ==> (x * y) : Infinitesimal"; |
|
300 |
by (auto_tac (claset() addSDs [HFiniteD], |
|
301 |
simpset() addsimps [Infinitesimal_def])); |
|
302 |
by (forward_tac [hrabs_less_gt_zero] 1); |
|
303 |
by (dres_inst_tac [("x","r/t")] bspec 1); |
|
304 |
by (blast_tac (claset() addIs [SReal_divide]) 1); |
|
305 |
by (asm_full_simp_tac (simpset() addsimps [hypreal_0_less_divide_iff]) 1); |
|
306 |
by (case_tac "x=0 | y=0" 1); |
|
307 |
by (cut_inst_tac [("u","abs x"),("v","r/t"),("x","abs y")] |
|
308 |
hypreal_mult_less_mono 2); |
|
309 |
by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_divide_iff])); |
|
310 |
qed "Infinitesimal_HFinite_mult"; |
|
311 |
||
312 |
Goal "[| x : Infinitesimal; y : HFinite |] ==> (y * x) : Infinitesimal"; |
|
313 |
by (auto_tac (claset() addDs [Infinitesimal_HFinite_mult], |
|
314 |
simpset() addsimps [hypreal_mult_commute])); |
|
315 |
qed "Infinitesimal_HFinite_mult2"; |
|
316 |
||
317 |
(*** rather long proof ***) |
|
318 |
Goalw [HInfinite_def,Infinitesimal_def] |
|
319 |
"x: HInfinite ==> inverse x: Infinitesimal"; |
|
320 |
by Auto_tac; |
|
321 |
by (eres_inst_tac [("x","inverse r")] ballE 1); |
|
322 |
by (rtac (hrabs_inverse RS ssubst) 1); |
|
323 |
by (forw_inst_tac [("x1","r"),("z","abs x")] |
|
324 |
(hypreal_inverse_gt_0 RS order_less_trans) 1); |
|
325 |
by (assume_tac 1); |
|
326 |
by (dtac ((hypreal_inverse_inverse RS sym) RS subst) 1); |
|
327 |
by (rtac (hypreal_inverse_less_iff RS iffD1) 1); |
|
328 |
by (auto_tac (claset(), simpset() addsimps [SReal_inverse])); |
|
329 |
qed "HInfinite_inverse_Infinitesimal"; |
|
330 |
||
331 |
||
332 |
||
333 |
Goalw [HInfinite_def] "[|x: HInfinite;y: HInfinite|] ==> (x*y): HInfinite"; |
|
334 |
by Auto_tac; |
|
335 |
by (eres_inst_tac [("x","#1")] ballE 1); |
|
336 |
by (eres_inst_tac [("x","r")] ballE 1); |
|
337 |
by (case_tac "y=0" 1); |
|
338 |
by (cut_inst_tac [("x","#1"),("y","abs x"), |
|
339 |
("u","r"),("v","abs y")] hypreal_mult_less_mono 2); |
|
340 |
by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac)); |
|
341 |
qed "HInfinite_mult"; |
|
342 |
||
343 |
Goalw [HInfinite_def] |
|
344 |
"[|x: HInfinite; #0 <= y; #0 <= x|] ==> (x + y): HInfinite"; |
|
345 |
by (auto_tac (claset() addSIs [hypreal_add_zero_less_le_mono], |
|
346 |
simpset() addsimps [hrabs_eqI1, hypreal_add_commute, |
|
347 |
hypreal_le_add_order])); |
|
348 |
qed "HInfinite_add_ge_zero"; |
|
349 |
||
350 |
Goal "[|x: HInfinite; #0 <= y; #0 <= x|] ==> (y + x): HInfinite"; |
|
351 |
by (auto_tac (claset() addSIs [HInfinite_add_ge_zero], |
|
352 |
simpset() addsimps [hypreal_add_commute])); |
|
353 |
qed "HInfinite_add_ge_zero2"; |
|
354 |
||
355 |
Goal "[|x: HInfinite; #0 < y; #0 < x|] ==> (x + y): HInfinite"; |
|
356 |
by (blast_tac (claset() addIs [HInfinite_add_ge_zero, |
|
357 |
order_less_imp_le]) 1); |
|
358 |
qed "HInfinite_add_gt_zero"; |
|
359 |
||
360 |
Goalw [HInfinite_def] "(-x: HInfinite) = (x: HInfinite)"; |
|
361 |
by Auto_tac; |
|
362 |
qed "HInfinite_minus_iff"; |
|
363 |
||
364 |
Goal "[|x: HInfinite; y <= #0; x <= #0|] ==> (x + y): HInfinite"; |
|
365 |
by (dtac (HInfinite_minus_iff RS iffD2) 1); |
|
366 |
by (rtac (HInfinite_minus_iff RS iffD1) 1); |
|
367 |
by (auto_tac (claset() addIs [HInfinite_add_ge_zero], |
|
368 |
simpset() addsimps [hypreal_minus_zero_le_iff])); |
|
369 |
qed "HInfinite_add_le_zero"; |
|
370 |
||
371 |
Goal "[|x: HInfinite; y < #0; x < #0|] ==> (x + y): HInfinite"; |
|
372 |
by (blast_tac (claset() addIs [HInfinite_add_le_zero, |
|
373 |
order_less_imp_le]) 1); |
|
374 |
qed "HInfinite_add_lt_zero"; |
|
375 |
||
376 |
Goal "[|a: HFinite; b: HFinite; c: HFinite|] \ |
|
377 |
\ ==> a*a + b*b + c*c : HFinite"; |
|
378 |
by (auto_tac (claset() addIs [HFinite_mult,HFinite_add], simpset())); |
|
379 |
qed "HFinite_sum_squares"; |
|
380 |
||
381 |
Goal "x ~: Infinitesimal ==> x ~= #0"; |
|
382 |
by Auto_tac; |
|
383 |
qed "not_Infinitesimal_not_zero"; |
|
384 |
||
385 |
Goal "x: HFinite - Infinitesimal ==> x ~= #0"; |
|
386 |
by Auto_tac; |
|
387 |
qed "not_Infinitesimal_not_zero2"; |
|
388 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
389 |
Goal "(abs x : Infinitesimal) = (x : Infinitesimal)"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
390 |
by (auto_tac (claset(), simpset() addsimps [hrabs_def])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
391 |
qed "Infinitesimal_hrabs_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
392 |
AddIffs [Infinitesimal_hrabs_iff]; |
10751 | 393 |
|
394 |
Goal "x : HFinite - Infinitesimal ==> abs x : HFinite - Infinitesimal"; |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
395 |
by (Blast_tac 1); |
10751 | 396 |
qed "HFinite_diff_Infinitesimal_hrabs"; |
397 |
||
398 |
Goalw [Infinitesimal_def] |
|
399 |
"[| e : Infinitesimal; abs x < e |] ==> x : Infinitesimal"; |
|
400 |
by (auto_tac (claset() addSDs [bspec], simpset())); |
|
401 |
by (dres_inst_tac [("x","e")] (hrabs_ge_self RS order_le_less_trans) 1); |
|
402 |
by (fast_tac (claset() addIs [order_less_trans]) 1); |
|
403 |
qed "hrabs_less_Infinitesimal"; |
|
404 |
||
405 |
Goal "[| e : Infinitesimal; abs x <= e |] ==> x : Infinitesimal"; |
|
406 |
by (blast_tac (claset() addDs [order_le_imp_less_or_eq] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
407 |
addIs [hrabs_less_Infinitesimal]) 1); |
10751 | 408 |
qed "hrabs_le_Infinitesimal"; |
409 |
||
410 |
Goalw [Infinitesimal_def] |
|
411 |
"[| e : Infinitesimal; \ |
|
412 |
\ e' : Infinitesimal; \ |
|
413 |
\ e' < x ; x < e |] ==> x : Infinitesimal"; |
|
414 |
by (auto_tac (claset() addSDs [bspec], simpset())); |
|
415 |
by (dres_inst_tac [("x","e")] (hrabs_ge_self RS order_le_less_trans) 1); |
|
416 |
by (dtac (hrabs_interval_iff RS iffD1) 1); |
|
417 |
by (fast_tac(claset() addIs [order_less_trans,hrabs_interval_iff RS iffD2]) 1); |
|
418 |
qed "Infinitesimal_interval"; |
|
419 |
||
420 |
Goal "[| e : Infinitesimal; e' : Infinitesimal; \ |
|
421 |
\ e' <= x ; x <= e |] ==> x : Infinitesimal"; |
|
422 |
by (auto_tac (claset() addIs [Infinitesimal_interval], |
|
423 |
simpset() addsimps [hypreal_le_eq_less_or_eq])); |
|
424 |
qed "Infinitesimal_interval2"; |
|
425 |
||
426 |
Goalw [Infinitesimal_def] |
|
427 |
"[| x ~: Infinitesimal; y ~: Infinitesimal|] ==> (x*y) ~:Infinitesimal"; |
|
428 |
by (Clarify_tac 1); |
|
429 |
by (asm_full_simp_tac (simpset() addsimps [linorder_not_less]) 1); |
|
430 |
by (eres_inst_tac [("x","r*ra")] ballE 1); |
|
431 |
by (fast_tac (claset() addIs [SReal_mult]) 2); |
|
432 |
by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_mult_iff])); |
|
433 |
by (cut_inst_tac [("x","ra"),("y","abs y"), |
|
434 |
("u","r"),("v","abs x")] hypreal_mult_le_mono 1); |
|
435 |
by Auto_tac; |
|
436 |
qed "not_Infinitesimal_mult"; |
|
437 |
||
438 |
Goal "x*y : Infinitesimal ==> x : Infinitesimal | y : Infinitesimal"; |
|
439 |
by (rtac ccontr 1); |
|
440 |
by (dtac (de_Morgan_disj RS iffD1) 1); |
|
441 |
by (fast_tac (claset() addDs [not_Infinitesimal_mult]) 1); |
|
442 |
qed "Infinitesimal_mult_disj"; |
|
443 |
||
444 |
Goal "x: HFinite-Infinitesimal ==> x ~= #0"; |
|
445 |
by (Blast_tac 1); |
|
446 |
qed "HFinite_Infinitesimal_not_zero"; |
|
447 |
||
448 |
Goal "[| x : HFinite - Infinitesimal; \ |
|
449 |
\ y : HFinite - Infinitesimal \ |
|
450 |
\ |] ==> (x*y) : HFinite - Infinitesimal"; |
|
451 |
by (Clarify_tac 1); |
|
452 |
by (blast_tac (claset() addDs [HFinite_mult,not_Infinitesimal_mult]) 1); |
|
453 |
qed "HFinite_Infinitesimal_diff_mult"; |
|
454 |
||
455 |
Goalw [Infinitesimal_def,HFinite_def] |
|
456 |
"Infinitesimal <= HFinite"; |
|
457 |
by Auto_tac; |
|
458 |
by (res_inst_tac [("x","#1")] bexI 1); |
|
459 |
by Auto_tac; |
|
460 |
qed "Infinitesimal_subset_HFinite"; |
|
461 |
||
462 |
Goal "x: Infinitesimal ==> x * hypreal_of_real r : Infinitesimal"; |
|
463 |
by (etac (HFinite_hypreal_of_real RSN |
|
464 |
(2,Infinitesimal_HFinite_mult)) 1); |
|
465 |
qed "Infinitesimal_hypreal_of_real_mult"; |
|
466 |
||
467 |
Goal "x: Infinitesimal ==> hypreal_of_real r * x: Infinitesimal"; |
|
468 |
by (etac (HFinite_hypreal_of_real RSN |
|
469 |
(2,Infinitesimal_HFinite_mult2)) 1); |
|
470 |
qed "Infinitesimal_hypreal_of_real_mult2"; |
|
471 |
||
472 |
(*---------------------------------------------------------------------- |
|
473 |
Infinitely close relation @= |
|
474 |
----------------------------------------------------------------------*) |
|
475 |
||
476 |
Goalw [Infinitesimal_def,inf_close_def] |
|
477 |
"x:Infinitesimal = (x @= #0)"; |
|
478 |
by (Simp_tac 1); |
|
479 |
qed "mem_infmal_iff"; |
|
480 |
||
481 |
Goalw [inf_close_def]" (x @= y) = (x + -y @= #0)"; |
|
482 |
by (Simp_tac 1); |
|
483 |
qed "inf_close_minus_iff"; |
|
484 |
||
485 |
Goalw [inf_close_def]" (x @= y) = (-y + x @= #0)"; |
|
486 |
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1); |
|
487 |
qed "inf_close_minus_iff2"; |
|
488 |
||
489 |
Goalw [inf_close_def,Infinitesimal_def] "x @= x"; |
|
490 |
by (Simp_tac 1); |
|
491 |
qed "inf_close_refl"; |
|
492 |
AddIffs [inf_close_refl]; |
|
493 |
||
494 |
Goalw [inf_close_def] "x @= y ==> y @= x"; |
|
495 |
by (rtac (hypreal_minus_distrib1 RS subst) 1); |
|
496 |
by (etac (Infinitesimal_minus_iff RS iffD2) 1); |
|
497 |
qed "inf_close_sym"; |
|
498 |
||
499 |
Goalw [inf_close_def] "[| x @= y; y @= z |] ==> x @= z"; |
|
500 |
by (dtac Infinitesimal_add 1); |
|
501 |
by (assume_tac 1); |
|
502 |
by Auto_tac; |
|
503 |
qed "inf_close_trans"; |
|
504 |
||
505 |
Goal "[| r @= x; s @= x |] ==> r @= s"; |
|
506 |
by (blast_tac (claset() addIs [inf_close_sym, inf_close_trans]) 1); |
|
507 |
qed "inf_close_trans2"; |
|
508 |
||
509 |
Goal "[| x @= r; x @= s|] ==> r @= s"; |
|
510 |
by (blast_tac (claset() addIs [inf_close_sym, inf_close_trans]) 1); |
|
511 |
qed "inf_close_trans3"; |
|
512 |
||
513 |
Goal "(number_of w @= x) = (x @= number_of w)"; |
|
514 |
by (blast_tac (claset() addIs [inf_close_sym]) 1); |
|
515 |
qed "number_of_inf_close_reorient"; |
|
516 |
Addsimps [number_of_inf_close_reorient]; |
|
517 |
||
518 |
Goal "(x-y : Infinitesimal) = (x @= y)"; |
|
519 |
by (auto_tac (claset(), |
|
520 |
simpset() addsimps [hypreal_diff_def, inf_close_minus_iff RS sym, |
|
521 |
mem_infmal_iff])); |
|
522 |
qed "Infinitesimal_inf_close_minus"; |
|
523 |
||
524 |
Goalw [monad_def] "(x @= y) = (monad(x)=monad(y))"; |
|
525 |
by (auto_tac (claset() addDs [inf_close_sym] |
|
526 |
addSEs [inf_close_trans,equalityCE], |
|
527 |
simpset())); |
|
528 |
qed "inf_close_monad_iff"; |
|
529 |
||
530 |
Goal "[| x: Infinitesimal; y: Infinitesimal |] ==> x @= y"; |
|
531 |
by (asm_full_simp_tac (simpset() addsimps [mem_infmal_iff]) 1); |
|
532 |
by (blast_tac (claset() addIs [inf_close_trans, inf_close_sym]) 1); |
|
533 |
qed "Infinitesimal_inf_close"; |
|
534 |
||
535 |
val prem1::prem2::rest = |
|
536 |
goalw thy [inf_close_def] "[| a @= b; c @= d |] ==> a+c @= b+d"; |
|
537 |
by (rtac (hypreal_minus_add_distrib RS ssubst) 1); |
|
538 |
by (rtac (hypreal_add_assoc RS ssubst) 1); |
|
539 |
by (res_inst_tac [("y1","c")] (hypreal_add_left_commute RS subst) 1); |
|
540 |
by (rtac (hypreal_add_assoc RS subst) 1); |
|
541 |
by (rtac ([prem1,prem2] MRS Infinitesimal_add) 1); |
|
542 |
qed "inf_close_add"; |
|
543 |
||
544 |
Goal "a @= b ==> -a @= -b"; |
|
545 |
by (rtac ((inf_close_minus_iff RS iffD2) RS inf_close_sym) 1); |
|
546 |
by (dtac (inf_close_minus_iff RS iffD1) 1); |
|
547 |
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1); |
|
548 |
qed "inf_close_minus"; |
|
549 |
||
550 |
Goal "-a @= -b ==> a @= b"; |
|
551 |
by (auto_tac (claset() addDs [inf_close_minus], simpset())); |
|
552 |
qed "inf_close_minus2"; |
|
553 |
||
554 |
Goal "(-a @= -b) = (a @= b)"; |
|
555 |
by (blast_tac (claset() addIs [inf_close_minus,inf_close_minus2]) 1); |
|
556 |
qed "inf_close_minus_cancel"; |
|
557 |
||
558 |
Addsimps [inf_close_minus_cancel]; |
|
559 |
||
560 |
Goal "[| a @= b; c @= d |] ==> a + -c @= b + -d"; |
|
561 |
by (blast_tac (claset() addSIs [inf_close_add,inf_close_minus]) 1); |
|
562 |
qed "inf_close_add_minus"; |
|
563 |
||
564 |
Goalw [inf_close_def] "[| a @= b; c: HFinite|] ==> a*c @= b*c"; |
|
565 |
by (asm_full_simp_tac (simpset() addsimps [Infinitesimal_HFinite_mult, |
|
566 |
hypreal_minus_mult_eq1,hypreal_add_mult_distrib RS sym] |
|
567 |
delsimps [hypreal_minus_mult_eq1 RS sym]) 1); |
|
568 |
qed "inf_close_mult1"; |
|
569 |
||
570 |
Goal "[|a @= b; c: HFinite|] ==> c*a @= c*b"; |
|
571 |
by (asm_simp_tac (simpset() addsimps [inf_close_mult1,hypreal_mult_commute]) 1); |
|
572 |
qed "inf_close_mult2"; |
|
573 |
||
574 |
Goal "[|u @= v*x; x @= y; v: HFinite|] ==> u @= v*y"; |
|
575 |
by (fast_tac (claset() addIs [inf_close_mult2,inf_close_trans]) 1); |
|
576 |
qed "inf_close_mult_subst"; |
|
577 |
||
578 |
Goal "[| u @= x*v; x @= y; v: HFinite |] ==> u @= y*v"; |
|
579 |
by (fast_tac (claset() addIs [inf_close_mult1,inf_close_trans]) 1); |
|
580 |
qed "inf_close_mult_subst2"; |
|
581 |
||
582 |
Goal "[| u @= x*hypreal_of_real v; x @= y |] ==> u @= y*hypreal_of_real v"; |
|
583 |
by (auto_tac (claset() addIs [inf_close_mult_subst2], simpset())); |
|
584 |
qed "inf_close_mult_subst_SReal"; |
|
585 |
||
586 |
Goalw [inf_close_def] "a = b ==> a @= b"; |
|
587 |
by (Asm_simp_tac 1); |
|
588 |
qed "inf_close_eq_imp"; |
|
589 |
||
590 |
Goal "x: Infinitesimal ==> -x @= x"; |
|
591 |
by (fast_tac (HOL_cs addIs [Infinitesimal_minus_iff RS iffD2, |
|
592 |
mem_infmal_iff RS iffD1,inf_close_trans2]) 1); |
|
593 |
qed "Infinitesimal_minus_inf_close"; |
|
594 |
||
595 |
Goalw [inf_close_def] "(EX y: Infinitesimal. x + -z = y) = (x @= z)"; |
|
596 |
by (Blast_tac 1); |
|
597 |
qed "bex_Infinitesimal_iff"; |
|
598 |
||
599 |
Goal "(EX y: Infinitesimal. x = z + y) = (x @= z)"; |
|
600 |
by (asm_full_simp_tac (simpset() addsimps [bex_Infinitesimal_iff RS sym]) 1); |
|
601 |
by (Force_tac 1); |
|
602 |
qed "bex_Infinitesimal_iff2"; |
|
603 |
||
604 |
Goal "[| y: Infinitesimal; x + y = z |] ==> x @= z"; |
|
605 |
by (rtac (bex_Infinitesimal_iff RS iffD1) 1); |
|
606 |
by (dtac (Infinitesimal_minus_iff RS iffD2) 1); |
|
607 |
by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib, |
|
608 |
hypreal_add_assoc RS sym])); |
|
609 |
qed "Infinitesimal_add_inf_close"; |
|
610 |
||
611 |
Goal "y: Infinitesimal ==> x @= x + y"; |
|
612 |
by (rtac (bex_Infinitesimal_iff RS iffD1) 1); |
|
613 |
by (dtac (Infinitesimal_minus_iff RS iffD2) 1); |
|
614 |
by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib, |
|
615 |
hypreal_add_assoc RS sym])); |
|
616 |
qed "Infinitesimal_add_inf_close_self"; |
|
617 |
||
618 |
Goal "y: Infinitesimal ==> x @= y + x"; |
|
619 |
by (auto_tac (claset() addDs [Infinitesimal_add_inf_close_self], |
|
620 |
simpset() addsimps [hypreal_add_commute])); |
|
621 |
qed "Infinitesimal_add_inf_close_self2"; |
|
622 |
||
623 |
Goal "y: Infinitesimal ==> x @= x + -y"; |
|
624 |
by (blast_tac (claset() addSIs [Infinitesimal_add_inf_close_self, |
|
625 |
Infinitesimal_minus_iff RS iffD2]) 1); |
|
626 |
qed "Infinitesimal_add_minus_inf_close_self"; |
|
627 |
||
628 |
Goal "[| y: Infinitesimal; x+y @= z|] ==> x @= z"; |
|
629 |
by (dres_inst_tac [("x","x")] (Infinitesimal_add_inf_close_self RS inf_close_sym) 1); |
|
630 |
by (etac (inf_close_trans3 RS inf_close_sym) 1); |
|
631 |
by (assume_tac 1); |
|
632 |
qed "Infinitesimal_add_cancel"; |
|
633 |
||
634 |
Goal "[| y: Infinitesimal; x @= z + y|] ==> x @= z"; |
|
635 |
by (dres_inst_tac [("x","z")] (Infinitesimal_add_inf_close_self2 RS inf_close_sym) 1); |
|
636 |
by (etac (inf_close_trans3 RS inf_close_sym) 1); |
|
637 |
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 1); |
|
638 |
by (etac inf_close_sym 1); |
|
639 |
qed "Infinitesimal_add_right_cancel"; |
|
640 |
||
641 |
Goal "d + b @= d + c ==> b @= c"; |
|
642 |
by (dtac (inf_close_minus_iff RS iffD1) 1); |
|
643 |
by (asm_full_simp_tac (simpset() addsimps |
|
644 |
[hypreal_minus_add_distrib,inf_close_minus_iff RS sym] |
|
645 |
@ hypreal_add_ac) 1); |
|
646 |
qed "inf_close_add_left_cancel"; |
|
647 |
||
648 |
Goal "b + d @= c + d ==> b @= c"; |
|
649 |
by (rtac inf_close_add_left_cancel 1); |
|
650 |
by (asm_full_simp_tac (simpset() addsimps |
|
651 |
[hypreal_add_commute]) 1); |
|
652 |
qed "inf_close_add_right_cancel"; |
|
653 |
||
654 |
Goal "b @= c ==> d + b @= d + c"; |
|
655 |
by (rtac (inf_close_minus_iff RS iffD2) 1); |
|
656 |
by (asm_full_simp_tac (simpset() addsimps |
|
657 |
[hypreal_minus_add_distrib,inf_close_minus_iff RS sym] |
|
658 |
@ hypreal_add_ac) 1); |
|
659 |
qed "inf_close_add_mono1"; |
|
660 |
||
661 |
Goal "b @= c ==> b + a @= c + a"; |
|
662 |
by (asm_simp_tac (simpset() addsimps |
|
663 |
[hypreal_add_commute,inf_close_add_mono1]) 1); |
|
664 |
qed "inf_close_add_mono2"; |
|
665 |
||
666 |
Goal "(a + b @= a + c) = (b @= c)"; |
|
667 |
by (fast_tac (claset() addEs [inf_close_add_left_cancel, |
|
668 |
inf_close_add_mono1]) 1); |
|
669 |
qed "inf_close_add_left_iff"; |
|
670 |
||
671 |
Addsimps [inf_close_add_left_iff]; |
|
672 |
||
673 |
Goal "(b + a @= c + a) = (b @= c)"; |
|
674 |
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1); |
|
675 |
qed "inf_close_add_right_iff"; |
|
676 |
||
677 |
Addsimps [inf_close_add_right_iff]; |
|
678 |
||
679 |
Goal "[| x: HFinite; x @= y |] ==> y: HFinite"; |
|
680 |
by (dtac (bex_Infinitesimal_iff2 RS iffD2) 1); |
|
681 |
by (Step_tac 1); |
|
682 |
by (dtac (Infinitesimal_subset_HFinite RS subsetD |
|
683 |
RS (HFinite_minus_iff RS iffD2)) 1); |
|
684 |
by (dtac HFinite_add 1); |
|
685 |
by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc])); |
|
686 |
qed "inf_close_HFinite"; |
|
687 |
||
688 |
Goal "x @= hypreal_of_real D ==> x: HFinite"; |
|
689 |
by (rtac (inf_close_sym RSN (2,inf_close_HFinite)) 1); |
|
690 |
by Auto_tac; |
|
691 |
qed "inf_close_hypreal_of_real_HFinite"; |
|
692 |
||
693 |
Goal "[|a @= b; c @= d; b: HFinite; d: HFinite|] ==> a*c @= b*d"; |
|
694 |
by (rtac inf_close_trans 1); |
|
695 |
by (rtac inf_close_mult2 2); |
|
696 |
by (rtac inf_close_mult1 1); |
|
697 |
by (blast_tac (claset() addIs [inf_close_HFinite, inf_close_sym]) 2); |
|
698 |
by Auto_tac; |
|
699 |
qed "inf_close_mult_HFinite"; |
|
700 |
||
701 |
Goal "[|a @= hypreal_of_real b; c @= hypreal_of_real d |] \ |
|
702 |
\ ==> a*c @= hypreal_of_real b*hypreal_of_real d"; |
|
703 |
by (blast_tac (claset() addSIs [inf_close_mult_HFinite, |
|
704 |
inf_close_hypreal_of_real_HFinite,HFinite_hypreal_of_real]) 1); |
|
705 |
qed "inf_close_mult_hypreal_of_real"; |
|
706 |
||
707 |
Goal "[| a: SReal; a ~= #0; a*x @= #0 |] ==> x @= #0"; |
|
708 |
by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1); |
|
709 |
by (auto_tac (claset() addDs [inf_close_mult2], |
|
710 |
simpset() addsimps [hypreal_mult_assoc RS sym])); |
|
711 |
qed "inf_close_SReal_mult_cancel_zero"; |
|
712 |
||
713 |
(* REM comments: newly added *) |
|
714 |
Goal "[| a: SReal; x @= #0 |] ==> x*a @= #0"; |
|
715 |
by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD), |
|
716 |
inf_close_mult1], simpset())); |
|
717 |
qed "inf_close_mult_SReal1"; |
|
718 |
||
719 |
Goal "[| a: SReal; x @= #0 |] ==> a*x @= #0"; |
|
720 |
by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD), |
|
721 |
inf_close_mult2], simpset())); |
|
722 |
qed "inf_close_mult_SReal2"; |
|
723 |
||
724 |
Goal "[|a : SReal; a ~= #0 |] ==> (a*x @= #0) = (x @= #0)"; |
|
725 |
by (blast_tac (claset() addIs [inf_close_SReal_mult_cancel_zero, |
|
726 |
inf_close_mult_SReal2]) 1); |
|
727 |
qed "inf_close_mult_SReal_zero_cancel_iff"; |
|
728 |
Addsimps [inf_close_mult_SReal_zero_cancel_iff]; |
|
729 |
||
730 |
Goal "[| a: SReal; a ~= #0; a* w @= a*z |] ==> w @= z"; |
|
731 |
by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1); |
|
732 |
by (auto_tac (claset() addDs [inf_close_mult2], |
|
733 |
simpset() addsimps [hypreal_mult_assoc RS sym])); |
|
734 |
qed "inf_close_SReal_mult_cancel"; |
|
735 |
||
736 |
Goal "[| a: SReal; a ~= #0|] ==> (a* w @= a*z) = (w @= z)"; |
|
737 |
by (auto_tac (claset() addSIs [inf_close_mult2,SReal_subset_HFinite RS subsetD] |
|
738 |
addIs [inf_close_SReal_mult_cancel], simpset())); |
|
739 |
qed "inf_close_SReal_mult_cancel_iff1"; |
|
740 |
Addsimps [inf_close_SReal_mult_cancel_iff1]; |
|
741 |
||
742 |
Goal "[| z <= f; f @= g; g <= z |] ==> f @= z"; |
|
743 |
by (asm_full_simp_tac (simpset() addsimps [bex_Infinitesimal_iff2 RS sym]) 1); |
|
744 |
by Auto_tac; |
|
745 |
by (res_inst_tac [("x","g+y-z")] bexI 1); |
|
746 |
by (Simp_tac 1); |
|
747 |
by (rtac Infinitesimal_interval2 1); |
|
748 |
by (rtac Infinitesimal_zero 2); |
|
749 |
by Auto_tac; |
|
750 |
qed "inf_close_le_bound"; |
|
751 |
||
752 |
(*----------------------------------------------------------------- |
|
753 |
Zero is the only infinitesimal that is also a real |
|
754 |
-----------------------------------------------------------------*) |
|
755 |
||
756 |
Goalw [Infinitesimal_def] |
|
757 |
"[| x: SReal; y: Infinitesimal; #0 < x |] ==> y < x"; |
|
758 |
by (rtac (hrabs_ge_self RS order_le_less_trans) 1); |
|
759 |
by Auto_tac; |
|
760 |
qed "Infinitesimal_less_SReal"; |
|
761 |
||
762 |
Goal "y: Infinitesimal ==> ALL r: SReal. #0 < r --> y < r"; |
|
763 |
by (blast_tac (claset() addIs [Infinitesimal_less_SReal]) 1); |
|
764 |
qed "Infinitesimal_less_SReal2"; |
|
765 |
||
766 |
Goalw [Infinitesimal_def] |
|
767 |
"[| #0 < y; y: SReal|] ==> y ~: Infinitesimal"; |
|
768 |
by (auto_tac (claset(), simpset() addsimps [hrabs_def])); |
|
769 |
qed "SReal_not_Infinitesimal"; |
|
770 |
||
771 |
Goal "[| y < #0; y : SReal |] ==> y ~: Infinitesimal"; |
|
772 |
by (stac (Infinitesimal_minus_iff RS sym) 1); |
|
773 |
by (rtac SReal_not_Infinitesimal 1); |
|
774 |
by Auto_tac; |
|
775 |
qed "SReal_minus_not_Infinitesimal"; |
|
776 |
||
777 |
Goal "SReal Int Infinitesimal = {#0}"; |
|
778 |
by Auto_tac; |
|
779 |
by (cut_inst_tac [("x","x"),("y","#0")] hypreal_linear 1); |
|
780 |
by (blast_tac (claset() addDs [SReal_not_Infinitesimal, |
|
781 |
SReal_minus_not_Infinitesimal]) 1); |
|
782 |
qed "SReal_Int_Infinitesimal_zero"; |
|
783 |
||
784 |
Goal "[| x: SReal; x: Infinitesimal|] ==> x = #0"; |
|
785 |
by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1); |
|
786 |
by (Blast_tac 1); |
|
787 |
qed "SReal_Infinitesimal_zero"; |
|
788 |
||
789 |
Goal "[| x : SReal; x ~= #0 |] ==> x : HFinite - Infinitesimal"; |
|
790 |
by (auto_tac (claset() addDs [SReal_Infinitesimal_zero, |
|
791 |
SReal_subset_HFinite RS subsetD], |
|
792 |
simpset())); |
|
793 |
qed "SReal_HFinite_diff_Infinitesimal"; |
|
794 |
||
795 |
Goal "hypreal_of_real x ~= #0 ==> hypreal_of_real x : HFinite - Infinitesimal"; |
|
796 |
by (rtac SReal_HFinite_diff_Infinitesimal 1); |
|
797 |
by Auto_tac; |
|
798 |
qed "hypreal_of_real_HFinite_diff_Infinitesimal"; |
|
799 |
||
800 |
Goal "(hypreal_of_real x : Infinitesimal) = (x=#0)"; |
|
801 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero])); |
|
802 |
by (rtac ccontr 1); |
|
803 |
by (rtac (hypreal_of_real_HFinite_diff_Infinitesimal RS DiffD2) 1); |
|
804 |
by Auto_tac; |
|
805 |
qed "hypreal_of_real_Infinitesimal_iff_0"; |
|
806 |
AddIffs [hypreal_of_real_Infinitesimal_iff_0]; |
|
807 |
||
808 |
Goal "number_of w ~= (#0::hypreal) ==> number_of w ~: Infinitesimal"; |
|
809 |
by (fast_tac (claset() addDs [SReal_number_of RS SReal_Infinitesimal_zero]) 1); |
|
810 |
qed "number_of_not_Infinitesimal"; |
|
811 |
Addsimps [number_of_not_Infinitesimal]; |
|
812 |
||
813 |
Goal "[| y: SReal; x @= y; y~= #0 |] ==> x ~= #0"; |
|
814 |
by (cut_inst_tac [("x","y")] hypreal_trichotomy 1); |
|
815 |
by (Asm_full_simp_tac 1); |
|
816 |
by (blast_tac (claset() addDs |
|
817 |
[inf_close_sym RS (mem_infmal_iff RS iffD2), |
|
818 |
SReal_not_Infinitesimal, SReal_minus_not_Infinitesimal]) 1); |
|
819 |
qed "inf_close_SReal_not_zero"; |
|
820 |
||
821 |
Goal "[| x @= y; y : HFinite - Infinitesimal |] \ |
|
822 |
\ ==> x : HFinite - Infinitesimal"; |
|
823 |
by (auto_tac (claset() addIs [inf_close_sym RSN (2,inf_close_HFinite)], |
|
824 |
simpset() addsimps [mem_infmal_iff])); |
|
825 |
by (dtac inf_close_trans3 1 THEN assume_tac 1); |
|
826 |
by (blast_tac (claset() addDs [inf_close_sym]) 1); |
|
827 |
qed "HFinite_diff_Infinitesimal_inf_close"; |
|
828 |
||
829 |
(*The premise y~=0 is essential; otherwise x/y =0 and we lose the |
|
830 |
HFinite premise.*) |
|
831 |
Goal "[| y ~= #0; y: Infinitesimal; x/y : HFinite |] ==> x : Infinitesimal"; |
|
832 |
by (dtac Infinitesimal_HFinite_mult2 1); |
|
833 |
by (assume_tac 1); |
|
834 |
by (asm_full_simp_tac |
|
835 |
(simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 1); |
|
836 |
qed "Infinitesimal_ratio"; |
|
837 |
||
838 |
(*------------------------------------------------------------------ |
|
839 |
Standard Part Theorem: Every finite x: R* is infinitely |
|
840 |
close to a unique real number (i.e a member of SReal) |
|
841 |
------------------------------------------------------------------*) |
|
842 |
(*------------------------------------------------------------------ |
|
843 |
Uniqueness: Two infinitely close reals are equal |
|
844 |
------------------------------------------------------------------*) |
|
845 |
||
846 |
Goal "[|x: SReal; y: SReal|] ==> (x @= y) = (x = y)"; |
|
847 |
by Auto_tac; |
|
848 |
by (rewrite_goals_tac [inf_close_def]); |
|
849 |
by (dres_inst_tac [("x","y")] SReal_minus 1); |
|
850 |
by (dtac SReal_add 1 THEN assume_tac 1); |
|
851 |
by (dtac SReal_Infinitesimal_zero 1 THEN assume_tac 1); |
|
852 |
by (dtac sym 1); |
|
853 |
by (asm_full_simp_tac (simpset() addsimps [hypreal_eq_minus_iff RS sym]) 1); |
|
854 |
qed "SReal_inf_close_iff"; |
|
855 |
||
856 |
Goal "(number_of v @= number_of w) = (number_of v = (number_of w :: hypreal))"; |
|
857 |
by (rtac SReal_inf_close_iff 1); |
|
858 |
by Auto_tac; |
|
859 |
qed "number_of_inf_close_iff"; |
|
860 |
Addsimps [number_of_inf_close_iff]; |
|
861 |
||
862 |
Goal "(hypreal_of_real k @= hypreal_of_real m) = (k = m)"; |
|
863 |
by Auto_tac; |
|
864 |
by (rtac (inj_hypreal_of_real RS injD) 1); |
|
865 |
by (rtac (SReal_inf_close_iff RS iffD1) 1); |
|
866 |
by Auto_tac; |
|
867 |
qed "hypreal_of_real_inf_close_iff"; |
|
868 |
Addsimps [hypreal_of_real_inf_close_iff]; |
|
869 |
||
870 |
Goal "(hypreal_of_real k @= number_of w) = (k = number_of w)"; |
|
871 |
by (stac (hypreal_of_real_inf_close_iff RS sym) 1); |
|
872 |
by Auto_tac; |
|
873 |
qed "hypreal_of_real_inf_close_number_of_iff"; |
|
874 |
Addsimps [hypreal_of_real_inf_close_number_of_iff]; |
|
875 |
||
876 |
Goal "[| r: SReal; s: SReal; r @= x; s @= x|] ==> r = s"; |
|
877 |
by (blast_tac (claset() addIs [(SReal_inf_close_iff RS iffD1), |
|
878 |
inf_close_trans2]) 1); |
|
879 |
qed "inf_close_unique_real"; |
|
880 |
||
881 |
(*------------------------------------------------------------------ |
|
882 |
Existence of unique real infinitely close |
|
883 |
------------------------------------------------------------------*) |
|
884 |
(* lemma about lubs *) |
|
885 |
Goal "!!(x::hypreal). [| isLub R S x; isLub R S y |] ==> x = y"; |
|
886 |
by (forward_tac [isLub_isUb] 1); |
|
887 |
by (forw_inst_tac [("x","y")] isLub_isUb 1); |
|
888 |
by (blast_tac (claset() addSIs [hypreal_le_anti_sym] |
|
889 |
addSDs [isLub_le_isUb]) 1); |
|
890 |
qed "hypreal_isLub_unique"; |
|
891 |
||
892 |
Goal "x: HFinite ==> EX u. isUb SReal {s. s: SReal & s < x} u"; |
|
893 |
by (dtac HFiniteD 1 THEN Step_tac 1); |
|
894 |
by (rtac exI 1 THEN rtac isUbI 1 THEN assume_tac 2); |
|
895 |
by (auto_tac (claset() addIs [order_less_imp_le,setleI,isUbI, |
|
896 |
order_less_trans], simpset() addsimps [hrabs_interval_iff])); |
|
897 |
qed "lemma_st_part_ub"; |
|
898 |
||
899 |
Goal "x: HFinite ==> EX y. y: {s. s: SReal & s < x}"; |
|
900 |
by (dtac HFiniteD 1 THEN Step_tac 1); |
|
901 |
by (dtac SReal_minus 1); |
|
902 |
by (res_inst_tac [("x","-t")] exI 1); |
|
903 |
by (auto_tac (claset(), simpset() addsimps [hrabs_interval_iff])); |
|
904 |
qed "lemma_st_part_nonempty"; |
|
905 |
||
906 |
Goal "{s. s: SReal & s < x} <= SReal"; |
|
907 |
by Auto_tac; |
|
908 |
qed "lemma_st_part_subset"; |
|
909 |
||
910 |
Goal "x: HFinite ==> EX t. isLub SReal {s. s: SReal & s < x} t"; |
|
911 |
by (blast_tac (claset() addSIs [SReal_complete,lemma_st_part_ub, |
|
912 |
lemma_st_part_nonempty, lemma_st_part_subset]) 1); |
|
913 |
qed "lemma_st_part_lub"; |
|
914 |
||
915 |
Goal "((t::hypreal) + r <= t) = (r <= #0)"; |
|
916 |
by (Step_tac 1); |
|
917 |
by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1); |
|
918 |
by (dres_inst_tac [("x","t")] hypreal_add_left_le_mono1 2); |
|
919 |
by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym])); |
|
920 |
qed "lemma_hypreal_le_left_cancel"; |
|
921 |
||
922 |
Goal "[| x: HFinite; isLub SReal {s. s: SReal & s < x} t; \ |
|
923 |
\ r: SReal; #0 < r |] ==> x <= t + r"; |
|
924 |
by (forward_tac [isLubD1a] 1); |
|
925 |
by (rtac ccontr 1 THEN dtac (linorder_not_le RS iffD2) 1); |
|
926 |
by (dres_inst_tac [("x","t")] SReal_add 1 THEN assume_tac 1); |
|
927 |
by (dres_inst_tac [("y","t + r")] (isLubD1 RS setleD) 1); |
|
928 |
by Auto_tac; |
|
929 |
qed "lemma_st_part_le1"; |
|
930 |
||
931 |
Goalw [setle_def] "!!x::hypreal. [| S *<= x; x < y |] ==> S *<= y"; |
|
932 |
by (auto_tac (claset() addSDs [bspec,order_le_less_trans] |
|
933 |
addIs [order_less_imp_le], |
|
934 |
simpset())); |
|
935 |
qed "hypreal_setle_less_trans"; |
|
936 |
||
937 |
Goalw [isUb_def] |
|
938 |
"!!x::hypreal. [| isUb R S x; x < y; y: R |] ==> isUb R S y"; |
|
939 |
by (blast_tac (claset() addIs [hypreal_setle_less_trans]) 1); |
|
940 |
qed "hypreal_gt_isUb"; |
|
941 |
||
942 |
Goal "[| x: HFinite; x < y; y: SReal |] \ |
|
943 |
\ ==> isUb SReal {s. s: SReal & s < x} y"; |
|
944 |
by (auto_tac (claset() addDs [order_less_trans] |
|
945 |
addIs [order_less_imp_le] addSIs [isUbI,setleI], simpset())); |
|
946 |
qed "lemma_st_part_gt_ub"; |
|
947 |
||
948 |
Goal "t <= t + -r ==> r <= (#0::hypreal)"; |
|
949 |
by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1); |
|
950 |
by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym])); |
|
951 |
qed "lemma_minus_le_zero"; |
|
952 |
||
953 |
Goal "[| x: HFinite; \ |
|
954 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
955 |
\ r: SReal; #0 < r |] \ |
|
956 |
\ ==> t + -r <= x"; |
|
957 |
by (forward_tac [isLubD1a] 1); |
|
958 |
by (rtac ccontr 1 THEN dtac not_hypreal_leE 1); |
|
959 |
by (dtac SReal_minus 1 THEN dres_inst_tac [("x","t")] |
|
960 |
SReal_add 1 THEN assume_tac 1); |
|
961 |
by (dtac lemma_st_part_gt_ub 1 THEN REPEAT(assume_tac 1)); |
|
962 |
by (dtac isLub_le_isUb 1 THEN assume_tac 1); |
|
963 |
by (dtac lemma_minus_le_zero 1); |
|
964 |
by (auto_tac (claset() addDs [order_less_le_trans], simpset())); |
|
965 |
qed "lemma_st_part_le2"; |
|
966 |
||
967 |
Goal "((x::hypreal) <= t + r) = (x + -t <= r)"; |
|
968 |
by Auto_tac; |
|
969 |
qed "lemma_hypreal_le_swap"; |
|
970 |
||
971 |
Goal "[| x: HFinite; \ |
|
972 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
973 |
\ r: SReal; #0 < r |] \ |
|
974 |
\ ==> x + -t <= r"; |
|
975 |
by (blast_tac (claset() addSIs [lemma_hypreal_le_swap RS iffD1, |
|
976 |
lemma_st_part_le1]) 1); |
|
977 |
qed "lemma_st_part1a"; |
|
978 |
||
979 |
Goal "(t + -r <= x) = (-(x + -t) <= (r::hypreal))"; |
|
980 |
by Auto_tac; |
|
981 |
qed "lemma_hypreal_le_swap2"; |
|
982 |
||
983 |
Goal "[| x: HFinite; \ |
|
984 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
985 |
\ r: SReal; #0 < r |] \ |
|
986 |
\ ==> -(x + -t) <= r"; |
|
987 |
by (blast_tac (claset() addSIs [lemma_hypreal_le_swap2 RS iffD1, |
|
988 |
lemma_st_part_le2]) 1); |
|
989 |
qed "lemma_st_part2a"; |
|
990 |
||
991 |
Goal "(x::hypreal): SReal ==> isUb SReal {s. s: SReal & s < x} x"; |
|
992 |
by (auto_tac (claset() addIs [isUbI, setleI,order_less_imp_le], simpset())); |
|
993 |
qed "lemma_SReal_ub"; |
|
994 |
||
995 |
Goal "(x::hypreal): SReal ==> isLub SReal {s. s: SReal & s < x} x"; |
|
996 |
by (auto_tac (claset() addSIs [isLubI2,lemma_SReal_ub,setgeI], simpset())); |
|
997 |
by (forward_tac [isUbD2a] 1); |
|
998 |
by (res_inst_tac [("x","x"),("y","y")] hypreal_linear_less2 1); |
|
999 |
by (auto_tac (claset() addSIs [order_less_imp_le], simpset())); |
|
1000 |
by (EVERY1[dtac SReal_dense, assume_tac, assume_tac, Step_tac]); |
|
1001 |
by (dres_inst_tac [("y","r")] isUbD 1); |
|
1002 |
by (auto_tac (claset() addDs [order_less_le_trans], simpset())); |
|
1003 |
qed "lemma_SReal_lub"; |
|
1004 |
||
1005 |
Goal "[| x: HFinite; \ |
|
1006 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
1007 |
\ r: SReal; #0 < r |] \ |
|
1008 |
\ ==> x + -t ~= r"; |
|
1009 |
by Auto_tac; |
|
1010 |
by (forward_tac [isLubD1a RS SReal_minus] 1); |
|
1011 |
by (dtac SReal_add_cancel 1 THEN assume_tac 1); |
|
1012 |
by (dres_inst_tac [("x","x")] lemma_SReal_lub 1); |
|
1013 |
by (dtac hypreal_isLub_unique 1 THEN assume_tac 1); |
|
1014 |
by Auto_tac; |
|
1015 |
qed "lemma_st_part_not_eq1"; |
|
1016 |
||
1017 |
Goal "[| x: HFinite; \ |
|
1018 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
1019 |
\ r: SReal; #0 < r |] \ |
|
1020 |
\ ==> -(x + -t) ~= r"; |
|
1021 |
by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib])); |
|
1022 |
by (forward_tac [isLubD1a] 1); |
|
1023 |
by (dtac SReal_add_cancel 1 THEN assume_tac 1); |
|
1024 |
by (dres_inst_tac [("x","-x")] SReal_minus 1); |
|
1025 |
by (Asm_full_simp_tac 1); |
|
1026 |
by (dres_inst_tac [("x","x")] lemma_SReal_lub 1); |
|
1027 |
by (dtac hypreal_isLub_unique 1 THEN assume_tac 1); |
|
1028 |
by Auto_tac; |
|
1029 |
qed "lemma_st_part_not_eq2"; |
|
1030 |
||
1031 |
Goal "[| x: HFinite; \ |
|
1032 |
\ isLub SReal {s. s: SReal & s < x} t; \ |
|
1033 |
\ r: SReal; #0 < r |] \ |
|
1034 |
\ ==> abs (x + -t) < r"; |
|
1035 |
by (forward_tac [lemma_st_part1a] 1); |
|
1036 |
by (forward_tac [lemma_st_part2a] 4); |
|
1037 |
by Auto_tac; |
|
1038 |
by (REPEAT(dtac order_le_imp_less_or_eq 1)); |
|
1039 |
by (auto_tac (claset() addDs [lemma_st_part_not_eq1, |
|
1040 |
lemma_st_part_not_eq2], simpset() addsimps [hrabs_interval_iff2])); |
|
1041 |
qed "lemma_st_part_major"; |
|
1042 |
||
1043 |
Goal "[| x: HFinite; \ |
|
1044 |
\ isLub SReal {s. s: SReal & s < x} t |] \ |
|
1045 |
\ ==> ALL r: SReal. #0 < r --> abs (x + -t) < r"; |
|
1046 |
by (blast_tac (claset() addSDs [lemma_st_part_major]) 1); |
|
1047 |
qed "lemma_st_part_major2"; |
|
1048 |
||
1049 |
(*---------------------------------------------- |
|
1050 |
Existence of real and Standard Part Theorem |
|
1051 |
----------------------------------------------*) |
|
1052 |
Goal "x: HFinite ==> \ |
|
1053 |
\ EX t: SReal. ALL r: SReal. #0 < r --> abs (x + -t) < r"; |
|
1054 |
by (forward_tac [lemma_st_part_lub] 1 THEN Step_tac 1); |
|
1055 |
by (forward_tac [isLubD1a] 1); |
|
1056 |
by (blast_tac (claset() addDs [lemma_st_part_major2]) 1); |
|
1057 |
qed "lemma_st_part_Ex"; |
|
1058 |
||
1059 |
Goalw [inf_close_def,Infinitesimal_def] |
|
1060 |
"x:HFinite ==> EX t: SReal. x @= t"; |
|
1061 |
by (dtac lemma_st_part_Ex 1); |
|
1062 |
by Auto_tac; |
|
1063 |
qed "st_part_Ex"; |
|
1064 |
||
1065 |
(*-------------------------------- |
|
1066 |
Unique real infinitely close |
|
1067 |
-------------------------------*) |
|
1068 |
Goal "x:HFinite ==> EX! t. t: SReal & x @= t"; |
|
1069 |
by (dtac st_part_Ex 1 THEN Step_tac 1); |
|
1070 |
by (dtac inf_close_sym 2 THEN dtac inf_close_sym 2 |
|
1071 |
THEN dtac inf_close_sym 2); |
|
1072 |
by (auto_tac (claset() addSIs [inf_close_unique_real], simpset())); |
|
1073 |
qed "st_part_Ex1"; |
|
1074 |
||
1075 |
(*------------------------------------------------------------------ |
|
1076 |
Finite and Infinite --- more theorems |
|
1077 |
------------------------------------------------------------------*) |
|
1078 |
||
1079 |
Goalw [HFinite_def,HInfinite_def] "HFinite Int HInfinite = {}"; |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1080 |
by (auto_tac (claset() addIs [hypreal_less_irrefl] addDs [order_less_trans], |
10751 | 1081 |
simpset())); |
1082 |
qed "HFinite_Int_HInfinite_empty"; |
|
1083 |
Addsimps [HFinite_Int_HInfinite_empty]; |
|
1084 |
||
1085 |
Goal "x: HFinite ==> x ~: HInfinite"; |
|
1086 |
by (EVERY1[Step_tac, dtac IntI, assume_tac]); |
|
1087 |
by Auto_tac; |
|
1088 |
qed "HFinite_not_HInfinite"; |
|
1089 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1090 |
Goalw [HInfinite_def, HFinite_def] "x~: HFinite ==> x: HInfinite"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1091 |
by Auto_tac; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1092 |
by (dres_inst_tac [("x","r + #1")] bspec 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1093 |
by (auto_tac (claset(), simpset() addsimps [SReal_add])); |
10751 | 1094 |
qed "not_HFinite_HInfinite"; |
1095 |
||
1096 |
Goal "x : HInfinite | x : HFinite"; |
|
1097 |
by (blast_tac (claset() addIs [not_HFinite_HInfinite]) 1); |
|
1098 |
qed "HInfinite_HFinite_disj"; |
|
1099 |
||
1100 |
Goal "(x : HInfinite) = (x ~: HFinite)"; |
|
1101 |
by (blast_tac (claset() addDs [HFinite_not_HInfinite, |
|
1102 |
not_HFinite_HInfinite]) 1); |
|
1103 |
qed "HInfinite_HFinite_iff"; |
|
1104 |
||
1105 |
Goal "(x : HFinite) = (x ~: HInfinite)"; |
|
1106 |
by (simp_tac (simpset() addsimps [HInfinite_HFinite_iff]) 1); |
|
1107 |
qed "HFinite_HInfinite_iff"; |
|
1108 |
||
1109 |
(*------------------------------------------------------------------ |
|
1110 |
Finite, Infinite and Infinitesimal --- more theorems |
|
1111 |
------------------------------------------------------------------*) |
|
1112 |
||
1113 |
Goal "x ~: Infinitesimal ==> x : HInfinite | x : HFinite - Infinitesimal"; |
|
1114 |
by (fast_tac (claset() addIs [not_HFinite_HInfinite]) 1); |
|
1115 |
qed "HInfinite_diff_HFinite_Infinitesimal_disj"; |
|
1116 |
||
1117 |
Goal "[| x : HFinite; x ~: Infinitesimal |] ==> inverse x : HFinite"; |
|
1118 |
by (cut_inst_tac [("x","inverse x")] HInfinite_HFinite_disj 1); |
|
1119 |
by (auto_tac (claset() addSDs [HInfinite_inverse_Infinitesimal], simpset())); |
|
1120 |
qed "HFinite_inverse"; |
|
1121 |
||
1122 |
Goal "x : HFinite - Infinitesimal ==> inverse x : HFinite"; |
|
1123 |
by (blast_tac (claset() addIs [HFinite_inverse]) 1); |
|
1124 |
qed "HFinite_inverse2"; |
|
1125 |
||
1126 |
(* stronger statement possible in fact *) |
|
1127 |
Goal "x ~: Infinitesimal ==> inverse(x) : HFinite"; |
|
1128 |
by (dtac HInfinite_diff_HFinite_Infinitesimal_disj 1); |
|
1129 |
by (blast_tac (claset() addIs [HFinite_inverse, |
|
1130 |
HInfinite_inverse_Infinitesimal, |
|
1131 |
Infinitesimal_subset_HFinite RS subsetD]) 1); |
|
1132 |
qed "Infinitesimal_inverse_HFinite"; |
|
1133 |
||
1134 |
Goal "x : HFinite - Infinitesimal ==> inverse x : HFinite - Infinitesimal"; |
|
1135 |
by (auto_tac (claset() addIs [Infinitesimal_inverse_HFinite], simpset())); |
|
1136 |
by (dtac Infinitesimal_HFinite_mult2 1); |
|
1137 |
by (assume_tac 1); |
|
1138 |
by (asm_full_simp_tac |
|
1139 |
(simpset() addsimps [not_Infinitesimal_not_zero, hypreal_mult_inverse]) 1); |
|
1140 |
qed "HFinite_not_Infinitesimal_inverse"; |
|
1141 |
||
1142 |
Goal "[| x @= y; y : HFinite - Infinitesimal |] \ |
|
1143 |
\ ==> inverse x @= inverse y"; |
|
1144 |
by (forward_tac [HFinite_diff_Infinitesimal_inf_close] 1); |
|
1145 |
by (assume_tac 1); |
|
1146 |
by (forward_tac [not_Infinitesimal_not_zero2] 1); |
|
1147 |
by (forw_inst_tac [("x","x")] not_Infinitesimal_not_zero2 1); |
|
1148 |
by (REPEAT(dtac HFinite_inverse2 1)); |
|
1149 |
by (dtac inf_close_mult2 1 THEN assume_tac 1); |
|
1150 |
by Auto_tac; |
|
1151 |
by (dres_inst_tac [("c","inverse x")] inf_close_mult1 1 |
|
1152 |
THEN assume_tac 1); |
|
1153 |
by (auto_tac (claset() addIs [inf_close_sym], |
|
1154 |
simpset() addsimps [hypreal_mult_assoc])); |
|
1155 |
qed "inf_close_inverse"; |
|
1156 |
||
1157 |
(*Used for NSLIM_inverse, NSLIMSEQ_inverse*) |
|
1158 |
bind_thm ("hypreal_of_real_inf_close_inverse", |
|
1159 |
hypreal_of_real_HFinite_diff_Infinitesimal RSN (2, inf_close_inverse)); |
|
1160 |
||
1161 |
Goal "[| x: HFinite - Infinitesimal; \ |
|
1162 |
\ h : Infinitesimal |] ==> inverse(x + h) @= inverse x"; |
|
1163 |
by (auto_tac (claset() addIs [inf_close_inverse, inf_close_sym, |
|
1164 |
Infinitesimal_add_inf_close_self], |
|
1165 |
simpset())); |
|
1166 |
qed "inverse_add_Infinitesimal_inf_close"; |
|
1167 |
||
1168 |
Goal "[| x: HFinite - Infinitesimal; \ |
|
1169 |
\ h : Infinitesimal |] ==> inverse(h + x) @= inverse x"; |
|
1170 |
by (rtac (hypreal_add_commute RS subst) 1); |
|
1171 |
by (blast_tac (claset() addIs [inverse_add_Infinitesimal_inf_close]) 1); |
|
1172 |
qed "inverse_add_Infinitesimal_inf_close2"; |
|
1173 |
||
1174 |
Goal "[| x : HFinite - Infinitesimal; \ |
|
1175 |
\ h : Infinitesimal |] ==> inverse(x + h) + -inverse x @= h"; |
|
1176 |
by (rtac inf_close_trans2 1); |
|
1177 |
by (auto_tac (claset() addIs [inverse_add_Infinitesimal_inf_close], |
|
1178 |
simpset() addsimps [mem_infmal_iff, |
|
1179 |
inf_close_minus_iff RS sym])); |
|
1180 |
qed "inverse_add_Infinitesimal_inf_close_Infinitesimal"; |
|
1181 |
||
1182 |
Goal "(x : Infinitesimal) = (x*x : Infinitesimal)"; |
|
1183 |
by (auto_tac (claset() addIs [Infinitesimal_mult], simpset())); |
|
1184 |
by (rtac ccontr 1 THEN forward_tac [Infinitesimal_inverse_HFinite] 1); |
|
1185 |
by (forward_tac [not_Infinitesimal_not_zero] 1); |
|
1186 |
by (auto_tac (claset() addDs [Infinitesimal_HFinite_mult], |
|
1187 |
simpset() addsimps [hypreal_mult_assoc])); |
|
1188 |
qed "Infinitesimal_square_iff"; |
|
1189 |
Addsimps [Infinitesimal_square_iff RS sym]; |
|
1190 |
||
1191 |
Goal "(x*x : HFinite) = (x : HFinite)"; |
|
1192 |
by (auto_tac (claset() addIs [HFinite_mult], simpset())); |
|
1193 |
by (auto_tac (claset() addDs [HInfinite_mult], |
|
1194 |
simpset() addsimps [HFinite_HInfinite_iff])); |
|
1195 |
qed "HFinite_square_iff"; |
|
1196 |
Addsimps [HFinite_square_iff]; |
|
1197 |
||
1198 |
Goal "(x*x : HInfinite) = (x : HInfinite)"; |
|
1199 |
by (auto_tac (claset(), simpset() addsimps |
|
1200 |
[HInfinite_HFinite_iff])); |
|
1201 |
qed "HInfinite_square_iff"; |
|
1202 |
Addsimps [HInfinite_square_iff]; |
|
1203 |
||
1204 |
Goal "[| a: HFinite-Infinitesimal; a* w @= a*z |] ==> w @= z"; |
|
1205 |
by (Step_tac 1); |
|
1206 |
by (ftac HFinite_inverse 1 THEN assume_tac 1); |
|
1207 |
by (dtac not_Infinitesimal_not_zero 1); |
|
1208 |
by (auto_tac (claset() addDs [inf_close_mult2], |
|
1209 |
simpset() addsimps [hypreal_mult_assoc RS sym])); |
|
1210 |
qed "inf_close_HFinite_mult_cancel"; |
|
1211 |
||
1212 |
Goal "a: HFinite-Infinitesimal ==> (a * w @= a * z) = (w @= z)"; |
|
1213 |
by (auto_tac (claset() addIs [inf_close_mult2, |
|
1214 |
inf_close_HFinite_mult_cancel], simpset())); |
|
1215 |
qed "inf_close_HFinite_mult_cancel_iff1"; |
|
1216 |
||
1217 |
(*------------------------------------------------------------------ |
|
1218 |
more about absolute value (hrabs) |
|
1219 |
------------------------------------------------------------------*) |
|
1220 |
||
1221 |
Goal "abs x @= x | abs x @= -x"; |
|
1222 |
by (cut_inst_tac [("x","x")] hrabs_disj 1); |
|
1223 |
by Auto_tac; |
|
1224 |
qed "inf_close_hrabs_disj"; |
|
1225 |
||
1226 |
(*------------------------------------------------------------------ |
|
1227 |
Theorems about monads |
|
1228 |
------------------------------------------------------------------*) |
|
1229 |
||
1230 |
Goal "monad (abs x) <= monad(x) Un monad(-x)"; |
|
1231 |
by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1); |
|
1232 |
by Auto_tac; |
|
1233 |
qed "monad_hrabs_Un_subset"; |
|
1234 |
||
1235 |
Goal "e : Infinitesimal ==> monad (x+e) = monad x"; |
|
1236 |
by (fast_tac (claset() addSIs [Infinitesimal_add_inf_close_self RS inf_close_sym, |
|
1237 |
inf_close_monad_iff RS iffD1]) 1); |
|
1238 |
qed "Infinitesimal_monad_eq"; |
|
1239 |
||
1240 |
Goalw [monad_def] "(u:monad x) = (-u:monad (-x))"; |
|
1241 |
by Auto_tac; |
|
1242 |
qed "mem_monad_iff"; |
|
1243 |
||
1244 |
Goalw [monad_def] "(x:Infinitesimal) = (x:monad #0)"; |
|
1245 |
by (auto_tac (claset() addIs [inf_close_sym], |
|
1246 |
simpset() addsimps [mem_infmal_iff])); |
|
1247 |
qed "Infinitesimal_monad_zero_iff"; |
|
1248 |
||
1249 |
Goal "(x:monad #0) = (-x:monad #0)"; |
|
1250 |
by (simp_tac (simpset() addsimps [Infinitesimal_monad_zero_iff RS sym]) 1); |
|
1251 |
qed "monad_zero_minus_iff"; |
|
1252 |
||
1253 |
Goal "(x:monad #0) = (abs x:monad #0)"; |
|
1254 |
by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1); |
|
1255 |
by (auto_tac (claset(), simpset() addsimps [monad_zero_minus_iff RS sym])); |
|
1256 |
qed "monad_zero_hrabs_iff"; |
|
1257 |
||
1258 |
Goalw [monad_def] "x:monad x"; |
|
1259 |
by (Simp_tac 1); |
|
1260 |
qed "mem_monad_self"; |
|
1261 |
Addsimps [mem_monad_self]; |
|
1262 |
||
1263 |
(*------------------------------------------------------------------ |
|
1264 |
Proof that x @= y ==> abs x @= abs y |
|
1265 |
------------------------------------------------------------------*) |
|
1266 |
Goal "x @= y ==> {x,y}<=monad x"; |
|
1267 |
by (Simp_tac 1); |
|
1268 |
by (asm_full_simp_tac (simpset() addsimps |
|
1269 |
[inf_close_monad_iff]) 1); |
|
1270 |
qed "inf_close_subset_monad"; |
|
1271 |
||
1272 |
Goal "x @= y ==> {x,y}<=monad y"; |
|
1273 |
by (dtac inf_close_sym 1); |
|
1274 |
by (fast_tac (claset() addDs [inf_close_subset_monad]) 1); |
|
1275 |
qed "inf_close_subset_monad2"; |
|
1276 |
||
1277 |
Goalw [monad_def] "u:monad x ==> x @= u"; |
|
1278 |
by (Fast_tac 1); |
|
1279 |
qed "mem_monad_inf_close"; |
|
1280 |
||
1281 |
Goalw [monad_def] "x @= u ==> u:monad x"; |
|
1282 |
by (Fast_tac 1); |
|
1283 |
qed "inf_close_mem_monad"; |
|
1284 |
||
1285 |
Goalw [monad_def] "x @= u ==> x:monad u"; |
|
1286 |
by (blast_tac (claset() addSIs [inf_close_sym]) 1); |
|
1287 |
qed "inf_close_mem_monad2"; |
|
1288 |
||
1289 |
Goal "[| x @= y;x:monad #0 |] ==> y:monad #0"; |
|
1290 |
by (dtac mem_monad_inf_close 1); |
|
1291 |
by (fast_tac (claset() addIs [inf_close_mem_monad,inf_close_trans]) 1); |
|
1292 |
qed "inf_close_mem_monad_zero"; |
|
1293 |
||
1294 |
Goal "[| x @= y; x: Infinitesimal |] ==> abs x @= abs y"; |
|
1295 |
by (dtac (Infinitesimal_monad_zero_iff RS iffD1) 1); |
|
1296 |
by (blast_tac (claset() addIs [inf_close_mem_monad_zero, |
|
1297 |
monad_zero_hrabs_iff RS iffD1, mem_monad_inf_close, inf_close_trans3]) 1); |
|
1298 |
qed "Infinitesimal_inf_close_hrabs"; |
|
1299 |
||
1300 |
Goal "[| #0 < x; x ~:Infinitesimal; e :Infinitesimal |] ==> e < x"; |
|
1301 |
by (rtac ccontr 1); |
|
1302 |
by (auto_tac (claset() |
|
1303 |
addIs [Infinitesimal_zero RSN (2, Infinitesimal_interval)] |
|
1304 |
addSDs [hypreal_leI, order_le_imp_less_or_eq], |
|
1305 |
simpset())); |
|
1306 |
qed "less_Infinitesimal_less"; |
|
1307 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1308 |
Goal "[| #0 < x; x ~: Infinitesimal; u: monad x |] ==> #0 < u"; |
10751 | 1309 |
by (dtac (mem_monad_inf_close RS inf_close_sym) 1); |
1310 |
by (etac (bex_Infinitesimal_iff2 RS iffD2 RS bexE) 1); |
|
1311 |
by (dres_inst_tac [("e","-xa")] less_Infinitesimal_less 1); |
|
1312 |
by Auto_tac; |
|
1313 |
qed "Ball_mem_monad_gt_zero"; |
|
1314 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1315 |
Goal "[| x < #0; x ~: Infinitesimal; u: monad x |] ==> u < #0"; |
10751 | 1316 |
by (dtac (mem_monad_inf_close RS inf_close_sym) 1); |
1317 |
by (etac (bex_Infinitesimal_iff RS iffD2 RS bexE) 1); |
|
1318 |
by (cut_inst_tac [("x","-x"),("e","xa")] less_Infinitesimal_less 1); |
|
1319 |
by Auto_tac; |
|
1320 |
qed "Ball_mem_monad_less_zero"; |
|
1321 |
||
1322 |
Goal "[|#0 < x; x ~: Infinitesimal; x @= y|] ==> #0 < y"; |
|
1323 |
by (blast_tac (claset() addDs [Ball_mem_monad_gt_zero, |
|
1324 |
inf_close_subset_monad]) 1); |
|
1325 |
qed "lemma_inf_close_gt_zero"; |
|
1326 |
||
1327 |
Goal "[|x < #0; x ~: Infinitesimal; x @= y|] ==> y < #0"; |
|
1328 |
by (blast_tac (claset() addDs [Ball_mem_monad_less_zero, |
|
1329 |
inf_close_subset_monad]) 1); |
|
1330 |
qed "lemma_inf_close_less_zero"; |
|
1331 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1332 |
Goal "[| x @= y; x < #0; x ~: Infinitesimal |] ==> abs x @= abs y"; |
10751 | 1333 |
by (forward_tac [lemma_inf_close_less_zero] 1); |
1334 |
by (REPEAT(assume_tac 1)); |
|
1335 |
by (REPEAT(dtac hrabs_minus_eqI2 1)); |
|
1336 |
by Auto_tac; |
|
1337 |
qed "inf_close_hrabs1"; |
|
1338 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1339 |
Goal "[| x @= y; #0 < x; x ~: Infinitesimal |] ==> abs x @= abs y"; |
10751 | 1340 |
by (forward_tac [lemma_inf_close_gt_zero] 1); |
1341 |
by (REPEAT(assume_tac 1)); |
|
1342 |
by (REPEAT(dtac hrabs_eqI2 1)); |
|
1343 |
by Auto_tac; |
|
1344 |
qed "inf_close_hrabs2"; |
|
1345 |
||
1346 |
Goal "x @= y ==> abs x @= abs y"; |
|
1347 |
by (res_inst_tac [("Q","x:Infinitesimal")] (excluded_middle RS disjE) 1); |
|
1348 |
by (res_inst_tac [("x1","x"),("y1","#0")] (hypreal_linear RS disjE) 1); |
|
1349 |
by (auto_tac (claset() addIs [inf_close_hrabs1,inf_close_hrabs2, |
|
1350 |
Infinitesimal_inf_close_hrabs], simpset())); |
|
1351 |
qed "inf_close_hrabs"; |
|
1352 |
||
1353 |
Goal "abs(x) @= #0 ==> x @= #0"; |
|
1354 |
by (cut_inst_tac [("x","x")] hrabs_disj 1); |
|
1355 |
by (auto_tac (claset() addDs [inf_close_minus], simpset())); |
|
1356 |
qed "inf_close_hrabs_zero_cancel"; |
|
1357 |
||
1358 |
Goal "e: Infinitesimal ==> abs x @= abs(x+e)"; |
|
1359 |
by (fast_tac (claset() addIs [inf_close_hrabs, |
|
1360 |
Infinitesimal_add_inf_close_self]) 1); |
|
1361 |
qed "inf_close_hrabs_add_Infinitesimal"; |
|
1362 |
||
1363 |
Goal "e: Infinitesimal ==> abs x @= abs(x + -e)"; |
|
1364 |
by (fast_tac (claset() addIs [inf_close_hrabs, |
|
1365 |
Infinitesimal_add_minus_inf_close_self]) 1); |
|
1366 |
qed "inf_close_hrabs_add_minus_Infinitesimal"; |
|
1367 |
||
1368 |
Goal "[| e: Infinitesimal; e': Infinitesimal; \ |
|
1369 |
\ abs(x+e) = abs(y+e')|] ==> abs x @= abs y"; |
|
1370 |
by (dres_inst_tac [("x","x")] inf_close_hrabs_add_Infinitesimal 1); |
|
1371 |
by (dres_inst_tac [("x","y")] inf_close_hrabs_add_Infinitesimal 1); |
|
1372 |
by (auto_tac (claset() addIs [inf_close_trans2], simpset())); |
|
1373 |
qed "hrabs_add_Infinitesimal_cancel"; |
|
1374 |
||
1375 |
Goal "[| e: Infinitesimal; e': Infinitesimal; \ |
|
1376 |
\ abs(x + -e) = abs(y + -e')|] ==> abs x @= abs y"; |
|
1377 |
by (dres_inst_tac [("x","x")] inf_close_hrabs_add_minus_Infinitesimal 1); |
|
1378 |
by (dres_inst_tac [("x","y")] inf_close_hrabs_add_minus_Infinitesimal 1); |
|
1379 |
by (auto_tac (claset() addIs [inf_close_trans2], simpset())); |
|
1380 |
qed "hrabs_add_minus_Infinitesimal_cancel"; |
|
1381 |
||
1382 |
(* interesting slightly counterintuitive theorem: necessary |
|
1383 |
for proving that an open interval is an NS open set |
|
1384 |
*) |
|
1385 |
Goalw [Infinitesimal_def] |
|
1386 |
"[| x < y; u: Infinitesimal |] \ |
|
1387 |
\ ==> hypreal_of_real x + u < hypreal_of_real y"; |
|
1388 |
by (dtac (hypreal_of_real_less_iff RS iffD2) 1); |
|
1389 |
by (dtac (hypreal_less_minus_iff RS iffD1) 1 THEN Step_tac 1); |
|
1390 |
by (rtac (hypreal_less_minus_iff RS iffD2) 1); |
|
1391 |
by (dres_inst_tac [("x","hypreal_of_real y + -hypreal_of_real x")] bspec 1); |
|
1392 |
by (auto_tac (claset(), |
|
1393 |
simpset() addsimps [hypreal_add_commute, |
|
1394 |
hrabs_interval_iff, |
|
1395 |
SReal_add, SReal_minus])); |
|
1396 |
qed "Infinitesimal_add_hypreal_of_real_less"; |
|
1397 |
||
1398 |
Goal "[| x: Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] \ |
|
1399 |
\ ==> abs (hypreal_of_real r + x) < hypreal_of_real y"; |
|
1400 |
by (dres_inst_tac [("x","hypreal_of_real r")] |
|
1401 |
inf_close_hrabs_add_Infinitesimal 1); |
|
1402 |
by (dtac (inf_close_sym RS (bex_Infinitesimal_iff2 RS iffD2)) 1); |
|
1403 |
by (auto_tac (claset() addSIs [Infinitesimal_add_hypreal_of_real_less], |
|
1404 |
simpset() addsimps [hypreal_of_real_hrabs])); |
|
1405 |
qed "Infinitesimal_add_hrabs_hypreal_of_real_less"; |
|
1406 |
||
1407 |
Goal "[| x: Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] \ |
|
1408 |
\ ==> abs (x + hypreal_of_real r) < hypreal_of_real y"; |
|
1409 |
by (rtac (hypreal_add_commute RS subst) 1); |
|
1410 |
by (etac Infinitesimal_add_hrabs_hypreal_of_real_less 1); |
|
1411 |
by (assume_tac 1); |
|
1412 |
qed "Infinitesimal_add_hrabs_hypreal_of_real_less2"; |
|
1413 |
||
1414 |
Goalw [hypreal_le_def] |
|
1415 |
"[| u: Infinitesimal; hypreal_of_real x + u <= hypreal_of_real y |] \ |
|
1416 |
\ ==> hypreal_of_real x <= hypreal_of_real y"; |
|
1417 |
by (EVERY1 [rtac notI, rtac contrapos_np, assume_tac]); |
|
1418 |
by (res_inst_tac [("C","-u")] hypreal_less_add_right_cancel 1); |
|
1419 |
by (Asm_full_simp_tac 1); |
|
1420 |
by (dtac (Infinitesimal_minus_iff RS iffD2) 1); |
|
1421 |
by (dtac Infinitesimal_add_hypreal_of_real_less 1); |
|
1422 |
by (assume_tac 1); |
|
1423 |
by Auto_tac; |
|
1424 |
qed "Infinitesimal_add_cancel_hypreal_of_real_le"; |
|
1425 |
||
1426 |
Goal "[| u: Infinitesimal; hypreal_of_real x + u <= hypreal_of_real y |] \ |
|
1427 |
\ ==> x <= y"; |
|
1428 |
by (blast_tac (claset() addSIs [hypreal_of_real_le_iff RS iffD1, |
|
1429 |
Infinitesimal_add_cancel_hypreal_of_real_le]) 1); |
|
1430 |
qed "Infinitesimal_add_cancel_real_le"; |
|
1431 |
||
1432 |
Goal "[| u: Infinitesimal; v: Infinitesimal; \ |
|
1433 |
\ hypreal_of_real x + u <= hypreal_of_real y + v |] \ |
|
1434 |
\ ==> hypreal_of_real x <= hypreal_of_real y"; |
|
1435 |
by (asm_full_simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); |
|
1436 |
by Auto_tac; |
|
1437 |
by (dres_inst_tac [("u","v-u")] Infinitesimal_add_hypreal_of_real_less 1); |
|
1438 |
by (auto_tac (claset(), simpset() addsimps [Infinitesimal_diff])); |
|
1439 |
qed "hypreal_of_real_le_add_Infininitesimal_cancel"; |
|
1440 |
||
1441 |
Goal "[| u: Infinitesimal; v: Infinitesimal; \ |
|
1442 |
\ hypreal_of_real x + u <= hypreal_of_real y + v |] \ |
|
1443 |
\ ==> x <= y"; |
|
1444 |
by (blast_tac (claset() addSIs [hypreal_of_real_le_iff RS iffD1, |
|
1445 |
hypreal_of_real_le_add_Infininitesimal_cancel]) 1); |
|
1446 |
qed "hypreal_of_real_le_add_Infininitesimal_cancel2"; |
|
1447 |
||
1448 |
Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= #0"; |
|
1449 |
by (rtac hypreal_leI 1 THEN Step_tac 1); |
|
1450 |
by (dtac Infinitesimal_interval 1); |
|
1451 |
by (dtac (SReal_hypreal_of_real RS SReal_Infinitesimal_zero) 4); |
|
1452 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero])); |
|
1453 |
qed "hypreal_of_real_less_Infinitesimal_le_zero"; |
|
1454 |
||
1455 |
(*used once, in NSDERIV_inverse*) |
|
1456 |
Goal "[| h: Infinitesimal; x ~= #0 |] ==> hypreal_of_real x + h ~= #0"; |
|
1457 |
by Auto_tac; |
|
1458 |
qed "Infinitesimal_add_not_zero"; |
|
1459 |
||
1460 |
Goal "x*x + y*y : Infinitesimal ==> x*x : Infinitesimal"; |
|
1461 |
by (rtac Infinitesimal_interval2 1); |
|
1462 |
by (rtac hypreal_le_square 3); |
|
1463 |
by (rtac hypreal_self_le_add_pos 3); |
|
1464 |
by Auto_tac; |
|
1465 |
qed "Infinitesimal_square_cancel"; |
|
1466 |
Addsimps [Infinitesimal_square_cancel]; |
|
1467 |
||
1468 |
Goal "x*x + y*y : HFinite ==> x*x : HFinite"; |
|
1469 |
by (rtac HFinite_bounded 1); |
|
1470 |
by (rtac hypreal_self_le_add_pos 2); |
|
1471 |
by (rtac (rename_numerals hypreal_le_square) 2); |
|
1472 |
by (assume_tac 1); |
|
1473 |
qed "HFinite_square_cancel"; |
|
1474 |
Addsimps [HFinite_square_cancel]; |
|
1475 |
||
1476 |
Goal "x*x + y*y : Infinitesimal ==> y*y : Infinitesimal"; |
|
1477 |
by (rtac Infinitesimal_square_cancel 1); |
|
1478 |
by (rtac (hypreal_add_commute RS subst) 1); |
|
1479 |
by (Simp_tac 1); |
|
1480 |
qed "Infinitesimal_square_cancel2"; |
|
1481 |
Addsimps [Infinitesimal_square_cancel2]; |
|
1482 |
||
1483 |
Goal "x*x + y*y : HFinite ==> y*y : HFinite"; |
|
1484 |
by (rtac HFinite_square_cancel 1); |
|
1485 |
by (rtac (hypreal_add_commute RS subst) 1); |
|
1486 |
by (Simp_tac 1); |
|
1487 |
qed "HFinite_square_cancel2"; |
|
1488 |
Addsimps [HFinite_square_cancel2]; |
|
1489 |
||
1490 |
Goal "x*x + y*y + z*z : Infinitesimal ==> x*x : Infinitesimal"; |
|
1491 |
by (blast_tac (claset() addIs [hypreal_self_le_add_pos2, |
|
1492 |
Infinitesimal_interval2, rename_numerals hypreal_le_square]) 1); |
|
1493 |
qed "Infinitesimal_sum_square_cancel"; |
|
1494 |
Addsimps [Infinitesimal_sum_square_cancel]; |
|
1495 |
||
1496 |
Goal "x*x + y*y + z*z : HFinite ==> x*x : HFinite"; |
|
1497 |
by (blast_tac (claset() addIs [hypreal_self_le_add_pos2, HFinite_bounded, |
|
1498 |
rename_numerals hypreal_le_square, |
|
1499 |
HFinite_number_of]) 1); |
|
1500 |
qed "HFinite_sum_square_cancel"; |
|
1501 |
Addsimps [HFinite_sum_square_cancel]; |
|
1502 |
||
1503 |
Goal "y*y + x*x + z*z : Infinitesimal ==> x*x : Infinitesimal"; |
|
1504 |
by (rtac Infinitesimal_sum_square_cancel 1); |
|
1505 |
by (asm_full_simp_tac (simpset() addsimps hypreal_add_ac) 1); |
|
1506 |
qed "Infinitesimal_sum_square_cancel2"; |
|
1507 |
Addsimps [Infinitesimal_sum_square_cancel2]; |
|
1508 |
||
1509 |
Goal "y*y + x*x + z*z : HFinite ==> x*x : HFinite"; |
|
1510 |
by (rtac HFinite_sum_square_cancel 1); |
|
1511 |
by (asm_full_simp_tac (simpset() addsimps hypreal_add_ac) 1); |
|
1512 |
qed "HFinite_sum_square_cancel2"; |
|
1513 |
Addsimps [HFinite_sum_square_cancel2]; |
|
1514 |
||
1515 |
Goal "z*z + y*y + x*x : Infinitesimal ==> x*x : Infinitesimal"; |
|
1516 |
by (rtac Infinitesimal_sum_square_cancel 1); |
|
1517 |
by (asm_full_simp_tac (simpset() addsimps hypreal_add_ac) 1); |
|
1518 |
qed "Infinitesimal_sum_square_cancel3"; |
|
1519 |
Addsimps [Infinitesimal_sum_square_cancel3]; |
|
1520 |
||
1521 |
Goal "z*z + y*y + x*x : HFinite ==> x*x : HFinite"; |
|
1522 |
by (rtac HFinite_sum_square_cancel 1); |
|
1523 |
by (asm_full_simp_tac (simpset() addsimps hypreal_add_ac) 1); |
|
1524 |
qed "HFinite_sum_square_cancel3"; |
|
1525 |
Addsimps [HFinite_sum_square_cancel3]; |
|
1526 |
||
1527 |
Goal "[| y: monad x; #0 < hypreal_of_real e |] \ |
|
1528 |
\ ==> abs (y + -x) < hypreal_of_real e"; |
|
1529 |
by (dtac (mem_monad_inf_close RS inf_close_sym) 1); |
|
1530 |
by (dtac (bex_Infinitesimal_iff RS iffD2) 1); |
|
1531 |
by (auto_tac (claset() addSDs [InfinitesimalD], simpset())); |
|
1532 |
qed "monad_hrabs_less"; |
|
1533 |
||
1534 |
Goal "x: monad (hypreal_of_real a) ==> x: HFinite"; |
|
1535 |
by (dtac (mem_monad_inf_close RS inf_close_sym) 1); |
|
1536 |
by (dtac (bex_Infinitesimal_iff2 RS iffD2) 1); |
|
1537 |
by (step_tac (claset() addSDs |
|
1538 |
[Infinitesimal_subset_HFinite RS subsetD]) 1); |
|
1539 |
by (etac (SReal_hypreal_of_real RS (SReal_subset_HFinite |
|
1540 |
RS subsetD) RS HFinite_add) 1); |
|
1541 |
qed "mem_monad_SReal_HFinite"; |
|
1542 |
||
1543 |
(*------------------------------------------------------------------ |
|
1544 |
Theorems about standard part |
|
1545 |
------------------------------------------------------------------*) |
|
1546 |
||
1547 |
Goalw [st_def] "x: HFinite ==> st x @= x"; |
|
1548 |
by (forward_tac [st_part_Ex] 1 THEN Step_tac 1); |
|
1549 |
by (rtac someI2 1); |
|
1550 |
by (auto_tac (claset() addIs [inf_close_sym], simpset())); |
|
1551 |
qed "st_inf_close_self"; |
|
1552 |
||
1553 |
Goalw [st_def] "x: HFinite ==> st x: SReal"; |
|
1554 |
by (forward_tac [st_part_Ex] 1 THEN Step_tac 1); |
|
1555 |
by (rtac someI2 1); |
|
1556 |
by (auto_tac (claset() addIs [inf_close_sym], simpset())); |
|
1557 |
qed "st_SReal"; |
|
1558 |
||
1559 |
Goal "x: HFinite ==> st x: HFinite"; |
|
1560 |
by (etac (st_SReal RS (SReal_subset_HFinite RS subsetD)) 1); |
|
1561 |
qed "st_HFinite"; |
|
1562 |
||
1563 |
Goalw [st_def] "x: SReal ==> st x = x"; |
|
1564 |
by (rtac some_equality 1); |
|
1565 |
by (fast_tac (claset() addIs [(SReal_subset_HFinite RS subsetD)]) 1); |
|
1566 |
by (blast_tac (claset() addDs [SReal_inf_close_iff RS iffD1]) 1); |
|
1567 |
qed "st_SReal_eq"; |
|
1568 |
||
1569 |
(* should be added to simpset *) |
|
1570 |
Goal "st (hypreal_of_real x) = hypreal_of_real x"; |
|
1571 |
by (rtac (SReal_hypreal_of_real RS st_SReal_eq) 1); |
|
1572 |
qed "st_hypreal_of_real"; |
|
1573 |
||
1574 |
Goal "[| x: HFinite; y: HFinite; st x = st y |] ==> x @= y"; |
|
1575 |
by (auto_tac (claset() addSDs [st_inf_close_self] |
|
1576 |
addSEs [inf_close_trans3], simpset())); |
|
1577 |
qed "st_eq_inf_close"; |
|
1578 |
||
1579 |
Goal "[| x: HFinite; y: HFinite; x @= y |] ==> st x = st y"; |
|
1580 |
by (EVERY1 [forward_tac [st_inf_close_self], |
|
1581 |
forw_inst_tac [("x","y")] st_inf_close_self, |
|
1582 |
dtac st_SReal,dtac st_SReal]); |
|
1583 |
by (fast_tac (claset() addEs [inf_close_trans, |
|
1584 |
inf_close_trans2,SReal_inf_close_iff RS iffD1]) 1); |
|
1585 |
qed "inf_close_st_eq"; |
|
1586 |
||
1587 |
Goal "[| x: HFinite; y: HFinite|] \ |
|
1588 |
\ ==> (x @= y) = (st x = st y)"; |
|
1589 |
by (blast_tac (claset() addIs [inf_close_st_eq, |
|
1590 |
st_eq_inf_close]) 1); |
|
1591 |
qed "st_eq_inf_close_iff"; |
|
1592 |
||
1593 |
Goal "[| x: SReal; e: Infinitesimal |] ==> st(x + e) = x"; |
|
1594 |
by (forward_tac [st_SReal_eq RS subst] 1); |
|
1595 |
by (assume_tac 2); |
|
1596 |
by (forward_tac [SReal_subset_HFinite RS subsetD] 1); |
|
1597 |
by (forward_tac [Infinitesimal_subset_HFinite RS subsetD] 1); |
|
1598 |
by (dtac st_SReal_eq 1); |
|
1599 |
by (rtac inf_close_st_eq 1); |
|
1600 |
by (auto_tac (claset() addIs [HFinite_add], |
|
1601 |
simpset() addsimps [Infinitesimal_add_inf_close_self |
|
1602 |
RS inf_close_sym])); |
|
1603 |
qed "st_Infinitesimal_add_SReal"; |
|
1604 |
||
1605 |
Goal "[| x: SReal; e: Infinitesimal |] \ |
|
1606 |
\ ==> st(e + x) = x"; |
|
1607 |
by (rtac (hypreal_add_commute RS subst) 1); |
|
1608 |
by (blast_tac (claset() addSIs [st_Infinitesimal_add_SReal]) 1); |
|
1609 |
qed "st_Infinitesimal_add_SReal2"; |
|
1610 |
||
1611 |
Goal "x: HFinite ==> \ |
|
1612 |
\ EX e: Infinitesimal. x = st(x) + e"; |
|
1613 |
by (blast_tac (claset() addSDs [(st_inf_close_self RS |
|
1614 |
inf_close_sym),bex_Infinitesimal_iff2 RS iffD2]) 1); |
|
1615 |
qed "HFinite_st_Infinitesimal_add"; |
|
1616 |
||
1617 |
Goal "[| x: HFinite; y: HFinite |] \ |
|
1618 |
\ ==> st (x + y) = st(x) + st(y)"; |
|
1619 |
by (forward_tac [HFinite_st_Infinitesimal_add] 1); |
|
1620 |
by (forw_inst_tac [("x","y")] HFinite_st_Infinitesimal_add 1); |
|
1621 |
by (Step_tac 1); |
|
1622 |
by (subgoal_tac "st (x + y) = st ((st x + e) + (st y + ea))" 1); |
|
1623 |
by (dtac sym 2 THEN dtac sym 2); |
|
1624 |
by (Asm_full_simp_tac 2); |
|
1625 |
by (asm_simp_tac (simpset() addsimps hypreal_add_ac) 1); |
|
1626 |
by (REPEAT(dtac st_SReal 1)); |
|
1627 |
by (dtac SReal_add 1 THEN assume_tac 1); |
|
1628 |
by (dtac Infinitesimal_add 1 THEN assume_tac 1); |
|
1629 |
by (rtac (hypreal_add_assoc RS subst) 1); |
|
1630 |
by (blast_tac (claset() addSIs [st_Infinitesimal_add_SReal2]) 1); |
|
1631 |
qed "st_add"; |
|
1632 |
||
1633 |
Goal "st (number_of w) = number_of w"; |
|
1634 |
by (rtac (SReal_number_of RS st_SReal_eq) 1); |
|
1635 |
qed "st_number_of"; |
|
1636 |
Addsimps [st_number_of]; |
|
1637 |
||
1638 |
Goal "y: HFinite ==> st(-y) = -st(y)"; |
|
1639 |
by (forward_tac [HFinite_minus_iff RS iffD2] 1); |
|
1640 |
by (rtac hypreal_add_minus_eq_minus 1); |
|
1641 |
by (dtac (st_add RS sym) 1 THEN assume_tac 1); |
|
1642 |
by Auto_tac; |
|
1643 |
qed "st_minus"; |
|
1644 |
||
1645 |
Goalw [hypreal_diff_def] |
|
1646 |
"[| x: HFinite; y: HFinite |] ==> st (x-y) = st(x) - st(y)"; |
|
1647 |
by (forw_inst_tac [("y1","y")] (st_minus RS sym) 1); |
|
1648 |
by (dres_inst_tac [("x1","y")] (HFinite_minus_iff RS iffD2) 1); |
|
1649 |
by (asm_simp_tac (simpset() addsimps [st_add]) 1); |
|
1650 |
qed "st_diff"; |
|
1651 |
||
1652 |
(* lemma *) |
|
1653 |
Goal "[| x: HFinite; y: HFinite; \ |
|
1654 |
\ e: Infinitesimal; \ |
|
1655 |
\ ea : Infinitesimal |] \ |
|
1656 |
\ ==> e*y + x*ea + e*ea: Infinitesimal"; |
|
1657 |
by (forw_inst_tac [("x","e"),("y","y")] Infinitesimal_HFinite_mult 1); |
|
1658 |
by (forw_inst_tac [("x","ea"),("y","x")] Infinitesimal_HFinite_mult 2); |
|
1659 |
by (dtac Infinitesimal_mult 3); |
|
1660 |
by (auto_tac (claset() addIs [Infinitesimal_add], |
|
1661 |
simpset() addsimps hypreal_add_ac @ hypreal_mult_ac)); |
|
1662 |
qed "lemma_st_mult"; |
|
1663 |
||
1664 |
Goal "[| x: HFinite; y: HFinite |] \ |
|
1665 |
\ ==> st (x * y) = st(x) * st(y)"; |
|
1666 |
by (forward_tac [HFinite_st_Infinitesimal_add] 1); |
|
1667 |
by (forw_inst_tac [("x","y")] HFinite_st_Infinitesimal_add 1); |
|
1668 |
by (Step_tac 1); |
|
1669 |
by (subgoal_tac "st (x * y) = st ((st x + e) * (st y + ea))" 1); |
|
1670 |
by (dtac sym 2 THEN dtac sym 2); |
|
1671 |
by (Asm_full_simp_tac 2); |
|
1672 |
by (thin_tac "x = st x + e" 1); |
|
1673 |
by (thin_tac "y = st y + ea" 1); |
|
1674 |
by (asm_full_simp_tac (simpset() addsimps |
|
1675 |
[hypreal_add_mult_distrib,hypreal_add_mult_distrib2]) 1); |
|
1676 |
by (REPEAT(dtac st_SReal 1)); |
|
1677 |
by (full_simp_tac (simpset() addsimps [hypreal_add_assoc]) 1); |
|
1678 |
by (rtac st_Infinitesimal_add_SReal 1); |
|
1679 |
by (blast_tac (claset() addSIs [SReal_mult]) 1); |
|
1680 |
by (REPEAT(dtac (SReal_subset_HFinite RS subsetD) 1)); |
|
1681 |
by (rtac (hypreal_add_assoc RS subst) 1); |
|
1682 |
by (blast_tac (claset() addSIs [lemma_st_mult]) 1); |
|
1683 |
qed "st_mult"; |
|
1684 |
||
1685 |
Goal "x: Infinitesimal ==> st x = #0"; |
|
1686 |
by (rtac (st_number_of RS subst) 1); |
|
1687 |
by (rtac inf_close_st_eq 1); |
|
1688 |
by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD], |
|
1689 |
simpset() addsimps [mem_infmal_iff RS sym])); |
|
1690 |
qed "st_Infinitesimal"; |
|
1691 |
||
1692 |
Goal "st(x) ~= #0 ==> x ~: Infinitesimal"; |
|
1693 |
by (fast_tac (claset() addIs [st_Infinitesimal]) 1); |
|
1694 |
qed "st_not_Infinitesimal"; |
|
1695 |
||
1696 |
Goal "[| x: HFinite; st x ~= #0 |] \ |
|
1697 |
\ ==> st(inverse x) = inverse (st x)"; |
|
1698 |
by (res_inst_tac [("c1","st x")] (hypreal_mult_left_cancel RS iffD1) 1); |
|
1699 |
by (auto_tac (claset(), |
|
1700 |
simpset() addsimps [st_mult RS sym, st_not_Infinitesimal, |
|
1701 |
HFinite_inverse])); |
|
1702 |
by (stac hypreal_mult_inverse 1); |
|
1703 |
by Auto_tac; |
|
1704 |
qed "st_inverse"; |
|
1705 |
||
1706 |
Goal "[| x: HFinite; y: HFinite; st y ~= #0 |] \ |
|
1707 |
\ ==> st(x/y) = (st x) / (st y)"; |
|
1708 |
by (auto_tac (claset(), |
|
1709 |
simpset() addsimps [hypreal_divide_def, st_mult, st_not_Infinitesimal, |
|
1710 |
HFinite_inverse, st_inverse])); |
|
1711 |
qed "st_divide"; |
|
1712 |
Addsimps [st_divide]; |
|
1713 |
||
1714 |
Goal "x: HFinite ==> st(st(x)) = st(x)"; |
|
1715 |
by (blast_tac (claset() addIs [st_HFinite, st_inf_close_self, |
|
1716 |
inf_close_st_eq]) 1); |
|
1717 |
qed "st_idempotent"; |
|
1718 |
Addsimps [st_idempotent]; |
|
1719 |
||
1720 |
(*** lemmas ***) |
|
1721 |
Goal "[| x: HFinite; y: HFinite; \ |
|
1722 |
\ u: Infinitesimal; st x < st y \ |
|
1723 |
\ |] ==> st x + u < st y"; |
|
1724 |
by (REPEAT(dtac st_SReal 1)); |
|
1725 |
by (auto_tac (claset() addSIs [Infinitesimal_add_hypreal_of_real_less], |
|
1726 |
simpset() addsimps [SReal_iff])); |
|
1727 |
qed "Infinitesimal_add_st_less"; |
|
1728 |
||
1729 |
Goalw [hypreal_le_def] |
|
1730 |
"[| x: HFinite; y: HFinite; \ |
|
1731 |
\ u: Infinitesimal; st x <= st y + u\ |
|
1732 |
\ |] ==> st x <= st y"; |
|
1733 |
by (auto_tac (claset() addDs [Infinitesimal_add_st_less], |
|
1734 |
simpset())); |
|
1735 |
qed "Infinitesimal_add_st_le_cancel"; |
|
1736 |
||
1737 |
Goal "[| x: HFinite; y: HFinite; x <= y |] \ |
|
1738 |
\ ==> st(x) <= st(y)"; |
|
1739 |
by (forward_tac [HFinite_st_Infinitesimal_add] 1); |
|
1740 |
by (rotate_tac 1 1); |
|
1741 |
by (forward_tac [HFinite_st_Infinitesimal_add] 1); |
|
1742 |
by (Step_tac 1); |
|
1743 |
by (rtac Infinitesimal_add_st_le_cancel 1); |
|
1744 |
by (res_inst_tac [("x","ea"),("y","e")] |
|
1745 |
Infinitesimal_diff 3); |
|
1746 |
by (auto_tac (claset(), |
|
1747 |
simpset() addsimps [hypreal_add_assoc RS sym])); |
|
1748 |
qed "st_le"; |
|
1749 |
||
1750 |
Goal "[| #0 <= x; x: HFinite |] ==> #0 <= st x"; |
|
1751 |
by (rtac (st_number_of RS subst) 1); |
|
1752 |
by (auto_tac (claset() addIs [st_le], |
|
1753 |
simpset() delsimps [st_number_of])); |
|
1754 |
qed "st_zero_le"; |
|
1755 |
||
1756 |
Goal "[| x <= #0; x: HFinite |] ==> st x <= #0"; |
|
1757 |
by (rtac (st_number_of RS subst) 1); |
|
1758 |
by (auto_tac (claset() addIs [st_le], |
|
1759 |
simpset() delsimps [st_number_of])); |
|
1760 |
qed "st_zero_ge"; |
|
1761 |
||
1762 |
Goal "x: HFinite ==> abs(st x) = st(abs x)"; |
|
1763 |
by (case_tac "#0 <= x" 1); |
|
1764 |
by (auto_tac (claset() addSDs [not_hypreal_leE, order_less_imp_le], |
|
1765 |
simpset() addsimps [st_zero_le,hrabs_eqI1, hrabs_minus_eqI1, |
|
1766 |
st_zero_ge,st_minus])); |
|
1767 |
qed "st_hrabs"; |
|
1768 |
||
1769 |
(*-------------------------------------------------------------------- |
|
1770 |
Alternative definitions for HFinite using Free ultrafilter |
|
1771 |
--------------------------------------------------------------------*) |
|
1772 |
||
1773 |
Goal "[| X: Rep_hypreal x; Y: Rep_hypreal x |] \ |
|
1774 |
\ ==> {n. X n = Y n} : FreeUltrafilterNat"; |
|
1775 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1776 |
by Auto_tac; |
|
1777 |
by (Ultra_tac 1); |
|
1778 |
qed "FreeUltrafilterNat_Rep_hypreal"; |
|
1779 |
||
1780 |
Goal "{n. Yb n < Y n} Int {n. -y = Yb n} <= {n. -y < Y n}"; |
|
1781 |
by Auto_tac; |
|
1782 |
qed "lemma_free1"; |
|
1783 |
||
1784 |
Goal "{n. Xa n < Yc n} Int {n. y = Yc n} <= {n. Xa n < y}"; |
|
1785 |
by Auto_tac; |
|
1786 |
qed "lemma_free2"; |
|
1787 |
||
1788 |
Goalw [HFinite_def] |
|
1789 |
"x : HFinite ==> EX X: Rep_hypreal x. \ |
|
1790 |
\ EX u. {n. abs (X n) < u}: FreeUltrafilterNat"; |
|
1791 |
by (auto_tac (claset(), simpset() addsimps |
|
1792 |
[hrabs_interval_iff])); |
|
1793 |
by (auto_tac (claset(), simpset() addsimps |
|
1794 |
[hypreal_less_def,SReal_iff,hypreal_minus, |
|
1795 |
hypreal_of_real_def])); |
|
1796 |
by (dtac FreeUltrafilterNat_Rep_hypreal 1 THEN assume_tac 1); |
|
1797 |
by (res_inst_tac [("x","Y")] bexI 1 THEN assume_tac 2); |
|
1798 |
by (res_inst_tac [("x","y")] exI 1); |
|
1799 |
by (Ultra_tac 1 THEN arith_tac 1); |
|
1800 |
qed "HFinite_FreeUltrafilterNat"; |
|
1801 |
||
1802 |
Goalw [HFinite_def] |
|
1803 |
"EX X: Rep_hypreal x. \ |
|
1804 |
\ EX u. {n. abs (X n) < u}: FreeUltrafilterNat\ |
|
1805 |
\ ==> x : HFinite"; |
|
1806 |
by (auto_tac (claset(), simpset() addsimps |
|
1807 |
[hrabs_interval_iff])); |
|
1808 |
by (res_inst_tac [("x","hypreal_of_real u")] bexI 1); |
|
1809 |
by (auto_tac (claset() addSIs [exI], simpset() addsimps |
|
1810 |
[hypreal_less_def,SReal_iff,hypreal_minus, |
|
1811 |
hypreal_of_real_def])); |
|
1812 |
by (ALLGOALS(Ultra_tac THEN' arith_tac)); |
|
1813 |
qed "FreeUltrafilterNat_HFinite"; |
|
1814 |
||
1815 |
Goal "(x : HFinite) = (EX X: Rep_hypreal x. \ |
|
1816 |
\ EX u. {n. abs (X n) < u}: FreeUltrafilterNat)"; |
|
1817 |
by (blast_tac (claset() addSIs [HFinite_FreeUltrafilterNat, |
|
1818 |
FreeUltrafilterNat_HFinite]) 1); |
|
1819 |
qed "HFinite_FreeUltrafilterNat_iff"; |
|
1820 |
||
1821 |
(*-------------------------------------------------------------------- |
|
1822 |
Alternative definitions for HInfinite using Free ultrafilter |
|
1823 |
--------------------------------------------------------------------*) |
|
1824 |
Goal "- {n. (u::real) < abs (xa n)} = {n. abs (xa n) <= u}"; |
|
1825 |
by Auto_tac; |
|
1826 |
qed "lemma_Compl_eq"; |
|
1827 |
||
1828 |
Goal "- {n. abs (xa n) < (u::real)} = {n. u <= abs (xa n)}"; |
|
1829 |
by Auto_tac; |
|
1830 |
qed "lemma_Compl_eq2"; |
|
1831 |
||
1832 |
Goal "{n. abs (xa n) <= (u::real)} Int {n. u <= abs (xa n)} \ |
|
1833 |
\ = {n. abs(xa n) = u}"; |
|
1834 |
by Auto_tac; |
|
1835 |
qed "lemma_Int_eq1"; |
|
1836 |
||
1837 |
Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (#1::real)}"; |
|
1838 |
by Auto_tac; |
|
1839 |
qed "lemma_FreeUltrafilterNat_one"; |
|
1840 |
||
1841 |
(*------------------------------------- |
|
1842 |
Exclude this type of sets from free |
|
1843 |
ultrafilter for Infinite numbers! |
|
1844 |
-------------------------------------*) |
|
1845 |
Goal "[| xa: Rep_hypreal x; \ |
|
1846 |
\ {n. abs (xa n) = u} : FreeUltrafilterNat \ |
|
1847 |
\ |] ==> x: HFinite"; |
|
1848 |
by (rtac FreeUltrafilterNat_HFinite 1); |
|
1849 |
by (res_inst_tac [("x","xa")] bexI 1); |
|
1850 |
by (res_inst_tac [("x","u + #1")] exI 1); |
|
1851 |
by (Ultra_tac 1 THEN assume_tac 1); |
|
1852 |
qed "FreeUltrafilterNat_const_Finite"; |
|
1853 |
||
1854 |
val [prem] = goal thy "x : HInfinite ==> EX X: Rep_hypreal x. \ |
|
1855 |
\ ALL u. {n. u < abs (X n)}: FreeUltrafilterNat"; |
|
1856 |
by (cut_facts_tac [(prem RS (HInfinite_HFinite_iff RS iffD1))] 1); |
|
1857 |
by (cut_inst_tac [("x","x")] Rep_hypreal_nonempty 1); |
|
1858 |
by (auto_tac (claset(), simpset() delsimps [Rep_hypreal_nonempty] |
|
1859 |
addsimps [HFinite_FreeUltrafilterNat_iff,Bex_def])); |
|
1860 |
by (REPEAT(dtac spec 1)); |
|
1861 |
by Auto_tac; |
|
1862 |
by (dres_inst_tac [("x","u")] spec 1 THEN |
|
1863 |
REPEAT(dtac FreeUltrafilterNat_Compl_mem 1)); |
|
1864 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
1865 |
||
1866 |
||
1867 |
by (asm_full_simp_tac (simpset() addsimps [lemma_Compl_eq, |
|
1868 |
lemma_Compl_eq2,lemma_Int_eq1]) 1); |
|
1869 |
by (auto_tac (claset() addDs [FreeUltrafilterNat_const_Finite], |
|
1870 |
simpset() addsimps [(prem RS (HInfinite_HFinite_iff RS iffD1))])); |
|
1871 |
qed "HInfinite_FreeUltrafilterNat"; |
|
1872 |
||
1873 |
(* yet more lemmas! *) |
|
1874 |
Goal "{n. abs (Xa n) < u} Int {n. X n = Xa n} \ |
|
1875 |
\ <= {n. abs (X n) < (u::real)}"; |
|
1876 |
by Auto_tac; |
|
1877 |
qed "lemma_Int_HI"; |
|
1878 |
||
1879 |
Goal "{n. u < abs (X n)} Int {n. abs (X n) < (u::real)} = {}"; |
|
1880 |
by (auto_tac (claset() addIs [real_less_asym], simpset())); |
|
1881 |
qed "lemma_Int_HIa"; |
|
1882 |
||
1883 |
Goal "EX X: Rep_hypreal x. ALL u. \ |
|
1884 |
\ {n. u < abs (X n)}: FreeUltrafilterNat\ |
|
1885 |
\ ==> x : HInfinite"; |
|
1886 |
by (rtac (HInfinite_HFinite_iff RS iffD2) 1); |
|
1887 |
by (Step_tac 1 THEN dtac HFinite_FreeUltrafilterNat 1); |
|
1888 |
by Auto_tac; |
|
1889 |
by (dres_inst_tac [("x","u")] spec 1); |
|
1890 |
by (dtac FreeUltrafilterNat_Rep_hypreal 1 THEN assume_tac 1); |
|
1891 |
by (dres_inst_tac [("Y","{n. X n = Xa n}")] FreeUltrafilterNat_Int 1); |
|
1892 |
by (dtac (lemma_Int_HI RSN (2,FreeUltrafilterNat_subset)) 2); |
|
1893 |
by (dres_inst_tac [("Y","{n. abs (X n) < u}")] FreeUltrafilterNat_Int 2); |
|
1894 |
by (auto_tac (claset(), simpset() addsimps [lemma_Int_HIa, |
|
1895 |
FreeUltrafilterNat_empty])); |
|
1896 |
qed "FreeUltrafilterNat_HInfinite"; |
|
1897 |
||
1898 |
Goal "(x : HInfinite) = (EX X: Rep_hypreal x. \ |
|
1899 |
\ ALL u. {n. u < abs (X n)}: FreeUltrafilterNat)"; |
|
1900 |
by (blast_tac (claset() addSIs [HInfinite_FreeUltrafilterNat, |
|
1901 |
FreeUltrafilterNat_HInfinite]) 1); |
|
1902 |
qed "HInfinite_FreeUltrafilterNat_iff"; |
|
1903 |
||
1904 |
(*-------------------------------------------------------------------- |
|
1905 |
Alternative definitions for Infinitesimal using Free ultrafilter |
|
1906 |
--------------------------------------------------------------------*) |
|
1907 |
||
1908 |
Goal "{n. - u < Yd n} Int {n. xa n = Yd n} <= {n. -u < xa n}"; |
|
1909 |
by Auto_tac; |
|
1910 |
qed "lemma_free4"; |
|
1911 |
||
1912 |
Goal "{n. Yb n < u} Int {n. xa n = Yb n} <= {n. xa n < u}"; |
|
1913 |
by Auto_tac; |
|
1914 |
qed "lemma_free5"; |
|
1915 |
||
1916 |
Goalw [Infinitesimal_def] |
|
1917 |
"x : Infinitesimal ==> EX X: Rep_hypreal x. \ |
|
1918 |
\ ALL u. #0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat"; |
|
1919 |
by (auto_tac (claset(), simpset() addsimps [hrabs_interval_iff])); |
|
1920 |
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1); |
|
1921 |
by (EVERY[Auto_tac, rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]); |
|
1922 |
by (dtac (hypreal_of_real_less_iff RS iffD2) 1); |
|
1923 |
by (dres_inst_tac [("x","hypreal_of_real u")] bspec 1); |
|
1924 |
by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero])); |
|
1925 |
by (auto_tac (claset(), |
|
1926 |
simpset() addsimps [hypreal_less_def, hypreal_minus, |
|
1927 |
hypreal_of_real_def,hypreal_of_real_zero])); |
|
1928 |
by (Ultra_tac 1 THEN arith_tac 1); |
|
1929 |
qed "Infinitesimal_FreeUltrafilterNat"; |
|
1930 |
||
1931 |
Goalw [Infinitesimal_def] |
|
1932 |
"EX X: Rep_hypreal x. \ |
|
1933 |
\ ALL u. #0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \ |
|
1934 |
\ ==> x : Infinitesimal"; |
|
1935 |
by (auto_tac (claset(), |
|
1936 |
simpset() addsimps [hrabs_interval_iff,abs_interval_iff])); |
|
1937 |
by (auto_tac (claset(), |
|
1938 |
simpset() addsimps [SReal_iff])); |
|
1939 |
by (auto_tac (claset() addSIs [exI] |
|
1940 |
addIs [FreeUltrafilterNat_subset], |
|
1941 |
simpset() addsimps [hypreal_less_def, hypreal_minus,hypreal_of_real_def])); |
|
1942 |
qed "FreeUltrafilterNat_Infinitesimal"; |
|
1943 |
||
1944 |
Goal "(x : Infinitesimal) = (EX X: Rep_hypreal x. \ |
|
1945 |
\ ALL u. #0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat)"; |
|
1946 |
by (blast_tac (claset() addSIs [Infinitesimal_FreeUltrafilterNat, |
|
1947 |
FreeUltrafilterNat_Infinitesimal]) 1); |
|
1948 |
qed "Infinitesimal_FreeUltrafilterNat_iff"; |
|
1949 |
||
1950 |
(*------------------------------------------------------------------------ |
|
1951 |
Infinitesimals as smaller than 1/n for all n::nat (> 0) |
|
1952 |
------------------------------------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1953 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1954 |
Goal "(ALL r. #0 < r --> x < r) = (ALL n. x < inverse(real_of_nat (Suc n)))"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1955 |
by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc_gt_zero])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1956 |
by (blast_tac (claset() addSDs [reals_Archimedean] |
10751 | 1957 |
addIs [order_less_trans]) 1); |
1958 |
qed "lemma_Infinitesimal"; |
|
1959 |
||
1960 |
Goal "(ALL r: SReal. #0 < r --> x < r) = \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1961 |
\ (ALL n. x < inverse(hypreal_of_nat (Suc n)))"; |
10751 | 1962 |
by (Step_tac 1); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1963 |
by (dres_inst_tac [("x","inverse (hypreal_of_real(real_of_nat (Suc n)))")] |
10751 | 1964 |
bspec 1); |
1965 |
by (full_simp_tac (simpset() addsimps [SReal_inverse]) 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1966 |
by (rtac (real_of_nat_Suc_gt_zero RS rename_numerals real_inverse_gt_zero RS |
10751 | 1967 |
(hypreal_of_real_less_iff RS iffD2) RSN(2,impE)) 1); |
1968 |
by (assume_tac 2); |
|
1969 |
by (asm_full_simp_tac (simpset() addsimps |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1970 |
[real_of_nat_Suc_gt_zero, hypreal_of_real_zero, hypreal_of_nat_def]) 1); |
10751 | 1971 |
by (auto_tac (claset() addSDs [reals_Archimedean], |
1972 |
simpset() addsimps [SReal_iff,hypreal_of_real_zero RS sym])); |
|
1973 |
by (dtac (hypreal_of_real_less_iff RS iffD2) 1); |
|
1974 |
by (asm_full_simp_tac (simpset() addsimps |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1975 |
[real_of_nat_Suc_gt_zero, hypreal_of_nat_def])1); |
10751 | 1976 |
by (blast_tac (claset() addIs [order_less_trans]) 1); |
1977 |
qed "lemma_Infinitesimal2"; |
|
1978 |
||
1979 |
Goalw [Infinitesimal_def] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1980 |
"Infinitesimal = {x. ALL n. abs x < inverse (hypreal_of_nat (Suc n))}"; |
10751 | 1981 |
by (auto_tac (claset(), simpset() addsimps [lemma_Infinitesimal2])); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1982 |
qed "Infinitesimal_hypreal_of_nat_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1983 |
|
10751 | 1984 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1985 |
(*--------------------------------------------------------------------------- |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1986 |
Proof that omega (whr) is an infinite number and |
10751 | 1987 |
hence that epsilon (ehr) is an infinitesimal number. |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1988 |
---------------------------------------------------------------------------*) |
10751 | 1989 |
Goal "{n. n < Suc m} = {n. n < m} Un {n. n = m}"; |
1990 |
by (auto_tac (claset(), simpset() addsimps [less_Suc_eq])); |
|
1991 |
qed "Suc_Un_eq"; |
|
1992 |
||
1993 |
(*------------------------------------------- |
|
1994 |
Prove that any segment is finite and |
|
1995 |
hence cannot belong to FreeUltrafilterNat |
|
1996 |
-------------------------------------------*) |
|
1997 |
Goal "finite {n::nat. n < m}"; |
|
1998 |
by (nat_ind_tac "m" 1); |
|
1999 |
by (auto_tac (claset(), simpset() addsimps [Suc_Un_eq])); |
|
2000 |
qed "finite_nat_segment"; |
|
2001 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2002 |
Goal "finite {n::nat. real_of_nat n < real_of_nat m}"; |
10751 | 2003 |
by (auto_tac (claset() addIs [finite_nat_segment], simpset())); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2004 |
qed "finite_real_of_nat_segment"; |
10751 | 2005 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2006 |
Goal "finite {n. real_of_nat n < u}"; |
10751 | 2007 |
by (cut_inst_tac [("x","u")] reals_Archimedean2 1); |
2008 |
by (Step_tac 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2009 |
by (rtac (finite_real_of_nat_segment RSN (2,finite_subset)) 1); |
10751 | 2010 |
by (auto_tac (claset() addDs [order_less_trans], simpset())); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2011 |
qed "finite_real_of_nat_less_real"; |
10751 | 2012 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2013 |
Goal "{n. f n <= u} = {n. f n < u} Un {n. u = (f n :: real)}"; |
10751 | 2014 |
by (auto_tac (claset() addDs [order_le_imp_less_or_eq], |
2015 |
simpset() addsimps [order_less_imp_le])); |
|
2016 |
qed "lemma_real_le_Un_eq"; |
|
2017 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2018 |
Goal "finite {n. real_of_nat n <= u}"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2019 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2020 |
simpset() addsimps [lemma_real_le_Un_eq,lemma_finite_omega_set, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2021 |
finite_real_of_nat_less_real])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2022 |
qed "finite_real_of_nat_le_real"; |
10751 | 2023 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2024 |
Goal "finite {n. abs(real_of_nat n) <= u}"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2025 |
by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2026 |
finite_real_of_nat_le_real]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2027 |
qed "finite_rabs_real_of_nat_le_real"; |
10751 | 2028 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2029 |
Goal "{n. abs(real_of_nat n) <= u} ~: FreeUltrafilterNat"; |
10751 | 2030 |
by (blast_tac (claset() addSIs [FreeUltrafilterNat_finite, |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2031 |
finite_rabs_real_of_nat_le_real]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2032 |
qed "rabs_real_of_nat_le_real_FreeUltrafilterNat"; |
10751 | 2033 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2034 |
Goal "{n. u < real_of_nat n} : FreeUltrafilterNat"; |
10751 | 2035 |
by (rtac ccontr 1 THEN dtac FreeUltrafilterNat_Compl_mem 1); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2036 |
by (subgoal_tac "- {n. u < real_of_nat n} = {n. real_of_nat n <= u}" 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2037 |
by (Force_tac 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2038 |
by (asm_full_simp_tac (simpset() addsimps |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2039 |
[finite_real_of_nat_le_real RS FreeUltrafilterNat_finite]) 1); |
10751 | 2040 |
qed "FreeUltrafilterNat_nat_gt_real"; |
2041 |
||
2042 |
(*-------------------------------------------------------------- |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2043 |
The complement of {n. abs(real_of_nat n) <= u} = |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2044 |
{n. u < abs (real_of_nat n)} is in FreeUltrafilterNat |
10751 | 2045 |
by property of (free) ultrafilters |
2046 |
--------------------------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2047 |
Goal "- {n. real_of_nat n <= u} = {n. u < real_of_nat n}"; |
10751 | 2048 |
by (auto_tac (claset() addSDs [order_le_less_trans], |
2049 |
simpset() addsimps [not_real_leE])); |
|
2050 |
val lemma = result(); |
|
2051 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2052 |
Goal "{n. u < abs (real_of_nat n)} : FreeUltrafilterNat"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2053 |
by (cut_inst_tac [("u","u")] rabs_real_of_nat_le_real_FreeUltrafilterNat 1); |
10751 | 2054 |
by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem], |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2055 |
simpset() addsimps [lemma])); |
10751 | 2056 |
qed "FreeUltrafilterNat_omega"; |
2057 |
||
2058 |
(*----------------------------------------------- |
|
2059 |
Omega is a member of HInfinite |
|
2060 |
-----------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2061 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2062 |
Goal "hyprel^^{%n::nat. real_of_nat (Suc n)} : hypreal"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2063 |
by Auto_tac; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2064 |
qed "hypreal_omega"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2065 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2066 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2067 |
Goal "{n. u < real_of_nat n} : FreeUltrafilterNat"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2068 |
by (cut_inst_tac [("u","u")] rabs_real_of_nat_le_real_FreeUltrafilterNat 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2069 |
by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem], |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2070 |
simpset() addsimps [lemma])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2071 |
qed "FreeUltrafilterNat_omega"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2072 |
|
10751 | 2073 |
Goalw [omega_def] "whr: HInfinite"; |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2074 |
by (auto_tac (claset() addSIs [FreeUltrafilterNat_HInfinite], |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2075 |
simpset())); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2076 |
by (rtac bexI 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2077 |
by (rtac lemma_hyprel_refl 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2078 |
by Auto_tac; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2079 |
by (simp_tac (simpset() addsimps [real_of_nat_Suc, real_diff_less_eq RS sym, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2080 |
FreeUltrafilterNat_omega]) 1); |
10751 | 2081 |
qed "HInfinite_omega"; |
2082 |
||
2083 |
(*----------------------------------------------- |
|
2084 |
Epsilon is a member of Infinitesimal |
|
2085 |
-----------------------------------------------*) |
|
2086 |
||
2087 |
Goal "ehr : Infinitesimal"; |
|
2088 |
by (auto_tac (claset() addSIs [HInfinite_inverse_Infinitesimal,HInfinite_omega], |
|
2089 |
simpset() addsimps [hypreal_epsilon_inverse_omega])); |
|
2090 |
qed "Infinitesimal_epsilon"; |
|
2091 |
Addsimps [Infinitesimal_epsilon]; |
|
2092 |
||
2093 |
Goal "ehr : HFinite"; |
|
2094 |
by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD], |
|
2095 |
simpset())); |
|
2096 |
qed "HFinite_epsilon"; |
|
2097 |
Addsimps [HFinite_epsilon]; |
|
2098 |
||
2099 |
Goal "ehr @= #0"; |
|
2100 |
by (simp_tac (simpset() addsimps [mem_infmal_iff RS sym]) 1); |
|
2101 |
qed "epsilon_inf_close_zero"; |
|
2102 |
Addsimps [epsilon_inf_close_zero]; |
|
2103 |
||
2104 |
(*------------------------------------------------------------------------ |
|
2105 |
Needed for proof that we define a hyperreal [<X(n)] @= hypreal_of_real a given |
|
2106 |
that ALL n. |X n - a| < 1/n. Used in proof of NSLIM => LIM. |
|
2107 |
-----------------------------------------------------------------------*) |
|
2108 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2109 |
Goal "0 < u ==> \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2110 |
\ (u < inverse (real_of_nat(Suc n))) = (real_of_nat(Suc n) < inverse u)"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2111 |
by (asm_full_simp_tac (simpset() addsimps [real_inverse_eq_divide]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2112 |
by (stac pos_real_less_divide_eq 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2113 |
by (assume_tac 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2114 |
by (stac pos_real_less_divide_eq 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2115 |
by (simp_tac (simpset() addsimps [real_mult_commute]) 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2116 |
by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2117 |
qed "real_of_nat_less_inverse_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2118 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2119 |
Goal "#0 < u ==> finite {n. u < inverse(real_of_nat(Suc n))}"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2120 |
by (asm_simp_tac (simpset() addsimps [real_of_nat_less_inverse_iff]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2121 |
by (asm_simp_tac (simpset() addsimps [real_of_nat_Suc, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2122 |
real_less_diff_eq RS sym]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2123 |
by (rtac finite_real_of_nat_less_real 1); |
10751 | 2124 |
qed "finite_inverse_real_of_posnat_gt_real"; |
2125 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2126 |
Goal "{n. u <= inverse(real_of_nat(Suc n))} = \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2127 |
\ {n. u < inverse(real_of_nat(Suc n))} Un {n. u = inverse(real_of_nat(Suc n))}"; |
10751 | 2128 |
by (auto_tac (claset() addDs [order_le_imp_less_or_eq], |
2129 |
simpset() addsimps [order_less_imp_le])); |
|
2130 |
qed "lemma_real_le_Un_eq2"; |
|
2131 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2132 |
Goal "(inverse (real_of_nat(Suc n)) <= r) = (#1 <= r * real_of_nat(Suc n))"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2133 |
by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2134 |
by (simp_tac (simpset() addsimps [real_inverse_eq_divide]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2135 |
by (stac pos_real_less_divide_eq 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2136 |
by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2137 |
by (simp_tac (simpset() addsimps [real_mult_commute]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2138 |
qed "real_of_nat_inverse_le_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2139 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2140 |
Goal "(u = inverse (real_of_nat(Suc n))) = (real_of_nat(Suc n) = inverse u)"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2141 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2142 |
simpset() addsimps [real_inverse_inverse, real_of_nat_Suc_gt_zero, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2143 |
real_not_refl2 RS not_sym])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2144 |
qed "real_of_nat_inverse_eq_iff"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2145 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2146 |
Goal "finite {n::nat. u = inverse(real_of_nat(Suc n))}"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2147 |
by (asm_simp_tac (simpset() addsimps [real_of_nat_inverse_eq_iff]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2148 |
by (cut_inst_tac [("x","inverse u - #1")] lemma_finite_omega_set 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2149 |
by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2150 |
real_diff_eq_eq RS sym, eq_commute]) 1); |
10751 | 2151 |
qed "lemma_finite_omega_set2"; |
2152 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2153 |
Goal "#0 < u ==> finite {n. u <= inverse(real_of_nat(Suc n))}"; |
10751 | 2154 |
by (auto_tac (claset(), |
2155 |
simpset() addsimps [lemma_real_le_Un_eq2,lemma_finite_omega_set2, |
|
2156 |
finite_inverse_real_of_posnat_gt_real])); |
|
2157 |
qed "finite_inverse_real_of_posnat_ge_real"; |
|
2158 |
||
2159 |
Goal "#0 < u ==> \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2160 |
\ {n. u <= inverse(real_of_nat(Suc n))} ~: FreeUltrafilterNat"; |
10751 | 2161 |
by (blast_tac (claset() addSIs [FreeUltrafilterNat_finite, |
2162 |
finite_inverse_real_of_posnat_ge_real]) 1); |
|
2163 |
qed "inverse_real_of_posnat_ge_real_FreeUltrafilterNat"; |
|
2164 |
||
2165 |
(*-------------------------------------------------------------- |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2166 |
The complement of {n. u <= inverse(real_of_nat(Suc n))} = |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2167 |
{n. inverse(real_of_nat(Suc n)) < u} is in FreeUltrafilterNat |
10751 | 2168 |
by property of (free) ultrafilters |
2169 |
--------------------------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2170 |
Goal "- {n. u <= inverse(real_of_nat(Suc n))} = \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2171 |
\ {n. inverse(real_of_nat(Suc n)) < u}"; |
10751 | 2172 |
by (auto_tac (claset() addSDs [order_le_less_trans], |
2173 |
simpset() addsimps [not_real_leE])); |
|
2174 |
val lemma = result(); |
|
2175 |
||
2176 |
Goal "#0 < u ==> \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2177 |
\ {n. inverse(real_of_nat(Suc n)) < u} : FreeUltrafilterNat"; |
10751 | 2178 |
by (cut_inst_tac [("u","u")] inverse_real_of_posnat_ge_real_FreeUltrafilterNat 1); |
2179 |
by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem], |
|
2180 |
simpset() addsimps [lemma])); |
|
2181 |
qed "FreeUltrafilterNat_inverse_real_of_posnat"; |
|
2182 |
||
2183 |
(*-------------------------------------------------------------- |
|
2184 |
Example where we get a hyperreal from a real sequence |
|
2185 |
for which a particular property holds. The theorem is |
|
2186 |
used in proofs about equivalence of nonstandard and |
|
2187 |
standard neighbourhoods. Also used for equivalence of |
|
2188 |
nonstandard ans standard definitions of pointwise |
|
2189 |
limit (the theorem was previously in REALTOPOS.thy). |
|
2190 |
-------------------------------------------------------------*) |
|
2191 |
(*----------------------------------------------------- |
|
2192 |
|X(n) - x| < 1/n ==> [<X n>] - hypreal_of_real x|: Infinitesimal |
|
2193 |
-----------------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2194 |
Goal "ALL n. abs(X n + -x) < inverse(real_of_nat(Suc n)) \ |
10751 | 2195 |
\ ==> Abs_hypreal(hyprel^^{X}) + -hypreal_of_real x : Infinitesimal"; |
2196 |
by (auto_tac (claset() addSIs [bexI] |
|
2197 |
addDs [rename_numerals FreeUltrafilterNat_inverse_real_of_posnat, |
|
2198 |
FreeUltrafilterNat_all,FreeUltrafilterNat_Int] |
|
2199 |
addIs [order_less_trans, FreeUltrafilterNat_subset], |
|
2200 |
simpset() addsimps [hypreal_minus, |
|
2201 |
hypreal_of_real_def,hypreal_add, |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2202 |
Infinitesimal_FreeUltrafilterNat_iff,hypreal_inverse])); |
10751 | 2203 |
qed "real_seq_to_hypreal_Infinitesimal"; |
2204 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2205 |
Goal "ALL n. abs(X n + -x) < inverse(real_of_nat(Suc n)) \ |
10751 | 2206 |
\ ==> Abs_hypreal(hyprel^^{X}) @= hypreal_of_real x"; |
2207 |
by (rtac (inf_close_minus_iff RS ssubst) 1); |
|
2208 |
by (rtac (mem_infmal_iff RS subst) 1); |
|
2209 |
by (etac real_seq_to_hypreal_Infinitesimal 1); |
|
2210 |
qed "real_seq_to_hypreal_inf_close"; |
|
2211 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2212 |
Goal "ALL n. abs(x + -X n) < inverse(real_of_nat(Suc n)) \ |
10751 | 2213 |
\ ==> Abs_hypreal(hyprel^^{X}) @= hypreal_of_real x"; |
2214 |
by (asm_full_simp_tac (simpset() addsimps [abs_minus_add_cancel, |
|
2215 |
real_seq_to_hypreal_inf_close]) 1); |
|
2216 |
qed "real_seq_to_hypreal_inf_close2"; |
|
2217 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2218 |
Goal "ALL n. abs(X n + -Y n) < inverse(real_of_nat(Suc n)) \ |
10751 | 2219 |
\ ==> Abs_hypreal(hyprel^^{X}) + \ |
2220 |
\ -Abs_hypreal(hyprel^^{Y}) : Infinitesimal"; |
|
2221 |
by (auto_tac (claset() addSIs [bexI] |
|
2222 |
addDs [rename_numerals |
|
2223 |
FreeUltrafilterNat_inverse_real_of_posnat, |
|
2224 |
FreeUltrafilterNat_all,FreeUltrafilterNat_Int] |
|
2225 |
addIs [order_less_trans, FreeUltrafilterNat_subset], |
|
2226 |
simpset() addsimps |
|
2227 |
[Infinitesimal_FreeUltrafilterNat_iff,hypreal_minus,hypreal_add, |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
2228 |
hypreal_inverse])); |
10751 | 2229 |
qed "real_seq_to_hypreal_Infinitesimal2"; |