13 begin |
13 begin |
14 |
14 |
15 text{*Standard and Nonstandard Definitions*} |
15 text{*Standard and Nonstandard Definitions*} |
16 |
16 |
17 definition |
17 definition |
18 LIM :: "[real=>real,real,real] => bool" |
18 LIM :: "[real => 'a::real_normed_vector, real, 'a] => bool" |
19 ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60) |
19 ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60) |
20 "f -- a --> L = |
20 "f -- a --> L = |
21 (\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s |
21 (\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s |
22 --> \<bar>f x + -L\<bar> < r)" |
22 --> norm (f x + -L) < r)" |
23 |
23 |
24 NSLIM :: "[real=>real,real,real] => bool" |
24 NSLIM :: "[real => 'a::real_normed_vector, real, 'a] => bool" |
25 ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60) |
25 ("((_)/ -- (_)/ --NS> (_))" [60, 0, 60] 60) |
26 "f -- a --NS> L = (\<forall>x. (x \<noteq> hypreal_of_real a & |
26 "f -- a --NS> L = |
27 x @= hypreal_of_real a --> |
27 (\<forall>x. (x \<noteq> star_of a & x @= star_of a --> ( *f* f) x @= star_of L))" |
28 ( *f* f) x @= hypreal_of_real L))" |
28 |
29 |
29 isCont :: "[real => 'a::real_normed_vector, real] => bool" |
30 isCont :: "[real=>real,real] => bool" |
|
31 "isCont f a = (f -- a --> (f a))" |
30 "isCont f a = (f -- a --> (f a))" |
32 |
31 |
33 isNSCont :: "[real=>real,real] => bool" |
32 isNSCont :: "[real => 'a::real_normed_vector, real] => bool" |
34 --{*NS definition dispenses with limit notions*} |
33 --{*NS definition dispenses with limit notions*} |
35 "isNSCont f a = (\<forall>y. y @= hypreal_of_real a --> |
34 "isNSCont f a = (\<forall>y. y @= star_of a --> |
36 ( *f* f) y @= hypreal_of_real (f a))" |
35 ( *f* f) y @= star_of (f a))" |
37 |
36 |
38 deriv:: "[real=>real,real,real] => bool" |
37 deriv:: "[real=>real,real,real] => bool" |
39 --{*Differentiation: D is derivative of function f at x*} |
38 --{*Differentiation: D is derivative of function f at x*} |
40 ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) |
39 ("(DERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60) |
41 "DERIV f x :> D = ((%h. (f(x + h) + -f x)/h) -- 0 --> D)" |
40 "DERIV f x :> D = ((%h. (f(x + h) + -f x)/h) -- 0 --> D)" |
77 |
76 |
78 section{*Some Purely Standard Proofs*} |
77 section{*Some Purely Standard Proofs*} |
79 |
78 |
80 lemma LIM_eq: |
79 lemma LIM_eq: |
81 "f -- a --> L = |
80 "f -- a --> L = |
82 (\<forall>r>0.\<exists>s>0.\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < s --> \<bar>f x - L\<bar> < r)" |
81 (\<forall>r>0.\<exists>s>0.\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < s --> norm (f x - L) < r)" |
83 by (simp add: LIM_def diff_minus) |
82 by (simp add: LIM_def diff_minus) |
|
83 |
|
84 lemma LIM_I: |
|
85 "(!!r. 0<r ==> \<exists>s>0.\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < s --> norm (f x - L) < r) |
|
86 ==> f -- a --> L" |
|
87 by (simp add: LIM_eq) |
84 |
88 |
85 lemma LIM_D: |
89 lemma LIM_D: |
86 "[| f -- a --> L; 0<r |] |
90 "[| f -- a --> L; 0<r |] |
87 ==> \<exists>s>0.\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < s --> \<bar>f x - L\<bar> < r" |
91 ==> \<exists>s>0.\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < s --> norm (f x - L) < r" |
88 by (simp add: LIM_eq) |
92 by (simp add: LIM_eq) |
89 |
93 |
90 lemma LIM_const [simp]: "(%x. k) -- x --> k" |
94 lemma LIM_const [simp]: "(%x. k) -- x --> k" |
91 by (simp add: LIM_def) |
95 by (simp add: LIM_def) |
92 |
96 |
93 lemma LIM_add: |
97 lemma LIM_add: |
94 assumes f: "f -- a --> L" and g: "g -- a --> M" |
98 assumes f: "f -- a --> L" and g: "g -- a --> M" |
95 shows "(%x. f x + g(x)) -- a --> (L + M)" |
99 shows "(%x. f x + g(x)) -- a --> (L + M)" |
96 proof (unfold LIM_eq, clarify) |
100 proof (rule LIM_I) |
97 fix r :: real |
101 fix r :: real |
98 assume r: "0 < r" |
102 assume r: "0 < r" |
99 from LIM_D [OF f half_gt_zero [OF r]] |
103 from LIM_D [OF f half_gt_zero [OF r]] |
100 obtain fs |
104 obtain fs |
101 where fs: "0 < fs" |
105 where fs: "0 < fs" |
102 and fs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < fs --> \<bar>f x - L\<bar> < r/2" |
106 and fs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < fs --> norm (f x - L) < r/2" |
103 by blast |
107 by blast |
104 from LIM_D [OF g half_gt_zero [OF r]] |
108 from LIM_D [OF g half_gt_zero [OF r]] |
105 obtain gs |
109 obtain gs |
106 where gs: "0 < gs" |
110 where gs: "0 < gs" |
107 and gs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < gs --> \<bar>g x - M\<bar> < r/2" |
111 and gs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < gs --> norm (g x - M) < r/2" |
108 by blast |
112 by blast |
109 show "\<exists>s>0.\<forall>x. x \<noteq> a \<and> \<bar>x-a\<bar> < s \<longrightarrow> \<bar>f x + g x - (L + M)\<bar> < r" |
113 show "\<exists>s>0.\<forall>x. x \<noteq> a \<and> \<bar>x-a\<bar> < s \<longrightarrow> norm (f x + g x - (L + M)) < r" |
110 proof (intro exI conjI strip) |
114 proof (intro exI conjI strip) |
111 show "0 < min fs gs" by (simp add: fs gs) |
115 show "0 < min fs gs" by (simp add: fs gs) |
112 fix x :: real |
116 fix x :: real |
113 assume "x \<noteq> a \<and> \<bar>x-a\<bar> < min fs gs" |
117 assume "x \<noteq> a \<and> \<bar>x-a\<bar> < min fs gs" |
114 hence "x \<noteq> a \<and> \<bar>x-a\<bar> < fs \<and> \<bar>x-a\<bar> < gs" by simp |
118 hence "x \<noteq> a \<and> \<bar>x-a\<bar> < fs \<and> \<bar>x-a\<bar> < gs" by simp |
115 with fs_lt gs_lt |
119 with fs_lt gs_lt |
116 have "\<bar>f x - L\<bar> < r/2" and "\<bar>g x - M\<bar> < r/2" by blast+ |
120 have "norm (f x - L) < r/2" and "norm (g x - M) < r/2" by blast+ |
117 hence "\<bar>f x - L\<bar> + \<bar>g x - M\<bar> < r" by arith |
121 hence "norm (f x - L) + norm (g x - M) < r" by arith |
118 thus "\<bar>f x + g x - (L + M)\<bar> < r" |
122 thus "norm (f x + g x - (L + M)) < r" |
119 by (blast intro: abs_diff_triangle_ineq order_le_less_trans) |
123 by (blast intro: norm_diff_triangle_ineq order_le_less_trans) |
120 qed |
124 qed |
121 qed |
125 qed |
122 |
126 |
|
127 lemma minus_diff_minus: |
|
128 fixes a b :: "'a::ab_group_add" |
|
129 shows "(- a) - (- b) = - (a - b)" |
|
130 by simp |
|
131 |
123 lemma LIM_minus: "f -- a --> L ==> (%x. -f(x)) -- a --> -L" |
132 lemma LIM_minus: "f -- a --> L ==> (%x. -f(x)) -- a --> -L" |
124 apply (simp add: LIM_eq) |
133 by (simp only: LIM_eq minus_diff_minus norm_minus_cancel) |
125 apply (subgoal_tac "\<forall>x. \<bar>- f x + L\<bar> = \<bar>f x - L\<bar>") |
|
126 apply (simp_all add: abs_if) |
|
127 done |
|
128 |
134 |
129 lemma LIM_add_minus: |
135 lemma LIM_add_minus: |
130 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) + -g(x)) -- x --> (l + -m)" |
136 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) + -g(x)) -- x --> (l + -m)" |
131 by (blast dest: LIM_add LIM_minus) |
137 by (intro LIM_add LIM_minus) |
132 |
138 |
133 lemma LIM_diff: |
139 lemma LIM_diff: |
134 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) - g(x)) -- x --> l-m" |
140 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) - g(x)) -- x --> l-m" |
135 by (simp add: diff_minus LIM_add_minus) |
141 by (simp only: diff_minus LIM_add LIM_minus) |
136 |
142 |
137 |
143 |
138 lemma LIM_const_not_eq: "k \<noteq> L ==> ~ ((%x. k) -- a --> L)" |
144 lemma LIM_const_not_eq: "k \<noteq> L ==> ~ ((%x. k) -- a --> L)" |
139 proof (simp add: linorder_neq_iff LIM_eq, elim disjE) |
145 apply (simp add: LIM_eq) |
140 assume k: "k < L" |
146 apply (rule_tac x="norm (k - L)" in exI, simp, safe) |
141 show "\<exists>r>0. \<forall>s>0. (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r" |
147 apply (rule_tac x="a + s/2" in exI, simp) |
142 proof (intro exI conjI strip) |
148 done |
143 show "0 < L-k" by (simp add: k compare_rls) |
|
144 fix s :: real |
|
145 assume s: "0<s" |
|
146 { from s show "s/2 + a < a \<or> a < s/2 + a" by arith |
|
147 next |
|
148 from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) |
|
149 next |
|
150 from s show "~ \<bar>k-L\<bar> < L-k" by (simp add: abs_if) } |
|
151 qed |
|
152 next |
|
153 assume k: "L < k" |
|
154 show "\<exists>r>0.\<forall>s>0. (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r" |
|
155 proof (intro exI conjI strip) |
|
156 show "0 < k-L" by (simp add: k compare_rls) |
|
157 fix s :: real |
|
158 assume s: "0<s" |
|
159 { from s show "s/2 + a < a \<or> a < s/2 + a" by arith |
|
160 next |
|
161 from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) |
|
162 next |
|
163 from s show "~ \<bar>k-L\<bar> < k-L" by (simp add: abs_if) } |
|
164 qed |
|
165 qed |
|
166 |
149 |
167 lemma LIM_const_eq: "(%x. k) -- x --> L ==> k = L" |
150 lemma LIM_const_eq: "(%x. k) -- x --> L ==> k = L" |
168 apply (rule ccontr) |
151 apply (rule ccontr) |
169 apply (blast dest: LIM_const_not_eq) |
152 apply (blast dest: LIM_const_not_eq) |
170 done |
153 done |
173 apply (drule LIM_diff, assumption) |
156 apply (drule LIM_diff, assumption) |
174 apply (auto dest!: LIM_const_eq) |
157 apply (auto dest!: LIM_const_eq) |
175 done |
158 done |
176 |
159 |
177 lemma LIM_mult_zero: |
160 lemma LIM_mult_zero: |
|
161 fixes f g :: "real \<Rightarrow> 'a::real_normed_algebra" |
178 assumes f: "f -- a --> 0" and g: "g -- a --> 0" |
162 assumes f: "f -- a --> 0" and g: "g -- a --> 0" |
179 shows "(%x. f(x) * g(x)) -- a --> 0" |
163 shows "(%x. f(x) * g(x)) -- a --> 0" |
180 proof (simp add: LIM_eq abs_mult, clarify) |
164 proof (rule LIM_I, simp) |
181 fix r :: real |
165 fix r :: real |
182 assume r: "0<r" |
166 assume r: "0<r" |
183 from LIM_D [OF f zero_less_one] |
167 from LIM_D [OF f zero_less_one] |
184 obtain fs |
168 obtain fs |
185 where fs: "0 < fs" |
169 where fs: "0 < fs" |
186 and fs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < fs --> \<bar>f x\<bar> < 1" |
170 and fs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < fs --> norm (f x) < 1" |
187 by auto |
171 by auto |
188 from LIM_D [OF g r] |
172 from LIM_D [OF g r] |
189 obtain gs |
173 obtain gs |
190 where gs: "0 < gs" |
174 where gs: "0 < gs" |
191 and gs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < gs --> \<bar>g x\<bar> < r" |
175 and gs_lt: "\<forall>x. x \<noteq> a & \<bar>x-a\<bar> < gs --> norm (g x) < r" |
192 by auto |
176 by auto |
193 show "\<exists>s. 0 < s \<and> (\<forall>x. x \<noteq> a \<and> \<bar>x-a\<bar> < s \<longrightarrow> \<bar>f x\<bar> * \<bar>g x\<bar> < r)" |
177 show "\<exists>s. 0 < s \<and> (\<forall>x. x \<noteq> a \<and> \<bar>x-a\<bar> < s \<longrightarrow> norm (f x * g x) < r)" |
194 proof (intro exI conjI strip) |
178 proof (intro exI conjI strip) |
195 show "0 < min fs gs" by (simp add: fs gs) |
179 show "0 < min fs gs" by (simp add: fs gs) |
196 fix x :: real |
180 fix x :: real |
197 assume "x \<noteq> a \<and> \<bar>x-a\<bar> < min fs gs" |
181 assume "x \<noteq> a \<and> \<bar>x-a\<bar> < min fs gs" |
198 hence "x \<noteq> a \<and> \<bar>x-a\<bar> < fs \<and> \<bar>x-a\<bar> < gs" by simp |
182 hence "x \<noteq> a \<and> \<bar>x-a\<bar> < fs \<and> \<bar>x-a\<bar> < gs" by simp |
199 with fs_lt gs_lt |
183 with fs_lt gs_lt |
200 have "\<bar>f x\<bar> < 1" and "\<bar>g x\<bar> < r" by blast+ |
184 have "norm (f x) < 1" and "norm (g x) < r" by blast+ |
201 hence "\<bar>f x\<bar> * \<bar>g x\<bar> < 1*r" by (rule abs_mult_less) |
185 hence "norm (f x) * norm (g x) < 1*r" |
202 thus "\<bar>f x\<bar> * \<bar>g x\<bar> < r" by simp |
186 by (rule mult_strict_mono' [OF _ _ norm_ge_zero norm_ge_zero]) |
|
187 thus "norm (f x * g x) < r" |
|
188 by (simp add: order_le_less_trans [OF norm_mult_ineq]) |
203 qed |
189 qed |
204 qed |
190 qed |
205 |
191 |
206 lemma LIM_self: "(%x. x) -- a --> a" |
192 lemma LIM_self: "(%x. x) -- a --> a" |
207 by (auto simp add: LIM_def) |
193 by (auto simp add: LIM_def) |
221 |
207 |
222 subsection{*Relationships Between Standard and Nonstandard Concepts*} |
208 subsection{*Relationships Between Standard and Nonstandard Concepts*} |
223 |
209 |
224 text{*Standard and NS definitions of Limit*} (*NEEDS STRUCTURING*) |
210 text{*Standard and NS definitions of Limit*} (*NEEDS STRUCTURING*) |
225 lemma LIM_NSLIM: |
211 lemma LIM_NSLIM: |
226 "f -- x --> L ==> f -- x --NS> L" |
212 "f -- a --> L ==> f -- a --NS> L" |
227 apply (simp add: LIM_def NSLIM_def approx_def) |
213 apply (simp add: LIM_def NSLIM_def approx_def, safe) |
|
214 apply (rule_tac x="x" in star_cases) |
|
215 apply (simp add: star_of_def star_n_minus star_n_add starfun) |
228 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) |
216 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) |
229 apply (rule_tac x = xa in star_cases) |
217 apply (simp add: star_n_eq_iff) |
230 apply (auto simp add: real_add_minus_iff starfun star_n_minus star_of_def star_n_add star_n_eq_iff) |
|
231 apply (rule bexI [OF _ Rep_star_star_n], clarify) |
|
232 apply (drule_tac x = u in spec, clarify) |
218 apply (drule_tac x = u in spec, clarify) |
233 apply (drule_tac x = s in spec, clarify) |
219 apply (drule_tac x = s in spec, clarify) |
234 apply (subgoal_tac "\<forall>n::nat. (Xa n) \<noteq> x & \<bar>(Xa n) + - x\<bar> < s --> \<bar>f (Xa n) + - L\<bar> < u") |
220 apply (simp only: FUFNat.Collect_not [symmetric]) |
235 prefer 2 apply blast |
221 apply (elim ultra, simp) |
236 apply (drule FreeUltrafilterNat_all, ultra) |
|
237 done |
222 done |
238 |
223 |
239 |
224 |
240 subsubsection{*Limit: The NS definition implies the standard definition.*} |
225 subsubsection{*Limit: The NS definition implies the standard definition.*} |
241 |
226 |
242 lemma lemma_LIM: "\<forall>s>0.\<exists>xa. xa \<noteq> x & |
227 lemma lemma_LIM: |
243 \<bar>xa + - x\<bar> < s & r \<le> \<bar>f xa + -L\<bar> |
228 fixes L :: "'a::real_normed_vector" |
244 ==> \<forall>n::nat. \<exists>xa. xa \<noteq> x & |
229 shows "\<forall>s>0. \<exists>x. x \<noteq> a \<and> \<bar>x + - a\<bar> < s \<and> \<not> norm (f x + -L) < r |
245 \<bar>xa + -x\<bar> < inverse(real(Suc n)) & r \<le> \<bar>f xa + -L\<bar>" |
230 ==> \<forall>n::nat. \<exists>x. x \<noteq> a \<and> |
|
231 \<bar>x + -a\<bar> < inverse(real(Suc n)) \<and> \<not> norm (f x + -L) < r" |
246 apply clarify |
232 apply clarify |
247 apply (cut_tac n1 = n in real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive], auto) |
233 apply (cut_tac n1 = n in real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive], auto) |
248 done |
234 done |
249 |
235 |
250 lemma lemma_skolemize_LIM2: |
236 lemma lemma_skolemize_LIM2: |
251 "\<forall>s>0.\<exists>xa. xa \<noteq> x & \<bar>xa + - x\<bar> < s & r \<le> \<bar>f xa + -L\<bar> |
237 fixes L :: "'a::real_normed_vector" |
252 ==> \<exists>X. \<forall>n::nat. X n \<noteq> x & |
238 shows "\<forall>s>0. \<exists>x. x \<noteq> a \<and> \<bar>x + - a\<bar> < s \<and> \<not> norm (f x + -L) < r |
253 \<bar>X n + -x\<bar> < inverse(real(Suc n)) & r \<le> abs(f (X n) + -L)" |
239 ==> \<exists>X. \<forall>n::nat. X n \<noteq> a \<and> |
|
240 \<bar>X n + -a\<bar> < inverse(real(Suc n)) \<and> \<not> norm(f (X n) + -L) < r" |
254 apply (drule lemma_LIM) |
241 apply (drule lemma_LIM) |
255 apply (drule choice, blast) |
242 apply (drule choice, blast) |
256 done |
243 done |
257 |
244 |
258 lemma lemma_simp: "\<forall>n. X n \<noteq> x & |
245 lemma FreeUltrafilterNat_most: "\<exists>N. \<forall>n\<ge>N. P n \<Longrightarrow> {n. P n} \<in> \<U>" |
259 \<bar>X n + - x\<bar> < inverse (real(Suc n)) & |
246 apply (erule exE) |
260 r \<le> abs (f (X n) + - L) ==> |
247 apply (rule_tac u="{n. N \<le> n}" in FUFNat.subset) |
261 \<forall>n. \<bar>X n + - x\<bar> < inverse (real(Suc n))" |
248 apply (rule cofinite_mem_FreeUltrafilterNat) |
|
249 apply (simp add: Collect_neg_eq [symmetric]) |
|
250 apply (simp add: linorder_not_le finite_nat_segment) |
|
251 apply fast |
|
252 done |
|
253 |
|
254 lemma lemma_simp: "\<forall>n. X n \<noteq> a & |
|
255 \<bar>X n + - a\<bar> < inverse (real(Suc n)) & |
|
256 \<not> norm (f (X n) + - L) < r ==> |
|
257 \<forall>n. \<bar>X n + - a\<bar> < inverse (real(Suc n))" |
262 by auto |
258 by auto |
263 |
259 |
264 |
260 |
265 text{*NSLIM => LIM*} |
261 text{*NSLIM => LIM*} |
266 |
262 |
267 lemma NSLIM_LIM: "f -- x --NS> L ==> f -- x --> L" |
263 lemma NSLIM_LIM: "f -- a --NS> L ==> f -- a --> L" |
268 apply (simp add: LIM_def NSLIM_def approx_def) |
264 apply (simp add: LIM_def NSLIM_def approx_def) |
269 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, clarify) |
265 apply (rule ccontr, simp, clarify) |
270 apply (rule ccontr, simp) |
|
271 apply (simp add: linorder_not_less) |
|
272 apply (drule lemma_skolemize_LIM2, safe) |
266 apply (drule lemma_skolemize_LIM2, safe) |
273 apply (drule_tac x = "star_n X" in spec) |
267 apply (drule_tac x = "star_n X" in spec) |
274 apply (auto simp add: starfun star_n_minus star_of_def star_n_add star_n_eq_iff) |
268 apply (drule mp, rule conjI) |
275 apply (drule lemma_simp [THEN real_seq_to_hypreal_Infinitesimal]) |
269 apply (simp add: star_of_def star_n_eq_iff) |
276 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff star_of_def star_n_minus star_n_add star_n_eq_iff, blast) |
270 apply (rule real_seq_to_hypreal_Infinitesimal, simp) |
277 apply (drule spec, drule mp, assumption) |
271 apply (simp add: starfun star_of_def star_n_minus star_n_add) |
278 apply (drule FreeUltrafilterNat_all, ultra) |
272 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff) |
279 done |
273 apply (drule spec, drule (1) mp) |
280 |
274 apply simp |
|
275 done |
281 |
276 |
282 theorem LIM_NSLIM_iff: "(f -- x --> L) = (f -- x --NS> L)" |
277 theorem LIM_NSLIM_iff: "(f -- x --> L) = (f -- x --NS> L)" |
283 by (blast intro: LIM_NSLIM NSLIM_LIM) |
278 by (blast intro: LIM_NSLIM NSLIM_LIM) |
284 |
279 |
285 text{*Proving properties of limits using nonstandard definition. |
280 text{*Proving properties of limits using nonstandard definition. |
286 The properties hold for standard limits as well!*} |
281 The properties hold for standard limits as well!*} |
287 |
282 |
288 lemma NSLIM_mult: |
283 lemma NSLIM_mult: |
289 "[| f -- x --NS> l; g -- x --NS> m |] |
284 fixes l m :: "'a::real_normed_algebra" |
|
285 shows "[| f -- x --NS> l; g -- x --NS> m |] |
290 ==> (%x. f(x) * g(x)) -- x --NS> (l * m)" |
286 ==> (%x. f(x) * g(x)) -- x --NS> (l * m)" |
291 by (auto simp add: NSLIM_def intro!: approx_mult_HFinite) |
287 by (auto simp add: NSLIM_def intro!: approx_mult_HFinite) |
292 |
288 |
293 lemma LIM_mult2: |
289 lemma LIM_mult2: |
294 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) * g(x)) -- x --> (l * m)" |
290 fixes l m :: "'a::real_normed_algebra" |
|
291 shows "[| f -- x --> l; g -- x --> m |] |
|
292 ==> (%x. f(x) * g(x)) -- x --> (l * m)" |
295 by (simp add: LIM_NSLIM_iff NSLIM_mult) |
293 by (simp add: LIM_NSLIM_iff NSLIM_mult) |
296 |
294 |
297 lemma NSLIM_add: |
295 lemma NSLIM_add: |
298 "[| f -- x --NS> l; g -- x --NS> m |] |
296 "[| f -- x --NS> l; g -- x --NS> m |] |
299 ==> (%x. f(x) + g(x)) -- x --NS> (l + m)" |
297 ==> (%x. f(x) + g(x)) -- x --NS> (l + m)" |
355 lemma LIM_zero_cancel: "(%x. f(x) - l) -- x --> 0 ==> f -- x --> l" |
357 lemma LIM_zero_cancel: "(%x. f(x) - l) -- x --> 0 ==> f -- x --> l" |
356 apply (drule_tac g = "%x. l" and M = l in LIM_add) |
358 apply (drule_tac g = "%x. l" and M = l in LIM_add) |
357 apply (auto simp add: diff_minus add_assoc) |
359 apply (auto simp add: diff_minus add_assoc) |
358 done |
360 done |
359 |
361 |
360 lemma NSLIM_not_zero: "k \<noteq> 0 ==> ~ ((%x. k) -- x --NS> 0)" |
|
361 apply (simp add: NSLIM_def) |
|
362 apply (rule_tac x = "hypreal_of_real x + epsilon" in exI) |
|
363 apply (auto intro: Infinitesimal_add_approx_self [THEN approx_sym] |
|
364 simp add: hypreal_epsilon_not_zero) |
|
365 done |
|
366 |
|
367 lemma NSLIM_const_not_eq: "k \<noteq> L ==> ~ ((%x. k) -- x --NS> L)" |
362 lemma NSLIM_const_not_eq: "k \<noteq> L ==> ~ ((%x. k) -- x --NS> L)" |
368 apply (simp add: NSLIM_def) |
363 apply (simp add: NSLIM_def) |
369 apply (rule_tac x = "hypreal_of_real x + epsilon" in exI) |
364 apply (rule_tac x = "hypreal_of_real x + epsilon" in exI) |
370 apply (auto intro: Infinitesimal_add_approx_self [THEN approx_sym] |
365 apply (auto intro: Infinitesimal_add_approx_self [THEN approx_sym] |
371 simp add: hypreal_epsilon_not_zero) |
366 simp add: hypreal_epsilon_not_zero) |
372 done |
367 done |
373 |
368 |
|
369 lemma NSLIM_not_zero: "k \<noteq> 0 ==> ~ ((%x. k) -- x --NS> 0)" |
|
370 by (rule NSLIM_const_not_eq) |
|
371 |
374 lemma NSLIM_const_eq: "(%x. k) -- x --NS> L ==> k = L" |
372 lemma NSLIM_const_eq: "(%x. k) -- x --NS> L ==> k = L" |
375 apply (rule ccontr) |
373 apply (rule ccontr) |
376 apply (blast dest: NSLIM_const_not_eq) |
374 apply (blast dest: NSLIM_const_not_eq) |
377 done |
375 done |
378 |
376 |
379 text{* can actually be proved more easily by unfolding the definition!*} |
377 text{* can actually be proved more easily by unfolding the definition!*} |
380 lemma NSLIM_unique: "[| f -- x --NS> L; f -- x --NS> M |] ==> L = M" |
378 lemma NSLIM_unique: "[| f -- x --NS> L; f -- x --NS> M |] ==> L = M" |
381 apply (drule NSLIM_minus) |
379 apply (drule NSLIM_minus) |
382 apply (drule NSLIM_add, assumption) |
380 apply (drule NSLIM_add, assumption) |
383 apply (auto dest!: NSLIM_const_eq [symmetric]) |
381 apply (auto dest!: NSLIM_const_eq [symmetric]) |
|
382 apply (simp add: diff_def [symmetric]) |
384 done |
383 done |
385 |
384 |
386 lemma LIM_unique2: "[| f -- x --> L; f -- x --> M |] ==> L = M" |
385 lemma LIM_unique2: "[| f -- x --> L; f -- x --> M |] ==> L = M" |
387 by (simp add: LIM_NSLIM_iff NSLIM_unique) |
386 by (simp add: LIM_NSLIM_iff NSLIM_unique) |
388 |
387 |
389 |
388 |
390 lemma NSLIM_mult_zero: "[| f -- x --NS> 0; g -- x --NS> 0 |] ==> (%x. f(x)*g(x)) -- x --NS> 0" |
389 lemma NSLIM_mult_zero: |
|
390 fixes f g :: "real \<Rightarrow> 'a::real_normed_algebra" |
|
391 shows "[| f -- x --NS> 0; g -- x --NS> 0 |] ==> (%x. f(x)*g(x)) -- x --NS> 0" |
391 by (drule NSLIM_mult, auto) |
392 by (drule NSLIM_mult, auto) |
392 |
393 |
393 (* we can use the corresponding thm LIM_mult2 *) |
394 (* we can use the corresponding thm LIM_mult2 *) |
394 (* for standard definition of limit *) |
395 (* for standard definition of limit *) |
395 |
396 |
396 lemma LIM_mult_zero2: "[| f -- x --> 0; g -- x --> 0 |] ==> (%x. f(x)*g(x)) -- x --> 0" |
397 lemma LIM_mult_zero2: |
|
398 fixes f g :: "real \<Rightarrow> 'a::real_normed_algebra" |
|
399 shows "[| f -- x --> 0; g -- x --> 0 |] ==> (%x. f(x)*g(x)) -- x --> 0" |
397 by (drule LIM_mult2, auto) |
400 by (drule LIM_mult2, auto) |
398 |
401 |
399 |
402 |
400 lemma NSLIM_self: "(%x. x) -- a --NS> a" |
403 lemma NSLIM_self: "(%x. x) -- a --NS> a" |
401 by (simp add: NSLIM_def) |
404 by (simp add: NSLIM_def) |
576 lemma isUCont_isCont: "isUCont f ==> isCont f x" |
584 lemma isUCont_isCont: "isUCont f ==> isCont f x" |
577 by (simp add: isUCont_def isCont_def LIM_def, meson) |
585 by (simp add: isUCont_def isCont_def LIM_def, meson) |
578 |
586 |
579 lemma isUCont_isNSUCont: "isUCont f ==> isNSUCont f" |
587 lemma isUCont_isNSUCont: "isUCont f ==> isNSUCont f" |
580 apply (simp add: isNSUCont_def isUCont_def approx_def) |
588 apply (simp add: isNSUCont_def isUCont_def approx_def) |
|
589 apply (simp add: all_star_eq starfun star_n_minus star_n_add) |
581 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) |
590 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) |
582 apply (rule_tac x = x in star_cases) |
591 apply (rename_tac Xa Xb u) |
583 apply (rule_tac x = y in star_cases) |
|
584 apply (auto simp add: starfun star_n_minus star_n_add) |
|
585 apply (rule bexI [OF _ Rep_star_star_n], safe) |
|
586 apply (drule_tac x = u in spec, clarify) |
592 apply (drule_tac x = u in spec, clarify) |
587 apply (drule_tac x = s in spec, clarify) |
593 apply (drule_tac x = s in spec, clarify) |
588 apply (subgoal_tac "\<forall>n::nat. abs ((Xa n) + - (Xb n)) < s --> abs (f (Xa n) + - f (Xb n)) < u") |
594 apply (subgoal_tac "\<forall>n::nat. abs ((Xa n) + - (Xb n)) < s --> abs (f (Xa n) + - f (Xb n)) < u") |
589 prefer 2 apply blast |
595 prefer 2 apply blast |
590 apply (erule_tac V = "\<forall>x y. \<bar>x + - y\<bar> < s --> \<bar>f x + - f y\<bar> < u" in thin_rl) |
596 apply (erule_tac V = "\<forall>x y. \<bar>x + - y\<bar> < s --> \<bar>f x + - f y\<bar> < u" in thin_rl) |
591 apply (drule FreeUltrafilterNat_all, ultra) |
597 apply (erule ultra, simp) |
592 done |
598 done |
593 |
599 |
594 lemma lemma_LIMu: "\<forall>s>0.\<exists>z y. \<bar>z + - y\<bar> < s & r \<le> \<bar>f z + -f y\<bar> |
600 lemma lemma_LIMu: "\<forall>s>0.\<exists>z y. \<bar>z + - y\<bar> < s & r \<le> \<bar>f z + -f y\<bar> |
595 ==> \<forall>n::nat. \<exists>z y. \<bar>z + -y\<bar> < inverse(real(Suc n)) & r \<le> \<bar>f z + -f y\<bar>" |
601 ==> \<forall>n::nat. \<exists>z y. \<bar>z + -y\<bar> < inverse(real(Suc n)) & r \<le> \<bar>f z + -f y\<bar>" |
596 apply clarify |
602 apply clarify |
613 \<forall>n. \<bar>X n + - Y n\<bar> < inverse (real(Suc n))" |
619 \<forall>n. \<bar>X n + - Y n\<bar> < inverse (real(Suc n))" |
614 by auto |
620 by auto |
615 |
621 |
616 lemma isNSUCont_isUCont: |
622 lemma isNSUCont_isUCont: |
617 "isNSUCont f ==> isUCont f" |
623 "isNSUCont f ==> isUCont f" |
618 apply (simp add: isNSUCont_def isUCont_def approx_def) |
624 apply (simp add: isNSUCont_def isUCont_def approx_def, safe) |
619 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff, safe) |
|
620 apply (rule ccontr, simp) |
625 apply (rule ccontr, simp) |
621 apply (simp add: linorder_not_less) |
626 apply (simp add: linorder_not_less) |
622 apply (drule lemma_skolemize_LIM2u, safe) |
627 apply (drule lemma_skolemize_LIM2u, safe) |
623 apply (drule_tac x = "star_n X" in spec) |
628 apply (drule_tac x = "star_n X" in spec) |
624 apply (drule_tac x = "star_n Y" in spec) |
629 apply (drule_tac x = "star_n Y" in spec) |
625 apply (simp add: starfun star_n_minus star_n_add, auto) |
630 apply (drule mp) |
626 apply (drule lemma_simpu [THEN real_seq_to_hypreal_Infinitesimal2]) |
631 apply (rule real_seq_to_hypreal_Infinitesimal2, simp) |
627 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff star_n_minus star_n_add, blast) |
632 apply (simp add: all_star_eq starfun star_n_minus star_n_add) |
628 apply (drule_tac x = r in spec, clarify) |
633 apply (simp add: Infinitesimal_FreeUltrafilterNat_iff) |
|
634 apply (drule spec, drule (1) mp) |
629 apply (drule FreeUltrafilterNat_all, ultra) |
635 apply (drule FreeUltrafilterNat_all, ultra) |
630 done |
636 done |
631 |
637 |
632 text{*Derivatives*} |
638 text{*Derivatives*} |
633 lemma DERIV_iff: "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- 0 --> D)" |
639 lemma DERIV_iff: "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- 0 --> D)" |
1439 apply (simp_all add: abs_if) |
1440 apply (simp_all add: abs_if) |
1440 apply (drule_tac x = "aa-x" in spec) |
1441 apply (drule_tac x = "aa-x" in spec) |
1441 apply (case_tac "x \<le> aa", simp_all) |
1442 apply (case_tac "x \<le> aa", simp_all) |
1442 done |
1443 done |
1443 |
1444 |
1444 lemma IVT2: "[| f(b) \<le> y; y \<le> f(a); |
1445 lemma IVT2: "[| f(b) \<le> (y::real); y \<le> f(a); |
1445 a \<le> b; |
1446 a \<le> b; |
1446 (\<forall>x. a \<le> x & x \<le> b --> isCont f x) |
1447 (\<forall>x. a \<le> x & x \<le> b --> isCont f x) |
1447 |] ==> \<exists>x. a \<le> x & x \<le> b & f(x) = y" |
1448 |] ==> \<exists>x. a \<le> x & x \<le> b & f(x) = y" |
1448 apply (subgoal_tac "- f a \<le> -y & -y \<le> - f b", clarify) |
1449 apply (subgoal_tac "- f a \<le> -y & -y \<le> - f b", clarify) |
1449 apply (drule IVT [where f = "%x. - f x"], assumption) |
1450 apply (drule IVT [where f = "%x. - f x"], assumption) |
1450 apply (auto intro: isCont_minus) |
1451 apply (auto intro: isCont_minus) |
1451 done |
1452 done |
1452 |
1453 |
1453 (*HOL style here: object-level formulations*) |
1454 (*HOL style here: object-level formulations*) |
1454 lemma IVT_objl: "(f(a) \<le> y & y \<le> f(b) & a \<le> b & |
1455 lemma IVT_objl: "(f(a) \<le> (y::real) & y \<le> f(b) & a \<le> b & |
1455 (\<forall>x. a \<le> x & x \<le> b --> isCont f x)) |
1456 (\<forall>x. a \<le> x & x \<le> b --> isCont f x)) |
1456 --> (\<exists>x. a \<le> x & x \<le> b & f(x) = y)" |
1457 --> (\<exists>x. a \<le> x & x \<le> b & f(x) = y)" |
1457 apply (blast intro: IVT) |
1458 apply (blast intro: IVT) |
1458 done |
1459 done |
1459 |
1460 |
1460 lemma IVT2_objl: "(f(b) \<le> y & y \<le> f(a) & a \<le> b & |
1461 lemma IVT2_objl: "(f(b) \<le> (y::real) & y \<le> f(a) & a \<le> b & |
1461 (\<forall>x. a \<le> x & x \<le> b --> isCont f x)) |
1462 (\<forall>x. a \<le> x & x \<le> b --> isCont f x)) |
1462 --> (\<exists>x. a \<le> x & x \<le> b & f(x) = y)" |
1463 --> (\<exists>x. a \<le> x & x \<le> b & f(x) = y)" |
1463 apply (blast intro: IVT2) |
1464 apply (blast intro: IVT2) |
1464 done |
1465 done |
1465 |
1466 |
1466 subsection{*By bisection, function continuous on closed interval is bounded above*} |
1467 subsection{*By bisection, function continuous on closed interval is bounded above*} |
1467 |
1468 |
1468 lemma isCont_bounded: |
1469 lemma isCont_bounded: |
1469 "[| a \<le> b; \<forall>x. a \<le> x & x \<le> b --> isCont f x |] |
1470 "[| a \<le> b; \<forall>x. a \<le> x & x \<le> b --> isCont f x |] |
1470 ==> \<exists>M. \<forall>x. a \<le> x & x \<le> b --> f(x) \<le> M" |
1471 ==> \<exists>M::real. \<forall>x. a \<le> x & x \<le> b --> f(x) \<le> M" |
1471 apply (cut_tac P = "% (u,v) . a \<le> u & u \<le> v & v \<le> b --> (\<exists>M. \<forall>x. u \<le> x & x \<le> v --> f x \<le> M)" in lemma_BOLZANO2) |
1472 apply (cut_tac P = "% (u,v) . a \<le> u & u \<le> v & v \<le> b --> (\<exists>M. \<forall>x. u \<le> x & x \<le> v --> f x \<le> M)" in lemma_BOLZANO2) |
1472 apply safe |
1473 apply safe |
1473 apply simp_all |
1474 apply simp_all |
1474 apply (rename_tac x xa ya M Ma) |
1475 apply (rename_tac x xa ya M Ma) |
1475 apply (cut_tac x = M and y = Ma in linorder_linear, safe) |
1476 apply (cut_tac x = M and y = Ma in linorder_linear, safe) |
2203 lemma LIMSEQ_SEQ_conv1: |
2207 lemma LIMSEQ_SEQ_conv1: |
2204 assumes "X -- a --> L" |
2208 assumes "X -- a --> L" |
2205 shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L" |
2209 shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L" |
2206 proof - |
2210 proof - |
2207 { |
2211 { |
2208 from prems have Xdef: "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s --> \<bar>X x + -L\<bar> < r" by (unfold LIM_def) |
2212 from prems have Xdef: "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s --> norm (X x + -L) < r" by (unfold LIM_def) |
2209 |
2213 |
2210 fix S |
2214 fix S |
2211 assume as: "(\<forall>n. S n \<noteq> a) \<and> S ----> a" |
2215 assume as: "(\<forall>n. S n \<noteq> a) \<and> S ----> a" |
2212 then have "S ----> a" by auto |
2216 then have "S ----> a" by auto |
2213 then have Sdef: "(\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> \<bar>S n + -a\<bar> < r))" by (unfold LIMSEQ_def) |
2217 then have Sdef: "(\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> norm (S n + -a) < r))" by (unfold LIMSEQ_def) |
2214 { |
2218 { |
2215 fix r |
2219 fix r |
2216 from Xdef have Xdef2: "0 < r --> (\<exists>s > 0. \<forall>x. x \<noteq> a \<and> \<bar>x + -a\<bar> < s --> \<bar>X x + -L\<bar> < r)" by simp |
2220 from Xdef have Xdef2: "0 < r --> (\<exists>s > 0. \<forall>x. x \<noteq> a \<and> \<bar>x + -a\<bar> < s --> norm (X x + -L) < r)" by simp |
2217 { |
2221 { |
2218 assume rgz: "0 < r" |
2222 assume rgz: "0 < r" |
2219 |
2223 |
2220 from Xdef2 rgz have "\<exists>s > 0. \<forall>x. x \<noteq> a \<and> \<bar>x + -a\<bar> < s --> \<bar>X x + -L\<bar> < r" by simp |
2224 from Xdef2 rgz have "\<exists>s > 0. \<forall>x. x \<noteq> a \<and> \<bar>x + -a\<bar> < s --> norm (X x + -L) < r" by simp |
2221 then obtain s where sdef: "s > 0 \<and> (\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> \<bar>X x + -L\<bar> < r)" by auto |
2225 then obtain s where sdef: "s > 0 \<and> (\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> norm (X x + -L) < r)" by auto |
2222 then have aux: "\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> \<bar>X x + -L\<bar> < r" by auto |
2226 then have aux: "\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> norm (X x + -L) < r" by auto |
2223 { |
2227 { |
2224 fix n |
2228 fix n |
2225 from aux have "S n \<noteq> a \<and> \<bar>S n + -a\<bar> < s \<longrightarrow> \<bar>X (S n) + -L\<bar> < r" by simp |
2229 from aux have "S n \<noteq> a \<and> \<bar>S n + -a\<bar> < s \<longrightarrow> norm (X (S n) + -L) < r" by simp |
2226 with as have imp2: "\<bar>S n + -a\<bar> < s --> \<bar>X (S n) + -L\<bar> < r" by auto |
2230 with as have imp2: "\<bar>S n + -a\<bar> < s --> norm (X (S n) + -L) < r" by auto |
2227 } |
2231 } |
2228 hence "\<forall>n. \<bar>S n + -a\<bar> < s --> \<bar>X (S n) + -L\<bar> < r" .. |
2232 hence "\<forall>n. \<bar>S n + -a\<bar> < s --> norm (X (S n) + -L) < r" .. |
2229 moreover |
2233 moreover |
2230 from Sdef sdef have imp1: "\<exists>no. \<forall>n. no \<le> n --> \<bar>S n + -a\<bar> < s" by auto |
2234 from Sdef sdef have imp1: "\<exists>no. \<forall>n. no \<le> n --> \<bar>S n + -a\<bar> < s" by auto |
2231 then obtain no where "\<forall>n. no \<le> n --> \<bar>S n + -a\<bar> < s" by auto |
2235 then obtain no where "\<forall>n. no \<le> n --> \<bar>S n + -a\<bar> < s" by auto |
2232 ultimately have "\<forall>n. no \<le> n \<longrightarrow> \<bar>X (S n) + -L\<bar> < r" by simp |
2236 ultimately have "\<forall>n. no \<le> n \<longrightarrow> norm (X (S n) + -L) < r" by simp |
2233 hence "\<exists>no. \<forall>n. no \<le> n \<longrightarrow> \<bar>X (S n) + -L\<bar> < r" by auto |
2237 hence "\<exists>no. \<forall>n. no \<le> n \<longrightarrow> norm (X (S n) + -L) < r" by auto |
2234 } |
2238 } |
2235 } |
2239 } |
2236 hence "(\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> \<bar>X (S n) + -L\<bar> < r))" by simp |
2240 hence "(\<forall>r. 0 < r --> (\<exists>no. \<forall>n. no \<le> n --> norm (X (S n) + -L) < r))" by simp |
2237 hence "(\<lambda>n. X (S n)) ----> L" by (fold LIMSEQ_def) |
2241 hence "(\<lambda>n. X (S n)) ----> L" by (fold LIMSEQ_def) |
2238 } |
2242 } |
2239 thus ?thesis by simp |
2243 thus ?thesis by simp |
2240 qed |
2244 qed |
2241 |
2245 |
2305 { |
2309 { |
2306 fix no::nat |
2310 fix no::nat |
2307 obtain n where "n = no + 1" by simp |
2311 obtain n where "n = no + 1" by simp |
2308 then have nolen: "no \<le> n" by simp |
2312 then have nolen: "no \<le> n" by simp |
2309 (* We prove this by showing that for any m there is an n\<ge>m such that |X (?F n) - L| \<ge> r *) |
2313 (* We prove this by showing that for any m there is an n\<ge>m such that |X (?F n) - L| \<ge> r *) |
2310 from rdef have "\<forall>s > 0. \<exists>x. (x \<noteq> a \<and> \<bar>x + -a\<bar> < s \<and> \<bar>X x + -L\<bar> \<ge> r)" .. |
2314 from rdef have "\<forall>s > 0. \<exists>x. (x \<noteq> a \<and> \<bar>x + -a\<bar> < s \<and> norm (X x + -L) \<ge> r)" .. |
2311 |
2315 |
2312 then have "\<exists>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < inverse (real (Suc n)) \<and> \<bar>X x + -L\<bar> \<ge> r" by simp |
2316 then have "\<exists>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < inverse (real (Suc n)) \<and> norm (X x + -L) \<ge> r" by simp |
2313 |
2317 |
2314 hence "\<bar>X (?F n) + -L\<bar> \<ge> r" by (simp add: some_eq_ex [symmetric]) |
2318 hence "norm (X (?F n) + -L) \<ge> r" by (simp add: some_eq_ex [symmetric]) |
2315 with nolen have "\<exists>n. no \<le> n \<and> \<bar>X (?F n) + -L\<bar> \<ge> r" by auto |
2319 with nolen have "\<exists>n. no \<le> n \<and> norm (X (?F n) + -L) \<ge> r" by auto |
2316 } |
2320 } |
2317 then have "(\<forall>no. \<exists>n. no \<le> n \<and> \<bar>X (?F n) + -L\<bar> \<ge> r)" by simp |
2321 then have "(\<forall>no. \<exists>n. no \<le> n \<and> norm (X (?F n) + -L) \<ge> r)" by simp |
2318 with rdef have "\<exists>e>0. (\<forall>no. \<exists>n. no \<le> n \<and> \<bar>X (?F n) + -L\<bar> \<ge> e)" by auto |
2322 with rdef have "\<exists>e>0. (\<forall>no. \<exists>n. no \<le> n \<and> norm (X (?F n) + -L) \<ge> e)" by auto |
2319 thus ?thesis by (unfold LIMSEQ_def, auto simp add: linorder_not_less) |
2323 thus ?thesis by (unfold LIMSEQ_def, auto simp add: linorder_not_less) |
2320 qed |
2324 qed |
2321 ultimately show False by simp |
2325 ultimately show False by simp |
2322 qed |
2326 qed |
2323 |
2327 |
2350 assumes "(\<lambda>x. f x) -- a --> L" |
2354 assumes "(\<lambda>x. f x) -- a --> L" |
2351 shows "(\<lambda>x. f (x+c)) -- (a-c) --> L" |
2355 shows "(\<lambda>x. f (x+c)) -- (a-c) --> L" |
2352 proof - |
2356 proof - |
2353 have "f -- a --> L" . |
2357 have "f -- a --> L" . |
2354 hence |
2358 hence |
2355 fd: "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s --> \<bar>f x + -L\<bar> < r" |
2359 fd: "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & \<bar>x + -a\<bar> < s --> norm (f x + -L) < r" |
2356 by (unfold LIM_def) |
2360 by (unfold LIM_def) |
2357 { |
2361 { |
2358 fix r::real |
2362 fix r::real |
2359 assume rgz: "0 < r" |
2363 assume rgz: "0 < r" |
2360 with fd have "\<exists>s > 0. \<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s --> \<bar>f x + -L\<bar> < r" by simp |
2364 with fd have "\<exists>s > 0. \<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s --> norm (f x + -L) < r" by simp |
2361 then obtain s where sgz: "s > 0" and ax: "\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> \<bar>f x + -L\<bar> < r" by auto |
2365 then obtain s where sgz: "s > 0" and ax: "\<forall>x. x\<noteq>a \<and> \<bar>x + -a\<bar> < s \<longrightarrow> norm (f x + -L) < r" by auto |
2362 from ax have ax2: "\<forall>x. (x+c)\<noteq>a \<and> \<bar>(x+c) + -a\<bar> < s \<longrightarrow> \<bar>f (x+c) + -L\<bar> < r" by auto |
2366 from ax have ax2: "\<forall>x. (x+c)\<noteq>a \<and> \<bar>(x+c) + -a\<bar> < s \<longrightarrow> norm (f (x+c) + -L) < r" by auto |
2363 { |
2367 { |
2364 fix x::real |
2368 fix x::real |
2365 from ax2 have nt: "(x+c)\<noteq>a \<and> \<bar>(x+c) + -a\<bar> < s \<longrightarrow> \<bar>f (x+c) + -L\<bar> < r" .. |
2369 from ax2 have nt: "(x+c)\<noteq>a \<and> \<bar>(x+c) + -a\<bar> < s \<longrightarrow> norm (f (x+c) + -L) < r" .. |
2366 moreover have "((x+c)\<noteq>a) = (x\<noteq>(a-c))" by auto |
2370 moreover have "((x+c)\<noteq>a) = (x\<noteq>(a-c))" by auto |
2367 moreover have "((x+c) + -a) = (x + -(a-c))" by simp |
2371 moreover have "((x+c) + -a) = (x + -(a-c))" by simp |
2368 ultimately have "x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> \<bar>f (x+c) + -L\<bar> < r" by simp |
2372 ultimately have "x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> norm (f (x+c) + -L) < r" by simp |
2369 } |
2373 } |
2370 then have "\<forall>x. x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> \<bar>f (x+c) + -L\<bar> < r" .. |
2374 then have "\<forall>x. x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> norm (f (x+c) + -L) < r" .. |
2371 with sgz have "\<exists>s > 0. \<forall>x. x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> \<bar>f (x+c) + -L\<bar> < r" by auto |
2375 with sgz have "\<exists>s > 0. \<forall>x. x\<noteq>(a-c) \<and> \<bar>x + -(a-c)\<bar> < s \<longrightarrow> norm (f (x+c) + -L) < r" by auto |
2372 } |
2376 } |
2373 then have |
2377 then have |
2374 "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> (a-c) & \<bar>x + -(a-c)\<bar> < s --> \<bar>f (x+c) + -L\<bar> < r" by simp |
2378 "\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> (a-c) & \<bar>x + -(a-c)\<bar> < s --> norm (f (x+c) + -L) < r" by simp |
2375 thus ?thesis by (fold LIM_def) |
2379 thus ?thesis by (fold LIM_def) |
2376 qed |
2380 qed |
2377 |
2381 |
2378 end |
2382 end |