author | ballarin |
Wed, 19 Jul 2006 19:25:58 +0200 | |
changeset 20168 | ed7bced29e1b |
parent 19765 | dfe940911617 |
child 20217 | 25b068a99d2b |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : NSA.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
4 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
5 |
Converted to Isar and polished by lcp |
14370 | 6 |
*) |
10751 | 7 |
|
14370 | 8 |
header{*Infinite Numbers, Infinitesimals, Infinitely Close Relation*} |
9 |
||
15131 | 10 |
theory NSA |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
11 |
imports HyperArith "../Real/RComplete" |
15131 | 12 |
begin |
10751 | 13 |
|
19765 | 14 |
definition |
10751 | 15 |
|
16 |
Infinitesimal :: "hypreal set" |
|
19765 | 17 |
"Infinitesimal = {x. \<forall>r \<in> Reals. 0 < r --> abs x < r}" |
10751 | 18 |
|
19 |
HFinite :: "hypreal set" |
|
19765 | 20 |
"HFinite = {x. \<exists>r \<in> Reals. abs x < r}" |
10751 | 21 |
|
22 |
HInfinite :: "hypreal set" |
|
19765 | 23 |
"HInfinite = {x. \<forall>r \<in> Reals. r < abs x}" |
10751 | 24 |
|
14653 | 25 |
approx :: "[hypreal, hypreal] => bool" (infixl "@=" 50) |
15229 | 26 |
--{*the `infinitely close' relation*} |
19765 | 27 |
"(x @= y) = ((x + -y) \<in> Infinitesimal)" |
14653 | 28 |
|
14370 | 29 |
st :: "hypreal => hypreal" |
15229 | 30 |
--{*the standard part of a hyperreal*} |
19765 | 31 |
"st = (%x. @r. x \<in> HFinite & r \<in> Reals & r @= x)" |
10751 | 32 |
|
14370 | 33 |
monad :: "hypreal => hypreal set" |
19765 | 34 |
"monad x = {y. x @= y}" |
10751 | 35 |
|
14370 | 36 |
galaxy :: "hypreal => hypreal set" |
19765 | 37 |
"galaxy x = {y. (x + -y) \<in> HFinite}" |
38 |
||
39 |
const_syntax (xsymbols) |
|
40 |
approx (infixl "\<approx>" 50) |
|
41 |
||
42 |
const_syntax (HTML output) |
|
43 |
approx (infixl "\<approx>" 50) |
|
14370 | 44 |
|
45 |
||
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
46 |
defs (overloaded) |
19765 | 47 |
SReal_def: "Reals == {x. \<exists>r. x = hypreal_of_real r}" |
48 |
--{*the standard real numbers as a subset of the hyperreals*} |
|
14565 | 49 |
|
14370 | 50 |
|
51 |
||
15229 | 52 |
subsection{*Closure Laws for the Standard Reals*} |
14370 | 53 |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
54 |
lemma SReal_add [simp]: |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
55 |
"[| (x::hypreal) \<in> Reals; y \<in> Reals |] ==> x + y \<in> Reals" |
14370 | 56 |
apply (auto simp add: SReal_def) |
57 |
apply (rule_tac x = "r + ra" in exI, simp) |
|
58 |
done |
|
59 |
||
60 |
lemma SReal_mult: "[| (x::hypreal) \<in> Reals; y \<in> Reals |] ==> x * y \<in> Reals" |
|
61 |
apply (simp add: SReal_def, safe) |
|
62 |
apply (rule_tac x = "r * ra" in exI) |
|
15539 | 63 |
apply (simp (no_asm)) |
14370 | 64 |
done |
65 |
||
66 |
lemma SReal_inverse: "(x::hypreal) \<in> Reals ==> inverse x \<in> Reals" |
|
67 |
apply (simp add: SReal_def) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
68 |
apply (blast intro: star_of_inverse [symmetric]) |
14370 | 69 |
done |
70 |
||
71 |
lemma SReal_divide: "[| (x::hypreal) \<in> Reals; y \<in> Reals |] ==> x/y \<in> Reals" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
72 |
by (simp (no_asm_simp) add: SReal_mult SReal_inverse divide_inverse) |
14370 | 73 |
|
74 |
lemma SReal_minus: "(x::hypreal) \<in> Reals ==> -x \<in> Reals" |
|
75 |
apply (simp add: SReal_def) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
76 |
apply (blast intro: star_of_minus [symmetric]) |
14370 | 77 |
done |
78 |
||
15229 | 79 |
lemma SReal_minus_iff [simp]: "(-x \<in> Reals) = ((x::hypreal) \<in> Reals)" |
14370 | 80 |
apply auto |
81 |
apply (erule_tac [2] SReal_minus) |
|
82 |
apply (drule SReal_minus, auto) |
|
83 |
done |
|
84 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
85 |
lemma SReal_add_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
86 |
"[| (x::hypreal) + y \<in> Reals; y \<in> Reals |] ==> x \<in> Reals" |
14370 | 87 |
apply (drule_tac x = y in SReal_minus) |
88 |
apply (drule SReal_add, assumption, auto) |
|
89 |
done |
|
90 |
||
91 |
lemma SReal_hrabs: "(x::hypreal) \<in> Reals ==> abs x \<in> Reals" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
92 |
apply (auto simp add: SReal_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
93 |
apply (rule_tac x="abs r" in exI) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
94 |
apply simp |
14370 | 95 |
done |
96 |
||
15229 | 97 |
lemma SReal_hypreal_of_real [simp]: "hypreal_of_real x \<in> Reals" |
14370 | 98 |
by (simp add: SReal_def) |
99 |
||
15229 | 100 |
lemma SReal_number_of [simp]: "(number_of w ::hypreal) \<in> Reals" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
101 |
apply (simp only: star_of_number_of [symmetric]) |
14370 | 102 |
apply (rule SReal_hypreal_of_real) |
103 |
done |
|
104 |
||
105 |
(** As always with numerals, 0 and 1 are special cases **) |
|
106 |
||
15229 | 107 |
lemma Reals_0 [simp]: "(0::hypreal) \<in> Reals" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
108 |
apply (subst numeral_0_eq_0 [symmetric]) |
14370 | 109 |
apply (rule SReal_number_of) |
110 |
done |
|
111 |
||
15229 | 112 |
lemma Reals_1 [simp]: "(1::hypreal) \<in> Reals" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
113 |
apply (subst numeral_1_eq_1 [symmetric]) |
14370 | 114 |
apply (rule SReal_number_of) |
115 |
done |
|
116 |
||
117 |
lemma SReal_divide_number_of: "r \<in> Reals ==> r/(number_of w::hypreal) \<in> Reals" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
118 |
apply (simp only: divide_inverse) |
14370 | 119 |
apply (blast intro!: SReal_number_of SReal_mult SReal_inverse) |
120 |
done |
|
121 |
||
15229 | 122 |
text{*epsilon is not in Reals because it is an infinitesimal*} |
14370 | 123 |
lemma SReal_epsilon_not_mem: "epsilon \<notin> Reals" |
124 |
apply (simp add: SReal_def) |
|
125 |
apply (auto simp add: hypreal_of_real_not_eq_epsilon [THEN not_sym]) |
|
126 |
done |
|
127 |
||
128 |
lemma SReal_omega_not_mem: "omega \<notin> Reals" |
|
129 |
apply (simp add: SReal_def) |
|
130 |
apply (auto simp add: hypreal_of_real_not_eq_omega [THEN not_sym]) |
|
131 |
done |
|
132 |
||
133 |
lemma SReal_UNIV_real: "{x. hypreal_of_real x \<in> Reals} = (UNIV::real set)" |
|
134 |
by (simp add: SReal_def) |
|
135 |
||
136 |
lemma SReal_iff: "(x \<in> Reals) = (\<exists>y. x = hypreal_of_real y)" |
|
137 |
by (simp add: SReal_def) |
|
138 |
||
139 |
lemma hypreal_of_real_image: "hypreal_of_real `(UNIV::real set) = Reals" |
|
140 |
by (auto simp add: SReal_def) |
|
141 |
||
142 |
lemma inv_hypreal_of_real_image: "inv hypreal_of_real ` Reals = UNIV" |
|
143 |
apply (auto simp add: SReal_def) |
|
144 |
apply (rule inj_hypreal_of_real [THEN inv_f_f, THEN subst], blast) |
|
145 |
done |
|
146 |
||
147 |
lemma SReal_hypreal_of_real_image: |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
148 |
"[| \<exists>x. x: P; P \<subseteq> Reals |] ==> \<exists>Q. P = hypreal_of_real ` Q" |
14370 | 149 |
apply (simp add: SReal_def, blast) |
150 |
done |
|
151 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
152 |
lemma SReal_dense: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
153 |
"[| (x::hypreal) \<in> Reals; y \<in> Reals; x<y |] ==> \<exists>r \<in> Reals. x<r & r<y" |
14370 | 154 |
apply (auto simp add: SReal_iff) |
14477 | 155 |
apply (drule dense, safe) |
14370 | 156 |
apply (rule_tac x = "hypreal_of_real r" in bexI, auto) |
157 |
done |
|
158 |
||
15229 | 159 |
text{*Completeness of Reals, but both lemmas are unused.*} |
160 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
161 |
lemma SReal_sup_lemma: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
162 |
"P \<subseteq> Reals ==> ((\<exists>x \<in> P. y < x) = |
14370 | 163 |
(\<exists>X. hypreal_of_real X \<in> P & y < hypreal_of_real X))" |
164 |
by (blast dest!: SReal_iff [THEN iffD1]) |
|
165 |
||
166 |
lemma SReal_sup_lemma2: |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
167 |
"[| P \<subseteq> Reals; \<exists>x. x \<in> P; \<exists>y \<in> Reals. \<forall>x \<in> P. x < y |] |
14370 | 168 |
==> (\<exists>X. X \<in> {w. hypreal_of_real w \<in> P}) & |
169 |
(\<exists>Y. \<forall>X \<in> {w. hypreal_of_real w \<in> P}. X < Y)" |
|
170 |
apply (rule conjI) |
|
171 |
apply (fast dest!: SReal_iff [THEN iffD1]) |
|
172 |
apply (auto, frule subsetD, assumption) |
|
173 |
apply (drule SReal_iff [THEN iffD1]) |
|
174 |
apply (auto, rule_tac x = ya in exI, auto) |
|
175 |
done |
|
176 |
||
15229 | 177 |
|
178 |
subsection{*Lifting of the Ub and Lub Properties*} |
|
179 |
||
14370 | 180 |
lemma hypreal_of_real_isUb_iff: |
181 |
"(isUb (Reals) (hypreal_of_real ` Q) (hypreal_of_real Y)) = |
|
182 |
(isUb (UNIV :: real set) Q Y)" |
|
15229 | 183 |
by (simp add: isUb_def setle_def) |
14370 | 184 |
|
185 |
lemma hypreal_of_real_isLub1: |
|
186 |
"isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y) |
|
187 |
==> isLub (UNIV :: real set) Q Y" |
|
188 |
apply (simp add: isLub_def leastP_def) |
|
189 |
apply (auto intro: hypreal_of_real_isUb_iff [THEN iffD2] |
|
190 |
simp add: hypreal_of_real_isUb_iff setge_def) |
|
191 |
done |
|
192 |
||
193 |
lemma hypreal_of_real_isLub2: |
|
194 |
"isLub (UNIV :: real set) Q Y |
|
195 |
==> isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y)" |
|
196 |
apply (simp add: isLub_def leastP_def) |
|
197 |
apply (auto simp add: hypreal_of_real_isUb_iff setge_def) |
|
198 |
apply (frule_tac x2 = x in isUbD2a [THEN SReal_iff [THEN iffD1], THEN exE]) |
|
199 |
prefer 2 apply assumption |
|
200 |
apply (drule_tac x = xa in spec) |
|
201 |
apply (auto simp add: hypreal_of_real_isUb_iff) |
|
202 |
done |
|
203 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
204 |
lemma hypreal_of_real_isLub_iff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
205 |
"(isLub Reals (hypreal_of_real ` Q) (hypreal_of_real Y)) = |
14370 | 206 |
(isLub (UNIV :: real set) Q Y)" |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
207 |
by (blast intro: hypreal_of_real_isLub1 hypreal_of_real_isLub2) |
14370 | 208 |
|
209 |
lemma lemma_isUb_hypreal_of_real: |
|
210 |
"isUb Reals P Y ==> \<exists>Yo. isUb Reals P (hypreal_of_real Yo)" |
|
211 |
by (auto simp add: SReal_iff isUb_def) |
|
212 |
||
213 |
lemma lemma_isLub_hypreal_of_real: |
|
214 |
"isLub Reals P Y ==> \<exists>Yo. isLub Reals P (hypreal_of_real Yo)" |
|
215 |
by (auto simp add: isLub_def leastP_def isUb_def SReal_iff) |
|
216 |
||
217 |
lemma lemma_isLub_hypreal_of_real2: |
|
218 |
"\<exists>Yo. isLub Reals P (hypreal_of_real Yo) ==> \<exists>Y. isLub Reals P Y" |
|
219 |
by (auto simp add: isLub_def leastP_def isUb_def) |
|
220 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
221 |
lemma SReal_complete: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
222 |
"[| P \<subseteq> Reals; \<exists>x. x \<in> P; \<exists>Y. isUb Reals P Y |] |
14370 | 223 |
==> \<exists>t::hypreal. isLub Reals P t" |
224 |
apply (frule SReal_hypreal_of_real_image) |
|
225 |
apply (auto, drule lemma_isUb_hypreal_of_real) |
|
15229 | 226 |
apply (auto intro!: reals_complete lemma_isLub_hypreal_of_real2 |
227 |
simp add: hypreal_of_real_isLub_iff hypreal_of_real_isUb_iff) |
|
14370 | 228 |
done |
229 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
230 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
231 |
subsection{* Set of Finite Elements is a Subring of the Extended Reals*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
232 |
|
14370 | 233 |
lemma HFinite_add: "[|x \<in> HFinite; y \<in> HFinite|] ==> (x+y) \<in> HFinite" |
234 |
apply (simp add: HFinite_def) |
|
235 |
apply (blast intro!: SReal_add hrabs_add_less) |
|
236 |
done |
|
237 |
||
238 |
lemma HFinite_mult: "[|x \<in> HFinite; y \<in> HFinite|] ==> x*y \<in> HFinite" |
|
16924 | 239 |
apply (simp add: HFinite_def abs_mult) |
14370 | 240 |
apply (blast intro!: SReal_mult abs_mult_less) |
241 |
done |
|
242 |
||
243 |
lemma HFinite_minus_iff: "(-x \<in> HFinite) = (x \<in> HFinite)" |
|
244 |
by (simp add: HFinite_def) |
|
245 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
246 |
lemma SReal_subset_HFinite: "Reals \<subseteq> HFinite" |
14370 | 247 |
apply (auto simp add: SReal_def HFinite_def) |
248 |
apply (rule_tac x = "1 + abs (hypreal_of_real r) " in exI) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
249 |
apply (rule conjI, rule_tac x = "1 + abs r" in exI) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
250 |
apply simp_all |
14370 | 251 |
done |
252 |
||
253 |
lemma HFinite_hypreal_of_real [simp]: "hypreal_of_real x \<in> HFinite" |
|
254 |
by (auto intro: SReal_subset_HFinite [THEN subsetD]) |
|
255 |
||
256 |
lemma HFiniteD: "x \<in> HFinite ==> \<exists>t \<in> Reals. abs x < t" |
|
257 |
by (simp add: HFinite_def) |
|
258 |
||
15229 | 259 |
lemma HFinite_hrabs_iff [iff]: "(abs x \<in> HFinite) = (x \<in> HFinite)" |
14370 | 260 |
by (simp add: HFinite_def) |
261 |
||
15229 | 262 |
lemma HFinite_number_of [simp]: "number_of w \<in> HFinite" |
14370 | 263 |
by (rule SReal_number_of [THEN SReal_subset_HFinite [THEN subsetD]]) |
264 |
||
265 |
(** As always with numerals, 0 and 1 are special cases **) |
|
266 |
||
15229 | 267 |
lemma HFinite_0 [simp]: "0 \<in> HFinite" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
268 |
apply (subst numeral_0_eq_0 [symmetric]) |
14370 | 269 |
apply (rule HFinite_number_of) |
270 |
done |
|
271 |
||
15229 | 272 |
lemma HFinite_1 [simp]: "1 \<in> HFinite" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
273 |
apply (subst numeral_1_eq_1 [symmetric]) |
14370 | 274 |
apply (rule HFinite_number_of) |
275 |
done |
|
276 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
277 |
lemma HFinite_bounded: "[|x \<in> HFinite; y \<le> x; 0 \<le> y |] ==> y \<in> HFinite" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
278 |
apply (case_tac "x \<le> 0") |
14370 | 279 |
apply (drule_tac y = x in order_trans) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
280 |
apply (drule_tac [2] order_antisym) |
14370 | 281 |
apply (auto simp add: linorder_not_le) |
282 |
apply (auto intro: order_le_less_trans simp add: abs_if HFinite_def) |
|
283 |
done |
|
284 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
285 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
286 |
subsection{* Set of Infinitesimals is a Subring of the Hyperreals*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
287 |
|
14370 | 288 |
lemma InfinitesimalD: |
289 |
"x \<in> Infinitesimal ==> \<forall>r \<in> Reals. 0 < r --> abs x < r" |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
290 |
by (simp add: Infinitesimal_def) |
14370 | 291 |
|
15229 | 292 |
lemma Infinitesimal_zero [iff]: "0 \<in> Infinitesimal" |
14370 | 293 |
by (simp add: Infinitesimal_def) |
294 |
||
295 |
lemma hypreal_sum_of_halves: "x/(2::hypreal) + x/(2::hypreal) = x" |
|
296 |
by auto |
|
297 |
||
298 |
lemma Infinitesimal_add: |
|
299 |
"[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> (x+y) \<in> Infinitesimal" |
|
300 |
apply (auto simp add: Infinitesimal_def) |
|
301 |
apply (rule hypreal_sum_of_halves [THEN subst]) |
|
14477 | 302 |
apply (drule half_gt_zero) |
15539 | 303 |
apply (blast intro: hrabs_add_less SReal_divide_number_of) |
14370 | 304 |
done |
305 |
||
15229 | 306 |
lemma Infinitesimal_minus_iff [simp]: "(-x:Infinitesimal) = (x:Infinitesimal)" |
14370 | 307 |
by (simp add: Infinitesimal_def) |
308 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
309 |
lemma Infinitesimal_diff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
310 |
"[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> x-y \<in> Infinitesimal" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
311 |
by (simp add: diff_def Infinitesimal_add) |
14370 | 312 |
|
313 |
lemma Infinitesimal_mult: |
|
314 |
"[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> (x * y) \<in> Infinitesimal" |
|
16924 | 315 |
apply (auto simp add: Infinitesimal_def abs_mult) |
316 |
apply (case_tac "y=0", simp) |
|
317 |
apply (cut_tac a = "abs x" and b = 1 and c = "abs y" and d = r |
|
318 |
in mult_strict_mono, auto) |
|
14370 | 319 |
done |
320 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
321 |
lemma Infinitesimal_HFinite_mult: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
322 |
"[| x \<in> Infinitesimal; y \<in> HFinite |] ==> (x * y) \<in> Infinitesimal" |
16924 | 323 |
apply (auto dest!: HFiniteD simp add: Infinitesimal_def abs_mult) |
14370 | 324 |
apply (frule hrabs_less_gt_zero) |
325 |
apply (drule_tac x = "r/t" in bspec) |
|
326 |
apply (blast intro: SReal_divide) |
|
15234
ec91a90c604e
simplification tweaks for better arithmetic reasoning
paulson
parents:
15229
diff
changeset
|
327 |
apply (cut_tac a = "abs x" and b = "r/t" and c = "abs y" in mult_strict_mono) |
15539 | 328 |
apply (auto simp add: zero_less_divide_iff) |
14370 | 329 |
done |
330 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
331 |
lemma Infinitesimal_HFinite_mult2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
332 |
"[| x \<in> Infinitesimal; y \<in> HFinite |] ==> (y * x) \<in> Infinitesimal" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
333 |
by (auto dest: Infinitesimal_HFinite_mult simp add: mult_commute) |
14370 | 334 |
|
335 |
(*** rather long proof ***) |
|
336 |
lemma HInfinite_inverse_Infinitesimal: |
|
337 |
"x \<in> HInfinite ==> inverse x: Infinitesimal" |
|
338 |
apply (auto simp add: HInfinite_def Infinitesimal_def) |
|
339 |
apply (erule_tac x = "inverse r" in ballE) |
|
340 |
apply (frule_tac a1 = r and z = "abs x" in positive_imp_inverse_positive [THEN order_less_trans], assumption) |
|
341 |
apply (drule inverse_inverse_eq [symmetric, THEN subst]) |
|
342 |
apply (rule inverse_less_iff_less [THEN iffD1]) |
|
343 |
apply (auto simp add: SReal_inverse) |
|
344 |
done |
|
345 |
||
346 |
lemma HInfinite_mult: "[|x \<in> HInfinite;y \<in> HInfinite|] ==> (x*y) \<in> HInfinite" |
|
16924 | 347 |
apply (auto simp add: HInfinite_def abs_mult) |
14370 | 348 |
apply (erule_tac x = 1 in ballE) |
349 |
apply (erule_tac x = r in ballE) |
|
16924 | 350 |
apply (case_tac "y=0", simp) |
351 |
apply (cut_tac c = 1 and d = "abs x" and a = r and b = "abs y" in mult_strict_mono) |
|
14370 | 352 |
apply (auto simp add: mult_ac) |
353 |
done |
|
354 |
||
15229 | 355 |
lemma hypreal_add_zero_less_le_mono: "[|r < x; (0::hypreal) \<le> y|] ==> r < x+y" |
356 |
by (auto dest: add_less_le_mono) |
|
357 |
||
14370 | 358 |
lemma HInfinite_add_ge_zero: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
359 |
"[|x \<in> HInfinite; 0 \<le> y; 0 \<le> x|] ==> (x + y): HInfinite" |
14370 | 360 |
by (auto intro!: hypreal_add_zero_less_le_mono |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
361 |
simp add: abs_if add_commute add_nonneg_nonneg HInfinite_def) |
14370 | 362 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
363 |
lemma HInfinite_add_ge_zero2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
364 |
"[|x \<in> HInfinite; 0 \<le> y; 0 \<le> x|] ==> (y + x): HInfinite" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
365 |
by (auto intro!: HInfinite_add_ge_zero simp add: add_commute) |
14370 | 366 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
367 |
lemma HInfinite_add_gt_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
368 |
"[|x \<in> HInfinite; 0 < y; 0 < x|] ==> (x + y): HInfinite" |
14370 | 369 |
by (blast intro: HInfinite_add_ge_zero order_less_imp_le) |
370 |
||
371 |
lemma HInfinite_minus_iff: "(-x \<in> HInfinite) = (x \<in> HInfinite)" |
|
372 |
by (simp add: HInfinite_def) |
|
373 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
374 |
lemma HInfinite_add_le_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
375 |
"[|x \<in> HInfinite; y \<le> 0; x \<le> 0|] ==> (x + y): HInfinite" |
14370 | 376 |
apply (drule HInfinite_minus_iff [THEN iffD2]) |
377 |
apply (rule HInfinite_minus_iff [THEN iffD1]) |
|
378 |
apply (auto intro: HInfinite_add_ge_zero) |
|
379 |
done |
|
380 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
381 |
lemma HInfinite_add_lt_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
382 |
"[|x \<in> HInfinite; y < 0; x < 0|] ==> (x + y): HInfinite" |
14370 | 383 |
by (blast intro: HInfinite_add_le_zero order_less_imp_le) |
384 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
385 |
lemma HFinite_sum_squares: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
386 |
"[|a: HFinite; b: HFinite; c: HFinite|] |
14370 | 387 |
==> a*a + b*b + c*c \<in> HFinite" |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
388 |
by (auto intro: HFinite_mult HFinite_add) |
14370 | 389 |
|
390 |
lemma not_Infinitesimal_not_zero: "x \<notin> Infinitesimal ==> x \<noteq> 0" |
|
391 |
by auto |
|
392 |
||
393 |
lemma not_Infinitesimal_not_zero2: "x \<in> HFinite - Infinitesimal ==> x \<noteq> 0" |
|
394 |
by auto |
|
395 |
||
15229 | 396 |
lemma Infinitesimal_hrabs_iff [iff]: |
397 |
"(abs x \<in> Infinitesimal) = (x \<in> Infinitesimal)" |
|
15003 | 398 |
by (auto simp add: abs_if) |
14370 | 399 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
400 |
lemma HFinite_diff_Infinitesimal_hrabs: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
401 |
"x \<in> HFinite - Infinitesimal ==> abs x \<in> HFinite - Infinitesimal" |
14370 | 402 |
by blast |
403 |
||
404 |
lemma hrabs_less_Infinitesimal: |
|
405 |
"[| e \<in> Infinitesimal; abs x < e |] ==> x \<in> Infinitesimal" |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
406 |
by (auto simp add: Infinitesimal_def abs_less_iff) |
14370 | 407 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
408 |
lemma hrabs_le_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
409 |
"[| e \<in> Infinitesimal; abs x \<le> e |] ==> x \<in> Infinitesimal" |
14370 | 410 |
by (blast dest: order_le_imp_less_or_eq intro: hrabs_less_Infinitesimal) |
411 |
||
412 |
lemma Infinitesimal_interval: |
|
413 |
"[| e \<in> Infinitesimal; e' \<in> Infinitesimal; e' < x ; x < e |] |
|
414 |
==> x \<in> Infinitesimal" |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
415 |
by (auto simp add: Infinitesimal_def abs_less_iff) |
14370 | 416 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
417 |
lemma Infinitesimal_interval2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
418 |
"[| e \<in> Infinitesimal; e' \<in> Infinitesimal; |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
419 |
e' \<le> x ; x \<le> e |] ==> x \<in> Infinitesimal" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
420 |
by (auto intro: Infinitesimal_interval simp add: order_le_less) |
14370 | 421 |
|
422 |
lemma not_Infinitesimal_mult: |
|
423 |
"[| x \<notin> Infinitesimal; y \<notin> Infinitesimal|] ==> (x*y) \<notin>Infinitesimal" |
|
424 |
apply (unfold Infinitesimal_def, clarify) |
|
16924 | 425 |
apply (simp add: linorder_not_less abs_mult) |
14370 | 426 |
apply (erule_tac x = "r*ra" in ballE) |
427 |
prefer 2 apply (fast intro: SReal_mult) |
|
428 |
apply (auto simp add: zero_less_mult_iff) |
|
429 |
apply (cut_tac c = ra and d = "abs y" and a = r and b = "abs x" in mult_mono, auto) |
|
430 |
done |
|
431 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
432 |
lemma Infinitesimal_mult_disj: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
433 |
"x*y \<in> Infinitesimal ==> x \<in> Infinitesimal | y \<in> Infinitesimal" |
14370 | 434 |
apply (rule ccontr) |
435 |
apply (drule de_Morgan_disj [THEN iffD1]) |
|
436 |
apply (fast dest: not_Infinitesimal_mult) |
|
437 |
done |
|
438 |
||
439 |
lemma HFinite_Infinitesimal_not_zero: "x \<in> HFinite-Infinitesimal ==> x \<noteq> 0" |
|
440 |
by blast |
|
441 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
442 |
lemma HFinite_Infinitesimal_diff_mult: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
443 |
"[| x \<in> HFinite - Infinitesimal; |
14370 | 444 |
y \<in> HFinite - Infinitesimal |
445 |
|] ==> (x*y) \<in> HFinite - Infinitesimal" |
|
446 |
apply clarify |
|
447 |
apply (blast dest: HFinite_mult not_Infinitesimal_mult) |
|
448 |
done |
|
449 |
||
450 |
lemma Infinitesimal_subset_HFinite: |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
451 |
"Infinitesimal \<subseteq> HFinite" |
14370 | 452 |
apply (simp add: Infinitesimal_def HFinite_def, auto) |
453 |
apply (rule_tac x = 1 in bexI, auto) |
|
454 |
done |
|
455 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
456 |
lemma Infinitesimal_hypreal_of_real_mult: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
457 |
"x \<in> Infinitesimal ==> x * hypreal_of_real r \<in> Infinitesimal" |
14370 | 458 |
by (erule HFinite_hypreal_of_real [THEN [2] Infinitesimal_HFinite_mult]) |
459 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
460 |
lemma Infinitesimal_hypreal_of_real_mult2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
461 |
"x \<in> Infinitesimal ==> hypreal_of_real r * x \<in> Infinitesimal" |
14370 | 462 |
by (erule HFinite_hypreal_of_real [THEN [2] Infinitesimal_HFinite_mult2]) |
463 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
464 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
465 |
subsection{*The Infinitely Close Relation*} |
14370 | 466 |
|
467 |
lemma mem_infmal_iff: "(x \<in> Infinitesimal) = (x @= 0)" |
|
468 |
by (simp add: Infinitesimal_def approx_def) |
|
469 |
||
470 |
lemma approx_minus_iff: " (x @= y) = (x + -y @= 0)" |
|
471 |
by (simp add: approx_def) |
|
472 |
||
473 |
lemma approx_minus_iff2: " (x @= y) = (-y + x @= 0)" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
474 |
by (simp add: approx_def add_commute) |
14370 | 475 |
|
15229 | 476 |
lemma approx_refl [iff]: "x @= x" |
14370 | 477 |
by (simp add: approx_def Infinitesimal_def) |
478 |
||
14477 | 479 |
lemma hypreal_minus_distrib1: "-(y + -(x::hypreal)) = x + -y" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
480 |
by (simp add: add_commute) |
14477 | 481 |
|
14370 | 482 |
lemma approx_sym: "x @= y ==> y @= x" |
483 |
apply (simp add: approx_def) |
|
484 |
apply (rule hypreal_minus_distrib1 [THEN subst]) |
|
485 |
apply (erule Infinitesimal_minus_iff [THEN iffD2]) |
|
486 |
done |
|
487 |
||
488 |
lemma approx_trans: "[| x @= y; y @= z |] ==> x @= z" |
|
489 |
apply (simp add: approx_def) |
|
490 |
apply (drule Infinitesimal_add, assumption, auto) |
|
491 |
done |
|
492 |
||
493 |
lemma approx_trans2: "[| r @= x; s @= x |] ==> r @= s" |
|
494 |
by (blast intro: approx_sym approx_trans) |
|
495 |
||
496 |
lemma approx_trans3: "[| x @= r; x @= s|] ==> r @= s" |
|
497 |
by (blast intro: approx_sym approx_trans) |
|
498 |
||
499 |
lemma number_of_approx_reorient: "(number_of w @= x) = (x @= number_of w)" |
|
500 |
by (blast intro: approx_sym) |
|
501 |
||
502 |
lemma zero_approx_reorient: "(0 @= x) = (x @= 0)" |
|
503 |
by (blast intro: approx_sym) |
|
504 |
||
505 |
lemma one_approx_reorient: "(1 @= x) = (x @= 1)" |
|
506 |
by (blast intro: approx_sym) |
|
10751 | 507 |
|
508 |
||
19765 | 509 |
ML {* |
510 |
local |
|
14370 | 511 |
(*** re-orientation, following HOL/Integ/Bin.ML |
512 |
We re-orient x @=y where x is 0, 1 or a numeral, unless y is as well! |
|
513 |
***) |
|
514 |
||
515 |
(*reorientation simprules using ==, for the following simproc*) |
|
19765 | 516 |
val meta_zero_approx_reorient = thm "zero_approx_reorient" RS eq_reflection; |
517 |
val meta_one_approx_reorient = thm "one_approx_reorient" RS eq_reflection; |
|
518 |
val meta_number_of_approx_reorient = thm "number_of_approx_reorient" RS eq_reflection |
|
14370 | 519 |
|
520 |
(*reorientation simplification procedure: reorients (polymorphic) |
|
521 |
0 = x, 1 = x, nnn = x provided x isn't 0, 1 or a numeral.*) |
|
522 |
fun reorient_proc sg _ (_ $ t $ u) = |
|
523 |
case u of |
|
15531 | 524 |
Const("0", _) => NONE |
525 |
| Const("1", _) => NONE |
|
526 |
| Const("Numeral.number_of", _) $ _ => NONE |
|
527 |
| _ => SOME (case t of |
|
14370 | 528 |
Const("0", _) => meta_zero_approx_reorient |
529 |
| Const("1", _) => meta_one_approx_reorient |
|
530 |
| Const("Numeral.number_of", _) $ _ => |
|
531 |
meta_number_of_approx_reorient); |
|
532 |
||
19765 | 533 |
in |
14370 | 534 |
val approx_reorient_simproc = |
535 |
Bin_Simprocs.prep_simproc |
|
536 |
("reorient_simproc", ["0@=x", "1@=x", "number_of w @= x"], reorient_proc); |
|
19765 | 537 |
end; |
14370 | 538 |
|
539 |
Addsimprocs [approx_reorient_simproc]; |
|
540 |
*} |
|
541 |
||
542 |
lemma Infinitesimal_approx_minus: "(x-y \<in> Infinitesimal) = (x @= y)" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
543 |
by (auto simp add: diff_def approx_minus_iff [symmetric] mem_infmal_iff) |
14370 | 544 |
|
545 |
lemma approx_monad_iff: "(x @= y) = (monad(x)=monad(y))" |
|
546 |
apply (simp add: monad_def) |
|
547 |
apply (auto dest: approx_sym elim!: approx_trans equalityCE) |
|
548 |
done |
|
549 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
550 |
lemma Infinitesimal_approx: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
551 |
"[| x \<in> Infinitesimal; y \<in> Infinitesimal |] ==> x @= y" |
14370 | 552 |
apply (simp add: mem_infmal_iff) |
553 |
apply (blast intro: approx_trans approx_sym) |
|
554 |
done |
|
555 |
||
556 |
lemma approx_add: "[| a @= b; c @= d |] ==> a+c @= b+d" |
|
557 |
proof (unfold approx_def) |
|
558 |
assume inf: "a + - b \<in> Infinitesimal" "c + - d \<in> Infinitesimal" |
|
559 |
have "a + c + - (b + d) = (a + - b) + (c + - d)" by arith |
|
560 |
also have "... \<in> Infinitesimal" using inf by (rule Infinitesimal_add) |
|
561 |
finally show "a + c + - (b + d) \<in> Infinitesimal" . |
|
562 |
qed |
|
563 |
||
564 |
lemma approx_minus: "a @= b ==> -a @= -b" |
|
565 |
apply (rule approx_minus_iff [THEN iffD2, THEN approx_sym]) |
|
566 |
apply (drule approx_minus_iff [THEN iffD1]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
567 |
apply (simp (no_asm) add: add_commute) |
14370 | 568 |
done |
569 |
||
570 |
lemma approx_minus2: "-a @= -b ==> a @= b" |
|
571 |
by (auto dest: approx_minus) |
|
572 |
||
15229 | 573 |
lemma approx_minus_cancel [simp]: "(-a @= -b) = (a @= b)" |
14370 | 574 |
by (blast intro: approx_minus approx_minus2) |
575 |
||
576 |
lemma approx_add_minus: "[| a @= b; c @= d |] ==> a + -c @= b + -d" |
|
577 |
by (blast intro!: approx_add approx_minus) |
|
578 |
||
579 |
lemma approx_mult1: "[| a @= b; c: HFinite|] ==> a*c @= b*c" |
|
580 |
by (simp add: approx_def Infinitesimal_HFinite_mult minus_mult_left |
|
581 |
left_distrib [symmetric] |
|
582 |
del: minus_mult_left [symmetric]) |
|
583 |
||
584 |
lemma approx_mult2: "[|a @= b; c: HFinite|] ==> c*a @= c*b" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
585 |
by (simp add: approx_mult1 mult_commute) |
14370 | 586 |
|
587 |
lemma approx_mult_subst: "[|u @= v*x; x @= y; v \<in> HFinite|] ==> u @= v*y" |
|
588 |
by (blast intro: approx_mult2 approx_trans) |
|
589 |
||
590 |
lemma approx_mult_subst2: "[| u @= x*v; x @= y; v \<in> HFinite |] ==> u @= y*v" |
|
591 |
by (blast intro: approx_mult1 approx_trans) |
|
592 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
593 |
lemma approx_mult_subst_SReal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
594 |
"[| u @= x*hypreal_of_real v; x @= y |] ==> u @= y*hypreal_of_real v" |
14370 | 595 |
by (auto intro: approx_mult_subst2) |
596 |
||
597 |
lemma approx_eq_imp: "a = b ==> a @= b" |
|
598 |
by (simp add: approx_def) |
|
599 |
||
600 |
lemma Infinitesimal_minus_approx: "x \<in> Infinitesimal ==> -x @= x" |
|
601 |
by (blast intro: Infinitesimal_minus_iff [THEN iffD2] |
|
602 |
mem_infmal_iff [THEN iffD1] approx_trans2) |
|
603 |
||
604 |
lemma bex_Infinitesimal_iff: "(\<exists>y \<in> Infinitesimal. x + -z = y) = (x @= z)" |
|
605 |
by (simp add: approx_def) |
|
606 |
||
607 |
lemma bex_Infinitesimal_iff2: "(\<exists>y \<in> Infinitesimal. x = z + y) = (x @= z)" |
|
608 |
by (force simp add: bex_Infinitesimal_iff [symmetric]) |
|
609 |
||
610 |
lemma Infinitesimal_add_approx: "[| y \<in> Infinitesimal; x + y = z |] ==> x @= z" |
|
611 |
apply (rule bex_Infinitesimal_iff [THEN iffD1]) |
|
612 |
apply (drule Infinitesimal_minus_iff [THEN iffD2]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
613 |
apply (auto simp add: add_assoc [symmetric]) |
14370 | 614 |
done |
615 |
||
616 |
lemma Infinitesimal_add_approx_self: "y \<in> Infinitesimal ==> x @= x + y" |
|
617 |
apply (rule bex_Infinitesimal_iff [THEN iffD1]) |
|
618 |
apply (drule Infinitesimal_minus_iff [THEN iffD2]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
619 |
apply (auto simp add: add_assoc [symmetric]) |
14370 | 620 |
done |
621 |
||
622 |
lemma Infinitesimal_add_approx_self2: "y \<in> Infinitesimal ==> x @= y + x" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
623 |
by (auto dest: Infinitesimal_add_approx_self simp add: add_commute) |
14370 | 624 |
|
625 |
lemma Infinitesimal_add_minus_approx_self: "y \<in> Infinitesimal ==> x @= x + -y" |
|
626 |
by (blast intro!: Infinitesimal_add_approx_self Infinitesimal_minus_iff [THEN iffD2]) |
|
627 |
||
628 |
lemma Infinitesimal_add_cancel: "[| y \<in> Infinitesimal; x+y @= z|] ==> x @= z" |
|
629 |
apply (drule_tac x = x in Infinitesimal_add_approx_self [THEN approx_sym]) |
|
630 |
apply (erule approx_trans3 [THEN approx_sym], assumption) |
|
631 |
done |
|
632 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
633 |
lemma Infinitesimal_add_right_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
634 |
"[| y \<in> Infinitesimal; x @= z + y|] ==> x @= z" |
14370 | 635 |
apply (drule_tac x = z in Infinitesimal_add_approx_self2 [THEN approx_sym]) |
636 |
apply (erule approx_trans3 [THEN approx_sym]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
637 |
apply (simp add: add_commute) |
14370 | 638 |
apply (erule approx_sym) |
639 |
done |
|
640 |
||
641 |
lemma approx_add_left_cancel: "d + b @= d + c ==> b @= c" |
|
642 |
apply (drule approx_minus_iff [THEN iffD1]) |
|
15539 | 643 |
apply (simp add: approx_minus_iff [symmetric] add_ac) |
14370 | 644 |
done |
645 |
||
646 |
lemma approx_add_right_cancel: "b + d @= c + d ==> b @= c" |
|
647 |
apply (rule approx_add_left_cancel) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
648 |
apply (simp add: add_commute) |
14370 | 649 |
done |
650 |
||
651 |
lemma approx_add_mono1: "b @= c ==> d + b @= d + c" |
|
652 |
apply (rule approx_minus_iff [THEN iffD2]) |
|
15539 | 653 |
apply (simp add: approx_minus_iff [symmetric] add_ac) |
14370 | 654 |
done |
655 |
||
656 |
lemma approx_add_mono2: "b @= c ==> b + a @= c + a" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
657 |
by (simp add: add_commute approx_add_mono1) |
14370 | 658 |
|
15229 | 659 |
lemma approx_add_left_iff [simp]: "(a + b @= a + c) = (b @= c)" |
14370 | 660 |
by (fast elim: approx_add_left_cancel approx_add_mono1) |
661 |
||
15229 | 662 |
lemma approx_add_right_iff [simp]: "(b + a @= c + a) = (b @= c)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
663 |
by (simp add: add_commute) |
14370 | 664 |
|
665 |
lemma approx_HFinite: "[| x \<in> HFinite; x @= y |] ==> y \<in> HFinite" |
|
666 |
apply (drule bex_Infinitesimal_iff2 [THEN iffD2], safe) |
|
667 |
apply (drule Infinitesimal_subset_HFinite [THEN subsetD, THEN HFinite_minus_iff [THEN iffD2]]) |
|
668 |
apply (drule HFinite_add) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
669 |
apply (auto simp add: add_assoc) |
14370 | 670 |
done |
671 |
||
672 |
lemma approx_hypreal_of_real_HFinite: "x @= hypreal_of_real D ==> x \<in> HFinite" |
|
673 |
by (rule approx_sym [THEN [2] approx_HFinite], auto) |
|
674 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
675 |
lemma approx_mult_HFinite: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
676 |
"[|a @= b; c @= d; b: HFinite; d: HFinite|] ==> a*c @= b*d" |
14370 | 677 |
apply (rule approx_trans) |
678 |
apply (rule_tac [2] approx_mult2) |
|
679 |
apply (rule approx_mult1) |
|
680 |
prefer 2 apply (blast intro: approx_HFinite approx_sym, auto) |
|
681 |
done |
|
682 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
683 |
lemma approx_mult_hypreal_of_real: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
684 |
"[|a @= hypreal_of_real b; c @= hypreal_of_real d |] |
14370 | 685 |
==> a*c @= hypreal_of_real b*hypreal_of_real d" |
15229 | 686 |
by (blast intro!: approx_mult_HFinite approx_hypreal_of_real_HFinite |
687 |
HFinite_hypreal_of_real) |
|
14370 | 688 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
689 |
lemma approx_SReal_mult_cancel_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
690 |
"[| a \<in> Reals; a \<noteq> 0; a*x @= 0 |] ==> x @= 0" |
14370 | 691 |
apply (drule SReal_inverse [THEN SReal_subset_HFinite [THEN subsetD]]) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
692 |
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric]) |
14370 | 693 |
done |
694 |
||
695 |
lemma approx_mult_SReal1: "[| a \<in> Reals; x @= 0 |] ==> x*a @= 0" |
|
696 |
by (auto dest: SReal_subset_HFinite [THEN subsetD] approx_mult1) |
|
697 |
||
698 |
lemma approx_mult_SReal2: "[| a \<in> Reals; x @= 0 |] ==> a*x @= 0" |
|
699 |
by (auto dest: SReal_subset_HFinite [THEN subsetD] approx_mult2) |
|
700 |
||
15229 | 701 |
lemma approx_mult_SReal_zero_cancel_iff [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
702 |
"[|a \<in> Reals; a \<noteq> 0 |] ==> (a*x @= 0) = (x @= 0)" |
14370 | 703 |
by (blast intro: approx_SReal_mult_cancel_zero approx_mult_SReal2) |
704 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
705 |
lemma approx_SReal_mult_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
706 |
"[| a \<in> Reals; a \<noteq> 0; a* w @= a*z |] ==> w @= z" |
14370 | 707 |
apply (drule SReal_inverse [THEN SReal_subset_HFinite [THEN subsetD]]) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
708 |
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric]) |
14370 | 709 |
done |
710 |
||
15229 | 711 |
lemma approx_SReal_mult_cancel_iff1 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
712 |
"[| a \<in> Reals; a \<noteq> 0|] ==> (a* w @= a*z) = (w @= z)" |
15229 | 713 |
by (auto intro!: approx_mult2 SReal_subset_HFinite [THEN subsetD] |
714 |
intro: approx_SReal_mult_cancel) |
|
14370 | 715 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
716 |
lemma approx_le_bound: "[| z \<le> f; f @= g; g \<le> z |] ==> f @= z" |
14370 | 717 |
apply (simp add: bex_Infinitesimal_iff2 [symmetric], auto) |
718 |
apply (rule_tac x = "g+y-z" in bexI) |
|
719 |
apply (simp (no_asm)) |
|
720 |
apply (rule Infinitesimal_interval2) |
|
721 |
apply (rule_tac [2] Infinitesimal_zero, auto) |
|
722 |
done |
|
723 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
724 |
|
15539 | 725 |
subsection{* Zero is the Only Infinitesimal that is also a Real*} |
14370 | 726 |
|
727 |
lemma Infinitesimal_less_SReal: |
|
728 |
"[| x \<in> Reals; y \<in> Infinitesimal; 0 < x |] ==> y < x" |
|
729 |
apply (simp add: Infinitesimal_def) |
|
730 |
apply (rule abs_ge_self [THEN order_le_less_trans], auto) |
|
731 |
done |
|
732 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
733 |
lemma Infinitesimal_less_SReal2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
734 |
"y \<in> Infinitesimal ==> \<forall>r \<in> Reals. 0 < r --> y < r" |
14370 | 735 |
by (blast intro: Infinitesimal_less_SReal) |
736 |
||
737 |
lemma SReal_not_Infinitesimal: |
|
738 |
"[| 0 < y; y \<in> Reals|] ==> y \<notin> Infinitesimal" |
|
739 |
apply (simp add: Infinitesimal_def) |
|
15003 | 740 |
apply (auto simp add: abs_if) |
14370 | 741 |
done |
742 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
743 |
lemma SReal_minus_not_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
744 |
"[| y < 0; y \<in> Reals |] ==> y \<notin> Infinitesimal" |
14370 | 745 |
apply (subst Infinitesimal_minus_iff [symmetric]) |
746 |
apply (rule SReal_not_Infinitesimal, auto) |
|
747 |
done |
|
748 |
||
749 |
lemma SReal_Int_Infinitesimal_zero: "Reals Int Infinitesimal = {0}" |
|
750 |
apply auto |
|
751 |
apply (cut_tac x = x and y = 0 in linorder_less_linear) |
|
752 |
apply (blast dest: SReal_not_Infinitesimal SReal_minus_not_Infinitesimal) |
|
753 |
done |
|
754 |
||
755 |
lemma SReal_Infinitesimal_zero: "[| x \<in> Reals; x \<in> Infinitesimal|] ==> x = 0" |
|
756 |
by (cut_tac SReal_Int_Infinitesimal_zero, blast) |
|
757 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
758 |
lemma SReal_HFinite_diff_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
759 |
"[| x \<in> Reals; x \<noteq> 0 |] ==> x \<in> HFinite - Infinitesimal" |
14370 | 760 |
by (auto dest: SReal_Infinitesimal_zero SReal_subset_HFinite [THEN subsetD]) |
761 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
762 |
lemma hypreal_of_real_HFinite_diff_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
763 |
"hypreal_of_real x \<noteq> 0 ==> hypreal_of_real x \<in> HFinite - Infinitesimal" |
14370 | 764 |
by (rule SReal_HFinite_diff_Infinitesimal, auto) |
765 |
||
15229 | 766 |
lemma hypreal_of_real_Infinitesimal_iff_0 [iff]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
767 |
"(hypreal_of_real x \<in> Infinitesimal) = (x=0)" |
14370 | 768 |
apply auto |
769 |
apply (rule ccontr) |
|
770 |
apply (rule hypreal_of_real_HFinite_diff_Infinitesimal [THEN DiffD2], auto) |
|
771 |
done |
|
772 |
||
15229 | 773 |
lemma number_of_not_Infinitesimal [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
774 |
"number_of w \<noteq> (0::hypreal) ==> number_of w \<notin> Infinitesimal" |
14370 | 775 |
by (fast dest: SReal_number_of [THEN SReal_Infinitesimal_zero]) |
776 |
||
777 |
(*again: 1 is a special case, but not 0 this time*) |
|
15229 | 778 |
lemma one_not_Infinitesimal [simp]: "1 \<notin> Infinitesimal" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
779 |
apply (subst numeral_1_eq_1 [symmetric]) |
14370 | 780 |
apply (rule number_of_not_Infinitesimal) |
781 |
apply (simp (no_asm)) |
|
782 |
done |
|
783 |
||
784 |
lemma approx_SReal_not_zero: "[| y \<in> Reals; x @= y; y\<noteq> 0 |] ==> x \<noteq> 0" |
|
785 |
apply (cut_tac x = 0 and y = y in linorder_less_linear, simp) |
|
786 |
apply (blast dest: approx_sym [THEN mem_infmal_iff [THEN iffD2]] SReal_not_Infinitesimal SReal_minus_not_Infinitesimal) |
|
787 |
done |
|
788 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
789 |
lemma HFinite_diff_Infinitesimal_approx: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
790 |
"[| x @= y; y \<in> HFinite - Infinitesimal |] |
14370 | 791 |
==> x \<in> HFinite - Infinitesimal" |
792 |
apply (auto intro: approx_sym [THEN [2] approx_HFinite] |
|
793 |
simp add: mem_infmal_iff) |
|
794 |
apply (drule approx_trans3, assumption) |
|
795 |
apply (blast dest: approx_sym) |
|
796 |
done |
|
797 |
||
798 |
(*The premise y\<noteq>0 is essential; otherwise x/y =0 and we lose the |
|
799 |
HFinite premise.*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
800 |
lemma Infinitesimal_ratio: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
801 |
"[| y \<noteq> 0; y \<in> Infinitesimal; x/y \<in> HFinite |] ==> x \<in> Infinitesimal" |
14370 | 802 |
apply (drule Infinitesimal_HFinite_mult2, assumption) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
803 |
apply (simp add: divide_inverse mult_assoc) |
14370 | 804 |
done |
805 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
806 |
lemma Infinitesimal_SReal_divide: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
807 |
"[| x \<in> Infinitesimal; y \<in> Reals |] ==> x/y \<in> Infinitesimal" |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14420
diff
changeset
|
808 |
apply (simp add: divide_inverse) |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
809 |
apply (auto intro!: Infinitesimal_HFinite_mult |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
810 |
dest!: SReal_inverse [THEN SReal_subset_HFinite [THEN subsetD]]) |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
811 |
done |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
812 |
|
14370 | 813 |
(*------------------------------------------------------------------ |
814 |
Standard Part Theorem: Every finite x: R* is infinitely |
|
815 |
close to a unique real number (i.e a member of Reals) |
|
816 |
------------------------------------------------------------------*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
817 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
818 |
subsection{* Uniqueness: Two Infinitely Close Reals are Equal*} |
14370 | 819 |
|
820 |
lemma SReal_approx_iff: "[|x \<in> Reals; y \<in> Reals|] ==> (x @= y) = (x = y)" |
|
821 |
apply auto |
|
822 |
apply (simp add: approx_def) |
|
823 |
apply (drule_tac x = y in SReal_minus) |
|
824 |
apply (drule SReal_add, assumption) |
|
825 |
apply (drule SReal_Infinitesimal_zero, assumption) |
|
826 |
apply (drule sym) |
|
827 |
apply (simp add: hypreal_eq_minus_iff [symmetric]) |
|
828 |
done |
|
829 |
||
15229 | 830 |
lemma number_of_approx_iff [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
831 |
"(number_of v @= number_of w) = (number_of v = (number_of w :: hypreal))" |
14370 | 832 |
by (auto simp add: SReal_approx_iff) |
833 |
||
834 |
(*And also for 0 @= #nn and 1 @= #nn, #nn @= 0 and #nn @= 1.*) |
|
835 |
lemma [simp]: "(0 @= number_of w) = ((number_of w :: hypreal) = 0)" |
|
836 |
"(number_of w @= 0) = ((number_of w :: hypreal) = 0)" |
|
837 |
"(1 @= number_of w) = ((number_of w :: hypreal) = 1)" |
|
838 |
"(number_of w @= 1) = ((number_of w :: hypreal) = 1)" |
|
839 |
"~ (0 @= 1)" "~ (1 @= 0)" |
|
840 |
by (auto simp only: SReal_number_of SReal_approx_iff Reals_0 Reals_1) |
|
841 |
||
15229 | 842 |
lemma hypreal_of_real_approx_iff [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
843 |
"(hypreal_of_real k @= hypreal_of_real m) = (k = m)" |
14370 | 844 |
apply auto |
845 |
apply (rule inj_hypreal_of_real [THEN injD]) |
|
846 |
apply (rule SReal_approx_iff [THEN iffD1], auto) |
|
847 |
done |
|
848 |
||
15229 | 849 |
lemma hypreal_of_real_approx_number_of_iff [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
850 |
"(hypreal_of_real k @= number_of w) = (k = number_of w)" |
14370 | 851 |
by (subst hypreal_of_real_approx_iff [symmetric], auto) |
852 |
||
853 |
(*And also for 0 and 1.*) |
|
854 |
(*And also for 0 @= #nn and 1 @= #nn, #nn @= 0 and #nn @= 1.*) |
|
855 |
lemma [simp]: "(hypreal_of_real k @= 0) = (k = 0)" |
|
856 |
"(hypreal_of_real k @= 1) = (k = 1)" |
|
857 |
by (simp_all add: hypreal_of_real_approx_iff [symmetric]) |
|
858 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
859 |
lemma approx_unique_real: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
860 |
"[| r \<in> Reals; s \<in> Reals; r @= x; s @= x|] ==> r = s" |
14370 | 861 |
by (blast intro: SReal_approx_iff [THEN iffD1] approx_trans2) |
862 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
863 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
864 |
subsection{* Existence of Unique Real Infinitely Close*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
865 |
|
14370 | 866 |
(* lemma about lubs *) |
867 |
lemma hypreal_isLub_unique: |
|
868 |
"[| isLub R S x; isLub R S y |] ==> x = (y::hypreal)" |
|
869 |
apply (frule isLub_isUb) |
|
870 |
apply (frule_tac x = y in isLub_isUb) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
871 |
apply (blast intro!: order_antisym dest!: isLub_le_isUb) |
14370 | 872 |
done |
873 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
874 |
lemma lemma_st_part_ub: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
875 |
"x \<in> HFinite ==> \<exists>u. isUb Reals {s. s \<in> Reals & s < x} u" |
14370 | 876 |
apply (drule HFiniteD, safe) |
877 |
apply (rule exI, rule isUbI) |
|
878 |
apply (auto intro: setleI isUbI simp add: abs_less_iff) |
|
879 |
done |
|
880 |
||
881 |
lemma lemma_st_part_nonempty: "x \<in> HFinite ==> \<exists>y. y \<in> {s. s \<in> Reals & s < x}" |
|
882 |
apply (drule HFiniteD, safe) |
|
883 |
apply (drule SReal_minus) |
|
884 |
apply (rule_tac x = "-t" in exI) |
|
885 |
apply (auto simp add: abs_less_iff) |
|
886 |
done |
|
887 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
888 |
lemma lemma_st_part_subset: "{s. s \<in> Reals & s < x} \<subseteq> Reals" |
14370 | 889 |
by auto |
890 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
891 |
lemma lemma_st_part_lub: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
892 |
"x \<in> HFinite ==> \<exists>t. isLub Reals {s. s \<in> Reals & s < x} t" |
14370 | 893 |
by (blast intro!: SReal_complete lemma_st_part_ub lemma_st_part_nonempty lemma_st_part_subset) |
894 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
895 |
lemma lemma_hypreal_le_left_cancel: "((t::hypreal) + r \<le> t) = (r \<le> 0)" |
14370 | 896 |
apply safe |
897 |
apply (drule_tac c = "-t" in add_left_mono) |
|
898 |
apply (drule_tac [2] c = t in add_left_mono) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
899 |
apply (auto simp add: add_assoc [symmetric]) |
14370 | 900 |
done |
901 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
902 |
lemma lemma_st_part_le1: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
903 |
"[| x \<in> HFinite; isLub Reals {s. s \<in> Reals & s < x} t; |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
904 |
r \<in> Reals; 0 < r |] ==> x \<le> t + r" |
14370 | 905 |
apply (frule isLubD1a) |
906 |
apply (rule ccontr, drule linorder_not_le [THEN iffD2]) |
|
907 |
apply (drule_tac x = t in SReal_add, assumption) |
|
908 |
apply (drule_tac y = "t + r" in isLubD1 [THEN setleD], auto) |
|
909 |
done |
|
910 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
911 |
lemma hypreal_setle_less_trans: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
912 |
"!!x::hypreal. [| S *<= x; x < y |] ==> S *<= y" |
14370 | 913 |
apply (simp add: setle_def) |
914 |
apply (auto dest!: bspec order_le_less_trans intro: order_less_imp_le) |
|
915 |
done |
|
916 |
||
917 |
lemma hypreal_gt_isUb: |
|
918 |
"!!x::hypreal. [| isUb R S x; x < y; y \<in> R |] ==> isUb R S y" |
|
919 |
apply (simp add: isUb_def) |
|
920 |
apply (blast intro: hypreal_setle_less_trans) |
|
921 |
done |
|
922 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
923 |
lemma lemma_st_part_gt_ub: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
924 |
"[| x \<in> HFinite; x < y; y \<in> Reals |] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
925 |
==> isUb Reals {s. s \<in> Reals & s < x} y" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
926 |
by (auto dest: order_less_trans intro: order_less_imp_le intro!: isUbI setleI) |
14370 | 927 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
928 |
lemma lemma_minus_le_zero: "t \<le> t + -r ==> r \<le> (0::hypreal)" |
14370 | 929 |
apply (drule_tac c = "-t" in add_left_mono) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
930 |
apply (auto simp add: add_assoc [symmetric]) |
14370 | 931 |
done |
932 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
933 |
lemma lemma_st_part_le2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
934 |
"[| x \<in> HFinite; |
14370 | 935 |
isLub Reals {s. s \<in> Reals & s < x} t; |
936 |
r \<in> Reals; 0 < r |] |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
937 |
==> t + -r \<le> x" |
14370 | 938 |
apply (frule isLubD1a) |
939 |
apply (rule ccontr, drule linorder_not_le [THEN iffD1]) |
|
940 |
apply (drule SReal_minus, drule_tac x = t in SReal_add, assumption) |
|
941 |
apply (drule lemma_st_part_gt_ub, assumption+) |
|
942 |
apply (drule isLub_le_isUb, assumption) |
|
943 |
apply (drule lemma_minus_le_zero) |
|
944 |
apply (auto dest: order_less_le_trans) |
|
945 |
done |
|
946 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
947 |
lemma lemma_st_part1a: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
948 |
"[| x \<in> HFinite; |
14370 | 949 |
isLub Reals {s. s \<in> Reals & s < x} t; |
950 |
r \<in> Reals; 0 < r |] |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
951 |
==> x + -t \<le> r" |
15229 | 952 |
apply (subgoal_tac "x \<le> t+r") |
953 |
apply (auto intro: lemma_st_part_le1) |
|
954 |
done |
|
14370 | 955 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
956 |
lemma lemma_st_part2a: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
957 |
"[| x \<in> HFinite; |
14370 | 958 |
isLub Reals {s. s \<in> Reals & s < x} t; |
959 |
r \<in> Reals; 0 < r |] |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
960 |
==> -(x + -t) \<le> r" |
15229 | 961 |
apply (subgoal_tac "(t + -r \<le> x)") |
962 |
apply (auto intro: lemma_st_part_le2) |
|
14370 | 963 |
done |
964 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
965 |
lemma lemma_SReal_ub: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
966 |
"(x::hypreal) \<in> Reals ==> isUb Reals {s. s \<in> Reals & s < x} x" |
14370 | 967 |
by (auto intro: isUbI setleI order_less_imp_le) |
968 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
969 |
lemma lemma_SReal_lub: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
970 |
"(x::hypreal) \<in> Reals ==> isLub Reals {s. s \<in> Reals & s < x} x" |
14370 | 971 |
apply (auto intro!: isLubI2 lemma_SReal_ub setgeI) |
972 |
apply (frule isUbD2a) |
|
973 |
apply (rule_tac x = x and y = y in linorder_cases) |
|
974 |
apply (auto intro!: order_less_imp_le) |
|
975 |
apply (drule SReal_dense, assumption, assumption, safe) |
|
976 |
apply (drule_tac y = r in isUbD) |
|
977 |
apply (auto dest: order_less_le_trans) |
|
978 |
done |
|
979 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
980 |
lemma lemma_st_part_not_eq1: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
981 |
"[| x \<in> HFinite; |
14370 | 982 |
isLub Reals {s. s \<in> Reals & s < x} t; |
983 |
r \<in> Reals; 0 < r |] |
|
984 |
==> x + -t \<noteq> r" |
|
985 |
apply auto |
|
986 |
apply (frule isLubD1a [THEN SReal_minus]) |
|
987 |
apply (drule SReal_add_cancel, assumption) |
|
988 |
apply (drule_tac x = x in lemma_SReal_lub) |
|
989 |
apply (drule hypreal_isLub_unique, assumption, auto) |
|
990 |
done |
|
991 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
992 |
lemma lemma_st_part_not_eq2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
993 |
"[| x \<in> HFinite; |
14370 | 994 |
isLub Reals {s. s \<in> Reals & s < x} t; |
995 |
r \<in> Reals; 0 < r |] |
|
996 |
==> -(x + -t) \<noteq> r" |
|
15539 | 997 |
apply (auto) |
14370 | 998 |
apply (frule isLubD1a) |
999 |
apply (drule SReal_add_cancel, assumption) |
|
1000 |
apply (drule_tac x = "-x" in SReal_minus, simp) |
|
1001 |
apply (drule_tac x = x in lemma_SReal_lub) |
|
1002 |
apply (drule hypreal_isLub_unique, assumption, auto) |
|
1003 |
done |
|
1004 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1005 |
lemma lemma_st_part_major: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1006 |
"[| x \<in> HFinite; |
14370 | 1007 |
isLub Reals {s. s \<in> Reals & s < x} t; |
1008 |
r \<in> Reals; 0 < r |] |
|
1009 |
==> abs (x + -t) < r" |
|
1010 |
apply (frule lemma_st_part1a) |
|
1011 |
apply (frule_tac [4] lemma_st_part2a, auto) |
|
1012 |
apply (drule order_le_imp_less_or_eq)+ |
|
1013 |
apply (auto dest: lemma_st_part_not_eq1 lemma_st_part_not_eq2 simp add: abs_less_iff) |
|
1014 |
done |
|
1015 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1016 |
lemma lemma_st_part_major2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1017 |
"[| x \<in> HFinite; isLub Reals {s. s \<in> Reals & s < x} t |] |
14370 | 1018 |
==> \<forall>r \<in> Reals. 0 < r --> abs (x + -t) < r" |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1019 |
by (blast dest!: lemma_st_part_major) |
14370 | 1020 |
|
15229 | 1021 |
|
1022 |
text{*Existence of real and Standard Part Theorem*} |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1023 |
lemma lemma_st_part_Ex: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1024 |
"x \<in> HFinite ==> \<exists>t \<in> Reals. \<forall>r \<in> Reals. 0 < r --> abs (x + -t) < r" |
14370 | 1025 |
apply (frule lemma_st_part_lub, safe) |
1026 |
apply (frule isLubD1a) |
|
1027 |
apply (blast dest: lemma_st_part_major2) |
|
1028 |
done |
|
1029 |
||
1030 |
lemma st_part_Ex: |
|
1031 |
"x \<in> HFinite ==> \<exists>t \<in> Reals. x @= t" |
|
1032 |
apply (simp add: approx_def Infinitesimal_def) |
|
1033 |
apply (drule lemma_st_part_Ex, auto) |
|
1034 |
done |
|
1035 |
||
15229 | 1036 |
text{*There is a unique real infinitely close*} |
14370 | 1037 |
lemma st_part_Ex1: "x \<in> HFinite ==> EX! t. t \<in> Reals & x @= t" |
1038 |
apply (drule st_part_Ex, safe) |
|
1039 |
apply (drule_tac [2] approx_sym, drule_tac [2] approx_sym, drule_tac [2] approx_sym) |
|
1040 |
apply (auto intro!: approx_unique_real) |
|
1041 |
done |
|
1042 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1043 |
subsection{* Finite, Infinite and Infinitesimal*} |
14370 | 1044 |
|
15229 | 1045 |
lemma HFinite_Int_HInfinite_empty [simp]: "HFinite Int HInfinite = {}" |
14370 | 1046 |
apply (simp add: HFinite_def HInfinite_def) |
1047 |
apply (auto dest: order_less_trans) |
|
1048 |
done |
|
1049 |
||
1050 |
lemma HFinite_not_HInfinite: |
|
1051 |
assumes x: "x \<in> HFinite" shows "x \<notin> HInfinite" |
|
1052 |
proof |
|
1053 |
assume x': "x \<in> HInfinite" |
|
1054 |
with x have "x \<in> HFinite \<inter> HInfinite" by blast |
|
1055 |
thus False by auto |
|
1056 |
qed |
|
1057 |
||
1058 |
lemma not_HFinite_HInfinite: "x\<notin> HFinite ==> x \<in> HInfinite" |
|
1059 |
apply (simp add: HInfinite_def HFinite_def, auto) |
|
1060 |
apply (drule_tac x = "r + 1" in bspec) |
|
15539 | 1061 |
apply (auto) |
14370 | 1062 |
done |
1063 |
||
1064 |
lemma HInfinite_HFinite_disj: "x \<in> HInfinite | x \<in> HFinite" |
|
1065 |
by (blast intro: not_HFinite_HInfinite) |
|
1066 |
||
1067 |
lemma HInfinite_HFinite_iff: "(x \<in> HInfinite) = (x \<notin> HFinite)" |
|
1068 |
by (blast dest: HFinite_not_HInfinite not_HFinite_HInfinite) |
|
1069 |
||
1070 |
lemma HFinite_HInfinite_iff: "(x \<in> HFinite) = (x \<notin> HInfinite)" |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1071 |
by (simp add: HInfinite_HFinite_iff) |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1072 |
|
14370 | 1073 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1074 |
lemma HInfinite_diff_HFinite_Infinitesimal_disj: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1075 |
"x \<notin> Infinitesimal ==> x \<in> HInfinite | x \<in> HFinite - Infinitesimal" |
14370 | 1076 |
by (fast intro: not_HFinite_HInfinite) |
1077 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1078 |
lemma HFinite_inverse: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1079 |
"[| x \<in> HFinite; x \<notin> Infinitesimal |] ==> inverse x \<in> HFinite" |
14370 | 1080 |
apply (cut_tac x = "inverse x" in HInfinite_HFinite_disj) |
1081 |
apply (auto dest!: HInfinite_inverse_Infinitesimal) |
|
1082 |
done |
|
1083 |
||
1084 |
lemma HFinite_inverse2: "x \<in> HFinite - Infinitesimal ==> inverse x \<in> HFinite" |
|
1085 |
by (blast intro: HFinite_inverse) |
|
1086 |
||
1087 |
(* stronger statement possible in fact *) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1088 |
lemma Infinitesimal_inverse_HFinite: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1089 |
"x \<notin> Infinitesimal ==> inverse(x) \<in> HFinite" |
14370 | 1090 |
apply (drule HInfinite_diff_HFinite_Infinitesimal_disj) |
1091 |
apply (blast intro: HFinite_inverse HInfinite_inverse_Infinitesimal Infinitesimal_subset_HFinite [THEN subsetD]) |
|
1092 |
done |
|
1093 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1094 |
lemma HFinite_not_Infinitesimal_inverse: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1095 |
"x \<in> HFinite - Infinitesimal ==> inverse x \<in> HFinite - Infinitesimal" |
14370 | 1096 |
apply (auto intro: Infinitesimal_inverse_HFinite) |
1097 |
apply (drule Infinitesimal_HFinite_mult2, assumption) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1098 |
apply (simp add: not_Infinitesimal_not_zero right_inverse) |
14370 | 1099 |
done |
1100 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1101 |
lemma approx_inverse: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1102 |
"[| x @= y; y \<in> HFinite - Infinitesimal |] |
14370 | 1103 |
==> inverse x @= inverse y" |
1104 |
apply (frule HFinite_diff_Infinitesimal_approx, assumption) |
|
1105 |
apply (frule not_Infinitesimal_not_zero2) |
|
1106 |
apply (frule_tac x = x in not_Infinitesimal_not_zero2) |
|
1107 |
apply (drule HFinite_inverse2)+ |
|
1108 |
apply (drule approx_mult2, assumption, auto) |
|
1109 |
apply (drule_tac c = "inverse x" in approx_mult1, assumption) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1110 |
apply (auto intro: approx_sym simp add: mult_assoc) |
14370 | 1111 |
done |
1112 |
||
1113 |
(*Used for NSLIM_inverse, NSLIMSEQ_inverse*) |
|
1114 |
lemmas hypreal_of_real_approx_inverse = hypreal_of_real_HFinite_diff_Infinitesimal [THEN [2] approx_inverse] |
|
1115 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1116 |
lemma inverse_add_Infinitesimal_approx: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1117 |
"[| x \<in> HFinite - Infinitesimal; |
14370 | 1118 |
h \<in> Infinitesimal |] ==> inverse(x + h) @= inverse x" |
1119 |
apply (auto intro: approx_inverse approx_sym Infinitesimal_add_approx_self) |
|
1120 |
done |
|
1121 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1122 |
lemma inverse_add_Infinitesimal_approx2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1123 |
"[| x \<in> HFinite - Infinitesimal; |
14370 | 1124 |
h \<in> Infinitesimal |] ==> inverse(h + x) @= inverse x" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1125 |
apply (rule add_commute [THEN subst]) |
14370 | 1126 |
apply (blast intro: inverse_add_Infinitesimal_approx) |
1127 |
done |
|
1128 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1129 |
lemma inverse_add_Infinitesimal_approx_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1130 |
"[| x \<in> HFinite - Infinitesimal; |
14370 | 1131 |
h \<in> Infinitesimal |] ==> inverse(x + h) + -inverse x @= h" |
1132 |
apply (rule approx_trans2) |
|
15229 | 1133 |
apply (auto intro: inverse_add_Infinitesimal_approx |
1134 |
simp add: mem_infmal_iff approx_minus_iff [symmetric]) |
|
14370 | 1135 |
done |
1136 |
||
1137 |
lemma Infinitesimal_square_iff: "(x \<in> Infinitesimal) = (x*x \<in> Infinitesimal)" |
|
1138 |
apply (auto intro: Infinitesimal_mult) |
|
1139 |
apply (rule ccontr, frule Infinitesimal_inverse_HFinite) |
|
1140 |
apply (frule not_Infinitesimal_not_zero) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1141 |
apply (auto dest: Infinitesimal_HFinite_mult simp add: mult_assoc) |
14370 | 1142 |
done |
1143 |
declare Infinitesimal_square_iff [symmetric, simp] |
|
1144 |
||
15229 | 1145 |
lemma HFinite_square_iff [simp]: "(x*x \<in> HFinite) = (x \<in> HFinite)" |
14370 | 1146 |
apply (auto intro: HFinite_mult) |
1147 |
apply (auto dest: HInfinite_mult simp add: HFinite_HInfinite_iff) |
|
1148 |
done |
|
1149 |
||
15229 | 1150 |
lemma HInfinite_square_iff [simp]: "(x*x \<in> HInfinite) = (x \<in> HInfinite)" |
14370 | 1151 |
by (auto simp add: HInfinite_HFinite_iff) |
1152 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1153 |
lemma approx_HFinite_mult_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1154 |
"[| a: HFinite-Infinitesimal; a* w @= a*z |] ==> w @= z" |
14370 | 1155 |
apply safe |
1156 |
apply (frule HFinite_inverse, assumption) |
|
1157 |
apply (drule not_Infinitesimal_not_zero) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1158 |
apply (auto dest: approx_mult2 simp add: mult_assoc [symmetric]) |
14370 | 1159 |
done |
1160 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1161 |
lemma approx_HFinite_mult_cancel_iff1: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1162 |
"a: HFinite-Infinitesimal ==> (a * w @= a * z) = (w @= z)" |
14370 | 1163 |
by (auto intro: approx_mult2 approx_HFinite_mult_cancel) |
1164 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1165 |
lemma HInfinite_HFinite_add_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1166 |
"[| x + y \<in> HInfinite; y \<in> HFinite |] ==> x \<in> HInfinite" |
14370 | 1167 |
apply (rule ccontr) |
1168 |
apply (drule HFinite_HInfinite_iff [THEN iffD2]) |
|
1169 |
apply (auto dest: HFinite_add simp add: HInfinite_HFinite_iff) |
|
1170 |
done |
|
1171 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1172 |
lemma HInfinite_HFinite_add: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1173 |
"[| x \<in> HInfinite; y \<in> HFinite |] ==> x + y \<in> HInfinite" |
14370 | 1174 |
apply (rule_tac y = "-y" in HInfinite_HFinite_add_cancel) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1175 |
apply (auto simp add: add_assoc HFinite_minus_iff) |
14370 | 1176 |
done |
1177 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1178 |
lemma HInfinite_ge_HInfinite: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1179 |
"[| x \<in> HInfinite; x \<le> y; 0 \<le> x |] ==> y \<in> HInfinite" |
14370 | 1180 |
by (auto intro: HFinite_bounded simp add: HInfinite_HFinite_iff) |
1181 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1182 |
lemma Infinitesimal_inverse_HInfinite: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1183 |
"[| x \<in> Infinitesimal; x \<noteq> 0 |] ==> inverse x \<in> HInfinite" |
14370 | 1184 |
apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2]) |
1185 |
apply (auto dest: Infinitesimal_HFinite_mult2) |
|
1186 |
done |
|
1187 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1188 |
lemma HInfinite_HFinite_not_Infinitesimal_mult: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1189 |
"[| x \<in> HInfinite; y \<in> HFinite - Infinitesimal |] |
14370 | 1190 |
==> x * y \<in> HInfinite" |
1191 |
apply (rule ccontr, drule HFinite_HInfinite_iff [THEN iffD2]) |
|
1192 |
apply (frule HFinite_Infinitesimal_not_zero) |
|
1193 |
apply (drule HFinite_not_Infinitesimal_inverse) |
|
1194 |
apply (safe, drule HFinite_mult) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1195 |
apply (auto simp add: mult_assoc HFinite_HInfinite_iff) |
14370 | 1196 |
done |
1197 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1198 |
lemma HInfinite_HFinite_not_Infinitesimal_mult2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1199 |
"[| x \<in> HInfinite; y \<in> HFinite - Infinitesimal |] |
14370 | 1200 |
==> y * x \<in> HInfinite" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1201 |
by (auto simp add: mult_commute HInfinite_HFinite_not_Infinitesimal_mult) |
14370 | 1202 |
|
1203 |
lemma HInfinite_gt_SReal: "[| x \<in> HInfinite; 0 < x; y \<in> Reals |] ==> y < x" |
|
15003 | 1204 |
by (auto dest!: bspec simp add: HInfinite_def abs_if order_less_imp_le) |
14370 | 1205 |
|
1206 |
lemma HInfinite_gt_zero_gt_one: "[| x \<in> HInfinite; 0 < x |] ==> 1 < x" |
|
1207 |
by (auto intro: HInfinite_gt_SReal) |
|
1208 |
||
1209 |
||
15229 | 1210 |
lemma not_HInfinite_one [simp]: "1 \<notin> HInfinite" |
14370 | 1211 |
apply (simp (no_asm) add: HInfinite_HFinite_iff) |
1212 |
done |
|
1213 |
||
1214 |
lemma approx_hrabs_disj: "abs x @= x | abs x @= -x" |
|
1215 |
by (cut_tac x = x in hrabs_disj, auto) |
|
1216 |
||
1217 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1218 |
subsection{*Theorems about Monads*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1219 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1220 |
lemma monad_hrabs_Un_subset: "monad (abs x) \<le> monad(x) Un monad(-x)" |
14370 | 1221 |
by (rule_tac x1 = x in hrabs_disj [THEN disjE], auto) |
1222 |
||
1223 |
lemma Infinitesimal_monad_eq: "e \<in> Infinitesimal ==> monad (x+e) = monad x" |
|
1224 |
by (fast intro!: Infinitesimal_add_approx_self [THEN approx_sym] approx_monad_iff [THEN iffD1]) |
|
1225 |
||
1226 |
lemma mem_monad_iff: "(u \<in> monad x) = (-u \<in> monad (-x))" |
|
1227 |
by (simp add: monad_def) |
|
1228 |
||
1229 |
lemma Infinitesimal_monad_zero_iff: "(x \<in> Infinitesimal) = (x \<in> monad 0)" |
|
1230 |
by (auto intro: approx_sym simp add: monad_def mem_infmal_iff) |
|
1231 |
||
1232 |
lemma monad_zero_minus_iff: "(x \<in> monad 0) = (-x \<in> monad 0)" |
|
1233 |
apply (simp (no_asm) add: Infinitesimal_monad_zero_iff [symmetric]) |
|
1234 |
done |
|
1235 |
||
1236 |
lemma monad_zero_hrabs_iff: "(x \<in> monad 0) = (abs x \<in> monad 0)" |
|
1237 |
apply (rule_tac x1 = x in hrabs_disj [THEN disjE]) |
|
1238 |
apply (auto simp add: monad_zero_minus_iff [symmetric]) |
|
1239 |
done |
|
1240 |
||
15229 | 1241 |
lemma mem_monad_self [simp]: "x \<in> monad x" |
14370 | 1242 |
by (simp add: monad_def) |
15229 | 1243 |
|
14370 | 1244 |
|
15229 | 1245 |
subsection{*Proof that @{term "x @= y"} implies @{term"\<bar>x\<bar> @= \<bar>y\<bar>"}*} |
1246 |
||
1247 |
lemma approx_subset_monad: "x @= y ==> {x,y} \<le> monad x" |
|
14370 | 1248 |
apply (simp (no_asm)) |
1249 |
apply (simp add: approx_monad_iff) |
|
1250 |
done |
|
1251 |
||
15229 | 1252 |
lemma approx_subset_monad2: "x @= y ==> {x,y} \<le> monad y" |
14370 | 1253 |
apply (drule approx_sym) |
1254 |
apply (fast dest: approx_subset_monad) |
|
1255 |
done |
|
1256 |
||
1257 |
lemma mem_monad_approx: "u \<in> monad x ==> x @= u" |
|
1258 |
by (simp add: monad_def) |
|
1259 |
||
1260 |
lemma approx_mem_monad: "x @= u ==> u \<in> monad x" |
|
1261 |
by (simp add: monad_def) |
|
1262 |
||
1263 |
lemma approx_mem_monad2: "x @= u ==> x \<in> monad u" |
|
1264 |
apply (simp add: monad_def) |
|
1265 |
apply (blast intro!: approx_sym) |
|
1266 |
done |
|
1267 |
||
1268 |
lemma approx_mem_monad_zero: "[| x @= y;x \<in> monad 0 |] ==> y \<in> monad 0" |
|
1269 |
apply (drule mem_monad_approx) |
|
1270 |
apply (fast intro: approx_mem_monad approx_trans) |
|
1271 |
done |
|
1272 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1273 |
lemma Infinitesimal_approx_hrabs: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1274 |
"[| x @= y; x \<in> Infinitesimal |] ==> abs x @= abs y" |
14370 | 1275 |
apply (drule Infinitesimal_monad_zero_iff [THEN iffD1]) |
1276 |
apply (blast intro: approx_mem_monad_zero monad_zero_hrabs_iff [THEN iffD1] mem_monad_approx approx_trans3) |
|
1277 |
done |
|
1278 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1279 |
lemma less_Infinitesimal_less: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1280 |
"[| 0 < x; x \<notin>Infinitesimal; e :Infinitesimal |] ==> e < x" |
14370 | 1281 |
apply (rule ccontr) |
1282 |
apply (auto intro: Infinitesimal_zero [THEN [2] Infinitesimal_interval] |
|
1283 |
dest!: order_le_imp_less_or_eq simp add: linorder_not_less) |
|
1284 |
done |
|
1285 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1286 |
lemma Ball_mem_monad_gt_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1287 |
"[| 0 < x; x \<notin> Infinitesimal; u \<in> monad x |] ==> 0 < u" |
14370 | 1288 |
apply (drule mem_monad_approx [THEN approx_sym]) |
1289 |
apply (erule bex_Infinitesimal_iff2 [THEN iffD2, THEN bexE]) |
|
1290 |
apply (drule_tac e = "-xa" in less_Infinitesimal_less, auto) |
|
1291 |
done |
|
1292 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1293 |
lemma Ball_mem_monad_less_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1294 |
"[| x < 0; x \<notin> Infinitesimal; u \<in> monad x |] ==> u < 0" |
14370 | 1295 |
apply (drule mem_monad_approx [THEN approx_sym]) |
1296 |
apply (erule bex_Infinitesimal_iff [THEN iffD2, THEN bexE]) |
|
1297 |
apply (cut_tac x = "-x" and e = xa in less_Infinitesimal_less, auto) |
|
1298 |
done |
|
1299 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1300 |
lemma lemma_approx_gt_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1301 |
"[|0 < x; x \<notin> Infinitesimal; x @= y|] ==> 0 < y" |
14370 | 1302 |
by (blast dest: Ball_mem_monad_gt_zero approx_subset_monad) |
1303 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1304 |
lemma lemma_approx_less_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1305 |
"[|x < 0; x \<notin> Infinitesimal; x @= y|] ==> y < 0" |
14370 | 1306 |
by (blast dest: Ball_mem_monad_less_zero approx_subset_monad) |
1307 |
||
15229 | 1308 |
theorem approx_hrabs: "x @= y ==> abs x @= abs y" |
1309 |
apply (case_tac "x \<in> Infinitesimal") |
|
1310 |
apply (simp add: Infinitesimal_approx_hrabs) |
|
1311 |
apply (rule linorder_cases [of 0 x]) |
|
1312 |
apply (frule lemma_approx_gt_zero [of x y]) |
|
16775
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
avigad
parents:
15539
diff
changeset
|
1313 |
apply (auto simp add: lemma_approx_less_zero [of x y] abs_of_neg) |
14370 | 1314 |
done |
1315 |
||
1316 |
lemma approx_hrabs_zero_cancel: "abs(x) @= 0 ==> x @= 0" |
|
1317 |
apply (cut_tac x = x in hrabs_disj) |
|
1318 |
apply (auto dest: approx_minus) |
|
1319 |
done |
|
1320 |
||
1321 |
lemma approx_hrabs_add_Infinitesimal: "e \<in> Infinitesimal ==> abs x @= abs(x+e)" |
|
1322 |
by (fast intro: approx_hrabs Infinitesimal_add_approx_self) |
|
1323 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1324 |
lemma approx_hrabs_add_minus_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1325 |
"e \<in> Infinitesimal ==> abs x @= abs(x + -e)" |
14370 | 1326 |
by (fast intro: approx_hrabs Infinitesimal_add_minus_approx_self) |
1327 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1328 |
lemma hrabs_add_Infinitesimal_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1329 |
"[| e \<in> Infinitesimal; e' \<in> Infinitesimal; |
14370 | 1330 |
abs(x+e) = abs(y+e')|] ==> abs x @= abs y" |
1331 |
apply (drule_tac x = x in approx_hrabs_add_Infinitesimal) |
|
1332 |
apply (drule_tac x = y in approx_hrabs_add_Infinitesimal) |
|
1333 |
apply (auto intro: approx_trans2) |
|
1334 |
done |
|
1335 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1336 |
lemma hrabs_add_minus_Infinitesimal_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1337 |
"[| e \<in> Infinitesimal; e' \<in> Infinitesimal; |
14370 | 1338 |
abs(x + -e) = abs(y + -e')|] ==> abs x @= abs y" |
1339 |
apply (drule_tac x = x in approx_hrabs_add_minus_Infinitesimal) |
|
1340 |
apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal) |
|
1341 |
apply (auto intro: approx_trans2) |
|
1342 |
done |
|
1343 |
||
1344 |
(* interesting slightly counterintuitive theorem: necessary |
|
1345 |
for proving that an open interval is an NS open set |
|
1346 |
*) |
|
1347 |
lemma Infinitesimal_add_hypreal_of_real_less: |
|
1348 |
"[| x < y; u \<in> Infinitesimal |] |
|
1349 |
==> hypreal_of_real x + u < hypreal_of_real y" |
|
1350 |
apply (simp add: Infinitesimal_def) |
|
17431 | 1351 |
apply (drule_tac x = "hypreal_of_real y + -hypreal_of_real x" in bspec, simp) |
1352 |
apply (simp add: abs_less_iff) |
|
14370 | 1353 |
done |
1354 |
||
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
1355 |
lemma Infinitesimal_add_hrabs_hypreal_of_real_less: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
1356 |
"[| x \<in> Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] |
14370 | 1357 |
==> abs (hypreal_of_real r + x) < hypreal_of_real y" |
1358 |
apply (drule_tac x = "hypreal_of_real r" in approx_hrabs_add_Infinitesimal) |
|
1359 |
apply (drule approx_sym [THEN bex_Infinitesimal_iff2 [THEN iffD2]]) |
|
15229 | 1360 |
apply (auto intro!: Infinitesimal_add_hypreal_of_real_less |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1361 |
simp del: star_of_abs |
15229 | 1362 |
simp add: hypreal_of_real_hrabs) |
14370 | 1363 |
done |
1364 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1365 |
lemma Infinitesimal_add_hrabs_hypreal_of_real_less2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1366 |
"[| x \<in> Infinitesimal; abs(hypreal_of_real r) < hypreal_of_real y |] |
14370 | 1367 |
==> abs (x + hypreal_of_real r) < hypreal_of_real y" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1368 |
apply (rule add_commute [THEN subst]) |
14370 | 1369 |
apply (erule Infinitesimal_add_hrabs_hypreal_of_real_less, assumption) |
1370 |
done |
|
1371 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1372 |
lemma hypreal_of_real_le_add_Infininitesimal_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1373 |
"[| u \<in> Infinitesimal; v \<in> Infinitesimal; |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1374 |
hypreal_of_real x + u \<le> hypreal_of_real y + v |] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1375 |
==> hypreal_of_real x \<le> hypreal_of_real y" |
14370 | 1376 |
apply (simp add: linorder_not_less [symmetric], auto) |
1377 |
apply (drule_tac u = "v-u" in Infinitesimal_add_hypreal_of_real_less) |
|
1378 |
apply (auto simp add: Infinitesimal_diff) |
|
1379 |
done |
|
1380 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1381 |
lemma hypreal_of_real_le_add_Infininitesimal_cancel2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1382 |
"[| u \<in> Infinitesimal; v \<in> Infinitesimal; |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1383 |
hypreal_of_real x + u \<le> hypreal_of_real y + v |] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1384 |
==> x \<le> y" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1385 |
by (blast intro: star_of_le [THEN iffD1] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1386 |
intro!: hypreal_of_real_le_add_Infininitesimal_cancel) |
14370 | 1387 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1388 |
lemma hypreal_of_real_less_Infinitesimal_le_zero: |
15229 | 1389 |
"[| hypreal_of_real x < e; e \<in> Infinitesimal |] ==> hypreal_of_real x \<le> 0" |
14370 | 1390 |
apply (rule linorder_not_less [THEN iffD1], safe) |
1391 |
apply (drule Infinitesimal_interval) |
|
1392 |
apply (drule_tac [4] SReal_hypreal_of_real [THEN SReal_Infinitesimal_zero], auto) |
|
1393 |
done |
|
1394 |
||
1395 |
(*used once, in Lim/NSDERIV_inverse*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1396 |
lemma Infinitesimal_add_not_zero: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1397 |
"[| h \<in> Infinitesimal; x \<noteq> 0 |] ==> hypreal_of_real x + h \<noteq> 0" |
14370 | 1398 |
apply auto |
1399 |
apply (subgoal_tac "h = - hypreal_of_real x", auto) |
|
1400 |
done |
|
1401 |
||
15229 | 1402 |
lemma Infinitesimal_square_cancel [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1403 |
"x*x + y*y \<in> Infinitesimal ==> x*x \<in> Infinitesimal" |
14370 | 1404 |
apply (rule Infinitesimal_interval2) |
1405 |
apply (rule_tac [3] zero_le_square, assumption) |
|
1406 |
apply (auto simp add: zero_le_square) |
|
1407 |
done |
|
1408 |
||
15229 | 1409 |
lemma HFinite_square_cancel [simp]: "x*x + y*y \<in> HFinite ==> x*x \<in> HFinite" |
14370 | 1410 |
apply (rule HFinite_bounded, assumption) |
1411 |
apply (auto simp add: zero_le_square) |
|
1412 |
done |
|
1413 |
||
15229 | 1414 |
lemma Infinitesimal_square_cancel2 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1415 |
"x*x + y*y \<in> Infinitesimal ==> y*y \<in> Infinitesimal" |
14370 | 1416 |
apply (rule Infinitesimal_square_cancel) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1417 |
apply (rule add_commute [THEN subst]) |
14370 | 1418 |
apply (simp (no_asm)) |
1419 |
done |
|
1420 |
||
15229 | 1421 |
lemma HFinite_square_cancel2 [simp]: "x*x + y*y \<in> HFinite ==> y*y \<in> HFinite" |
14370 | 1422 |
apply (rule HFinite_square_cancel) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1423 |
apply (rule add_commute [THEN subst]) |
14370 | 1424 |
apply (simp (no_asm)) |
1425 |
done |
|
1426 |
||
15229 | 1427 |
lemma Infinitesimal_sum_square_cancel [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1428 |
"x*x + y*y + z*z \<in> Infinitesimal ==> x*x \<in> Infinitesimal" |
14370 | 1429 |
apply (rule Infinitesimal_interval2, assumption) |
1430 |
apply (rule_tac [2] zero_le_square, simp) |
|
1431 |
apply (insert zero_le_square [of y]) |
|
1432 |
apply (insert zero_le_square [of z], simp) |
|
1433 |
done |
|
1434 |
||
15229 | 1435 |
lemma HFinite_sum_square_cancel [simp]: |
1436 |
"x*x + y*y + z*z \<in> HFinite ==> x*x \<in> HFinite" |
|
14370 | 1437 |
apply (rule HFinite_bounded, assumption) |
1438 |
apply (rule_tac [2] zero_le_square) |
|
1439 |
apply (insert zero_le_square [of y]) |
|
1440 |
apply (insert zero_le_square [of z], simp) |
|
1441 |
done |
|
1442 |
||
15229 | 1443 |
lemma Infinitesimal_sum_square_cancel2 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1444 |
"y*y + x*x + z*z \<in> Infinitesimal ==> x*x \<in> Infinitesimal" |
14370 | 1445 |
apply (rule Infinitesimal_sum_square_cancel) |
1446 |
apply (simp add: add_ac) |
|
1447 |
done |
|
1448 |
||
15229 | 1449 |
lemma HFinite_sum_square_cancel2 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1450 |
"y*y + x*x + z*z \<in> HFinite ==> x*x \<in> HFinite" |
14370 | 1451 |
apply (rule HFinite_sum_square_cancel) |
1452 |
apply (simp add: add_ac) |
|
1453 |
done |
|
1454 |
||
15229 | 1455 |
lemma Infinitesimal_sum_square_cancel3 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1456 |
"z*z + y*y + x*x \<in> Infinitesimal ==> x*x \<in> Infinitesimal" |
14370 | 1457 |
apply (rule Infinitesimal_sum_square_cancel) |
1458 |
apply (simp add: add_ac) |
|
1459 |
done |
|
1460 |
||
15229 | 1461 |
lemma HFinite_sum_square_cancel3 [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1462 |
"z*z + y*y + x*x \<in> HFinite ==> x*x \<in> HFinite" |
14370 | 1463 |
apply (rule HFinite_sum_square_cancel) |
1464 |
apply (simp add: add_ac) |
|
1465 |
done |
|
1466 |
||
15229 | 1467 |
lemma monad_hrabs_less: |
1468 |
"[| y \<in> monad x; 0 < hypreal_of_real e |] |
|
14370 | 1469 |
==> abs (y + -x) < hypreal_of_real e" |
1470 |
apply (drule mem_monad_approx [THEN approx_sym]) |
|
1471 |
apply (drule bex_Infinitesimal_iff [THEN iffD2]) |
|
1472 |
apply (auto dest!: InfinitesimalD) |
|
1473 |
done |
|
1474 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1475 |
lemma mem_monad_SReal_HFinite: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1476 |
"x \<in> monad (hypreal_of_real a) ==> x \<in> HFinite" |
14370 | 1477 |
apply (drule mem_monad_approx [THEN approx_sym]) |
1478 |
apply (drule bex_Infinitesimal_iff2 [THEN iffD2]) |
|
1479 |
apply (safe dest!: Infinitesimal_subset_HFinite [THEN subsetD]) |
|
1480 |
apply (erule SReal_hypreal_of_real [THEN SReal_subset_HFinite [THEN subsetD], THEN HFinite_add]) |
|
1481 |
done |
|
1482 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1483 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1484 |
subsection{* Theorems about Standard Part*} |
14370 | 1485 |
|
1486 |
lemma st_approx_self: "x \<in> HFinite ==> st x @= x" |
|
1487 |
apply (simp add: st_def) |
|
1488 |
apply (frule st_part_Ex, safe) |
|
1489 |
apply (rule someI2) |
|
1490 |
apply (auto intro: approx_sym) |
|
1491 |
done |
|
1492 |
||
1493 |
lemma st_SReal: "x \<in> HFinite ==> st x \<in> Reals" |
|
1494 |
apply (simp add: st_def) |
|
1495 |
apply (frule st_part_Ex, safe) |
|
1496 |
apply (rule someI2) |
|
1497 |
apply (auto intro: approx_sym) |
|
1498 |
done |
|
1499 |
||
1500 |
lemma st_HFinite: "x \<in> HFinite ==> st x \<in> HFinite" |
|
1501 |
by (erule st_SReal [THEN SReal_subset_HFinite [THEN subsetD]]) |
|
1502 |
||
1503 |
lemma st_SReal_eq: "x \<in> Reals ==> st x = x" |
|
1504 |
apply (simp add: st_def) |
|
1505 |
apply (rule some_equality) |
|
1506 |
apply (fast intro: SReal_subset_HFinite [THEN subsetD]) |
|
1507 |
apply (blast dest: SReal_approx_iff [THEN iffD1]) |
|
1508 |
done |
|
1509 |
||
15229 | 1510 |
lemma st_hypreal_of_real [simp]: "st (hypreal_of_real x) = hypreal_of_real x" |
14370 | 1511 |
by (rule SReal_hypreal_of_real [THEN st_SReal_eq]) |
1512 |
||
1513 |
lemma st_eq_approx: "[| x \<in> HFinite; y \<in> HFinite; st x = st y |] ==> x @= y" |
|
1514 |
by (auto dest!: st_approx_self elim!: approx_trans3) |
|
1515 |
||
1516 |
lemma approx_st_eq: |
|
1517 |
assumes "x \<in> HFinite" and "y \<in> HFinite" and "x @= y" |
|
1518 |
shows "st x = st y" |
|
1519 |
proof - |
|
1520 |
have "st x @= x" "st y @= y" "st x \<in> Reals" "st y \<in> Reals" |
|
1521 |
by (simp_all add: st_approx_self st_SReal prems) |
|
1522 |
with prems show ?thesis |
|
1523 |
by (fast elim: approx_trans approx_trans2 SReal_approx_iff [THEN iffD1]) |
|
1524 |
qed |
|
1525 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1526 |
lemma st_eq_approx_iff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1527 |
"[| x \<in> HFinite; y \<in> HFinite|] |
14370 | 1528 |
==> (x @= y) = (st x = st y)" |
1529 |
by (blast intro: approx_st_eq st_eq_approx) |
|
1530 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1531 |
lemma st_Infinitesimal_add_SReal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1532 |
"[| x \<in> Reals; e \<in> Infinitesimal |] ==> st(x + e) = x" |
14370 | 1533 |
apply (frule st_SReal_eq [THEN subst]) |
1534 |
prefer 2 apply assumption |
|
1535 |
apply (frule SReal_subset_HFinite [THEN subsetD]) |
|
1536 |
apply (frule Infinitesimal_subset_HFinite [THEN subsetD]) |
|
1537 |
apply (drule st_SReal_eq) |
|
1538 |
apply (rule approx_st_eq) |
|
1539 |
apply (auto intro: HFinite_add simp add: Infinitesimal_add_approx_self [THEN approx_sym]) |
|
1540 |
done |
|
1541 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1542 |
lemma st_Infinitesimal_add_SReal2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1543 |
"[| x \<in> Reals; e \<in> Infinitesimal |] ==> st(e + x) = x" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1544 |
apply (rule add_commute [THEN subst]) |
14370 | 1545 |
apply (blast intro!: st_Infinitesimal_add_SReal) |
1546 |
done |
|
1547 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1548 |
lemma HFinite_st_Infinitesimal_add: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1549 |
"x \<in> HFinite ==> \<exists>e \<in> Infinitesimal. x = st(x) + e" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1550 |
by (blast dest!: st_approx_self [THEN approx_sym] bex_Infinitesimal_iff2 [THEN iffD2]) |
14370 | 1551 |
|
1552 |
lemma st_add: |
|
1553 |
assumes x: "x \<in> HFinite" and y: "y \<in> HFinite" |
|
1554 |
shows "st (x + y) = st(x) + st(y)" |
|
1555 |
proof - |
|
1556 |
from HFinite_st_Infinitesimal_add [OF x] |
|
1557 |
obtain ex where ex: "ex \<in> Infinitesimal" "st x + ex = x" |
|
1558 |
by (blast intro: sym) |
|
1559 |
from HFinite_st_Infinitesimal_add [OF y] |
|
1560 |
obtain ey where ey: "ey \<in> Infinitesimal" "st y + ey = y" |
|
1561 |
by (blast intro: sym) |
|
1562 |
have "st (x + y) = st ((st x + ex) + (st y + ey))" |
|
1563 |
by (simp add: ex ey) |
|
1564 |
also have "... = st ((ex + ey) + (st x + st y))" by (simp add: add_ac) |
|
1565 |
also have "... = st x + st y" |
|
15539 | 1566 |
by (simp add: prems st_SReal Infinitesimal_add |
14370 | 1567 |
st_Infinitesimal_add_SReal2) |
1568 |
finally show ?thesis . |
|
1569 |
qed |
|
1570 |
||
15229 | 1571 |
lemma st_number_of [simp]: "st (number_of w) = number_of w" |
14370 | 1572 |
by (rule SReal_number_of [THEN st_SReal_eq]) |
1573 |
||
1574 |
(*the theorem above for the special cases of zero and one*) |
|
1575 |
lemma [simp]: "st 0 = 0" "st 1 = 1" |
|
1576 |
by (simp_all add: st_SReal_eq) |
|
1577 |
||
1578 |
lemma st_minus: assumes "y \<in> HFinite" shows "st(-y) = -st(y)" |
|
1579 |
proof - |
|
1580 |
have "st (- y) + st y = 0" |
|
1581 |
by (simp add: prems st_add [symmetric] HFinite_minus_iff) |
|
1582 |
thus ?thesis by arith |
|
1583 |
qed |
|
1584 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1585 |
lemma st_diff: "[| x \<in> HFinite; y \<in> HFinite |] ==> st (x-y) = st(x) - st(y)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1586 |
apply (simp add: diff_def) |
14370 | 1587 |
apply (frule_tac y1 = y in st_minus [symmetric]) |
1588 |
apply (drule_tac x1 = y in HFinite_minus_iff [THEN iffD2]) |
|
1589 |
apply (simp (no_asm_simp) add: st_add) |
|
1590 |
done |
|
1591 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1592 |
lemma lemma_st_mult: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1593 |
"[| x \<in> HFinite; y \<in> HFinite; e \<in> Infinitesimal; ea \<in> Infinitesimal |] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1594 |
==> e*y + x*ea + e*ea \<in> Infinitesimal" |
14370 | 1595 |
apply (frule_tac x = e and y = y in Infinitesimal_HFinite_mult) |
1596 |
apply (frule_tac [2] x = ea and y = x in Infinitesimal_HFinite_mult) |
|
1597 |
apply (drule_tac [3] Infinitesimal_mult) |
|
1598 |
apply (auto intro: Infinitesimal_add simp add: add_ac mult_ac) |
|
1599 |
done |
|
1600 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1601 |
lemma st_mult: "[| x \<in> HFinite; y \<in> HFinite |] ==> st (x * y) = st(x) * st(y)" |
14370 | 1602 |
apply (frule HFinite_st_Infinitesimal_add) |
1603 |
apply (frule_tac x = y in HFinite_st_Infinitesimal_add, safe) |
|
1604 |
apply (subgoal_tac "st (x * y) = st ((st x + e) * (st y + ea))") |
|
1605 |
apply (drule_tac [2] sym, drule_tac [2] sym) |
|
1606 |
prefer 2 apply simp |
|
1607 |
apply (erule_tac V = "x = st x + e" in thin_rl) |
|
1608 |
apply (erule_tac V = "y = st y + ea" in thin_rl) |
|
1609 |
apply (simp add: left_distrib right_distrib) |
|
1610 |
apply (drule st_SReal)+ |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1611 |
apply (simp (no_asm_use) add: add_assoc) |
14370 | 1612 |
apply (rule st_Infinitesimal_add_SReal) |
1613 |
apply (blast intro!: SReal_mult) |
|
1614 |
apply (drule SReal_subset_HFinite [THEN subsetD])+ |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1615 |
apply (rule add_assoc [THEN subst]) |
14370 | 1616 |
apply (blast intro!: lemma_st_mult) |
1617 |
done |
|
1618 |
||
1619 |
lemma st_Infinitesimal: "x \<in> Infinitesimal ==> st x = 0" |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
1620 |
apply (subst numeral_0_eq_0 [symmetric]) |
14370 | 1621 |
apply (rule st_number_of [THEN subst]) |
1622 |
apply (rule approx_st_eq) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1623 |
apply (auto intro: Infinitesimal_subset_HFinite [THEN subsetD] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1624 |
simp add: mem_infmal_iff [symmetric]) |
14370 | 1625 |
done |
1626 |
||
1627 |
lemma st_not_Infinitesimal: "st(x) \<noteq> 0 ==> x \<notin> Infinitesimal" |
|
1628 |
by (fast intro: st_Infinitesimal) |
|
1629 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1630 |
lemma st_inverse: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1631 |
"[| x \<in> HFinite; st x \<noteq> 0 |] |
14370 | 1632 |
==> st(inverse x) = inverse (st x)" |
1633 |
apply (rule_tac c1 = "st x" in hypreal_mult_left_cancel [THEN iffD1]) |
|
1634 |
apply (auto simp add: st_mult [symmetric] st_not_Infinitesimal HFinite_inverse) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1635 |
apply (subst right_inverse, auto) |
14370 | 1636 |
done |
1637 |
||
15229 | 1638 |
lemma st_divide [simp]: |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1639 |
"[| x \<in> HFinite; y \<in> HFinite; st y \<noteq> 0 |] |
14370 | 1640 |
==> st(x/y) = (st x) / (st y)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1641 |
by (simp add: divide_inverse st_mult st_not_Infinitesimal HFinite_inverse st_inverse) |
14370 | 1642 |
|
15229 | 1643 |
lemma st_idempotent [simp]: "x \<in> HFinite ==> st(st(x)) = st(x)" |
14370 | 1644 |
by (blast intro: st_HFinite st_approx_self approx_st_eq) |
1645 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1646 |
lemma Infinitesimal_add_st_less: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1647 |
"[| x \<in> HFinite; y \<in> HFinite; u \<in> Infinitesimal; st x < st y |] |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1648 |
==> st x + u < st y" |
14370 | 1649 |
apply (drule st_SReal)+ |
1650 |
apply (auto intro!: Infinitesimal_add_hypreal_of_real_less simp add: SReal_iff) |
|
1651 |
done |
|
1652 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1653 |
lemma Infinitesimal_add_st_le_cancel: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1654 |
"[| x \<in> HFinite; y \<in> HFinite; |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1655 |
u \<in> Infinitesimal; st x \<le> st y + u |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1656 |
|] ==> st x \<le> st y" |
14370 | 1657 |
apply (simp add: linorder_not_less [symmetric]) |
1658 |
apply (auto dest: Infinitesimal_add_st_less) |
|
1659 |
done |
|
1660 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1661 |
lemma st_le: "[| x \<in> HFinite; y \<in> HFinite; x \<le> y |] ==> st(x) \<le> st(y)" |
14370 | 1662 |
apply (frule HFinite_st_Infinitesimal_add) |
1663 |
apply (rotate_tac 1) |
|
1664 |
apply (frule HFinite_st_Infinitesimal_add, safe) |
|
1665 |
apply (rule Infinitesimal_add_st_le_cancel) |
|
1666 |
apply (rule_tac [3] x = ea and y = e in Infinitesimal_diff) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1667 |
apply (auto simp add: add_assoc [symmetric]) |
14370 | 1668 |
done |
1669 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1670 |
lemma st_zero_le: "[| 0 \<le> x; x \<in> HFinite |] ==> 0 \<le> st x" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
1671 |
apply (subst numeral_0_eq_0 [symmetric]) |
14370 | 1672 |
apply (rule st_number_of [THEN subst]) |
1673 |
apply (rule st_le, auto) |
|
1674 |
done |
|
1675 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1676 |
lemma st_zero_ge: "[| x \<le> 0; x \<in> HFinite |] ==> st x \<le> 0" |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14378
diff
changeset
|
1677 |
apply (subst numeral_0_eq_0 [symmetric]) |
14370 | 1678 |
apply (rule st_number_of [THEN subst]) |
1679 |
apply (rule st_le, auto) |
|
1680 |
done |
|
1681 |
||
1682 |
lemma st_hrabs: "x \<in> HFinite ==> abs(st x) = st(abs x)" |
|
1683 |
apply (simp add: linorder_not_le st_zero_le abs_if st_minus |
|
1684 |
linorder_not_less) |
|
1685 |
apply (auto dest!: st_zero_ge [OF order_less_imp_le]) |
|
1686 |
done |
|
1687 |
||
1688 |
||
1689 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1690 |
subsection{*Alternative Definitions for @{term HFinite} using Free Ultrafilter*} |
14370 | 1691 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1692 |
lemma FreeUltrafilterNat_Rep_hypreal: |
17298 | 1693 |
"[| X \<in> Rep_star x; Y \<in> Rep_star x |] |
14370 | 1694 |
==> {n. X n = Y n} \<in> FreeUltrafilterNat" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
1695 |
by (cases x, unfold star_n_def, auto, ultra) |
14370 | 1696 |
|
1697 |
lemma HFinite_FreeUltrafilterNat: |
|
1698 |
"x \<in> HFinite |
|
17298 | 1699 |
==> \<exists>X \<in> Rep_star x. \<exists>u. {n. abs (X n) < u} \<in> FreeUltrafilterNat" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1700 |
apply (cases x) |
14370 | 1701 |
apply (auto simp add: HFinite_def abs_less_iff minus_less_iff [of x] |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1702 |
star_of_def |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1703 |
star_n_less SReal_iff star_n_minus) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1704 |
apply (rule_tac x=X in bexI) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1705 |
apply (rule_tac x=y in exI, ultra) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1706 |
apply simp |
14370 | 1707 |
done |
1708 |
||
1709 |
lemma FreeUltrafilterNat_HFinite: |
|
17298 | 1710 |
"\<exists>X \<in> Rep_star x. |
14370 | 1711 |
\<exists>u. {n. abs (X n) < u} \<in> FreeUltrafilterNat |
1712 |
==> x \<in> HFinite" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1713 |
apply (cases x) |
14370 | 1714 |
apply (auto simp add: HFinite_def abs_less_iff minus_less_iff [of x]) |
1715 |
apply (rule_tac x = "hypreal_of_real u" in bexI) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1716 |
apply (auto simp add: star_n_less SReal_iff star_n_minus star_of_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1717 |
apply ultra+ |
14370 | 1718 |
done |
1719 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1720 |
lemma HFinite_FreeUltrafilterNat_iff: |
17298 | 1721 |
"(x \<in> HFinite) = (\<exists>X \<in> Rep_star x. |
14370 | 1722 |
\<exists>u. {n. abs (X n) < u} \<in> FreeUltrafilterNat)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1723 |
by (blast intro!: HFinite_FreeUltrafilterNat FreeUltrafilterNat_HFinite) |
14370 | 1724 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1725 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1726 |
subsection{*Alternative Definitions for @{term HInfinite} using Free Ultrafilter*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1727 |
|
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1728 |
lemma lemma_Compl_eq: "- {n. (u::real) < abs (xa n)} = {n. abs (xa n) \<le> u}" |
14370 | 1729 |
by auto |
1730 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1731 |
lemma lemma_Compl_eq2: "- {n. abs (xa n) < (u::real)} = {n. u \<le> abs (xa n)}" |
14370 | 1732 |
by auto |
1733 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1734 |
lemma lemma_Int_eq1: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1735 |
"{n. abs (xa n) \<le> (u::real)} Int {n. u \<le> abs (xa n)} |
14370 | 1736 |
= {n. abs(xa n) = u}" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1737 |
by auto |
14370 | 1738 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1739 |
lemma lemma_FreeUltrafilterNat_one: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1740 |
"{n. abs (xa n) = u} \<le> {n. abs (xa n) < u + (1::real)}" |
14370 | 1741 |
by auto |
1742 |
||
1743 |
(*------------------------------------- |
|
1744 |
Exclude this type of sets from free |
|
1745 |
ultrafilter for Infinite numbers! |
|
1746 |
-------------------------------------*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1747 |
lemma FreeUltrafilterNat_const_Finite: |
17298 | 1748 |
"[| xa: Rep_star x; |
14370 | 1749 |
{n. abs (xa n) = u} \<in> FreeUltrafilterNat |
1750 |
|] ==> x \<in> HFinite" |
|
1751 |
apply (rule FreeUltrafilterNat_HFinite) |
|
1752 |
apply (rule_tac x = xa in bexI) |
|
1753 |
apply (rule_tac x = "u + 1" in exI) |
|
1754 |
apply (ultra, assumption) |
|
1755 |
done |
|
1756 |
||
1757 |
lemma HInfinite_FreeUltrafilterNat: |
|
17298 | 1758 |
"x \<in> HInfinite ==> \<exists>X \<in> Rep_star x. |
14370 | 1759 |
\<forall>u. {n. u < abs (X n)} \<in> FreeUltrafilterNat" |
1760 |
apply (frule HInfinite_HFinite_iff [THEN iffD1]) |
|
1761 |
apply (cut_tac x = x in Rep_hypreal_nonempty) |
|
1762 |
apply (auto simp del: Rep_hypreal_nonempty simp add: HFinite_FreeUltrafilterNat_iff Bex_def) |
|
1763 |
apply (drule spec)+ |
|
1764 |
apply auto |
|
1765 |
apply (drule_tac x = u in spec) |
|
1766 |
apply (drule FreeUltrafilterNat_Compl_mem)+ |
|
1767 |
apply (drule FreeUltrafilterNat_Int, assumption) |
|
1768 |
apply (simp add: lemma_Compl_eq lemma_Compl_eq2 lemma_Int_eq1) |
|
1769 |
apply (auto dest: FreeUltrafilterNat_const_Finite simp |
|
1770 |
add: HInfinite_HFinite_iff [THEN iffD1]) |
|
1771 |
done |
|
1772 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1773 |
lemma lemma_Int_HI: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1774 |
"{n. abs (Xa n) < u} Int {n. X n = Xa n} \<subseteq> {n. abs (X n) < (u::real)}" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1775 |
by auto |
14370 | 1776 |
|
1777 |
lemma lemma_Int_HIa: "{n. u < abs (X n)} Int {n. abs (X n) < (u::real)} = {}" |
|
1778 |
by (auto intro: order_less_asym) |
|
1779 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1780 |
lemma FreeUltrafilterNat_HInfinite: |
17298 | 1781 |
"\<exists>X \<in> Rep_star x. \<forall>u. |
14370 | 1782 |
{n. u < abs (X n)} \<in> FreeUltrafilterNat |
1783 |
==> x \<in> HInfinite" |
|
1784 |
apply (rule HInfinite_HFinite_iff [THEN iffD2]) |
|
1785 |
apply (safe, drule HFinite_FreeUltrafilterNat, auto) |
|
1786 |
apply (drule_tac x = u in spec) |
|
1787 |
apply (drule FreeUltrafilterNat_Rep_hypreal, assumption) |
|
1788 |
apply (drule_tac Y = "{n. X n = Xa n}" in FreeUltrafilterNat_Int, simp) |
|
1789 |
apply (drule lemma_Int_HI [THEN [2] FreeUltrafilterNat_subset]) |
|
1790 |
apply (drule_tac Y = "{n. abs (X n) < u}" in FreeUltrafilterNat_Int) |
|
15539 | 1791 |
apply (auto simp add: lemma_Int_HIa) |
14370 | 1792 |
done |
1793 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1794 |
lemma HInfinite_FreeUltrafilterNat_iff: |
17298 | 1795 |
"(x \<in> HInfinite) = (\<exists>X \<in> Rep_star x. |
14370 | 1796 |
\<forall>u. {n. u < abs (X n)} \<in> FreeUltrafilterNat)" |
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1797 |
by (blast intro!: HInfinite_FreeUltrafilterNat FreeUltrafilterNat_HInfinite) |
14370 | 1798 |
|
1799 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1800 |
subsection{*Alternative Definitions for @{term Infinitesimal} using Free Ultrafilter*} |
10751 | 1801 |
|
14370 | 1802 |
lemma Infinitesimal_FreeUltrafilterNat: |
17298 | 1803 |
"x \<in> Infinitesimal ==> \<exists>X \<in> Rep_star x. |
14370 | 1804 |
\<forall>u. 0 < u --> {n. abs (X n) < u} \<in> FreeUltrafilterNat" |
1805 |
apply (simp add: Infinitesimal_def) |
|
1806 |
apply (auto simp add: abs_less_iff minus_less_iff [of x]) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1807 |
apply (cases x) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1808 |
apply (auto, rule bexI [OF _ Rep_star_star_n], safe) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1809 |
apply (drule star_of_less [THEN iffD2]) |
14370 | 1810 |
apply (drule_tac x = "hypreal_of_real u" in bspec, auto) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1811 |
apply (auto simp add: star_n_less star_n_minus star_of_def, ultra) |
14370 | 1812 |
done |
1813 |
||
1814 |
lemma FreeUltrafilterNat_Infinitesimal: |
|
17298 | 1815 |
"\<exists>X \<in> Rep_star x. |
14370 | 1816 |
\<forall>u. 0 < u --> {n. abs (X n) < u} \<in> FreeUltrafilterNat |
1817 |
==> x \<in> Infinitesimal" |
|
1818 |
apply (simp add: Infinitesimal_def) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1819 |
apply (cases x) |
14370 | 1820 |
apply (auto simp add: abs_less_iff abs_interval_iff minus_less_iff [of x]) |
1821 |
apply (auto simp add: SReal_iff) |
|
1822 |
apply (drule_tac [!] x=y in spec) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1823 |
apply (auto simp add: star_n_less star_n_minus star_of_def, ultra+) |
14370 | 1824 |
done |
1825 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1826 |
lemma Infinitesimal_FreeUltrafilterNat_iff: |
17298 | 1827 |
"(x \<in> Infinitesimal) = (\<exists>X \<in> Rep_star x. |
14370 | 1828 |
\<forall>u. 0 < u --> {n. abs (X n) < u} \<in> FreeUltrafilterNat)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1829 |
by (blast intro!: Infinitesimal_FreeUltrafilterNat FreeUltrafilterNat_Infinitesimal) |
14370 | 1830 |
|
1831 |
(*------------------------------------------------------------------------ |
|
1832 |
Infinitesimals as smaller than 1/n for all n::nat (> 0) |
|
1833 |
------------------------------------------------------------------------*) |
|
1834 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1835 |
lemma lemma_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1836 |
"(\<forall>r. 0 < r --> x < r) = (\<forall>n. x < inverse(real (Suc n)))" |
14370 | 1837 |
apply (auto simp add: real_of_nat_Suc_gt_zero) |
1838 |
apply (blast dest!: reals_Archimedean intro: order_less_trans) |
|
1839 |
done |
|
1840 |
||
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1841 |
lemma of_nat_in_Reals [simp]: "(of_nat n::hypreal) \<in> \<real>" |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1842 |
apply (induct n) |
15539 | 1843 |
apply (simp_all) |
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1844 |
done |
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1845 |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1846 |
lemma lemma_Infinitesimal2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1847 |
"(\<forall>r \<in> Reals. 0 < r --> x < r) = |
14370 | 1848 |
(\<forall>n. x < inverse(hypreal_of_nat (Suc n)))" |
1849 |
apply safe |
|
1850 |
apply (drule_tac x = "inverse (hypreal_of_real (real (Suc n))) " in bspec) |
|
1851 |
apply (simp (no_asm_use) add: SReal_inverse) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1852 |
apply (rule real_of_nat_Suc_gt_zero [THEN positive_imp_inverse_positive, THEN star_of_less [THEN iffD2], THEN [2] impE]) |
14370 | 1853 |
prefer 2 apply assumption |
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1854 |
apply (simp add: real_of_nat_Suc_gt_zero hypreal_of_nat_eq) |
14370 | 1855 |
apply (auto dest!: reals_Archimedean simp add: SReal_iff) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
1856 |
apply (drule star_of_less [THEN iffD2]) |
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1857 |
apply (simp add: real_of_nat_Suc_gt_zero hypreal_of_nat_eq) |
14370 | 1858 |
apply (blast intro: order_less_trans) |
1859 |
done |
|
1860 |
||
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
1861 |
|
14370 | 1862 |
lemma Infinitesimal_hypreal_of_nat_iff: |
1863 |
"Infinitesimal = {x. \<forall>n. abs x < inverse (hypreal_of_nat (Suc n))}" |
|
1864 |
apply (simp add: Infinitesimal_def) |
|
1865 |
apply (auto simp add: lemma_Infinitesimal2) |
|
1866 |
done |
|
1867 |
||
1868 |
||
15229 | 1869 |
subsection{*Proof that @{term omega} is an infinite number*} |
1870 |
||
1871 |
text{*It will follow that epsilon is an infinitesimal number.*} |
|
1872 |
||
14370 | 1873 |
lemma Suc_Un_eq: "{n. n < Suc m} = {n. n < m} Un {n. n = m}" |
1874 |
by (auto simp add: less_Suc_eq) |
|
1875 |
||
1876 |
(*------------------------------------------- |
|
1877 |
Prove that any segment is finite and |
|
1878 |
hence cannot belong to FreeUltrafilterNat |
|
1879 |
-------------------------------------------*) |
|
1880 |
lemma finite_nat_segment: "finite {n::nat. n < m}" |
|
15251 | 1881 |
apply (induct "m") |
14370 | 1882 |
apply (auto simp add: Suc_Un_eq) |
1883 |
done |
|
1884 |
||
1885 |
lemma finite_real_of_nat_segment: "finite {n::nat. real n < real (m::nat)}" |
|
1886 |
by (auto intro: finite_nat_segment) |
|
1887 |
||
1888 |
lemma finite_real_of_nat_less_real: "finite {n::nat. real n < u}" |
|
1889 |
apply (cut_tac x = u in reals_Archimedean2, safe) |
|
1890 |
apply (rule finite_real_of_nat_segment [THEN [2] finite_subset]) |
|
1891 |
apply (auto dest: order_less_trans) |
|
1892 |
done |
|
1893 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1894 |
lemma lemma_real_le_Un_eq: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1895 |
"{n. f n \<le> u} = {n. f n < u} Un {n. u = (f n :: real)}" |
14370 | 1896 |
by (auto dest: order_le_imp_less_or_eq simp add: order_less_imp_le) |
1897 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1898 |
lemma finite_real_of_nat_le_real: "finite {n::nat. real n \<le> u}" |
14370 | 1899 |
by (auto simp add: lemma_real_le_Un_eq lemma_finite_omega_set finite_real_of_nat_less_real) |
1900 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1901 |
lemma finite_rabs_real_of_nat_le_real: "finite {n::nat. abs(real n) \<le> u}" |
14370 | 1902 |
apply (simp (no_asm) add: real_of_nat_Suc_gt_zero finite_real_of_nat_le_real) |
1903 |
done |
|
1904 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1905 |
lemma rabs_real_of_nat_le_real_FreeUltrafilterNat: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1906 |
"{n. abs(real n) \<le> u} \<notin> FreeUltrafilterNat" |
14370 | 1907 |
by (blast intro!: FreeUltrafilterNat_finite finite_rabs_real_of_nat_le_real) |
1908 |
||
1909 |
lemma FreeUltrafilterNat_nat_gt_real: "{n. u < real n} \<in> FreeUltrafilterNat" |
|
1910 |
apply (rule ccontr, drule FreeUltrafilterNat_Compl_mem) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1911 |
apply (subgoal_tac "- {n::nat. u < real n} = {n. real n \<le> u}") |
14370 | 1912 |
prefer 2 apply force |
1913 |
apply (simp add: finite_real_of_nat_le_real [THEN FreeUltrafilterNat_finite]) |
|
1914 |
done |
|
1915 |
||
1916 |
(*-------------------------------------------------------------- |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1917 |
The complement of {n. abs(real n) \<le> u} = |
14370 | 1918 |
{n. u < abs (real n)} is in FreeUltrafilterNat |
1919 |
by property of (free) ultrafilters |
|
1920 |
--------------------------------------------------------------*) |
|
1921 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1922 |
lemma Compl_real_le_eq: "- {n::nat. real n \<le> u} = {n. u < real n}" |
14370 | 1923 |
by (auto dest!: order_le_less_trans simp add: linorder_not_le) |
1924 |
||
15229 | 1925 |
text{*@{term omega} is a member of @{term HInfinite}*} |
14370 | 1926 |
|
1927 |
lemma FreeUltrafilterNat_omega: "{n. u < real n} \<in> FreeUltrafilterNat" |
|
1928 |
apply (cut_tac u = u in rabs_real_of_nat_le_real_FreeUltrafilterNat) |
|
1929 |
apply (auto dest: FreeUltrafilterNat_Compl_mem simp add: Compl_real_le_eq) |
|
1930 |
done |
|
1931 |
||
15229 | 1932 |
theorem HInfinite_omega [simp]: "omega \<in> HInfinite" |
17298 | 1933 |
apply (simp add: omega_def star_n_def) |
14370 | 1934 |
apply (auto intro!: FreeUltrafilterNat_HInfinite) |
1935 |
apply (rule bexI) |
|
17298 | 1936 |
apply (rule_tac [2] lemma_starrel_refl, auto) |
14370 | 1937 |
apply (simp (no_asm) add: real_of_nat_Suc diff_less_eq [symmetric] FreeUltrafilterNat_omega) |
1938 |
done |
|
1939 |
||
1940 |
(*----------------------------------------------- |
|
1941 |
Epsilon is a member of Infinitesimal |
|
1942 |
-----------------------------------------------*) |
|
1943 |
||
15229 | 1944 |
lemma Infinitesimal_epsilon [simp]: "epsilon \<in> Infinitesimal" |
14370 | 1945 |
by (auto intro!: HInfinite_inverse_Infinitesimal HInfinite_omega simp add: hypreal_epsilon_inverse_omega) |
1946 |
||
15229 | 1947 |
lemma HFinite_epsilon [simp]: "epsilon \<in> HFinite" |
14370 | 1948 |
by (auto intro: Infinitesimal_subset_HFinite [THEN subsetD]) |
1949 |
||
15229 | 1950 |
lemma epsilon_approx_zero [simp]: "epsilon @= 0" |
14370 | 1951 |
apply (simp (no_asm) add: mem_infmal_iff [symmetric]) |
1952 |
done |
|
1953 |
||
1954 |
(*------------------------------------------------------------------------ |
|
1955 |
Needed for proof that we define a hyperreal [<X(n)] @= hypreal_of_real a given |
|
1956 |
that \<forall>n. |X n - a| < 1/n. Used in proof of NSLIM => LIM. |
|
1957 |
-----------------------------------------------------------------------*) |
|
1958 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1959 |
lemma real_of_nat_less_inverse_iff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1960 |
"0 < u ==> (u < inverse (real(Suc n))) = (real(Suc n) < inverse u)" |
14370 | 1961 |
apply (simp add: inverse_eq_divide) |
1962 |
apply (subst pos_less_divide_eq, assumption) |
|
1963 |
apply (subst pos_less_divide_eq) |
|
1964 |
apply (simp add: real_of_nat_Suc_gt_zero) |
|
1965 |
apply (simp add: real_mult_commute) |
|
1966 |
done |
|
1967 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1968 |
lemma finite_inverse_real_of_posnat_gt_real: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1969 |
"0 < u ==> finite {n. u < inverse(real(Suc n))}" |
14370 | 1970 |
apply (simp (no_asm_simp) add: real_of_nat_less_inverse_iff) |
1971 |
apply (simp (no_asm_simp) add: real_of_nat_Suc less_diff_eq [symmetric]) |
|
1972 |
apply (rule finite_real_of_nat_less_real) |
|
1973 |
done |
|
1974 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1975 |
lemma lemma_real_le_Un_eq2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1976 |
"{n. u \<le> inverse(real(Suc n))} = |
14370 | 1977 |
{n. u < inverse(real(Suc n))} Un {n. u = inverse(real(Suc n))}" |
1978 |
apply (auto dest: order_le_imp_less_or_eq simp add: order_less_imp_le) |
|
1979 |
done |
|
1980 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1981 |
lemma real_of_nat_inverse_le_iff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1982 |
"(inverse (real(Suc n)) \<le> r) = (1 \<le> r * real(Suc n))" |
14370 | 1983 |
apply (simp (no_asm) add: linorder_not_less [symmetric]) |
1984 |
apply (simp (no_asm) add: inverse_eq_divide) |
|
1985 |
apply (subst pos_less_divide_eq) |
|
1986 |
apply (simp (no_asm) add: real_of_nat_Suc_gt_zero) |
|
1987 |
apply (simp (no_asm) add: real_mult_commute) |
|
1988 |
done |
|
1989 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1990 |
lemma real_of_nat_inverse_eq_iff: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
1991 |
"(u = inverse (real(Suc n))) = (real(Suc n) = inverse u)" |
15539 | 1992 |
by (auto simp add: real_of_nat_Suc_gt_zero real_not_refl2 [THEN not_sym]) |
14370 | 1993 |
|
1994 |
lemma lemma_finite_omega_set2: "finite {n::nat. u = inverse(real(Suc n))}" |
|
1995 |
apply (simp (no_asm_simp) add: real_of_nat_inverse_eq_iff) |
|
1996 |
apply (cut_tac x = "inverse u - 1" in lemma_finite_omega_set) |
|
1997 |
apply (simp add: real_of_nat_Suc diff_eq_eq [symmetric] eq_commute) |
|
1998 |
done |
|
1999 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2000 |
lemma finite_inverse_real_of_posnat_ge_real: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2001 |
"0 < u ==> finite {n. u \<le> inverse(real(Suc n))}" |
14370 | 2002 |
by (auto simp add: lemma_real_le_Un_eq2 lemma_finite_omega_set2 finite_inverse_real_of_posnat_gt_real) |
2003 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2004 |
lemma inverse_real_of_posnat_ge_real_FreeUltrafilterNat: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2005 |
"0 < u ==> {n. u \<le> inverse(real(Suc n))} \<notin> FreeUltrafilterNat" |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2006 |
by (blast intro!: FreeUltrafilterNat_finite finite_inverse_real_of_posnat_ge_real) |
14370 | 2007 |
|
2008 |
(*-------------------------------------------------------------- |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2009 |
The complement of {n. u \<le> inverse(real(Suc n))} = |
14370 | 2010 |
{n. inverse(real(Suc n)) < u} is in FreeUltrafilterNat |
2011 |
by property of (free) ultrafilters |
|
2012 |
--------------------------------------------------------------*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2013 |
lemma Compl_le_inverse_eq: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2014 |
"- {n. u \<le> inverse(real(Suc n))} = |
14370 | 2015 |
{n. inverse(real(Suc n)) < u}" |
2016 |
apply (auto dest!: order_le_less_trans simp add: linorder_not_le) |
|
2017 |
done |
|
2018 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2019 |
lemma FreeUltrafilterNat_inverse_real_of_posnat: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2020 |
"0 < u ==> |
14370 | 2021 |
{n. inverse(real(Suc n)) < u} \<in> FreeUltrafilterNat" |
2022 |
apply (cut_tac u = u in inverse_real_of_posnat_ge_real_FreeUltrafilterNat) |
|
2023 |
apply (auto dest: FreeUltrafilterNat_Compl_mem simp add: Compl_le_inverse_eq) |
|
2024 |
done |
|
2025 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2026 |
text{* Example where we get a hyperreal from a real sequence |
14370 | 2027 |
for which a particular property holds. The theorem is |
2028 |
used in proofs about equivalence of nonstandard and |
|
2029 |
standard neighbourhoods. Also used for equivalence of |
|
2030 |
nonstandard ans standard definitions of pointwise |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2031 |
limit.*} |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2032 |
|
14370 | 2033 |
(*----------------------------------------------------- |
2034 |
|X(n) - x| < 1/n ==> [<X n>] - hypreal_of_real x| \<in> Infinitesimal |
|
2035 |
-----------------------------------------------------*) |
|
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2036 |
lemma real_seq_to_hypreal_Infinitesimal: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2037 |
"\<forall>n. abs(X n + -x) < inverse(real(Suc n)) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2038 |
==> star_n X + -hypreal_of_real x \<in> Infinitesimal" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2039 |
apply (auto intro!: bexI dest: FreeUltrafilterNat_inverse_real_of_posnat FreeUltrafilterNat_all FreeUltrafilterNat_Int intro: order_less_trans FreeUltrafilterNat_subset simp add: star_n_minus star_of_def star_n_add Infinitesimal_FreeUltrafilterNat_iff star_n_inverse) |
14370 | 2040 |
done |
2041 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2042 |
lemma real_seq_to_hypreal_approx: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2043 |
"\<forall>n. abs(X n + -x) < inverse(real(Suc n)) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2044 |
==> star_n X @= hypreal_of_real x" |
14370 | 2045 |
apply (subst approx_minus_iff) |
2046 |
apply (rule mem_infmal_iff [THEN subst]) |
|
2047 |
apply (erule real_seq_to_hypreal_Infinitesimal) |
|
2048 |
done |
|
2049 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2050 |
lemma real_seq_to_hypreal_approx2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2051 |
"\<forall>n. abs(x + -X n) < inverse(real(Suc n)) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2052 |
==> star_n X @= hypreal_of_real x" |
14370 | 2053 |
apply (simp add: abs_minus_add_cancel real_seq_to_hypreal_approx) |
2054 |
done |
|
2055 |
||
14420
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2056 |
lemma real_seq_to_hypreal_Infinitesimal2: |
4e72cd222e0b
converted Hyperreal/HTranscendental to Isar script
paulson
parents:
14387
diff
changeset
|
2057 |
"\<forall>n. abs(X n + -Y n) < inverse(real(Suc n)) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2058 |
==> star_n X + -star_n Y \<in> Infinitesimal" |
14370 | 2059 |
by (auto intro!: bexI |
2060 |
dest: FreeUltrafilterNat_inverse_real_of_posnat |
|
2061 |
FreeUltrafilterNat_all FreeUltrafilterNat_Int |
|
2062 |
intro: order_less_trans FreeUltrafilterNat_subset |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2063 |
simp add: Infinitesimal_FreeUltrafilterNat_iff star_n_minus |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17298
diff
changeset
|
2064 |
star_n_add star_n_inverse) |
14370 | 2065 |
|
10751 | 2066 |
end |