author | krauss |
Mon, 13 Nov 2006 21:52:14 +0100 | |
changeset 21346 | c8aa120fa05d |
parent 20732 | 275f9bd2ead9 |
child 21404 | eb85850d3eb7 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : Star.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
14468 | 4 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
14370 | 5 |
*) |
10751 | 6 |
|
14370 | 7 |
header{*Star-Transforms in Non-Standard Analysis*} |
8 |
||
15131 | 9 |
theory Star |
15140 | 10 |
imports NSA |
15131 | 11 |
begin |
10751 | 12 |
|
19765 | 13 |
definition |
10751 | 14 |
(* internal sets *) |
19765 | 15 |
starset_n :: "(nat => 'a set) => 'a star set" ("*sn* _" [80] 80) |
16 |
"*sn* As = Iset (star_n As)" |
|
14370 | 17 |
|
19765 | 18 |
InternalSets :: "'a star set set" |
19 |
"InternalSets = {X. \<exists>As. X = *sn* As}" |
|
10751 | 20 |
|
19765 | 21 |
(* nonstandard extension of function *) |
22 |
is_starext :: "['a star => 'a star, 'a => 'a] => bool" |
|
23 |
"is_starext F f = (\<forall>x y. \<exists>X \<in> Rep_star(x). \<exists>Y \<in> Rep_star(y). |
|
10751 | 24 |
((y = (F x)) = ({n. Y n = f(X n)} : FreeUltrafilterNat)))" |
19765 | 25 |
(* internal functions *) |
26 |
starfun_n :: "(nat => ('a => 'b)) => 'a star => 'b star" ("*fn* _" [80] 80) |
|
27 |
"*fn* F = Ifun (star_n F)" |
|
10751 | 28 |
|
19765 | 29 |
InternalFuns :: "('a star => 'b star) set" |
30 |
"InternalFuns = {X. \<exists>F. X = *fn* F}" |
|
10751 | 31 |
|
32 |
||
14370 | 33 |
(*-------------------------------------------------------- |
34 |
Preamble - Pulling "EX" over "ALL" |
|
35 |
---------------------------------------------------------*) |
|
36 |
||
37 |
(* This proof does not need AC and was suggested by the |
|
38 |
referee for the JCM Paper: let f(x) be least y such |
|
39 |
that Q(x,y) |
|
40 |
*) |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
41 |
lemma no_choice: "\<forall>x. \<exists>y. Q x y ==> \<exists>(f :: 'a => nat). \<forall>x. Q x (f x)" |
14370 | 42 |
apply (rule_tac x = "%x. LEAST y. Q x y" in exI) |
43 |
apply (blast intro: LeastI) |
|
44 |
done |
|
45 |
||
15169 | 46 |
subsection{*Properties of the Star-transform Applied to Sets of Reals*} |
14370 | 47 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
48 |
lemma STAR_star_of_image_subset: "star_of ` A <= *s* A" |
20732 | 49 |
by auto |
14370 | 50 |
|
51 |
lemma STAR_hypreal_of_real_Int: "*s* X Int Reals = hypreal_of_real ` X" |
|
20732 | 52 |
by (auto simp add: SReal_def) |
14370 | 53 |
|
14468 | 54 |
lemma lemma_not_hyprealA: "x \<notin> hypreal_of_real ` A ==> \<forall>y \<in> A. x \<noteq> hypreal_of_real y" |
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
55 |
by auto |
14370 | 56 |
|
57 |
lemma lemma_Compl_eq: "- {n. X n = xa} = {n. X n \<noteq> xa}" |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
58 |
by auto |
14370 | 59 |
|
60 |
lemma STAR_real_seq_to_hypreal: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
61 |
"\<forall>n. (X n) \<notin> M ==> star_n X \<notin> *s* M" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
62 |
apply (unfold starset_def star_of_def) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
63 |
apply (simp add: Iset_star_n) |
14370 | 64 |
done |
65 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
66 |
lemma STAR_singleton: "*s* {x} = {star_of x}" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
67 |
by simp |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
68 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
69 |
lemma STAR_not_mem: "x \<notin> F ==> star_of x \<notin> *s* F" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
70 |
by transfer |
14370 | 71 |
|
72 |
lemma STAR_subset_closed: "[| x : *s* A; A <= B |] ==> x : *s* B" |
|
20732 | 73 |
by (erule rev_subsetD, simp) |
14370 | 74 |
|
15169 | 75 |
text{*Nonstandard extension of a set (defined using a constant |
76 |
sequence) as a special case of an internal set*} |
|
14370 | 77 |
|
14468 | 78 |
lemma starset_n_starset: "\<forall>n. (As n = A) ==> *sn* As = *s* A" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
79 |
apply (drule expand_fun_eq [THEN iffD2]) |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
80 |
apply (simp add: starset_n_def starset_def star_of_def) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
81 |
done |
14370 | 82 |
|
83 |
||
84 |
(*----------------------------------------------------------------*) |
|
85 |
(* Theorems about nonstandard extensions of functions *) |
|
86 |
(*----------------------------------------------------------------*) |
|
87 |
||
88 |
(*----------------------------------------------------------------*) |
|
89 |
(* Nonstandard extension of a function (defined using a *) |
|
90 |
(* constant sequence) as a special case of an internal function *) |
|
91 |
(*----------------------------------------------------------------*) |
|
92 |
||
14468 | 93 |
lemma starfun_n_starfun: "\<forall>n. (F n = f) ==> *fn* F = *f* f" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
94 |
apply (drule expand_fun_eq [THEN iffD2]) |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
95 |
apply (simp add: starfun_n_def starfun_def star_of_def) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
96 |
done |
14370 | 97 |
|
98 |
||
99 |
(* |
|
15003 | 100 |
Prove that abs for hypreal is a nonstandard extension of abs for real w/o |
14370 | 101 |
use of congruence property (proved after this for general |
15003 | 102 |
nonstandard extensions of real valued functions). |
14370 | 103 |
|
15003 | 104 |
Proof now Uses the ultrafilter tactic! |
14370 | 105 |
*) |
106 |
||
107 |
lemma hrabs_is_starext_rabs: "is_starext abs abs" |
|
14468 | 108 |
apply (simp add: is_starext_def, safe) |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
109 |
apply (rule_tac x=x in star_cases) |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
110 |
apply (rule_tac x=y in star_cases) |
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
111 |
apply (unfold star_n_def, auto) |
17298 | 112 |
apply (rule bexI, rule_tac [2] lemma_starrel_refl) |
113 |
apply (rule bexI, rule_tac [2] lemma_starrel_refl) |
|
17302 | 114 |
apply (fold star_n_def) |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
115 |
apply (unfold star_abs_def starfun_def star_of_def) |
17302 | 116 |
apply (simp add: Ifun_star_n star_n_eq_iff) |
14370 | 117 |
done |
118 |
||
15169 | 119 |
text{*Nonstandard extension of functions*} |
14370 | 120 |
|
121 |
lemma starfun: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
122 |
"( *f* f) (star_n X) = star_n (%n. f (X n))" |
20732 | 123 |
by (rule starfun_star_n) |
14370 | 124 |
|
14477 | 125 |
lemma starfun_if_eq: |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
126 |
"!!w. w \<noteq> star_of x |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
127 |
==> ( *f* (\<lambda>z. if z = x then a else g z)) w = ( *f* g) w" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17318
diff
changeset
|
128 |
by (transfer, simp) |
14477 | 129 |
|
14370 | 130 |
(*------------------------------------------- |
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
131 |
multiplication: ( *f) x ( *g) = *(f x g) |
14370 | 132 |
------------------------------------------*) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
133 |
lemma starfun_mult: "!!x. ( *f* f) x * ( *f* g) x = ( *f* (%x. f x * g x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
134 |
by (transfer, rule refl) |
14370 | 135 |
declare starfun_mult [symmetric, simp] |
136 |
||
137 |
(*--------------------------------------- |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
138 |
addition: ( *f) + ( *g) = *(f + g) |
14370 | 139 |
---------------------------------------*) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
140 |
lemma starfun_add: "!!x. ( *f* f) x + ( *f* g) x = ( *f* (%x. f x + g x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
141 |
by (transfer, rule refl) |
14370 | 142 |
declare starfun_add [symmetric, simp] |
143 |
||
144 |
(*-------------------------------------------- |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
145 |
subtraction: ( *f) + -( *g) = *(f + -g) |
14370 | 146 |
-------------------------------------------*) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
147 |
lemma starfun_minus: "!!x. - ( *f* f) x = ( *f* (%x. - f x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
148 |
by (transfer, rule refl) |
14370 | 149 |
declare starfun_minus [symmetric, simp] |
150 |
||
151 |
(*FIXME: delete*) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
152 |
lemma starfun_add_minus: "!!x. ( *f* f) x + -( *f* g) x = ( *f* (%x. f x + -g x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
153 |
by (transfer, rule refl) |
14370 | 154 |
declare starfun_add_minus [symmetric, simp] |
155 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
156 |
lemma starfun_diff: "!!x. ( *f* f) x - ( *f* g) x = ( *f* (%x. f x - g x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
157 |
by (transfer, rule refl) |
14370 | 158 |
declare starfun_diff [symmetric, simp] |
159 |
||
160 |
(*-------------------------------------- |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
161 |
composition: ( *f) o ( *g) = *(f o g) |
14370 | 162 |
---------------------------------------*) |
163 |
||
164 |
lemma starfun_o2: "(%x. ( *f* f) (( *f* g) x)) = *f* (%x. f (g x))" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
165 |
by (transfer, rule refl) |
14370 | 166 |
|
167 |
lemma starfun_o: "( *f* f) o ( *f* g) = ( *f* (f o g))" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
168 |
by (transfer o_def, rule refl) |
14370 | 169 |
|
15169 | 170 |
text{*NS extension of constant function*} |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
171 |
lemma starfun_const_fun [simp]: "!!x. ( *f* (%x. k)) x = star_of k" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
172 |
by (transfer, rule refl) |
14370 | 173 |
|
15169 | 174 |
text{*the NS extension of the identity function*} |
14370 | 175 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
176 |
lemma starfun_Id [simp]: "!!x. ( *f* (%x. x)) x = x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
177 |
by (transfer, rule refl) |
14370 | 178 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
179 |
(* this is trivial, given starfun_Id *) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
180 |
lemma starfun_Idfun_approx: |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
181 |
"x @= star_of a ==> ( *f* (%x. x)) x @= star_of a" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
182 |
by (simp only: starfun_Id) |
14370 | 183 |
|
15169 | 184 |
text{*The Star-function is a (nonstandard) extension of the function*} |
14370 | 185 |
|
186 |
lemma is_starext_starfun: "is_starext ( *f* f) f" |
|
14468 | 187 |
apply (simp add: is_starext_def, auto) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
188 |
apply (rule_tac x = x in star_cases) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
189 |
apply (rule_tac x = y in star_cases) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
190 |
apply (auto intro!: bexI [OF _ Rep_star_star_n] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
191 |
simp add: starfun star_n_eq_iff) |
14370 | 192 |
done |
193 |
||
15169 | 194 |
text{*Any nonstandard extension is in fact the Star-function*} |
14370 | 195 |
|
196 |
lemma is_starfun_starext: "is_starext F f ==> F = *f* f" |
|
14468 | 197 |
apply (simp add: is_starext_def) |
14370 | 198 |
apply (rule ext) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
199 |
apply (rule_tac x = x in star_cases) |
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
200 |
apply (drule_tac x = x in spec) |
14370 | 201 |
apply (drule_tac x = "( *f* f) x" in spec) |
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
202 |
apply (auto dest!: FreeUltrafilterNat_Compl_mem simp add: starfun, ultra) |
14370 | 203 |
done |
204 |
||
205 |
lemma is_starext_starfun_iff: "(is_starext F f) = (F = *f* f)" |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
206 |
by (blast intro: is_starfun_starext is_starext_starfun) |
14370 | 207 |
|
15169 | 208 |
text{*extented function has same solution as its standard |
14370 | 209 |
version for real arguments. i.e they are the same |
15169 | 210 |
for all real arguments*} |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
211 |
lemma starfun_eq: "( *f* f) (star_of a) = star_of (f a)" |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
212 |
by (rule starfun_star_of) |
14370 | 213 |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
214 |
lemma starfun_approx: "( *f* f) (star_of a) @= star_of (f a)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
215 |
by simp |
14370 | 216 |
|
217 |
(* useful for NS definition of derivatives *) |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
218 |
lemma starfun_lambda_cancel: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
219 |
"!!x'. ( *f* (%h. f (x + h))) x' = ( *f* f) (star_of x + x')" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
220 |
by (transfer, rule refl) |
14370 | 221 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
222 |
lemma starfun_lambda_cancel2: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
223 |
"( *f* (%h. f(g(x + h)))) x' = ( *f* (f o g)) (star_of x + x')" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
224 |
by (unfold o_def, rule starfun_lambda_cancel) |
14370 | 225 |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
226 |
lemma starfun_mult_HFinite_approx: |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
227 |
fixes l m :: "'a::real_normed_algebra star" |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
228 |
shows "[| ( *f* f) x @= l; ( *f* g) x @= m; |
14370 | 229 |
l: HFinite; m: HFinite |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
230 |
|] ==> ( *f* (%x. f x * g x)) x @= l * m" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
231 |
apply (drule (3) approx_mult_HFinite) |
14370 | 232 |
apply (auto intro: approx_HFinite [OF _ approx_sym]) |
233 |
done |
|
234 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
235 |
lemma starfun_add_approx: "[| ( *f* f) x @= l; ( *f* g) x @= m |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
236 |
|] ==> ( *f* (%x. f x + g x)) x @= l + m" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
237 |
by (auto intro: approx_add) |
14370 | 238 |
|
15169 | 239 |
text{*Examples: hrabs is nonstandard extension of rabs |
240 |
inverse is nonstandard extension of inverse*} |
|
14370 | 241 |
|
242 |
(* can be proved easily using theorem "starfun" and *) |
|
243 |
(* properties of ultrafilter as for inverse below we *) |
|
244 |
(* use the theorem we proved above instead *) |
|
245 |
||
246 |
lemma starfun_rabs_hrabs: "*f* abs = abs" |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
247 |
by (simp only: star_abs_def) |
14370 | 248 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
249 |
lemma starfun_inverse_inverse [simp]: "( *f* inverse) x = inverse(x)" |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
250 |
by (simp only: star_inverse_def) |
14370 | 251 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
252 |
lemma starfun_inverse: "!!x. inverse (( *f* f) x) = ( *f* (%x. inverse (f x))) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
253 |
by (transfer, rule refl) |
14370 | 254 |
declare starfun_inverse [symmetric, simp] |
255 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
256 |
lemma starfun_divide: "!!x. ( *f* f) x / ( *f* g) x = ( *f* (%x. f x / g x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
257 |
by (transfer, rule refl) |
14370 | 258 |
declare starfun_divide [symmetric, simp] |
259 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
260 |
lemma starfun_inverse2: "!!x. inverse (( *f* f) x) = ( *f* (%x. inverse (f x))) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
261 |
by (transfer, rule refl) |
14370 | 262 |
|
15169 | 263 |
text{*General lemma/theorem needed for proofs in elementary |
264 |
topology of the reals*} |
|
14370 | 265 |
lemma starfun_mem_starset: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
266 |
"!!x. ( *f* f) x : *s* A ==> x : *s* {x. f x \<in> A}" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
267 |
by (transfer, simp) |
14370 | 268 |
|
15169 | 269 |
text{*Alternative definition for hrabs with rabs function |
14370 | 270 |
applied entrywise to equivalence class representative. |
15169 | 271 |
This is easily proved using starfun and ns extension thm*} |
15170 | 272 |
lemma hypreal_hrabs: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
273 |
"abs (star_n X) = star_n (%n. abs (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
274 |
by (simp only: starfun_rabs_hrabs [symmetric] starfun) |
14370 | 275 |
|
15169 | 276 |
text{*nonstandard extension of set through nonstandard extension |
14370 | 277 |
of rabs function i.e hrabs. A more general result should be |
278 |
where we replace rabs by some arbitrary function f and hrabs |
|
15169 | 279 |
by its NS extenson. See second NS set extension below.*} |
14370 | 280 |
lemma STAR_rabs_add_minus: |
281 |
"*s* {x. abs (x + - y) < r} = |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
282 |
{x. abs(x + -star_of y) < star_of r}" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
283 |
by (transfer, rule refl) |
14370 | 284 |
|
285 |
lemma STAR_starfun_rabs_add_minus: |
|
286 |
"*s* {x. abs (f x + - y) < r} = |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
287 |
{x. abs(( *f* f) x + -star_of y) < star_of r}" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
288 |
by (transfer, rule refl) |
14370 | 289 |
|
15169 | 290 |
text{*Another characterization of Infinitesimal and one of @= relation. |
15170 | 291 |
In this theory since @{text hypreal_hrabs} proved here. Maybe |
292 |
move both theorems??*} |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14371
diff
changeset
|
293 |
lemma Infinitesimal_FreeUltrafilterNat_iff2: |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
294 |
"(star_n X \<in> Infinitesimal) = |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
295 |
(\<forall>m. {n. norm(X n) < inverse(real(Suc m))} |
14468 | 296 |
\<in> FreeUltrafilterNat)" |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
297 |
by (simp add: Infinitesimal_hypreal_of_nat_iff star_of_def |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
298 |
hnorm_def star_of_nat_def starfun_star_n |
20730 | 299 |
star_n_inverse star_n_less real_of_nat_def) |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
300 |
|
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
301 |
lemma approx_FreeUltrafilterNat_iff: "star_n X @= star_n Y = |
20563 | 302 |
(\<forall>r>0. {n. norm (X n - Y n) < r} : FreeUltrafilterNat)" |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
303 |
apply (subst approx_minus_iff) |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
304 |
apply (rule mem_infmal_iff [THEN subst]) |
20563 | 305 |
apply (simp add: star_n_diff) |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
306 |
apply (simp add: Infinitesimal_FreeUltrafilterNat_iff) |
14370 | 307 |
done |
308 |
||
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
309 |
lemma approx_FreeUltrafilterNat_iff2: "star_n X @= star_n Y = |
20563 | 310 |
(\<forall>m. {n. norm (X n - Y n) < |
14370 | 311 |
inverse(real(Suc m))} : FreeUltrafilterNat)" |
312 |
apply (subst approx_minus_iff) |
|
313 |
apply (rule mem_infmal_iff [THEN subst]) |
|
20563 | 314 |
apply (simp add: star_n_diff) |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
19765
diff
changeset
|
315 |
apply (simp add: Infinitesimal_FreeUltrafilterNat_iff2) |
14370 | 316 |
done |
317 |
||
318 |
lemma inj_starfun: "inj starfun" |
|
319 |
apply (rule inj_onI) |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
320 |
apply (rule ext, rule ccontr) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
321 |
apply (drule_tac x = "star_n (%n. xa)" in fun_cong) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17303
diff
changeset
|
322 |
apply (auto simp add: starfun star_n_eq_iff) |
14370 | 323 |
done |
324 |
||
325 |
end |