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