| author | wenzelm |
| Sat, 07 Oct 2006 01:30:58 +0200 | |
| changeset 20872 | 528054ca23e3 |
| parent 20752 | 09cf0e407a45 |
| child 21404 | eb85850d3eb7 |
| permissions | -rw-r--r-- |
| 13957 | 1 |
(* Title : CLim.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 2001 University of Edinburgh |
|
| 14469 | 4 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2004 |
| 13957 | 5 |
*) |
6 |
||
| 14469 | 7 |
header{*Limits, Continuity and Differentiation for Complex Functions*}
|
8 |
||
| 15131 | 9 |
theory CLim |
| 15140 | 10 |
imports CSeries |
| 15131 | 11 |
begin |
| 14405 | 12 |
|
13 |
(*not in simpset?*) |
|
14 |
declare hypreal_epsilon_not_zero [simp] |
|
15 |
||
16 |
(*??generalize*) |
|
17 |
lemma lemma_complex_mult_inverse_squared [simp]: |
|
18 |
"x \<noteq> (0::complex) \<Longrightarrow> (x * inverse(x) ^ 2) = inverse x" |
|
| 14469 | 19 |
by (simp add: numeral_2_eq_2) |
| 14405 | 20 |
|
21 |
text{*Changing the quantified variable. Install earlier?*}
|
|
| 14738 | 22 |
lemma all_shift: "(\<forall>x::'a::comm_ring_1. P x) = (\<forall>x. P (x-a))"; |
| 14405 | 23 |
apply auto |
24 |
apply (drule_tac x="x+a" in spec) |
|
25 |
apply (simp add: diff_minus add_assoc) |
|
26 |
done |
|
27 |
||
28 |
lemma complex_add_minus_iff [simp]: "(x + - a = (0::complex)) = (x=a)" |
|
29 |
by (simp add: diff_eq_eq diff_minus [symmetric]) |
|
30 |
||
31 |
lemma complex_add_eq_0_iff [iff]: "(x+y = (0::complex)) = (y = -x)" |
|
32 |
apply auto |
|
33 |
apply (drule sym [THEN diff_eq_eq [THEN iffD2]], auto) |
|
34 |
done |
|
| 13957 | 35 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
36 |
abbreviation |
| 13957 | 37 |
|
| 14405 | 38 |
CLIM :: "[complex=>complex,complex,complex] => bool" |
| 13957 | 39 |
("((_)/ -- (_)/ --C> (_))" [60, 0, 60] 60)
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
40 |
"CLIM == LIM" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
41 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
42 |
NSCLIM :: "[complex=>complex,complex,complex] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
43 |
("((_)/ -- (_)/ --NSC> (_))" [60, 0, 60] 60)
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
44 |
"NSCLIM == NSLIM" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
45 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
46 |
(* f: C --> R *) |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
47 |
CRLIM :: "[complex=>real,complex,real] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
48 |
("((_)/ -- (_)/ --CR> (_))" [60, 0, 60] 60)
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
49 |
"CRLIM == LIM" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
50 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
51 |
NSCRLIM :: "[complex=>real,complex,real] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
52 |
("((_)/ -- (_)/ --NSCR> (_))" [60, 0, 60] 60)
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
53 |
"NSCRLIM == NSLIM" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
54 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
55 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
56 |
isContc :: "[complex=>complex,complex] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
57 |
"isContc == isCont" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
58 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
59 |
(* NS definition dispenses with limit notions *) |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
60 |
isNSContc :: "[complex=>complex,complex] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
61 |
"isNSContc == isNSCont" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
62 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
63 |
isContCR :: "[complex=>real,complex] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
64 |
"isContCR == isCont" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
65 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
66 |
(* NS definition dispenses with limit notions *) |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
67 |
isNSContCR :: "[complex=>real,complex] => bool" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
68 |
"isNSContCR == isNSCont" |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
69 |
|
| 20752 | 70 |
isUContc :: "(complex=>complex) => bool" |
71 |
"isUContc == isUCont" |
|
72 |
||
73 |
isNSUContc :: "(complex=>complex) => bool" |
|
74 |
"isNSUContc == isNSUCont" |
|
75 |
||
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
76 |
|
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
77 |
lemma CLIM_def: |
| 19765 | 78 |
"f -- a --C> L = |
79 |
(\<forall>r. 0 < r --> |
|
| 14405 | 80 |
(\<exists>s. 0 < s & (\<forall>x. (x \<noteq> a & (cmod(x - a) < s) |
| 19765 | 81 |
--> cmod(f x - L) < r))))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
82 |
by (rule LIM_def) |
| 13957 | 83 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
84 |
lemma NSCLIM_def: |
| 19765 | 85 |
"f -- a --NSC> L = (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
86 |
x @= hcomplex_of_complex a |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
87 |
--> ( *f* f) x @= hcomplex_of_complex L))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
88 |
by (rule NSLIM_def) |
| 13957 | 89 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
90 |
lemma CRLIM_def: |
| 19765 | 91 |
"f -- a --CR> L = |
92 |
(\<forall>r. 0 < r --> |
|
| 14405 | 93 |
(\<exists>s. 0 < s & (\<forall>x. (x \<noteq> a & (cmod(x - a) < s) |
| 19765 | 94 |
--> abs(f x - L) < r))))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
95 |
by (simp add: LIM_def) |
| 13957 | 96 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
97 |
lemma NSCRLIM_def: |
| 19765 | 98 |
"f -- a --NSCR> L = (\<forall>x. (x \<noteq> hcomplex_of_complex a & |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
99 |
x @= hcomplex_of_complex a |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
100 |
--> ( *f* f) x @= hypreal_of_real L))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
101 |
by (rule NSLIM_def) |
| 13957 | 102 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
103 |
lemma isContc_def: |
| 19765 | 104 |
"isContc f a = (f -- a --C> (f a))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
105 |
by (rule isCont_def) |
| 13957 | 106 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
107 |
lemma isNSContc_def: |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
108 |
"isNSContc f a = (\<forall>y. y @= hcomplex_of_complex a --> |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
109 |
( *f* f) y @= hcomplex_of_complex (f a))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
110 |
by (rule isNSCont_def) |
| 13957 | 111 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
112 |
lemma isContCR_def: |
| 19765 | 113 |
"isContCR f a = (f -- a --CR> (f a))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
114 |
by (rule isCont_def) |
| 13957 | 115 |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
116 |
lemma isNSContCR_def: |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
117 |
"isNSContCR f a = (\<forall>y. y @= hcomplex_of_complex a --> |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
118 |
( *f* f) y @= hypreal_of_real (f a))" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
119 |
by (rule isNSCont_def) |
|
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
120 |
|
| 20752 | 121 |
lemma isUContc_def: |
122 |
"isUContc f = (\<forall>r. 0 < r --> |
|
123 |
(\<exists>s. 0 < s & (\<forall>x y. cmod(x - y) < s |
|
124 |
--> cmod(f x - f y) < r)))" |
|
125 |
by (rule isUCont_def) |
|
126 |
||
127 |
lemma isNSUContc_def: |
|
128 |
"isNSUContc f = (\<forall>x y. x @= y --> ( *f* f) x @= ( *f* f) y)" |
|
129 |
by (rule isNSUCont_def) |
|
130 |
||
131 |
||
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
132 |
definition |
| 13957 | 133 |
|
134 |
(* differentiation: D is derivative of function f at x *) |
|
| 14405 | 135 |
cderiv:: "[complex=>complex,complex,complex] => bool" |
| 13957 | 136 |
("(CDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
|
| 19765 | 137 |
"CDERIV f x :> D = ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)" |
| 13957 | 138 |
|
| 14405 | 139 |
nscderiv :: "[complex=>complex,complex,complex] => bool" |
| 13957 | 140 |
("(NSCDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
141 |
"NSCDERIV f x :> D = (\<forall>h \<in> Infinitesimal - {0}.
|
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
142 |
(( *f* f)(hcomplex_of_complex x + h) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
143 |
- hcomplex_of_complex (f x))/h @= hcomplex_of_complex D)" |
| 13957 | 144 |
|
| 14405 | 145 |
cdifferentiable :: "[complex=>complex,complex] => bool" |
146 |
(infixl "cdifferentiable" 60) |
|
| 19765 | 147 |
"f cdifferentiable x = (\<exists>D. CDERIV f x :> D)" |
| 14405 | 148 |
|
149 |
NSCdifferentiable :: "[complex=>complex,complex] => bool" |
|
150 |
(infixl "NSCdifferentiable" 60) |
|
| 19765 | 151 |
"f NSCdifferentiable x = (\<exists>D. NSCDERIV f x :> D)" |
| 14405 | 152 |
|
153 |
||
154 |
subsection{*Limit of Complex to Complex Function*}
|
|
155 |
||
156 |
lemma NSCLIM_NSCRLIM_Re: "f -- a --NSC> L ==> (%x. Re(f x)) -- a --NSCR> Re(L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
157 |
by (simp add: NSLIM_def starfunC_approx_Re_Im_iff |
| 14469 | 158 |
hRe_hcomplex_of_complex) |
159 |
||
| 14405 | 160 |
|
| 14469 | 161 |
lemma NSCLIM_NSCRLIM_Im: "f -- a --NSC> L ==> (%x. Im(f x)) -- a --NSCR> Im(L)" |
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
162 |
by (simp add: NSLIM_def starfunC_approx_Re_Im_iff |
| 14469 | 163 |
hIm_hcomplex_of_complex) |
| 14405 | 164 |
|
165 |
lemma CLIM_NSCLIM: |
|
166 |
"f -- x --C> L ==> f -- x --NSC> L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
167 |
by (rule LIM_NSLIM) |
| 14405 | 168 |
|
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
169 |
lemma eq_Abs_star_ALL: "(\<forall>t. P t) = (\<forall>X. P (star_n X))" |
| 14405 | 170 |
apply auto |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
171 |
apply (rule_tac x = t in star_cases, auto) |
| 14405 | 172 |
done |
173 |
||
174 |
lemma lemma_CLIM: |
|
175 |
"\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
|
176 |
cmod (xa - x) < s & r \<le> cmod (f xa - L)) |
|
177 |
==> \<forall>(n::nat). \<exists>xa. xa \<noteq> x & |
|
178 |
cmod(xa - x) < inverse(real(Suc n)) & r \<le> cmod(f xa - L)" |
|
179 |
apply clarify |
|
180 |
apply (cut_tac n1 = n in real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive], auto) |
|
181 |
done |
|
182 |
||
183 |
||
184 |
lemma lemma_skolemize_CLIM2: |
|
185 |
"\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
|
186 |
cmod (xa - x) < s & r \<le> cmod (f xa - L)) |
|
187 |
==> \<exists>X. \<forall>(n::nat). X n \<noteq> x & |
|
188 |
cmod(X n - x) < inverse(real(Suc n)) & r \<le> cmod(f (X n) - L)" |
|
189 |
apply (drule lemma_CLIM) |
|
190 |
apply (drule choice, blast) |
|
191 |
done |
|
192 |
||
193 |
lemma lemma_csimp: |
|
194 |
"\<forall>n. X n \<noteq> x & |
|
195 |
cmod (X n - x) < inverse (real(Suc n)) & |
|
196 |
r \<le> cmod (f (X n) - L) ==> |
|
197 |
\<forall>n. cmod (X n - x) < inverse (real(Suc n))" |
|
198 |
by auto |
|
199 |
||
200 |
lemma NSCLIM_CLIM: |
|
201 |
"f -- x --NSC> L ==> f -- x --C> L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
202 |
by (rule NSLIM_LIM) |
| 14405 | 203 |
|
204 |
||
205 |
text{*First key result*}
|
|
206 |
theorem CLIM_NSCLIM_iff: "(f -- x --C> L) = (f -- x --NSC> L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
207 |
by (rule LIM_NSLIM_iff) |
| 14405 | 208 |
|
209 |
||
210 |
subsection{*Limit of Complex to Real Function*}
|
|
211 |
||
212 |
lemma CRLIM_NSCRLIM: "f -- x --CR> L ==> f -- x --NSCR> L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
213 |
by (rule LIM_NSLIM) |
| 14405 | 214 |
|
215 |
lemma lemma_CRLIM: |
|
216 |
"\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
|
217 |
cmod (xa - x) < s & r \<le> abs (f xa - L)) |
|
218 |
==> \<forall>(n::nat). \<exists>xa. xa \<noteq> x & |
|
219 |
cmod(xa - x) < inverse(real(Suc n)) & r \<le> abs (f xa - L)" |
|
220 |
apply clarify |
|
221 |
apply (cut_tac n1 = n in real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive], auto) |
|
222 |
done |
|
223 |
||
224 |
lemma lemma_skolemize_CRLIM2: |
|
225 |
"\<forall>s. 0 < s --> (\<exists>xa. xa \<noteq> x & |
|
226 |
cmod (xa - x) < s & r \<le> abs (f xa - L)) |
|
227 |
==> \<exists>X. \<forall>(n::nat). X n \<noteq> x & |
|
228 |
cmod(X n - x) < inverse(real(Suc n)) & r \<le> abs (f (X n) - L)" |
|
229 |
apply (drule lemma_CRLIM) |
|
230 |
apply (drule choice, blast) |
|
231 |
done |
|
232 |
||
233 |
lemma lemma_crsimp: |
|
234 |
"\<forall>n. X n \<noteq> x & |
|
235 |
cmod (X n - x) < inverse (real(Suc n)) & |
|
236 |
r \<le> abs (f (X n) - L) ==> |
|
237 |
\<forall>n. cmod (X n - x) < inverse (real(Suc n))" |
|
238 |
by auto |
|
239 |
||
240 |
lemma NSCRLIM_CRLIM: "f -- x --NSCR> L ==> f -- x --CR> L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
241 |
by (rule NSLIM_LIM) |
| 14405 | 242 |
|
243 |
text{*Second key result*}
|
|
244 |
theorem CRLIM_NSCRLIM_iff: "(f -- x --CR> L) = (f -- x --NSCR> L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
245 |
by (rule LIM_NSLIM_iff) |
| 14405 | 246 |
|
247 |
(** get this result easily now **) |
|
248 |
lemma CLIM_CRLIM_Re: "f -- a --C> L ==> (%x. Re(f x)) -- a --CR> Re(L)" |
|
249 |
by (auto dest: NSCLIM_NSCRLIM_Re simp add: CLIM_NSCLIM_iff CRLIM_NSCRLIM_iff [symmetric]) |
|
250 |
||
251 |
lemma CLIM_CRLIM_Im: "f -- a --C> L ==> (%x. Im(f x)) -- a --CR> Im(L)" |
|
252 |
by (auto dest: NSCLIM_NSCRLIM_Im simp add: CLIM_NSCLIM_iff CRLIM_NSCRLIM_iff [symmetric]) |
|
253 |
||
254 |
lemma CLIM_cnj: "f -- a --C> L ==> (%x. cnj (f x)) -- a --C> cnj L" |
|
| 14469 | 255 |
by (simp add: CLIM_def complex_cnj_diff [symmetric]) |
| 14405 | 256 |
|
257 |
lemma CLIM_cnj_iff: "((%x. cnj (f x)) -- a --C> cnj L) = (f -- a --C> L)" |
|
| 14469 | 258 |
by (simp add: CLIM_def complex_cnj_diff [symmetric]) |
| 14405 | 259 |
|
260 |
(*** NSLIM_add hence CLIM_add *) |
|
261 |
||
262 |
lemma NSCLIM_add: |
|
263 |
"[| f -- x --NSC> l; g -- x --NSC> m |] |
|
264 |
==> (%x. f(x) + g(x)) -- x --NSC> (l + m)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
265 |
by (rule NSLIM_add) |
| 14405 | 266 |
|
267 |
lemma CLIM_add: |
|
268 |
"[| f -- x --C> l; g -- x --C> m |] |
|
269 |
==> (%x. f(x) + g(x)) -- x --C> (l + m)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
270 |
by (rule LIM_add) |
| 14405 | 271 |
|
272 |
(*** NSLIM_mult hence CLIM_mult *) |
|
273 |
||
274 |
lemma NSCLIM_mult: |
|
275 |
"[| f -- x --NSC> l; g -- x --NSC> m |] |
|
276 |
==> (%x. f(x) * g(x)) -- x --NSC> (l * m)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
277 |
by (rule NSLIM_mult) |
| 14405 | 278 |
|
279 |
lemma CLIM_mult: |
|
280 |
"[| f -- x --C> l; g -- x --C> m |] |
|
281 |
==> (%x. f(x) * g(x)) -- x --C> (l * m)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
282 |
by (rule LIM_mult2) |
| 14405 | 283 |
|
284 |
(*** NSCLIM_const and CLIM_const ***) |
|
285 |
||
286 |
lemma NSCLIM_const [simp]: "(%x. k) -- x --NSC> k" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
287 |
by (rule NSLIM_const) |
| 14405 | 288 |
|
289 |
lemma CLIM_const [simp]: "(%x. k) -- x --C> k" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
290 |
by (rule LIM_const) |
| 14405 | 291 |
|
292 |
(*** NSCLIM_minus and CLIM_minus ***) |
|
293 |
||
294 |
lemma NSCLIM_minus: "f -- a --NSC> L ==> (%x. -f(x)) -- a --NSC> -L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
295 |
by (rule NSLIM_minus) |
| 14405 | 296 |
|
297 |
lemma CLIM_minus: "f -- a --C> L ==> (%x. -f(x)) -- a --C> -L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
298 |
by (rule LIM_minus) |
| 14405 | 299 |
|
300 |
(*** NSCLIM_diff hence CLIM_diff ***) |
|
301 |
||
302 |
lemma NSCLIM_diff: |
|
303 |
"[| f -- x --NSC> l; g -- x --NSC> m |] |
|
304 |
==> (%x. f(x) - g(x)) -- x --NSC> (l - m)" |
|
| 14469 | 305 |
by (simp add: diff_minus NSCLIM_add NSCLIM_minus) |
| 14405 | 306 |
|
307 |
lemma CLIM_diff: |
|
308 |
"[| f -- x --C> l; g -- x --C> m |] |
|
309 |
==> (%x. f(x) - g(x)) -- x --C> (l - m)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
310 |
by (rule LIM_diff) |
| 14405 | 311 |
|
312 |
(*** NSCLIM_inverse and hence CLIM_inverse *) |
|
313 |
||
314 |
lemma NSCLIM_inverse: |
|
315 |
"[| f -- a --NSC> L; L \<noteq> 0 |] |
|
316 |
==> (%x. inverse(f(x))) -- a --NSC> (inverse L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
317 |
by (rule NSLIM_inverse) |
| 14405 | 318 |
|
319 |
lemma CLIM_inverse: |
|
320 |
"[| f -- a --C> L; L \<noteq> 0 |] |
|
321 |
==> (%x. inverse(f(x))) -- a --C> (inverse L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
322 |
by (rule LIM_inverse) |
| 14405 | 323 |
|
324 |
(*** NSCLIM_zero, CLIM_zero, etc. ***) |
|
325 |
||
326 |
lemma NSCLIM_zero: "f -- a --NSC> l ==> (%x. f(x) - l) -- a --NSC> 0" |
|
| 14469 | 327 |
apply (simp add: diff_minus) |
| 14405 | 328 |
apply (rule_tac a1 = l in right_minus [THEN subst]) |
| 14469 | 329 |
apply (rule NSCLIM_add, auto) |
| 14405 | 330 |
done |
331 |
||
332 |
lemma CLIM_zero: "f -- a --C> l ==> (%x. f(x) - l) -- a --C> 0" |
|
333 |
by (simp add: CLIM_NSCLIM_iff NSCLIM_zero) |
|
334 |
||
335 |
lemma NSCLIM_zero_cancel: "(%x. f(x) - l) -- x --NSC> 0 ==> f -- x --NSC> l" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
336 |
by (rule NSLIM_zero_cancel) |
| 14405 | 337 |
|
338 |
lemma CLIM_zero_cancel: "(%x. f(x) - l) -- x --C> 0 ==> f -- x --C> l" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
339 |
by (rule LIM_zero_cancel) |
| 14405 | 340 |
|
341 |
(*** NSCLIM_not zero and hence CLIM_not_zero ***) |
|
| 13957 | 342 |
|
| 14405 | 343 |
lemma NSCLIM_not_zero: "k \<noteq> 0 ==> ~ ((%x. k) -- x --NSC> 0)" |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17318
diff
changeset
|
344 |
apply (auto simp del: star_of_zero simp add: NSCLIM_def) |
| 14405 | 345 |
apply (rule_tac x = "hcomplex_of_complex x + hcomplex_of_hypreal epsilon" in exI) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
346 |
apply (auto intro: Infinitesimal_add_approx_self [THEN approx_sym] |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17318
diff
changeset
|
347 |
simp del: star_of_zero) |
| 14405 | 348 |
done |
349 |
||
350 |
(* [| k \<noteq> 0; (%x. k) -- x --NSC> 0 |] ==> R *) |
|
351 |
lemmas NSCLIM_not_zeroE = NSCLIM_not_zero [THEN notE, standard] |
|
352 |
||
353 |
lemma CLIM_not_zero: "k \<noteq> 0 ==> ~ ((%x. k) -- x --C> 0)" |
|
354 |
by (simp add: CLIM_NSCLIM_iff NSCLIM_not_zero) |
|
355 |
||
356 |
(*** NSCLIM_const hence CLIM_const ***) |
|
357 |
||
358 |
lemma NSCLIM_const_eq: "(%x. k) -- x --NSC> L ==> k = L" |
|
359 |
apply (rule ccontr) |
|
360 |
apply (drule NSCLIM_zero) |
|
361 |
apply (rule NSCLIM_not_zeroE [of "k-L"], auto) |
|
362 |
done |
|
363 |
||
364 |
lemma CLIM_const_eq: "(%x. k) -- x --C> L ==> k = L" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
365 |
by (rule LIM_const_eq) |
| 14405 | 366 |
|
367 |
(*** NSCLIM and hence CLIM are unique ***) |
|
368 |
||
369 |
lemma NSCLIM_unique: "[| f -- x --NSC> L; f -- x --NSC> M |] ==> L = M" |
|
370 |
apply (drule NSCLIM_minus) |
|
371 |
apply (drule NSCLIM_add, assumption) |
|
372 |
apply (auto dest!: NSCLIM_const_eq [symmetric]) |
|
373 |
done |
|
374 |
||
375 |
lemma CLIM_unique: "[| f -- x --C> L; f -- x --C> M |] ==> L = M" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
376 |
by (rule LIM_unique) |
| 14405 | 377 |
|
378 |
(*** NSCLIM_mult_zero and CLIM_mult_zero ***) |
|
379 |
||
380 |
lemma NSCLIM_mult_zero: |
|
381 |
"[| f -- x --NSC> 0; g -- x --NSC> 0 |] ==> (%x. f(x)*g(x)) -- x --NSC> 0" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
382 |
by (rule NSLIM_mult_zero) |
| 14405 | 383 |
|
384 |
lemma CLIM_mult_zero: |
|
385 |
"[| f -- x --C> 0; g -- x --C> 0 |] ==> (%x. f(x)*g(x)) -- x --C> 0" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
386 |
by (rule LIM_mult_zero) |
| 14405 | 387 |
|
388 |
(*** NSCLIM_self hence CLIM_self ***) |
|
389 |
||
390 |
lemma NSCLIM_self: "(%x. x) -- a --NSC> a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
391 |
by (rule NSLIM_self) |
| 14405 | 392 |
|
393 |
lemma CLIM_self: "(%x. x) -- a --C> a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
394 |
by (rule LIM_self) |
| 14405 | 395 |
|
396 |
(** another equivalence result **) |
|
397 |
lemma NSCLIM_NSCRLIM_iff: |
|
398 |
"(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)" |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
399 |
apply (auto simp add: NSCLIM_def NSCRLIM_def Infinitesimal_approx_minus [symmetric] Infinitesimal_hcmod_iff) |
| 14405 | 400 |
apply (auto dest!: spec) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
401 |
apply (rule_tac [!] x = xa in star_cases) |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
402 |
apply (auto simp add: star_n_diff starfun hcmod mem_infmal_iff star_of_def) |
| 14405 | 403 |
done |
404 |
||
405 |
(** much, much easier standard proof **) |
|
406 |
lemma CLIM_CRLIM_iff: "(f -- x --C> L) = ((%y. cmod(f y - L)) -- x --CR> 0)" |
|
407 |
by (simp add: CLIM_def CRLIM_def) |
|
408 |
||
409 |
(* so this is nicer nonstandard proof *) |
|
410 |
lemma NSCLIM_NSCRLIM_iff2: |
|
411 |
"(f -- x --NSC> L) = ((%y. cmod(f y - L)) -- x --NSCR> 0)" |
|
| 14469 | 412 |
by (simp add: CRLIM_NSCRLIM_iff [symmetric] CLIM_CRLIM_iff CLIM_NSCLIM_iff [symmetric]) |
| 14405 | 413 |
|
414 |
lemma NSCLIM_NSCRLIM_Re_Im_iff: |
|
415 |
"(f -- a --NSC> L) = ((%x. Re(f x)) -- a --NSCR> Re(L) & |
|
416 |
(%x. Im(f x)) -- a --NSCR> Im(L))" |
|
417 |
apply (auto intro: NSCLIM_NSCRLIM_Re NSCLIM_NSCRLIM_Im) |
|
418 |
apply (auto simp add: NSCLIM_def NSCRLIM_def) |
|
419 |
apply (auto dest!: spec) |
|
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
420 |
apply (rule_tac x = x in star_cases) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
421 |
apply (simp add: approx_approx_iff starfun star_of_def) |
| 14405 | 422 |
done |
423 |
||
424 |
lemma CLIM_CRLIM_Re_Im_iff: |
|
425 |
"(f -- a --C> L) = ((%x. Re(f x)) -- a --CR> Re(L) & |
|
426 |
(%x. Im(f x)) -- a --CR> Im(L))" |
|
427 |
by (simp add: CLIM_NSCLIM_iff CRLIM_NSCRLIM_iff NSCLIM_NSCRLIM_Re_Im_iff) |
|
428 |
||
429 |
||
430 |
subsection{*Continuity*}
|
|
431 |
||
432 |
lemma isNSContcD: |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
433 |
"[| isNSContc f a; y @= hcomplex_of_complex a |] |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
434 |
==> ( *f* f) y @= hcomplex_of_complex (f a)" |
| 14405 | 435 |
by (simp add: isNSContc_def) |
436 |
||
437 |
lemma isNSContc_NSCLIM: "isNSContc f a ==> f -- a --NSC> (f a) " |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
438 |
by (rule isNSCont_NSLIM) |
| 14405 | 439 |
|
440 |
lemma NSCLIM_isNSContc: |
|
441 |
"f -- a --NSC> (f a) ==> isNSContc f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
442 |
by (rule NSLIM_isNSCont) |
| 14405 | 443 |
|
444 |
text{*Nonstandard continuity can be defined using NS Limit in
|
|
445 |
similar fashion to standard definition of continuity*} |
|
446 |
||
447 |
lemma isNSContc_NSCLIM_iff: "(isNSContc f a) = (f -- a --NSC> (f a))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
448 |
by (rule isNSCont_NSLIM_iff) |
| 14405 | 449 |
|
450 |
lemma isNSContc_CLIM_iff: "(isNSContc f a) = (f -- a --C> (f a))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
451 |
by (rule isNSCont_LIM_iff) |
| 14405 | 452 |
|
453 |
(*** key result for continuity ***) |
|
454 |
lemma isNSContc_isContc_iff: "(isNSContc f a) = (isContc f a)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
455 |
by (rule isNSCont_isCont_iff) |
| 14405 | 456 |
|
457 |
lemma isContc_isNSContc: "isContc f a ==> isNSContc f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
458 |
by (rule isCont_isNSCont) |
| 14405 | 459 |
|
460 |
lemma isNSContc_isContc: "isNSContc f a ==> isContc f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
461 |
by (rule isNSCont_isCont) |
| 14405 | 462 |
|
463 |
||
464 |
text{*Alternative definition of continuity*}
|
|
465 |
lemma NSCLIM_h_iff: "(f -- a --NSC> L) = ((%h. f(a + h)) -- 0 --NSC> L)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
466 |
by (rule NSLIM_h_iff) |
| 14405 | 467 |
|
468 |
lemma NSCLIM_isContc_iff: |
|
469 |
"(f -- a --NSC> f a) = ((%h. f(a + h)) -- 0 --NSC> f a)" |
|
470 |
by (rule NSCLIM_h_iff) |
|
471 |
||
472 |
lemma CLIM_isContc_iff: "(f -- a --C> f a) = ((%h. f(a + h)) -- 0 --C> f(a))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
473 |
by (rule LIM_isCont_iff) |
| 14405 | 474 |
|
475 |
lemma isContc_iff: "(isContc f x) = ((%h. f(x + h)) -- 0 --C> f(x))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
476 |
by (rule isCont_iff) |
| 14405 | 477 |
|
478 |
lemma isContc_add: |
|
479 |
"[| isContc f a; isContc g a |] ==> isContc (%x. f(x) + g(x)) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
480 |
by (rule isCont_add) |
| 14405 | 481 |
|
482 |
lemma isContc_mult: |
|
483 |
"[| isContc f a; isContc g a |] ==> isContc (%x. f(x) * g(x)) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
484 |
by (rule isCont_mult) |
| 14405 | 485 |
|
486 |
||
487 |
lemma isContc_o: "[| isContc f a; isContc g (f a) |] ==> isContc (g o f) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
488 |
by (rule isCont_o) |
| 14405 | 489 |
|
490 |
lemma isContc_o2: |
|
491 |
"[| isContc f a; isContc g (f a) |] ==> isContc (%x. g (f x)) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
492 |
by (rule isCont_o2) |
| 14405 | 493 |
|
494 |
lemma isNSContc_minus: "isNSContc f a ==> isNSContc (%x. - f x) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
495 |
by (rule isNSCont_minus) |
| 14405 | 496 |
|
497 |
lemma isContc_minus: "isContc f a ==> isContc (%x. - f x) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
498 |
by (rule isCont_minus) |
| 14405 | 499 |
|
500 |
lemma isContc_inverse: |
|
501 |
"[| isContc f x; f x \<noteq> 0 |] ==> isContc (%x. inverse (f x)) x" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
502 |
by (rule isCont_inverse) |
| 14405 | 503 |
|
504 |
lemma isNSContc_inverse: |
|
505 |
"[| isNSContc f x; f x \<noteq> 0 |] ==> isNSContc (%x. inverse (f x)) x" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
506 |
by (rule isNSCont_inverse) |
| 14405 | 507 |
|
508 |
lemma isContc_diff: |
|
509 |
"[| isContc f a; isContc g a |] ==> isContc (%x. f(x) - g(x)) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
510 |
by (rule isCont_diff) |
| 14405 | 511 |
|
512 |
lemma isContc_const [simp]: "isContc (%x. k) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
513 |
by (rule isCont_const) |
| 14405 | 514 |
|
515 |
lemma isNSContc_const [simp]: "isNSContc (%x. k) a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
516 |
by (rule isNSCont_const) |
| 14405 | 517 |
|
518 |
||
519 |
subsection{*Functions from Complex to Reals*}
|
|
520 |
||
521 |
lemma isNSContCRD: |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
522 |
"[| isNSContCR f a; y @= hcomplex_of_complex a |] |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
523 |
==> ( *f* f) y @= hypreal_of_real (f a)" |
| 14405 | 524 |
by (simp add: isNSContCR_def) |
525 |
||
526 |
lemma isNSContCR_NSCRLIM: "isNSContCR f a ==> f -- a --NSCR> (f a) " |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
527 |
by (rule isNSCont_NSLIM) |
| 14405 | 528 |
|
529 |
lemma NSCRLIM_isNSContCR: "f -- a --NSCR> (f a) ==> isNSContCR f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
530 |
by (rule NSLIM_isNSCont) |
| 14405 | 531 |
|
532 |
lemma isNSContCR_NSCRLIM_iff: "(isNSContCR f a) = (f -- a --NSCR> (f a))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
533 |
by (rule isNSCont_NSLIM_iff) |
| 14405 | 534 |
|
535 |
lemma isNSContCR_CRLIM_iff: "(isNSContCR f a) = (f -- a --CR> (f a))" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
536 |
by (rule isNSCont_LIM_iff) |
| 14405 | 537 |
|
538 |
(*** another key result for continuity ***) |
|
539 |
lemma isNSContCR_isContCR_iff: "(isNSContCR f a) = (isContCR f a)" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
540 |
by (rule isNSCont_isCont_iff) |
| 14405 | 541 |
|
542 |
lemma isContCR_isNSContCR: "isContCR f a ==> isNSContCR f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
543 |
by (rule isCont_isNSCont) |
| 14405 | 544 |
|
545 |
lemma isNSContCR_isContCR: "isNSContCR f a ==> isContCR f a" |
|
|
20659
66b8455090b8
changed constants into abbreviations; shortened proofs
huffman
parents:
20563
diff
changeset
|
546 |
by (rule isNSCont_isCont) |
| 14405 | 547 |
|
548 |
lemma isNSContCR_cmod [simp]: "isNSContCR cmod (a)" |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
549 |
by (auto intro: approx_hcmod_approx |
| 14405 | 550 |
simp add: starfunCR_cmod hcmod_hcomplex_of_complex [symmetric] |
551 |
isNSContCR_def) |
|
552 |
||
553 |
lemma isContCR_cmod [simp]: "isContCR cmod (a)" |
|
| 14469 | 554 |
by (simp add: isNSContCR_isContCR_iff [symmetric]) |
| 14405 | 555 |
|
556 |
lemma isContc_isContCR_Re: "isContc f a ==> isContCR (%x. Re (f x)) a" |
|
557 |
by (simp add: isContc_def isContCR_def CLIM_CRLIM_Re) |
|
558 |
||
559 |
lemma isContc_isContCR_Im: "isContc f a ==> isContCR (%x. Im (f x)) a" |
|
560 |
by (simp add: isContc_def isContCR_def CLIM_CRLIM_Im) |
|
561 |
||
562 |
||
563 |
subsection{*Derivatives*}
|
|
564 |
||
565 |
lemma CDERIV_iff: "(CDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --C> D)" |
|
566 |
by (simp add: cderiv_def) |
|
567 |
||
568 |
lemma CDERIV_NSC_iff: |
|
569 |
"(CDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)" |
|
570 |
by (simp add: cderiv_def CLIM_NSCLIM_iff) |
|
571 |
||
572 |
lemma CDERIVD: "CDERIV f x :> D ==> (%h. (f(x + h) - f(x))/h) -- 0 --C> D" |
|
573 |
by (simp add: cderiv_def) |
|
574 |
||
575 |
lemma NSC_DERIVD: "CDERIV f x :> D ==> (%h. (f(x + h) - f(x))/h) -- 0 --NSC> D" |
|
576 |
by (simp add: cderiv_def CLIM_NSCLIM_iff) |
|
577 |
||
578 |
text{*Uniqueness*}
|
|
579 |
lemma CDERIV_unique: "[| CDERIV f x :> D; CDERIV f x :> E |] ==> D = E" |
|
580 |
by (simp add: cderiv_def CLIM_unique) |
|
581 |
||
582 |
(*** uniqueness: a nonstandard proof ***) |
|
583 |
lemma NSCDeriv_unique: "[| NSCDERIV f x :> D; NSCDERIV f x :> E |] ==> D = E" |
|
584 |
apply (simp add: nscderiv_def) |
|
585 |
apply (auto dest!: bspec [where x = "hcomplex_of_hypreal epsilon"] |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
586 |
intro!: inj_hcomplex_of_complex [THEN injD] dest: approx_trans3) |
| 14405 | 587 |
done |
| 13957 | 588 |
|
589 |
||
| 14405 | 590 |
subsection{* Differentiability*}
|
591 |
||
592 |
lemma CDERIV_CLIM_iff: |
|
593 |
"((%h. (f(a + h) - f(a))/h) -- 0 --C> D) = |
|
594 |
((%x. (f(x) - f(a)) / (x - a)) -- a --C> D)" |
|
595 |
apply (simp add: CLIM_def) |
|
596 |
apply (rule_tac f=All in arg_cong) |
|
597 |
apply (rule ext) |
|
598 |
apply (rule imp_cong) |
|
599 |
apply (rule refl) |
|
600 |
apply (rule_tac f=Ex in arg_cong) |
|
601 |
apply (rule ext) |
|
602 |
apply (rule conj_cong) |
|
603 |
apply (rule refl) |
|
604 |
apply (rule trans) |
|
605 |
apply (rule all_shift [where a=a], simp) |
|
606 |
done |
|
607 |
||
608 |
lemma CDERIV_iff2: |
|
609 |
"(CDERIV f x :> D) = ((%z. (f(z) - f(x)) / (z - x)) -- x --C> D)" |
|
610 |
by (simp add: cderiv_def CDERIV_CLIM_iff) |
|
611 |
||
612 |
||
613 |
subsection{* Equivalence of NS and Standard Differentiation*}
|
|
614 |
||
615 |
(*** first equivalence ***) |
|
616 |
lemma NSCDERIV_NSCLIM_iff: |
|
617 |
"(NSCDERIV f x :> D) = ((%h. (f(x + h) - f(x))/h) -- 0 --NSC> D)" |
|
618 |
apply (simp add: nscderiv_def NSCLIM_def, auto) |
|
619 |
apply (drule_tac x = xa in bspec) |
|
620 |
apply (rule_tac [3] ccontr) |
|
621 |
apply (drule_tac [3] x = h in spec) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
622 |
apply (auto simp add: mem_infmal_iff starfun_lambda_cancel) |
| 14405 | 623 |
done |
624 |
||
625 |
(*** 2nd equivalence ***) |
|
626 |
lemma NSCDERIV_NSCLIM_iff2: |
|
627 |
"(NSCDERIV f x :> D) = ((%z. (f(z) - f(x)) / (z - x)) -- x --NSC> D)" |
|
628 |
by (simp add: NSCDERIV_NSCLIM_iff CDERIV_CLIM_iff CLIM_NSCLIM_iff [symmetric]) |
|
629 |
||
630 |
lemma NSCDERIV_iff2: |
|
631 |
"(NSCDERIV f x :> D) = |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
632 |
(\<forall>xa. xa \<noteq> hcomplex_of_complex x & xa @= hcomplex_of_complex x --> |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
633 |
( *f* (%z. (f z - f x) / (z - x))) xa @= hcomplex_of_complex D)" |
| 14405 | 634 |
by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
635 |
||
636 |
lemma NSCDERIV_CDERIV_iff: "(NSCDERIV f x :> D) = (CDERIV f x :> D)" |
|
637 |
by (simp add: cderiv_def NSCDERIV_NSCLIM_iff CLIM_NSCLIM_iff) |
|
638 |
||
639 |
lemma NSCDERIV_isNSContc: "NSCDERIV f x :> D ==> isNSContc f x" |
|
| 20563 | 640 |
apply (auto simp add: nscderiv_def isNSContc_NSCLIM_iff NSCLIM_def) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
641 |
apply (drule approx_minus_iff [THEN iffD1]) |
| 20563 | 642 |
apply (subgoal_tac "xa - (hcomplex_of_complex x) \<noteq> 0") |
| 14405 | 643 |
prefer 2 apply (simp add: compare_rls) |
| 20563 | 644 |
apply (drule_tac x = "xa - hcomplex_of_complex x" in bspec) |
645 |
apply (simp add: mem_infmal_iff) |
|
646 |
apply (simp add: add_assoc [symmetric]) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
647 |
apply (auto simp add: mem_infmal_iff [symmetric] add_commute) |
| 20563 | 648 |
apply (drule_tac c = "xa - hcomplex_of_complex x" in approx_mult1) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
649 |
apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] |
| 14405 | 650 |
simp add: mult_assoc) |
651 |
apply (drule_tac x3 = D in |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
652 |
HFinite_hcomplex_of_complex [THEN [2] Infinitesimal_HFinite_mult, |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
653 |
THEN mem_infmal_iff [THEN iffD1]]) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
654 |
apply (blast intro: approx_trans mult_commute [THEN subst] approx_minus_iff [THEN iffD2]) |
| 14405 | 655 |
done |
656 |
||
657 |
lemma CDERIV_isContc: "CDERIV f x :> D ==> isContc f x" |
|
658 |
by (simp add: NSCDERIV_CDERIV_iff [symmetric] isNSContc_isContc_iff [symmetric] NSCDERIV_isNSContc) |
|
659 |
||
660 |
text{* Differentiation rules for combinations of functions follow by clear,
|
|
661 |
straightforard algebraic manipulations*} |
|
662 |
||
663 |
(* use simple constant nslimit theorem *) |
|
664 |
lemma NSCDERIV_const [simp]: "(NSCDERIV (%x. k) x :> 0)" |
|
665 |
by (simp add: NSCDERIV_NSCLIM_iff) |
|
666 |
||
667 |
lemma CDERIV_const [simp]: "(CDERIV (%x. k) x :> 0)" |
|
668 |
by (simp add: NSCDERIV_CDERIV_iff [symmetric]) |
|
669 |
||
670 |
lemma NSCDERIV_add: |
|
671 |
"[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
|
672 |
==> NSCDERIV (%x. f x + g x) x :> Da + Db" |
|
673 |
apply (simp add: NSCDERIV_NSCLIM_iff NSCLIM_def, clarify) |
|
674 |
apply (auto dest!: spec simp add: add_divide_distrib diff_minus) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
675 |
apply (drule_tac b = "hcomplex_of_complex Da" and d = "hcomplex_of_complex Db" in approx_add) |
| 14405 | 676 |
apply (auto simp add: add_ac) |
677 |
done |
|
678 |
||
679 |
lemma CDERIV_add: |
|
680 |
"[| CDERIV f x :> Da; CDERIV g x :> Db |] |
|
681 |
==> CDERIV (%x. f x + g x) x :> Da + Db" |
|
682 |
by (simp add: NSCDERIV_add NSCDERIV_CDERIV_iff [symmetric]) |
|
683 |
||
684 |
||
685 |
subsection{*Lemmas for Multiplication*}
|
|
686 |
||
687 |
lemma lemma_nscderiv1: "((a::hcomplex)*b) - (c*d) = (b*(a - c)) + (c*(b - d))" |
|
688 |
by (simp add: right_diff_distrib) |
|
689 |
||
690 |
lemma lemma_nscderiv2: |
|
| 20563 | 691 |
"[| (x - y) / z = hcomplex_of_complex D + yb; z \<noteq> 0; |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
692 |
z : Infinitesimal; yb : Infinitesimal |] |
| 20563 | 693 |
==> x - y @= 0" |
| 14405 | 694 |
apply (frule_tac c1 = z in hcomplex_mult_right_cancel [THEN iffD2], assumption) |
| 20563 | 695 |
apply (erule_tac V = " (x - y) / z = hcomplex_of_complex D + yb" in thin_rl) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
696 |
apply (auto intro!: Infinitesimal_HFinite_mult2 HFinite_add |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
697 |
simp add: mem_infmal_iff [symmetric]) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
698 |
apply (erule Infinitesimal_subset_HFinite [THEN subsetD]) |
| 14405 | 699 |
done |
700 |
||
701 |
lemma NSCDERIV_mult: |
|
702 |
"[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
|
703 |
==> NSCDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))" |
|
| 20563 | 704 |
apply (auto simp add: NSCDERIV_NSCLIM_iff NSCLIM_def) |
| 14405 | 705 |
apply (auto dest!: spec |
| 20563 | 706 |
simp add: starfun_lambda_cancel lemma_nscderiv1) |
707 |
apply (simp (no_asm) add: add_divide_distrib diff_divide_distrib) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
708 |
apply (drule bex_Infinitesimal_iff2 [THEN iffD2])+ |
| 20563 | 709 |
apply (auto simp add: times_divide_eq_right [symmetric] |
710 |
simp del: times_divide_eq) |
|
711 |
apply (drule_tac D = Db in lemma_nscderiv2, assumption+) |
|
712 |
apply (drule_tac |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
713 |
approx_minus_iff [THEN iffD2, THEN bex_Infinitesimal_iff2 [THEN iffD2]]) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
714 |
apply (auto intro!: approx_add_mono1 simp add: left_distrib right_distrib mult_commute add_assoc) |
| 14405 | 715 |
apply (rule_tac b1 = "hcomplex_of_complex Db * hcomplex_of_complex (f x) " in add_commute [THEN subst]) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
716 |
apply (auto intro!: Infinitesimal_add_approx_self2 [THEN approx_sym] |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
717 |
Infinitesimal_add Infinitesimal_mult |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
718 |
Infinitesimal_hcomplex_of_complex_mult |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
719 |
Infinitesimal_hcomplex_of_complex_mult2 |
| 15013 | 720 |
simp add: add_assoc [symmetric]) |
| 14405 | 721 |
done |
722 |
||
723 |
lemma CDERIV_mult: |
|
724 |
"[| CDERIV f x :> Da; CDERIV g x :> Db |] |
|
725 |
==> CDERIV (%x. f x * g x) x :> (Da * g(x)) + (Db * f(x))" |
|
726 |
by (simp add: NSCDERIV_mult NSCDERIV_CDERIV_iff [symmetric]) |
|
727 |
||
728 |
lemma NSCDERIV_cmult: "NSCDERIV f x :> D ==> NSCDERIV (%x. c * f x) x :> c*D" |
|
729 |
apply (simp add: times_divide_eq_right [symmetric] NSCDERIV_NSCLIM_iff |
|
| 14469 | 730 |
minus_mult_right right_distrib [symmetric] diff_minus |
| 14405 | 731 |
del: times_divide_eq_right minus_mult_right [symmetric]) |
732 |
apply (erule NSCLIM_const [THEN NSCLIM_mult]) |
|
733 |
done |
|
734 |
||
735 |
lemma CDERIV_cmult: "CDERIV f x :> D ==> CDERIV (%x. c * f x) x :> c*D" |
|
736 |
by (simp add: NSCDERIV_cmult NSCDERIV_CDERIV_iff [symmetric]) |
|
737 |
||
738 |
lemma NSCDERIV_minus: "NSCDERIV f x :> D ==> NSCDERIV (%x. -(f x)) x :> -D" |
|
| 14469 | 739 |
apply (simp add: NSCDERIV_NSCLIM_iff diff_minus) |
| 14405 | 740 |
apply (rule_tac t = "f x" in minus_minus [THEN subst]) |
741 |
apply (simp (no_asm_simp) add: minus_add_distrib [symmetric] |
|
742 |
del: minus_add_distrib minus_minus) |
|
743 |
apply (erule NSCLIM_minus) |
|
744 |
done |
|
745 |
||
746 |
lemma CDERIV_minus: "CDERIV f x :> D ==> CDERIV (%x. -(f x)) x :> -D" |
|
747 |
by (simp add: NSCDERIV_minus NSCDERIV_CDERIV_iff [symmetric]) |
|
748 |
||
749 |
lemma NSCDERIV_add_minus: |
|
750 |
"[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
|
751 |
==> NSCDERIV (%x. f x + -g x) x :> Da + -Db" |
|
752 |
by (blast dest: NSCDERIV_add NSCDERIV_minus) |
|
753 |
||
754 |
lemma CDERIV_add_minus: |
|
755 |
"[| CDERIV f x :> Da; CDERIV g x :> Db |] |
|
756 |
==> CDERIV (%x. f x + -g x) x :> Da + -Db" |
|
757 |
by (blast dest: CDERIV_add CDERIV_minus) |
|
758 |
||
759 |
lemma NSCDERIV_diff: |
|
760 |
"[| NSCDERIV f x :> Da; NSCDERIV g x :> Db |] |
|
761 |
==> NSCDERIV (%x. f x - g x) x :> Da - Db" |
|
| 14469 | 762 |
by (simp add: diff_minus NSCDERIV_add_minus) |
| 14405 | 763 |
|
764 |
lemma CDERIV_diff: |
|
765 |
"[| CDERIV f x :> Da; CDERIV g x :> Db |] |
|
766 |
==> CDERIV (%x. f x - g x) x :> Da - Db" |
|
| 14469 | 767 |
by (simp add: diff_minus CDERIV_add_minus) |
| 14405 | 768 |
|
769 |
||
770 |
subsection{*Chain Rule*}
|
|
771 |
||
772 |
(* lemmas *) |
|
773 |
lemma NSCDERIV_zero: |
|
774 |
"[| NSCDERIV g x :> D; |
|
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
775 |
( *f* g) (hcomplex_of_complex(x) + xa) = hcomplex_of_complex(g x); |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
776 |
xa : Infinitesimal; xa \<noteq> 0 |
| 14405 | 777 |
|] ==> D = 0" |
778 |
apply (simp add: nscderiv_def) |
|
779 |
apply (drule bspec, auto) |
|
780 |
done |
|
781 |
||
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
782 |
lemma NSCDERIV_approx: |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
783 |
"[| NSCDERIV f x :> D; h: Infinitesimal; h \<noteq> 0 |] |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
784 |
==> ( *f* f) (hcomplex_of_complex(x) + h) - hcomplex_of_complex(f x) @= 0" |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
785 |
apply (simp add: nscderiv_def mem_infmal_iff [symmetric]) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
786 |
apply (rule Infinitesimal_ratio) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
787 |
apply (rule_tac [3] approx_hcomplex_of_complex_HFinite, auto) |
| 14405 | 788 |
done |
789 |
||
790 |
||
791 |
(*--------------------------------------------------*) |
|
792 |
(* from one version of differentiability *) |
|
793 |
(* *) |
|
794 |
(* f(x) - f(a) *) |
|
795 |
(* --------------- @= Db *) |
|
796 |
(* x - a *) |
|
797 |
(* -------------------------------------------------*) |
|
798 |
||
799 |
lemma NSCDERIVD1: |
|
800 |
"[| NSCDERIV f (g x) :> Da; |
|
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
801 |
( *f* g) (hcomplex_of_complex(x) + xa) \<noteq> hcomplex_of_complex (g x); |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
802 |
( *f* g) (hcomplex_of_complex(x) + xa) @= hcomplex_of_complex (g x)|] |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
803 |
==> (( *f* f) (( *f* g) (hcomplex_of_complex(x) + xa)) |
| 14405 | 804 |
- hcomplex_of_complex (f (g x))) / |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
805 |
(( *f* g) (hcomplex_of_complex(x) + xa) - hcomplex_of_complex (g x)) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
806 |
@= hcomplex_of_complex (Da)" |
| 14469 | 807 |
by (simp add: NSCDERIV_NSCLIM_iff2 NSCLIM_def) |
| 14405 | 808 |
|
809 |
(*--------------------------------------------------*) |
|
810 |
(* from other version of differentiability *) |
|
811 |
(* *) |
|
812 |
(* f(x + h) - f(x) *) |
|
813 |
(* ----------------- @= Db *) |
|
814 |
(* h *) |
|
815 |
(*--------------------------------------------------*) |
|
816 |
||
817 |
lemma NSCDERIVD2: |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
818 |
"[| NSCDERIV g x :> Db; xa: Infinitesimal; xa \<noteq> 0 |] |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
819 |
==> (( *f* g) (hcomplex_of_complex x + xa) - hcomplex_of_complex(g x)) / xa |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
820 |
@= hcomplex_of_complex (Db)" |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
821 |
by (simp add: NSCDERIV_NSCLIM_iff NSCLIM_def mem_infmal_iff starfun_lambda_cancel) |
| 14405 | 822 |
|
823 |
lemma lemma_complex_chain: "(z::hcomplex) \<noteq> 0 ==> x*y = (x*inverse(z))*(z*y)" |
|
824 |
by auto |
|
825 |
||
826 |
||
827 |
text{*Chain rule*}
|
|
828 |
theorem NSCDERIV_chain: |
|
829 |
"[| NSCDERIV f (g x) :> Da; NSCDERIV g x :> Db |] |
|
830 |
==> NSCDERIV (f o g) x :> Da * Db" |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
831 |
apply (simp (no_asm_simp) add: NSCDERIV_NSCLIM_iff NSCLIM_def mem_infmal_iff [symmetric]) |
| 14405 | 832 |
apply safe |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
833 |
apply (frule_tac f = g in NSCDERIV_approx) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
834 |
apply (auto simp add: starfun_lambda_cancel2 starfun_o [symmetric]) |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
835 |
apply (case_tac "( *f* g) (hcomplex_of_complex (x) + xa) = hcomplex_of_complex (g x) ") |
| 14405 | 836 |
apply (drule_tac g = g in NSCDERIV_zero) |
| 17300 | 837 |
apply (auto simp add: divide_inverse) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
838 |
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]) |
| 14405 | 839 |
apply (simp (no_asm_simp)) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
840 |
apply (rule approx_mult_hcomplex_of_complex) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
841 |
apply (auto intro!: NSCDERIVD1 intro: approx_minus_iff [THEN iffD2] |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14405
diff
changeset
|
842 |
simp add: diff_minus [symmetric] divide_inverse [symmetric]) |
| 14405 | 843 |
apply (blast intro: NSCDERIVD2) |
844 |
done |
|
845 |
||
846 |
text{*standard version*}
|
|
847 |
lemma CDERIV_chain: |
|
848 |
"[| CDERIV f (g x) :> Da; CDERIV g x :> Db |] |
|
849 |
==> CDERIV (f o g) x :> Da * Db" |
|
850 |
by (simp add: NSCDERIV_CDERIV_iff [symmetric] NSCDERIV_chain) |
|
851 |
||
852 |
lemma CDERIV_chain2: |
|
853 |
"[| CDERIV f (g x) :> Da; CDERIV g x :> Db |] |
|
854 |
==> CDERIV (%x. f (g x)) x :> Da * Db" |
|
855 |
by (auto dest: CDERIV_chain simp add: o_def) |
|
856 |
||
857 |
||
858 |
subsection{* Differentiation of Natural Number Powers*}
|
|
859 |
||
860 |
lemma NSCDERIV_Id [simp]: "NSCDERIV (%x. x) x :> 1" |
|
| 15228 | 861 |
by (simp add: NSCDERIV_NSCLIM_iff NSCLIM_def divide_self del: divide_self_if) |
| 14405 | 862 |
|
863 |
lemma CDERIV_Id [simp]: "CDERIV (%x. x) x :> 1" |
|
864 |
by (simp add: NSCDERIV_CDERIV_iff [symmetric]) |
|
865 |
||
866 |
lemmas isContc_Id = CDERIV_Id [THEN CDERIV_isContc, standard] |
|
| 13957 | 867 |
|
| 14405 | 868 |
text{*derivative of linear multiplication*}
|
869 |
lemma CDERIV_cmult_Id [simp]: "CDERIV (op * c) x :> c" |
|
870 |
by (cut_tac c = c and x = x in CDERIV_Id [THEN CDERIV_cmult], simp) |
|
871 |
||
872 |
lemma NSCDERIV_cmult_Id [simp]: "NSCDERIV (op * c) x :> c" |
|
873 |
by (simp add: NSCDERIV_CDERIV_iff) |
|
874 |
||
875 |
lemma CDERIV_pow [simp]: |
|
876 |
"CDERIV (%x. x ^ n) x :> (complex_of_real (real n)) * (x ^ (n - Suc 0))" |
|
877 |
apply (induct_tac "n") |
|
878 |
apply (drule_tac [2] CDERIV_Id [THEN CDERIV_mult]) |
|
| 15013 | 879 |
apply (auto simp add: left_distrib real_of_nat_Suc) |
| 14405 | 880 |
apply (case_tac "n") |
881 |
apply (auto simp add: mult_ac add_commute) |
|
882 |
done |
|
883 |
||
884 |
text{*Nonstandard version*}
|
|
885 |
lemma NSCDERIV_pow: |
|
886 |
"NSCDERIV (%x. x ^ n) x :> complex_of_real (real n) * (x ^ (n - 1))" |
|
887 |
by (simp add: NSCDERIV_CDERIV_iff) |
|
888 |
||
889 |
lemma lemma_CDERIV_subst: |
|
890 |
"[|CDERIV f x :> D; D = E|] ==> CDERIV f x :> E" |
|
891 |
by auto |
|
892 |
||
893 |
(*used once, in NSCDERIV_inverse*) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
894 |
lemma Infinitesimal_add_not_zero: |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
895 |
"[| h: Infinitesimal; x \<noteq> 0 |] ==> hcomplex_of_complex x + h \<noteq> 0" |
| 14405 | 896 |
apply clarify |
897 |
apply (drule equals_zero_I, auto) |
|
898 |
done |
|
899 |
||
900 |
text{*Can't relax the premise @{term "x \<noteq> 0"}: it isn't continuous at zero*}
|
|
901 |
lemma NSCDERIV_inverse: |
|
902 |
"x \<noteq> 0 ==> NSCDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))" |
|
903 |
apply (simp add: nscderiv_def Ball_def, clarify) |
|
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
904 |
apply (frule Infinitesimal_add_not_zero [where x=x]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
905 |
apply (auto simp add: starfun_inverse_inverse diff_minus |
| 14405 | 906 |
simp del: minus_mult_left [symmetric] minus_mult_right [symmetric]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
907 |
apply (simp add: add_commute numeral_2_eq_2 inverse_add |
| 14405 | 908 |
inverse_mult_distrib [symmetric] inverse_minus_eq [symmetric] |
909 |
add_ac mult_ac |
|
| 15013 | 910 |
del: inverse_minus_eq inverse_mult_distrib |
911 |
minus_mult_right [symmetric] minus_mult_left [symmetric]) |
|
| 14405 | 912 |
apply (simp only: mult_assoc [symmetric] right_distrib) |
|
20559
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
913 |
apply (rule_tac y = " inverse (- hcomplex_of_complex x * hcomplex_of_complex x) " in approx_trans) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
914 |
apply (rule inverse_add_Infinitesimal_approx2) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
915 |
apply (auto dest!: hcomplex_of_complex_HFinite_diff_Infinitesimal |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
916 |
intro: HFinite_mult |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
917 |
simp add: inverse_minus_eq [symmetric] HFinite_minus_iff) |
|
2116b7a371c7
removed capprox, CFinite, CInfinite, CInfinitesimal, cmonad, and cgalaxy in favor of polymorphic constants
huffman
parents:
20552
diff
changeset
|
918 |
apply (rule Infinitesimal_HFinite_mult2, auto) |
| 14405 | 919 |
done |
920 |
||
921 |
lemma CDERIV_inverse: |
|
922 |
"x \<noteq> 0 ==> CDERIV (%x. inverse(x)) x :> (-(inverse x ^ 2))" |
|
923 |
by (simp add: NSCDERIV_inverse NSCDERIV_CDERIV_iff [symmetric] |
|
924 |
del: complexpow_Suc) |
|
925 |
||
926 |
||
927 |
subsection{*Derivative of Reciprocals (Function @{term inverse})*}
|
|
928 |
||
929 |
lemma CDERIV_inverse_fun: |
|
930 |
"[| CDERIV f x :> d; f(x) \<noteq> 0 |] |
|
931 |
==> CDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))" |
|
932 |
apply (rule mult_commute [THEN subst]) |
|
| 15013 | 933 |
apply (simp add: minus_mult_left power_inverse |
934 |
del: complexpow_Suc minus_mult_left [symmetric]) |
|
| 14405 | 935 |
apply (fold o_def) |
936 |
apply (blast intro!: CDERIV_chain CDERIV_inverse) |
|
937 |
done |
|
938 |
||
939 |
lemma NSCDERIV_inverse_fun: |
|
940 |
"[| NSCDERIV f x :> d; f(x) \<noteq> 0 |] |
|
941 |
==> NSCDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))" |
|
942 |
by (simp add: NSCDERIV_CDERIV_iff CDERIV_inverse_fun del: complexpow_Suc) |
|
943 |
||
944 |
||
945 |
subsection{* Derivative of Quotient*}
|
|
946 |
||
947 |
lemma CDERIV_quotient: |
|
948 |
"[| CDERIV f x :> d; CDERIV g x :> e; g(x) \<noteq> 0 |] |
|
949 |
==> CDERIV (%y. f(y) / (g y)) x :> (d*g(x) - (e*f(x))) / (g(x) ^ 2)" |
|
| 14469 | 950 |
apply (simp add: diff_minus) |
| 14405 | 951 |
apply (drule_tac f = g in CDERIV_inverse_fun) |
952 |
apply (drule_tac [2] CDERIV_mult, assumption+) |
|
|
19233
77ca20b0ed77
renamed HOL + - * etc. to HOL.plus HOL.minus HOL.times etc.
haftmann
parents:
17373
diff
changeset
|
953 |
apply (simp add: divide_inverse left_distrib power_inverse minus_mult_left |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14405
diff
changeset
|
954 |
mult_ac |
|
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14405
diff
changeset
|
955 |
del: minus_mult_right [symmetric] minus_mult_left [symmetric] |
|
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14405
diff
changeset
|
956 |
complexpow_Suc) |
| 14405 | 957 |
done |
958 |
||
959 |
lemma NSCDERIV_quotient: |
|
960 |
"[| NSCDERIV f x :> d; NSCDERIV g x :> e; g(x) \<noteq> 0 |] |
|
961 |
==> NSCDERIV (%y. f(y) / (g y)) x :> (d*g(x) - (e*f(x))) / (g(x) ^ 2)" |
|
962 |
by (simp add: NSCDERIV_CDERIV_iff CDERIV_quotient del: complexpow_Suc) |
|
963 |
||
964 |
||
965 |
subsection{*Caratheodory Formulation of Derivative at a Point: Standard Proof*}
|
|
966 |
||
967 |
lemma CLIM_equal: |
|
968 |
"[| \<forall>x. x \<noteq> a --> (f x = g x) |] ==> (f -- a --C> l) = (g -- a --C> l)" |
|
969 |
by (simp add: CLIM_def complex_add_minus_iff) |
|
970 |
||
971 |
lemma CLIM_trans: |
|
972 |
"[| (%x. f(x) + -g(x)) -- a --C> 0; g -- a --C> l |] ==> f -- a --C> l" |
|
973 |
apply (drule CLIM_add, assumption) |
|
974 |
apply (simp add: complex_add_assoc) |
|
975 |
done |
|
976 |
||
977 |
lemma CARAT_CDERIV: |
|
978 |
"(CDERIV f x :> l) = |
|
979 |
(\<exists>g. (\<forall>z. f z - f x = g z * (z - x)) & isContc g x & g x = l)" |
|
980 |
apply safe |
|
981 |
apply (rule_tac x = "%z. if z=x then l else (f (z) - f (x)) / (z-x)" in exI) |
|
982 |
apply (auto simp add: mult_assoc isContc_iff CDERIV_iff) |
|
983 |
apply (rule_tac [!] CLIM_equal [THEN iffD1], auto) |
|
984 |
done |
|
985 |
||
986 |
||
987 |
lemma CARAT_NSCDERIV: |
|
988 |
"NSCDERIV f x :> l ==> |
|
989 |
\<exists>g. (\<forall>z. f z - f x = g z * (z - x)) & isNSContc g x & g x = l" |
|
| 14469 | 990 |
by (simp add: NSCDERIV_CDERIV_iff isNSContc_isContc_iff CARAT_CDERIV) |
| 14405 | 991 |
|
992 |
lemma CARAT_CDERIVD: |
|
993 |
"(\<forall>z. f z - f x = g z * (z - x)) & isNSContc g x & g x = l |
|
994 |
==> NSCDERIV f x :> l" |
|
| 20732 | 995 |
by (auto simp add: NSCDERIV_iff2 isNSContc_def starfun_if_eq); |
|
15234
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15228
diff
changeset
|
996 |
|
| 14405 | 997 |
end |