44 |
44 |
45 NSCLIM :: "[complex=>complex,complex,complex] => bool" |
45 NSCLIM :: "[complex=>complex,complex,complex] => bool" |
46 ("((_)/ -- (_)/ --NSC> (_))" [60, 0, 60] 60) |
46 ("((_)/ -- (_)/ --NSC> (_))" [60, 0, 60] 60) |
47 "f -- a --NSC> L == (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
47 "f -- a --NSC> L == (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
48 x @c= hcomplex_of_complex a |
48 x @c= hcomplex_of_complex a |
49 --> ( *fc* f) x @c= hcomplex_of_complex L))" |
49 --> ( *f* f) x @c= hcomplex_of_complex L))" |
50 |
50 |
51 (* f: C --> R *) |
51 (* f: C --> R *) |
52 CRLIM :: "[complex=>real,complex,real] => bool" |
52 CRLIM :: "[complex=>real,complex,real] => bool" |
53 ("((_)/ -- (_)/ --CR> (_))" [60, 0, 60] 60) |
53 ("((_)/ -- (_)/ --CR> (_))" [60, 0, 60] 60) |
54 "f -- a --CR> L == |
54 "f -- a --CR> L == |
58 |
58 |
59 NSCRLIM :: "[complex=>real,complex,real] => bool" |
59 NSCRLIM :: "[complex=>real,complex,real] => bool" |
60 ("((_)/ -- (_)/ --NSCR> (_))" [60, 0, 60] 60) |
60 ("((_)/ -- (_)/ --NSCR> (_))" [60, 0, 60] 60) |
61 "f -- a --NSCR> L == (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
61 "f -- a --NSCR> L == (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
62 x @c= hcomplex_of_complex a |
62 x @c= hcomplex_of_complex a |
63 --> ( *fcR* f) x @= hypreal_of_real L))" |
63 --> ( *f* f) x @= hypreal_of_real L))" |
64 |
64 |
65 |
65 |
66 isContc :: "[complex=>complex,complex] => bool" |
66 isContc :: "[complex=>complex,complex] => bool" |
67 "isContc f a == (f -- a --C> (f a))" |
67 "isContc f a == (f -- a --C> (f a))" |
68 |
68 |
69 (* NS definition dispenses with limit notions *) |
69 (* NS definition dispenses with limit notions *) |
70 isNSContc :: "[complex=>complex,complex] => bool" |
70 isNSContc :: "[complex=>complex,complex] => bool" |
71 "isNSContc f a == (\<forall>y. y @c= hcomplex_of_complex a --> |
71 "isNSContc f a == (\<forall>y. y @c= hcomplex_of_complex a --> |
72 ( *fc* f) y @c= hcomplex_of_complex (f a))" |
72 ( *f* f) y @c= hcomplex_of_complex (f a))" |
73 |
73 |
74 isContCR :: "[complex=>real,complex] => bool" |
74 isContCR :: "[complex=>real,complex] => bool" |
75 "isContCR f a == (f -- a --CR> (f a))" |
75 "isContCR f a == (f -- a --CR> (f a))" |
76 |
76 |
77 (* NS definition dispenses with limit notions *) |
77 (* NS definition dispenses with limit notions *) |
78 isNSContCR :: "[complex=>real,complex] => bool" |
78 isNSContCR :: "[complex=>real,complex] => bool" |
79 "isNSContCR f a == (\<forall>y. y @c= hcomplex_of_complex a --> |
79 "isNSContCR f a == (\<forall>y. y @c= hcomplex_of_complex a --> |
80 ( *fcR* f) y @= hypreal_of_real (f a))" |
80 ( *f* f) y @= hypreal_of_real (f a))" |
81 |
81 |
82 (* differentiation: D is derivative of function f at x *) |
82 (* differentiation: D is derivative of function f at x *) |
83 cderiv:: "[complex=>complex,complex,complex] => bool" |
83 cderiv:: "[complex=>complex,complex,complex] => bool" |
84 ("(CDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) |
84 ("(CDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) |
85 "CDERIV f x :> D == ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)" |
85 "CDERIV f x :> D == ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)" |
86 |
86 |
87 nscderiv :: "[complex=>complex,complex,complex] => bool" |
87 nscderiv :: "[complex=>complex,complex,complex] => bool" |
88 ("(NSCDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) |
88 ("(NSCDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60) |
89 "NSCDERIV f x :> D == (\<forall>h \<in> CInfinitesimal - {0}. |
89 "NSCDERIV f x :> D == (\<forall>h \<in> CInfinitesimal - {0}. |
90 (( *fc* f)(hcomplex_of_complex x + h) |
90 (( *f* f)(hcomplex_of_complex x + h) |
91 - hcomplex_of_complex (f x))/h @c= hcomplex_of_complex D)" |
91 - hcomplex_of_complex (f x))/h @c= hcomplex_of_complex D)" |
92 |
92 |
93 cdifferentiable :: "[complex=>complex,complex] => bool" |
93 cdifferentiable :: "[complex=>complex,complex] => bool" |
94 (infixl "cdifferentiable" 60) |
94 (infixl "cdifferentiable" 60) |
95 "f cdifferentiable x == (\<exists>D. CDERIV f x :> D)" |
95 "f cdifferentiable x == (\<exists>D. CDERIV f x :> D)" |
121 hIm_hcomplex_of_complex) |
121 hIm_hcomplex_of_complex) |
122 |
122 |
123 lemma CLIM_NSCLIM: |
123 lemma CLIM_NSCLIM: |
124 "f -- x --C> L ==> f -- x --NSC> L" |
124 "f -- x --C> L ==> f -- x --NSC> L" |
125 apply (simp add: CLIM_def NSCLIM_def capprox_def, auto) |
125 apply (simp add: CLIM_def NSCLIM_def capprox_def, auto) |
126 apply (rule_tac z = xa in eq_Abs_star) |
126 apply (rule_tac x = xa in star_cases) |
127 apply (auto simp add: hcomplex_of_complex_def starfunC hcomplex_diff |
127 apply (auto simp add: starfun star_n_diff star_of_def star_n_eq_iff |
128 star_of_def star_n_def |
|
129 CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff) |
128 CInfinitesimal_hcmod_iff hcmod Infinitesimal_FreeUltrafilterNat_iff) |
130 apply (rule bexI, rule_tac [2] lemma_starrel_refl, safe) |
129 apply (rule bexI [OF _ Rep_star_star_n], safe) |
131 apply (drule_tac x = u in spec, auto) |
130 apply (drule_tac x = u in spec, auto) |
132 apply (drule_tac x = s in spec, auto, ultra) |
131 apply (drule_tac x = s in spec, auto, ultra) |
133 apply (drule sym, auto) |
132 apply (drule sym, auto) |
134 done |
133 done |
135 |
134 |
136 lemma eq_Abs_star_ALL: |
135 lemma eq_Abs_star_ALL: "(\<forall>t. P t) = (\<forall>X. P (star_n X))" |
137 "(\<forall>t. P t) = (\<forall>X. P (Abs_star(starrel `` {X})))" |
|
138 apply auto |
136 apply auto |
139 apply (rule_tac z = t in eq_Abs_star, auto) |
137 apply (rule_tac x = t in star_cases, auto) |
140 done |
138 done |
141 |
139 |
142 lemma lemma_CLIM: |
140 lemma lemma_CLIM: |
143 "\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
141 "\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
144 cmod (xa - x) < s & r \<le> cmod (f xa - L)) |
142 cmod (xa - x) < s & r \<le> cmod (f xa - L)) |
167 |
165 |
168 lemma NSCLIM_CLIM: |
166 lemma NSCLIM_CLIM: |
169 "f -- x --NSC> L ==> f -- x --C> L" |
167 "f -- x --NSC> L ==> f -- x --C> L" |
170 apply (simp add: CLIM_def NSCLIM_def) |
168 apply (simp add: CLIM_def NSCLIM_def) |
171 apply (rule ccontr) |
169 apply (rule ccontr) |
172 apply (auto simp add: eq_Abs_star_ALL starfunC |
170 apply (auto simp add: eq_Abs_star_ALL starfun |
173 CInfinitesimal_capprox_minus [symmetric] hcomplex_diff |
171 CInfinitesimal_capprox_minus [symmetric] star_n_diff |
174 CInfinitesimal_hcmod_iff hcomplex_of_complex_def |
172 CInfinitesimal_hcmod_iff star_of_def star_n_eq_iff |
175 star_of_def star_n_def |
|
176 Infinitesimal_FreeUltrafilterNat_iff hcmod) |
173 Infinitesimal_FreeUltrafilterNat_iff hcmod) |
177 apply (simp add: linorder_not_less) |
174 apply (simp add: linorder_not_less) |
178 apply (drule lemma_skolemize_CLIM2, safe) |
175 apply (drule lemma_skolemize_CLIM2, safe) |
179 apply (drule_tac x = X in spec, auto) |
176 apply (drule_tac x = X in spec, auto) |
180 apply (drule lemma_csimp [THEN complex_seq_to_hcomplex_CInfinitesimal]) |
177 apply (drule lemma_csimp [THEN complex_seq_to_hcomplex_CInfinitesimal]) |
181 apply (simp add: CInfinitesimal_hcmod_iff hcomplex_of_complex_def |
178 apply (simp add: CInfinitesimal_hcmod_iff star_of_def |
182 star_of_def star_n_def |
179 Infinitesimal_FreeUltrafilterNat_iff star_n_diff hcmod, blast) |
183 Infinitesimal_FreeUltrafilterNat_iff hcomplex_diff hcmod, blast) |
|
184 apply (drule_tac x = r in spec, clarify) |
180 apply (drule_tac x = r in spec, clarify) |
185 apply (drule FreeUltrafilterNat_all, ultra, arith) |
181 apply (drule FreeUltrafilterNat_all, ultra, arith) |
186 done |
182 done |
187 |
183 |
188 |
184 |
193 |
189 |
194 subsection{*Limit of Complex to Real Function*} |
190 subsection{*Limit of Complex to Real Function*} |
195 |
191 |
196 lemma CRLIM_NSCRLIM: "f -- x --CR> L ==> f -- x --NSCR> L" |
192 lemma CRLIM_NSCRLIM: "f -- x --CR> L ==> f -- x --NSCR> L" |
197 apply (simp add: CRLIM_def NSCRLIM_def capprox_def, auto) |
193 apply (simp add: CRLIM_def NSCRLIM_def capprox_def, auto) |
198 apply (rule_tac z = xa in eq_Abs_star) |
194 apply (rule_tac x = xa in star_cases) |
199 apply (auto simp add: hcomplex_of_complex_def starfunCR hcomplex_diff |
195 apply (auto simp add: starfun star_n_diff |
200 CInfinitesimal_hcmod_iff hcmod hypreal_diff |
196 CInfinitesimal_hcmod_iff hcmod |
201 Infinitesimal_FreeUltrafilterNat_iff |
197 Infinitesimal_FreeUltrafilterNat_iff |
202 star_of_def star_n_def |
198 star_of_def star_n_eq_iff |
203 Infinitesimal_approx_minus [symmetric] hypreal_of_real_def) |
199 Infinitesimal_approx_minus [symmetric]) |
204 apply (rule bexI, rule_tac [2] lemma_starrel_refl, safe) |
200 apply (rule bexI [OF _ Rep_star_star_n], safe) |
205 apply (drule_tac x = u in spec, auto) |
201 apply (drule_tac x = u in spec, auto) |
206 apply (drule_tac x = s in spec, auto, ultra) |
202 apply (drule_tac x = s in spec, auto, ultra) |
207 apply (drule sym, auto) |
203 apply (drule sym, auto) |
208 done |
204 done |
209 |
205 |
233 by auto |
229 by auto |
234 |
230 |
235 lemma NSCRLIM_CRLIM: "f -- x --NSCR> L ==> f -- x --CR> L" |
231 lemma NSCRLIM_CRLIM: "f -- x --NSCR> L ==> f -- x --CR> L" |
236 apply (simp add: CRLIM_def NSCRLIM_def capprox_def) |
232 apply (simp add: CRLIM_def NSCRLIM_def capprox_def) |
237 apply (rule ccontr) |
233 apply (rule ccontr) |
238 apply (auto simp add: eq_Abs_star_ALL starfunCR hcomplex_diff |
234 apply (auto simp add: eq_Abs_star_ALL starfun star_n_diff |
239 hcomplex_of_complex_def hypreal_diff CInfinitesimal_hcmod_iff |
235 CInfinitesimal_hcmod_iff |
240 hcmod Infinitesimal_approx_minus [symmetric] |
236 hcmod Infinitesimal_approx_minus [symmetric] |
241 star_of_def star_n_def |
237 star_of_def star_n_eq_iff |
242 Infinitesimal_FreeUltrafilterNat_iff) |
238 Infinitesimal_FreeUltrafilterNat_iff) |
243 apply (simp add: linorder_not_less) |
239 apply (simp add: linorder_not_less) |
244 apply (drule lemma_skolemize_CRLIM2, safe) |
240 apply (drule lemma_skolemize_CRLIM2, safe) |
245 apply (drule_tac x = X in spec, auto) |
241 apply (drule_tac x = X in spec, auto) |
246 apply (drule lemma_crsimp [THEN complex_seq_to_hcomplex_CInfinitesimal]) |
242 apply (drule lemma_crsimp [THEN complex_seq_to_hcomplex_CInfinitesimal]) |
247 apply (simp add: CInfinitesimal_hcmod_iff hcomplex_of_complex_def |
243 apply (simp add: CInfinitesimal_hcmod_iff star_of_def |
248 star_of_def star_n_def |
244 Infinitesimal_FreeUltrafilterNat_iff star_n_diff hcmod) |
249 Infinitesimal_FreeUltrafilterNat_iff hcomplex_diff hcmod) |
245 apply (auto simp add: star_of_def star_n_diff) |
250 apply (auto simp add: hypreal_of_real_def star_of_def star_n_def hypreal_diff) |
|
251 apply (drule_tac x = r in spec, clarify) |
246 apply (drule_tac x = r in spec, clarify) |
252 apply (drule FreeUltrafilterNat_all, ultra) |
247 apply (drule FreeUltrafilterNat_all, ultra) |
253 done |
248 done |
254 |
249 |
255 text{*Second key result*} |
250 text{*Second key result*} |
411 (** another equivalence result **) |
406 (** another equivalence result **) |
412 lemma NSCLIM_NSCRLIM_iff: |
407 lemma NSCLIM_NSCRLIM_iff: |
413 "(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)" |
408 "(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)" |
414 apply (auto simp add: NSCLIM_def NSCRLIM_def CInfinitesimal_capprox_minus [symmetric] CInfinitesimal_hcmod_iff) |
409 apply (auto simp add: NSCLIM_def NSCRLIM_def CInfinitesimal_capprox_minus [symmetric] CInfinitesimal_hcmod_iff) |
415 apply (auto dest!: spec) |
410 apply (auto dest!: spec) |
416 apply (rule_tac [!] z = xa in eq_Abs_star) |
411 apply (rule_tac [!] x = xa in star_cases) |
417 apply (auto simp add: hcomplex_diff starfunC starfunCR hcomplex_of_complex_def hcmod mem_infmal_iff star_of_def star_n_def) |
412 apply (auto simp add: star_n_diff starfun hcmod mem_infmal_iff star_of_def) |
418 done |
413 done |
419 |
414 |
420 (** much, much easier standard proof **) |
415 (** much, much easier standard proof **) |
421 lemma CLIM_CRLIM_iff: "(f -- x --C> L) = ((%y. cmod(f y - L)) -- x --CR> 0)" |
416 lemma CLIM_CRLIM_iff: "(f -- x --C> L) = ((%y. cmod(f y - L)) -- x --CR> 0)" |
422 by (simp add: CLIM_def CRLIM_def) |
417 by (simp add: CLIM_def CRLIM_def) |
430 "(f -- a --NSC> L) = ((%x. Re(f x)) -- a --NSCR> Re(L) & |
425 "(f -- a --NSC> L) = ((%x. Re(f x)) -- a --NSCR> Re(L) & |
431 (%x. Im(f x)) -- a --NSCR> Im(L))" |
426 (%x. Im(f x)) -- a --NSCR> Im(L))" |
432 apply (auto intro: NSCLIM_NSCRLIM_Re NSCLIM_NSCRLIM_Im) |
427 apply (auto intro: NSCLIM_NSCRLIM_Re NSCLIM_NSCRLIM_Im) |
433 apply (auto simp add: NSCLIM_def NSCRLIM_def) |
428 apply (auto simp add: NSCLIM_def NSCRLIM_def) |
434 apply (auto dest!: spec) |
429 apply (auto dest!: spec) |
435 apply (rule_tac z = x in eq_Abs_star) |
430 apply (rule_tac x = x in star_cases) |
436 apply (simp add: capprox_approx_iff starfunC hcomplex_of_complex_def starfunCR hypreal_of_real_def star_of_def star_n_def) |
431 apply (simp add: capprox_approx_iff starfun star_of_def) |
437 done |
432 done |
438 |
433 |
439 lemma CLIM_CRLIM_Re_Im_iff: |
434 lemma CLIM_CRLIM_Re_Im_iff: |
440 "(f -- a --C> L) = ((%x. Re(f x)) -- a --CR> Re(L) & |
435 "(f -- a --C> L) = ((%x. Re(f x)) -- a --CR> Re(L) & |
441 (%x. Im(f x)) -- a --CR> Im(L))" |
436 (%x. Im(f x)) -- a --CR> Im(L))" |
483 apply (simp add: NSCLIM_def, auto) |
478 apply (simp add: NSCLIM_def, auto) |
484 apply (drule_tac x = "hcomplex_of_complex a + x" in spec) |
479 apply (drule_tac x = "hcomplex_of_complex a + x" in spec) |
485 apply (drule_tac [2] x = "- hcomplex_of_complex a + x" in spec, safe, simp) |
480 apply (drule_tac [2] x = "- hcomplex_of_complex a + x" in spec, safe, simp) |
486 apply (rule mem_cinfmal_iff [THEN iffD2, THEN CInfinitesimal_add_capprox_self [THEN capprox_sym]]) |
481 apply (rule mem_cinfmal_iff [THEN iffD2, THEN CInfinitesimal_add_capprox_self [THEN capprox_sym]]) |
487 apply (rule_tac [4] capprox_minus_iff2 [THEN iffD1]) |
482 apply (rule_tac [4] capprox_minus_iff2 [THEN iffD1]) |
488 prefer 3 apply (simp add: compare_rls hcomplex_add_commute) |
483 prefer 3 apply (simp add: compare_rls add_commute) |
489 apply (rule_tac [2] z = x in eq_Abs_star) |
484 apply (rule_tac [2] x = x in star_cases) |
490 apply (rule_tac [4] z = x in eq_Abs_star) |
485 apply (rule_tac [4] x = x in star_cases) |
491 apply (auto simp add: starfunC hcomplex_of_complex_def hcomplex_minus hcomplex_add star_of_def star_n_def) |
486 apply (auto simp add: starfun star_n_minus star_n_add star_of_def) |
492 done |
487 done |
493 |
488 |
494 lemma NSCLIM_isContc_iff: |
489 lemma NSCLIM_isContc_iff: |
495 "(f -- a --NSC> f a) = ((%h. f(a + h)) -- 0 --NSC> f a)" |
490 "(f -- a --NSC> f a) = ((%h. f(a + h)) -- 0 --NSC> f a)" |
496 by (rule NSCLIM_h_iff) |
491 by (rule NSCLIM_h_iff) |
505 "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) + g(x)) a" |
500 "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) + g(x)) a" |
506 by (auto intro: capprox_add simp add: isNSContc_isContc_iff [symmetric] isNSContc_def) |
501 by (auto intro: capprox_add simp add: isNSContc_isContc_iff [symmetric] isNSContc_def) |
507 |
502 |
508 lemma isContc_mult: |
503 lemma isContc_mult: |
509 "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) * g(x)) a" |
504 "[| isContc f a; isContc g a |] ==> isContc (%x. f(x) * g(x)) a" |
510 by (auto intro!: starfunC_mult_CFinite_capprox |
505 by (auto intro!: starfun_mult_CFinite_capprox |
511 simp del: starfunC_mult [symmetric] |
506 [simplified starfun_mult [symmetric]] |
512 simp add: isNSContc_isContc_iff [symmetric] isNSContc_def) |
507 simp add: isNSContc_isContc_iff [symmetric] isNSContc_def) |
513 |
508 |
514 |
509 |
515 lemma isContc_o: "[| isContc f a; isContc g (f a) |] ==> isContc (g o f) a" |
510 lemma isContc_o: "[| isContc f a; isContc g (f a) |] ==> isContc (g o f) a" |
516 by (simp add: isNSContc_isContc_iff [symmetric] isNSContc_def starfunC_o [symmetric]) |
511 by (simp add: isNSContc_isContc_iff [symmetric] isNSContc_def starfun_o [symmetric]) |
517 |
512 |
518 lemma isContc_o2: |
513 lemma isContc_o2: |
519 "[| isContc f a; isContc g (f a) |] ==> isContc (%x. g (f x)) a" |
514 "[| isContc f a; isContc g (f a) |] ==> isContc (%x. g (f x)) a" |
520 by (auto dest: isContc_o simp add: o_def) |
515 by (auto dest: isContc_o simp add: o_def) |
521 |
516 |
649 "(NSCDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)" |
644 "(NSCDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)" |
650 apply (simp add: nscderiv_def NSCLIM_def, auto) |
645 apply (simp add: nscderiv_def NSCLIM_def, auto) |
651 apply (drule_tac x = xa in bspec) |
646 apply (drule_tac x = xa in bspec) |
652 apply (rule_tac [3] ccontr) |
647 apply (rule_tac [3] ccontr) |
653 apply (drule_tac [3] x = h in spec) |
648 apply (drule_tac [3] x = h in spec) |
654 apply (auto simp add: mem_cinfmal_iff starfunC_lambda_cancel) |
649 apply (auto simp add: mem_cinfmal_iff starfun_lambda_cancel) |
655 done |
650 done |
656 |
651 |
657 (*** 2nd equivalence ***) |
652 (*** 2nd equivalence ***) |
658 lemma NSCDERIV_NSCLIM_iff2: |
653 lemma NSCDERIV_NSCLIM_iff2: |
659 "(NSCDERIV f x :> D) = ((%z. (f(z) - f(x)) / (z - x)) -- x --NSC> D)" |
654 "(NSCDERIV f x :> D) = ((%z. (f(z) - f(x)) / (z - x)) -- x --NSC> D)" |
660 by (simp add: NSCDERIV_NSCLIM_iff CDERIV_CLIM_iff CLIM_NSCLIM_iff [symmetric]) |
655 by (simp add: NSCDERIV_NSCLIM_iff CDERIV_CLIM_iff CLIM_NSCLIM_iff [symmetric]) |
661 |
656 |
662 lemma NSCDERIV_iff2: |
657 lemma NSCDERIV_iff2: |
663 "(NSCDERIV f x :> D) = |
658 "(NSCDERIV f x :> D) = |
664 (\<forall>xa. xa \<noteq> hcomplex_of_complex x & xa @c= hcomplex_of_complex x --> |
659 (\<forall>xa. xa \<noteq> hcomplex_of_complex x & xa @c= hcomplex_of_complex x --> |
665 ( *fc* (%z. (f z - f x) / (z - x))) xa @c= hcomplex_of_complex D)" |
660 ( *f* (%z. (f z - f x) / (z - x))) xa @c= hcomplex_of_complex D)" |
666 by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
661 by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
667 |
662 |
668 lemma NSCDERIV_CDERIV_iff: "(NSCDERIV f x :> D) = (CDERIV f x :> D)" |
663 lemma NSCDERIV_CDERIV_iff: "(NSCDERIV f x :> D) = (CDERIV f x :> D)" |
669 by (simp add: cderiv_def NSCDERIV_NSCLIM_iff CLIM_NSCLIM_iff) |
664 by (simp add: cderiv_def NSCDERIV_NSCLIM_iff CLIM_NSCLIM_iff) |
670 |
665 |
732 lemma NSCDERIV_mult: |
727 lemma NSCDERIV_mult: |
733 "[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
728 "[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
734 ==> NSCDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))" |
729 ==> NSCDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))" |
735 apply (simp add: NSCDERIV_NSCLIM_iff NSCLIM_def, clarify) |
730 apply (simp add: NSCDERIV_NSCLIM_iff NSCLIM_def, clarify) |
736 apply (auto dest!: spec |
731 apply (auto dest!: spec |
737 simp add: starfunC_lambda_cancel lemma_nscderiv1) |
732 simp add: starfun_lambda_cancel lemma_nscderiv1) |
738 apply (simp (no_asm) add: add_divide_distrib) |
733 apply (simp (no_asm) add: add_divide_distrib) |
739 apply (drule bex_CInfinitesimal_iff2 [THEN iffD2])+ |
734 apply (drule bex_CInfinitesimal_iff2 [THEN iffD2])+ |
740 apply (auto simp del: times_divide_eq_right simp add: times_divide_eq_right [symmetric]) |
735 apply (auto simp del: times_divide_eq_right simp add: times_divide_eq_right [symmetric]) |
741 apply (simp add: diff_minus) |
736 apply (simp add: diff_minus) |
742 apply (drule_tac D = Db in lemma_nscderiv2) |
737 apply (drule_tac D = Db in lemma_nscderiv2) |
801 subsection{*Chain Rule*} |
796 subsection{*Chain Rule*} |
802 |
797 |
803 (* lemmas *) |
798 (* lemmas *) |
804 lemma NSCDERIV_zero: |
799 lemma NSCDERIV_zero: |
805 "[| NSCDERIV g x :> D; |
800 "[| NSCDERIV g x :> D; |
806 ( *fc* g) (hcomplex_of_complex(x) + xa) = hcomplex_of_complex(g x); |
801 ( *f* g) (hcomplex_of_complex(x) + xa) = hcomplex_of_complex(g x); |
807 xa : CInfinitesimal; xa \<noteq> 0 |
802 xa : CInfinitesimal; xa \<noteq> 0 |
808 |] ==> D = 0" |
803 |] ==> D = 0" |
809 apply (simp add: nscderiv_def) |
804 apply (simp add: nscderiv_def) |
810 apply (drule bspec, auto) |
805 apply (drule bspec, auto) |
811 done |
806 done |
812 |
807 |
813 lemma NSCDERIV_capprox: |
808 lemma NSCDERIV_capprox: |
814 "[| NSCDERIV f x :> D; h: CInfinitesimal; h \<noteq> 0 |] |
809 "[| NSCDERIV f x :> D; h: CInfinitesimal; h \<noteq> 0 |] |
815 ==> ( *fc* f) (hcomplex_of_complex(x) + h) - hcomplex_of_complex(f x) @c= 0" |
810 ==> ( *f* f) (hcomplex_of_complex(x) + h) - hcomplex_of_complex(f x) @c= 0" |
816 apply (simp add: nscderiv_def mem_cinfmal_iff [symmetric]) |
811 apply (simp add: nscderiv_def mem_cinfmal_iff [symmetric]) |
817 apply (rule CInfinitesimal_ratio) |
812 apply (rule CInfinitesimal_ratio) |
818 apply (rule_tac [3] capprox_hcomplex_of_complex_CFinite, auto) |
813 apply (rule_tac [3] capprox_hcomplex_of_complex_CFinite, auto) |
819 done |
814 done |
820 |
815 |
827 (* x - a *) |
822 (* x - a *) |
828 (* -------------------------------------------------*) |
823 (* -------------------------------------------------*) |
829 |
824 |
830 lemma NSCDERIVD1: |
825 lemma NSCDERIVD1: |
831 "[| NSCDERIV f (g x) :> Da; |
826 "[| NSCDERIV f (g x) :> Da; |
832 ( *fc* g) (hcomplex_of_complex(x) + xa) \<noteq> hcomplex_of_complex (g x); |
827 ( *f* g) (hcomplex_of_complex(x) + xa) \<noteq> hcomplex_of_complex (g x); |
833 ( *fc* g) (hcomplex_of_complex(x) + xa) @c= hcomplex_of_complex (g x)|] |
828 ( *f* g) (hcomplex_of_complex(x) + xa) @c= hcomplex_of_complex (g x)|] |
834 ==> (( *fc* f) (( *fc* g) (hcomplex_of_complex(x) + xa)) |
829 ==> (( *f* f) (( *f* g) (hcomplex_of_complex(x) + xa)) |
835 - hcomplex_of_complex (f (g x))) / |
830 - hcomplex_of_complex (f (g x))) / |
836 (( *fc* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex (g x)) |
831 (( *f* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex (g x)) |
837 @c= hcomplex_of_complex (Da)" |
832 @c= hcomplex_of_complex (Da)" |
838 by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
833 by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
839 |
834 |
840 (*--------------------------------------------------*) |
835 (*--------------------------------------------------*) |
841 (* from other version of differentiability *) |
836 (* from other version of differentiability *) |
860 "[| NSCDERIV f (g x) :> Da; NSCDERIV g x :> Db |] |
855 "[| NSCDERIV f (g x) :> Da; NSCDERIV g x :> Db |] |
861 ==> NSCDERIV (f o g) x :> Da * Db" |
856 ==> NSCDERIV (f o g) x :> Da * Db" |
862 apply (simp (no_asm_simp) add: NSCDERIV_NSCLIM_iff NSCLIM_def mem_cinfmal_iff [symmetric]) |
857 apply (simp (no_asm_simp) add: NSCDERIV_NSCLIM_iff NSCLIM_def mem_cinfmal_iff [symmetric]) |
863 apply safe |
858 apply safe |
864 apply (frule_tac f = g in NSCDERIV_capprox) |
859 apply (frule_tac f = g in NSCDERIV_capprox) |
865 apply (auto simp add: starfunC_lambda_cancel2 starfunC_o [symmetric]) |
860 apply (auto simp add: starfun_lambda_cancel2 starfun_o [symmetric]) |
866 apply (case_tac "( *fc* g) (hcomplex_of_complex (x) + xa) = hcomplex_of_complex (g x) ") |
861 apply (case_tac "( *f* g) (hcomplex_of_complex (x) + xa) = hcomplex_of_complex (g x) ") |
867 apply (drule_tac g = g in NSCDERIV_zero) |
862 apply (drule_tac g = g in NSCDERIV_zero) |
868 apply (auto simp add: divide_inverse) |
863 apply (auto simp add: divide_inverse) |
869 apply (rule_tac z1 = "( *fc* g) (hcomplex_of_complex (x) + xa) - hcomplex_of_complex (g x) " and y1 = "inverse xa" in lemma_complex_chain [THEN ssubst]) |
864 apply (rule_tac z1 = "( *f* g) (hcomplex_of_complex (x) + xa) - hcomplex_of_complex (g x) " and y1 = "inverse xa" in lemma_complex_chain [THEN ssubst]) |
870 apply (simp (no_asm_simp)) |
865 apply (simp (no_asm_simp)) |
871 apply (rule capprox_mult_hcomplex_of_complex) |
866 apply (rule capprox_mult_hcomplex_of_complex) |
872 apply (auto intro!: NSCDERIVD1 intro: capprox_minus_iff [THEN iffD2] |
867 apply (auto intro!: NSCDERIVD1 intro: capprox_minus_iff [THEN iffD2] |
873 simp add: diff_minus [symmetric] divide_inverse [symmetric]) |
868 simp add: diff_minus [symmetric] divide_inverse [symmetric]) |
874 apply (blast intro: NSCDERIVD2) |
869 apply (blast intro: NSCDERIVD2) |
931 text{*Can't relax the premise @{term "x \<noteq> 0"}: it isn't continuous at zero*} |
926 text{*Can't relax the premise @{term "x \<noteq> 0"}: it isn't continuous at zero*} |
932 lemma NSCDERIV_inverse: |
927 lemma NSCDERIV_inverse: |
933 "x \<noteq> 0 ==> NSCDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))" |
928 "x \<noteq> 0 ==> NSCDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))" |
934 apply (simp add: nscderiv_def Ball_def, clarify) |
929 apply (simp add: nscderiv_def Ball_def, clarify) |
935 apply (frule CInfinitesimal_add_not_zero [where x=x]) |
930 apply (frule CInfinitesimal_add_not_zero [where x=x]) |
936 apply (auto simp add: starfunC_inverse_inverse diff_minus |
931 apply (auto simp add: starfun_inverse_inverse diff_minus |
937 simp del: minus_mult_left [symmetric] minus_mult_right [symmetric]) |
932 simp del: minus_mult_left [symmetric] minus_mult_right [symmetric]) |
938 apply (simp add: hcomplex_add_commute numeral_2_eq_2 inverse_add |
933 apply (simp add: add_commute numeral_2_eq_2 inverse_add |
939 inverse_mult_distrib [symmetric] inverse_minus_eq [symmetric] |
934 inverse_mult_distrib [symmetric] inverse_minus_eq [symmetric] |
940 add_ac mult_ac |
935 add_ac mult_ac |
941 del: inverse_minus_eq inverse_mult_distrib |
936 del: inverse_minus_eq inverse_mult_distrib |
942 minus_mult_right [symmetric] minus_mult_left [symmetric]) |
937 minus_mult_right [symmetric] minus_mult_left [symmetric]) |
943 apply (simp only: mult_assoc [symmetric] right_distrib) |
938 apply (simp only: mult_assoc [symmetric] right_distrib) |