author | berghofe |
Fri, 01 Jul 2005 13:54:12 +0200 | |
changeset 16633 | 208ebc9311f2 |
parent 15539 | 333a88244569 |
child 16819 | 00d8f9300d13 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : SEQ.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
4 |
Description : Convergence of sequences and series |
|
15082 | 5 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2004 |
6 |
*) |
|
10751 | 7 |
|
15131 | 8 |
theory SEQ |
15236
f289e8ba2bb3
Proofs needed to be updated because induction now preserves name of
nipkow
parents:
15229
diff
changeset
|
9 |
imports NatStar |
15131 | 10 |
begin |
10751 | 11 |
|
12 |
constdefs |
|
13 |
||
15082 | 14 |
LIMSEQ :: "[nat=>real,real] => bool" ("((_)/ ----> (_))" [60, 60] 60) |
15 |
--{*Standard definition of convergence of sequence*} |
|
16 |
"X ----> L == (\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> \<bar>X n + -L\<bar> < r))" |
|
10751 | 17 |
|
15082 | 18 |
NSLIMSEQ :: "[nat=>real,real] => bool" ("((_)/ ----NS> (_))" [60, 60] 60) |
19 |
--{*Nonstandard definition of convergence of sequence*} |
|
20 |
"X ----NS> L == (\<forall>N \<in> HNatInfinite. ( *fNat* X) N \<approx> hypreal_of_real L)" |
|
21 |
||
22 |
lim :: "(nat => real) => real" |
|
23 |
--{*Standard definition of limit using choice operator*} |
|
10751 | 24 |
"lim X == (@L. (X ----> L))" |
25 |
||
15082 | 26 |
nslim :: "(nat => real) => real" |
27 |
--{*Nonstandard definition of limit using choice operator*} |
|
10751 | 28 |
"nslim X == (@L. (X ----NS> L))" |
29 |
||
15082 | 30 |
convergent :: "(nat => real) => bool" |
31 |
--{*Standard definition of convergence*} |
|
32 |
"convergent X == (\<exists>L. (X ----> L))" |
|
10751 | 33 |
|
15082 | 34 |
NSconvergent :: "(nat => real) => bool" |
35 |
--{*Nonstandard definition of convergence*} |
|
36 |
"NSconvergent X == (\<exists>L. (X ----NS> L))" |
|
37 |
||
38 |
Bseq :: "(nat => real) => bool" |
|
39 |
--{*Standard definition for bounded sequence*} |
|
15360 | 40 |
"Bseq X == \<exists>K>0.\<forall>n. \<bar>X n\<bar> \<le> K" |
10751 | 41 |
|
15082 | 42 |
NSBseq :: "(nat=>real) => bool" |
43 |
--{*Nonstandard definition for bounded sequence*} |
|
44 |
"NSBseq X == (\<forall>N \<in> HNatInfinite. ( *fNat* X) N : HFinite)" |
|
45 |
||
46 |
monoseq :: "(nat=>real)=>bool" |
|
47 |
--{*Definition for monotonicity*} |
|
15360 | 48 |
"monoseq X == (\<forall>m. \<forall>n\<ge>m. X m \<le> X n) | (\<forall>m. \<forall>n\<ge>m. X n \<le> X m)" |
10751 | 49 |
|
15082 | 50 |
subseq :: "(nat => nat) => bool" |
51 |
--{*Definition of subsequence*} |
|
15360 | 52 |
"subseq f == \<forall>m. \<forall>n>m. (f m) < (f n)" |
10751 | 53 |
|
15082 | 54 |
Cauchy :: "(nat => real) => bool" |
55 |
--{*Standard definition of the Cauchy condition*} |
|
15360 | 56 |
"Cauchy X == \<forall>e>0. \<exists>M. \<forall>m \<ge> M. \<forall>n \<ge> M. abs((X m) + -(X n)) < e" |
10751 | 57 |
|
15082 | 58 |
NSCauchy :: "(nat => real) => bool" |
59 |
--{*Nonstandard definition*} |
|
60 |
"NSCauchy X == (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. |
|
61 |
( *fNat* X) M \<approx> ( *fNat* X) N)" |
|
62 |
||
63 |
||
64 |
||
65 |
text{* Example of an hypersequence (i.e. an extended standard sequence) |
|
66 |
whose term with an hypernatural suffix is an infinitesimal i.e. |
|
67 |
the whn'nth term of the hypersequence is a member of Infinitesimal*} |
|
68 |
||
69 |
lemma SEQ_Infinitesimal: |
|
70 |
"( *fNat* (%n::nat. inverse(real(Suc n)))) whn : Infinitesimal" |
|
71 |
apply (simp add: hypnat_omega_def Infinitesimal_FreeUltrafilterNat_iff starfunNat) |
|
72 |
apply (rule bexI, rule_tac [2] lemma_hyprel_refl) |
|
15229 | 73 |
apply (simp add: real_of_nat_Suc_gt_zero FreeUltrafilterNat_inverse_real_of_posnat) |
15082 | 74 |
done |
75 |
||
76 |
||
77 |
subsection{*LIMSEQ and NSLIMSEQ*} |
|
78 |
||
79 |
lemma LIMSEQ_iff: |
|
15360 | 80 |
"(X ----> L) = (\<forall>r>0. \<exists>no. \<forall>n \<ge> no. \<bar>X n + -L\<bar> < r)" |
15082 | 81 |
by (simp add: LIMSEQ_def) |
82 |
||
83 |
lemma NSLIMSEQ_iff: |
|
84 |
"(X ----NS> L) = (\<forall>N \<in> HNatInfinite. ( *fNat* X) N \<approx> hypreal_of_real L)" |
|
85 |
by (simp add: NSLIMSEQ_def) |
|
86 |
||
87 |
||
88 |
text{*LIMSEQ ==> NSLIMSEQ*} |
|
89 |
||
90 |
lemma LIMSEQ_NSLIMSEQ: |
|
91 |
"X ----> L ==> X ----NS> L" |
|
92 |
apply (simp add: LIMSEQ_def NSLIMSEQ_def) |
|
93 |
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff) |
|
94 |
apply (rule_tac z = N in eq_Abs_hypnat) |
|
95 |
apply (rule approx_minus_iff [THEN iffD2]) |
|
96 |
apply (auto simp add: starfunNat mem_infmal_iff [symmetric] hypreal_of_real_def |
|
97 |
hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff) |
|
98 |
apply (rule bexI [OF _ lemma_hyprel_refl], safe) |
|
99 |
apply (drule_tac x = u in spec, safe) |
|
100 |
apply (drule_tac x = no in spec, fuf) |
|
101 |
apply (blast dest: less_imp_le) |
|
102 |
done |
|
103 |
||
104 |
||
105 |
text{*NSLIMSEQ ==> LIMSEQ*} |
|
106 |
||
107 |
lemma lemma_NSLIMSEQ1: "!!(f::nat=>nat). \<forall>n. n \<le> f n |
|
108 |
==> {n. f n = 0} = {0} | {n. f n = 0} = {}" |
|
109 |
apply auto |
|
110 |
apply (drule_tac x = xa in spec) |
|
111 |
apply (drule_tac [2] x = x in spec, auto) |
|
112 |
done |
|
113 |
||
114 |
lemma lemma_NSLIMSEQ2: "{n. f n \<le> Suc u} = {n. f n \<le> u} Un {n. f n = Suc u}" |
|
115 |
by (auto simp add: le_Suc_eq) |
|
116 |
||
117 |
lemma lemma_NSLIMSEQ3: |
|
118 |
"!!(f::nat=>nat). \<forall>n. n \<le> f n ==> {n. f n = Suc u} \<le> {n. n \<le> Suc u}" |
|
119 |
apply auto |
|
120 |
apply (drule_tac x = x in spec, auto) |
|
121 |
done |
|
122 |
||
123 |
text{* the following sequence @{term "f(n)"} defines a hypernatural *} |
|
124 |
lemma NSLIMSEQ_finite_set: |
|
125 |
"!!(f::nat=>nat). \<forall>n. n \<le> f n ==> finite {n. f n \<le> u}" |
|
126 |
apply (induct u) |
|
127 |
apply (auto simp add: lemma_NSLIMSEQ2) |
|
128 |
apply (auto intro: lemma_NSLIMSEQ3 [THEN finite_subset] finite_atMost [unfolded atMost_def]) |
|
129 |
apply (drule lemma_NSLIMSEQ1, safe) |
|
130 |
apply (simp_all (no_asm_simp)) |
|
131 |
done |
|
132 |
||
133 |
lemma Compl_less_set: "- {n. u < (f::nat=>nat) n} = {n. f n \<le> u}" |
|
134 |
by (auto dest: less_le_trans simp add: le_def) |
|
135 |
||
136 |
text{* the index set is in the free ultrafilter *} |
|
137 |
lemma FreeUltrafilterNat_NSLIMSEQ: |
|
138 |
"!!(f::nat=>nat). \<forall>n. n \<le> f n ==> {n. u < f n} : FreeUltrafilterNat" |
|
139 |
apply (rule FreeUltrafilterNat_Compl_iff2 [THEN iffD2]) |
|
140 |
apply (rule FreeUltrafilterNat_finite) |
|
141 |
apply (auto dest: NSLIMSEQ_finite_set simp add: Compl_less_set) |
|
142 |
done |
|
143 |
||
144 |
text{* thus, the sequence defines an infinite hypernatural! *} |
|
145 |
lemma HNatInfinite_NSLIMSEQ: "\<forall>n. n \<le> f n |
|
146 |
==> Abs_hypnat (hypnatrel `` {f}) : HNatInfinite" |
|
147 |
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff) |
|
148 |
apply (rule bexI [OF _ lemma_hypnatrel_refl], safe) |
|
149 |
apply (erule FreeUltrafilterNat_NSLIMSEQ) |
|
150 |
done |
|
151 |
||
152 |
lemma lemmaLIM: |
|
153 |
"{n. X (f n) + - L = Y n} Int {n. \<bar>Y n\<bar> < r} \<le> |
|
154 |
{n. \<bar>X (f n) + - L\<bar> < r}" |
|
155 |
by auto |
|
156 |
||
157 |
lemma lemmaLIM2: |
|
158 |
"{n. \<bar>X (f n) + - L\<bar> < r} Int {n. r \<le> abs (X (f n) + - (L::real))} = {}" |
|
159 |
by auto |
|
160 |
||
161 |
lemma lemmaLIM3: "[| 0 < r; \<forall>n. r \<le> \<bar>X (f n) + - L\<bar>; |
|
162 |
( *fNat* X) (Abs_hypnat (hypnatrel `` {f})) + |
|
163 |
- hypreal_of_real L \<approx> 0 |] ==> False" |
|
164 |
apply (auto simp add: starfunNat mem_infmal_iff [symmetric] hypreal_of_real_def hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff) |
|
165 |
apply (rename_tac "Y") |
|
166 |
apply (drule_tac x = r in spec, safe) |
|
167 |
apply (drule FreeUltrafilterNat_Int, assumption) |
|
168 |
apply (drule lemmaLIM [THEN [2] FreeUltrafilterNat_subset]) |
|
169 |
apply (drule FreeUltrafilterNat_all) |
|
170 |
apply (erule_tac V = "{n. \<bar>Y n\<bar> < r} : FreeUltrafilterNat" in thin_rl) |
|
171 |
apply (drule FreeUltrafilterNat_Int, assumption) |
|
15539 | 172 |
apply (simp add: lemmaLIM2) |
15082 | 173 |
done |
174 |
||
175 |
lemma NSLIMSEQ_LIMSEQ: "X ----NS> L ==> X ----> L" |
|
176 |
apply (simp add: LIMSEQ_def NSLIMSEQ_def) |
|
177 |
apply (rule ccontr, simp, safe) |
|
178 |
txt{* skolemization step *} |
|
179 |
apply (drule choice, safe) |
|
180 |
apply (drule_tac x = "Abs_hypnat (hypnatrel``{f}) " in bspec) |
|
181 |
apply (drule_tac [2] approx_minus_iff [THEN iffD1]) |
|
182 |
apply (simp_all add: linorder_not_less) |
|
183 |
apply (blast intro: HNatInfinite_NSLIMSEQ) |
|
184 |
apply (blast intro: lemmaLIM3) |
|
185 |
done |
|
186 |
||
187 |
text{* Now, the all-important result is trivially proved! *} |
|
188 |
theorem LIMSEQ_NSLIMSEQ_iff: "(f ----> L) = (f ----NS> L)" |
|
189 |
by (blast intro: LIMSEQ_NSLIMSEQ NSLIMSEQ_LIMSEQ) |
|
190 |
||
191 |
||
192 |
subsection{*Theorems About Sequences*} |
|
193 |
||
194 |
lemma NSLIMSEQ_const: "(%n. k) ----NS> k" |
|
195 |
by (simp add: NSLIMSEQ_def) |
|
196 |
||
197 |
lemma LIMSEQ_const: "(%n. k) ----> k" |
|
198 |
by (simp add: LIMSEQ_def) |
|
199 |
||
200 |
lemma NSLIMSEQ_add: |
|
201 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n + Y n) ----NS> a + b" |
|
202 |
by (auto intro: approx_add simp add: NSLIMSEQ_def starfunNat_add [symmetric]) |
|
203 |
||
204 |
lemma LIMSEQ_add: "[| X ----> a; Y ----> b |] ==> (%n. X n + Y n) ----> a + b" |
|
205 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_add) |
|
206 |
||
207 |
lemma NSLIMSEQ_mult: |
|
208 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n * Y n) ----NS> a * b" |
|
209 |
by (auto intro!: approx_mult_HFinite |
|
15539 | 210 |
simp add: NSLIMSEQ_def starfunNat_mult [symmetric]) |
15082 | 211 |
|
212 |
lemma LIMSEQ_mult: "[| X ----> a; Y ----> b |] ==> (%n. X n * Y n) ----> a * b" |
|
213 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_mult) |
|
214 |
||
215 |
lemma NSLIMSEQ_minus: "X ----NS> a ==> (%n. -(X n)) ----NS> -a" |
|
216 |
by (auto simp add: NSLIMSEQ_def starfunNat_minus [symmetric]) |
|
217 |
||
218 |
lemma LIMSEQ_minus: "X ----> a ==> (%n. -(X n)) ----> -a" |
|
219 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_minus) |
|
220 |
||
221 |
lemma LIMSEQ_minus_cancel: "(%n. -(X n)) ----> -a ==> X ----> a" |
|
222 |
by (drule LIMSEQ_minus, simp) |
|
223 |
||
224 |
lemma NSLIMSEQ_minus_cancel: "(%n. -(X n)) ----NS> -a ==> X ----NS> a" |
|
225 |
by (drule NSLIMSEQ_minus, simp) |
|
226 |
||
227 |
lemma NSLIMSEQ_add_minus: |
|
228 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n + -Y n) ----NS> a + -b" |
|
229 |
by (simp add: NSLIMSEQ_add NSLIMSEQ_minus [of Y]) |
|
230 |
||
231 |
lemma LIMSEQ_add_minus: |
|
232 |
"[| X ----> a; Y ----> b |] ==> (%n. X n + -Y n) ----> a + -b" |
|
233 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_add_minus) |
|
234 |
||
235 |
lemma LIMSEQ_diff: "[| X ----> a; Y ----> b |] ==> (%n. X n - Y n) ----> a - b" |
|
236 |
apply (simp add: diff_minus) |
|
237 |
apply (blast intro: LIMSEQ_add_minus) |
|
238 |
done |
|
239 |
||
240 |
lemma NSLIMSEQ_diff: |
|
241 |
"[| X ----NS> a; Y ----NS> b |] ==> (%n. X n - Y n) ----NS> a - b" |
|
242 |
apply (simp add: diff_minus) |
|
243 |
apply (blast intro: NSLIMSEQ_add_minus) |
|
244 |
done |
|
245 |
||
246 |
text{*Proof is like that of @{text NSLIM_inverse}.*} |
|
247 |
lemma NSLIMSEQ_inverse: |
|
248 |
"[| X ----NS> a; a ~= 0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)" |
|
249 |
by (simp add: NSLIMSEQ_def starfunNat_inverse [symmetric] |
|
250 |
hypreal_of_real_approx_inverse) |
|
251 |
||
252 |
||
253 |
text{*Standard version of theorem*} |
|
254 |
lemma LIMSEQ_inverse: |
|
255 |
"[| X ----> a; a ~= 0 |] ==> (%n. inverse(X n)) ----> inverse(a)" |
|
256 |
by (simp add: NSLIMSEQ_inverse LIMSEQ_NSLIMSEQ_iff) |
|
257 |
||
258 |
lemma NSLIMSEQ_mult_inverse: |
|
259 |
"[| X ----NS> a; Y ----NS> b; b ~= 0 |] ==> (%n. X n / Y n) ----NS> a/b" |
|
260 |
by (simp add: NSLIMSEQ_mult NSLIMSEQ_inverse divide_inverse) |
|
261 |
||
262 |
lemma LIMSEQ_divide: |
|
263 |
"[| X ----> a; Y ----> b; b ~= 0 |] ==> (%n. X n / Y n) ----> a/b" |
|
264 |
by (simp add: LIMSEQ_mult LIMSEQ_inverse divide_inverse) |
|
265 |
||
266 |
text{*Uniqueness of limit*} |
|
267 |
lemma NSLIMSEQ_unique: "[| X ----NS> a; X ----NS> b |] ==> a = b" |
|
268 |
apply (simp add: NSLIMSEQ_def) |
|
269 |
apply (drule HNatInfinite_whn [THEN [2] bspec])+ |
|
270 |
apply (auto dest: approx_trans3) |
|
271 |
done |
|
272 |
||
273 |
lemma LIMSEQ_unique: "[| X ----> a; X ----> b |] ==> a = b" |
|
274 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_unique) |
|
275 |
||
15312 | 276 |
lemma LIMSEQ_setsum: |
277 |
assumes n: "\<And>n. n \<in> S \<Longrightarrow> X n ----> L n" |
|
278 |
shows "(\<lambda>m. \<Sum>n\<in>S. X n m) ----> (\<Sum>n\<in>S. L n)" |
|
279 |
proof (cases "finite S") |
|
280 |
case True |
|
281 |
thus ?thesis using n |
|
282 |
proof (induct) |
|
283 |
case empty |
|
284 |
show ?case |
|
285 |
by (simp add: LIMSEQ_const) |
|
286 |
next |
|
287 |
case insert |
|
288 |
thus ?case |
|
289 |
by (simp add: LIMSEQ_add) |
|
290 |
qed |
|
291 |
next |
|
292 |
case False |
|
293 |
thus ?thesis |
|
294 |
by (simp add: setsum_def LIMSEQ_const) |
|
295 |
qed |
|
296 |
||
15082 | 297 |
|
298 |
subsection{*Nslim and Lim*} |
|
299 |
||
300 |
lemma limI: "X ----> L ==> lim X = L" |
|
301 |
apply (simp add: lim_def) |
|
302 |
apply (blast intro: LIMSEQ_unique) |
|
303 |
done |
|
304 |
||
305 |
lemma nslimI: "X ----NS> L ==> nslim X = L" |
|
306 |
apply (simp add: nslim_def) |
|
307 |
apply (blast intro: NSLIMSEQ_unique) |
|
308 |
done |
|
309 |
||
310 |
lemma lim_nslim_iff: "lim X = nslim X" |
|
311 |
by (simp add: lim_def nslim_def LIMSEQ_NSLIMSEQ_iff) |
|
312 |
||
313 |
||
314 |
subsection{*Convergence*} |
|
315 |
||
316 |
lemma convergentD: "convergent X ==> \<exists>L. (X ----> L)" |
|
317 |
by (simp add: convergent_def) |
|
318 |
||
319 |
lemma convergentI: "(X ----> L) ==> convergent X" |
|
320 |
by (auto simp add: convergent_def) |
|
321 |
||
322 |
lemma NSconvergentD: "NSconvergent X ==> \<exists>L. (X ----NS> L)" |
|
323 |
by (simp add: NSconvergent_def) |
|
324 |
||
325 |
lemma NSconvergentI: "(X ----NS> L) ==> NSconvergent X" |
|
326 |
by (auto simp add: NSconvergent_def) |
|
327 |
||
328 |
lemma convergent_NSconvergent_iff: "convergent X = NSconvergent X" |
|
329 |
by (simp add: convergent_def NSconvergent_def LIMSEQ_NSLIMSEQ_iff) |
|
330 |
||
331 |
lemma NSconvergent_NSLIMSEQ_iff: "NSconvergent X = (X ----NS> nslim X)" |
|
332 |
by (auto intro: someI simp add: NSconvergent_def nslim_def) |
|
333 |
||
334 |
lemma convergent_LIMSEQ_iff: "convergent X = (X ----> lim X)" |
|
335 |
by (auto intro: someI simp add: convergent_def lim_def) |
|
336 |
||
337 |
text{*Subsequence (alternative definition, (e.g. Hoskins)*} |
|
338 |
||
339 |
lemma subseq_Suc_iff: "subseq f = (\<forall>n. (f n) < (f (Suc n)))" |
|
340 |
apply (simp add: subseq_def) |
|
341 |
apply (auto dest!: less_imp_Suc_add) |
|
342 |
apply (induct_tac k) |
|
343 |
apply (auto intro: less_trans) |
|
344 |
done |
|
345 |
||
346 |
||
347 |
subsection{*Monotonicity*} |
|
348 |
||
349 |
lemma monoseq_Suc: |
|
350 |
"monoseq X = ((\<forall>n. X n \<le> X (Suc n)) |
|
351 |
| (\<forall>n. X (Suc n) \<le> X n))" |
|
352 |
apply (simp add: monoseq_def) |
|
353 |
apply (auto dest!: le_imp_less_or_eq) |
|
354 |
apply (auto intro!: lessI [THEN less_imp_le] dest!: less_imp_Suc_add) |
|
355 |
apply (induct_tac "ka") |
|
356 |
apply (auto intro: order_trans) |
|
357 |
apply (erule swap) |
|
358 |
apply (induct_tac "k") |
|
359 |
apply (auto intro: order_trans) |
|
360 |
done |
|
361 |
||
15360 | 362 |
lemma monoI1: "\<forall>m. \<forall> n \<ge> m. X m \<le> X n ==> monoseq X" |
15082 | 363 |
by (simp add: monoseq_def) |
364 |
||
15360 | 365 |
lemma monoI2: "\<forall>m. \<forall> n \<ge> m. X n \<le> X m ==> monoseq X" |
15082 | 366 |
by (simp add: monoseq_def) |
367 |
||
368 |
lemma mono_SucI1: "\<forall>n. X n \<le> X (Suc n) ==> monoseq X" |
|
369 |
by (simp add: monoseq_Suc) |
|
370 |
||
371 |
lemma mono_SucI2: "\<forall>n. X (Suc n) \<le> X n ==> monoseq X" |
|
372 |
by (simp add: monoseq_Suc) |
|
373 |
||
374 |
||
375 |
subsection{*Bounded Sequence*} |
|
376 |
||
377 |
lemma BseqD: "Bseq X ==> \<exists>K. 0 < K & (\<forall>n. \<bar>X n\<bar> \<le> K)" |
|
378 |
by (simp add: Bseq_def) |
|
379 |
||
380 |
lemma BseqI: "[| 0 < K; \<forall>n. \<bar>X n\<bar> \<le> K |] ==> Bseq X" |
|
381 |
by (auto simp add: Bseq_def) |
|
382 |
||
383 |
lemma lemma_NBseq_def: |
|
15360 | 384 |
"(\<exists>K > 0. \<forall>n. \<bar>X n\<bar> \<le> K) = |
15082 | 385 |
(\<exists>N. \<forall>n. \<bar>X n\<bar> \<le> real(Suc N))" |
386 |
apply auto |
|
387 |
prefer 2 apply force |
|
388 |
apply (cut_tac x = K in reals_Archimedean2, clarify) |
|
389 |
apply (rule_tac x = n in exI, clarify) |
|
390 |
apply (drule_tac x = na in spec) |
|
391 |
apply (auto simp add: real_of_nat_Suc) |
|
392 |
done |
|
393 |
||
394 |
text{* alternative definition for Bseq *} |
|
395 |
lemma Bseq_iff: "Bseq X = (\<exists>N. \<forall>n. \<bar>X n\<bar> \<le> real(Suc N))" |
|
396 |
apply (simp add: Bseq_def) |
|
397 |
apply (simp (no_asm) add: lemma_NBseq_def) |
|
398 |
done |
|
399 |
||
400 |
lemma lemma_NBseq_def2: |
|
15360 | 401 |
"(\<exists>K > 0. \<forall>n. \<bar>X n\<bar> \<le> K) = (\<exists>N. \<forall>n. \<bar>X n\<bar> < real(Suc N))" |
15082 | 402 |
apply (subst lemma_NBseq_def, auto) |
403 |
apply (rule_tac x = "Suc N" in exI) |
|
404 |
apply (rule_tac [2] x = N in exI) |
|
405 |
apply (auto simp add: real_of_nat_Suc) |
|
406 |
prefer 2 apply (blast intro: order_less_imp_le) |
|
407 |
apply (drule_tac x = n in spec, simp) |
|
408 |
done |
|
409 |
||
410 |
(* yet another definition for Bseq *) |
|
411 |
lemma Bseq_iff1a: "Bseq X = (\<exists>N. \<forall>n. \<bar>X n\<bar> < real(Suc N))" |
|
412 |
by (simp add: Bseq_def lemma_NBseq_def2) |
|
413 |
||
414 |
lemma NSBseqD: "[| NSBseq X; N: HNatInfinite |] ==> ( *fNat* X) N : HFinite" |
|
415 |
by (simp add: NSBseq_def) |
|
416 |
||
417 |
lemma NSBseqI: "\<forall>N \<in> HNatInfinite. ( *fNat* X) N : HFinite ==> NSBseq X" |
|
418 |
by (simp add: NSBseq_def) |
|
419 |
||
420 |
text{*The standard definition implies the nonstandard definition*} |
|
421 |
||
422 |
lemma lemma_Bseq: "\<forall>n. \<bar>X n\<bar> \<le> K ==> \<forall>n. abs(X((f::nat=>nat) n)) \<le> K" |
|
423 |
by auto |
|
424 |
||
425 |
lemma Bseq_NSBseq: "Bseq X ==> NSBseq X" |
|
426 |
apply (simp add: Bseq_def NSBseq_def, safe) |
|
427 |
apply (rule_tac z = N in eq_Abs_hypnat) |
|
428 |
apply (auto simp add: starfunNat HFinite_FreeUltrafilterNat_iff |
|
429 |
HNatInfinite_FreeUltrafilterNat_iff) |
|
430 |
apply (rule bexI [OF _ lemma_hyprel_refl]) |
|
431 |
apply (drule_tac f = Xa in lemma_Bseq) |
|
432 |
apply (rule_tac x = "K+1" in exI) |
|
433 |
apply (drule_tac P="%n. ?f n \<le> K" in FreeUltrafilterNat_all, ultra) |
|
434 |
done |
|
435 |
||
436 |
text{*The nonstandard definition implies the standard definition*} |
|
437 |
||
438 |
(* similar to NSLIM proof in REALTOPOS *) |
|
439 |
||
440 |
text{* We need to get rid of the real variable and do so by proving the |
|
441 |
following, which relies on the Archimedean property of the reals. |
|
442 |
When we skolemize we then get the required function @{term "f::nat=>nat"}. |
|
443 |
Otherwise, we would be stuck with a skolem function @{term "f::real=>nat"} |
|
444 |
which woulid be useless.*} |
|
445 |
||
446 |
lemma lemmaNSBseq: |
|
15360 | 447 |
"\<forall>K > 0. \<exists>n. K < \<bar>X n\<bar> |
15082 | 448 |
==> \<forall>N. \<exists>n. real(Suc N) < \<bar>X n\<bar>" |
449 |
apply safe |
|
450 |
apply (cut_tac n = N in real_of_nat_Suc_gt_zero, blast) |
|
451 |
done |
|
452 |
||
15360 | 453 |
lemma lemmaNSBseq2: "\<forall>K > 0. \<exists>n. K < \<bar>X n\<bar> |
15082 | 454 |
==> \<exists>f. \<forall>N. real(Suc N) < \<bar>X (f N)\<bar>" |
455 |
apply (drule lemmaNSBseq) |
|
456 |
apply (drule choice, blast) |
|
457 |
done |
|
458 |
||
459 |
lemma real_seq_to_hypreal_HInfinite: |
|
460 |
"\<forall>N. real(Suc N) < \<bar>X (f N)\<bar> |
|
461 |
==> Abs_hypreal(hyprel``{X o f}) : HInfinite" |
|
462 |
apply (auto simp add: HInfinite_FreeUltrafilterNat_iff o_def) |
|
463 |
apply (rule bexI [OF _ lemma_hyprel_refl], clarify) |
|
464 |
apply (cut_tac u = u in FreeUltrafilterNat_nat_gt_real) |
|
465 |
apply (drule FreeUltrafilterNat_all) |
|
466 |
apply (erule FreeUltrafilterNat_Int [THEN FreeUltrafilterNat_subset]) |
|
467 |
apply (auto simp add: real_of_nat_Suc) |
|
468 |
done |
|
469 |
||
470 |
text{* Now prove that we can get out an infinite hypernatural as well |
|
471 |
defined using the skolem function @{term "f::nat=>nat"} above*} |
|
472 |
||
473 |
lemma lemma_finite_NSBseq: |
|
474 |
"{n. f n \<le> Suc u & real(Suc n) < \<bar>X (f n)\<bar>} \<le> |
|
475 |
{n. f n \<le> u & real(Suc n) < \<bar>X (f n)\<bar>} Un |
|
476 |
{n. real(Suc n) < \<bar>X (Suc u)\<bar>}" |
|
477 |
by (auto dest!: le_imp_less_or_eq) |
|
478 |
||
479 |
lemma lemma_finite_NSBseq2: |
|
480 |
"finite {n. f n \<le> (u::nat) & real(Suc n) < \<bar>X(f n)\<bar>}" |
|
15251 | 481 |
apply (induct "u") |
15082 | 482 |
apply (rule_tac [2] lemma_finite_NSBseq [THEN finite_subset]) |
483 |
apply (rule_tac B = "{n. real (Suc n) < \<bar>X 0\<bar> }" in finite_subset) |
|
484 |
apply (auto intro: finite_real_of_nat_less_real |
|
485 |
simp add: real_of_nat_Suc less_diff_eq [symmetric]) |
|
486 |
done |
|
487 |
||
488 |
lemma HNatInfinite_skolem_f: |
|
489 |
"\<forall>N. real(Suc N) < \<bar>X (f N)\<bar> |
|
490 |
==> Abs_hypnat(hypnatrel``{f}) : HNatInfinite" |
|
491 |
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff) |
|
492 |
apply (rule bexI [OF _ lemma_hypnatrel_refl], safe) |
|
493 |
apply (rule ccontr, drule FreeUltrafilterNat_Compl_mem) |
|
494 |
apply (rule lemma_finite_NSBseq2 [THEN FreeUltrafilterNat_finite, THEN notE]) |
|
495 |
apply (subgoal_tac "{n. f n \<le> u & real (Suc n) < \<bar>X (f n)\<bar>} = |
|
496 |
{n. f n \<le> u} \<inter> {N. real (Suc N) < \<bar>X (f N)\<bar>}") |
|
497 |
apply (erule ssubst) |
|
498 |
apply (auto simp add: linorder_not_less Compl_def) |
|
499 |
done |
|
500 |
||
501 |
lemma NSBseq_Bseq: "NSBseq X ==> Bseq X" |
|
502 |
apply (simp add: Bseq_def NSBseq_def) |
|
503 |
apply (rule ccontr) |
|
504 |
apply (auto simp add: linorder_not_less [symmetric]) |
|
505 |
apply (drule lemmaNSBseq2, safe) |
|
506 |
apply (frule_tac X = X and f = f in real_seq_to_hypreal_HInfinite) |
|
507 |
apply (drule HNatInfinite_skolem_f [THEN [2] bspec]) |
|
508 |
apply (auto simp add: starfunNat o_def HFinite_HInfinite_iff) |
|
509 |
done |
|
510 |
||
511 |
text{* Equivalence of nonstandard and standard definitions |
|
512 |
for a bounded sequence*} |
|
513 |
lemma Bseq_NSBseq_iff: "(Bseq X) = (NSBseq X)" |
|
514 |
by (blast intro!: NSBseq_Bseq Bseq_NSBseq) |
|
515 |
||
516 |
text{*A convergent sequence is bounded: |
|
517 |
Boundedness as a necessary condition for convergence. |
|
518 |
The nonstandard version has no existential, as usual *} |
|
519 |
||
520 |
lemma NSconvergent_NSBseq: "NSconvergent X ==> NSBseq X" |
|
521 |
apply (simp add: NSconvergent_def NSBseq_def NSLIMSEQ_def) |
|
522 |
apply (blast intro: HFinite_hypreal_of_real approx_sym approx_HFinite) |
|
523 |
done |
|
524 |
||
525 |
text{*Standard Version: easily now proved using equivalence of NS and |
|
526 |
standard definitions *} |
|
527 |
lemma convergent_Bseq: "convergent X ==> Bseq X" |
|
528 |
by (simp add: NSconvergent_NSBseq convergent_NSconvergent_iff Bseq_NSBseq_iff) |
|
529 |
||
530 |
||
531 |
subsection{*Upper Bounds and Lubs of Bounded Sequences*} |
|
532 |
||
533 |
lemma Bseq_isUb: |
|
534 |
"!!(X::nat=>real). Bseq X ==> \<exists>U. isUb (UNIV::real set) {x. \<exists>n. X n = x} U" |
|
535 |
by (auto intro: isUbI setleI simp add: Bseq_def abs_le_interval_iff) |
|
536 |
||
537 |
||
538 |
text{* Use completeness of reals (supremum property) |
|
539 |
to show that any bounded sequence has a least upper bound*} |
|
540 |
||
541 |
lemma Bseq_isLub: |
|
542 |
"!!(X::nat=>real). Bseq X ==> |
|
543 |
\<exists>U. isLub (UNIV::real set) {x. \<exists>n. X n = x} U" |
|
544 |
by (blast intro: reals_complete Bseq_isUb) |
|
545 |
||
546 |
lemma NSBseq_isUb: "NSBseq X ==> \<exists>U. isUb UNIV {x. \<exists>n. X n = x} U" |
|
547 |
by (simp add: Bseq_NSBseq_iff [symmetric] Bseq_isUb) |
|
548 |
||
549 |
lemma NSBseq_isLub: "NSBseq X ==> \<exists>U. isLub UNIV {x. \<exists>n. X n = x} U" |
|
550 |
by (simp add: Bseq_NSBseq_iff [symmetric] Bseq_isLub) |
|
551 |
||
552 |
||
553 |
subsection{*A Bounded and Monotonic Sequence Converges*} |
|
554 |
||
555 |
lemma lemma_converg1: |
|
15360 | 556 |
"!!(X::nat=>real). [| \<forall>m. \<forall> n \<ge> m. X m \<le> X n; |
15082 | 557 |
isLub (UNIV::real set) {x. \<exists>n. X n = x} (X ma) |
15360 | 558 |
|] ==> \<forall>n \<ge> ma. X n = X ma" |
15082 | 559 |
apply safe |
560 |
apply (drule_tac y = "X n" in isLubD2) |
|
561 |
apply (blast dest: order_antisym)+ |
|
562 |
done |
|
563 |
||
564 |
text{* The best of both worlds: Easier to prove this result as a standard |
|
565 |
theorem and then use equivalence to "transfer" it into the |
|
566 |
equivalent nonstandard form if needed!*} |
|
567 |
||
568 |
lemma Bmonoseq_LIMSEQ: "\<forall>n. m \<le> n --> X n = X m ==> \<exists>L. (X ----> L)" |
|
569 |
apply (simp add: LIMSEQ_def) |
|
570 |
apply (rule_tac x = "X m" in exI, safe) |
|
571 |
apply (rule_tac x = m in exI, safe) |
|
572 |
apply (drule spec, erule impE, auto) |
|
573 |
done |
|
574 |
||
575 |
text{*Now, the same theorem in terms of NS limit *} |
|
15360 | 576 |
lemma Bmonoseq_NSLIMSEQ: "\<forall>n \<ge> m. X n = X m ==> \<exists>L. (X ----NS> L)" |
15082 | 577 |
by (auto dest!: Bmonoseq_LIMSEQ simp add: LIMSEQ_NSLIMSEQ_iff) |
578 |
||
579 |
lemma lemma_converg2: |
|
580 |
"!!(X::nat=>real). |
|
581 |
[| \<forall>m. X m ~= U; isLub UNIV {x. \<exists>n. X n = x} U |] ==> \<forall>m. X m < U" |
|
582 |
apply safe |
|
583 |
apply (drule_tac y = "X m" in isLubD2) |
|
584 |
apply (auto dest!: order_le_imp_less_or_eq) |
|
585 |
done |
|
586 |
||
587 |
lemma lemma_converg3: "!!(X ::nat=>real). \<forall>m. X m \<le> U ==> isUb UNIV {x. \<exists>n. X n = x} U" |
|
588 |
by (rule setleI [THEN isUbI], auto) |
|
589 |
||
590 |
text{* FIXME: @{term "U - T < U"} is redundant *} |
|
591 |
lemma lemma_converg4: "!!(X::nat=> real). |
|
592 |
[| \<forall>m. X m ~= U; |
|
593 |
isLub UNIV {x. \<exists>n. X n = x} U; |
|
594 |
0 < T; |
|
595 |
U + - T < U |
|
596 |
|] ==> \<exists>m. U + -T < X m & X m < U" |
|
597 |
apply (drule lemma_converg2, assumption) |
|
598 |
apply (rule ccontr, simp) |
|
599 |
apply (simp add: linorder_not_less) |
|
600 |
apply (drule lemma_converg3) |
|
601 |
apply (drule isLub_le_isUb, assumption) |
|
602 |
apply (auto dest: order_less_le_trans) |
|
603 |
done |
|
604 |
||
605 |
text{*A standard proof of the theorem for monotone increasing sequence*} |
|
606 |
||
607 |
lemma Bseq_mono_convergent: |
|
15360 | 608 |
"[| Bseq X; \<forall>m. \<forall>n \<ge> m. X m \<le> X n |] ==> convergent X" |
15082 | 609 |
apply (simp add: convergent_def) |
610 |
apply (frule Bseq_isLub, safe) |
|
611 |
apply (case_tac "\<exists>m. X m = U", auto) |
|
612 |
apply (blast dest: lemma_converg1 Bmonoseq_LIMSEQ) |
|
613 |
(* second case *) |
|
614 |
apply (rule_tac x = U in exI) |
|
615 |
apply (subst LIMSEQ_iff, safe) |
|
616 |
apply (frule lemma_converg2, assumption) |
|
617 |
apply (drule lemma_converg4, auto) |
|
618 |
apply (rule_tac x = m in exI, safe) |
|
619 |
apply (subgoal_tac "X m \<le> X n") |
|
620 |
prefer 2 apply blast |
|
621 |
apply (drule_tac x=n and P="%m. X m < U" in spec, arith) |
|
622 |
done |
|
623 |
||
624 |
text{*Nonstandard version of the theorem*} |
|
625 |
||
626 |
lemma NSBseq_mono_NSconvergent: |
|
15360 | 627 |
"[| NSBseq X; \<forall>m. \<forall>n \<ge> m. X m \<le> X n |] ==> NSconvergent X" |
15082 | 628 |
by (auto intro: Bseq_mono_convergent |
629 |
simp add: convergent_NSconvergent_iff [symmetric] |
|
630 |
Bseq_NSBseq_iff [symmetric]) |
|
631 |
||
632 |
lemma convergent_minus_iff: "(convergent X) = (convergent (%n. -(X n)))" |
|
633 |
apply (simp add: convergent_def) |
|
634 |
apply (auto dest: LIMSEQ_minus) |
|
635 |
apply (drule LIMSEQ_minus, auto) |
|
636 |
done |
|
637 |
||
638 |
lemma Bseq_minus_iff: "Bseq (%n. -(X n)) = Bseq X" |
|
639 |
by (simp add: Bseq_def) |
|
640 |
||
641 |
text{*Main monotonicity theorem*} |
|
642 |
lemma Bseq_monoseq_convergent: "[| Bseq X; monoseq X |] ==> convergent X" |
|
643 |
apply (simp add: monoseq_def, safe) |
|
644 |
apply (rule_tac [2] convergent_minus_iff [THEN ssubst]) |
|
645 |
apply (drule_tac [2] Bseq_minus_iff [THEN ssubst]) |
|
646 |
apply (auto intro!: Bseq_mono_convergent) |
|
647 |
done |
|
648 |
||
649 |
||
650 |
subsection{*A Few More Equivalence Theorems for Boundedness*} |
|
651 |
||
652 |
text{*alternative formulation for boundedness*} |
|
15360 | 653 |
lemma Bseq_iff2: "Bseq X = (\<exists>k > 0. \<exists>x. \<forall>n. \<bar>X(n) + -x\<bar> \<le> k)" |
15082 | 654 |
apply (unfold Bseq_def, safe) |
655 |
apply (rule_tac [2] x = "k + \<bar>x\<bar> " in exI) |
|
15360 | 656 |
apply (rule_tac x = K in exI, simp) |
15221 | 657 |
apply (rule exI [where x = 0], auto) |
658 |
apply (drule_tac x=n in spec, arith)+ |
|
15082 | 659 |
done |
660 |
||
661 |
text{*alternative formulation for boundedness*} |
|
15360 | 662 |
lemma Bseq_iff3: "Bseq X = (\<exists>k > 0. \<exists>N. \<forall>n. abs(X(n) + -X(N)) \<le> k)" |
15082 | 663 |
apply safe |
664 |
apply (simp add: Bseq_def, safe) |
|
665 |
apply (rule_tac x = "K + \<bar>X N\<bar> " in exI) |
|
666 |
apply auto |
|
667 |
apply arith |
|
668 |
apply (rule_tac x = N in exI, safe) |
|
669 |
apply (drule_tac x = n in spec, arith) |
|
670 |
apply (auto simp add: Bseq_iff2) |
|
671 |
done |
|
672 |
||
673 |
lemma BseqI2: "(\<forall>n. k \<le> f n & f n \<le> K) ==> Bseq f" |
|
674 |
apply (simp add: Bseq_def) |
|
15221 | 675 |
apply (rule_tac x = " (\<bar>k\<bar> + \<bar>K\<bar>) + 1" in exI, auto) |
15082 | 676 |
apply (drule_tac [2] x = n in spec, arith+) |
677 |
done |
|
678 |
||
679 |
||
680 |
subsection{*Equivalence Between NS and Standard Cauchy Sequences*} |
|
681 |
||
682 |
subsubsection{*Standard Implies Nonstandard*} |
|
683 |
||
684 |
lemma lemmaCauchy1: |
|
685 |
"Abs_hypnat (hypnatrel `` {x}) : HNatInfinite |
|
686 |
==> {n. M \<le> x n} : FreeUltrafilterNat" |
|
687 |
apply (auto simp add: HNatInfinite_FreeUltrafilterNat_iff) |
|
688 |
apply (drule_tac x = M in spec, ultra) |
|
689 |
done |
|
690 |
||
691 |
lemma lemmaCauchy2: |
|
692 |
"{n. \<forall>m n. M \<le> m & M \<le> (n::nat) --> \<bar>X m + - X n\<bar> < u} Int |
|
693 |
{n. M \<le> xa n} Int {n. M \<le> x n} \<le> |
|
694 |
{n. abs (X (xa n) + - X (x n)) < u}" |
|
695 |
by blast |
|
696 |
||
697 |
lemma Cauchy_NSCauchy: "Cauchy X ==> NSCauchy X" |
|
698 |
apply (simp add: Cauchy_def NSCauchy_def, safe) |
|
699 |
apply (rule_tac z = M in eq_Abs_hypnat) |
|
700 |
apply (rule_tac z = N in eq_Abs_hypnat) |
|
701 |
apply (rule approx_minus_iff [THEN iffD2]) |
|
702 |
apply (rule mem_infmal_iff [THEN iffD1]) |
|
703 |
apply (auto simp add: starfunNat hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff) |
|
704 |
apply (rule bexI, auto) |
|
705 |
apply (drule spec, auto) |
|
706 |
apply (drule_tac M = M in lemmaCauchy1) |
|
707 |
apply (drule_tac M = M in lemmaCauchy1) |
|
708 |
apply (rule_tac x1 = xa in lemmaCauchy2 [THEN [2] FreeUltrafilterNat_subset]) |
|
709 |
apply (rule FreeUltrafilterNat_Int) |
|
15539 | 710 |
apply (auto intro: FreeUltrafilterNat_Int) |
15082 | 711 |
done |
712 |
||
713 |
subsubsection{*Nonstandard Implies Standard*} |
|
714 |
||
715 |
lemma NSCauchy_Cauchy: "NSCauchy X ==> Cauchy X" |
|
716 |
apply (auto simp add: Cauchy_def NSCauchy_def) |
|
717 |
apply (rule ccontr, simp) |
|
718 |
apply (auto dest!: choice HNatInfinite_NSLIMSEQ simp add: all_conj_distrib) |
|
719 |
apply (drule bspec, assumption) |
|
720 |
apply (drule_tac x = "Abs_hypnat (hypnatrel `` {fa}) " in bspec); |
|
721 |
apply (auto simp add: starfunNat) |
|
722 |
apply (drule approx_minus_iff [THEN iffD1]) |
|
723 |
apply (drule mem_infmal_iff [THEN iffD2]) |
|
724 |
apply (auto simp add: hypreal_minus hypreal_add Infinitesimal_FreeUltrafilterNat_iff) |
|
725 |
apply (rename_tac "Y") |
|
726 |
apply (drule_tac x = e in spec, auto) |
|
727 |
apply (drule FreeUltrafilterNat_Int, assumption) |
|
728 |
apply (subgoal_tac "{n. \<bar>X (f n) + - X (fa n)\<bar> < e} \<in> \<U>") |
|
729 |
prefer 2 apply (erule FreeUltrafilterNat_subset, force) |
|
730 |
apply (rule FreeUltrafilterNat_empty [THEN notE]) |
|
731 |
apply (subgoal_tac |
|
732 |
"{n. abs (X (f n) + - X (fa n)) < e} Int |
|
733 |
{M. ~ abs (X (f M) + - X (fa M)) < e} = {}") |
|
734 |
apply auto |
|
735 |
done |
|
736 |
||
737 |
||
738 |
theorem NSCauchy_Cauchy_iff: "NSCauchy X = Cauchy X" |
|
739 |
by (blast intro!: NSCauchy_Cauchy Cauchy_NSCauchy) |
|
740 |
||
741 |
text{*A Cauchy sequence is bounded -- this is the standard |
|
742 |
proof mechanization rather than the nonstandard proof*} |
|
743 |
||
15360 | 744 |
lemma lemmaCauchy: "\<forall>n \<ge> M. \<bar>X M + - X n\<bar> < (1::real) |
745 |
==> \<forall>n \<ge> M. \<bar>X n\<bar> < 1 + \<bar>X M\<bar>" |
|
15082 | 746 |
apply safe |
747 |
apply (drule spec, auto, arith) |
|
748 |
done |
|
749 |
||
750 |
lemma less_Suc_cancel_iff: "(n < Suc M) = (n \<le> M)" |
|
751 |
by auto |
|
752 |
||
753 |
text{* FIXME: Long. Maximal element in subsequence *} |
|
754 |
lemma SUP_rabs_subseq: |
|
15360 | 755 |
"\<exists>m \<le> M. \<forall>n \<le> M. \<bar>(X::nat=> real) n\<bar> \<le> \<bar>X m\<bar>" |
15082 | 756 |
apply (induct M) |
757 |
apply (rule_tac x = 0 in exI, simp, safe) |
|
15236
f289e8ba2bb3
Proofs needed to be updated because induction now preserves name of
nipkow
parents:
15229
diff
changeset
|
758 |
apply (cut_tac x = "\<bar>X (Suc M)\<bar>" and y = "\<bar>X m\<bar> " in linorder_less_linear) |
15082 | 759 |
apply safe |
760 |
apply (rule_tac x = m in exI) |
|
761 |
apply (rule_tac [2] x = m in exI) |
|
15236
f289e8ba2bb3
Proofs needed to be updated because induction now preserves name of
nipkow
parents:
15229
diff
changeset
|
762 |
apply (rule_tac [3] x = "Suc M" in exI, simp_all, safe) |
f289e8ba2bb3
Proofs needed to be updated because induction now preserves name of
nipkow
parents:
15229
diff
changeset
|
763 |
apply (erule_tac [!] m1 = n in le_imp_less_or_eq [THEN disjE]) |
15082 | 764 |
apply (simp_all add: less_Suc_cancel_iff) |
765 |
apply (blast intro: order_le_less_trans [THEN order_less_imp_le]) |
|
766 |
done |
|
767 |
||
768 |
lemma lemma_Nat_covered: |
|
769 |
"[| \<forall>m::nat. m \<le> M --> P M m; |
|
15360 | 770 |
\<forall>m \<ge> M. P M m |] |
15082 | 771 |
==> \<forall>m. P M m" |
772 |
by (auto elim: less_asym simp add: le_def) |
|
773 |
||
774 |
||
775 |
lemma lemma_trans1: |
|
15360 | 776 |
"[| \<forall>n \<le> M. \<bar>(X::nat=>real) n\<bar> \<le> a; a < b |] |
777 |
==> \<forall>n \<le> M. \<bar>X n\<bar> \<le> b" |
|
15082 | 778 |
by (blast intro: order_le_less_trans [THEN order_less_imp_le]) |
779 |
||
780 |
lemma lemma_trans2: |
|
15360 | 781 |
"[| \<forall>n \<ge> M. \<bar>(X::nat=>real) n\<bar> < a; a < b |] |
782 |
==> \<forall>n \<ge> M. \<bar>X n\<bar>\<le> b" |
|
15082 | 783 |
by (blast intro: order_less_trans [THEN order_less_imp_le]) |
784 |
||
785 |
lemma lemma_trans3: |
|
15360 | 786 |
"[| \<forall>n \<le> M. \<bar>X n\<bar> \<le> a; a = b |] |
787 |
==> \<forall>n \<le> M. \<bar>X n\<bar> \<le> b" |
|
15082 | 788 |
by auto |
789 |
||
15360 | 790 |
lemma lemma_trans4: "\<forall>n \<ge> M. \<bar>(X::nat=>real) n\<bar> < a |
791 |
==> \<forall>n \<ge> M. \<bar>X n\<bar> \<le> a" |
|
15082 | 792 |
by (blast intro: order_less_imp_le) |
793 |
||
794 |
||
795 |
text{*Proof is more involved than outlines sketched by various authors |
|
796 |
would suggest*} |
|
797 |
||
798 |
lemma Cauchy_Bseq: "Cauchy X ==> Bseq X" |
|
799 |
apply (simp add: Cauchy_def Bseq_def) |
|
800 |
apply (drule_tac x = 1 in spec) |
|
801 |
apply (erule zero_less_one [THEN [2] impE], safe) |
|
802 |
apply (drule_tac x = M in spec, simp) |
|
803 |
apply (drule lemmaCauchy) |
|
804 |
apply (cut_tac M = M and X = X in SUP_rabs_subseq, safe) |
|
805 |
apply (cut_tac x = "\<bar>X m\<bar> " and y = "1 + \<bar>X M\<bar> " in linorder_less_linear) |
|
806 |
apply safe |
|
807 |
apply (drule lemma_trans1, assumption) |
|
808 |
apply (drule_tac [3] lemma_trans2, erule_tac [3] asm_rl) |
|
809 |
apply (drule_tac [2] lemma_trans3, erule_tac [2] asm_rl) |
|
810 |
apply (drule_tac [3] abs_add_one_gt_zero [THEN order_less_trans]) |
|
811 |
apply (drule lemma_trans4) |
|
812 |
apply (drule_tac [2] lemma_trans4) |
|
813 |
apply (rule_tac x = "1 + \<bar>X M\<bar> " in exI) |
|
814 |
apply (rule_tac [2] x = "1 + \<bar>X M\<bar> " in exI) |
|
815 |
apply (rule_tac [3] x = "\<bar>X m\<bar> " in exI) |
|
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15082
diff
changeset
|
816 |
apply (auto elim!: lemma_Nat_covered) |
15082 | 817 |
done |
818 |
||
819 |
text{*A Cauchy sequence is bounded -- nonstandard version*} |
|
820 |
||
821 |
lemma NSCauchy_NSBseq: "NSCauchy X ==> NSBseq X" |
|
822 |
by (simp add: Cauchy_Bseq Bseq_NSBseq_iff [symmetric] NSCauchy_Cauchy_iff) |
|
823 |
||
824 |
||
825 |
text{*Equivalence of Cauchy criterion and convergence: |
|
826 |
We will prove this using our NS formulation which provides a |
|
827 |
much easier proof than using the standard definition. We do not |
|
828 |
need to use properties of subsequences such as boundedness, |
|
829 |
monotonicity etc... Compare with Harrison's corresponding proof |
|
830 |
in HOL which is much longer and more complicated. Of course, we do |
|
831 |
not have problems which he encountered with guessing the right |
|
832 |
instantiations for his 'espsilon-delta' proof(s) in this case |
|
833 |
since the NS formulations do not involve existential quantifiers.*} |
|
834 |
||
835 |
lemma NSCauchy_NSconvergent_iff: "NSCauchy X = NSconvergent X" |
|
836 |
apply (simp add: NSconvergent_def NSLIMSEQ_def, safe) |
|
837 |
apply (frule NSCauchy_NSBseq) |
|
838 |
apply (auto intro: approx_trans2 simp add: NSBseq_def NSCauchy_def) |
|
839 |
apply (drule HNatInfinite_whn [THEN [2] bspec]) |
|
840 |
apply (drule HNatInfinite_whn [THEN [2] bspec]) |
|
841 |
apply (auto dest!: st_part_Ex simp add: SReal_iff) |
|
842 |
apply (blast intro: approx_trans3) |
|
843 |
done |
|
844 |
||
845 |
text{*Standard proof for free*} |
|
846 |
lemma Cauchy_convergent_iff: "Cauchy X = convergent X" |
|
847 |
by (simp add: NSCauchy_Cauchy_iff [symmetric] convergent_NSconvergent_iff NSCauchy_NSconvergent_iff) |
|
848 |
||
849 |
||
850 |
text{*We can now try and derive a few properties of sequences, |
|
851 |
starting with the limit comparison property for sequences.*} |
|
852 |
||
853 |
lemma NSLIMSEQ_le: |
|
854 |
"[| f ----NS> l; g ----NS> m; |
|
15360 | 855 |
\<exists>N. \<forall>n \<ge> N. f(n) \<le> g(n) |
856 |
|] ==> l \<le> m" |
|
15082 | 857 |
apply (simp add: NSLIMSEQ_def, safe) |
858 |
apply (drule starfun_le_mono) |
|
859 |
apply (drule HNatInfinite_whn [THEN [2] bspec])+ |
|
860 |
apply (drule_tac x = whn in spec) |
|
861 |
apply (drule bex_Infinitesimal_iff2 [THEN iffD2])+ |
|
862 |
apply clarify |
|
863 |
apply (auto intro: hypreal_of_real_le_add_Infininitesimal_cancel2) |
|
864 |
done |
|
865 |
||
866 |
(* standard version *) |
|
867 |
lemma LIMSEQ_le: |
|
15360 | 868 |
"[| f ----> l; g ----> m; \<exists>N. \<forall>n \<ge> N. f(n) \<le> g(n) |] |
15082 | 869 |
==> l \<le> m" |
870 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_le) |
|
871 |
||
872 |
lemma LIMSEQ_le_const: "[| X ----> r; \<forall>n. a \<le> X n |] ==> a \<le> r" |
|
873 |
apply (rule LIMSEQ_le) |
|
874 |
apply (rule LIMSEQ_const, auto) |
|
875 |
done |
|
876 |
||
877 |
lemma NSLIMSEQ_le_const: "[| X ----NS> r; \<forall>n. a \<le> X n |] ==> a \<le> r" |
|
878 |
by (simp add: LIMSEQ_NSLIMSEQ_iff LIMSEQ_le_const) |
|
879 |
||
880 |
lemma LIMSEQ_le_const2: "[| X ----> r; \<forall>n. X n \<le> a |] ==> r \<le> a" |
|
881 |
apply (rule LIMSEQ_le) |
|
882 |
apply (rule_tac [2] LIMSEQ_const, auto) |
|
883 |
done |
|
884 |
||
885 |
lemma NSLIMSEQ_le_const2: "[| X ----NS> r; \<forall>n. X n \<le> a |] ==> r \<le> a" |
|
886 |
by (simp add: LIMSEQ_NSLIMSEQ_iff LIMSEQ_le_const2) |
|
887 |
||
888 |
text{*Shift a convergent series by 1: |
|
889 |
By the equivalence between Cauchiness and convergence and because |
|
890 |
the successor of an infinite hypernatural is also infinite.*} |
|
891 |
||
892 |
lemma NSLIMSEQ_Suc: "f ----NS> l ==> (%n. f(Suc n)) ----NS> l" |
|
893 |
apply (frule NSconvergentI [THEN NSCauchy_NSconvergent_iff [THEN iffD2]]) |
|
894 |
apply (auto simp add: NSCauchy_def NSLIMSEQ_def starfunNat_shift_one) |
|
895 |
apply (drule bspec, assumption) |
|
896 |
apply (drule bspec, assumption) |
|
897 |
apply (drule Nats_1 [THEN [2] HNatInfinite_SHNat_add]) |
|
898 |
apply (blast intro: approx_trans3) |
|
899 |
done |
|
900 |
||
901 |
text{* standard version *} |
|
902 |
lemma LIMSEQ_Suc: "f ----> l ==> (%n. f(Suc n)) ----> l" |
|
903 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_Suc) |
|
904 |
||
905 |
lemma NSLIMSEQ_imp_Suc: "(%n. f(Suc n)) ----NS> l ==> f ----NS> l" |
|
906 |
apply (frule NSconvergentI [THEN NSCauchy_NSconvergent_iff [THEN iffD2]]) |
|
907 |
apply (auto simp add: NSCauchy_def NSLIMSEQ_def starfunNat_shift_one) |
|
908 |
apply (drule bspec, assumption) |
|
909 |
apply (drule bspec, assumption) |
|
910 |
apply (frule Nats_1 [THEN [2] HNatInfinite_SHNat_diff]) |
|
911 |
apply (drule_tac x="N - 1" in bspec) |
|
912 |
apply (auto intro: approx_trans3) |
|
913 |
done |
|
914 |
||
915 |
lemma LIMSEQ_imp_Suc: "(%n. f(Suc n)) ----> l ==> f ----> l" |
|
916 |
apply (simp add: LIMSEQ_NSLIMSEQ_iff) |
|
917 |
apply (erule NSLIMSEQ_imp_Suc) |
|
918 |
done |
|
919 |
||
920 |
lemma LIMSEQ_Suc_iff: "((%n. f(Suc n)) ----> l) = (f ----> l)" |
|
921 |
by (blast intro: LIMSEQ_imp_Suc LIMSEQ_Suc) |
|
922 |
||
923 |
lemma NSLIMSEQ_Suc_iff: "((%n. f(Suc n)) ----NS> l) = (f ----NS> l)" |
|
924 |
by (blast intro: NSLIMSEQ_imp_Suc NSLIMSEQ_Suc) |
|
925 |
||
926 |
text{*A sequence tends to zero iff its abs does*} |
|
927 |
lemma LIMSEQ_rabs_zero: "((%n. \<bar>f n\<bar>) ----> 0) = (f ----> 0)" |
|
928 |
by (simp add: LIMSEQ_def) |
|
929 |
||
930 |
text{*We prove the NS version from the standard one, since the NS proof |
|
931 |
seems more complicated than the standard one above!*} |
|
932 |
lemma NSLIMSEQ_rabs_zero: "((%n. \<bar>f n\<bar>) ----NS> 0) = (f ----NS> 0)" |
|
933 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_rabs_zero) |
|
934 |
||
935 |
text{*Generalization to other limits*} |
|
936 |
lemma NSLIMSEQ_imp_rabs: "f ----NS> l ==> (%n. \<bar>f n\<bar>) ----NS> \<bar>l\<bar>" |
|
937 |
apply (simp add: NSLIMSEQ_def) |
|
938 |
apply (auto intro: approx_hrabs |
|
939 |
simp add: starfunNat_rabs hypreal_of_real_hrabs [symmetric]) |
|
940 |
done |
|
941 |
||
942 |
text{* standard version *} |
|
943 |
lemma LIMSEQ_imp_rabs: "f ----> l ==> (%n. \<bar>f n\<bar>) ----> \<bar>l\<bar>" |
|
944 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_imp_rabs) |
|
945 |
||
946 |
text{*An unbounded sequence's inverse tends to 0*} |
|
947 |
||
948 |
text{* standard proof seems easier *} |
|
949 |
lemma LIMSEQ_inverse_zero: |
|
15360 | 950 |
"\<forall>y. \<exists>N. \<forall>n \<ge> N. y < f(n) ==> (%n. inverse(f n)) ----> 0" |
15082 | 951 |
apply (simp add: LIMSEQ_def, safe) |
952 |
apply (drule_tac x = "inverse r" in spec, safe) |
|
953 |
apply (rule_tac x = N in exI, safe) |
|
954 |
apply (drule spec, auto) |
|
955 |
apply (frule positive_imp_inverse_positive) |
|
956 |
apply (frule order_less_trans, assumption) |
|
957 |
apply (frule_tac a = "f n" in positive_imp_inverse_positive) |
|
958 |
apply (simp add: abs_if) |
|
959 |
apply (rule_tac t = r in inverse_inverse_eq [THEN subst]) |
|
960 |
apply (auto intro: inverse_less_iff_less [THEN iffD2] |
|
961 |
simp del: inverse_inverse_eq) |
|
962 |
done |
|
963 |
||
964 |
lemma NSLIMSEQ_inverse_zero: |
|
15360 | 965 |
"\<forall>y. \<exists>N. \<forall>n \<ge> N. y < f(n) |
15082 | 966 |
==> (%n. inverse(f n)) ----NS> 0" |
967 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_zero) |
|
968 |
||
969 |
text{*The sequence @{term "1/n"} tends to 0 as @{term n} tends to infinity*} |
|
970 |
||
971 |
lemma LIMSEQ_inverse_real_of_nat: "(%n. inverse(real(Suc n))) ----> 0" |
|
972 |
apply (rule LIMSEQ_inverse_zero, safe) |
|
973 |
apply (cut_tac x = y in reals_Archimedean2) |
|
974 |
apply (safe, rule_tac x = n in exI) |
|
975 |
apply (auto simp add: real_of_nat_Suc) |
|
976 |
done |
|
977 |
||
978 |
lemma NSLIMSEQ_inverse_real_of_nat: "(%n. inverse(real(Suc n))) ----NS> 0" |
|
979 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat) |
|
980 |
||
981 |
text{*The sequence @{term "r + 1/n"} tends to @{term r} as @{term n} tends to |
|
982 |
infinity is now easily proved*} |
|
983 |
||
984 |
lemma LIMSEQ_inverse_real_of_nat_add: |
|
985 |
"(%n. r + inverse(real(Suc n))) ----> r" |
|
986 |
by (cut_tac LIMSEQ_add [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat], auto) |
|
987 |
||
988 |
lemma NSLIMSEQ_inverse_real_of_nat_add: |
|
989 |
"(%n. r + inverse(real(Suc n))) ----NS> r" |
|
990 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add) |
|
991 |
||
992 |
lemma LIMSEQ_inverse_real_of_nat_add_minus: |
|
993 |
"(%n. r + -inverse(real(Suc n))) ----> r" |
|
994 |
by (cut_tac LIMSEQ_add_minus [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat], auto) |
|
995 |
||
996 |
lemma NSLIMSEQ_inverse_real_of_nat_add_minus: |
|
997 |
"(%n. r + -inverse(real(Suc n))) ----NS> r" |
|
998 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add_minus) |
|
999 |
||
1000 |
lemma LIMSEQ_inverse_real_of_nat_add_minus_mult: |
|
1001 |
"(%n. r*( 1 + -inverse(real(Suc n)))) ----> r" |
|
1002 |
by (cut_tac b=1 in |
|
1003 |
LIMSEQ_mult [OF LIMSEQ_const LIMSEQ_inverse_real_of_nat_add_minus], auto) |
|
1004 |
||
1005 |
lemma NSLIMSEQ_inverse_real_of_nat_add_minus_mult: |
|
1006 |
"(%n. r*( 1 + -inverse(real(Suc n)))) ----NS> r" |
|
1007 |
by (simp add: LIMSEQ_NSLIMSEQ_iff [symmetric] LIMSEQ_inverse_real_of_nat_add_minus_mult) |
|
1008 |
||
1009 |
||
1010 |
text{* Real Powers*} |
|
1011 |
||
1012 |
lemma NSLIMSEQ_pow [rule_format]: |
|
1013 |
"(X ----NS> a) --> ((%n. (X n) ^ m) ----NS> a ^ m)" |
|
15251 | 1014 |
apply (induct "m") |
15082 | 1015 |
apply (auto intro: NSLIMSEQ_mult NSLIMSEQ_const) |
1016 |
done |
|
1017 |
||
1018 |
lemma LIMSEQ_pow: "X ----> a ==> (%n. (X n) ^ m) ----> a ^ m" |
|
1019 |
by (simp add: LIMSEQ_NSLIMSEQ_iff NSLIMSEQ_pow) |
|
1020 |
||
1021 |
text{*The sequence @{term "x^n"} tends to 0 if @{term "0\<le>x"} and @{term |
|
1022 |
"x<1"}. Proof will use (NS) Cauchy equivalence for convergence and |
|
1023 |
also fact that bounded and monotonic sequence converges.*} |
|
1024 |
||
1025 |
lemma Bseq_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> Bseq (%n. x ^ n)" |
|
1026 |
apply (simp add: Bseq_def) |
|
1027 |
apply (rule_tac x = 1 in exI) |
|
1028 |
apply (simp add: power_abs) |
|
1029 |
apply (auto dest: power_mono intro: order_less_imp_le simp add: abs_if) |
|
1030 |
done |
|
1031 |
||
1032 |
lemma monoseq_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> monoseq (%n. x ^ n)" |
|
1033 |
apply (clarify intro!: mono_SucI2) |
|
1034 |
apply (cut_tac n = n and N = "Suc n" and a = x in power_decreasing, auto) |
|
1035 |
done |
|
1036 |
||
1037 |
lemma convergent_realpow: "[| 0 \<le> x; x \<le> 1 |] ==> convergent (%n. x ^ n)" |
|
1038 |
by (blast intro!: Bseq_monoseq_convergent Bseq_realpow monoseq_realpow) |
|
1039 |
||
1040 |
text{* We now use NS criterion to bring proof of theorem through *} |
|
1041 |
||
1042 |
lemma NSLIMSEQ_realpow_zero: "[| 0 \<le> x; x < 1 |] ==> (%n. x ^ n) ----NS> 0" |
|
1043 |
apply (simp add: NSLIMSEQ_def) |
|
1044 |
apply (auto dest!: convergent_realpow simp add: convergent_NSconvergent_iff) |
|
1045 |
apply (frule NSconvergentD) |
|
1046 |
apply (auto simp add: NSLIMSEQ_def NSCauchy_NSconvergent_iff [symmetric] NSCauchy_def starfunNat_pow) |
|
1047 |
apply (frule HNatInfinite_add_one) |
|
1048 |
apply (drule bspec, assumption) |
|
1049 |
apply (drule bspec, assumption) |
|
1050 |
apply (drule_tac x = "N + (1::hypnat) " in bspec, assumption) |
|
1051 |
apply (simp add: hyperpow_add) |
|
1052 |
apply (drule approx_mult_subst_SReal, assumption) |
|
1053 |
apply (drule approx_trans3, assumption) |
|
1054 |
apply (auto simp del: hypreal_of_real_mult simp add: hypreal_of_real_mult [symmetric]) |
|
1055 |
done |
|
1056 |
||
1057 |
text{* standard version *} |
|
1058 |
lemma LIMSEQ_realpow_zero: "[| 0 \<le> x; x < 1 |] ==> (%n. x ^ n) ----> 0" |
|
1059 |
by (simp add: NSLIMSEQ_realpow_zero LIMSEQ_NSLIMSEQ_iff) |
|
1060 |
||
1061 |
lemma LIMSEQ_divide_realpow_zero: "1 < x ==> (%n. a / (x ^ n)) ----> 0" |
|
1062 |
apply (cut_tac a = a and x1 = "inverse x" in |
|
1063 |
LIMSEQ_mult [OF LIMSEQ_const LIMSEQ_realpow_zero]) |
|
1064 |
apply (auto simp add: divide_inverse power_inverse) |
|
1065 |
apply (simp add: inverse_eq_divide pos_divide_less_eq) |
|
1066 |
done |
|
1067 |
||
15102 | 1068 |
text{*Limit of @{term "c^n"} for @{term"\<bar>c\<bar> < 1"}*} |
15082 | 1069 |
|
1070 |
lemma LIMSEQ_rabs_realpow_zero: "\<bar>c\<bar> < 1 ==> (%n. \<bar>c\<bar> ^ n) ----> 0" |
|
1071 |
by (blast intro!: LIMSEQ_realpow_zero abs_ge_zero) |
|
1072 |
||
1073 |
lemma NSLIMSEQ_rabs_realpow_zero: "\<bar>c\<bar> < 1 ==> (%n. \<bar>c\<bar> ^ n) ----NS> 0" |
|
1074 |
by (simp add: LIMSEQ_rabs_realpow_zero LIMSEQ_NSLIMSEQ_iff [symmetric]) |
|
1075 |
||
1076 |
lemma LIMSEQ_rabs_realpow_zero2: "\<bar>c\<bar> < 1 ==> (%n. c ^ n) ----> 0" |
|
1077 |
apply (rule LIMSEQ_rabs_zero [THEN iffD1]) |
|
1078 |
apply (auto intro: LIMSEQ_rabs_realpow_zero simp add: power_abs) |
|
1079 |
done |
|
1080 |
||
1081 |
lemma NSLIMSEQ_rabs_realpow_zero2: "\<bar>c\<bar> < 1 ==> (%n. c ^ n) ----NS> 0" |
|
1082 |
by (simp add: LIMSEQ_rabs_realpow_zero2 LIMSEQ_NSLIMSEQ_iff [symmetric]) |
|
1083 |
||
1084 |
subsection{*Hyperreals and Sequences*} |
|
1085 |
||
1086 |
text{*A bounded sequence is a finite hyperreal*} |
|
1087 |
lemma NSBseq_HFinite_hypreal: "NSBseq X ==> Abs_hypreal(hyprel``{X}) : HFinite" |
|
1088 |
by (auto intro!: bexI lemma_hyprel_refl |
|
1089 |
intro: FreeUltrafilterNat_all [THEN FreeUltrafilterNat_subset] |
|
1090 |
simp add: HFinite_FreeUltrafilterNat_iff Bseq_NSBseq_iff [symmetric] |
|
1091 |
Bseq_iff1a) |
|
1092 |
||
1093 |
text{*A sequence converging to zero defines an infinitesimal*} |
|
1094 |
lemma NSLIMSEQ_zero_Infinitesimal_hypreal: |
|
1095 |
"X ----NS> 0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal" |
|
1096 |
apply (simp add: NSLIMSEQ_def) |
|
1097 |
apply (drule_tac x = whn in bspec) |
|
1098 |
apply (simp add: HNatInfinite_whn) |
|
1099 |
apply (auto simp add: hypnat_omega_def mem_infmal_iff [symmetric] starfunNat) |
|
1100 |
done |
|
1101 |
||
1102 |
(***--------------------------------------------------------------- |
|
1103 |
Theorems proved by Harrison in HOL that we do not need |
|
1104 |
in order to prove equivalence between Cauchy criterion |
|
1105 |
and convergence: |
|
1106 |
-- Show that every sequence contains a monotonic subsequence |
|
1107 |
Goal "\<exists>f. subseq f & monoseq (%n. s (f n))" |
|
1108 |
-- Show that a subsequence of a bounded sequence is bounded |
|
1109 |
Goal "Bseq X ==> Bseq (%n. X (f n))"; |
|
1110 |
-- Show we can take subsequential terms arbitrarily far |
|
1111 |
up a sequence |
|
1112 |
Goal "subseq f ==> n \<le> f(n)"; |
|
1113 |
Goal "subseq f ==> \<exists>n. N1 \<le> n & N2 \<le> f(n)"; |
|
1114 |
---------------------------------------------------------------***) |
|
1115 |
||
15241 | 1116 |
|
15082 | 1117 |
ML |
1118 |
{* |
|
1119 |
val Cauchy_def = thm"Cauchy_def"; |
|
1120 |
val SEQ_Infinitesimal = thm "SEQ_Infinitesimal"; |
|
1121 |
val LIMSEQ_iff = thm "LIMSEQ_iff"; |
|
1122 |
val NSLIMSEQ_iff = thm "NSLIMSEQ_iff"; |
|
1123 |
val LIMSEQ_NSLIMSEQ = thm "LIMSEQ_NSLIMSEQ"; |
|
1124 |
val NSLIMSEQ_finite_set = thm "NSLIMSEQ_finite_set"; |
|
1125 |
val Compl_less_set = thm "Compl_less_set"; |
|
1126 |
val FreeUltrafilterNat_NSLIMSEQ = thm "FreeUltrafilterNat_NSLIMSEQ"; |
|
1127 |
val HNatInfinite_NSLIMSEQ = thm "HNatInfinite_NSLIMSEQ"; |
|
1128 |
val NSLIMSEQ_LIMSEQ = thm "NSLIMSEQ_LIMSEQ"; |
|
1129 |
val LIMSEQ_NSLIMSEQ_iff = thm "LIMSEQ_NSLIMSEQ_iff"; |
|
1130 |
val NSLIMSEQ_const = thm "NSLIMSEQ_const"; |
|
1131 |
val LIMSEQ_const = thm "LIMSEQ_const"; |
|
1132 |
val NSLIMSEQ_add = thm "NSLIMSEQ_add"; |
|
1133 |
val LIMSEQ_add = thm "LIMSEQ_add"; |
|
1134 |
val NSLIMSEQ_mult = thm "NSLIMSEQ_mult"; |
|
1135 |
val LIMSEQ_mult = thm "LIMSEQ_mult"; |
|
1136 |
val NSLIMSEQ_minus = thm "NSLIMSEQ_minus"; |
|
1137 |
val LIMSEQ_minus = thm "LIMSEQ_minus"; |
|
1138 |
val LIMSEQ_minus_cancel = thm "LIMSEQ_minus_cancel"; |
|
1139 |
val NSLIMSEQ_minus_cancel = thm "NSLIMSEQ_minus_cancel"; |
|
1140 |
val NSLIMSEQ_add_minus = thm "NSLIMSEQ_add_minus"; |
|
1141 |
val LIMSEQ_add_minus = thm "LIMSEQ_add_minus"; |
|
1142 |
val LIMSEQ_diff = thm "LIMSEQ_diff"; |
|
1143 |
val NSLIMSEQ_diff = thm "NSLIMSEQ_diff"; |
|
1144 |
val NSLIMSEQ_inverse = thm "NSLIMSEQ_inverse"; |
|
1145 |
val LIMSEQ_inverse = thm "LIMSEQ_inverse"; |
|
1146 |
val NSLIMSEQ_mult_inverse = thm "NSLIMSEQ_mult_inverse"; |
|
1147 |
val LIMSEQ_divide = thm "LIMSEQ_divide"; |
|
1148 |
val NSLIMSEQ_unique = thm "NSLIMSEQ_unique"; |
|
1149 |
val LIMSEQ_unique = thm "LIMSEQ_unique"; |
|
1150 |
val limI = thm "limI"; |
|
1151 |
val nslimI = thm "nslimI"; |
|
1152 |
val lim_nslim_iff = thm "lim_nslim_iff"; |
|
1153 |
val convergentD = thm "convergentD"; |
|
1154 |
val convergentI = thm "convergentI"; |
|
1155 |
val NSconvergentD = thm "NSconvergentD"; |
|
1156 |
val NSconvergentI = thm "NSconvergentI"; |
|
1157 |
val convergent_NSconvergent_iff = thm "convergent_NSconvergent_iff"; |
|
1158 |
val NSconvergent_NSLIMSEQ_iff = thm "NSconvergent_NSLIMSEQ_iff"; |
|
1159 |
val convergent_LIMSEQ_iff = thm "convergent_LIMSEQ_iff"; |
|
1160 |
val subseq_Suc_iff = thm "subseq_Suc_iff"; |
|
1161 |
val monoseq_Suc = thm "monoseq_Suc"; |
|
1162 |
val monoI1 = thm "monoI1"; |
|
1163 |
val monoI2 = thm "monoI2"; |
|
1164 |
val mono_SucI1 = thm "mono_SucI1"; |
|
1165 |
val mono_SucI2 = thm "mono_SucI2"; |
|
1166 |
val BseqD = thm "BseqD"; |
|
1167 |
val BseqI = thm "BseqI"; |
|
1168 |
val Bseq_iff = thm "Bseq_iff"; |
|
1169 |
val Bseq_iff1a = thm "Bseq_iff1a"; |
|
1170 |
val NSBseqD = thm "NSBseqD"; |
|
1171 |
val NSBseqI = thm "NSBseqI"; |
|
1172 |
val Bseq_NSBseq = thm "Bseq_NSBseq"; |
|
1173 |
val real_seq_to_hypreal_HInfinite = thm "real_seq_to_hypreal_HInfinite"; |
|
1174 |
val HNatInfinite_skolem_f = thm "HNatInfinite_skolem_f"; |
|
1175 |
val NSBseq_Bseq = thm "NSBseq_Bseq"; |
|
1176 |
val Bseq_NSBseq_iff = thm "Bseq_NSBseq_iff"; |
|
1177 |
val NSconvergent_NSBseq = thm "NSconvergent_NSBseq"; |
|
1178 |
val convergent_Bseq = thm "convergent_Bseq"; |
|
1179 |
val Bseq_isUb = thm "Bseq_isUb"; |
|
1180 |
val Bseq_isLub = thm "Bseq_isLub"; |
|
1181 |
val NSBseq_isUb = thm "NSBseq_isUb"; |
|
1182 |
val NSBseq_isLub = thm "NSBseq_isLub"; |
|
1183 |
val Bmonoseq_LIMSEQ = thm "Bmonoseq_LIMSEQ"; |
|
1184 |
val Bmonoseq_NSLIMSEQ = thm "Bmonoseq_NSLIMSEQ"; |
|
1185 |
val Bseq_mono_convergent = thm "Bseq_mono_convergent"; |
|
1186 |
val NSBseq_mono_NSconvergent = thm "NSBseq_mono_NSconvergent"; |
|
1187 |
val convergent_minus_iff = thm "convergent_minus_iff"; |
|
1188 |
val Bseq_minus_iff = thm "Bseq_minus_iff"; |
|
1189 |
val Bseq_monoseq_convergent = thm "Bseq_monoseq_convergent"; |
|
1190 |
val Bseq_iff2 = thm "Bseq_iff2"; |
|
1191 |
val Bseq_iff3 = thm "Bseq_iff3"; |
|
1192 |
val BseqI2 = thm "BseqI2"; |
|
1193 |
val Cauchy_NSCauchy = thm "Cauchy_NSCauchy"; |
|
1194 |
val NSCauchy_Cauchy = thm "NSCauchy_Cauchy"; |
|
1195 |
val NSCauchy_Cauchy_iff = thm "NSCauchy_Cauchy_iff"; |
|
1196 |
val less_Suc_cancel_iff = thm "less_Suc_cancel_iff"; |
|
1197 |
val SUP_rabs_subseq = thm "SUP_rabs_subseq"; |
|
1198 |
val Cauchy_Bseq = thm "Cauchy_Bseq"; |
|
1199 |
val NSCauchy_NSBseq = thm "NSCauchy_NSBseq"; |
|
1200 |
val NSCauchy_NSconvergent_iff = thm "NSCauchy_NSconvergent_iff"; |
|
1201 |
val Cauchy_convergent_iff = thm "Cauchy_convergent_iff"; |
|
1202 |
val NSLIMSEQ_le = thm "NSLIMSEQ_le"; |
|
1203 |
val LIMSEQ_le = thm "LIMSEQ_le"; |
|
1204 |
val LIMSEQ_le_const = thm "LIMSEQ_le_const"; |
|
1205 |
val NSLIMSEQ_le_const = thm "NSLIMSEQ_le_const"; |
|
1206 |
val LIMSEQ_le_const2 = thm "LIMSEQ_le_const2"; |
|
1207 |
val NSLIMSEQ_le_const2 = thm "NSLIMSEQ_le_const2"; |
|
1208 |
val NSLIMSEQ_Suc = thm "NSLIMSEQ_Suc"; |
|
1209 |
val LIMSEQ_Suc = thm "LIMSEQ_Suc"; |
|
1210 |
val NSLIMSEQ_imp_Suc = thm "NSLIMSEQ_imp_Suc"; |
|
1211 |
val LIMSEQ_imp_Suc = thm "LIMSEQ_imp_Suc"; |
|
1212 |
val LIMSEQ_Suc_iff = thm "LIMSEQ_Suc_iff"; |
|
1213 |
val NSLIMSEQ_Suc_iff = thm "NSLIMSEQ_Suc_iff"; |
|
1214 |
val LIMSEQ_rabs_zero = thm "LIMSEQ_rabs_zero"; |
|
1215 |
val NSLIMSEQ_rabs_zero = thm "NSLIMSEQ_rabs_zero"; |
|
1216 |
val NSLIMSEQ_imp_rabs = thm "NSLIMSEQ_imp_rabs"; |
|
1217 |
val LIMSEQ_imp_rabs = thm "LIMSEQ_imp_rabs"; |
|
1218 |
val LIMSEQ_inverse_zero = thm "LIMSEQ_inverse_zero"; |
|
1219 |
val NSLIMSEQ_inverse_zero = thm "NSLIMSEQ_inverse_zero"; |
|
1220 |
val LIMSEQ_inverse_real_of_nat = thm "LIMSEQ_inverse_real_of_nat"; |
|
1221 |
val NSLIMSEQ_inverse_real_of_nat = thm "NSLIMSEQ_inverse_real_of_nat"; |
|
1222 |
val LIMSEQ_inverse_real_of_nat_add = thm "LIMSEQ_inverse_real_of_nat_add"; |
|
1223 |
val NSLIMSEQ_inverse_real_of_nat_add = thm "NSLIMSEQ_inverse_real_of_nat_add"; |
|
1224 |
val LIMSEQ_inverse_real_of_nat_add_minus = thm "LIMSEQ_inverse_real_of_nat_add_minus"; |
|
1225 |
val NSLIMSEQ_inverse_real_of_nat_add_minus = thm "NSLIMSEQ_inverse_real_of_nat_add_minus"; |
|
1226 |
val LIMSEQ_inverse_real_of_nat_add_minus_mult = thm "LIMSEQ_inverse_real_of_nat_add_minus_mult"; |
|
1227 |
val NSLIMSEQ_inverse_real_of_nat_add_minus_mult = thm "NSLIMSEQ_inverse_real_of_nat_add_minus_mult"; |
|
1228 |
val NSLIMSEQ_pow = thm "NSLIMSEQ_pow"; |
|
1229 |
val LIMSEQ_pow = thm "LIMSEQ_pow"; |
|
1230 |
val Bseq_realpow = thm "Bseq_realpow"; |
|
1231 |
val monoseq_realpow = thm "monoseq_realpow"; |
|
1232 |
val convergent_realpow = thm "convergent_realpow"; |
|
1233 |
val NSLIMSEQ_realpow_zero = thm "NSLIMSEQ_realpow_zero"; |
|
1234 |
*} |
|
1235 |
||
15241 | 1236 |
|
10751 | 1237 |
end |