author | huffman |
Fri, 09 Sep 2005 19:34:22 +0200 | |
changeset 17318 | bc1c75855f3d |
parent 17299 | c6eecde058e4 |
child 17332 | 4910cf8c0cd2 |
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 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
14 |
lemma starset_n_Un: "*sn* (%n. (A n) Un (B n)) = *sn* A Un *sn* B" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
15 |
apply (simp add: starset_n_def expand_set_eq all_star_eq) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
16 |
apply (simp add: Iset_star_n fuf_disj) |
14415 | 17 |
done |
18 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
19 |
lemma InternalSets_Un: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
20 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
21 |
==> (X Un Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
22 |
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
|
23 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
24 |
lemma starset_n_Int: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
25 |
"*sn* (%n. (A n) Int (B n)) = *sn* A Int *sn* B" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
26 |
apply (simp add: starset_n_def expand_set_eq all_star_eq) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
27 |
apply (simp add: Iset_star_n fuf_conj) |
14415 | 28 |
done |
29 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
30 |
lemma InternalSets_Int: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
31 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
32 |
==> (X Int Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
33 |
by (auto simp add: InternalSets_def starset_n_Int [symmetric]) |
14415 | 34 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
35 |
lemma starset_n_Compl: "*sn* ((%n. - A n)) = -( *sn* A)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
36 |
apply (simp add: starset_n_def expand_set_eq all_star_eq) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
37 |
apply (simp add: Iset_star_n fuf_not) |
14415 | 38 |
done |
39 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
40 |
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
|
41 |
by (auto simp add: InternalSets_def starset_n_Compl [symmetric]) |
14415 | 42 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
43 |
lemma starset_n_diff: "*sn* (%n. (A n) - (B n)) = *sn* A - *sn* B" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
44 |
apply (simp add: starset_n_def expand_set_eq all_star_eq) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
45 |
apply (simp add: Iset_star_n fuf_conj fuf_not) |
14415 | 46 |
done |
47 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
48 |
lemma InternalSets_diff: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
49 |
"[| X \<in> InternalSets; Y \<in> InternalSets |] |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
50 |
==> (X - Y) \<in> InternalSets" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
51 |
by (auto simp add: InternalSets_def starset_n_diff [symmetric]) |
14415 | 52 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
53 |
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
|
54 |
by simp |
14415 | 55 |
|
56 |
lemma NatStar_hypreal_of_real_Int: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
57 |
"*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
|
58 |
by (auto simp add: SHNat_eq STAR_mem_iff) |
14415 | 59 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
60 |
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
|
61 |
by (simp add: starset_n_starset) |
14415 | 62 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
63 |
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
|
64 |
by (auto simp add: InternalSets_def starset_starset_n_eq) |
14415 | 65 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
66 |
lemma InternalSets_UNIV_diff: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
67 |
"X \<in> InternalSets ==> UNIV - X \<in> InternalSets" |
17290 | 68 |
apply (subgoal_tac "UNIV - X = - X") |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
69 |
by (auto intro: InternalSets_Compl) |
14415 | 70 |
|
71 |
||
72 |
subsection{*Nonstandard Extensions of Functions*} |
|
73 |
||
74 |
text{* Example of transfer of a property from reals to hyperreals |
|
75 |
--- used for limit comparison of sequences*} |
|
76 |
||
77 |
lemma starfun_le_mono: |
|
78 |
"\<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
|
79 |
==> \<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
|
80 |
by transfer |
14415 | 81 |
|
82 |
(*****----- and another -----*****) |
|
83 |
lemma starfun_less_mono: |
|
84 |
"\<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
|
85 |
==> \<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
|
86 |
by transfer |
14415 | 87 |
|
88 |
text{*Nonstandard extension when we increment the argument by one*} |
|
89 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
90 |
lemma starfun_shift_one: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
91 |
"!!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
|
92 |
by (transfer, simp) |
14415 | 93 |
|
94 |
text{*Nonstandard extension with absolute value*} |
|
95 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
96 |
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
|
97 |
by (transfer, rule refl) |
14415 | 98 |
|
99 |
text{*The hyperpow function as a nonstandard extension of realpow*} |
|
100 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
101 |
lemma starfun_pow: "!!N. ( *f* (%n. r ^ n)) N = (hypreal_of_real r) pow N" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
102 |
by (unfold hyperpow_def, transfer, rule refl) |
14415 | 103 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
104 |
lemma starfun_pow2: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
105 |
"!!N. ( *f* (%n. (X n) ^ m)) N = ( *f* X) N pow hypnat_of_nat m" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
106 |
by (unfold hyperpow_def, transfer, rule refl) |
14415 | 107 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
108 |
lemma starfun_pow3: "!!R. ( *f* (%r. r ^ n)) R = (R) pow hypnat_of_nat n" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
109 |
by (unfold hyperpow_def, transfer, rule refl) |
14415 | 110 |
|
111 |
text{*The @{term hypreal_of_hypnat} function as a nonstandard extension of |
|
112 |
@{term real_of_nat} *} |
|
113 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
114 |
lemma starfunNat_real_of_nat: "( *f* real) = hypreal_of_hypnat" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
115 |
apply (unfold hypreal_of_hypnat_def) |
14415 | 116 |
apply (rule ext) |
17299 | 117 |
apply (rule_tac z = x in eq_Abs_star) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
118 |
apply (simp add: hypreal_of_hypnat starfun) |
14415 | 119 |
done |
120 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
121 |
lemma starfun_inverse_real_of_nat_eq: |
14415 | 122 |
"N \<in> HNatInfinite |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
123 |
==> ( *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
|
124 |
apply (rule_tac f1 = inverse in starfun_o2 [THEN subst]) |
14415 | 125 |
apply (subgoal_tac "hypreal_of_hypnat N ~= 0") |
126 |
apply (simp_all add: HNatInfinite_not_eq_zero starfunNat_real_of_nat starfun_inverse_inverse) |
|
127 |
done |
|
128 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
129 |
text{*Internal functions - some redundancy with *f* now*} |
14415 | 130 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
131 |
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
|
132 |
by (simp add: starfun_n_def Ifun_star_n) |
14415 | 133 |
|
134 |
text{*Multiplication: @{text "( *fn) x ( *gn) = *(fn x gn)"}*} |
|
10751 | 135 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
136 |
lemma starfun_n_mult: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
137 |
"( *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
|
138 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
139 |
apply (simp add: starfun_n star_n_mult) |
14415 | 140 |
done |
141 |
||
142 |
text{*Addition: @{text "( *fn) + ( *gn) = *(fn + gn)"}*} |
|
143 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
144 |
lemma starfun_n_add: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
145 |
"( *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
|
146 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
147 |
apply (simp add: starfun_n star_n_add) |
14415 | 148 |
done |
149 |
||
150 |
text{*Subtraction: @{text "( *fn) - ( *gn) = *(fn + - gn)"}*} |
|
151 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
152 |
lemma starfun_n_add_minus: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
153 |
"( *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
|
154 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
155 |
apply (simp add: starfun_n star_n_minus star_n_add) |
14415 | 156 |
done |
157 |
||
158 |
||
159 |
text{*Composition: @{text "( *fn) o ( *gn) = *(fn o gn)"}*} |
|
160 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
161 |
lemma starfun_n_const_fun [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
162 |
"( *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
|
163 |
apply (cases z) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
164 |
apply (simp add: starfun_n star_of_def) |
14415 | 165 |
done |
166 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
167 |
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
|
168 |
apply (cases x) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
169 |
apply (simp add: starfun_n star_n_minus) |
14415 | 170 |
done |
171 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
172 |
lemma starfun_n_eq [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
173 |
"( *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
|
174 |
by (simp add: starfun_n star_of_def) |
14415 | 175 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
176 |
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
|
177 |
by (transfer, rule refl) |
14415 | 178 |
|
179 |
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
|
180 |
"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
|
181 |
apply (rule_tac f1 = inverse in starfun_o2 [THEN subst]) |
14415 | 182 |
apply (subgoal_tac "hypreal_of_hypnat N ~= 0") |
183 |
apply (simp_all add: HNatInfinite_not_eq_zero starfunNat_real_of_nat) |
|
184 |
done |
|
185 |
||
186 |
ML |
|
187 |
{* |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
188 |
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
|
189 |
val InternalSets_Un = thm "InternalSets_Un"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
190 |
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
|
191 |
val InternalSets_Int = thm "InternalSets_Int"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
192 |
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
|
193 |
val InternalSets_Compl = thm "InternalSets_Compl"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
194 |
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
|
195 |
val InternalSets_diff = thm "InternalSets_diff"; |
14415 | 196 |
val NatStar_SHNat_subset = thm "NatStar_SHNat_subset"; |
197 |
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
|
198 |
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
|
199 |
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
|
200 |
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
|
201 |
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
|
202 |
val starfun_const_fun = thm "starfun_const_fun"; |
14415 | 203 |
val starfun_le_mono = thm "starfun_le_mono"; |
204 |
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
|
205 |
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
|
206 |
val starfun_abs = thm "starfun_abs"; |
14415 | 207 |
val starfun_pow = thm "starfun_pow"; |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
208 |
val starfun_pow2 = thm "starfun_pow2"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
209 |
val starfun_pow3 = thm "starfun_pow3"; |
14415 | 210 |
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
|
211 |
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
|
212 |
val starfun_n = thm "starfun_n"; |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
213 |
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
|
214 |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
val starfun_n_eq = thm "starfun_n_eq"; |
14415 | 219 |
val starfun_eq_iff = thm "starfun_eq_iff"; |
220 |
val starfunNat_inverse_real_of_nat_Infinitesimal = thm "starfunNat_inverse_real_of_nat_Infinitesimal"; |
|
221 |
*} |
|
222 |
||
14641
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 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
225 |
subsection{*Nonstandard Characterization of Induction*} |
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 |
syntax |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
228 |
starP :: "('a => bool) => 'a star => bool" ("*p* _" [80] 80) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
229 |
starP2 :: "('a => 'b => bool) => 'a star => 'b star => bool" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
230 |
("*p2* _" [80] 80) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
231 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
232 |
translations |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
233 |
"starP" == "Ipred_of" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
234 |
"starP2" == "Ipred2_of" |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
235 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
236 |
constdefs |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
237 |
hSuc :: "hypnat => hypnat" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
238 |
"hSuc n == n + 1" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
239 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
240 |
lemma starP: "(( *p* P) (star_n X)) = ({n. P (X n)} \<in> FreeUltrafilterNat)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
241 |
by (simp add: Ipred_of_def star_of_def Ifun_star_n unstar_star_n) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
242 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
243 |
lemma starP_star_of [simp]: "( *p* P) (star_of n) = P n" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
244 |
by (transfer, rule refl) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
245 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
246 |
lemma hypnat_induct_obj: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
247 |
"!!n. (( *p* P) (0::hypnat) & |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
248 |
(\<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
|
249 |
--> ( *p* P)(n)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
250 |
by (transfer, induct_tac n, auto) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
251 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
252 |
lemma hypnat_induct: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
253 |
"!!n. [| ( *p* P) (0::hypnat); |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
254 |
!!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
|
255 |
==> ( *p* P)(n)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
256 |
by (transfer, induct_tac n, auto) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
257 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
258 |
lemma starP2: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
259 |
"(( *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
|
260 |
({n. P (X n) (Y n)} \<in> FreeUltrafilterNat)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
261 |
by (simp add: Ipred2_of_def star_of_def Ifun_star_n unstar_star_n) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
262 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
263 |
lemma starP2_eq_iff: "( *p2* (op =)) = (op =)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
264 |
by (transfer, rule refl) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
265 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
266 |
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
|
267 |
by (simp add: starP2_eq_iff) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
268 |
|
17299 | 269 |
lemma lemma_hyp: "(\<exists>h. P(h::hypnat)) = (\<exists>x. P(Abs_star(starrel `` {x})))" |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
270 |
apply auto |
17299 | 271 |
apply (rule_tac z = h in eq_Abs_star, auto) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
272 |
done |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
273 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
274 |
lemma hSuc_not_zero [iff]: "hSuc m \<noteq> 0" |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
275 |
by (simp add: hSuc_def) |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
276 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
277 |
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
|
278 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
279 |
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
|
280 |
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
|
281 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
282 |
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
|
283 |
by (erule LeastI) |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
284 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
285 |
lemma nonempty_set_star_has_least: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
286 |
"!!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
|
287 |
apply (transfer empty_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
288 |
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
|
289 |
apply (simp add: Least_le) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
290 |
apply (rule LeastI_ex, auto) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
291 |
done |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
292 |
|
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
293 |
lemma nonempty_InternalNatSet_has_least: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
294 |
"[| (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
|
295 |
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
|
296 |
apply (erule nonempty_set_star_has_least) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
297 |
done |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
298 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
299 |
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
|
300 |
lemma internal_induct_lemma: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
301 |
"!!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
|
302 |
==> Iset X = (UNIV:: hypnat set)" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
303 |
apply (transfer UNIV_def) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
304 |
apply (rule equalityI [OF subset_UNIV subsetI]) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
305 |
apply (induct_tac x, auto) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
306 |
done |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
307 |
|
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
308 |
lemma internal_induct: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
309 |
"[| 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
|
310 |
==> X = (UNIV:: hypnat set)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17299
diff
changeset
|
311 |
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
|
312 |
apply (erule (1) internal_induct_lemma) |
14641
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
313 |
done |
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
314 |
|
79b7bd936264
moved Complex/NSInduct and Hyperreal/IntFloor to more appropriate
paulson
parents:
14468
diff
changeset
|
315 |
|
10751 | 316 |
end |