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