author | paulson |
Wed, 10 Jan 2001 17:21:31 +0100 | |
changeset 10857 | 47b1f34ddd09 |
parent 10834 | a7897aebbffc |
child 10919 | 144ede948e58 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : SEQ.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
4 |
Description : Theory of sequence and series of real numbers |
|
5 |
*) |
|
6 |
||
7 |
(*--------------------------------------------------------------------------- |
|
8 |
Example of an hypersequence (i.e. an extended standard sequence) |
|
9 |
whose term with an hypernatural suffix is an infinitesimal i.e. |
|
10 |
the whn'nth term of the hypersequence is a member of Infinitesimal |
|
11 |
-------------------------------------------------------------------------- *) |
|
12 |
||
13 |
Goalw [hypnat_omega_def] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
14 |
"(*fNat* (%n::nat. inverse(real_of_nat(Suc n)))) whn : Infinitesimal"; |
10751 | 15 |
by (auto_tac (claset(), |
16 |
simpset() addsimps [Infinitesimal_FreeUltrafilterNat_iff,starfunNat])); |
|
17 |
by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2); |
|
18 |
by (auto_tac (claset(), |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
19 |
simpset() addsimps [real_of_nat_Suc_gt_zero, abs_eqI2, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
20 |
FreeUltrafilterNat_inverse_real_of_posnat])); |
10751 | 21 |
qed "SEQ_Infinitesimal"; |
22 |
||
23 |
(*-------------------------------------------------------------------------- |
|
24 |
Rules for LIMSEQ and NSLIMSEQ etc. |
|
25 |
--------------------------------------------------------------------------*) |
|
26 |
||
27 |
(*** LIMSEQ ***) |
|
28 |
Goalw [LIMSEQ_def] |
|
29 |
"X ----> L ==> \ |
|
30 |
\ ALL r. #0 < r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r)"; |
|
31 |
by (Asm_simp_tac 1); |
|
32 |
qed "LIMSEQD1"; |
|
33 |
||
34 |
Goalw [LIMSEQ_def] |
|
35 |
"[| X ----> L; #0 < r|] ==> \ |
|
36 |
\ EX no. ALL n. no <= n --> abs(X n + -L) < r"; |
|
37 |
by (Asm_simp_tac 1); |
|
38 |
qed "LIMSEQD2"; |
|
39 |
||
40 |
Goalw [LIMSEQ_def] |
|
41 |
"ALL r. #0 < r --> (EX no. ALL n. \ |
|
42 |
\ no <= n --> abs(X n + -L) < r) ==> X ----> L"; |
|
43 |
by (Asm_simp_tac 1); |
|
44 |
qed "LIMSEQI"; |
|
45 |
||
46 |
Goalw [LIMSEQ_def] |
|
47 |
"(X ----> L) = \ |
|
48 |
\ (ALL r. #0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))"; |
|
49 |
by (Simp_tac 1); |
|
50 |
qed "LIMSEQ_iff"; |
|
51 |
||
52 |
(*** NSLIMSEQ ***) |
|
53 |
Goalw [NSLIMSEQ_def] |
|
54 |
"X ----NS> L ==> ALL N: HNatInfinite. (*fNat* X) N @= hypreal_of_real L"; |
|
55 |
by (Asm_simp_tac 1); |
|
56 |
qed "NSLIMSEQD1"; |
|
57 |
||
58 |
Goalw [NSLIMSEQ_def] |
|
59 |
"[| X ----NS> L; N: HNatInfinite |] ==> (*fNat* X) N @= hypreal_of_real L"; |
|
60 |
by (Asm_simp_tac 1); |
|
61 |
qed "NSLIMSEQD2"; |
|
62 |
||
63 |
Goalw [NSLIMSEQ_def] |
|
64 |
"ALL N: HNatInfinite. (*fNat* X) N @= hypreal_of_real L ==> X ----NS> L"; |
|
65 |
by (Asm_simp_tac 1); |
|
66 |
qed "NSLIMSEQI"; |
|
67 |
||
68 |
Goalw [NSLIMSEQ_def] |
|
69 |
"(X ----NS> L) = (ALL N: HNatInfinite. (*fNat* X) N @= hypreal_of_real L)"; |
|
70 |
by (Simp_tac 1); |
|
71 |
qed "NSLIMSEQ_iff"; |
|
72 |
||
73 |
(*---------------------------------------- |
|
74 |
LIMSEQ ==> NSLIMSEQ |
|
75 |
---------------------------------------*) |
|
76 |
Goalw [LIMSEQ_def,NSLIMSEQ_def] |
|
77 |
"X ----> L ==> X ----NS> L"; |
|
78 |
by (auto_tac (claset(),simpset() addsimps |
|
79 |
[HNatInfinite_FreeUltrafilterNat_iff])); |
|
80 |
by (res_inst_tac [("z","N")] eq_Abs_hypnat 1); |
|
81 |
by (rtac (inf_close_minus_iff RS iffD2) 1); |
|
82 |
by (auto_tac (claset(),simpset() addsimps [starfunNat, |
|
83 |
mem_infmal_iff RS sym,hypreal_of_real_def, |
|
84 |
hypreal_minus,hypreal_add, |
|
85 |
Infinitesimal_FreeUltrafilterNat_iff])); |
|
86 |
by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]); |
|
87 |
by (dres_inst_tac [("x","u")] spec 1 THEN Step_tac 1); |
|
88 |
by (dres_inst_tac [("x","no")] spec 1); |
|
89 |
by (Fuf_tac 1); |
|
90 |
by (blast_tac (claset() addDs [less_imp_le]) 1); |
|
91 |
qed "LIMSEQ_NSLIMSEQ"; |
|
92 |
||
93 |
(*------------------------------------------------------------- |
|
94 |
NSLIMSEQ ==> LIMSEQ |
|
95 |
proving NS def ==> Standard def is trickier as usual |
|
96 |
-------------------------------------------------------------*) |
|
97 |
(* the following sequence f(n) defines a hypernatural *) |
|
98 |
(* lemmas etc. first *) |
|
99 |
Goal "!!(f::nat=>nat). ALL n. n <= f n \ |
|
100 |
\ ==> {n. f n = 0} = {0} | {n. f n = 0} = {}"; |
|
101 |
by (Auto_tac); |
|
102 |
by (dres_inst_tac [("x","xa")] spec 1); |
|
103 |
by (dres_inst_tac [("x","x")] spec 2); |
|
104 |
by (Auto_tac); |
|
105 |
val lemma_NSLIMSEQ1 = result(); |
|
106 |
||
107 |
Goal "{n. f n <= Suc u} = {n. f n <= u} Un {n. f n = Suc u}"; |
|
108 |
by (auto_tac (claset(),simpset() addsimps [le_Suc_eq])); |
|
109 |
val lemma_NSLIMSEQ2 = result(); |
|
110 |
||
111 |
Goal "!!(f::nat=>nat). ALL n. n <= f n \ |
|
112 |
\ ==> {n. f n = Suc u} <= {n. n <= Suc u}"; |
|
113 |
by (Auto_tac); |
|
114 |
by (dres_inst_tac [("x","x")] spec 1); |
|
115 |
by (Auto_tac); |
|
116 |
val lemma_NSLIMSEQ3 = result(); |
|
117 |
||
118 |
Goal "!!(f::nat=>nat). ALL n. n <= f n \ |
|
119 |
\ ==> finite {n. f n <= u}"; |
|
120 |
by (induct_tac "u" 1); |
|
121 |
by (auto_tac (claset(),simpset() addsimps [lemma_NSLIMSEQ2])); |
|
122 |
by (auto_tac (claset() addIs [(lemma_NSLIMSEQ3 RS finite_subset), |
|
123 |
finite_nat_le_segment], simpset())); |
|
124 |
by (dtac lemma_NSLIMSEQ1 1 THEN Step_tac 1); |
|
125 |
by (ALLGOALS(Asm_simp_tac)); |
|
126 |
qed "NSLIMSEQ_finite_set"; |
|
127 |
||
128 |
Goal "- {n. u < (f::nat=>nat) n} = {n. f n <= u}"; |
|
129 |
by (auto_tac (claset() addDs [less_le_trans], |
|
130 |
simpset() addsimps [le_def])); |
|
131 |
qed "Compl_less_set"; |
|
132 |
||
133 |
(* the index set is in the free ultrafilter *) |
|
134 |
Goal "!!(f::nat=>nat). ALL n. n <= f n \ |
|
135 |
\ ==> {n. u < f n} : FreeUltrafilterNat"; |
|
136 |
by (rtac (FreeUltrafilterNat_Compl_iff2 RS iffD2) 1); |
|
137 |
by (rtac FreeUltrafilterNat_finite 1); |
|
138 |
by (auto_tac (claset() addDs [NSLIMSEQ_finite_set], |
|
139 |
simpset() addsimps [Compl_less_set])); |
|
140 |
qed "FreeUltrafilterNat_NSLIMSEQ"; |
|
141 |
||
142 |
(* thus, the sequence defines an infinite hypernatural! *) |
|
143 |
Goal "ALL n. n <= f n \ |
|
10834 | 144 |
\ ==> Abs_hypnat (hypnatrel `` {f}) : HNatInfinite"; |
10751 | 145 |
by (auto_tac (claset(),simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff])); |
146 |
by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]); |
|
147 |
by (etac FreeUltrafilterNat_NSLIMSEQ 1); |
|
148 |
qed "HNatInfinite_NSLIMSEQ"; |
|
149 |
||
150 |
val lemmaLIM = CLAIM "{n. X (f n) + - L = Y n} Int {n. abs (Y n) < r} <= \ |
|
151 |
\ {n. abs (X (f n) + - L) < r}"; |
|
152 |
||
153 |
Goal "{n. abs (X (f n) + - L) < r} Int {n. r <= abs (X (f n) + - (L::real))} \ |
|
154 |
\ = {}"; |
|
155 |
by Auto_tac; |
|
156 |
val lemmaLIM2 = result(); |
|
157 |
||
158 |
Goal "[| #0 < r; ALL n. r <= abs (X (f n) + - L); \ |
|
10834 | 159 |
\ (*fNat* X) (Abs_hypnat (hypnatrel `` {f})) + \ |
10751 | 160 |
\ - hypreal_of_real L @= 0 |] ==> False"; |
161 |
by (auto_tac (claset(),simpset() addsimps [starfunNat, |
|
162 |
mem_infmal_iff RS sym,hypreal_of_real_def, |
|
163 |
hypreal_minus,hypreal_add, |
|
164 |
Infinitesimal_FreeUltrafilterNat_iff])); |
|
165 |
by (dres_inst_tac [("x","r")] spec 1 THEN Step_tac 1); |
|
166 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
167 |
by (dtac (lemmaLIM RSN (2,FreeUltrafilterNat_subset)) 1); |
|
168 |
by (dtac FreeUltrafilterNat_all 1); |
|
169 |
by (thin_tac "{n. abs (Y n) < r} : FreeUltrafilterNat" 1); |
|
170 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
171 |
by (asm_full_simp_tac (simpset() addsimps [lemmaLIM2, |
|
172 |
FreeUltrafilterNat_empty]) 1); |
|
173 |
val lemmaLIM3 = result(); |
|
174 |
||
175 |
Goalw [LIMSEQ_def,NSLIMSEQ_def] |
|
176 |
"X ----NS> L ==> X ----> L"; |
|
177 |
by (rtac ccontr 1 THEN Asm_full_simp_tac 1); |
|
178 |
by (Step_tac 1); |
|
179 |
(* skolemization step *) |
|
180 |
by (dtac choice 1 THEN Step_tac 1); |
|
10834 | 181 |
by (dres_inst_tac [("x","Abs_hypnat(hypnatrel``{f})")] bspec 1); |
10751 | 182 |
by (dtac (inf_close_minus_iff RS iffD1) 2); |
183 |
by (fold_tac [real_le_def]); |
|
184 |
by (blast_tac (claset() addIs [HNatInfinite_NSLIMSEQ]) 1); |
|
185 |
by (blast_tac (claset() addIs [rename_numerals lemmaLIM3]) 1); |
|
186 |
qed "NSLIMSEQ_LIMSEQ"; |
|
187 |
||
188 |
(* Now the all important result is trivially proved! *) |
|
189 |
Goal "(f ----> L) = (f ----NS> L)"; |
|
190 |
by (blast_tac (claset() addIs [LIMSEQ_NSLIMSEQ,NSLIMSEQ_LIMSEQ]) 1); |
|
191 |
qed "LIMSEQ_NSLIMSEQ_iff"; |
|
192 |
||
193 |
(*------------------------------------------------------------------- |
|
194 |
Theorems about sequences |
|
195 |
------------------------------------------------------------------*) |
|
196 |
Goalw [NSLIMSEQ_def] "(%n. k) ----NS> k"; |
|
197 |
by (Auto_tac); |
|
198 |
qed "NSLIMSEQ_const"; |
|
199 |
||
200 |
Goalw [LIMSEQ_def] "(%n. k) ----> k"; |
|
201 |
by (Auto_tac); |
|
202 |
qed "LIMSEQ_const"; |
|
203 |
||
204 |
Goalw [NSLIMSEQ_def] |
|
205 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n + Y n) ----NS> a + b"; |
|
206 |
by (auto_tac (claset() addIs [inf_close_add], |
|
207 |
simpset() addsimps [starfunNat_add RS sym])); |
|
208 |
qed "NSLIMSEQ_add"; |
|
209 |
||
210 |
Goal "[| X ----> a; Y ----> b |] ==> (%n. X n + Y n) ----> a + b"; |
|
211 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
212 |
NSLIMSEQ_add]) 1); |
|
213 |
qed "LIMSEQ_add"; |
|
214 |
||
215 |
Goalw [NSLIMSEQ_def] |
|
216 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n * Y n) ----NS> a * b"; |
|
217 |
by (auto_tac (claset() addSIs [inf_close_mult_HFinite], |
|
218 |
simpset() addsimps [hypreal_of_real_mult, starfunNat_mult RS sym])); |
|
219 |
qed "NSLIMSEQ_mult"; |
|
220 |
||
221 |
Goal "[| X ----> a; Y ----> b |] ==> (%n. X n * Y n) ----> a * b"; |
|
222 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
223 |
NSLIMSEQ_mult]) 1); |
|
224 |
qed "LIMSEQ_mult"; |
|
225 |
||
226 |
Goalw [NSLIMSEQ_def] |
|
227 |
"X ----NS> a ==> (%n. -(X n)) ----NS> -a"; |
|
228 |
by (auto_tac (claset(), simpset() addsimps [starfunNat_minus RS sym])); |
|
229 |
qed "NSLIMSEQ_minus"; |
|
230 |
||
231 |
Goal "X ----> a ==> (%n. -(X n)) ----> -a"; |
|
232 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
233 |
NSLIMSEQ_minus]) 1); |
|
234 |
qed "LIMSEQ_minus"; |
|
235 |
||
236 |
Goal "(%n. -(X n)) ----> -a ==> X ----> a"; |
|
237 |
by (dtac LIMSEQ_minus 1); |
|
238 |
by (Asm_full_simp_tac 1); |
|
239 |
qed "LIMSEQ_minus_cancel"; |
|
240 |
||
241 |
Goal "(%n. -(X n)) ----NS> -a ==> X ----NS> a"; |
|
242 |
by (dtac NSLIMSEQ_minus 1); |
|
243 |
by (Asm_full_simp_tac 1); |
|
244 |
qed "NSLIMSEQ_minus_cancel"; |
|
245 |
||
246 |
Goal "[| X ----NS> a; Y ----NS> b |] \ |
|
247 |
\ ==> (%n. X n + -Y n) ----NS> a + -b"; |
|
248 |
by (dres_inst_tac [("X","Y")] NSLIMSEQ_minus 1); |
|
249 |
by (auto_tac (claset(),simpset() addsimps [NSLIMSEQ_add])); |
|
250 |
qed "NSLIMSEQ_add_minus"; |
|
251 |
||
252 |
Goal "[| X ----> a; Y ----> b |] \ |
|
253 |
\ ==> (%n. X n + -Y n) ----> a + -b"; |
|
254 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
255 |
NSLIMSEQ_add_minus]) 1); |
|
256 |
qed "LIMSEQ_add_minus"; |
|
257 |
||
258 |
Goalw [real_diff_def] |
|
259 |
"[| X ----> a; Y ----> b |] ==> (%n. X n - Y n) ----> a - b"; |
|
260 |
by (blast_tac (claset() addIs [LIMSEQ_add_minus]) 1); |
|
261 |
qed "LIMSEQ_diff"; |
|
262 |
||
263 |
Goalw [real_diff_def] |
|
264 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n - Y n) ----NS> a - b"; |
|
265 |
by (blast_tac (claset() addIs [NSLIMSEQ_add_minus]) 1); |
|
266 |
qed "NSLIMSEQ_diff"; |
|
267 |
||
268 |
(*--------------------------------------------------------------- |
|
269 |
Proof is like that of NSLIM_inverse. |
|
270 |
--------------------------------------------------------------*) |
|
271 |
Goalw [NSLIMSEQ_def] |
|
272 |
"[| X ----NS> a; a ~= #0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)"; |
|
273 |
by (Clarify_tac 1); |
|
274 |
by (dtac bspec 1); |
|
275 |
by (auto_tac (claset(), |
|
276 |
simpset() addsimps [starfunNat_inverse RS sym, |
|
277 |
hypreal_of_real_inf_close_inverse])); |
|
278 |
qed "NSLIMSEQ_inverse"; |
|
279 |
||
280 |
||
281 |
(*------ Standard version of theorem -------*) |
|
282 |
Goal "[| X ----> a; a ~= #0 |] ==> (%n. inverse(X n)) ----> inverse(a)"; |
|
283 |
by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_inverse, |
|
284 |
LIMSEQ_NSLIMSEQ_iff]) 1); |
|
285 |
qed "LIMSEQ_inverse"; |
|
286 |
||
287 |
Goal "[| X ----NS> a; Y ----NS> b; b ~= #0 |] \ |
|
288 |
\ ==> (%n. X n / Y n) ----NS> a/b"; |
|
289 |
by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_mult, NSLIMSEQ_inverse, |
|
290 |
real_divide_def]) 1); |
|
291 |
qed "NSLIMSEQ_mult_inverse"; |
|
292 |
||
293 |
Goal "[| X ----> a; Y ----> b; b ~= #0 |] ==> (%n. X n / Y n) ----> a/b"; |
|
294 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_mult, LIMSEQ_inverse, |
|
295 |
real_divide_def]) 1); |
|
296 |
qed "LIMSEQ_divide"; |
|
297 |
||
298 |
(*----------------------------------------------- |
|
299 |
Uniqueness of limit |
|
300 |
----------------------------------------------*) |
|
301 |
Goalw [NSLIMSEQ_def] |
|
302 |
"[| X ----NS> a; X ----NS> b |] ==> a = b"; |
|
303 |
by (REPEAT(dtac (HNatInfinite_whn RSN (2,bspec)) 1)); |
|
304 |
by (auto_tac (claset() addDs [inf_close_trans3], simpset())); |
|
305 |
qed "NSLIMSEQ_unique"; |
|
306 |
||
307 |
Goal "[| X ----> a; X ----> b |] ==> a = b"; |
|
308 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
309 |
NSLIMSEQ_unique]) 1); |
|
310 |
qed "LIMSEQ_unique"; |
|
311 |
||
312 |
(*----------------------------------------------------------------- |
|
313 |
theorems about nslim and lim |
|
314 |
----------------------------------------------------------------*) |
|
315 |
Goalw [lim_def] "X ----> L ==> lim X = L"; |
|
316 |
by (blast_tac (claset() addIs [LIMSEQ_unique]) 1); |
|
317 |
qed "limI"; |
|
318 |
||
319 |
Goalw [nslim_def] "X ----NS> L ==> nslim X = L"; |
|
320 |
by (blast_tac (claset() addIs [NSLIMSEQ_unique]) 1); |
|
321 |
qed "nslimI"; |
|
322 |
||
323 |
Goalw [lim_def,nslim_def] "lim X = nslim X"; |
|
324 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff]) 1); |
|
325 |
qed "lim_nslim_iff"; |
|
326 |
||
327 |
(*------------------------------------------------------------------ |
|
328 |
Convergence |
|
329 |
-----------------------------------------------------------------*) |
|
330 |
Goalw [convergent_def] |
|
331 |
"convergent X ==> EX L. (X ----> L)"; |
|
332 |
by (assume_tac 1); |
|
333 |
qed "convergentD"; |
|
334 |
||
335 |
Goalw [convergent_def] |
|
336 |
"(X ----> L) ==> convergent X"; |
|
337 |
by (Blast_tac 1); |
|
338 |
qed "convergentI"; |
|
339 |
||
340 |
Goalw [NSconvergent_def] |
|
341 |
"NSconvergent X ==> EX L. (X ----NS> L)"; |
|
342 |
by (assume_tac 1); |
|
343 |
qed "NSconvergentD"; |
|
344 |
||
345 |
Goalw [NSconvergent_def] |
|
346 |
"(X ----NS> L) ==> NSconvergent X"; |
|
347 |
by (Blast_tac 1); |
|
348 |
qed "NSconvergentI"; |
|
349 |
||
350 |
Goalw [convergent_def,NSconvergent_def] |
|
351 |
"convergent X = NSconvergent X"; |
|
352 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff]) 1); |
|
353 |
qed "convergent_NSconvergent_iff"; |
|
354 |
||
355 |
Goalw [NSconvergent_def,nslim_def] |
|
356 |
"NSconvergent X = (X ----NS> nslim X)"; |
|
357 |
by (auto_tac (claset() addIs [someI], simpset())); |
|
358 |
qed "NSconvergent_NSLIMSEQ_iff"; |
|
359 |
||
360 |
Goalw [convergent_def,lim_def] |
|
361 |
"convergent X = (X ----> lim X)"; |
|
362 |
by (auto_tac (claset() addIs [someI], simpset())); |
|
363 |
qed "convergent_LIMSEQ_iff"; |
|
364 |
||
365 |
(*------------------------------------------------------------------- |
|
366 |
Subsequence (alternative definition) (e.g. Hoskins) |
|
367 |
------------------------------------------------------------------*) |
|
368 |
Goalw [subseq_def] "subseq f = (ALL n. (f n) < (f (Suc n)))"; |
|
369 |
by (auto_tac (claset() addSDs [less_imp_Suc_add], simpset())); |
|
370 |
by (nat_ind_tac "k" 1); |
|
371 |
by (auto_tac (claset() addIs [less_trans], simpset())); |
|
372 |
qed "subseq_Suc_iff"; |
|
373 |
||
374 |
(*------------------------------------------------------------------- |
|
375 |
Monotonicity |
|
376 |
------------------------------------------------------------------*) |
|
377 |
||
378 |
Goalw [monoseq_def] |
|
379 |
"monoseq X = ((ALL n. X n <= X (Suc n)) \ |
|
380 |
\ | (ALL n. X (Suc n) <= X n))"; |
|
381 |
by (auto_tac (claset () addSDs [le_imp_less_or_eq], simpset())); |
|
382 |
by (auto_tac (claset() addSIs [lessI RS less_imp_le] |
|
383 |
addSDs [less_imp_Suc_add], |
|
384 |
simpset())); |
|
385 |
by (induct_tac "ka" 1); |
|
386 |
by (auto_tac (claset() addIs [order_trans], simpset())); |
|
387 |
by (EVERY1[rtac ccontr, rtac swap, Simp_tac]); |
|
388 |
by (induct_tac "k" 1); |
|
389 |
by (auto_tac (claset() addIs [order_trans], simpset())); |
|
390 |
qed "monoseq_Suc"; |
|
391 |
||
392 |
Goalw [monoseq_def] |
|
393 |
"ALL m n. m <= n --> X m <= X n ==> monoseq X"; |
|
394 |
by (Blast_tac 1); |
|
395 |
qed "monoI1"; |
|
396 |
||
397 |
Goalw [monoseq_def] |
|
398 |
"ALL m n. m <= n --> X n <= X m ==> monoseq X"; |
|
399 |
by (Blast_tac 1); |
|
400 |
qed "monoI2"; |
|
401 |
||
402 |
Goal "ALL n. X n <= X (Suc n) ==> monoseq X"; |
|
403 |
by (asm_simp_tac (simpset() addsimps [monoseq_Suc]) 1); |
|
404 |
qed "mono_SucI1"; |
|
405 |
||
406 |
Goal "ALL n. X (Suc n) <= X n ==> monoseq X"; |
|
407 |
by (asm_simp_tac (simpset() addsimps [monoseq_Suc]) 1); |
|
408 |
qed "mono_SucI2"; |
|
409 |
||
410 |
(*------------------------------------------------------------------- |
|
411 |
Bounded Sequence |
|
412 |
------------------------------------------------------------------*) |
|
413 |
Goalw [Bseq_def] |
|
414 |
"Bseq X ==> EX K. #0 < K & (ALL n. abs(X n) <= K)"; |
|
415 |
by (assume_tac 1); |
|
416 |
qed "BseqD"; |
|
417 |
||
418 |
Goalw [Bseq_def] |
|
10784 | 419 |
"[| #0 < K; ALL n. abs(X n) <= K |] ==> Bseq X"; |
10751 | 420 |
by (Blast_tac 1); |
421 |
qed "BseqI"; |
|
422 |
||
423 |
Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
424 |
\ (EX N. ALL n. abs(X n) <= real_of_nat(Suc N))"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
425 |
by Auto_tac; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
426 |
by (cut_inst_tac [("x","K")] reals_Archimedean2 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
427 |
by (Clarify_tac 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
428 |
by (res_inst_tac [("x","n")] exI 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
429 |
by (Clarify_tac 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
430 |
by (dres_inst_tac [("x","na")] spec 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
431 |
by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc])); |
10751 | 432 |
qed "lemma_NBseq_def"; |
433 |
||
434 |
(* alternative definition for Bseq *) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
435 |
Goalw [Bseq_def] "Bseq X = (EX N. ALL n. abs(X n) <= real_of_nat(Suc N))"; |
10751 | 436 |
by (simp_tac (simpset() addsimps [lemma_NBseq_def]) 1); |
437 |
qed "Bseq_iff"; |
|
438 |
||
439 |
Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
440 |
\ (EX N. ALL n. abs(X n) < real_of_nat(Suc N))"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
441 |
by (stac lemma_NBseq_def 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
442 |
by Auto_tac; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
443 |
by (res_inst_tac [("x","Suc N")] exI 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
444 |
by (res_inst_tac [("x","N")] exI 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
445 |
by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
446 |
by (blast_tac (claset() addIs [order_less_imp_le]) 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
447 |
by (dres_inst_tac [("x","n")] spec 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
448 |
by (Asm_simp_tac 1); |
10751 | 449 |
qed "lemma_NBseq_def2"; |
450 |
||
451 |
(* yet another definition for Bseq *) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
452 |
Goalw [Bseq_def] "Bseq X = (EX N. ALL n. abs(X n) < real_of_nat(Suc N))"; |
10751 | 453 |
by (simp_tac (simpset() addsimps [lemma_NBseq_def2]) 1); |
454 |
qed "Bseq_iff1a"; |
|
455 |
||
456 |
Goalw [NSBseq_def] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
457 |
"[| NSBseq X; N: HNatInfinite |] ==> (*fNat* X) N : HFinite"; |
10751 | 458 |
by (Blast_tac 1); |
459 |
qed "NSBseqD"; |
|
460 |
||
461 |
Goalw [NSBseq_def] |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
462 |
"ALL N: HNatInfinite. (*fNat* X) N : HFinite ==> NSBseq X"; |
10751 | 463 |
by (assume_tac 1); |
464 |
qed "NSBseqI"; |
|
465 |
||
466 |
(*----------------------------------------------------------- |
|
467 |
Standard definition ==> NS definition |
|
468 |
----------------------------------------------------------*) |
|
469 |
(* a few lemmas *) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
470 |
Goal "ALL n. abs(X n) <= K ==> ALL n. abs(X((f::nat=>nat) n)) <= K"; |
10751 | 471 |
by (Auto_tac); |
472 |
val lemma_Bseq = result(); |
|
473 |
||
474 |
Goalw [Bseq_def,NSBseq_def] "Bseq X ==> NSBseq X"; |
|
475 |
by (Step_tac 1); |
|
476 |
by (res_inst_tac [("z","N")] eq_Abs_hypnat 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
477 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
478 |
simpset() addsimps [starfunNat, HFinite_FreeUltrafilterNat_iff, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
479 |
HNatInfinite_FreeUltrafilterNat_iff])); |
10751 | 480 |
by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2]); |
481 |
by (dres_inst_tac [("f","Xa")] lemma_Bseq 1); |
|
482 |
by (res_inst_tac [("x","K+#1")] exI 1); |
|
483 |
by (rotate_tac 2 1 THEN dtac FreeUltrafilterNat_all 1); |
|
484 |
by (Ultra_tac 1); |
|
485 |
qed "Bseq_NSBseq"; |
|
486 |
||
487 |
(*--------------------------------------------------------------- |
|
488 |
NS definition ==> Standard definition |
|
489 |
---------------------------------------------------------------*) |
|
490 |
(* similar to NSLIM proof in REALTOPOS *) |
|
491 |
(*------------------------------------------------------------------- |
|
492 |
We need to get rid of the real variable and do so by proving the |
|
493 |
following which relies on the Archimedean property of the reals |
|
494 |
When we skolemize we then get the required function f::nat=>nat |
|
495 |
o/w we would be stuck with a skolem function f :: real=>nat which |
|
496 |
is not what we want (read useless!) |
|
497 |
-------------------------------------------------------------------*) |
|
498 |
||
499 |
Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
500 |
\ ==> ALL N. EX n. real_of_nat(Suc N) < abs (X n)"; |
10751 | 501 |
by (Step_tac 1); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
502 |
by (cut_inst_tac [("n","N")] real_of_nat_Suc_gt_zero 1); |
10751 | 503 |
by (Blast_tac 1); |
504 |
val lemmaNSBseq = result(); |
|
505 |
||
506 |
Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \ |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
507 |
\ ==> EX f. ALL N. real_of_nat(Suc N) < abs (X (f N))"; |
10751 | 508 |
by (dtac lemmaNSBseq 1); |
509 |
by (dtac choice 1); |
|
510 |
by (Blast_tac 1); |
|
511 |
val lemmaNSBseq2 = result(); |
|
512 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
513 |
Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \ |
10834 | 514 |
\ ==> Abs_hypreal(hyprel``{X o f}) : HInfinite"; |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
515 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
516 |
simpset() addsimps [HInfinite_FreeUltrafilterNat_iff,o_def])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
517 |
by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]); |
10751 | 518 |
by (cut_inst_tac [("u","u")] FreeUltrafilterNat_nat_gt_real 1); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
519 |
by (dtac FreeUltrafilterNat_all 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
520 |
by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
521 |
by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc])); |
10751 | 522 |
qed "real_seq_to_hypreal_HInfinite"; |
523 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
524 |
(*----------------------------------------------------------------------------- |
10751 | 525 |
Now prove that we can get out an infinite hypernatural as well |
526 |
defined using the skolem function f::nat=>nat above |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
527 |
----------------------------------------------------------------------------*) |
10751 | 528 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
529 |
Goal "{n. f n <= Suc u & real_of_nat(Suc n) < abs (X (f n))} <= \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
530 |
\ {n. f n <= u & real_of_nat(Suc n) < abs (X (f n))} \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
531 |
\ Un {n. real_of_nat(Suc n) < abs (X (Suc u))}"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
532 |
by (auto_tac (claset() addSDs [le_imp_less_or_eq], simpset())); |
10751 | 533 |
val lemma_finite_NSBseq = result(); |
534 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
535 |
Goal "finite {n. f n <= (u::nat) & real_of_nat(Suc n) < abs(X(f n))}"; |
10751 | 536 |
by (induct_tac "u" 1); |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
537 |
by (res_inst_tac [("B","{n. real_of_nat(Suc n) < abs(X 0)}")] finite_subset 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
538 |
by (Force_tac 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
539 |
by (rtac (lemma_finite_NSBseq RS finite_subset) 2); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
540 |
by (auto_tac (claset() addIs [finite_real_of_nat_less_real], |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
541 |
simpset() addsimps [real_of_nat_Suc, real_less_diff_eq RS sym])); |
10751 | 542 |
val lemma_finite_NSBseq2 = result(); |
543 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
544 |
Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \ |
10834 | 545 |
\ ==> Abs_hypnat(hypnatrel``{f}) : HNatInfinite"; |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
546 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
547 |
simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
548 |
by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]); |
10751 | 549 |
by (rtac ccontr 1 THEN dtac FreeUltrafilterNat_Compl_mem 1); |
550 |
by (asm_full_simp_tac (simpset() addsimps |
|
551 |
[CLAIM_SIMP "- {n. u < (f::nat=>nat) n} \ |
|
552 |
\ = {n. f n <= u}" [le_def]]) 1); |
|
553 |
by (dtac FreeUltrafilterNat_all 1); |
|
554 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
555 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
556 |
simpset() addsimps |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
557 |
[CLAIM "({n. f n <= u} Int {n. real_of_nat(Suc n) < abs(X(f n))}) = \ |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
558 |
\ {n. f n <= (u::nat) & real_of_nat(Suc n) < abs(X(f n))}", |
10751 | 559 |
lemma_finite_NSBseq2 RS FreeUltrafilterNat_finite])); |
560 |
qed "HNatInfinite_skolem_f"; |
|
561 |
||
562 |
Goalw [Bseq_def,NSBseq_def] |
|
563 |
"NSBseq X ==> Bseq X"; |
|
564 |
by (rtac ccontr 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
565 |
by (auto_tac (claset(), simpset() addsimps [real_le_def])); |
10751 | 566 |
by (dtac lemmaNSBseq2 1 THEN Step_tac 1); |
567 |
by (forw_inst_tac [("X","X"),("f","f")] real_seq_to_hypreal_HInfinite 1); |
|
568 |
by (dtac (HNatInfinite_skolem_f RSN (2,bspec)) 1 THEN assume_tac 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
569 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
570 |
simpset() addsimps [starfunNat, o_def,HFinite_HInfinite_iff])); |
10751 | 571 |
qed "NSBseq_Bseq"; |
572 |
||
573 |
(*---------------------------------------------------------------------- |
|
574 |
Equivalence of nonstandard and standard definitions |
|
575 |
for a bounded sequence |
|
576 |
-----------------------------------------------------------------------*) |
|
577 |
Goal "(Bseq X) = (NSBseq X)"; |
|
578 |
by (blast_tac (claset() addSIs [NSBseq_Bseq,Bseq_NSBseq]) 1); |
|
579 |
qed "Bseq_NSBseq_iff"; |
|
580 |
||
581 |
(*---------------------------------------------------------------------- |
|
582 |
A convergent sequence is bounded |
|
583 |
(Boundedness as a necessary condition for convergence) |
|
584 |
-----------------------------------------------------------------------*) |
|
585 |
(* easier --- nonstandard version - no existential as usual *) |
|
586 |
Goalw [NSconvergent_def,NSBseq_def,NSLIMSEQ_def] |
|
587 |
"NSconvergent X ==> NSBseq X"; |
|
588 |
by (blast_tac (claset() addDs [HFinite_hypreal_of_real RS |
|
589 |
(inf_close_sym RSN (2,inf_close_HFinite))]) 1); |
|
590 |
qed "NSconvergent_NSBseq"; |
|
591 |
||
592 |
(* standard version - easily now proved using *) |
|
593 |
(* equivalence of NS and standard definitions *) |
|
594 |
Goal "convergent X ==> Bseq X"; |
|
595 |
by (asm_full_simp_tac (simpset() addsimps [NSconvergent_NSBseq, |
|
596 |
convergent_NSconvergent_iff,Bseq_NSBseq_iff]) 1); |
|
597 |
qed "convergent_Bseq"; |
|
598 |
||
599 |
(*---------------------------------------------------------------------- |
|
600 |
Results about Ubs and Lubs of bounded sequences |
|
601 |
-----------------------------------------------------------------------*) |
|
602 |
Goalw [Bseq_def] |
|
603 |
"!!(X::nat=>real). Bseq X ==> \ |
|
604 |
\ EX U. isUb (UNIV::real set) {x. EX n. X n = x} U"; |
|
605 |
by (auto_tac (claset() addIs [isUbI,setleI], |
|
606 |
simpset() addsimps [abs_le_interval_iff])); |
|
607 |
qed "Bseq_isUb"; |
|
608 |
||
609 |
(*---------------------------------------------------------------------- |
|
610 |
Use completeness of reals (supremum property) |
|
611 |
to show that any bounded sequence has a lub |
|
612 |
-----------------------------------------------------------------------*) |
|
613 |
Goal |
|
614 |
"!!(X::nat=>real). Bseq X ==> \ |
|
615 |
\ EX U. isLub (UNIV::real set) {x. EX n. X n = x} U"; |
|
616 |
by (blast_tac (claset() addIs [reals_complete, |
|
617 |
Bseq_isUb]) 1); |
|
618 |
qed "Bseq_isLub"; |
|
619 |
||
620 |
(* nonstandard version of premise will be *) |
|
621 |
(* handy when we work in NS universe *) |
|
622 |
Goal "NSBseq X ==> \ |
|
623 |
\ EX U. isUb (UNIV::real set) {x. EX n. X n = x} U"; |
|
624 |
by (asm_full_simp_tac (simpset() addsimps |
|
625 |
[Bseq_NSBseq_iff RS sym,Bseq_isUb]) 1); |
|
626 |
qed "NSBseq_isUb"; |
|
627 |
||
628 |
Goal |
|
629 |
"NSBseq X ==> \ |
|
630 |
\ EX U. isLub (UNIV::real set) {x. EX n. X n = x} U"; |
|
631 |
by (asm_full_simp_tac (simpset() addsimps |
|
632 |
[Bseq_NSBseq_iff RS sym,Bseq_isLub]) 1); |
|
633 |
qed "NSBseq_isLub"; |
|
634 |
||
635 |
(*-------------------------------------------------------------------- |
|
636 |
Bounded and monotonic sequence converges |
|
637 |
--------------------------------------------------------------------*) |
|
638 |
(* lemmas *) |
|
639 |
Goal |
|
640 |
"!!(X::nat=>real). [| ALL m n. m <= n --> X m <= X n; \ |
|
641 |
\ isLub (UNIV::real set) {x. EX n. X n = x} (X ma) \ |
|
642 |
\ |] ==> ALL n. ma <= n --> X n = X ma"; |
|
643 |
by (Step_tac 1); |
|
644 |
by (dres_inst_tac [("y","X n")] isLubD2 1); |
|
645 |
by (ALLGOALS(blast_tac (claset() addDs [real_le_anti_sym]))); |
|
646 |
val lemma_converg1 = result(); |
|
647 |
||
648 |
(*------------------------------------------------------------------- |
|
649 |
The best of both world: Easier to prove this result as a standard |
|
650 |
theorem and then use equivalence to "transfer" it into the |
|
651 |
equivalent nonstandard form if needed! |
|
652 |
-------------------------------------------------------------------*) |
|
653 |
Goalw [LIMSEQ_def] |
|
654 |
"ALL n. m <= n --> X n = X m \ |
|
655 |
\ ==> EX L. (X ----> L)"; |
|
656 |
by (res_inst_tac [("x","X m")] exI 1); |
|
657 |
by (Step_tac 1); |
|
658 |
by (res_inst_tac [("x","m")] exI 1); |
|
659 |
by (Step_tac 1); |
|
660 |
by (dtac spec 1 THEN etac impE 1); |
|
661 |
by (Auto_tac); |
|
662 |
qed "Bmonoseq_LIMSEQ"; |
|
663 |
||
664 |
(* Now same theorem in terms of NS limit *) |
|
665 |
Goal "ALL n. m <= n --> X n = X m \ |
|
666 |
\ ==> EX L. (X ----NS> L)"; |
|
667 |
by (auto_tac (claset() addSDs [Bmonoseq_LIMSEQ], |
|
668 |
simpset() addsimps [LIMSEQ_NSLIMSEQ_iff])); |
|
669 |
qed "Bmonoseq_NSLIMSEQ"; |
|
670 |
||
671 |
(* a few more lemmas *) |
|
672 |
Goal "!!(X::nat=>real). \ |
|
673 |
\ [| ALL m. X m ~= U; isLub UNIV {x. EX n. X n = x} U |] ==> ALL m. X m < U"; |
|
674 |
by (Step_tac 1); |
|
675 |
by (dres_inst_tac [("y","X m")] isLubD2 1); |
|
676 |
by (auto_tac (claset() addSDs [order_le_imp_less_or_eq], |
|
677 |
simpset())); |
|
678 |
val lemma_converg2 = result(); |
|
679 |
||
680 |
Goal "!!(X ::nat=>real). ALL m. X m <= U ==> \ |
|
681 |
\ isUb UNIV {x. EX n. X n = x} U"; |
|
682 |
by (rtac (setleI RS isUbI) 1); |
|
683 |
by (Auto_tac); |
|
684 |
val lemma_converg3 = result(); |
|
685 |
||
686 |
(* FIXME: U - T < U redundant *) |
|
687 |
Goal "!!(X::nat=> real). \ |
|
688 |
\ [| ALL m. X m ~= U; \ |
|
689 |
\ isLub UNIV {x. EX n. X n = x} U; \ |
|
690 |
\ #0 < T; \ |
|
691 |
\ U + - T < U \ |
|
692 |
\ |] ==> EX m. U + -T < X m & X m < U"; |
|
693 |
by (dtac lemma_converg2 1 THEN assume_tac 1); |
|
694 |
by (rtac ccontr 1 THEN Asm_full_simp_tac 1); |
|
695 |
by (fold_tac [real_le_def]); |
|
696 |
by (dtac lemma_converg3 1); |
|
697 |
by (dtac isLub_le_isUb 1 THEN assume_tac 1); |
|
698 |
by (auto_tac (claset() addDs [order_less_le_trans], |
|
699 |
simpset() addsimps [real_minus_zero_le_iff])); |
|
700 |
val lemma_converg4 = result(); |
|
701 |
||
702 |
(*------------------------------------------------------------------- |
|
703 |
A standard proof of the theorem for monotone increasing sequence |
|
704 |
------------------------------------------------------------------*) |
|
705 |
||
706 |
Goalw [convergent_def] |
|
707 |
"[| Bseq X; ALL m n. m <= n --> X m <= X n |] \ |
|
708 |
\ ==> convergent X"; |
|
709 |
by (forward_tac [Bseq_isLub] 1); |
|
710 |
by (Step_tac 1); |
|
711 |
by (case_tac "EX m. X m = U" 1 THEN Auto_tac); |
|
712 |
by (blast_tac (claset() addDs [lemma_converg1, |
|
713 |
Bmonoseq_LIMSEQ]) 1); |
|
714 |
(* second case *) |
|
715 |
by (res_inst_tac [("x","U")] exI 1); |
|
716 |
by (rtac LIMSEQI 1 THEN Step_tac 1); |
|
717 |
by (forward_tac [lemma_converg2] 1 THEN assume_tac 1); |
|
718 |
by (dtac lemma_converg4 1 THEN Auto_tac); |
|
719 |
by (res_inst_tac [("x","m")] exI 1 THEN Step_tac 1); |
|
720 |
by (subgoal_tac "X m <= X n" 1 THEN Fast_tac 2); |
|
721 |
by (rotate_tac 3 1 THEN dres_inst_tac [("x","n")] spec 1); |
|
722 |
by (arith_tac 1); |
|
723 |
qed "Bseq_mono_convergent"; |
|
724 |
||
725 |
(* NS version of theorem *) |
|
726 |
Goalw [convergent_def] |
|
727 |
"[| NSBseq X; ALL m n. m <= n --> X m <= X n |] \ |
|
728 |
\ ==> NSconvergent X"; |
|
729 |
by (auto_tac (claset() addIs [Bseq_mono_convergent], |
|
730 |
simpset() addsimps [convergent_NSconvergent_iff RS sym, |
|
731 |
Bseq_NSBseq_iff RS sym])); |
|
732 |
qed "NSBseq_mono_NSconvergent"; |
|
733 |
||
734 |
Goalw [convergent_def] |
|
735 |
"(convergent X) = (convergent (%n. -(X n)))"; |
|
736 |
by (auto_tac (claset() addDs [LIMSEQ_minus], simpset())); |
|
737 |
by (dtac LIMSEQ_minus 1 THEN Auto_tac); |
|
738 |
qed "convergent_minus_iff"; |
|
739 |
||
740 |
Goalw [Bseq_def] "Bseq (%n. -(X n)) = Bseq X"; |
|
741 |
by (Asm_full_simp_tac 1); |
|
742 |
qed "Bseq_minus_iff"; |
|
743 |
||
744 |
(*-------------------------------- |
|
745 |
**** main mono theorem **** |
|
746 |
-------------------------------*) |
|
747 |
Goalw [monoseq_def] "[| Bseq X; monoseq X |] ==> convergent X"; |
|
748 |
by (Step_tac 1); |
|
749 |
by (rtac (convergent_minus_iff RS ssubst) 2); |
|
750 |
by (dtac (Bseq_minus_iff RS ssubst) 2); |
|
751 |
by (auto_tac (claset() addSIs [Bseq_mono_convergent], simpset())); |
|
752 |
qed "Bseq_monoseq_convergent"; |
|
753 |
||
754 |
(*---------------------------------------------------------------- |
|
755 |
A few more equivalence theorems for boundedness |
|
756 |
---------------------------------------------------------------*) |
|
757 |
||
758 |
(***--- alternative formulation for boundedness---***) |
|
759 |
Goalw [Bseq_def] |
|
760 |
"Bseq X = (EX k x. #0 < k & (ALL n. abs(X(n) + -x) <= k))"; |
|
761 |
by (Step_tac 1); |
|
762 |
by (res_inst_tac [("x","k + abs(x)")] exI 2); |
|
763 |
by (res_inst_tac [("x","K")] exI 1); |
|
764 |
by (res_inst_tac [("x","0")] exI 1); |
|
765 |
by (Auto_tac); |
|
766 |
by (ALLGOALS (dres_inst_tac [("x","n")] spec)); |
|
767 |
by (ALLGOALS arith_tac); |
|
768 |
qed "Bseq_iff2"; |
|
769 |
||
770 |
(***--- alternative formulation for boundedness ---***) |
|
771 |
Goal "Bseq X = (EX k N. #0 < k & (ALL n. abs(X(n) + -X(N)) <= k))"; |
|
772 |
by (Step_tac 1); |
|
773 |
by (asm_full_simp_tac (simpset() addsimps [Bseq_def]) 1); |
|
774 |
by (Step_tac 1); |
|
775 |
by (res_inst_tac [("x","K + abs(X N)")] exI 1); |
|
776 |
by (Auto_tac); |
|
777 |
by (arith_tac 1); |
|
778 |
by (res_inst_tac [("x","N")] exI 1); |
|
779 |
by (Step_tac 1); |
|
780 |
by (dres_inst_tac [("x","n")] spec 1); |
|
781 |
by (arith_tac 1); |
|
782 |
by (auto_tac (claset(), simpset() addsimps [Bseq_iff2])); |
|
783 |
qed "Bseq_iff3"; |
|
784 |
||
785 |
Goalw [Bseq_def] "(ALL n. k <= f n & f n <= K) ==> Bseq f"; |
|
786 |
by (res_inst_tac [("x","(abs(k) + abs(K)) + #1")] exI 1); |
|
787 |
by (Auto_tac); |
|
788 |
by (dres_inst_tac [("x","n")] spec 2); |
|
789 |
by (ALLGOALS arith_tac); |
|
790 |
qed "BseqI2"; |
|
791 |
||
792 |
(*------------------------------------------------------------------- |
|
793 |
Equivalence between NS and standard definitions of Cauchy seqs |
|
794 |
------------------------------------------------------------------*) |
|
795 |
(*------------------------------- |
|
796 |
Standard def => NS def |
|
797 |
-------------------------------*) |
|
10834 | 798 |
Goal "Abs_hypnat (hypnatrel `` {x}) : HNatInfinite \ |
10751 | 799 |
\ ==> {n. M <= x n} : FreeUltrafilterNat"; |
800 |
by (auto_tac (claset(), |
|
801 |
simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff])); |
|
802 |
by (dres_inst_tac [("x","M")] spec 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
803 |
by (ultra_tac (claset(), simpset() addsimps [less_imp_le]) 1); |
10751 | 804 |
val lemmaCauchy1 = result(); |
805 |
||
806 |
Goal "{n. ALL m n. M <= m & M <= (n::nat) --> abs (X m + - X n) < u} Int \ |
|
807 |
\ {n. M <= xa n} Int {n. M <= x n} <= \ |
|
808 |
\ {n. abs (X (xa n) + - X (x n)) < u}"; |
|
809 |
by (Blast_tac 1); |
|
810 |
val lemmaCauchy2 = result(); |
|
811 |
||
812 |
Goalw [Cauchy_def,NSCauchy_def] |
|
813 |
"Cauchy X ==> NSCauchy X"; |
|
814 |
by (Step_tac 1); |
|
815 |
by (res_inst_tac [("z","M")] eq_Abs_hypnat 1); |
|
816 |
by (res_inst_tac [("z","N")] eq_Abs_hypnat 1); |
|
817 |
by (rtac (inf_close_minus_iff RS iffD2) 1); |
|
818 |
by (rtac (mem_infmal_iff RS iffD1) 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
819 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
820 |
simpset() addsimps [starfunNat, hypreal_minus,hypreal_add, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
821 |
Infinitesimal_FreeUltrafilterNat_iff])); |
10751 | 822 |
by (EVERY[rtac bexI 1, Auto_tac]); |
823 |
by (dtac spec 1 THEN Auto_tac); |
|
824 |
by (dres_inst_tac [("M","M")] lemmaCauchy1 1); |
|
825 |
by (dres_inst_tac [("M","M")] lemmaCauchy1 1); |
|
826 |
by (res_inst_tac [("x1","xa")] |
|
827 |
(lemmaCauchy2 RSN (2,FreeUltrafilterNat_subset)) 1); |
|
828 |
by (rtac FreeUltrafilterNat_Int 1 THEN assume_tac 2); |
|
829 |
by (auto_tac (claset() addIs [FreeUltrafilterNat_Int, |
|
830 |
FreeUltrafilterNat_Nat_set], simpset())); |
|
831 |
qed "Cauchy_NSCauchy"; |
|
832 |
||
833 |
(*----------------------------------------------- |
|
834 |
NS def => Standard def -- rather long but |
|
835 |
straightforward proof in this case |
|
836 |
---------------------------------------------*) |
|
837 |
Goalw [Cauchy_def,NSCauchy_def] |
|
838 |
"NSCauchy X ==> Cauchy X"; |
|
839 |
by (EVERY1[Step_tac, rtac ccontr,Asm_full_simp_tac]); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
840 |
by (dtac choice 1 THEN |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
841 |
auto_tac (claset(), simpset() addsimps [all_conj_distrib])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
842 |
by (dtac choice 1 THEN |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
843 |
step_tac (claset() addSDs [all_conj_distrib RS iffD1]) 1); |
10751 | 844 |
by (REPEAT(dtac HNatInfinite_NSLIMSEQ 1)); |
845 |
by (dtac bspec 1 THEN assume_tac 1); |
|
10834 | 846 |
by (dres_inst_tac [("x","Abs_hypnat (hypnatrel `` {fa})")] bspec 1 |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
847 |
THEN auto_tac (claset(), simpset() addsimps [starfunNat])); |
10751 | 848 |
by (dtac (inf_close_minus_iff RS iffD1) 1); |
849 |
by (dtac (mem_infmal_iff RS iffD2) 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
850 |
by (auto_tac (claset(), simpset() addsimps [hypreal_minus, |
10751 | 851 |
hypreal_add,Infinitesimal_FreeUltrafilterNat_iff])); |
852 |
by (dres_inst_tac [("x","e")] spec 1 THEN Auto_tac); |
|
853 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
854 |
by (dtac (CLAIM "{n. X (f n) + - X (fa n) = Y n} Int \ |
|
855 |
\ {n. abs (Y n) < e} <= \ |
|
856 |
\ {n. abs (X (f n) + - X (fa n)) < e}" RSN |
|
857 |
(2,FreeUltrafilterNat_subset)) 1); |
|
858 |
by (thin_tac "{n. abs (Y n) < e} : FreeUltrafilterNat" 1); |
|
859 |
by (dtac FreeUltrafilterNat_all 1); |
|
860 |
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1); |
|
861 |
by (asm_full_simp_tac (simpset() addsimps |
|
862 |
[CLAIM "{n. abs (X (f n) + - X (fa n)) < e} Int \ |
|
863 |
\ {M. ~ abs (X (f M) + - X (fa M)) < e} = {}", |
|
864 |
FreeUltrafilterNat_empty]) 1); |
|
865 |
qed "NSCauchy_Cauchy"; |
|
866 |
||
867 |
(*----- Equivalence -----*) |
|
868 |
Goal "NSCauchy X = Cauchy X"; |
|
869 |
by (blast_tac (claset() addSIs[NSCauchy_Cauchy, |
|
870 |
Cauchy_NSCauchy]) 1); |
|
871 |
qed "NSCauchy_Cauchy_iff"; |
|
872 |
||
873 |
(*------------------------------------------------------- |
|
874 |
Cauchy sequence is bounded -- this is the standard |
|
875 |
proof mechanization rather than the nonstandard proof |
|
876 |
-------------------------------------------------------*) |
|
877 |
||
878 |
(***------------- VARIOUS LEMMAS --------------***) |
|
879 |
Goal "ALL n. M <= n --> abs (X M + - X n) < (#1::real) \ |
|
880 |
\ ==> ALL n. M <= n --> abs(X n) < #1 + abs(X M)"; |
|
881 |
by (Step_tac 1); |
|
882 |
by (dtac spec 1 THEN Auto_tac); |
|
883 |
by (arith_tac 1); |
|
884 |
val lemmaCauchy = result(); |
|
885 |
||
886 |
Goal "(n < Suc M) = (n <= M)"; |
|
887 |
by Auto_tac; |
|
888 |
qed "less_Suc_cancel_iff"; |
|
889 |
||
890 |
(* FIXME: Long. Maximal element in subsequence *) |
|
891 |
Goal "EX m. m <= M & (ALL n. n <= M --> \ |
|
892 |
\ abs ((X::nat=> real) n) <= abs (X m))"; |
|
893 |
by (induct_tac "M" 1); |
|
894 |
by (res_inst_tac [("x","0")] exI 1); |
|
895 |
by (Asm_full_simp_tac 1); |
|
896 |
by (Step_tac 1); |
|
897 |
by (cut_inst_tac [("R1.0","abs (X (Suc n))"),("R2.0","abs(X m)")] |
|
898 |
real_linear 1); |
|
899 |
by (Step_tac 1); |
|
900 |
by (res_inst_tac [("x","m")] exI 1); |
|
901 |
by (res_inst_tac [("x","m")] exI 2); |
|
902 |
by (res_inst_tac [("x","Suc n")] exI 3); |
|
903 |
by (ALLGOALS(Asm_full_simp_tac)); |
|
904 |
by (Step_tac 1); |
|
905 |
by (ALLGOALS(eres_inst_tac [("m1","na")] |
|
906 |
(le_imp_less_or_eq RS disjE))); |
|
907 |
by (ALLGOALS(asm_full_simp_tac (simpset() addsimps |
|
908 |
[less_Suc_cancel_iff, order_less_imp_le]))); |
|
909 |
by (blast_tac (claset() addIs [order_le_less_trans RS order_less_imp_le]) 1); |
|
910 |
qed "SUP_rabs_subseq"; |
|
911 |
||
912 |
(* lemmas to help proof - mostly trivial *) |
|
913 |
Goal "[| ALL m::nat. m <= M --> P M m; \ |
|
914 |
\ ALL m. M <= m --> P M m |] \ |
|
915 |
\ ==> ALL m. P M m"; |
|
916 |
by (Step_tac 1); |
|
917 |
by (REPEAT(dres_inst_tac [("x","m")] spec 1)); |
|
918 |
by (auto_tac (claset() addEs [less_asym], |
|
919 |
simpset() addsimps [le_def])); |
|
920 |
val lemma_Nat_covered = result(); |
|
921 |
||
922 |
Goal "[| ALL n. n <= M --> abs ((X::nat=>real) n) <= a; a < b |] \ |
|
923 |
\ ==> ALL n. n <= M --> abs(X n) <= b"; |
|
924 |
by (blast_tac (claset() addIs [order_le_less_trans RS order_less_imp_le]) 1); |
|
925 |
val lemma_trans1 = result(); |
|
926 |
||
927 |
Goal "[| ALL n. M <= n --> abs ((X::nat=>real) n) < a; \ |
|
928 |
\ a < b |] \ |
|
929 |
\ ==> ALL n. M <= n --> abs(X n)<= b"; |
|
930 |
by (blast_tac (claset() addIs [order_less_trans RS order_less_imp_le]) 1); |
|
931 |
val lemma_trans2 = result(); |
|
932 |
||
933 |
Goal "[| ALL n. n <= M --> abs (X n) <= a; \ |
|
934 |
\ a = b |] \ |
|
935 |
\ ==> ALL n. n <= M --> abs(X n) <= b"; |
|
936 |
by (Auto_tac); |
|
937 |
val lemma_trans3 = result(); |
|
938 |
||
939 |
Goal "ALL n. M <= n --> abs ((X::nat=>real) n) < a \ |
|
940 |
\ ==> ALL n. M <= n --> abs (X n) <= a"; |
|
941 |
by (blast_tac (claset() addIs [order_less_imp_le]) 1); |
|
942 |
val lemma_trans4 = result(); |
|
943 |
||
944 |
(*---------------------------------------------------------- |
|
945 |
Trickier than expected --- proof is more involved than |
|
946 |
outlines sketched by various authors would suggest |
|
947 |
---------------------------------------------------------*) |
|
948 |
Goalw [Cauchy_def,Bseq_def] "Cauchy X ==> Bseq X"; |
|
949 |
by (dres_inst_tac [("x","#1")] spec 1); |
|
950 |
by (etac (rename_numerals real_zero_less_one RSN (2,impE)) 1); |
|
951 |
by (Step_tac 1); |
|
952 |
by (dres_inst_tac [("x","M")] spec 1); |
|
953 |
by (Asm_full_simp_tac 1); |
|
954 |
by (dtac lemmaCauchy 1); |
|
955 |
by (cut_inst_tac [("M","M"),("X","X")] SUP_rabs_subseq 1); |
|
956 |
by (Step_tac 1); |
|
957 |
by (cut_inst_tac [("R1.0","abs(X m)"), |
|
958 |
("R2.0","#1 + abs(X M)")] real_linear 1); |
|
959 |
by (Step_tac 1); |
|
960 |
by (dtac lemma_trans1 1 THEN assume_tac 1); |
|
961 |
by (dtac lemma_trans2 3 THEN assume_tac 3); |
|
962 |
by (dtac lemma_trans3 2 THEN assume_tac 2); |
|
963 |
by (dtac (abs_add_one_gt_zero RS order_less_trans) 3); |
|
964 |
by (dtac lemma_trans4 1); |
|
965 |
by (dtac lemma_trans4 2); |
|
966 |
by (res_inst_tac [("x","#1 + abs(X M)")] exI 1); |
|
967 |
by (res_inst_tac [("x","#1 + abs(X M)")] exI 2); |
|
968 |
by (res_inst_tac [("x","abs(X m)")] exI 3); |
|
969 |
by (auto_tac (claset() addSEs [lemma_Nat_covered], |
|
970 |
simpset())); |
|
971 |
by (ALLGOALS arith_tac); |
|
972 |
qed "Cauchy_Bseq"; |
|
973 |
||
974 |
(*------------------------------------------------ |
|
975 |
Cauchy sequence is bounded -- NSformulation |
|
976 |
------------------------------------------------*) |
|
977 |
Goal "NSCauchy X ==> NSBseq X"; |
|
978 |
by (asm_full_simp_tac (simpset() addsimps [Cauchy_Bseq, |
|
979 |
Bseq_NSBseq_iff RS sym,NSCauchy_Cauchy_iff]) 1); |
|
980 |
qed "NSCauchy_NSBseq"; |
|
981 |
||
982 |
||
983 |
(*----------------------------------------------------------------- |
|
984 |
Equivalence of Cauchy criterion and convergence |
|
985 |
||
986 |
We will prove this using our NS formulation which provides a |
|
987 |
much easier proof than using the standard definition. We do not |
|
988 |
need to use properties of subsequences such as boundedness, |
|
989 |
monotonicity etc... Compare with Harrison's corresponding proof |
|
990 |
in HOL which is much longer and more complicated. Of course, we do |
|
991 |
not have problems which he encountered with guessing the right |
|
992 |
instantiations for his 'espsilon-delta' proof(s) in this case |
|
993 |
since the NS formulations do not involve existential quantifiers. |
|
994 |
-----------------------------------------------------------------*) |
|
995 |
Goalw [NSconvergent_def,NSLIMSEQ_def] |
|
996 |
"NSCauchy X = NSconvergent X"; |
|
997 |
by (Step_tac 1); |
|
998 |
by (forward_tac [NSCauchy_NSBseq] 1); |
|
999 |
by (auto_tac (claset() addIs [inf_close_trans2], |
|
1000 |
simpset() addsimps |
|
1001 |
[NSBseq_def,NSCauchy_def])); |
|
1002 |
by (dtac (HNatInfinite_whn RSN (2,bspec)) 1); |
|
1003 |
by (dtac (HNatInfinite_whn RSN (2,bspec)) 1); |
|
1004 |
by (auto_tac (claset() addSDs [st_part_Ex], simpset() |
|
1005 |
addsimps [SReal_iff])); |
|
1006 |
by (blast_tac (claset() addIs [inf_close_trans3]) 1); |
|
1007 |
qed "NSCauchy_NSconvergent_iff"; |
|
1008 |
||
1009 |
(* Standard proof for free *) |
|
1010 |
Goal "Cauchy X = convergent X"; |
|
1011 |
by (simp_tac (simpset() addsimps [NSCauchy_Cauchy_iff RS sym, |
|
1012 |
convergent_NSconvergent_iff, NSCauchy_NSconvergent_iff]) 1); |
|
1013 |
qed "Cauchy_convergent_iff"; |
|
1014 |
||
1015 |
(*----------------------------------------------------------------- |
|
1016 |
We can now try and derive a few properties of sequences |
|
1017 |
starting with the limit comparison property for sequences |
|
1018 |
-----------------------------------------------------------------*) |
|
1019 |
Goalw [NSLIMSEQ_def] |
|
1020 |
"[| f ----NS> l; g ----NS> m; \ |
|
1021 |
\ EX N. ALL n. N <= n --> f(n) <= g(n) \ |
|
1022 |
\ |] ==> l <= m"; |
|
1023 |
by (Step_tac 1); |
|
1024 |
by (dtac starfun_le_mono 1); |
|
1025 |
by (REPEAT(dtac (HNatInfinite_whn RSN (2,bspec)) 1)); |
|
1026 |
by (dres_inst_tac [("x","whn")] spec 1); |
|
1027 |
by (REPEAT(dtac (bex_Infinitesimal_iff2 RS iffD2) 1)); |
|
1028 |
by Auto_tac; |
|
1029 |
by (auto_tac (claset() addIs |
|
1030 |
[hypreal_of_real_le_add_Infininitesimal_cancel2], simpset())); |
|
1031 |
qed "NSLIMSEQ_le"; |
|
1032 |
||
1033 |
(* standard version *) |
|
1034 |
Goal "[| f ----> l; g ----> m; \ |
|
1035 |
\ EX N. ALL n. N <= n --> f(n) <= g(n) |] \ |
|
1036 |
\ ==> l <= m"; |
|
1037 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1038 |
NSLIMSEQ_le]) 1); |
|
1039 |
qed "LIMSEQ_le"; |
|
1040 |
||
1041 |
(*--------------- |
|
1042 |
Also... |
|
1043 |
--------------*) |
|
1044 |
Goal "[| X ----> r; ALL n. a <= X n |] ==> a <= r"; |
|
1045 |
by (rtac LIMSEQ_le 1); |
|
1046 |
by (rtac LIMSEQ_const 1); |
|
1047 |
by (Auto_tac); |
|
1048 |
qed "LIMSEQ_le_const"; |
|
1049 |
||
1050 |
Goal "[| X ----NS> r; ALL n. a <= X n |] ==> a <= r"; |
|
1051 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1052 |
LIMSEQ_le_const]) 1); |
|
1053 |
qed "NSLIMSEQ_le_const"; |
|
1054 |
||
1055 |
Goal "[| X ----> r; ALL n. X n <= a |] ==> r <= a"; |
|
1056 |
by (rtac LIMSEQ_le 1); |
|
1057 |
by (rtac LIMSEQ_const 2); |
|
1058 |
by (Auto_tac); |
|
1059 |
qed "LIMSEQ_le_const2"; |
|
1060 |
||
1061 |
Goal "[| X ----NS> r; ALL n. X n <= a |] ==> r <= a"; |
|
1062 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1063 |
LIMSEQ_le_const2]) 1); |
|
1064 |
qed "NSLIMSEQ_le_const2"; |
|
1065 |
||
1066 |
(*----------------------------------------------------- |
|
1067 |
Shift a convergent series by 1 |
|
1068 |
We use the fact that Cauchyness and convergence |
|
1069 |
are equivalent and also that the successor of an |
|
1070 |
infinite hypernatural is also infinite. |
|
1071 |
-----------------------------------------------------*) |
|
1072 |
Goal "f ----NS> l ==> (%n. f(Suc n)) ----NS> l"; |
|
1073 |
by (forward_tac [NSconvergentI RS |
|
1074 |
(NSCauchy_NSconvergent_iff RS iffD2)] 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1075 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1076 |
simpset() addsimps [NSCauchy_def, NSLIMSEQ_def,starfunNat_shift_one])); |
10751 | 1077 |
by (dtac bspec 1 THEN assume_tac 1); |
1078 |
by (dtac bspec 1 THEN assume_tac 1); |
|
1079 |
by (dtac (SHNat_one RSN (2,HNatInfinite_SHNat_add)) 1); |
|
1080 |
by (blast_tac (claset() addIs [inf_close_trans3]) 1); |
|
1081 |
qed "NSLIMSEQ_Suc"; |
|
1082 |
||
1083 |
(* standard version *) |
|
1084 |
Goal "f ----> l ==> (%n. f(Suc n)) ----> l"; |
|
1085 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1086 |
NSLIMSEQ_Suc]) 1); |
|
1087 |
qed "LIMSEQ_Suc"; |
|
1088 |
||
1089 |
Goal "(%n. f(Suc n)) ----NS> l ==> f ----NS> l"; |
|
1090 |
by (forward_tac [NSconvergentI RS |
|
1091 |
(NSCauchy_NSconvergent_iff RS iffD2)] 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1092 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1093 |
simpset() addsimps [NSCauchy_def, NSLIMSEQ_def,starfunNat_shift_one])); |
10751 | 1094 |
by (dtac bspec 1 THEN assume_tac 1); |
1095 |
by (dtac bspec 1 THEN assume_tac 1); |
|
1096 |
by (ftac (SHNat_one RSN (2,HNatInfinite_SHNat_diff)) 1); |
|
1097 |
by (rotate_tac 2 1); |
|
1098 |
by (auto_tac (claset() addSDs [bspec] addIs [inf_close_trans3], |
|
1099 |
simpset())); |
|
1100 |
qed "NSLIMSEQ_imp_Suc"; |
|
1101 |
||
1102 |
Goal "(%n. f(Suc n)) ----> l ==> f ----> l"; |
|
1103 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff]) 1); |
|
1104 |
by (etac NSLIMSEQ_imp_Suc 1); |
|
1105 |
qed "LIMSEQ_imp_Suc"; |
|
1106 |
||
1107 |
Goal "((%n. f(Suc n)) ----> l) = (f ----> l)"; |
|
1108 |
by (blast_tac (claset() addIs [LIMSEQ_imp_Suc,LIMSEQ_Suc]) 1); |
|
1109 |
qed "LIMSEQ_Suc_iff"; |
|
1110 |
||
1111 |
Goal "((%n. f(Suc n)) ----NS> l) = (f ----NS> l)"; |
|
1112 |
by (blast_tac (claset() addIs [NSLIMSEQ_imp_Suc,NSLIMSEQ_Suc]) 1); |
|
1113 |
qed "NSLIMSEQ_Suc_iff"; |
|
1114 |
||
1115 |
(*----------------------------------------------------- |
|
1116 |
A sequence tends to zero iff its abs does |
|
1117 |
----------------------------------------------------*) |
|
1118 |
(* we can prove this directly since proof is trivial *) |
|
1119 |
Goalw [LIMSEQ_def] |
|
1120 |
"((%n. abs(f n)) ----> #0) = (f ----> #0)"; |
|
1121 |
by (simp_tac (simpset() addsimps [abs_idempotent]) 1); |
|
1122 |
qed "LIMSEQ_rabs_zero"; |
|
1123 |
||
1124 |
(*-----------------------------------------------------*) |
|
1125 |
(* We prove the NS version from the standard one *) |
|
1126 |
(* Actually pure NS proof seems more complicated *) |
|
1127 |
(* than the direct standard one above! *) |
|
1128 |
(*-----------------------------------------------------*) |
|
1129 |
||
1130 |
Goal "((%n. abs(f n)) ----NS> #0) = (f ----NS> #0)"; |
|
1131 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
|
1132 |
LIMSEQ_rabs_zero]) 1); |
|
1133 |
qed "NSLIMSEQ_rabs_zero"; |
|
1134 |
||
1135 |
(*---------------------------------------- |
|
1136 |
Also we have for a general limit |
|
1137 |
(NS proof much easier) |
|
1138 |
---------------------------------------*) |
|
1139 |
Goalw [NSLIMSEQ_def] |
|
1140 |
"f ----NS> l ==> (%n. abs(f n)) ----NS> abs(l)"; |
|
1141 |
by (auto_tac (claset() addIs [inf_close_hrabs], simpset() |
|
1142 |
addsimps [starfunNat_rabs,hypreal_of_real_hrabs RS sym])); |
|
1143 |
qed "NSLIMSEQ_imp_rabs"; |
|
1144 |
||
1145 |
(* standard version *) |
|
1146 |
Goal "f ----> l ==> (%n. abs(f n)) ----> abs(l)"; |
|
1147 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1148 |
NSLIMSEQ_imp_rabs]) 1); |
|
1149 |
qed "LIMSEQ_imp_rabs"; |
|
1150 |
||
1151 |
(*----------------------------------------------------- |
|
1152 |
An unbounded sequence's inverse tends to 0 |
|
1153 |
----------------------------------------------------*) |
|
1154 |
(* standard proof seems easier *) |
|
1155 |
Goalw [LIMSEQ_def] |
|
1156 |
"ALL y. EX N. ALL n. N <= n --> y < f(n) \ |
|
1157 |
\ ==> (%n. inverse(f n)) ----> #0"; |
|
1158 |
by (Step_tac 1 THEN Asm_full_simp_tac 1); |
|
1159 |
by (dres_inst_tac [("x","inverse r")] spec 1 THEN Step_tac 1); |
|
1160 |
by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1); |
|
1161 |
by (dtac spec 1 THEN Auto_tac); |
|
1162 |
by (forward_tac [real_inverse_gt_0] 1); |
|
1163 |
by (forward_tac [order_less_trans] 1 THEN assume_tac 1); |
|
1164 |
by (forw_inst_tac [("x","f n")] real_inverse_gt_0 1); |
|
1165 |
by (asm_simp_tac (simpset() addsimps [abs_eqI2]) 1); |
|
1166 |
by (res_inst_tac [("t","r")] (real_inverse_inverse RS subst) 1); |
|
1167 |
by (auto_tac (claset() addIs [real_inverse_less_iff RS iffD2], |
|
1168 |
simpset() delsimps [real_inverse_inverse])); |
|
1169 |
qed "LIMSEQ_inverse_zero"; |
|
1170 |
||
1171 |
Goal "ALL y. EX N. ALL n. N <= n --> y < f(n) \ |
|
1172 |
\ ==> (%n. inverse(f n)) ----NS> #0"; |
|
1173 |
by (asm_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
|
1174 |
LIMSEQ_inverse_zero]) 1); |
|
1175 |
qed "NSLIMSEQ_inverse_zero"; |
|
1176 |
||
1177 |
(*-------------------------------------------------------------- |
|
1178 |
Sequence 1/n --> 0 as n --> infinity |
|
1179 |
-------------------------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1180 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1181 |
Goal "(%n. inverse(real_of_nat(Suc n))) ----> #0"; |
10751 | 1182 |
by (rtac LIMSEQ_inverse_zero 1 THEN Step_tac 1); |
1183 |
by (cut_inst_tac [("x","y")] reals_Archimedean2 1); |
|
1184 |
by (Step_tac 1 THEN res_inst_tac [("x","n")] exI 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1185 |
by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc])); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1186 |
by (subgoal_tac "y < real_of_nat na" 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1187 |
by (Asm_simp_tac 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1188 |
by (blast_tac (claset() addIs [order_less_le_trans]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1189 |
qed "LIMSEQ_inverse_real_of_nat"; |
10751 | 1190 |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1191 |
Goal "(%n. inverse(real_of_nat(Suc n))) ----NS> #0"; |
10751 | 1192 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1193 |
LIMSEQ_inverse_real_of_nat]) 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1194 |
qed "NSLIMSEQ_inverse_real_of_nat"; |
10751 | 1195 |
|
1196 |
(*-------------------------------------------- |
|
1197 |
Sequence r + 1/n --> r as n --> infinity |
|
1198 |
now easily proved |
|
1199 |
--------------------------------------------*) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1200 |
Goal "(%n. r + inverse(real_of_nat(Suc n))) ----> r"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1201 |
by (cut_facts_tac |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1202 |
[ [LIMSEQ_const,LIMSEQ_inverse_real_of_nat] MRS LIMSEQ_add ] 1); |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1203 |
by Auto_tac; |
10751 | 1204 |
qed "LIMSEQ_inverse_real_of_posnat_add"; |
1205 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1206 |
Goal "(%n. r + inverse(real_of_nat(Suc n))) ----NS> r"; |
10751 | 1207 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
1208 |
LIMSEQ_inverse_real_of_posnat_add]) 1); |
|
1209 |
qed "NSLIMSEQ_inverse_real_of_posnat_add"; |
|
1210 |
||
1211 |
(*-------------- |
|
1212 |
Also... |
|
1213 |
--------------*) |
|
1214 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1215 |
Goal "(%n. r + -inverse(real_of_nat(Suc n))) ----> r"; |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1216 |
by (cut_facts_tac [[LIMSEQ_const,LIMSEQ_inverse_real_of_nat] |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1217 |
MRS LIMSEQ_add_minus] 1); |
10751 | 1218 |
by (Auto_tac); |
1219 |
qed "LIMSEQ_inverse_real_of_posnat_add_minus"; |
|
1220 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1221 |
Goal "(%n. r + -inverse(real_of_nat(Suc n))) ----NS> r"; |
10751 | 1222 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
1223 |
LIMSEQ_inverse_real_of_posnat_add_minus]) 1); |
|
1224 |
qed "NSLIMSEQ_inverse_real_of_posnat_add_minus"; |
|
1225 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1226 |
Goal "(%n. r*( #1 + -inverse(real_of_nat(Suc n)))) ----> r"; |
10751 | 1227 |
by (cut_inst_tac [("b","#1")] ([LIMSEQ_const, |
1228 |
LIMSEQ_inverse_real_of_posnat_add_minus] MRS LIMSEQ_mult) 1); |
|
1229 |
by (Auto_tac); |
|
1230 |
qed "LIMSEQ_inverse_real_of_posnat_add_minus_mult"; |
|
1231 |
||
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1232 |
Goal "(%n. r*( #1 + -inverse(real_of_nat(Suc n)))) ----NS> r"; |
10751 | 1233 |
by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym, |
1234 |
LIMSEQ_inverse_real_of_posnat_add_minus_mult]) 1); |
|
1235 |
qed "NSLIMSEQ_inverse_real_of_posnat_add_minus_mult"; |
|
1236 |
||
1237 |
(*--------------------------------------------------------------- |
|
1238 |
Real Powers |
|
1239 |
--------------------------------------------------------------*) |
|
1240 |
Goal "(X ----NS> a) --> ((%n. (X n) ^ m) ----NS> a ^ m)"; |
|
1241 |
by (induct_tac "m" 1); |
|
1242 |
by (auto_tac (claset() addIs [NSLIMSEQ_mult,NSLIMSEQ_const], |
|
1243 |
simpset())); |
|
1244 |
qed_spec_mp "NSLIMSEQ_pow"; |
|
1245 |
||
1246 |
Goal "X ----> a ==> (%n. (X n) ^ m) ----> a ^ m"; |
|
1247 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff, |
|
1248 |
NSLIMSEQ_pow]) 1); |
|
1249 |
qed "LIMSEQ_pow"; |
|
1250 |
||
1251 |
(*---------------------------------------------------------------- |
|
1252 |
0 <= x < #1 ==> (x ^ n ----> 0) |
|
1253 |
Proof will use (NS) Cauchy equivalence for convergence and |
|
1254 |
also fact that bounded and monotonic sequence converges. |
|
1255 |
---------------------------------------------------------------*) |
|
10784 | 1256 |
Goalw [Bseq_def] "[| #0 <= x; x < #1 |] ==> Bseq (%n. x ^ n)"; |
10751 | 1257 |
by (res_inst_tac [("x","#1")] exI 1); |
10784 | 1258 |
by (auto_tac (claset() addDs [conjI RS realpow_le] |
10751 | 1259 |
addIs [order_less_imp_le], |
10784 | 1260 |
simpset() addsimps [abs_eqI1, realpow_abs RS sym] )); |
10751 | 1261 |
qed "Bseq_realpow"; |
1262 |
||
1263 |
Goal "[| #0 <= x; x < #1 |] ==> monoseq (%n. x ^ n)"; |
|
1264 |
by (blast_tac (claset() addSIs [mono_SucI2,realpow_Suc_le3]) 1); |
|
1265 |
qed "monoseq_realpow"; |
|
1266 |
||
1267 |
Goal "[| #0 <= x; x < #1 |] ==> convergent (%n. x ^ n)"; |
|
1268 |
by (blast_tac (claset() addSIs [Bseq_monoseq_convergent, |
|
1269 |
Bseq_realpow,monoseq_realpow]) 1); |
|
1270 |
qed "convergent_realpow"; |
|
1271 |
||
1272 |
(* We now use NS criterion to bring proof of theorem through *) |
|
1273 |
||
1274 |
||
1275 |
Goalw [NSLIMSEQ_def] |
|
1276 |
"[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----NS> #0"; |
|
1277 |
by (auto_tac (claset() addSDs [convergent_realpow], |
|
1278 |
simpset() addsimps [convergent_NSconvergent_iff])); |
|
1279 |
by (forward_tac [NSconvergentD] 1); |
|
1280 |
by (auto_tac (claset(), |
|
1281 |
simpset() addsimps [NSLIMSEQ_def, NSCauchy_NSconvergent_iff RS sym, |
|
1282 |
NSCauchy_def, starfunNat_pow])); |
|
1283 |
by (forward_tac [HNatInfinite_add_one] 1); |
|
1284 |
by (dtac bspec 1 THEN assume_tac 1); |
|
1285 |
by (dtac bspec 1 THEN assume_tac 1); |
|
1286 |
by (dres_inst_tac [("x","N + 1hn")] bspec 1 THEN assume_tac 1); |
|
1287 |
by (asm_full_simp_tac (simpset() addsimps [hyperpow_add]) 1); |
|
1288 |
by (dtac inf_close_mult_subst_SReal 1 THEN assume_tac 1); |
|
1289 |
by (dtac inf_close_trans3 1 THEN assume_tac 1); |
|
1290 |
by (auto_tac (claset(), |
|
1291 |
simpset() delsimps [hypreal_of_real_mult] |
|
1292 |
addsimps [hypreal_of_real_mult RS sym])); |
|
1293 |
qed "NSLIMSEQ_realpow_zero"; |
|
1294 |
||
1295 |
(*--------------- standard version ---------------*) |
|
1296 |
Goal "[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----> #0"; |
|
1297 |
by (asm_simp_tac (simpset() addsimps [NSLIMSEQ_realpow_zero, |
|
1298 |
LIMSEQ_NSLIMSEQ_iff]) 1); |
|
1299 |
qed "LIMSEQ_realpow_zero"; |
|
1300 |
||
1301 |
Goal "#1 < x ==> (%n. a / (x ^ n)) ----> #0"; |
|
1302 |
by (cut_inst_tac [("a","a"),("x1","inverse x")] |
|
1303 |
([LIMSEQ_const, LIMSEQ_realpow_zero] MRS LIMSEQ_mult) 1); |
|
1304 |
by (auto_tac (claset(), |
|
1305 |
simpset() addsimps [real_divide_def, realpow_inverse])); |
|
1306 |
by (asm_simp_tac (simpset() addsimps [real_inverse_eq_divide, |
|
1307 |
pos_real_divide_less_eq]) 1); |
|
1308 |
qed "LIMSEQ_divide_realpow_zero"; |
|
1309 |
||
1310 |
(*---------------------------------------------------------------- |
|
1311 |
Limit of c^n for |c| < 1 |
|
1312 |
---------------------------------------------------------------*) |
|
1313 |
Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----> #0"; |
|
1314 |
by (blast_tac (claset() addSIs [LIMSEQ_realpow_zero,abs_ge_zero]) 1); |
|
1315 |
qed "LIMSEQ_rabs_realpow_zero"; |
|
1316 |
||
1317 |
Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----NS> #0"; |
|
1318 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero, |
|
1319 |
LIMSEQ_NSLIMSEQ_iff RS sym]) 1); |
|
1320 |
qed "NSLIMSEQ_rabs_realpow_zero"; |
|
1321 |
||
1322 |
Goal "abs(c) < #1 ==> (%n. c ^ n) ----> #0"; |
|
1323 |
by (rtac (LIMSEQ_rabs_zero RS iffD1) 1); |
|
1324 |
by (auto_tac (claset() addIs [LIMSEQ_rabs_realpow_zero], |
|
1325 |
simpset() addsimps [realpow_abs RS sym])); |
|
1326 |
qed "LIMSEQ_rabs_realpow_zero2"; |
|
1327 |
||
1328 |
Goal "abs(c) < #1 ==> (%n. c ^ n) ----NS> #0"; |
|
1329 |
by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero2, |
|
1330 |
LIMSEQ_NSLIMSEQ_iff RS sym]) 1); |
|
1331 |
qed "NSLIMSEQ_rabs_realpow_zero2"; |
|
1332 |
||
1333 |
(***--------------------------------------------------------------- |
|
1334 |
Hyperreals and Sequences |
|
1335 |
---------------------------------------------------------------***) |
|
1336 |
(*** A bounded sequence is a finite hyperreal ***) |
|
10834 | 1337 |
Goal "NSBseq X ==> Abs_hypreal(hyprel``{X}) : HFinite"; |
10751 | 1338 |
by (auto_tac (claset() addSIs [bexI,lemma_hyprel_refl] addIs |
1339 |
[FreeUltrafilterNat_all RS FreeUltrafilterNat_subset], |
|
1340 |
simpset() addsimps [HFinite_FreeUltrafilterNat_iff, |
|
1341 |
Bseq_NSBseq_iff RS sym, Bseq_iff1a])); |
|
1342 |
qed "NSBseq_HFinite_hypreal"; |
|
1343 |
||
1344 |
(*** A sequence converging to zero defines an infinitesimal ***) |
|
1345 |
Goalw [NSLIMSEQ_def] |
|
10834 | 1346 |
"X ----NS> #0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal"; |
10751 | 1347 |
by (dres_inst_tac [("x","whn")] bspec 1); |
1348 |
by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1); |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1349 |
by (auto_tac (claset(), |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1350 |
simpset() addsimps [hypnat_omega_def, mem_infmal_iff RS sym, |
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1351 |
starfunNat,hypreal_of_real_zero])); |
10751 | 1352 |
qed "NSLIMSEQ_zero_Infinitesimal_hypreal"; |
1353 |
||
1354 |
(***--------------------------------------------------------------- |
|
1355 |
Theorems proved by Harrison in HOL that we do not need |
|
1356 |
in order to prove equivalence between Cauchy criterion |
|
1357 |
and convergence: |
|
1358 |
-- Show that every sequence contains a monotonic subsequence |
|
1359 |
Goal "EX f. subseq f & monoseq (%n. s (f n))"; |
|
1360 |
-- Show that a subsequence of a bounded sequence is bounded |
|
1361 |
Goal "Bseq X ==> Bseq (%n. X (f n))"; |
|
1362 |
-- Show we can take subsequential terms arbitrarily far |
|
1363 |
up a sequence |
|
1364 |
Goal "subseq f ==> n <= f(n)"; |
|
1365 |
Goal "subseq f ==> EX n. N1 <= n & N2 <= f(n)"; |
|
1366 |
---------------------------------------------------------------***) |
|
10778
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1367 |
|
2c6605049646
more tidying, especially to remove real_of_posnat
paulson
parents:
10751
diff
changeset
|
1368 |