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