author | berghofe |
Fri, 28 Apr 2006 15:59:31 +0200 | |
changeset 19497 | 630073ef9212 |
parent 17443 | f503dccdff27 |
child 19765 | dfe940911617 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : NatStar.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
14415 | 4 |
|
5 |
Converted to Isar and polished by lcp |
|
6 |
*) |
|
7 |
||
8 |
header{*Star-transforms for the Hypernaturals*} |
|
10751 | 9 |
|
15131 | 10 |
theory NatStar |
15360 | 11 |
imports HyperPow |
15131 | 12 |
begin |
14415 | 13 |
|
17443 | 14 |
lemma star_n_eq_starfun_whn: "star_n X = ( *f* X) whn" |
15 |
by (simp add: hypnat_omega_def starfun_def star_of_def Ifun_star_n) |
|
16 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
17 |
lemma starset_n_Un: "*sn* (%n. (A n) Un (B n)) = *sn* A Un *sn* B" |
17443 | 18 |
apply (simp add: starset_n_def star_n_eq_starfun_whn Un_def) |
19 |
apply (rule_tac x=whn in spec, transfer, simp) |
|
14415 | 20 |
done |
21 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
22 |
lemma InternalSets_Un: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
23 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
24 |
==> (X Un Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
25 |
by (auto simp add: InternalSets_def starset_n_Un [symmetric]) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
26 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
27 |
lemma starset_n_Int: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
28 |
"*sn* (%n. (A n) Int (B n)) = *sn* A Int *sn* B" |
17443 | 29 |
apply (simp add: starset_n_def star_n_eq_starfun_whn Int_def) |
30 |
apply (rule_tac x=whn in spec, transfer, simp) |
|
14415 | 31 |
done |
32 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
33 |
lemma InternalSets_Int: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
34 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
35 |
==> (X Int Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
36 |
by (auto simp add: InternalSets_def starset_n_Int [symmetric]) |
14415 | 37 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
38 |
lemma starset_n_Compl: "*sn* ((%n. - A n)) = -( *sn* A)" |
17443 | 39 |
apply (simp add: starset_n_def star_n_eq_starfun_whn Compl_def) |
40 |
apply (rule_tac x=whn in spec, transfer, simp) |
|
14415 | 41 |
done |
42 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
43 |
lemma InternalSets_Compl: "X \<in> InternalSets ==> -X \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
44 |
by (auto simp add: InternalSets_def starset_n_Compl [symmetric]) |
14415 | 45 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
46 |
lemma starset_n_diff: "*sn* (%n. (A n) - (B n)) = *sn* A - *sn* B" |
17443 | 47 |
apply (simp add: starset_n_def star_n_eq_starfun_whn set_diff_def) |
48 |
apply (rule_tac x=whn in spec, transfer, simp) |
|
14415 | 49 |
done |
50 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
51 |
lemma InternalSets_diff: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
52 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
53 |
==> (X - Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
54 |
by (auto simp add: InternalSets_def starset_n_diff [symmetric]) |
14415 | 55 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
56 |
lemma NatStar_SHNat_subset: "Nats \<le> *s* (UNIV:: nat set)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
57 |
by simp |
14415 | 58 |
|
59 |
lemma NatStar_hypreal_of_real_Int: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
60 |
"*s* X Int Nats = hypnat_of_nat ` X" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
61 |
by (auto simp add: SHNat_eq STAR_mem_iff) |
14415 | 62 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
63 |
lemma starset_starset_n_eq: "*s* X = *sn* (%n. X)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
64 |
by (simp add: starset_n_starset) |
14415 | 65 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
66 |
lemma InternalSets_starset_n [simp]: "( *s* X) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
67 |
by (auto simp add: InternalSets_def starset_starset_n_eq) |
14415 | 68 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
69 |
lemma InternalSets_UNIV_diff: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
70 |
"X \<in> InternalSets ==> UNIV - X \<in> InternalSets" |
17290 | 71 |
apply (subgoal_tac "UNIV - X = - X") |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
72 |
by (auto intro: InternalSets_Compl) |
14415 | 73 |
|
74 |
||
75 |
subsection{*Nonstandard Extensions of Functions*} |
|
76 |
||
77 |
text{* Example of transfer of a property from reals to hyperreals |
|
78 |
--- used for limit comparison of sequences*} |
|
79 |
||
80 |
lemma starfun_le_mono: |
|
81 |
"\<forall>n. N \<le> n --> f n \<le> g n |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
82 |
==> \<forall>n. hypnat_of_nat N \<le> n --> ( *f* f) n \<le> ( *f* g) n" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
83 |
by transfer |
14415 | 84 |
|
85 |
(*****----- and another -----*****) |
|
86 |
lemma starfun_less_mono: |
|
87 |
"\<forall>n. N \<le> n --> f n < g n |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
88 |
==> \<forall>n. hypnat_of_nat N \<le> n --> ( *f* f) n < ( *f* g) n" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
89 |
by transfer |
14415 | 90 |
|
91 |
text{*Nonstandard extension when we increment the argument by one*} |
|
92 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
93 |
lemma starfun_shift_one: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
94 |
"!!N. ( *f* (%n. f (Suc n))) N = ( *f* f) (N + (1::hypnat))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
95 |
by (transfer, simp) |
14415 | 96 |
|
97 |
text{*Nonstandard extension with absolute value*} |
|
98 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
99 |
lemma starfun_abs: "!!N. ( *f* (%n. abs (f n))) N = abs(( *f* f) N)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
100 |
by (transfer, rule refl) |
14415 | 101 |
|
102 |
text{*The hyperpow function as a nonstandard extension of realpow*} |
|
103 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
104 |
lemma starfun_pow: "!!N. ( *f* (%n. r ^ n)) N = (hypreal_of_real r) pow N" |
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17318
diff
changeset
|
105 |
by (transfer, rule refl) |
14415 | 106 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
107 |
lemma starfun_pow2: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
108 |
"!!N. ( *f* (%n. (X n) ^ m)) N = ( *f* X) N pow hypnat_of_nat m" |
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17318
diff
changeset
|
109 |
by (transfer, rule refl) |
14415 | 110 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
111 |
lemma starfun_pow3: "!!R. ( *f* (%r. r ^ n)) R = (R) pow hypnat_of_nat n" |
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17318
diff
changeset
|
112 |
by (transfer, rule refl) |
14415 | 113 |
|
114 |
text{*The @{term hypreal_of_hypnat} function as a nonstandard extension of |
|
115 |
@{term real_of_nat} *} |
|
116 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
117 |
lemma starfunNat_real_of_nat: "( *f* real) = hypreal_of_hypnat" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
118 |
by (transfer, rule refl) |
14415 | 119 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
120 |
lemma starfun_inverse_real_of_nat_eq: |
14415 | 121 |
"N \<in> HNatInfinite |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
122 |
==> ( *f* (%x::nat. inverse(real x))) N = inverse(hypreal_of_hypnat N)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
123 |
apply (rule_tac f1 = inverse in starfun_o2 [THEN subst]) |
14415 | 124 |
apply (subgoal_tac "hypreal_of_hypnat N ~= 0") |
125 |
apply (simp_all add: HNatInfinite_not_eq_zero starfunNat_real_of_nat starfun_inverse_inverse) |
|
126 |
done |
|
127 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
128 |
text{*Internal functions - some redundancy with *f* now*} |
14415 | 129 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
130 |
lemma starfun_n: "( *fn* f) (star_n X) = star_n (%n. f n (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
131 |
by (simp add: starfun_n_def Ifun_star_n) |
14415 | 132 |
|
133 |
text{*Multiplication: @{text "( *fn) x ( *gn) = *(fn x gn)"}*} |
|
10751 | 134 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
135 |
lemma starfun_n_mult: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
136 |
"( *fn* f) z * ( *fn* g) z = ( *fn* (% i x. f i x * g i x)) z" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
137 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
138 |
apply (simp add: starfun_n star_n_mult) |
14415 | 139 |
done |
140 |
||
141 |
text{*Addition: @{text "( *fn) + ( *gn) = *(fn + gn)"}*} |
|
142 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
143 |
lemma starfun_n_add: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
144 |
"( *fn* f) z + ( *fn* g) z = ( *fn* (%i x. f i x + g i x)) z" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
145 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
146 |
apply (simp add: starfun_n star_n_add) |
14415 | 147 |
done |
148 |
||
149 |
text{*Subtraction: @{text "( *fn) - ( *gn) = *(fn + - gn)"}*} |
|
150 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
151 |
lemma starfun_n_add_minus: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
152 |
"( *fn* f) z + -( *fn* g) z = ( *fn* (%i x. f i x + -g i x)) z" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
153 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
154 |
apply (simp add: starfun_n star_n_minus star_n_add) |
14415 | 155 |
done |
156 |
||
157 |
||
158 |
text{*Composition: @{text "( *fn) o ( *gn) = *(fn o gn)"}*} |
|
159 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
160 |
lemma starfun_n_const_fun [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
161 |
"( *fn* (%i x. k)) z = star_of k" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
162 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
163 |
apply (simp add: starfun_n star_of_def) |
14415 | 164 |
done |
165 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
166 |
lemma starfun_n_minus: "- ( *fn* f) x = ( *fn* (%i x. - (f i) x)) x" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
167 |
apply (cases x) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
168 |
apply (simp add: starfun_n star_n_minus) |
14415 | 169 |
done |
170 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
171 |
lemma starfun_n_eq [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
172 |
"( *fn* f) (star_of n) = star_n (%i. f i n)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
173 |
by (simp add: starfun_n star_of_def) |
14415 | 174 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
175 |
lemma starfun_eq_iff: "(( *f* f) = ( *f* g)) = (f = g)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
176 |
by (transfer, rule refl) |
14415 | 177 |
|
178 |
lemma starfunNat_inverse_real_of_nat_Infinitesimal [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
179 |
"N \<in> HNatInfinite ==> ( *f* (%x. inverse (real x))) N \<in> Infinitesimal" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
180 |
apply (rule_tac f1 = inverse in starfun_o2 [THEN subst]) |
14415 | 181 |
apply (subgoal_tac "hypreal_of_hypnat N ~= 0") |
182 |
apply (simp_all add: HNatInfinite_not_eq_zero starfunNat_real_of_nat) |
|
183 |
done |
|
184 |
||
185 |
ML |
|
186 |
{* |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
187 |
val starset_n_Un = thm "starset_n_Un"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
188 |
val InternalSets_Un = thm "InternalSets_Un"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
189 |
val starset_n_Int = thm "starset_n_Int"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
190 |
val InternalSets_Int = thm "InternalSets_Int"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
191 |
val starset_n_Compl = thm "starset_n_Compl"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
192 |
val InternalSets_Compl = thm "InternalSets_Compl"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
193 |
val starset_n_diff = thm "starset_n_diff"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
194 |
val InternalSets_diff = thm "InternalSets_diff"; |
14415 | 195 |
val NatStar_SHNat_subset = thm "NatStar_SHNat_subset"; |
196 |
val NatStar_hypreal_of_real_Int = thm "NatStar_hypreal_of_real_Int"; |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
197 |
val starset_starset_n_eq = thm "starset_starset_n_eq"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
198 |
val InternalSets_starset_n = thm "InternalSets_starset_n"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
199 |
val InternalSets_UNIV_diff = thm "InternalSets_UNIV_diff"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
200 |
val starset_n_starset = thm "starset_n_starset"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
201 |
val starfun_const_fun = thm "starfun_const_fun"; |
14415 | 202 |
val starfun_le_mono = thm "starfun_le_mono"; |
203 |
val starfun_less_mono = thm "starfun_less_mono"; |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
204 |
val starfun_shift_one = thm "starfun_shift_one"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
205 |
val starfun_abs = thm "starfun_abs"; |
14415 | 206 |
val starfun_pow = thm "starfun_pow"; |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
207 |
val starfun_pow2 = thm "starfun_pow2"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
208 |
val starfun_pow3 = thm "starfun_pow3"; |
14415 | 209 |
val starfunNat_real_of_nat = thm "starfunNat_real_of_nat"; |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
210 |
val starfun_inverse_real_of_nat_eq = thm "starfun_inverse_real_of_nat_eq"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
211 |
val starfun_n = thm "starfun_n"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
212 |
val starfun_n_mult = thm "starfun_n_mult"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
213 |
val starfun_n_add = thm "starfun_n_add"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
214 |
val starfun_n_add_minus = thm "starfun_n_add_minus"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
215 |
val starfun_n_const_fun = thm "starfun_n_const_fun"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
216 |
val starfun_n_minus = thm "starfun_n_minus"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
217 |
val starfun_n_eq = thm "starfun_n_eq"; |
14415 | 218 |
val starfun_eq_iff = thm "starfun_eq_iff"; |
219 |
val starfunNat_inverse_real_of_nat_Infinitesimal = thm "starfunNat_inverse_real_of_nat_Infinitesimal"; |
|
220 |
*} |
|
221 |
||
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
222 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
223 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
224 |
subsection{*Nonstandard Characterization of Induction*} |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
225 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
226 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
227 |
constdefs |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
228 |
hSuc :: "hypnat => hypnat" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
229 |
"hSuc n == n + 1" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
230 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
231 |
lemma starP: "(( *p* P) (star_n X)) = ({n. P (X n)} \<in> FreeUltrafilterNat)" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17332
diff
changeset
|
232 |
by (rule starP_star_n) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
233 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
234 |
lemma hypnat_induct_obj: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
235 |
"!!n. (( *p* P) (0::hypnat) & |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
236 |
(\<forall>n. ( *p* P)(n) --> ( *p* P)(n + 1))) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
237 |
--> ( *p* P)(n)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
238 |
by (transfer, induct_tac n, auto) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
239 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
240 |
lemma hypnat_induct: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
241 |
"!!n. [| ( *p* P) (0::hypnat); |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
242 |
!!n. ( *p* P)(n) ==> ( *p* P)(n + 1)|] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
243 |
==> ( *p* P)(n)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
244 |
by (transfer, induct_tac n, auto) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
245 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
246 |
lemma starP2: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
247 |
"(( *p2* P) (star_n X) (star_n Y)) = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
248 |
({n. P (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:
17332
diff
changeset
|
249 |
by (rule starP2_star_n) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
250 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
251 |
lemma starP2_eq_iff: "( *p2* (op =)) = (op =)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
252 |
by (transfer, rule refl) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
253 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
254 |
lemma starP2_eq_iff2: "( *p2* (%x y. x = y)) X Y = (X = Y)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
255 |
by (simp add: starP2_eq_iff) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
256 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
257 |
lemma hSuc_not_zero [iff]: "hSuc m \<noteq> 0" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
258 |
by (simp add: hSuc_def) |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
259 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
260 |
lemmas zero_not_hSuc = hSuc_not_zero [THEN not_sym, standard, iff] |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
261 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
262 |
lemma hSuc_hSuc_eq [iff]: "(hSuc m = hSuc n) = (m = n)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
263 |
by (simp add: hSuc_def star_n_one_num) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
264 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
265 |
lemma nonempty_nat_set_Least_mem: "c \<in> (S :: nat set) ==> (LEAST n. n \<in> S) \<in> S" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
266 |
by (erule LeastI) |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
267 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
268 |
lemma nonempty_set_star_has_least: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
269 |
"!!S::nat set star. Iset S \<noteq> {} ==> \<exists>n \<in> Iset S. \<forall>m \<in> Iset S. n \<le> m" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
270 |
apply (transfer empty_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
271 |
apply (rule_tac x="LEAST n. n \<in> S" in bexI) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
272 |
apply (simp add: Least_le) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
273 |
apply (rule LeastI_ex, auto) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
274 |
done |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
275 |
|
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
276 |
lemma nonempty_InternalNatSet_has_least: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
277 |
"[| (S::hypnat set) \<in> InternalSets; S \<noteq> {} |] ==> \<exists>n \<in> S. \<forall>m \<in> S. n \<le> m" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
278 |
apply (clarsimp simp add: InternalSets_def starset_n_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
279 |
apply (erule nonempty_set_star_has_least) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
280 |
done |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
281 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
282 |
text{* Goldblatt page 129 Thm 11.3.2*} |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
283 |
lemma internal_induct_lemma: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
284 |
"!!X::nat set star. [| (0::hypnat) \<in> Iset X; \<forall>n. n \<in> Iset X --> n + 1 \<in> Iset X |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
285 |
==> Iset X = (UNIV:: hypnat set)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
286 |
apply (transfer UNIV_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
287 |
apply (rule equalityI [OF subset_UNIV subsetI]) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
288 |
apply (induct_tac x, auto) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
289 |
done |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
290 |
|
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
291 |
lemma internal_induct: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
292 |
"[| X \<in> InternalSets; (0::hypnat) \<in> X; \<forall>n. n \<in> X --> n + 1 \<in> X |] |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
293 |
==> X = (UNIV:: hypnat set)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
294 |
apply (clarsimp simp add: InternalSets_def starset_n_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
295 |
apply (erule (1) internal_induct_lemma) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
296 |
done |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
297 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
298 |
|
10751 | 299 |
end |