| author | wenzelm |
| Wed, 11 Feb 2009 21:40:16 +0100 | |
| changeset 29728 | 2a4f000d1e4d |
| parent 26086 | 3c243098b64a |
| child 35416 | d8d7d1b785af |
| permissions | -rw-r--r-- |
| 15647 | 1 |
(* AUTOMATICALLY GENERATED, DO NOT EDIT! *) |
2 |
||
| 17566 | 3 |
theory HOL4Real imports HOL4Base begin |
| 14516 | 4 |
|
5 |
;setup_theory realax |
|
6 |
||
| 17644 | 7 |
lemma HREAL_RDISTRIB: "ALL (x::hreal) (y::hreal) z::hreal. |
| 14516 | 8 |
hreal_mul (hreal_add x y) z = hreal_add (hreal_mul x z) (hreal_mul y z)" |
9 |
by (import realax HREAL_RDISTRIB) |
|
10 |
||
| 17644 | 11 |
lemma HREAL_EQ_ADDL: "ALL (x::hreal) y::hreal. x ~= hreal_add x y" |
| 14516 | 12 |
by (import realax HREAL_EQ_ADDL) |
13 |
||
| 17644 | 14 |
lemma HREAL_EQ_LADD: "ALL (x::hreal) (y::hreal) z::hreal. |
15 |
(hreal_add x y = hreal_add x z) = (y = z)" |
|
| 14516 | 16 |
by (import realax HREAL_EQ_LADD) |
17 |
||
| 17644 | 18 |
lemma HREAL_LT_REFL: "ALL x::hreal. ~ hreal_lt x x" |
| 14516 | 19 |
by (import realax HREAL_LT_REFL) |
20 |
||
| 17644 | 21 |
lemma HREAL_LT_ADDL: "ALL (x::hreal) y::hreal. hreal_lt x (hreal_add x y)" |
| 14516 | 22 |
by (import realax HREAL_LT_ADDL) |
23 |
||
| 17644 | 24 |
lemma HREAL_LT_NE: "ALL (x::hreal) y::hreal. hreal_lt x y --> x ~= y" |
| 14516 | 25 |
by (import realax HREAL_LT_NE) |
26 |
||
| 17644 | 27 |
lemma HREAL_LT_ADDR: "ALL (x::hreal) y::hreal. ~ hreal_lt (hreal_add x y) x" |
| 14516 | 28 |
by (import realax HREAL_LT_ADDR) |
29 |
||
| 17644 | 30 |
lemma HREAL_LT_GT: "ALL (x::hreal) y::hreal. hreal_lt x y --> ~ hreal_lt y x" |
| 14516 | 31 |
by (import realax HREAL_LT_GT) |
32 |
||
| 17644 | 33 |
lemma HREAL_LT_ADD2: "ALL (x1::hreal) (x2::hreal) (y1::hreal) y2::hreal. |
| 14516 | 34 |
hreal_lt x1 y1 & hreal_lt x2 y2 --> |
35 |
hreal_lt (hreal_add x1 x2) (hreal_add y1 y2)" |
|
36 |
by (import realax HREAL_LT_ADD2) |
|
37 |
||
| 17644 | 38 |
lemma HREAL_LT_LADD: "ALL (x::hreal) (y::hreal) z::hreal. |
39 |
hreal_lt (hreal_add x y) (hreal_add x z) = hreal_lt y z" |
|
| 14516 | 40 |
by (import realax HREAL_LT_LADD) |
41 |
||
42 |
constdefs |
|
43 |
treal_0 :: "hreal * hreal" |
|
44 |
"treal_0 == (hreal_1, hreal_1)" |
|
45 |
||
46 |
lemma treal_0: "treal_0 = (hreal_1, hreal_1)" |
|
47 |
by (import realax treal_0) |
|
48 |
||
49 |
constdefs |
|
50 |
treal_1 :: "hreal * hreal" |
|
51 |
"treal_1 == (hreal_add hreal_1 hreal_1, hreal_1)" |
|
52 |
||
53 |
lemma treal_1: "treal_1 = (hreal_add hreal_1 hreal_1, hreal_1)" |
|
54 |
by (import realax treal_1) |
|
55 |
||
56 |
constdefs |
|
57 |
treal_neg :: "hreal * hreal => hreal * hreal" |
|
| 17644 | 58 |
"treal_neg == %(x::hreal, y::hreal). (y, x)" |
59 |
||
60 |
lemma treal_neg: "ALL (x::hreal) y::hreal. treal_neg (x, y) = (y, x)" |
|
| 14516 | 61 |
by (import realax treal_neg) |
62 |
||
63 |
constdefs |
|
64 |
treal_add :: "hreal * hreal => hreal * hreal => hreal * hreal" |
|
| 17644 | 65 |
"treal_add == |
66 |
%(x1::hreal, y1::hreal) (x2::hreal, y2::hreal). |
|
67 |
(hreal_add x1 x2, hreal_add y1 y2)" |
|
68 |
||
69 |
lemma treal_add: "ALL (x1::hreal) (y1::hreal) (x2::hreal) y2::hreal. |
|
| 14516 | 70 |
treal_add (x1, y1) (x2, y2) = (hreal_add x1 x2, hreal_add y1 y2)" |
71 |
by (import realax treal_add) |
|
72 |
||
73 |
constdefs |
|
74 |
treal_mul :: "hreal * hreal => hreal * hreal => hreal * hreal" |
|
75 |
"treal_mul == |
|
| 17644 | 76 |
%(x1::hreal, y1::hreal) (x2::hreal, y2::hreal). |
| 14516 | 77 |
(hreal_add (hreal_mul x1 x2) (hreal_mul y1 y2), |
78 |
hreal_add (hreal_mul x1 y2) (hreal_mul y1 x2))" |
|
79 |
||
| 17644 | 80 |
lemma treal_mul: "ALL (x1::hreal) (y1::hreal) (x2::hreal) y2::hreal. |
| 14516 | 81 |
treal_mul (x1, y1) (x2, y2) = |
82 |
(hreal_add (hreal_mul x1 x2) (hreal_mul y1 y2), |
|
83 |
hreal_add (hreal_mul x1 y2) (hreal_mul y1 x2))" |
|
84 |
by (import realax treal_mul) |
|
85 |
||
86 |
constdefs |
|
87 |
treal_lt :: "hreal * hreal => hreal * hreal => bool" |
|
| 17644 | 88 |
"treal_lt == |
89 |
%(x1::hreal, y1::hreal) (x2::hreal, y2::hreal). |
|
90 |
hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)" |
|
91 |
||
92 |
lemma treal_lt: "ALL (x1::hreal) (y1::hreal) (x2::hreal) y2::hreal. |
|
| 14516 | 93 |
treal_lt (x1, y1) (x2, y2) = hreal_lt (hreal_add x1 y2) (hreal_add x2 y1)" |
94 |
by (import realax treal_lt) |
|
95 |
||
96 |
constdefs |
|
97 |
treal_inv :: "hreal * hreal => hreal * hreal" |
|
98 |
"treal_inv == |
|
| 17644 | 99 |
%(x::hreal, y::hreal). |
| 14516 | 100 |
if x = y then treal_0 |
101 |
else if hreal_lt y x |
|
102 |
then (hreal_add (hreal_inv (hreal_sub x y)) hreal_1, hreal_1) |
|
103 |
else (hreal_1, hreal_add (hreal_inv (hreal_sub y x)) hreal_1)" |
|
104 |
||
| 17644 | 105 |
lemma treal_inv: "ALL (x::hreal) y::hreal. |
| 14516 | 106 |
treal_inv (x, y) = |
107 |
(if x = y then treal_0 |
|
108 |
else if hreal_lt y x |
|
109 |
then (hreal_add (hreal_inv (hreal_sub x y)) hreal_1, hreal_1) |
|
110 |
else (hreal_1, hreal_add (hreal_inv (hreal_sub y x)) hreal_1))" |
|
111 |
by (import realax treal_inv) |
|
112 |
||
113 |
constdefs |
|
114 |
treal_eq :: "hreal * hreal => hreal * hreal => bool" |
|
| 17644 | 115 |
"treal_eq == |
116 |
%(x1::hreal, y1::hreal) (x2::hreal, y2::hreal). |
|
117 |
hreal_add x1 y2 = hreal_add x2 y1" |
|
118 |
||
119 |
lemma treal_eq: "ALL (x1::hreal) (y1::hreal) (x2::hreal) y2::hreal. |
|
| 14516 | 120 |
treal_eq (x1, y1) (x2, y2) = (hreal_add x1 y2 = hreal_add x2 y1)" |
121 |
by (import realax treal_eq) |
|
122 |
||
| 17644 | 123 |
lemma TREAL_EQ_REFL: "ALL x::hreal * hreal. treal_eq x x" |
| 14516 | 124 |
by (import realax TREAL_EQ_REFL) |
125 |
||
| 17644 | 126 |
lemma TREAL_EQ_SYM: "ALL (x::hreal * hreal) y::hreal * hreal. treal_eq x y = treal_eq y x" |
| 14516 | 127 |
by (import realax TREAL_EQ_SYM) |
128 |
||
| 17644 | 129 |
lemma TREAL_EQ_TRANS: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
130 |
treal_eq x y & treal_eq y z --> treal_eq x z" |
|
| 14516 | 131 |
by (import realax TREAL_EQ_TRANS) |
132 |
||
| 17644 | 133 |
lemma TREAL_EQ_EQUIV: "ALL (p::hreal * hreal) q::hreal * hreal. |
134 |
treal_eq p q = (treal_eq p = treal_eq q)" |
|
| 14516 | 135 |
by (import realax TREAL_EQ_EQUIV) |
136 |
||
| 17644 | 137 |
lemma TREAL_EQ_AP: "ALL (p::hreal * hreal) q::hreal * hreal. p = q --> treal_eq p q" |
| 14516 | 138 |
by (import realax TREAL_EQ_AP) |
139 |
||
140 |
lemma TREAL_10: "~ treal_eq treal_1 treal_0" |
|
141 |
by (import realax TREAL_10) |
|
142 |
||
| 17644 | 143 |
lemma TREAL_ADD_SYM: "ALL (x::hreal * hreal) y::hreal * hreal. treal_add x y = treal_add y x" |
| 14516 | 144 |
by (import realax TREAL_ADD_SYM) |
145 |
||
| 17644 | 146 |
lemma TREAL_MUL_SYM: "ALL (x::hreal * hreal) y::hreal * hreal. treal_mul x y = treal_mul y x" |
| 14516 | 147 |
by (import realax TREAL_MUL_SYM) |
148 |
||
| 17644 | 149 |
lemma TREAL_ADD_ASSOC: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
150 |
treal_add x (treal_add y z) = treal_add (treal_add x y) z" |
|
| 14516 | 151 |
by (import realax TREAL_ADD_ASSOC) |
152 |
||
| 17644 | 153 |
lemma TREAL_MUL_ASSOC: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
154 |
treal_mul x (treal_mul y z) = treal_mul (treal_mul x y) z" |
|
| 14516 | 155 |
by (import realax TREAL_MUL_ASSOC) |
156 |
||
| 17644 | 157 |
lemma TREAL_LDISTRIB: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
| 14516 | 158 |
treal_mul x (treal_add y z) = treal_add (treal_mul x y) (treal_mul x z)" |
159 |
by (import realax TREAL_LDISTRIB) |
|
160 |
||
| 17644 | 161 |
lemma TREAL_ADD_LID: "ALL x::hreal * hreal. treal_eq (treal_add treal_0 x) x" |
| 14516 | 162 |
by (import realax TREAL_ADD_LID) |
163 |
||
| 17644 | 164 |
lemma TREAL_MUL_LID: "ALL x::hreal * hreal. treal_eq (treal_mul treal_1 x) x" |
| 14516 | 165 |
by (import realax TREAL_MUL_LID) |
166 |
||
| 17644 | 167 |
lemma TREAL_ADD_LINV: "ALL x::hreal * hreal. treal_eq (treal_add (treal_neg x) x) treal_0" |
| 14516 | 168 |
by (import realax TREAL_ADD_LINV) |
169 |
||
170 |
lemma TREAL_INV_0: "treal_eq (treal_inv treal_0) treal_0" |
|
171 |
by (import realax TREAL_INV_0) |
|
172 |
||
| 17644 | 173 |
lemma TREAL_MUL_LINV: "ALL x::hreal * hreal. |
174 |
~ treal_eq x treal_0 --> treal_eq (treal_mul (treal_inv x) x) treal_1" |
|
| 14516 | 175 |
by (import realax TREAL_MUL_LINV) |
176 |
||
| 17644 | 177 |
lemma TREAL_LT_TOTAL: "ALL (x::hreal * hreal) y::hreal * hreal. |
178 |
treal_eq x y | treal_lt x y | treal_lt y x" |
|
| 14516 | 179 |
by (import realax TREAL_LT_TOTAL) |
180 |
||
| 17644 | 181 |
lemma TREAL_LT_REFL: "ALL x::hreal * hreal. ~ treal_lt x x" |
| 14516 | 182 |
by (import realax TREAL_LT_REFL) |
183 |
||
| 17644 | 184 |
lemma TREAL_LT_TRANS: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
185 |
treal_lt x y & treal_lt y z --> treal_lt x z" |
|
| 14516 | 186 |
by (import realax TREAL_LT_TRANS) |
187 |
||
| 17644 | 188 |
lemma TREAL_LT_ADD: "ALL (x::hreal * hreal) (y::hreal * hreal) z::hreal * hreal. |
189 |
treal_lt y z --> treal_lt (treal_add x y) (treal_add x z)" |
|
| 14516 | 190 |
by (import realax TREAL_LT_ADD) |
191 |
||
| 17644 | 192 |
lemma TREAL_LT_MUL: "ALL (x::hreal * hreal) y::hreal * hreal. |
| 14516 | 193 |
treal_lt treal_0 x & treal_lt treal_0 y --> |
194 |
treal_lt treal_0 (treal_mul x y)" |
|
195 |
by (import realax TREAL_LT_MUL) |
|
196 |
||
197 |
constdefs |
|
198 |
treal_of_hreal :: "hreal => hreal * hreal" |
|
| 17644 | 199 |
"treal_of_hreal == %x::hreal. (hreal_add x hreal_1, hreal_1)" |
200 |
||
201 |
lemma treal_of_hreal: "ALL x::hreal. treal_of_hreal x = (hreal_add x hreal_1, hreal_1)" |
|
| 14516 | 202 |
by (import realax treal_of_hreal) |
203 |
||
204 |
constdefs |
|
205 |
hreal_of_treal :: "hreal * hreal => hreal" |
|
| 17644 | 206 |
"hreal_of_treal == %(x::hreal, y::hreal). SOME d::hreal. x = hreal_add y d" |
207 |
||
208 |
lemma hreal_of_treal: "ALL (x::hreal) y::hreal. |
|
209 |
hreal_of_treal (x, y) = (SOME d::hreal. x = hreal_add y d)" |
|
| 14516 | 210 |
by (import realax hreal_of_treal) |
211 |
||
| 17644 | 212 |
lemma TREAL_BIJ: "(ALL h::hreal. hreal_of_treal (treal_of_hreal h) = h) & |
213 |
(ALL r::hreal * hreal. |
|
214 |
treal_lt treal_0 r = treal_eq (treal_of_hreal (hreal_of_treal r)) r)" |
|
| 14516 | 215 |
by (import realax TREAL_BIJ) |
216 |
||
| 17644 | 217 |
lemma TREAL_ISO: "ALL (h::hreal) i::hreal. |
218 |
hreal_lt h i --> treal_lt (treal_of_hreal h) (treal_of_hreal i)" |
|
| 14516 | 219 |
by (import realax TREAL_ISO) |
220 |
||
| 17644 | 221 |
lemma TREAL_BIJ_WELLDEF: "ALL (h::hreal * hreal) i::hreal * hreal. |
222 |
treal_eq h i --> hreal_of_treal h = hreal_of_treal i" |
|
| 14516 | 223 |
by (import realax TREAL_BIJ_WELLDEF) |
224 |
||
| 17644 | 225 |
lemma TREAL_NEG_WELLDEF: "ALL (x1::hreal * hreal) x2::hreal * hreal. |
226 |
treal_eq x1 x2 --> treal_eq (treal_neg x1) (treal_neg x2)" |
|
| 14516 | 227 |
by (import realax TREAL_NEG_WELLDEF) |
228 |
||
| 17644 | 229 |
lemma TREAL_ADD_WELLDEFR: "ALL (x1::hreal * hreal) (x2::hreal * hreal) y::hreal * hreal. |
230 |
treal_eq x1 x2 --> treal_eq (treal_add x1 y) (treal_add x2 y)" |
|
| 14516 | 231 |
by (import realax TREAL_ADD_WELLDEFR) |
232 |
||
| 17644 | 233 |
lemma TREAL_ADD_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal) |
234 |
y2::hreal * hreal. |
|
| 14516 | 235 |
treal_eq x1 x2 & treal_eq y1 y2 --> |
236 |
treal_eq (treal_add x1 y1) (treal_add x2 y2)" |
|
237 |
by (import realax TREAL_ADD_WELLDEF) |
|
238 |
||
| 17644 | 239 |
lemma TREAL_MUL_WELLDEFR: "ALL (x1::hreal * hreal) (x2::hreal * hreal) y::hreal * hreal. |
240 |
treal_eq x1 x2 --> treal_eq (treal_mul x1 y) (treal_mul x2 y)" |
|
| 14516 | 241 |
by (import realax TREAL_MUL_WELLDEFR) |
242 |
||
| 17644 | 243 |
lemma TREAL_MUL_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal) |
244 |
y2::hreal * hreal. |
|
| 14516 | 245 |
treal_eq x1 x2 & treal_eq y1 y2 --> |
246 |
treal_eq (treal_mul x1 y1) (treal_mul x2 y2)" |
|
247 |
by (import realax TREAL_MUL_WELLDEF) |
|
248 |
||
| 17644 | 249 |
lemma TREAL_LT_WELLDEFR: "ALL (x1::hreal * hreal) (x2::hreal * hreal) y::hreal * hreal. |
250 |
treal_eq x1 x2 --> treal_lt x1 y = treal_lt x2 y" |
|
| 14516 | 251 |
by (import realax TREAL_LT_WELLDEFR) |
252 |
||
| 17644 | 253 |
lemma TREAL_LT_WELLDEFL: "ALL (x::hreal * hreal) (y1::hreal * hreal) y2::hreal * hreal. |
254 |
treal_eq y1 y2 --> treal_lt x y1 = treal_lt x y2" |
|
| 14516 | 255 |
by (import realax TREAL_LT_WELLDEFL) |
256 |
||
| 17644 | 257 |
lemma TREAL_LT_WELLDEF: "ALL (x1::hreal * hreal) (x2::hreal * hreal) (y1::hreal * hreal) |
258 |
y2::hreal * hreal. |
|
| 14516 | 259 |
treal_eq x1 x2 & treal_eq y1 y2 --> treal_lt x1 y1 = treal_lt x2 y2" |
260 |
by (import realax TREAL_LT_WELLDEF) |
|
261 |
||
| 17644 | 262 |
lemma TREAL_INV_WELLDEF: "ALL (x1::hreal * hreal) x2::hreal * hreal. |
263 |
treal_eq x1 x2 --> treal_eq (treal_inv x1) (treal_inv x2)" |
|
| 14516 | 264 |
by (import realax TREAL_INV_WELLDEF) |
265 |
||
266 |
;end_setup |
|
267 |
||
268 |
;setup_theory real |
|
269 |
||
| 17652 | 270 |
lemma REAL_0: "(op =::real => real => bool) (0::real) (0::real)" |
| 14516 | 271 |
by (import real REAL_0) |
272 |
||
| 17652 | 273 |
lemma REAL_1: "(op =::real => real => bool) (1::real) (1::real)" |
| 14516 | 274 |
by (import real REAL_1) |
275 |
||
| 17652 | 276 |
lemma REAL_ADD_LID_UNIQ: "ALL (x::real) y::real. (x + y = y) = (x = 0)" |
| 14516 | 277 |
by (import real REAL_ADD_LID_UNIQ) |
278 |
||
| 17652 | 279 |
lemma REAL_ADD_RID_UNIQ: "ALL (x::real) y::real. (x + y = x) = (y = 0)" |
| 14516 | 280 |
by (import real REAL_ADD_RID_UNIQ) |
281 |
||
| 17652 | 282 |
lemma REAL_LNEG_UNIQ: "ALL (x::real) y::real. (x + y = 0) = (x = - y)" |
| 14516 | 283 |
by (import real REAL_LNEG_UNIQ) |
284 |
||
285 |
lemma REAL_LT_ANTISYM: "ALL (x::real) y::real. ~ (x < y & y < x)" |
|
286 |
by (import real REAL_LT_ANTISYM) |
|
287 |
||
288 |
lemma REAL_LTE_TOTAL: "ALL (x::real) y::real. x < y | y <= x" |
|
289 |
by (import real REAL_LTE_TOTAL) |
|
290 |
||
291 |
lemma REAL_LET_ANTISYM: "ALL (x::real) y::real. ~ (x < y & y <= x)" |
|
292 |
by (import real REAL_LET_ANTISYM) |
|
293 |
||
294 |
lemma REAL_LTE_ANTSYM: "ALL (x::real) y::real. ~ (x <= y & y < x)" |
|
295 |
by (import real REAL_LTE_ANTSYM) |
|
296 |
||
| 17652 | 297 |
lemma REAL_LT_NEGTOTAL: "ALL x::real. x = 0 | 0 < x | 0 < - x" |
| 14516 | 298 |
by (import real REAL_LT_NEGTOTAL) |
299 |
||
| 17652 | 300 |
lemma REAL_LE_NEGTOTAL: "ALL x::real. 0 <= x | 0 <= - x" |
| 14516 | 301 |
by (import real REAL_LE_NEGTOTAL) |
302 |
||
303 |
lemma REAL_LT_ADDNEG: "ALL (x::real) (y::real) z::real. (y < x + - z) = (y + z < x)" |
|
304 |
by (import real REAL_LT_ADDNEG) |
|
305 |
||
306 |
lemma REAL_LT_ADDNEG2: "ALL (x::real) (y::real) z::real. (x + - y < z) = (x < z + y)" |
|
307 |
by (import real REAL_LT_ADDNEG2) |
|
308 |
||
| 17652 | 309 |
lemma REAL_LT_ADD1: "ALL (x::real) y::real. x <= y --> x < y + 1" |
| 14516 | 310 |
by (import real REAL_LT_ADD1) |
311 |
||
| 14796 | 312 |
lemma REAL_SUB_ADD2: "ALL (x::real) y::real. y + (x - y) = x" |
313 |
by (import real REAL_SUB_ADD2) |
|
314 |
||
| 17652 | 315 |
lemma REAL_SUB_LT: "ALL (x::real) y::real. (0 < x - y) = (y < x)" |
| 15647 | 316 |
by (import real REAL_SUB_LT) |
317 |
||
| 17652 | 318 |
lemma REAL_SUB_LE: "ALL (x::real) y::real. (0 <= x - y) = (y <= x)" |
| 15647 | 319 |
by (import real REAL_SUB_LE) |
320 |
||
| 14796 | 321 |
lemma REAL_ADD_SUB: "ALL (x::real) y::real. x + y - x = y" |
322 |
by (import real REAL_ADD_SUB) |
|
| 14516 | 323 |
|
324 |
lemma REAL_NEG_EQ: "ALL (x::real) y::real. (- x = y) = (x = - y)" |
|
325 |
by (import real REAL_NEG_EQ) |
|
326 |
||
| 17652 | 327 |
lemma REAL_NEG_MINUS1: "ALL x::real. - x = - 1 * x" |
| 14516 | 328 |
by (import real REAL_NEG_MINUS1) |
329 |
||
| 17652 | 330 |
lemma REAL_LT_LMUL_0: "ALL (x::real) y::real. 0 < x --> (0 < x * y) = (0 < y)" |
| 14516 | 331 |
by (import real REAL_LT_LMUL_0) |
332 |
||
| 17652 | 333 |
lemma REAL_LT_RMUL_0: "ALL (x::real) y::real. 0 < y --> (0 < x * y) = (0 < x)" |
| 14516 | 334 |
by (import real REAL_LT_RMUL_0) |
335 |
||
| 17652 | 336 |
lemma REAL_LT_LMUL: "ALL (x::real) (y::real) z::real. 0 < x --> (x * y < x * z) = (y < z)" |
| 14516 | 337 |
by (import real REAL_LT_LMUL) |
338 |
||
| 17652 | 339 |
lemma REAL_LINV_UNIQ: "ALL (x::real) y::real. x * y = 1 --> x = inverse y" |
| 14516 | 340 |
by (import real REAL_LINV_UNIQ) |
341 |
||
| 17652 | 342 |
lemma REAL_LE_INV: "(All::(real => bool) => bool) |
343 |
(%x::real. |
|
344 |
(op -->::bool => bool => bool) |
|
345 |
((op <=::real => real => bool) (0::real) x) |
|
346 |
((op <=::real => real => bool) (0::real) ((inverse::real => real) x)))" |
|
| 14516 | 347 |
by (import real REAL_LE_INV) |
348 |
||
| 17652 | 349 |
lemma REAL_LE_ADDR: "ALL (x::real) y::real. (x <= x + y) = (0 <= y)" |
| 14516 | 350 |
by (import real REAL_LE_ADDR) |
351 |
||
| 17652 | 352 |
lemma REAL_LE_ADDL: "ALL (x::real) y::real. (y <= x + y) = (0 <= x)" |
| 14516 | 353 |
by (import real REAL_LE_ADDL) |
354 |
||
| 17652 | 355 |
lemma REAL_LT_ADDR: "ALL (x::real) y::real. (x < x + y) = (0 < y)" |
| 14516 | 356 |
by (import real REAL_LT_ADDR) |
357 |
||
| 17652 | 358 |
lemma REAL_LT_ADDL: "ALL (x::real) y::real. (y < x + y) = (0 < x)" |
| 14516 | 359 |
by (import real REAL_LT_ADDL) |
360 |
||
| 17652 | 361 |
lemma REAL_LT_NZ: "ALL n::nat. (real n ~= 0) = (0 < real n)" |
| 14516 | 362 |
by (import real REAL_LT_NZ) |
363 |
||
| 17652 | 364 |
lemma REAL_NZ_IMP_LT: "ALL n::nat. n ~= 0 --> 0 < real n" |
| 14516 | 365 |
by (import real REAL_NZ_IMP_LT) |
366 |
||
| 17652 | 367 |
lemma REAL_LT_RDIV_0: "ALL (y::real) z::real. 0 < z --> (0 < y / z) = (0 < y)" |
| 14516 | 368 |
by (import real REAL_LT_RDIV_0) |
369 |
||
| 17652 | 370 |
lemma REAL_LT_RDIV: "ALL (x::real) (y::real) z::real. 0 < z --> (x / z < y / z) = (x < y)" |
| 14516 | 371 |
by (import real REAL_LT_RDIV) |
372 |
||
| 17652 | 373 |
lemma REAL_LT_FRACTION_0: "ALL (n::nat) d::real. n ~= 0 --> (0 < d / real n) = (0 < d)" |
| 14516 | 374 |
by (import real REAL_LT_FRACTION_0) |
375 |
||
| 17652 | 376 |
lemma REAL_LT_MULTIPLE: "ALL (x::nat) xa::real. 1 < x --> (xa < real x * xa) = (0 < xa)" |
| 14516 | 377 |
by (import real REAL_LT_MULTIPLE) |
378 |
||
| 17652 | 379 |
lemma REAL_LT_FRACTION: "ALL (n::nat) d::real. 1 < n --> (d / real n < d) = (0 < d)" |
| 14516 | 380 |
by (import real REAL_LT_FRACTION) |
381 |
||
| 17652 | 382 |
lemma REAL_LT_HALF2: "ALL d::real. (d / 2 < d) = (0 < d)" |
| 14516 | 383 |
by (import real REAL_LT_HALF2) |
384 |
||
| 17652 | 385 |
lemma REAL_DIV_LMUL: "ALL (x::real) y::real. y ~= 0 --> y * (x / y) = x" |
| 14516 | 386 |
by (import real REAL_DIV_LMUL) |
387 |
||
| 17652 | 388 |
lemma REAL_DIV_RMUL: "ALL (x::real) y::real. y ~= 0 --> x / y * y = x" |
| 14516 | 389 |
by (import real REAL_DIV_RMUL) |
390 |
||
| 17652 | 391 |
lemma REAL_DOWN: "(All::(real => bool) => bool) |
392 |
(%x::real. |
|
393 |
(op -->::bool => bool => bool) |
|
394 |
((op <::real => real => bool) (0::real) x) |
|
395 |
((Ex::(real => bool) => bool) |
|
396 |
(%xa::real. |
|
397 |
(op &::bool => bool => bool) |
|
398 |
((op <::real => real => bool) (0::real) xa) |
|
399 |
((op <::real => real => bool) xa x))))" |
|
| 14516 | 400 |
by (import real REAL_DOWN) |
401 |
||
402 |
lemma REAL_SUB_SUB: "ALL (x::real) y::real. x - y - x = - y" |
|
403 |
by (import real REAL_SUB_SUB) |
|
404 |
||
405 |
lemma REAL_ADD2_SUB2: "ALL (a::real) (b::real) (c::real) d::real. a + b - (c + d) = a - c + (b - d)" |
|
406 |
by (import real REAL_ADD2_SUB2) |
|
407 |
||
408 |
lemma REAL_SUB_LNEG: "ALL (x::real) y::real. - x - y = - (x + y)" |
|
409 |
by (import real REAL_SUB_LNEG) |
|
410 |
||
411 |
lemma REAL_SUB_NEG2: "ALL (x::real) y::real. - x - - y = y - x" |
|
412 |
by (import real REAL_SUB_NEG2) |
|
413 |
||
414 |
lemma REAL_SUB_TRIANGLE: "ALL (a::real) (b::real) c::real. a - b + (b - c) = a - c" |
|
415 |
by (import real REAL_SUB_TRIANGLE) |
|
416 |
||
417 |
lemma REAL_INV_MUL: "ALL (x::real) y::real. |
|
| 17652 | 418 |
x ~= 0 & y ~= 0 --> inverse (x * y) = inverse x * inverse y" |
| 14516 | 419 |
by (import real REAL_INV_MUL) |
420 |
||
421 |
lemma REAL_SUB_INV2: "ALL (x::real) y::real. |
|
| 17652 | 422 |
x ~= 0 & y ~= 0 --> inverse x - inverse y = (y - x) / (x * y)" |
| 14516 | 423 |
by (import real REAL_SUB_INV2) |
424 |
||
425 |
lemma REAL_SUB_SUB2: "ALL (x::real) y::real. x - (x - y) = y" |
|
426 |
by (import real REAL_SUB_SUB2) |
|
427 |
||
428 |
lemma REAL_ADD_SUB2: "ALL (x::real) y::real. x - (x + y) = - y" |
|
429 |
by (import real REAL_ADD_SUB2) |
|
430 |
||
431 |
lemma REAL_LE_MUL2: "ALL (x1::real) (x2::real) (y1::real) y2::real. |
|
| 17652 | 432 |
0 <= x1 & 0 <= y1 & x1 <= x2 & y1 <= y2 --> x1 * y1 <= x2 * y2" |
| 14516 | 433 |
by (import real REAL_LE_MUL2) |
434 |
||
| 17652 | 435 |
lemma REAL_LE_DIV: "ALL (x::real) xa::real. 0 <= x & 0 <= xa --> 0 <= x / xa" |
| 14516 | 436 |
by (import real REAL_LE_DIV) |
437 |
||
| 17652 | 438 |
lemma REAL_LT_1: "ALL (x::real) y::real. 0 <= x & x < y --> x / y < 1" |
| 14516 | 439 |
by (import real REAL_LT_1) |
440 |
||
| 17652 | 441 |
lemma REAL_POS_NZ: "(All::(real => bool) => bool) |
442 |
(%x::real. |
|
443 |
(op -->::bool => bool => bool) |
|
444 |
((op <::real => real => bool) (0::real) x) |
|
445 |
((Not::bool => bool) ((op =::real => real => bool) x (0::real))))" |
|
| 14516 | 446 |
by (import real REAL_POS_NZ) |
447 |
||
| 17652 | 448 |
lemma REAL_EQ_LMUL_IMP: "ALL (x::real) (xa::real) xb::real. x ~= 0 & x * xa = x * xb --> xa = xb" |
| 14516 | 449 |
by (import real REAL_EQ_LMUL_IMP) |
450 |
||
| 17652 | 451 |
lemma REAL_FACT_NZ: "ALL n::nat. real (FACT n) ~= 0" |
| 14516 | 452 |
by (import real REAL_FACT_NZ) |
453 |
||
454 |
lemma REAL_DIFFSQ: "ALL (x::real) y::real. (x + y) * (x - y) = x * x - y * y" |
|
455 |
by (import real REAL_DIFFSQ) |
|
456 |
||
| 17652 | 457 |
lemma REAL_POASQ: "ALL x::real. (0 < x * x) = (x ~= 0)" |
| 14516 | 458 |
by (import real REAL_POASQ) |
459 |
||
| 17652 | 460 |
lemma REAL_SUMSQ: "ALL (x::real) y::real. (x * x + y * y = 0) = (x = 0 & y = 0)" |
| 14516 | 461 |
by (import real REAL_SUMSQ) |
462 |
||
| 17188 | 463 |
lemma REAL_DIV_MUL2: "ALL (x::real) z::real. |
| 17652 | 464 |
x ~= 0 & z ~= 0 --> (ALL y::real. y / z = x * y / (x * z))" |
| 17188 | 465 |
by (import real REAL_DIV_MUL2) |
466 |
||
| 17652 | 467 |
lemma REAL_MIDDLE1: "ALL (a::real) b::real. a <= b --> a <= (a + b) / 2" |
| 14516 | 468 |
by (import real REAL_MIDDLE1) |
469 |
||
| 17652 | 470 |
lemma REAL_MIDDLE2: "ALL (a::real) b::real. a <= b --> (a + b) / 2 <= b" |
| 14516 | 471 |
by (import real REAL_MIDDLE2) |
472 |
||
473 |
lemma ABS_LT_MUL2: "ALL (w::real) (x::real) (y::real) z::real. |
|
474 |
abs w < y & abs x < z --> abs (w * x) < y * z" |
|
475 |
by (import real ABS_LT_MUL2) |
|
476 |
||
| 17652 | 477 |
lemma ABS_REFL: "ALL x::real. (abs x = x) = (0 <= x)" |
| 14516 | 478 |
by (import real ABS_REFL) |
479 |
||
480 |
lemma ABS_BETWEEN: "ALL (x::real) (y::real) d::real. |
|
| 17652 | 481 |
(0 < d & x - d < y & y < x + d) = (abs (y - x) < d)" |
| 14516 | 482 |
by (import real ABS_BETWEEN) |
483 |
||
484 |
lemma ABS_BOUND: "ALL (x::real) (y::real) d::real. abs (x - y) < d --> y < x + d" |
|
485 |
by (import real ABS_BOUND) |
|
486 |
||
| 17652 | 487 |
lemma ABS_STILLNZ: "ALL (x::real) y::real. abs (x - y) < abs y --> x ~= 0" |
| 14516 | 488 |
by (import real ABS_STILLNZ) |
489 |
||
| 17652 | 490 |
lemma ABS_CASES: "ALL x::real. x = 0 | 0 < abs x" |
| 14516 | 491 |
by (import real ABS_CASES) |
492 |
||
493 |
lemma ABS_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & abs (y - x) < z - x --> y < z" |
|
494 |
by (import real ABS_BETWEEN1) |
|
495 |
||
| 17652 | 496 |
lemma ABS_SIGN: "ALL (x::real) y::real. abs (x - y) < y --> 0 < x" |
| 14516 | 497 |
by (import real ABS_SIGN) |
498 |
||
| 17652 | 499 |
lemma ABS_SIGN2: "ALL (x::real) y::real. abs (x - y) < - y --> x < 0" |
| 14516 | 500 |
by (import real ABS_SIGN2) |
501 |
||
502 |
lemma ABS_CIRCLE: "ALL (x::real) (y::real) h::real. |
|
503 |
abs h < abs y - abs x --> abs (x + h) < abs y" |
|
504 |
by (import real ABS_CIRCLE) |
|
505 |
||
506 |
lemma ABS_BETWEEN2: "ALL (x0::real) (x::real) (y0::real) y::real. |
|
| 17652 | 507 |
x0 < y0 & abs (x - x0) < (y0 - x0) / 2 & abs (y - y0) < (y0 - x0) / 2 --> |
| 14516 | 508 |
x < y" |
509 |
by (import real ABS_BETWEEN2) |
|
510 |
||
| 17652 | 511 |
lemma POW_PLUS1: "ALL e>0. ALL n::nat. 1 + real n * e <= (1 + e) ^ n" |
| 14516 | 512 |
by (import real POW_PLUS1) |
513 |
||
| 17652 | 514 |
lemma POW_M1: "(All::(nat => bool) => bool) |
515 |
(%n::nat. |
|
516 |
(op =::real => real => bool) |
|
517 |
((abs::real => real) |
|
518 |
((op ^::real => nat => real) ((uminus::real => real) (1::real)) n)) |
|
519 |
(1::real))" |
|
| 14516 | 520 |
by (import real POW_M1) |
521 |
||
| 17652 | 522 |
lemma REAL_LE1_POW2: "(All::(real => bool) => bool) |
523 |
(%x::real. |
|
524 |
(op -->::bool => bool => bool) |
|
525 |
((op <=::real => real => bool) (1::real) x) |
|
526 |
((op <=::real => real => bool) (1::real) |
|
527 |
((op ^::real => nat => real) x |
|
| 20485 | 528 |
((number_of \<Colon> int => nat) |
|
26086
3c243098b64a
New simpler representation of numerals, using Bit0 and Bit1 instead of BIT, B0, and B1
huffman
parents:
25919
diff
changeset
|
529 |
((Int.Bit0 \<Colon> int => int) |
|
3c243098b64a
New simpler representation of numerals, using Bit0 and Bit1 instead of BIT, B0, and B1
huffman
parents:
25919
diff
changeset
|
530 |
((Int.Bit1 \<Colon> int => int) (Int.Pls \<Colon> int)))))))" |
| 14516 | 531 |
by (import real REAL_LE1_POW2) |
532 |
||
| 17652 | 533 |
lemma REAL_LT1_POW2: "(All::(real => bool) => bool) |
534 |
(%x::real. |
|
535 |
(op -->::bool => bool => bool) |
|
536 |
((op <::real => real => bool) (1::real) x) |
|
537 |
((op <::real => real => bool) (1::real) |
|
538 |
((op ^::real => nat => real) x |
|
| 20485 | 539 |
((number_of \<Colon> int => nat) |
|
26086
3c243098b64a
New simpler representation of numerals, using Bit0 and Bit1 instead of BIT, B0, and B1
huffman
parents:
25919
diff
changeset
|
540 |
((Int.Bit0 \<Colon> int => int) |
|
3c243098b64a
New simpler representation of numerals, using Bit0 and Bit1 instead of BIT, B0, and B1
huffman
parents:
25919
diff
changeset
|
541 |
((Int.Bit1 \<Colon> int => int) (Int.Pls \<Colon> int)))))))" |
| 14516 | 542 |
by (import real REAL_LT1_POW2) |
543 |
||
| 17652 | 544 |
lemma POW_POS_LT: "ALL (x::real) n::nat. 0 < x --> 0 < x ^ Suc n" |
| 14516 | 545 |
by (import real POW_POS_LT) |
546 |
||
| 17652 | 547 |
lemma POW_LT: "ALL (n::nat) (x::real) y::real. 0 <= x & x < y --> x ^ Suc n < y ^ Suc n" |
| 14516 | 548 |
by (import real POW_LT) |
549 |
||
| 17652 | 550 |
lemma POW_ZERO_EQ: "ALL (n::nat) x::real. (x ^ Suc n = 0) = (x = 0)" |
| 14516 | 551 |
by (import real POW_ZERO_EQ) |
552 |
||
| 17652 | 553 |
lemma REAL_POW_LT2: "ALL (n::nat) (x::real) y::real. n ~= 0 & 0 <= x & x < y --> x ^ n < y ^ n" |
| 14516 | 554 |
by (import real REAL_POW_LT2) |
555 |
||
| 17652 | 556 |
lemma REAL_POW_MONO_LT: "ALL (m::nat) (n::nat) x::real. 1 < x & m < n --> x ^ m < x ^ n" |
| 17188 | 557 |
by (import real REAL_POW_MONO_LT) |
558 |
||
| 14516 | 559 |
lemma REAL_SUP_SOMEPOS: "ALL P::real => bool. |
| 17652 | 560 |
(EX x::real. P x & 0 < x) & (EX z::real. ALL x::real. P x --> x < z) --> |
| 14516 | 561 |
(EX s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s))" |
562 |
by (import real REAL_SUP_SOMEPOS) |
|
563 |
||
564 |
lemma SUP_LEMMA1: "ALL (P::real => bool) (s::real) d::real. |
|
565 |
(ALL y::real. (EX x::real. P (x + d) & y < x) = (y < s)) --> |
|
566 |
(ALL y::real. (EX x::real. P x & y < x) = (y < s + d))" |
|
567 |
by (import real SUP_LEMMA1) |
|
568 |
||
| 17652 | 569 |
lemma SUP_LEMMA2: "ALL P::real => bool. Ex P --> (EX (d::real) x::real. P (x + d) & 0 < x)" |
| 14516 | 570 |
by (import real SUP_LEMMA2) |
571 |
||
572 |
lemma SUP_LEMMA3: "ALL d::real. |
|
573 |
(EX z::real. ALL x::real. (P::real => bool) x --> x < z) --> |
|
574 |
(EX x::real. ALL xa::real. P (xa + d) --> xa < x)" |
|
575 |
by (import real SUP_LEMMA3) |
|
576 |
||
577 |
lemma REAL_SUP_EXISTS: "ALL P::real => bool. |
|
578 |
Ex P & (EX z::real. ALL x::real. P x --> x < z) --> |
|
579 |
(EX x::real. ALL y::real. (EX x::real. P x & y < x) = (y < x))" |
|
580 |
by (import real REAL_SUP_EXISTS) |
|
581 |
||
582 |
constdefs |
|
583 |
sup :: "(real => bool) => real" |
|
| 17644 | 584 |
"sup == |
585 |
%P::real => bool. |
|
586 |
SOME s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s)" |
|
587 |
||
588 |
lemma sup: "ALL P::real => bool. |
|
589 |
sup P = (SOME s::real. ALL y::real. (EX x::real. P x & y < x) = (y < s))" |
|
| 14516 | 590 |
by (import real sup) |
591 |
||
| 17644 | 592 |
lemma REAL_SUP: "ALL P::real => bool. |
593 |
Ex P & (EX z::real. ALL x::real. P x --> x < z) --> |
|
594 |
(ALL y::real. (EX x::real. P x & y < x) = (y < sup P))" |
|
| 14516 | 595 |
by (import real REAL_SUP) |
596 |
||
| 17644 | 597 |
lemma REAL_SUP_UBOUND: "ALL P::real => bool. |
598 |
Ex P & (EX z::real. ALL x::real. P x --> x < z) --> |
|
599 |
(ALL y::real. P y --> y <= sup P)" |
|
| 14516 | 600 |
by (import real REAL_SUP_UBOUND) |
601 |
||
602 |
lemma SETOK_LE_LT: "ALL P::real => bool. |
|
603 |
(Ex P & (EX z::real. ALL x::real. P x --> x <= z)) = |
|
604 |
(Ex P & (EX z::real. ALL x::real. P x --> x < z))" |
|
605 |
by (import real SETOK_LE_LT) |
|
606 |
||
| 17644 | 607 |
lemma REAL_SUP_LE: "ALL P::real => bool. |
608 |
Ex P & (EX z::real. ALL x::real. P x --> x <= z) --> |
|
609 |
(ALL y::real. (EX x::real. P x & y < x) = (y < sup P))" |
|
| 14516 | 610 |
by (import real REAL_SUP_LE) |
611 |
||
| 17644 | 612 |
lemma REAL_SUP_UBOUND_LE: "ALL P::real => bool. |
613 |
Ex P & (EX z::real. ALL x::real. P x --> x <= z) --> |
|
614 |
(ALL y::real. P y --> y <= sup P)" |
|
| 14516 | 615 |
by (import real REAL_SUP_UBOUND_LE) |
616 |
||
| 17652 | 617 |
lemma REAL_ARCH_LEAST: "ALL y>0. ALL x>=0. EX n::nat. real n * y <= x & x < real (Suc n) * y" |
| 14516 | 618 |
by (import real REAL_ARCH_LEAST) |
619 |
||
620 |
consts |
|
621 |
sumc :: "nat => nat => (nat => real) => real" |
|
622 |
||
| 17652 | 623 |
specification (sumc) sumc: "(ALL (n::nat) f::nat => real. sumc n 0 f = 0) & |
| 17644 | 624 |
(ALL (n::nat) (m::nat) f::nat => real. |
625 |
sumc n (Suc m) f = sumc n m f + f (n + m))" |
|
| 14516 | 626 |
by (import real sumc) |
627 |
||
| 14694 | 628 |
consts |
| 14516 | 629 |
sum :: "nat * nat => (nat => real) => real" |
| 14694 | 630 |
|
631 |
defs |
|
| 15647 | 632 |
sum_def: "(op ==::(nat * nat => (nat => real) => real) |
633 |
=> (nat * nat => (nat => real) => real) => prop) |
|
634 |
(real.sum::nat * nat => (nat => real) => real) |
|
635 |
((split::(nat => nat => (nat => real) => real) |
|
636 |
=> nat * nat => (nat => real) => real) |
|
637 |
(sumc::nat => nat => (nat => real) => real))" |
|
| 14516 | 638 |
|
| 17644 | 639 |
lemma SUM_DEF: "ALL (m::nat) (n::nat) f::nat => real. real.sum (m, n) f = sumc m n f" |
| 14516 | 640 |
by (import real SUM_DEF) |
641 |
||
| 17644 | 642 |
lemma sum: "ALL (x::nat => real) (xa::nat) xb::nat. |
| 17652 | 643 |
real.sum (xa, 0) x = 0 & |
| 14516 | 644 |
real.sum (xa, Suc xb) x = real.sum (xa, xb) x + x (xa + xb)" |
645 |
by (import real sum) |
|
646 |
||
| 17644 | 647 |
lemma SUM_TWO: "ALL (f::nat => real) (n::nat) p::nat. |
| 17652 | 648 |
real.sum (0, n) f + real.sum (n, p) f = real.sum (0, n + p) f" |
| 14516 | 649 |
by (import real SUM_TWO) |
650 |
||
| 17644 | 651 |
lemma SUM_DIFF: "ALL (f::nat => real) (m::nat) n::nat. |
| 17652 | 652 |
real.sum (m, n) f = real.sum (0, m + n) f - real.sum (0, m) f" |
| 14516 | 653 |
by (import real SUM_DIFF) |
654 |
||
| 17644 | 655 |
lemma ABS_SUM: "ALL (f::nat => real) (m::nat) n::nat. |
656 |
abs (real.sum (m, n) f) <= real.sum (m, n) (%n::nat. abs (f n))" |
|
| 14516 | 657 |
by (import real ABS_SUM) |
658 |
||
| 17644 | 659 |
lemma SUM_LE: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat. |
660 |
(ALL r::nat. m <= r & r < n + m --> f r <= g r) --> |
|
| 14516 | 661 |
real.sum (m, n) f <= real.sum (m, n) g" |
662 |
by (import real SUM_LE) |
|
663 |
||
| 17644 | 664 |
lemma SUM_EQ: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat. |
665 |
(ALL r::nat. m <= r & r < n + m --> f r = g r) --> |
|
| 14516 | 666 |
real.sum (m, n) f = real.sum (m, n) g" |
667 |
by (import real SUM_EQ) |
|
668 |
||
| 17644 | 669 |
lemma SUM_POS: "ALL f::nat => real. |
| 17652 | 670 |
(ALL n::nat. 0 <= f n) --> (ALL (m::nat) n::nat. 0 <= real.sum (m, n) f)" |
| 14516 | 671 |
by (import real SUM_POS) |
672 |
||
| 17644 | 673 |
lemma SUM_POS_GEN: "ALL (f::nat => real) m::nat. |
| 17652 | 674 |
(ALL n::nat. m <= n --> 0 <= f n) --> |
675 |
(ALL n::nat. 0 <= real.sum (m, n) f)" |
|
| 14516 | 676 |
by (import real SUM_POS_GEN) |
677 |
||
| 17644 | 678 |
lemma SUM_ABS: "ALL (f::nat => real) (m::nat) x::nat. |
679 |
abs (real.sum (m, x) (%m::nat. abs (f m))) = |
|
680 |
real.sum (m, x) (%m::nat. abs (f m))" |
|
| 14516 | 681 |
by (import real SUM_ABS) |
682 |
||
| 17644 | 683 |
lemma SUM_ABS_LE: "ALL (f::nat => real) (m::nat) n::nat. |
684 |
abs (real.sum (m, n) f) <= real.sum (m, n) (%n::nat. abs (f n))" |
|
| 14516 | 685 |
by (import real SUM_ABS_LE) |
686 |
||
| 17644 | 687 |
lemma SUM_ZERO: "ALL (f::nat => real) N::nat. |
| 17652 | 688 |
(ALL n::nat. N <= n --> f n = 0) --> |
689 |
(ALL (m::nat) n::nat. N <= m --> real.sum (m, n) f = 0)" |
|
| 14516 | 690 |
by (import real SUM_ZERO) |
691 |
||
| 17644 | 692 |
lemma SUM_ADD: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat. |
693 |
real.sum (m, n) (%n::nat. f n + g n) = |
|
694 |
real.sum (m, n) f + real.sum (m, n) g" |
|
| 14516 | 695 |
by (import real SUM_ADD) |
696 |
||
| 17644 | 697 |
lemma SUM_CMUL: "ALL (f::nat => real) (c::real) (m::nat) n::nat. |
698 |
real.sum (m, n) (%n::nat. c * f n) = c * real.sum (m, n) f" |
|
| 14516 | 699 |
by (import real SUM_CMUL) |
700 |
||
| 17644 | 701 |
lemma SUM_NEG: "ALL (f::nat => real) (n::nat) d::nat. |
702 |
real.sum (n, d) (%n::nat. - f n) = - real.sum (n, d) f" |
|
| 14516 | 703 |
by (import real SUM_NEG) |
704 |
||
| 17644 | 705 |
lemma SUM_SUB: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat. |
706 |
real.sum (m, n) (%x::nat. f x - g x) = |
|
707 |
real.sum (m, n) f - real.sum (m, n) g" |
|
| 14516 | 708 |
by (import real SUM_SUB) |
709 |
||
| 17644 | 710 |
lemma SUM_SUBST: "ALL (f::nat => real) (g::nat => real) (m::nat) n::nat. |
711 |
(ALL p::nat. m <= p & p < m + n --> f p = g p) --> |
|
| 14516 | 712 |
real.sum (m, n) f = real.sum (m, n) g" |
713 |
by (import real SUM_SUBST) |
|
714 |
||
| 17644 | 715 |
lemma SUM_NSUB: "ALL (n::nat) (f::nat => real) c::real. |
| 17652 | 716 |
real.sum (0, n) f - real n * c = real.sum (0, n) (%p::nat. f p - c)" |
| 14516 | 717 |
by (import real SUM_NSUB) |
718 |
||
| 17644 | 719 |
lemma SUM_BOUND: "ALL (f::nat => real) (k::real) (m::nat) n::nat. |
720 |
(ALL p::nat. m <= p & p < m + n --> f p <= k) --> |
|
| 14516 | 721 |
real.sum (m, n) f <= real n * k" |
722 |
by (import real SUM_BOUND) |
|
723 |
||
| 17644 | 724 |
lemma SUM_GROUP: "ALL (n::nat) (k::nat) f::nat => real. |
| 17652 | 725 |
real.sum (0, n) (%m::nat. real.sum (m * k, k) f) = real.sum (0, n * k) f" |
| 14516 | 726 |
by (import real SUM_GROUP) |
727 |
||
| 17652 | 728 |
lemma SUM_1: "ALL (f::nat => real) n::nat. real.sum (n, 1) f = f n" |
| 14516 | 729 |
by (import real SUM_1) |
730 |
||
| 17652 | 731 |
lemma SUM_2: "ALL (f::nat => real) n::nat. real.sum (n, 2) f = f n + f (n + 1)" |
| 14516 | 732 |
by (import real SUM_2) |
733 |
||
| 17644 | 734 |
lemma SUM_OFFSET: "ALL (f::nat => real) (n::nat) k::nat. |
| 17652 | 735 |
real.sum (0, n) (%m::nat. f (m + k)) = |
736 |
real.sum (0, n + k) f - real.sum (0, k) f" |
|
| 14516 | 737 |
by (import real SUM_OFFSET) |
738 |
||
| 17644 | 739 |
lemma SUM_REINDEX: "ALL (f::nat => real) (m::nat) (k::nat) n::nat. |
740 |
real.sum (m + k, n) f = real.sum (m, n) (%r::nat. f (r + k))" |
|
| 14516 | 741 |
by (import real SUM_REINDEX) |
742 |
||
| 17652 | 743 |
lemma SUM_0: "ALL (m::nat) n::nat. real.sum (m, n) (%r::nat. 0) = 0" |
| 14516 | 744 |
by (import real SUM_0) |
745 |
||
| 14847 | 746 |
lemma SUM_PERMUTE_0: "(All::(nat => bool) => bool) |
747 |
(%n::nat. |
|
748 |
(All::((nat => nat) => bool) => bool) |
|
749 |
(%p::nat => nat. |
|
750 |
(op -->::bool => bool => bool) |
|
751 |
((All::(nat => bool) => bool) |
|
752 |
(%y::nat. |
|
753 |
(op -->::bool => bool => bool) |
|
754 |
((op <::nat => nat => bool) y n) |
|
755 |
((Ex1::(nat => bool) => bool) |
|
756 |
(%x::nat. |
|
757 |
(op &::bool => bool => bool) |
|
758 |
((op <::nat => nat => bool) x n) |
|
759 |
((op =::nat => nat => bool) (p x) y))))) |
|
760 |
((All::((nat => real) => bool) => bool) |
|
761 |
(%f::nat => real. |
|
762 |
(op =::real => real => bool) |
|
763 |
((real.sum::nat * nat => (nat => real) => real) |
|
764 |
((Pair::nat => nat => nat * nat) (0::nat) n) |
|
765 |
(%n::nat. f (p n))) |
|
766 |
((real.sum::nat * nat => (nat => real) => real) |
|
767 |
((Pair::nat => nat => nat * nat) (0::nat) n) f)))))" |
|
| 14516 | 768 |
by (import real SUM_PERMUTE_0) |
769 |
||
| 17644 | 770 |
lemma SUM_CANCEL: "ALL (f::nat => real) (n::nat) d::nat. |
771 |
real.sum (n, d) (%n::nat. f (Suc n) - f n) = f (n + d) - f n" |
|
| 14516 | 772 |
by (import real SUM_CANCEL) |
773 |
||
| 17652 | 774 |
lemma REAL_EQ_RDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x = xa / xb) = (x * xb = xa)" |
| 14516 | 775 |
by (import real REAL_EQ_RDIV_EQ) |
776 |
||
| 17652 | 777 |
lemma REAL_EQ_LDIV_EQ: "ALL (x::real) (xa::real) xb::real. 0 < xb --> (x / xb = xa) = (x = xa * xb)" |
| 14516 | 778 |
by (import real REAL_EQ_LDIV_EQ) |
779 |
||
780 |
;end_setup |
|
781 |
||
782 |
;setup_theory topology |
|
783 |
||
784 |
constdefs |
|
| 17652 | 785 |
re_Union :: "(('a => bool) => bool) => 'a => bool"
|
| 17644 | 786 |
"re_Union == |
787 |
%(P::('a::type => bool) => bool) x::'a::type.
|
|
788 |
EX s::'a::type => bool. P s & s x" |
|
789 |
||
790 |
lemma re_Union: "ALL P::('a::type => bool) => bool.
|
|
791 |
re_Union P = (%x::'a::type. EX s::'a::type => bool. P s & s x)" |
|
| 14516 | 792 |
by (import topology re_Union) |
793 |
||
794 |
constdefs |
|
| 17652 | 795 |
re_union :: "('a => bool) => ('a => bool) => 'a => bool"
|
| 17644 | 796 |
"re_union == |
797 |
%(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x | Q x" |
|
798 |
||
799 |
lemma re_union: "ALL (P::'a::type => bool) Q::'a::type => bool. |
|
800 |
re_union P Q = (%x::'a::type. P x | Q x)" |
|
| 14516 | 801 |
by (import topology re_union) |
802 |
||
803 |
constdefs |
|
| 17652 | 804 |
re_intersect :: "('a => bool) => ('a => bool) => 'a => bool"
|
| 17644 | 805 |
"re_intersect == |
806 |
%(P::'a::type => bool) (Q::'a::type => bool) x::'a::type. P x & Q x" |
|
807 |
||
808 |
lemma re_intersect: "ALL (P::'a::type => bool) Q::'a::type => bool. |
|
809 |
re_intersect P Q = (%x::'a::type. P x & Q x)" |
|
| 14516 | 810 |
by (import topology re_intersect) |
811 |
||
812 |
constdefs |
|
| 17652 | 813 |
re_null :: "'a => bool" |
| 17644 | 814 |
"re_null == %x::'a::type. False" |
815 |
||
816 |
lemma re_null: "re_null = (%x::'a::type. False)" |
|
| 14516 | 817 |
by (import topology re_null) |
818 |
||
819 |
constdefs |
|
| 17652 | 820 |
re_universe :: "'a => bool" |
| 17644 | 821 |
"re_universe == %x::'a::type. True" |
822 |
||
823 |
lemma re_universe: "re_universe = (%x::'a::type. True)" |
|
| 14516 | 824 |
by (import topology re_universe) |
825 |
||
826 |
constdefs |
|
| 17652 | 827 |
re_subset :: "('a => bool) => ('a => bool) => bool"
|
| 17644 | 828 |
"re_subset == |
829 |
%(P::'a::type => bool) Q::'a::type => bool. ALL x::'a::type. P x --> Q x" |
|
830 |
||
831 |
lemma re_subset: "ALL (P::'a::type => bool) Q::'a::type => bool. |
|
832 |
re_subset P Q = (ALL x::'a::type. P x --> Q x)" |
|
| 14516 | 833 |
by (import topology re_subset) |
834 |
||
835 |
constdefs |
|
| 17652 | 836 |
re_compl :: "('a => bool) => 'a => bool"
|
| 17644 | 837 |
"re_compl == %(P::'a::type => bool) x::'a::type. ~ P x" |
838 |
||
839 |
lemma re_compl: "ALL P::'a::type => bool. re_compl P = (%x::'a::type. ~ P x)" |
|
| 14516 | 840 |
by (import topology re_compl) |
841 |
||
| 17644 | 842 |
lemma SUBSET_REFL: "ALL P::'a::type => bool. re_subset P P" |
| 14516 | 843 |
by (import topology SUBSET_REFL) |
844 |
||
| 17644 | 845 |
lemma COMPL_MEM: "ALL (P::'a::type => bool) x::'a::type. P x = (~ re_compl P x)" |
| 14516 | 846 |
by (import topology COMPL_MEM) |
847 |
||
| 17644 | 848 |
lemma SUBSET_ANTISYM: "ALL (P::'a::type => bool) Q::'a::type => bool. |
849 |
(re_subset P Q & re_subset Q P) = (P = Q)" |
|
| 14516 | 850 |
by (import topology SUBSET_ANTISYM) |
851 |
||
| 17644 | 852 |
lemma SUBSET_TRANS: "ALL (P::'a::type => bool) (Q::'a::type => bool) R::'a::type => bool. |
853 |
re_subset P Q & re_subset Q R --> re_subset P R" |
|
| 14516 | 854 |
by (import topology SUBSET_TRANS) |
855 |
||
856 |
constdefs |
|
| 17652 | 857 |
istopology :: "(('a => bool) => bool) => bool"
|
| 14516 | 858 |
"istopology == |
| 17644 | 859 |
%L::('a::type => bool) => bool.
|
860 |
L re_null & |
|
861 |
L re_universe & |
|
862 |
(ALL (a::'a::type => bool) b::'a::type => bool. |
|
863 |
L a & L b --> L (re_intersect a b)) & |
|
864 |
(ALL P::('a::type => bool) => bool. re_subset P L --> L (re_Union P))"
|
|
865 |
||
866 |
lemma istopology: "ALL L::('a::type => bool) => bool.
|
|
| 14516 | 867 |
istopology L = |
868 |
(L re_null & |
|
869 |
L re_universe & |
|
| 17644 | 870 |
(ALL (a::'a::type => bool) b::'a::type => bool. |
871 |
L a & L b --> L (re_intersect a b)) & |
|
872 |
(ALL P::('a::type => bool) => bool. re_subset P L --> L (re_Union P)))"
|
|
| 14516 | 873 |
by (import topology istopology) |
874 |
||
| 17644 | 875 |
typedef (open) ('a) topology = "(Collect::((('a::type => bool) => bool) => bool)
|
876 |
=> (('a::type => bool) => bool) set)
|
|
877 |
(istopology::(('a::type => bool) => bool) => bool)"
|
|
| 14516 | 878 |
by (rule typedef_helper,import topology topology_TY_DEF) |
879 |
||
880 |
lemmas topology_TY_DEF = typedef_hol2hol4 [OF type_definition_topology] |
|
881 |
||
882 |
consts |
|
| 17652 | 883 |
topology :: "(('a => bool) => bool) => 'a topology"
|
884 |
"open" :: "'a topology => ('a => bool) => bool"
|
|
| 17644 | 885 |
|
886 |
specification ("open" topology) topology_tybij: "(ALL a::'a::type topology. topology (open a) = a) &
|
|
887 |
(ALL r::('a::type => bool) => bool. istopology r = (open (topology r) = r))"
|
|
| 14516 | 888 |
by (import topology topology_tybij) |
889 |
||
| 17644 | 890 |
lemma TOPOLOGY: "ALL L::'a::type topology. |
| 14516 | 891 |
open L re_null & |
892 |
open L re_universe & |
|
| 17644 | 893 |
(ALL (a::'a::type => bool) b::'a::type => bool. |
894 |
open L a & open L b --> open L (re_intersect a b)) & |
|
895 |
(ALL P::('a::type => bool) => bool.
|
|
896 |
re_subset P (open L) --> open L (re_Union P))" |
|
| 14516 | 897 |
by (import topology TOPOLOGY) |
898 |
||
| 17644 | 899 |
lemma TOPOLOGY_UNION: "ALL (x::'a::type topology) xa::('a::type => bool) => bool.
|
900 |
re_subset xa (open x) --> open x (re_Union xa)" |
|
| 14516 | 901 |
by (import topology TOPOLOGY_UNION) |
902 |
||
903 |
constdefs |
|
| 17652 | 904 |
neigh :: "'a topology => ('a => bool) * 'a => bool"
|
| 17644 | 905 |
"neigh == |
906 |
%(top::'a::type topology) (N::'a::type => bool, x::'a::type). |
|
907 |
EX P::'a::type => bool. open top P & re_subset P N & P x" |
|
908 |
||
909 |
lemma neigh: "ALL (top::'a::type topology) (N::'a::type => bool) x::'a::type. |
|
910 |
neigh top (N, x) = |
|
911 |
(EX P::'a::type => bool. open top P & re_subset P N & P x)" |
|
| 14516 | 912 |
by (import topology neigh) |
913 |
||
| 17644 | 914 |
lemma OPEN_OWN_NEIGH: "ALL (S'::'a::type => bool) (top::'a::type topology) x::'a::type. |
915 |
open top S' & S' x --> neigh top (S', x)" |
|
| 14516 | 916 |
by (import topology OPEN_OWN_NEIGH) |
917 |
||
| 17644 | 918 |
lemma OPEN_UNOPEN: "ALL (S'::'a::type => bool) top::'a::type topology. |
919 |
open top S' = |
|
920 |
(re_Union (%P::'a::type => bool. open top P & re_subset P S') = S')" |
|
| 14516 | 921 |
by (import topology OPEN_UNOPEN) |
922 |
||
| 17644 | 923 |
lemma OPEN_SUBOPEN: "ALL (S'::'a::type => bool) top::'a::type topology. |
924 |
open top S' = |
|
925 |
(ALL x::'a::type. |
|
926 |
S' x --> (EX P::'a::type => bool. P x & open top P & re_subset P S'))" |
|
| 14516 | 927 |
by (import topology OPEN_SUBOPEN) |
928 |
||
| 17644 | 929 |
lemma OPEN_NEIGH: "ALL (S'::'a::type => bool) top::'a::type topology. |
930 |
open top S' = |
|
931 |
(ALL x::'a::type. |
|
932 |
S' x --> (EX N::'a::type => bool. neigh top (N, x) & re_subset N S'))" |
|
| 14516 | 933 |
by (import topology OPEN_NEIGH) |
934 |
||
935 |
constdefs |
|
| 17652 | 936 |
closed :: "'a topology => ('a => bool) => bool"
|
| 17644 | 937 |
"closed == %(L::'a::type topology) S'::'a::type => bool. open L (re_compl S')" |
938 |
||
939 |
lemma closed: "ALL (L::'a::type topology) S'::'a::type => bool. |
|
940 |
closed L S' = open L (re_compl S')" |
|
| 14516 | 941 |
by (import topology closed) |
942 |
||
943 |
constdefs |
|
| 17652 | 944 |
limpt :: "'a topology => 'a => ('a => bool) => bool"
|
| 17644 | 945 |
"limpt == |
946 |
%(top::'a::type topology) (x::'a::type) S'::'a::type => bool. |
|
947 |
ALL N::'a::type => bool. |
|
948 |
neigh top (N, x) --> (EX y::'a::type. x ~= y & S' y & N y)" |
|
949 |
||
950 |
lemma limpt: "ALL (top::'a::type topology) (x::'a::type) S'::'a::type => bool. |
|
| 14516 | 951 |
limpt top x S' = |
| 17644 | 952 |
(ALL N::'a::type => bool. |
953 |
neigh top (N, x) --> (EX y::'a::type. x ~= y & S' y & N y))" |
|
| 14516 | 954 |
by (import topology limpt) |
955 |
||
| 17644 | 956 |
lemma CLOSED_LIMPT: "ALL (top::'a::type topology) S'::'a::type => bool. |
957 |
closed top S' = (ALL x::'a::type. limpt top x S' --> S' x)" |
|
| 14516 | 958 |
by (import topology CLOSED_LIMPT) |
959 |
||
960 |
constdefs |
|
| 17652 | 961 |
ismet :: "('a * 'a => real) => bool"
|
| 14516 | 962 |
"ismet == |
| 17644 | 963 |
%m::'a::type * 'a::type => real. |
| 17652 | 964 |
(ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) & |
| 17644 | 965 |
(ALL (x::'a::type) (y::'a::type) z::'a::type. |
966 |
m (y, z) <= m (x, y) + m (x, z))" |
|
967 |
||
968 |
lemma ismet: "ALL m::'a::type * 'a::type => real. |
|
| 14516 | 969 |
ismet m = |
| 17652 | 970 |
((ALL (x::'a::type) y::'a::type. (m (x, y) = 0) = (x = y)) & |
| 17644 | 971 |
(ALL (x::'a::type) (y::'a::type) z::'a::type. |
972 |
m (y, z) <= m (x, y) + m (x, z)))" |
|
| 14516 | 973 |
by (import topology ismet) |
974 |
||
| 17644 | 975 |
typedef (open) ('a) metric = "(Collect::(('a::type * 'a::type => real) => bool)
|
976 |
=> ('a::type * 'a::type => real) set)
|
|
977 |
(ismet::('a::type * 'a::type => real) => bool)"
|
|
| 14516 | 978 |
by (rule typedef_helper,import topology metric_TY_DEF) |
979 |
||
980 |
lemmas metric_TY_DEF = typedef_hol2hol4 [OF type_definition_metric] |
|
981 |
||
982 |
consts |
|
| 17652 | 983 |
metric :: "('a * 'a => real) => 'a metric"
|
984 |
dist :: "'a metric => 'a * 'a => real" |
|
| 17644 | 985 |
|
986 |
specification (dist metric) metric_tybij: "(ALL a::'a::type metric. metric (dist a) = a) & |
|
987 |
(ALL r::'a::type * 'a::type => real. ismet r = (dist (metric r) = r))" |
|
| 14516 | 988 |
by (import topology metric_tybij) |
989 |
||
| 17644 | 990 |
lemma METRIC_ISMET: "ALL m::'a::type metric. ismet (dist m)" |
| 14516 | 991 |
by (import topology METRIC_ISMET) |
992 |
||
| 17644 | 993 |
lemma METRIC_ZERO: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. |
| 17652 | 994 |
(dist m (x, y) = 0) = (x = y)" |
| 14516 | 995 |
by (import topology METRIC_ZERO) |
996 |
||
| 17652 | 997 |
lemma METRIC_SAME: "ALL (m::'a::type metric) x::'a::type. dist m (x, x) = 0" |
| 14516 | 998 |
by (import topology METRIC_SAME) |
999 |
||
| 17652 | 1000 |
lemma METRIC_POS: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. 0 <= dist m (x, y)" |
| 14516 | 1001 |
by (import topology METRIC_POS) |
1002 |
||
| 17644 | 1003 |
lemma METRIC_SYM: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. |
1004 |
dist m (x, y) = dist m (y, x)" |
|
| 14516 | 1005 |
by (import topology METRIC_SYM) |
1006 |
||
| 17644 | 1007 |
lemma METRIC_TRIANGLE: "ALL (m::'a::type metric) (x::'a::type) (y::'a::type) z::'a::type. |
1008 |
dist m (x, z) <= dist m (x, y) + dist m (y, z)" |
|
| 14516 | 1009 |
by (import topology METRIC_TRIANGLE) |
1010 |
||
| 17644 | 1011 |
lemma METRIC_NZ: "ALL (m::'a::type metric) (x::'a::type) y::'a::type. |
| 17652 | 1012 |
x ~= y --> 0 < dist m (x, y)" |
| 14516 | 1013 |
by (import topology METRIC_NZ) |
1014 |
||
1015 |
constdefs |
|
| 17652 | 1016 |
mtop :: "'a metric => 'a topology" |
| 14516 | 1017 |
"mtop == |
| 17644 | 1018 |
%m::'a::type metric. |
1019 |
topology |
|
1020 |
(%S'::'a::type => bool. |
|
1021 |
ALL x::'a::type. |
|
| 17652 | 1022 |
S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))" |
| 17644 | 1023 |
|
1024 |
lemma mtop: "ALL m::'a::type metric. |
|
| 14516 | 1025 |
mtop m = |
1026 |
topology |
|
| 17644 | 1027 |
(%S'::'a::type => bool. |
1028 |
ALL x::'a::type. |
|
| 17652 | 1029 |
S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))" |
| 14516 | 1030 |
by (import topology mtop) |
1031 |
||
| 17644 | 1032 |
lemma mtop_istopology: "ALL m::'a::type metric. |
| 14516 | 1033 |
istopology |
| 17644 | 1034 |
(%S'::'a::type => bool. |
1035 |
ALL x::'a::type. |
|
| 17652 | 1036 |
S' x --> (EX e>0. ALL y::'a::type. dist m (x, y) < e --> S' y))" |
| 14516 | 1037 |
by (import topology mtop_istopology) |
1038 |
||
| 17644 | 1039 |
lemma MTOP_OPEN: "ALL (S'::'a::type => bool) x::'a::type metric. |
| 14516 | 1040 |
open (mtop x) S' = |
| 17644 | 1041 |
(ALL xa::'a::type. |
| 17652 | 1042 |
S' xa --> (EX e>0. ALL y::'a::type. dist x (xa, y) < e --> S' y))" |
| 14516 | 1043 |
by (import topology MTOP_OPEN) |
1044 |
||
1045 |
constdefs |
|
| 17652 | 1046 |
B :: "'a metric => 'a * real => 'a => bool" |
| 17644 | 1047 |
"B == |
1048 |
%(m::'a::type metric) (x::'a::type, e::real) y::'a::type. dist m (x, y) < e" |
|
1049 |
||
1050 |
lemma ball: "ALL (m::'a::type metric) (x::'a::type) e::real. |
|
1051 |
B m (x, e) = (%y::'a::type. dist m (x, y) < e)" |
|
| 14516 | 1052 |
by (import topology ball) |
1053 |
||
| 17644 | 1054 |
lemma BALL_OPEN: "ALL (m::'a::type metric) (x::'a::type) e::real. |
| 17652 | 1055 |
0 < e --> open (mtop m) (B m (x, e))" |
| 14516 | 1056 |
by (import topology BALL_OPEN) |
1057 |
||
| 17644 | 1058 |
lemma BALL_NEIGH: "ALL (m::'a::type metric) (x::'a::type) e::real. |
| 17652 | 1059 |
0 < e --> neigh (mtop m) (B m (x, e), x)" |
| 14516 | 1060 |
by (import topology BALL_NEIGH) |
1061 |
||
| 17644 | 1062 |
lemma MTOP_LIMPT: "ALL (m::'a::type metric) (x::'a::type) S'::'a::type => bool. |
1063 |
limpt (mtop m) x S' = |
|
| 17652 | 1064 |
(ALL e>0. EX y::'a::type. x ~= y & S' y & dist m (x, y) < e)" |
| 14516 | 1065 |
by (import topology MTOP_LIMPT) |
1066 |
||
| 17644 | 1067 |
lemma ISMET_R1: "ismet (%(x::real, y::real). abs (y - x))" |
| 14516 | 1068 |
by (import topology ISMET_R1) |
1069 |
||
1070 |
constdefs |
|
1071 |
mr1 :: "real metric" |
|
| 17644 | 1072 |
"mr1 == metric (%(x::real, y::real). abs (y - x))" |
1073 |
||
1074 |
lemma mr1: "mr1 = metric (%(x::real, y::real). abs (y - x))" |
|
| 14516 | 1075 |
by (import topology mr1) |
1076 |
||
| 17644 | 1077 |
lemma MR1_DEF: "ALL (x::real) y::real. dist mr1 (x, y) = abs (y - x)" |
| 14516 | 1078 |
by (import topology MR1_DEF) |
1079 |
||
| 17644 | 1080 |
lemma MR1_ADD: "ALL (x::real) d::real. dist mr1 (x, x + d) = abs d" |
| 14516 | 1081 |
by (import topology MR1_ADD) |
1082 |
||
| 17644 | 1083 |
lemma MR1_SUB: "ALL (x::real) d::real. dist mr1 (x, x - d) = abs d" |
| 14516 | 1084 |
by (import topology MR1_SUB) |
1085 |
||
| 17652 | 1086 |
lemma MR1_ADD_POS: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x + d) = d" |
| 14516 | 1087 |
by (import topology MR1_ADD_POS) |
1088 |
||
| 17652 | 1089 |
lemma MR1_SUB_LE: "ALL (x::real) d::real. 0 <= d --> dist mr1 (x, x - d) = d" |
| 14516 | 1090 |
by (import topology MR1_SUB_LE) |
1091 |
||
| 17652 | 1092 |
lemma MR1_ADD_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x + d) = d" |
| 14516 | 1093 |
by (import topology MR1_ADD_LT) |
1094 |
||
| 17652 | 1095 |
lemma MR1_SUB_LT: "ALL (x::real) d::real. 0 < d --> dist mr1 (x, x - d) = d" |
| 14516 | 1096 |
by (import topology MR1_SUB_LT) |
1097 |
||
| 17644 | 1098 |
lemma MR1_BETWEEN1: "ALL (x::real) (y::real) z::real. x < z & dist mr1 (x, y) < z - x --> y < z" |
| 14516 | 1099 |
by (import topology MR1_BETWEEN1) |
1100 |
||
| 17644 | 1101 |
lemma MR1_LIMPT: "ALL x::real. limpt (mtop mr1) x re_universe" |
| 14516 | 1102 |
by (import topology MR1_LIMPT) |
1103 |
||
1104 |
;end_setup |
|
1105 |
||
1106 |
;setup_theory nets |
|
1107 |
||
1108 |
constdefs |
|
| 17652 | 1109 |
dorder :: "('a => 'a => bool) => bool"
|
| 14516 | 1110 |
"dorder == |
| 17644 | 1111 |
%g::'a::type => 'a::type => bool. |
1112 |
ALL (x::'a::type) y::'a::type. |
|
1113 |
g x x & g y y --> |
|
1114 |
(EX z::'a::type. g z z & (ALL w::'a::type. g w z --> g w x & g w y))" |
|
1115 |
||
1116 |
lemma dorder: "ALL g::'a::type => 'a::type => bool. |
|
| 14516 | 1117 |
dorder g = |
| 17644 | 1118 |
(ALL (x::'a::type) y::'a::type. |
1119 |
g x x & g y y --> |
|
1120 |
(EX z::'a::type. g z z & (ALL w::'a::type. g w z --> g w x & g w y)))" |
|
| 14516 | 1121 |
by (import nets dorder) |
1122 |
||
1123 |
constdefs |
|
| 17652 | 1124 |
tends :: "('b => 'a) => 'a => 'a topology * ('b => 'b => bool) => bool"
|
| 14516 | 1125 |
"tends == |
| 17644 | 1126 |
%(s::'b::type => 'a::type) (l::'a::type) (top::'a::type topology, |
1127 |
g::'b::type => 'b::type => bool). |
|
1128 |
ALL N::'a::type => bool. |
|
| 14516 | 1129 |
neigh top (N, l) --> |
| 17644 | 1130 |
(EX n::'b::type. g n n & (ALL m::'b::type. g m n --> N (s m)))" |
1131 |
||
1132 |
lemma tends: "ALL (s::'b::type => 'a::type) (l::'a::type) (top::'a::type topology) |
|
1133 |
g::'b::type => 'b::type => bool. |
|
| 14516 | 1134 |
tends s l (top, g) = |
| 17644 | 1135 |
(ALL N::'a::type => bool. |
| 14516 | 1136 |
neigh top (N, l) --> |
| 17644 | 1137 |
(EX n::'b::type. g n n & (ALL m::'b::type. g m n --> N (s m))))" |
| 14516 | 1138 |
by (import nets tends) |
1139 |
||
1140 |
constdefs |
|
| 17652 | 1141 |
bounded :: "'a metric * ('b => 'b => bool) => ('b => 'a) => bool"
|
| 14516 | 1142 |
"bounded == |
| 17644 | 1143 |
%(m::'a::type metric, g::'b::type => 'b::type => bool) |
1144 |
f::'b::type => 'a::type. |
|
1145 |
EX (k::real) (x::'a::type) N::'b::type. |
|
1146 |
g N N & (ALL n::'b::type. g n N --> dist m (f n, x) < k)" |
|
1147 |
||
1148 |
lemma bounded: "ALL (m::'a::type metric) (g::'b::type => 'b::type => bool) |
|
1149 |
f::'b::type => 'a::type. |
|
| 14516 | 1150 |
bounded (m, g) f = |
| 17644 | 1151 |
(EX (k::real) (x::'a::type) N::'b::type. |
1152 |
g N N & (ALL n::'b::type. g n N --> dist m (f n, x) < k))" |
|
| 14516 | 1153 |
by (import nets bounded) |
1154 |
||
1155 |
constdefs |
|
| 17652 | 1156 |
tendsto :: "'a metric * 'a => 'a => 'a => bool" |
| 17644 | 1157 |
"tendsto == |
1158 |
%(m::'a::type metric, x::'a::type) (y::'a::type) z::'a::type. |
|
| 17652 | 1159 |
0 < dist m (x, y) & dist m (x, y) <= dist m (x, z)" |
| 17644 | 1160 |
|
1161 |
lemma tendsto: "ALL (m::'a::type metric) (x::'a::type) (y::'a::type) z::'a::type. |
|
| 17652 | 1162 |
tendsto (m, x) y z = (0 < dist m (x, y) & dist m (x, y) <= dist m (x, z))" |
| 14516 | 1163 |
by (import nets tendsto) |
1164 |
||
| 17644 | 1165 |
lemma DORDER_LEMMA: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1166 |
dorder g --> |
| 17644 | 1167 |
(ALL (P::'a::type => bool) Q::'a::type => bool. |
1168 |
(EX n::'a::type. g n n & (ALL m::'a::type. g m n --> P m)) & |
|
1169 |
(EX n::'a::type. g n n & (ALL m::'a::type. g m n --> Q m)) --> |
|
1170 |
(EX n::'a::type. g n n & (ALL m::'a::type. g m n --> P m & Q m)))" |
|
| 14516 | 1171 |
by (import nets DORDER_LEMMA) |
1172 |
||
1173 |
lemma DORDER_NGE: "dorder nat_ge" |
|
1174 |
by (import nets DORDER_NGE) |
|
1175 |
||
| 17644 | 1176 |
lemma DORDER_TENDSTO: "ALL (m::'a::type metric) x::'a::type. dorder (tendsto (m, x))" |
| 14516 | 1177 |
by (import nets DORDER_TENDSTO) |
1178 |
||
| 17644 | 1179 |
lemma MTOP_TENDS: "ALL (d::'a::type metric) (g::'b::type => 'b::type => bool) |
1180 |
(x::'b::type => 'a::type) x0::'a::type. |
|
| 14516 | 1181 |
tends x x0 (mtop d, g) = |
| 17652 | 1182 |
(ALL e>0. |
| 17644 | 1183 |
EX n::'b::type. |
1184 |
g n n & (ALL m::'b::type. g m n --> dist d (x m, x0) < e))" |
|
| 14516 | 1185 |
by (import nets MTOP_TENDS) |
1186 |
||
| 17644 | 1187 |
lemma MTOP_TENDS_UNIQ: "ALL (g::'b::type => 'b::type => bool) d::'a::type metric. |
| 14516 | 1188 |
dorder g --> |
| 17644 | 1189 |
tends (x::'b::type => 'a::type) (x0::'a::type) (mtop d, g) & |
1190 |
tends x (x1::'a::type) (mtop d, g) --> |
|
| 14516 | 1191 |
x0 = x1" |
1192 |
by (import nets MTOP_TENDS_UNIQ) |
|
1193 |
||
| 17644 | 1194 |
lemma SEQ_TENDS: "ALL (d::'a::type metric) (x::nat => 'a::type) x0::'a::type. |
| 14516 | 1195 |
tends x x0 (mtop d, nat_ge) = |
| 17652 | 1196 |
(ALL xa>0. EX xb::nat. ALL xc::nat. xb <= xc --> dist d (x xc, x0) < xa)" |
| 14516 | 1197 |
by (import nets SEQ_TENDS) |
1198 |
||
| 17644 | 1199 |
lemma LIM_TENDS: "ALL (m1::'a::type metric) (m2::'b::type metric) (f::'a::type => 'b::type) |
1200 |
(x0::'a::type) y0::'b::type. |
|
| 14516 | 1201 |
limpt (mtop m1) x0 re_universe --> |
1202 |
tends f y0 (mtop m2, tendsto (m1, x0)) = |
|
| 17652 | 1203 |
(ALL e>0. |
1204 |
EX d>0. |
|
| 17644 | 1205 |
ALL x::'a::type. |
| 17652 | 1206 |
0 < dist m1 (x, x0) & dist m1 (x, x0) <= d --> |
| 15647 | 1207 |
dist m2 (f x, y0) < e)" |
| 14516 | 1208 |
by (import nets LIM_TENDS) |
1209 |
||
| 17644 | 1210 |
lemma LIM_TENDS2: "ALL (m1::'a::type metric) (m2::'b::type metric) (f::'a::type => 'b::type) |
1211 |
(x0::'a::type) y0::'b::type. |
|
| 14516 | 1212 |
limpt (mtop m1) x0 re_universe --> |
1213 |
tends f y0 (mtop m2, tendsto (m1, x0)) = |
|
| 17652 | 1214 |
(ALL e>0. |
1215 |
EX d>0. |
|
| 17644 | 1216 |
ALL x::'a::type. |
| 17652 | 1217 |
0 < dist m1 (x, x0) & dist m1 (x, x0) < d --> |
| 15647 | 1218 |
dist m2 (f x, y0) < e)" |
| 14516 | 1219 |
by (import nets LIM_TENDS2) |
1220 |
||
| 17644 | 1221 |
lemma MR1_BOUNDED: "ALL (g::'a::type => 'a::type => bool) f::'a::type => real. |
1222 |
bounded (mr1, g) f = |
|
1223 |
(EX (k::real) N::'a::type. |
|
1224 |
g N N & (ALL n::'a::type. g n N --> abs (f n) < k))" |
|
| 14516 | 1225 |
by (import nets MR1_BOUNDED) |
1226 |
||
| 17644 | 1227 |
lemma NET_NULL: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real. |
| 17652 | 1228 |
tends x x0 (mtop mr1, g) = tends (%n::'a::type. x n - x0) 0 (mtop mr1, g)" |
| 14516 | 1229 |
by (import nets NET_NULL) |
1230 |
||
| 17644 | 1231 |
lemma NET_CONV_BOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real. |
1232 |
tends x x0 (mtop mr1, g) --> bounded (mr1, g) x" |
|
| 14516 | 1233 |
by (import nets NET_CONV_BOUNDED) |
1234 |
||
| 17644 | 1235 |
lemma NET_CONV_NZ: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real. |
| 17652 | 1236 |
tends x x0 (mtop mr1, g) & x0 ~= 0 --> |
1237 |
(EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n ~= 0))" |
|
| 14516 | 1238 |
by (import nets NET_CONV_NZ) |
1239 |
||
| 17644 | 1240 |
lemma NET_CONV_IBOUNDED: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real. |
| 17652 | 1241 |
tends x x0 (mtop mr1, g) & x0 ~= 0 --> |
| 17644 | 1242 |
bounded (mr1, g) (%n::'a::type. inverse (x n))" |
| 14516 | 1243 |
by (import nets NET_CONV_IBOUNDED) |
1244 |
||
| 17644 | 1245 |
lemma NET_NULL_ADD: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1246 |
dorder g --> |
| 17644 | 1247 |
(ALL (x::'a::type => real) y::'a::type => real. |
| 17652 | 1248 |
tends x 0 (mtop mr1, g) & tends y 0 (mtop mr1, g) --> |
1249 |
tends (%n::'a::type. x n + y n) 0 (mtop mr1, g))" |
|
| 14516 | 1250 |
by (import nets NET_NULL_ADD) |
1251 |
||
| 17644 | 1252 |
lemma NET_NULL_MUL: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1253 |
dorder g --> |
| 17644 | 1254 |
(ALL (x::'a::type => real) y::'a::type => real. |
| 17652 | 1255 |
bounded (mr1, g) x & tends y 0 (mtop mr1, g) --> |
1256 |
tends (%n::'a::type. x n * y n) 0 (mtop mr1, g))" |
|
| 14516 | 1257 |
by (import nets NET_NULL_MUL) |
1258 |
||
| 17644 | 1259 |
lemma NET_NULL_CMUL: "ALL (g::'a::type => 'a::type => bool) (k::real) x::'a::type => real. |
| 17652 | 1260 |
tends x 0 (mtop mr1, g) --> tends (%n::'a::type. k * x n) 0 (mtop mr1, g)" |
| 14516 | 1261 |
by (import nets NET_NULL_CMUL) |
1262 |
||
| 17644 | 1263 |
lemma NET_ADD: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1264 |
dorder g --> |
| 17644 | 1265 |
(ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real. |
| 14516 | 1266 |
tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) --> |
| 17644 | 1267 |
tends (%n::'a::type. x n + y n) (x0 + y0) (mtop mr1, g))" |
| 14516 | 1268 |
by (import nets NET_ADD) |
1269 |
||
| 17644 | 1270 |
lemma NET_NEG: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1271 |
dorder g --> |
| 17644 | 1272 |
(ALL (x::'a::type => real) x0::real. |
1273 |
tends x x0 (mtop mr1, g) = |
|
1274 |
tends (%n::'a::type. - x n) (- x0) (mtop mr1, g))" |
|
| 14516 | 1275 |
by (import nets NET_NEG) |
1276 |
||
| 17644 | 1277 |
lemma NET_SUB: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1278 |
dorder g --> |
| 17644 | 1279 |
(ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real. |
| 14516 | 1280 |
tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) --> |
| 17644 | 1281 |
tends (%xa::'a::type. x xa - y xa) (x0 - y0) (mtop mr1, g))" |
| 14516 | 1282 |
by (import nets NET_SUB) |
1283 |
||
| 17644 | 1284 |
lemma NET_MUL: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1285 |
dorder g --> |
| 17644 | 1286 |
(ALL (x::'a::type => real) (y::'a::type => real) (x0::real) y0::real. |
| 14516 | 1287 |
tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) --> |
| 17644 | 1288 |
tends (%n::'a::type. x n * y n) (x0 * y0) (mtop mr1, g))" |
| 14516 | 1289 |
by (import nets NET_MUL) |
1290 |
||
| 17644 | 1291 |
lemma NET_INV: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1292 |
dorder g --> |
| 17644 | 1293 |
(ALL (x::'a::type => real) x0::real. |
| 17652 | 1294 |
tends x x0 (mtop mr1, g) & x0 ~= 0 --> |
| 17644 | 1295 |
tends (%n::'a::type. inverse (x n)) (inverse x0) (mtop mr1, g))" |
| 14516 | 1296 |
by (import nets NET_INV) |
1297 |
||
| 17644 | 1298 |
lemma NET_DIV: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1299 |
dorder g --> |
| 17644 | 1300 |
(ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real. |
| 17652 | 1301 |
tends x x0 (mtop mr1, g) & tends y y0 (mtop mr1, g) & y0 ~= 0 --> |
| 17644 | 1302 |
tends (%xa::'a::type. x xa / y xa) (x0 / y0) (mtop mr1, g))" |
| 14516 | 1303 |
by (import nets NET_DIV) |
1304 |
||
| 17644 | 1305 |
lemma NET_ABS: "ALL (g::'a::type => 'a::type => bool) (x::'a::type => real) x0::real. |
1306 |
tends x x0 (mtop mr1, g) --> |
|
1307 |
tends (%n::'a::type. abs (x n)) (abs x0) (mtop mr1, g)" |
|
| 14516 | 1308 |
by (import nets NET_ABS) |
1309 |
||
| 17644 | 1310 |
lemma NET_LE: "ALL g::'a::type => 'a::type => bool. |
| 14516 | 1311 |
dorder g --> |
| 17644 | 1312 |
(ALL (x::'a::type => real) (x0::real) (y::'a::type => real) y0::real. |
| 14516 | 1313 |
tends x x0 (mtop mr1, g) & |
1314 |
tends y y0 (mtop mr1, g) & |
|
| 17644 | 1315 |
(EX N::'a::type. g N N & (ALL n::'a::type. g n N --> x n <= y n)) --> |
| 14516 | 1316 |
x0 <= y0)" |
1317 |
by (import nets NET_LE) |
|
1318 |
||
1319 |
;end_setup |
|
1320 |
||
1321 |
;setup_theory seq |
|
1322 |
||
| 14694 | 1323 |
consts |
| 17694 | 1324 |
"hol4-->" :: "(nat => real) => real => bool" ("hol4-->")
|
| 14694 | 1325 |
|
1326 |
defs |
|
| 17694 | 1327 |
"hol4-->_def": "hol4--> == %(x::nat => real) x0::real. tends x x0 (mtop mr1, nat_ge)" |
1328 |
||
1329 |
lemma tends_num_real: "ALL (x::nat => real) x0::real. hol4--> x x0 = tends x x0 (mtop mr1, nat_ge)" |
|
| 14516 | 1330 |
by (import seq tends_num_real) |
1331 |
||
| 17694 | 1332 |
lemma SEQ: "ALL (x::nat => real) x0::real. |
1333 |
hol4--> x x0 = |
|
1334 |
(ALL e>0. EX N::nat. ALL n::nat. N <= n --> abs (x n - x0) < e)" |
|
| 14516 | 1335 |
by (import seq SEQ) |
1336 |
||
| 17694 | 1337 |
lemma SEQ_CONST: "ALL k::real. hol4--> (%x::nat. k) k" |
| 14516 | 1338 |
by (import seq SEQ_CONST) |
1339 |
||
| 17694 | 1340 |
lemma SEQ_ADD: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1341 |
hol4--> x x0 & hol4--> y y0 --> hol4--> (%n::nat. x n + y n) (x0 + y0)" |
|
| 14516 | 1342 |
by (import seq SEQ_ADD) |
1343 |
||
| 17694 | 1344 |
lemma SEQ_MUL: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1345 |
hol4--> x x0 & hol4--> y y0 --> hol4--> (%n::nat. x n * y n) (x0 * y0)" |
|
| 14516 | 1346 |
by (import seq SEQ_MUL) |
1347 |
||
| 17694 | 1348 |
lemma SEQ_NEG: "ALL (x::nat => real) x0::real. |
1349 |
hol4--> x x0 = hol4--> (%n::nat. - x n) (- x0)" |
|
| 14516 | 1350 |
by (import seq SEQ_NEG) |
1351 |
||
| 17694 | 1352 |
lemma SEQ_INV: "ALL (x::nat => real) x0::real. |
1353 |
hol4--> x x0 & x0 ~= 0 --> hol4--> (%n::nat. inverse (x n)) (inverse x0)" |
|
| 14516 | 1354 |
by (import seq SEQ_INV) |
1355 |
||
| 17694 | 1356 |
lemma SEQ_SUB: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1357 |
hol4--> x x0 & hol4--> y y0 --> hol4--> (%n::nat. x n - y n) (x0 - y0)" |
|
| 14516 | 1358 |
by (import seq SEQ_SUB) |
1359 |
||
| 17694 | 1360 |
lemma SEQ_DIV: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1361 |
hol4--> x x0 & hol4--> y y0 & y0 ~= 0 --> |
|
1362 |
hol4--> (%n::nat. x n / y n) (x0 / y0)" |
|
| 14516 | 1363 |
by (import seq SEQ_DIV) |
1364 |
||
| 17694 | 1365 |
lemma SEQ_UNIQ: "ALL (x::nat => real) (x1::real) x2::real. |
1366 |
hol4--> x x1 & hol4--> x x2 --> x1 = x2" |
|
| 14516 | 1367 |
by (import seq SEQ_UNIQ) |
1368 |
||
1369 |
constdefs |
|
1370 |
convergent :: "(nat => real) => bool" |
|
| 17694 | 1371 |
"convergent == %f::nat => real. Ex (hol4--> f)" |
1372 |
||
1373 |
lemma convergent: "ALL f::nat => real. convergent f = Ex (hol4--> f)" |
|
| 14516 | 1374 |
by (import seq convergent) |
1375 |
||
1376 |
constdefs |
|
1377 |
cauchy :: "(nat => real) => bool" |
|
| 17694 | 1378 |
"cauchy == |
1379 |
%f::nat => real. |
|
1380 |
ALL e>0. |
|
1381 |
EX N::nat. |
|
1382 |
ALL (m::nat) n::nat. N <= m & N <= n --> abs (f m - f n) < e" |
|
1383 |
||
1384 |
lemma cauchy: "ALL f::nat => real. |
|
1385 |
cauchy f = |
|
1386 |
(ALL e>0. |
|
1387 |
EX N::nat. |
|
1388 |
ALL (m::nat) n::nat. N <= m & N <= n --> abs (f m - f n) < e)" |
|
| 14516 | 1389 |
by (import seq cauchy) |
1390 |
||
1391 |
constdefs |
|
1392 |
lim :: "(nat => real) => real" |
|
| 17694 | 1393 |
"lim == %f::nat => real. Eps (hol4--> f)" |
1394 |
||
1395 |
lemma lim: "ALL f::nat => real. lim f = Eps (hol4--> f)" |
|
| 14516 | 1396 |
by (import seq lim) |
1397 |
||
| 17694 | 1398 |
lemma SEQ_LIM: "ALL f::nat => real. convergent f = hol4--> f (lim f)" |
| 14516 | 1399 |
by (import seq SEQ_LIM) |
1400 |
||
1401 |
constdefs |
|
1402 |
subseq :: "(nat => nat) => bool" |
|
| 17694 | 1403 |
"subseq == %f::nat => nat. ALL (m::nat) n::nat. m < n --> f m < f n" |
1404 |
||
1405 |
lemma subseq: "ALL f::nat => nat. subseq f = (ALL (m::nat) n::nat. m < n --> f m < f n)" |
|
| 14516 | 1406 |
by (import seq subseq) |
1407 |
||
| 17644 | 1408 |
lemma SUBSEQ_SUC: "ALL f::nat => nat. subseq f = (ALL n::nat. f n < f (Suc n))" |
| 14516 | 1409 |
by (import seq SUBSEQ_SUC) |
1410 |
||
| 14694 | 1411 |
consts |
| 14516 | 1412 |
mono :: "(nat => real) => bool" |
| 14694 | 1413 |
|
1414 |
defs |
|
| 17694 | 1415 |
mono_def: "seq.mono == |
1416 |
%f::nat => real. |
|
1417 |
(ALL (m::nat) n::nat. m <= n --> f m <= f n) | |
|
1418 |
(ALL (m::nat) n::nat. m <= n --> f n <= f m)" |
|
1419 |
||
1420 |
lemma mono: "ALL f::nat => real. |
|
1421 |
seq.mono f = |
|
1422 |
((ALL (m::nat) n::nat. m <= n --> f m <= f n) | |
|
1423 |
(ALL (m::nat) n::nat. m <= n --> f n <= f m))" |
|
| 14516 | 1424 |
by (import seq mono) |
1425 |
||
| 17644 | 1426 |
lemma MONO_SUC: "ALL f::nat => real. |
1427 |
seq.mono f = |
|
1428 |
((ALL x::nat. f x <= f (Suc x)) | (ALL n::nat. f (Suc n) <= f n))" |
|
| 14516 | 1429 |
by (import seq MONO_SUC) |
1430 |
||
| 14847 | 1431 |
lemma MAX_LEMMA: "(All::((nat => real) => bool) => bool) |
1432 |
(%s::nat => real. |
|
1433 |
(All::(nat => bool) => bool) |
|
1434 |
(%N::nat. |
|
1435 |
(Ex::(real => bool) => bool) |
|
1436 |
(%k::real. |
|
1437 |
(All::(nat => bool) => bool) |
|
1438 |
(%n::nat. |
|
1439 |
(op -->::bool => bool => bool) |
|
1440 |
((op <::nat => nat => bool) n N) |
|
1441 |
((op <::real => real => bool) |
|
1442 |
((abs::real => real) (s n)) k)))))" |
|
| 14516 | 1443 |
by (import seq MAX_LEMMA) |
1444 |
||
| 17644 | 1445 |
lemma SEQ_BOUNDED: "ALL s::nat => real. |
1446 |
bounded (mr1, nat_ge) s = (EX k::real. ALL n::nat. abs (s n) < k)" |
|
| 14516 | 1447 |
by (import seq SEQ_BOUNDED) |
1448 |
||
| 17694 | 1449 |
lemma SEQ_BOUNDED_2: "ALL (f::nat => real) (k::real) k'::real. |
1450 |
(ALL n::nat. k <= f n & f n <= k') --> bounded (mr1, nat_ge) f" |
|
| 14516 | 1451 |
by (import seq SEQ_BOUNDED_2) |
1452 |
||
| 17694 | 1453 |
lemma SEQ_CBOUNDED: "ALL f::nat => real. cauchy f --> bounded (mr1, nat_ge) f" |
| 14516 | 1454 |
by (import seq SEQ_CBOUNDED) |
1455 |
||
| 17694 | 1456 |
lemma SEQ_ICONV: "ALL f::nat => real. |
1457 |
bounded (mr1, nat_ge) f & |
|
1458 |
(ALL (m::nat) n::nat. n <= m --> f n <= f m) --> |
|
1459 |
convergent f" |
|
| 14516 | 1460 |
by (import seq SEQ_ICONV) |
1461 |
||
| 17644 | 1462 |
lemma SEQ_NEG_CONV: "ALL f::nat => real. convergent f = convergent (%n::nat. - f n)" |
| 14516 | 1463 |
by (import seq SEQ_NEG_CONV) |
1464 |
||
| 17644 | 1465 |
lemma SEQ_NEG_BOUNDED: "ALL f::nat => real. |
1466 |
bounded (mr1, nat_ge) (%n::nat. - f n) = bounded (mr1, nat_ge) f" |
|
| 14516 | 1467 |
by (import seq SEQ_NEG_BOUNDED) |
1468 |
||
| 17694 | 1469 |
lemma SEQ_BCONV: "ALL f::nat => real. bounded (mr1, nat_ge) f & seq.mono f --> convergent f" |
| 14516 | 1470 |
by (import seq SEQ_BCONV) |
1471 |
||
| 17644 | 1472 |
lemma SEQ_MONOSUB: "ALL s::nat => real. EX f::nat => nat. subseq f & seq.mono (%n::nat. s (f n))" |
| 14516 | 1473 |
by (import seq SEQ_MONOSUB) |
1474 |
||
| 17694 | 1475 |
lemma SEQ_SBOUNDED: "ALL (s::nat => real) f::nat => nat. |
1476 |
bounded (mr1, nat_ge) s --> bounded (mr1, nat_ge) (%n::nat. s (f n))" |
|
| 14516 | 1477 |
by (import seq SEQ_SBOUNDED) |
1478 |
||
| 17694 | 1479 |
lemma SEQ_SUBLE: "ALL f::nat => nat. subseq f --> (ALL n::nat. n <= f n)" |
| 14516 | 1480 |
by (import seq SEQ_SUBLE) |
1481 |
||
| 17694 | 1482 |
lemma SEQ_DIRECT: "ALL f::nat => nat. |
1483 |
subseq f --> (ALL (N1::nat) N2::nat. EX x::nat. N1 <= x & N2 <= f x)" |
|
| 14516 | 1484 |
by (import seq SEQ_DIRECT) |
1485 |
||
| 17644 | 1486 |
lemma SEQ_CAUCHY: "ALL f::nat => real. cauchy f = convergent f" |
| 14516 | 1487 |
by (import seq SEQ_CAUCHY) |
1488 |
||
| 17694 | 1489 |
lemma SEQ_LE: "ALL (f::nat => real) (g::nat => real) (l::real) m::real. |
1490 |
hol4--> f l & |
|
1491 |
hol4--> g m & (EX x::nat. ALL xa::nat. x <= xa --> f xa <= g xa) --> |
|
1492 |
l <= m" |
|
| 14516 | 1493 |
by (import seq SEQ_LE) |
1494 |
||
| 17694 | 1495 |
lemma SEQ_SUC: "ALL (f::nat => real) l::real. hol4--> f l = hol4--> (%n::nat. f (Suc n)) l" |
| 14516 | 1496 |
by (import seq SEQ_SUC) |
1497 |
||
| 17694 | 1498 |
lemma SEQ_ABS: "ALL f::nat => real. hol4--> (%n::nat. abs (f n)) 0 = hol4--> f 0" |
| 14516 | 1499 |
by (import seq SEQ_ABS) |
1500 |
||
| 17694 | 1501 |
lemma SEQ_ABS_IMP: "ALL (f::nat => real) l::real. |
1502 |
hol4--> f l --> hol4--> (%n::nat. abs (f n)) (abs l)" |
|
| 14516 | 1503 |
by (import seq SEQ_ABS_IMP) |
1504 |
||
| 17694 | 1505 |
lemma SEQ_INV0: "ALL f::nat => real. |
1506 |
(ALL y::real. EX N::nat. ALL n::nat. N <= n --> y < f n) --> |
|
1507 |
hol4--> (%n::nat. inverse (f n)) 0" |
|
| 14516 | 1508 |
by (import seq SEQ_INV0) |
1509 |
||
| 17694 | 1510 |
lemma SEQ_POWER_ABS: "ALL c::real. abs c < 1 --> hol4--> (op ^ (abs c)) 0" |
| 14516 | 1511 |
by (import seq SEQ_POWER_ABS) |
1512 |
||
| 17694 | 1513 |
lemma SEQ_POWER: "ALL c::real. abs c < 1 --> hol4--> (op ^ c) 0" |
| 14516 | 1514 |
by (import seq SEQ_POWER) |
1515 |
||
| 17694 | 1516 |
lemma NEST_LEMMA: "ALL (f::nat => real) g::nat => real. |
1517 |
(ALL n::nat. f n <= f (Suc n)) & |
|
1518 |
(ALL n::nat. g (Suc n) <= g n) & (ALL n::nat. f n <= g n) --> |
|
1519 |
(EX (l::real) m::real. |
|
1520 |
l <= m & |
|
1521 |
((ALL n::nat. f n <= l) & hol4--> f l) & |
|
1522 |
(ALL n::nat. m <= g n) & hol4--> g m)" |
|
| 14516 | 1523 |
by (import seq NEST_LEMMA) |
1524 |
||
| 17694 | 1525 |
lemma NEST_LEMMA_UNIQ: "ALL (f::nat => real) g::nat => real. |
1526 |
(ALL n::nat. f n <= f (Suc n)) & |
|
1527 |
(ALL n::nat. g (Suc n) <= g n) & |
|
1528 |
(ALL n::nat. f n <= g n) & hol4--> (%n::nat. f n - g n) 0 --> |
|
1529 |
(EX x::real. |
|
1530 |
((ALL n::nat. f n <= x) & hol4--> f x) & |
|
1531 |
(ALL n::nat. x <= g n) & hol4--> g x)" |
|
| 14516 | 1532 |
by (import seq NEST_LEMMA_UNIQ) |
1533 |
||
| 17694 | 1534 |
lemma BOLZANO_LEMMA: "ALL P::real * real => bool. |
1535 |
(ALL (a::real) (b::real) c::real. |
|
1536 |
a <= b & b <= c & P (a, b) & P (b, c) --> P (a, c)) & |
|
1537 |
(ALL x::real. |
|
1538 |
EX d>0. |
|
1539 |
ALL (a::real) b::real. |
|
1540 |
a <= x & x <= b & b - a < d --> P (a, b)) --> |
|
1541 |
(ALL (a::real) b::real. a <= b --> P (a, b))" |
|
| 14516 | 1542 |
by (import seq BOLZANO_LEMMA) |
1543 |
||
1544 |
constdefs |
|
1545 |
sums :: "(nat => real) => real => bool" |
|
| 17694 | 1546 |
"sums == %f::nat => real. hol4--> (%n::nat. real.sum (0, n) f)" |
1547 |
||
1548 |
lemma sums: "ALL (f::nat => real) s::real. |
|
1549 |
sums f s = hol4--> (%n::nat. real.sum (0, n) f) s" |
|
| 14516 | 1550 |
by (import seq sums) |
1551 |
||
1552 |
constdefs |
|
1553 |
summable :: "(nat => real) => bool" |
|
| 17644 | 1554 |
"summable == %f::nat => real. Ex (sums f)" |
1555 |
||
1556 |
lemma summable: "ALL f::nat => real. summable f = Ex (sums f)" |
|
| 14516 | 1557 |
by (import seq summable) |
1558 |
||
1559 |
constdefs |
|
1560 |
suminf :: "(nat => real) => real" |
|
| 17644 | 1561 |
"suminf == %f::nat => real. Eps (sums f)" |
1562 |
||
1563 |
lemma suminf: "ALL f::nat => real. suminf f = Eps (sums f)" |
|
| 14516 | 1564 |
by (import seq suminf) |
1565 |
||
| 17694 | 1566 |
lemma SUM_SUMMABLE: "ALL (f::nat => real) l::real. sums f l --> summable f" |
| 14516 | 1567 |
by (import seq SUM_SUMMABLE) |
1568 |
||
| 17694 | 1569 |
lemma SUMMABLE_SUM: "ALL f::nat => real. summable f --> sums f (suminf f)" |
| 14516 | 1570 |
by (import seq SUMMABLE_SUM) |
1571 |
||
| 17694 | 1572 |
lemma SUM_UNIQ: "ALL (f::nat => real) x::real. sums f x --> x = suminf f" |
| 14516 | 1573 |
by (import seq SUM_UNIQ) |
1574 |
||
| 17694 | 1575 |
lemma SER_0: "ALL (f::nat => real) n::nat. |
1576 |
(ALL m::nat. n <= m --> f m = 0) --> sums f (real.sum (0, n) f)" |
|
| 14516 | 1577 |
by (import seq SER_0) |
1578 |
||
| 17694 | 1579 |
lemma SER_POS_LE: "ALL (f::nat => real) n::nat. |
1580 |
summable f & (ALL m::nat. n <= m --> 0 <= f m) --> |
|
1581 |
real.sum (0, n) f <= suminf f" |
|
| 14516 | 1582 |
by (import seq SER_POS_LE) |
1583 |
||
| 17694 | 1584 |
lemma SER_POS_LT: "ALL (f::nat => real) n::nat. |
1585 |
summable f & (ALL m::nat. n <= m --> 0 < f m) --> |
|
1586 |
real.sum (0, n) f < suminf f" |
|
| 14516 | 1587 |
by (import seq SER_POS_LT) |
1588 |
||
| 17694 | 1589 |
lemma SER_GROUP: "ALL (f::nat => real) k::nat. |
1590 |
summable f & 0 < k --> sums (%n::nat. real.sum (n * k, k) f) (suminf f)" |
|
| 14516 | 1591 |
by (import seq SER_GROUP) |
1592 |
||
| 17694 | 1593 |
lemma SER_PAIR: "ALL f::nat => real. |
1594 |
summable f --> sums (%n::nat. real.sum (2 * n, 2) f) (suminf f)" |
|
| 14516 | 1595 |
by (import seq SER_PAIR) |
1596 |
||
| 17694 | 1597 |
lemma SER_OFFSET: "ALL f::nat => real. |
1598 |
summable f --> |
|
1599 |
(ALL k::nat. sums (%n::nat. f (n + k)) (suminf f - real.sum (0, k) f))" |
|
| 14516 | 1600 |
by (import seq SER_OFFSET) |
1601 |
||
| 17694 | 1602 |
lemma SER_POS_LT_PAIR: "ALL (f::nat => real) n::nat. |
1603 |
summable f & (ALL d::nat. 0 < f (n + 2 * d) + f (n + (2 * d + 1))) --> |
|
1604 |
real.sum (0, n) f < suminf f" |
|
| 14516 | 1605 |
by (import seq SER_POS_LT_PAIR) |
1606 |
||
| 17694 | 1607 |
lemma SER_ADD: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1608 |
sums x x0 & sums y y0 --> sums (%n::nat. x n + y n) (x0 + y0)" |
|
| 14516 | 1609 |
by (import seq SER_ADD) |
1610 |
||
| 17694 | 1611 |
lemma SER_CMUL: "ALL (x::nat => real) (x0::real) c::real. |
1612 |
sums x x0 --> sums (%n::nat. c * x n) (c * x0)" |
|
| 14516 | 1613 |
by (import seq SER_CMUL) |
1614 |
||
| 17694 | 1615 |
lemma SER_NEG: "ALL (x::nat => real) x0::real. sums x x0 --> sums (%xa::nat. - x xa) (- x0)" |
| 14516 | 1616 |
by (import seq SER_NEG) |
1617 |
||
| 17694 | 1618 |
lemma SER_SUB: "ALL (x::nat => real) (x0::real) (y::nat => real) y0::real. |
1619 |
sums x x0 & sums y y0 --> sums (%xa::nat. x xa - y xa) (x0 - y0)" |
|
| 14516 | 1620 |
by (import seq SER_SUB) |
1621 |
||
| 17694 | 1622 |
lemma SER_CDIV: "ALL (x::nat => real) (x0::real) c::real. |
1623 |
sums x x0 --> sums (%xa::nat. x xa / c) (x0 / c)" |
|
| 14516 | 1624 |
by (import seq SER_CDIV) |
1625 |
||
| 17694 | 1626 |
lemma SER_CAUCHY: "ALL f::nat => real. |
1627 |
summable f = |
|
1628 |
(ALL e>0. |
|
1629 |
EX N::nat. |
|
1630 |
ALL (m::nat) n::nat. N <= m --> abs (real.sum (m, n) f) < e)" |
|
| 14516 | 1631 |
by (import seq SER_CAUCHY) |
1632 |
||
| 17694 | 1633 |
lemma SER_ZERO: "ALL f::nat => real. summable f --> hol4--> f 0" |
| 14516 | 1634 |
by (import seq SER_ZERO) |
1635 |
||
| 17694 | 1636 |
lemma SER_COMPAR: "ALL (f::nat => real) g::nat => real. |
1637 |
(EX x::nat. ALL xa::nat. x <= xa --> abs (f xa) <= g xa) & summable g --> |
|
1638 |
summable f" |
|
| 14516 | 1639 |
by (import seq SER_COMPAR) |
1640 |
||
| 17694 | 1641 |
lemma SER_COMPARA: "ALL (f::nat => real) g::nat => real. |
1642 |
(EX x::nat. ALL xa::nat. x <= xa --> abs (f xa) <= g xa) & summable g --> |
|
1643 |
summable (%k::nat. abs (f k))" |
|
| 14516 | 1644 |
by (import seq SER_COMPARA) |
1645 |
||
| 17694 | 1646 |
lemma SER_LE: "ALL (f::nat => real) g::nat => real. |
1647 |
(ALL n::nat. f n <= g n) & summable f & summable g --> |
|
1648 |
suminf f <= suminf g" |
|
| 14516 | 1649 |
by (import seq SER_LE) |
1650 |
||
| 17694 | 1651 |
lemma SER_LE2: "ALL (f::nat => real) g::nat => real. |
1652 |
(ALL n::nat. abs (f n) <= g n) & summable g --> |
|
1653 |
summable f & suminf f <= suminf g" |
|
| 14516 | 1654 |
by (import seq SER_LE2) |
1655 |
||
| 17694 | 1656 |
lemma SER_ACONV: "ALL f::nat => real. summable (%n::nat. abs (f n)) --> summable f" |
| 14516 | 1657 |
by (import seq SER_ACONV) |
1658 |
||
| 17694 | 1659 |
lemma SER_ABS: "ALL f::nat => real. |
1660 |
summable (%n::nat. abs (f n)) --> |
|
1661 |
abs (suminf f) <= suminf (%n::nat. abs (f n))" |
|
| 14516 | 1662 |
by (import seq SER_ABS) |
1663 |
||
| 17694 | 1664 |
lemma GP_FINITE: "ALL x::real. |
1665 |
x ~= 1 --> (ALL n::nat. real.sum (0, n) (op ^ x) = (x ^ n - 1) / (x - 1))" |
|
| 14516 | 1666 |
by (import seq GP_FINITE) |
1667 |
||
| 17694 | 1668 |
lemma GP: "ALL x::real. abs x < 1 --> sums (op ^ x) (inverse (1 - x))" |
| 14516 | 1669 |
by (import seq GP) |
1670 |
||
1671 |
lemma ABS_NEG_LEMMA: "(All::(real => bool) => bool) |
|
1672 |
(%c::real. |
|
1673 |
(op -->::bool => bool => bool) |
|
1674 |
((op <=::real => real => bool) c (0::real)) |
|
1675 |
((All::(real => bool) => bool) |
|
1676 |
(%x::real. |
|
1677 |
(All::(real => bool) => bool) |
|
1678 |
(%y::real. |
|
1679 |
(op -->::bool => bool => bool) |
|
1680 |
((op <=::real => real => bool) ((abs::real => real) x) |
|
1681 |
((op *::real => real => real) c |
|
1682 |
((abs::real => real) y))) |
|
1683 |
((op =::real => real => bool) x (0::real))))))" |
|
1684 |
by (import seq ABS_NEG_LEMMA) |
|
1685 |
||
| 17694 | 1686 |
lemma SER_RATIO: "ALL (f::nat => real) (c::real) N::nat. |
1687 |
c < 1 & (ALL n::nat. N <= n --> abs (f (Suc n)) <= c * abs (f n)) --> |
|
1688 |
summable f" |
|
| 14516 | 1689 |
by (import seq SER_RATIO) |
1690 |
||
1691 |
;end_setup |
|
1692 |
||
1693 |
;setup_theory lim |
|
1694 |
||
1695 |
constdefs |
|
1696 |
tends_real_real :: "(real => real) => real => real => bool" |
|
| 17644 | 1697 |
"tends_real_real == |
1698 |
%(f::real => real) (l::real) x0::real. |
|
1699 |
tends f l (mtop mr1, tendsto (mr1, x0))" |
|
1700 |
||
1701 |
lemma tends_real_real: "ALL (f::real => real) (l::real) x0::real. |
|
1702 |
tends_real_real f l x0 = tends f l (mtop mr1, tendsto (mr1, x0))" |
|
| 14516 | 1703 |
by (import lim tends_real_real) |
1704 |
||
| 17694 | 1705 |
lemma LIM: "ALL (f::real => real) (y0::real) x0::real. |
1706 |
tends_real_real f y0 x0 = |
|
1707 |
(ALL e>0. |
|
1708 |
EX d>0. |
|
1709 |
ALL x::real. |
|
1710 |
0 < abs (x - x0) & abs (x - x0) < d --> abs (f x - y0) < e)" |
|
| 14516 | 1711 |
by (import lim LIM) |
1712 |
||
| 17644 | 1713 |
lemma LIM_CONST: "ALL k::real. All (tends_real_real (%x::real. k) k)" |
| 14516 | 1714 |
by (import lim LIM_CONST) |
1715 |
||
| 17694 | 1716 |
lemma LIM_ADD: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1717 |
tends_real_real f l x & tends_real_real g m x --> |
|
1718 |
tends_real_real (%x::real. f x + g x) (l + m) x" |
|
| 14516 | 1719 |
by (import lim LIM_ADD) |
1720 |
||
| 17694 | 1721 |
lemma LIM_MUL: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1722 |
tends_real_real f l x & tends_real_real g m x --> |
|
1723 |
tends_real_real (%x::real. f x * g x) (l * m) x" |
|
| 14516 | 1724 |
by (import lim LIM_MUL) |
1725 |
||
| 17644 | 1726 |
lemma LIM_NEG: "ALL (f::real => real) (l::real) x::real. |
1727 |
tends_real_real f l x = tends_real_real (%x::real. - f x) (- l) x" |
|
| 14516 | 1728 |
by (import lim LIM_NEG) |
1729 |
||
| 17694 | 1730 |
lemma LIM_INV: "ALL (f::real => real) (l::real) x::real. |
1731 |
tends_real_real f l x & l ~= 0 --> |
|
1732 |
tends_real_real (%x::real. inverse (f x)) (inverse l) x" |
|
| 14516 | 1733 |
by (import lim LIM_INV) |
1734 |
||
| 17694 | 1735 |
lemma LIM_SUB: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1736 |
tends_real_real f l x & tends_real_real g m x --> |
|
1737 |
tends_real_real (%x::real. f x - g x) (l - m) x" |
|
| 14516 | 1738 |
by (import lim LIM_SUB) |
1739 |
||
| 17694 | 1740 |
lemma LIM_DIV: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1741 |
tends_real_real f l x & tends_real_real g m x & m ~= 0 --> |
|
1742 |
tends_real_real (%x::real. f x / g x) (l / m) x" |
|
| 14516 | 1743 |
by (import lim LIM_DIV) |
1744 |
||
| 17644 | 1745 |
lemma LIM_NULL: "ALL (f::real => real) (l::real) x::real. |
| 17652 | 1746 |
tends_real_real f l x = tends_real_real (%x::real. f x - l) 0 x" |
| 14516 | 1747 |
by (import lim LIM_NULL) |
1748 |
||
| 17644 | 1749 |
lemma LIM_X: "ALL x0::real. tends_real_real (%x::real. x) x0 x0" |
| 14516 | 1750 |
by (import lim LIM_X) |
1751 |
||
| 17694 | 1752 |
lemma LIM_UNIQ: "ALL (f::real => real) (l::real) (m::real) x::real. |
1753 |
tends_real_real f l x & tends_real_real f m x --> l = m" |
|
| 14516 | 1754 |
by (import lim LIM_UNIQ) |
1755 |
||
| 17694 | 1756 |
lemma LIM_EQUAL: "ALL (f::real => real) (g::real => real) (l::real) x0::real. |
1757 |
(ALL x::real. x ~= x0 --> f x = g x) --> |
|
1758 |
tends_real_real f l x0 = tends_real_real g l x0" |
|
| 14516 | 1759 |
by (import lim LIM_EQUAL) |
1760 |
||
| 17694 | 1761 |
lemma LIM_TRANSFORM: "ALL (f::real => real) (g::real => real) (x0::real) l::real. |
1762 |
tends_real_real (%x::real. f x - g x) 0 x0 & tends_real_real g l x0 --> |
|
1763 |
tends_real_real f l x0" |
|
| 14516 | 1764 |
by (import lim LIM_TRANSFORM) |
1765 |
||
1766 |
constdefs |
|
1767 |
diffl :: "(real => real) => real => real => bool" |
|
| 17644 | 1768 |
"diffl == |
1769 |
%(f::real => real) (l::real) x::real. |
|
| 17652 | 1770 |
tends_real_real (%h::real. (f (x + h) - f x) / h) l 0" |
| 17644 | 1771 |
|
1772 |
lemma diffl: "ALL (f::real => real) (l::real) x::real. |
|
| 17652 | 1773 |
diffl f l x = tends_real_real (%h::real. (f (x + h) - f x) / h) l 0" |
| 14516 | 1774 |
by (import lim diffl) |
1775 |
||
1776 |
constdefs |
|
1777 |
contl :: "(real => real) => real => bool" |
|
| 17644 | 1778 |
"contl == |
| 17652 | 1779 |
%(f::real => real) x::real. tends_real_real (%h::real. f (x + h)) (f x) 0" |
| 17644 | 1780 |
|
1781 |
lemma contl: "ALL (f::real => real) x::real. |
|
| 17652 | 1782 |
contl f x = tends_real_real (%h::real. f (x + h)) (f x) 0" |
| 14516 | 1783 |
by (import lim contl) |
1784 |
||
1785 |
constdefs |
|
1786 |
differentiable :: "(real => real) => real => bool" |
|
| 17644 | 1787 |
"differentiable == %(f::real => real) x::real. EX l::real. diffl f l x" |
1788 |
||
1789 |
lemma differentiable: "ALL (f::real => real) x::real. |
|
1790 |
differentiable f x = (EX l::real. diffl f l x)" |
|
| 14516 | 1791 |
by (import lim differentiable) |
1792 |
||
| 17694 | 1793 |
lemma DIFF_UNIQ: "ALL (f::real => real) (l::real) (m::real) x::real. |
1794 |
diffl f l x & diffl f m x --> l = m" |
|
| 14516 | 1795 |
by (import lim DIFF_UNIQ) |
1796 |
||
| 17694 | 1797 |
lemma DIFF_CONT: "ALL (f::real => real) (l::real) x::real. diffl f l x --> contl f x" |
| 14516 | 1798 |
by (import lim DIFF_CONT) |
1799 |
||
| 17644 | 1800 |
lemma CONTL_LIM: "ALL (f::real => real) x::real. contl f x = tends_real_real f (f x) x" |
| 14516 | 1801 |
by (import lim CONTL_LIM) |
1802 |
||
| 17644 | 1803 |
lemma DIFF_CARAT: "ALL (f::real => real) (l::real) x::real. |
| 14516 | 1804 |
diffl f l x = |
| 17644 | 1805 |
(EX g::real => real. |
1806 |
(ALL z::real. f z - f x = g z * (z - x)) & contl g x & g x = l)" |
|
| 14516 | 1807 |
by (import lim DIFF_CARAT) |
1808 |
||
| 17644 | 1809 |
lemma CONT_CONST: "ALL k::real. All (contl (%x::real. k))" |
| 14516 | 1810 |
by (import lim CONT_CONST) |
1811 |
||
| 17694 | 1812 |
lemma CONT_ADD: "ALL (f::real => real) (g::real => real) x::real. |
1813 |
contl f x & contl g x --> contl (%x::real. f x + g x) x" |
|
| 14516 | 1814 |
by (import lim CONT_ADD) |
1815 |
||
| 17694 | 1816 |
lemma CONT_MUL: "ALL (f::real => real) (g::real => real) x::real. |
1817 |
contl f x & contl g x --> contl (%x::real. f x * g x) x" |
|
| 14516 | 1818 |
by (import lim CONT_MUL) |
1819 |
||
| 17694 | 1820 |
lemma CONT_NEG: "ALL (f::real => real) x::real. contl f x --> contl (%x::real. - f x) x" |
| 14516 | 1821 |
by (import lim CONT_NEG) |
1822 |
||
| 17694 | 1823 |
lemma CONT_INV: "ALL (f::real => real) x::real. |
1824 |
contl f x & f x ~= 0 --> contl (%x::real. inverse (f x)) x" |
|
| 14516 | 1825 |
by (import lim CONT_INV) |
1826 |
||
| 17694 | 1827 |
lemma CONT_SUB: "ALL (f::real => real) (g::real => real) x::real. |
1828 |
contl f x & contl g x --> contl (%x::real. f x - g x) x" |
|
| 14516 | 1829 |
by (import lim CONT_SUB) |
1830 |
||
| 17694 | 1831 |
lemma CONT_DIV: "ALL (f::real => real) (g::real => real) x::real. |
1832 |
contl f x & contl g x & g x ~= 0 --> contl (%x::real. f x / g x) x" |
|
| 14516 | 1833 |
by (import lim CONT_DIV) |
1834 |
||
| 17694 | 1835 |
lemma CONT_COMPOSE: "ALL (f::real => real) (g::real => real) x::real. |
1836 |
contl f x & contl g (f x) --> contl (%x::real. g (f x)) x" |
|
| 14516 | 1837 |
by (import lim CONT_COMPOSE) |
1838 |
||
| 17694 | 1839 |
lemma IVT: "ALL (f::real => real) (a::real) (b::real) y::real. |
1840 |
a <= b & |
|
1841 |
(f a <= y & y <= f b) & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1842 |
(EX x::real. a <= x & x <= b & f x = y)" |
|
| 14516 | 1843 |
by (import lim IVT) |
1844 |
||
| 17694 | 1845 |
lemma IVT2: "ALL (f::real => real) (a::real) (b::real) y::real. |
1846 |
a <= b & |
|
1847 |
(f b <= y & y <= f a) & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1848 |
(EX x::real. a <= x & x <= b & f x = y)" |
|
| 14516 | 1849 |
by (import lim IVT2) |
1850 |
||
| 17652 | 1851 |
lemma DIFF_CONST: "ALL k::real. All (diffl (%x::real. k) 0)" |
| 14516 | 1852 |
by (import lim DIFF_CONST) |
1853 |
||
| 17694 | 1854 |
lemma DIFF_ADD: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1855 |
diffl f l x & diffl g m x --> diffl (%x::real. f x + g x) (l + m) x" |
|
| 14516 | 1856 |
by (import lim DIFF_ADD) |
1857 |
||
| 17694 | 1858 |
lemma DIFF_MUL: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1859 |
diffl f l x & diffl g m x --> |
|
1860 |
diffl (%x::real. f x * g x) (l * g x + m * f x) x" |
|
| 14516 | 1861 |
by (import lim DIFF_MUL) |
1862 |
||
| 17694 | 1863 |
lemma DIFF_CMUL: "ALL (f::real => real) (c::real) (l::real) x::real. |
1864 |
diffl f l x --> diffl (%x::real. c * f x) (c * l) x" |
|
| 14516 | 1865 |
by (import lim DIFF_CMUL) |
1866 |
||
| 17694 | 1867 |
lemma DIFF_NEG: "ALL (f::real => real) (l::real) x::real. |
1868 |
diffl f l x --> diffl (%x::real. - f x) (- l) x" |
|
| 14516 | 1869 |
by (import lim DIFF_NEG) |
1870 |
||
| 17694 | 1871 |
lemma DIFF_SUB: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1872 |
diffl f l x & diffl g m x --> diffl (%x::real. f x - g x) (l - m) x" |
|
| 14516 | 1873 |
by (import lim DIFF_SUB) |
1874 |
||
| 17694 | 1875 |
lemma DIFF_CHAIN: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1876 |
diffl f l (g x) & diffl g m x --> diffl (%x::real. f (g x)) (l * m) x" |
|
| 14516 | 1877 |
by (import lim DIFF_CHAIN) |
1878 |
||
| 17652 | 1879 |
lemma DIFF_X: "All (diffl (%x::real. x) 1)" |
| 14516 | 1880 |
by (import lim DIFF_X) |
1881 |
||
| 17652 | 1882 |
lemma DIFF_POW: "ALL (n::nat) x::real. diffl (%x::real. x ^ n) (real n * x ^ (n - 1)) x" |
| 14516 | 1883 |
by (import lim DIFF_POW) |
1884 |
||
| 17694 | 1885 |
lemma DIFF_XM1: "ALL x::real. x ~= 0 --> diffl inverse (- (inverse x ^ 2)) x" |
| 14516 | 1886 |
by (import lim DIFF_XM1) |
1887 |
||
| 17694 | 1888 |
lemma DIFF_INV: "ALL (f::real => real) (l::real) x::real. |
1889 |
diffl f l x & f x ~= 0 --> |
|
1890 |
diffl (%x::real. inverse (f x)) (- (l / f x ^ 2)) x" |
|
| 14516 | 1891 |
by (import lim DIFF_INV) |
1892 |
||
| 17694 | 1893 |
lemma DIFF_DIV: "ALL (f::real => real) (g::real => real) (l::real) (m::real) x::real. |
1894 |
diffl f l x & diffl g m x & g x ~= 0 --> |
|
1895 |
diffl (%x::real. f x / g x) ((l * g x - m * f x) / g x ^ 2) x" |
|
| 14516 | 1896 |
by (import lim DIFF_DIV) |
1897 |
||
| 17694 | 1898 |
lemma DIFF_SUM: "ALL (f::nat => real => real) (f'::nat => real => real) (m::nat) (n::nat) |
1899 |
x::real. |
|
1900 |
(ALL r::nat. m <= r & r < m + n --> diffl (f r) (f' r x) x) --> |
|
1901 |
diffl (%x::real. real.sum (m, n) (%n::nat. f n x)) |
|
1902 |
(real.sum (m, n) (%r::nat. f' r x)) x" |
|
| 14516 | 1903 |
by (import lim DIFF_SUM) |
1904 |
||
| 17694 | 1905 |
lemma CONT_BOUNDED: "ALL (f::real => real) (a::real) b::real. |
1906 |
a <= b & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1907 |
(EX M::real. ALL x::real. a <= x & x <= b --> f x <= M)" |
|
| 14516 | 1908 |
by (import lim CONT_BOUNDED) |
1909 |
||
1910 |
lemma CONT_HASSUP: "(All::((real => real) => bool) => bool) |
|
1911 |
(%f::real => real. |
|
1912 |
(All::(real => bool) => bool) |
|
1913 |
(%a::real. |
|
1914 |
(All::(real => bool) => bool) |
|
1915 |
(%b::real. |
|
1916 |
(op -->::bool => bool => bool) |
|
1917 |
((op &::bool => bool => bool) |
|
1918 |
((op <=::real => real => bool) a b) |
|
1919 |
((All::(real => bool) => bool) |
|
1920 |
(%x::real. |
|
1921 |
(op -->::bool => bool => bool) |
|
1922 |
((op &::bool => bool => bool) |
|
1923 |
((op <=::real => real => bool) a x) |
|
1924 |
((op <=::real => real => bool) x b)) |
|
1925 |
((contl::(real => real) => real => bool) f x)))) |
|
1926 |
((Ex::(real => bool) => bool) |
|
1927 |
(%M::real. |
|
1928 |
(op &::bool => bool => bool) |
|
1929 |
((All::(real => bool) => bool) |
|
1930 |
(%x::real. |
|
1931 |
(op -->::bool => bool => bool) |
|
1932 |
((op &::bool => bool => bool) |
|
1933 |
((op <=::real => real => bool) a x) |
|
1934 |
((op <=::real => real => bool) x b)) |
|
1935 |
((op <=::real => real => bool) (f x) M))) |
|
1936 |
((All::(real => bool) => bool) |
|
1937 |
(%N::real. |
|
1938 |
(op -->::bool => bool => bool) |
|
1939 |
((op <::real => real => bool) N M) |
|
1940 |
((Ex::(real => bool) => bool) |
|
1941 |
(%x::real. |
|
1942 |
(op &::bool => bool => bool) |
|
1943 |
((op <=::real => real => bool) a x) |
|
1944 |
((op &::bool => bool => bool) |
|
1945 |
((op <=::real => real => bool) x b) |
|
1946 |
((op <::real => real => bool) N (f x))))))))))))" |
|
1947 |
by (import lim CONT_HASSUP) |
|
1948 |
||
| 17694 | 1949 |
lemma CONT_ATTAINS: "ALL (f::real => real) (a::real) b::real. |
1950 |
a <= b & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1951 |
(EX x::real. |
|
1952 |
(ALL xa::real. a <= xa & xa <= b --> f xa <= x) & |
|
1953 |
(EX xa::real. a <= xa & xa <= b & f xa = x))" |
|
| 14516 | 1954 |
by (import lim CONT_ATTAINS) |
1955 |
||
| 17694 | 1956 |
lemma CONT_ATTAINS2: "ALL (f::real => real) (a::real) b::real. |
1957 |
a <= b & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1958 |
(EX x::real. |
|
1959 |
(ALL xa::real. a <= xa & xa <= b --> x <= f xa) & |
|
1960 |
(EX xa::real. a <= xa & xa <= b & f xa = x))" |
|
| 14516 | 1961 |
by (import lim CONT_ATTAINS2) |
1962 |
||
| 17694 | 1963 |
lemma CONT_ATTAINS_ALL: "ALL (f::real => real) (a::real) b::real. |
1964 |
a <= b & (ALL x::real. a <= x & x <= b --> contl f x) --> |
|
1965 |
(EX (x::real) M::real. |
|
1966 |
x <= M & |
|
1967 |
(ALL y::real. |
|
1968 |
x <= y & y <= M --> (EX x::real. a <= x & x <= b & f x = y)) & |
|
1969 |
(ALL xa::real. a <= xa & xa <= b --> x <= f xa & f xa <= M))" |
|
| 14516 | 1970 |
by (import lim CONT_ATTAINS_ALL) |
1971 |
||
| 17694 | 1972 |
lemma DIFF_LINC: "ALL (f::real => real) (x::real) l::real. |
1973 |
diffl f l x & 0 < l --> |
|
1974 |
(EX d>0. ALL h::real. 0 < h & h < d --> f x < f (x + h))" |
|
| 14516 | 1975 |
by (import lim DIFF_LINC) |
1976 |
||
| 17694 | 1977 |
lemma DIFF_LDEC: "ALL (f::real => real) (x::real) l::real. |
1978 |
diffl f l x & l < 0 --> |
|
1979 |
(EX d>0. ALL h::real. 0 < h & h < d --> f x < f (x - h))" |
|
| 14516 | 1980 |
by (import lim DIFF_LDEC) |
1981 |
||
| 17694 | 1982 |
lemma DIFF_LMAX: "ALL (f::real => real) (x::real) l::real. |
1983 |
diffl f l x & (EX d>0. ALL y::real. abs (x - y) < d --> f y <= f x) --> |
|
1984 |
l = 0" |
|
| 14516 | 1985 |
by (import lim DIFF_LMAX) |
1986 |
||
| 17694 | 1987 |
lemma DIFF_LMIN: "ALL (f::real => real) (x::real) l::real. |
1988 |
diffl f l x & (EX d>0. ALL y::real. abs (x - y) < d --> f x <= f y) --> |
|
1989 |
l = 0" |
|
| 14516 | 1990 |
by (import lim DIFF_LMIN) |
1991 |
||
| 17694 | 1992 |
lemma DIFF_LCONST: "ALL (f::real => real) (x::real) l::real. |
1993 |
diffl f l x & (EX d>0. ALL y::real. abs (x - y) < d --> f y = f x) --> |
|
1994 |
l = 0" |
|
| 14516 | 1995 |
by (import lim DIFF_LCONST) |
1996 |
||
| 17694 | 1997 |
lemma INTERVAL_LEMMA: "ALL (a::real) (b::real) x::real. |
1998 |
a < x & x < b --> |
|
1999 |
(EX d>0. ALL y::real. abs (x - y) < d --> a <= y & y <= b)" |
|
| 14516 | 2000 |
by (import lim INTERVAL_LEMMA) |
2001 |
||
| 17694 | 2002 |
lemma ROLLE: "ALL (f::real => real) (a::real) b::real. |
2003 |
a < b & |
|
2004 |
f a = f b & |
|
2005 |
(ALL x::real. a <= x & x <= b --> contl f x) & |
|
2006 |
(ALL x::real. a < x & x < b --> differentiable f x) --> |
|
2007 |
(EX z::real. a < z & z < b & diffl f 0 z)" |
|
| 14516 | 2008 |
by (import lim ROLLE) |
2009 |
||
2010 |
lemma MVT_LEMMA: "ALL (f::real => real) (a::real) b::real. |
|
2011 |
f a - (f b - f a) / (b - a) * a = f b - (f b - f a) / (b - a) * b" |
|
2012 |
by (import lim MVT_LEMMA) |
|
2013 |
||
| 17694 | 2014 |
lemma MVT: "ALL (f::real => real) (a::real) b::real. |
2015 |
a < b & |
|
2016 |
(ALL x::real. a <= x & x <= b --> contl f x) & |
|
2017 |
(ALL x::real. a < x & x < b --> differentiable f x) --> |
|
2018 |
(EX (l::real) z::real. |
|
2019 |
a < z & z < b & diffl f l z & f b - f a = (b - a) * l)" |
|
| 14516 | 2020 |
by (import lim MVT) |
2021 |
||
| 17694 | 2022 |
lemma DIFF_ISCONST_END: "ALL (f::real => real) (a::real) b::real. |
2023 |
a < b & |
|
2024 |
(ALL x::real. a <= x & x <= b --> contl f x) & |
|
2025 |
(ALL x::real. a < x & x < b --> diffl f 0 x) --> |
|
2026 |
f b = f a" |
|
| 14516 | 2027 |
by (import lim DIFF_ISCONST_END) |
2028 |
||
| 17694 | 2029 |
lemma DIFF_ISCONST: "ALL (f::real => real) (a::real) b::real. |
2030 |
a < b & |
|
2031 |
(ALL x::real. a <= x & x <= b --> contl f x) & |
|
2032 |
(ALL x::real. a < x & x < b --> diffl f 0 x) --> |
|
2033 |
(ALL x::real. a <= x & x <= b --> f x = f a)" |
|
| 14516 | 2034 |
by (import lim DIFF_ISCONST) |
2035 |
||
| 17694 | 2036 |
lemma DIFF_ISCONST_ALL: "ALL f::real => real. All (diffl f 0) --> (ALL (x::real) y::real. f x = f y)" |
| 14516 | 2037 |
by (import lim DIFF_ISCONST_ALL) |
2038 |
||
2039 |
lemma INTERVAL_ABS: "ALL (x::real) (z::real) d::real. |
|
2040 |
(x - d <= z & z <= x + d) = (abs (z - x) <= d)" |
|
2041 |
by (import lim INTERVAL_ABS) |
|
2042 |
||
| 17694 | 2043 |
lemma CONT_INJ_LEMMA: "ALL (f::real => real) (g::real => real) (x::real) d::real. |
2044 |
0 < d & |
|
2045 |
(ALL z::real. abs (z - x) <= d --> g (f z) = z) & |
|
2046 |
(ALL z::real. abs (z - x) <= d --> contl f z) --> |
|
2047 |
~ (ALL z::real. abs (z - x) <= d --> f z <= f x)" |
|
| 14516 | 2048 |
by (import lim CONT_INJ_LEMMA) |
2049 |
||
| 17694 | 2050 |
lemma CONT_INJ_LEMMA2: "ALL (f::real => real) (g::real => real) (x::real) d::real. |
2051 |
0 < d & |
|
2052 |
(ALL z::real. abs (z - x) <= d --> g (f z) = z) & |
|
2053 |
(ALL z::real. abs (z - x) <= d --> contl f z) --> |
|
2054 |
~ (ALL z::real. abs (z - x) <= d --> f x <= f z)" |
|
| 14516 | 2055 |
by (import lim CONT_INJ_LEMMA2) |
2056 |
||
| 17694 | 2057 |
lemma CONT_INJ_RANGE: "ALL (f::real => real) (g::real => real) (x::real) d::real. |
2058 |
0 < d & |
|
2059 |
(ALL z::real. abs (z - x) <= d --> g (f z) = z) & |
|
2060 |
(ALL z::real. abs (z - x) <= d --> contl f z) --> |
|
2061 |
(EX e>0. |
|
2062 |
ALL y::real. |
|
2063 |
abs (y - f x) <= e --> (EX z::real. abs (z - x) <= d & f z = y))" |
|
| 14516 | 2064 |
by (import lim CONT_INJ_RANGE) |
2065 |
||
| 17694 | 2066 |
lemma CONT_INVERSE: "ALL (f::real => real) (g::real => real) (x::real) d::real. |
2067 |
0 < d & |
|
2068 |
(ALL z::real. abs (z - x) <= d --> g (f z) = z) & |
|
2069 |
(ALL z::real. abs (z - x) <= d --> contl f z) --> |
|
2070 |
contl g (f x)" |
|
| 14516 | 2071 |
by (import lim CONT_INVERSE) |
2072 |
||
| 17694 | 2073 |
lemma DIFF_INVERSE: "ALL (f::real => real) (g::real => real) (l::real) (x::real) d::real. |
2074 |
0 < d & |
|
2075 |
(ALL z::real. abs (z - x) <= d --> g (f z) = z) & |
|
2076 |
(ALL z::real. abs (z - x) <= d --> contl f z) & diffl f l x & l ~= 0 --> |
|
2077 |
diffl g (inverse l) (f x)" |
|
| 14516 | 2078 |
by (import lim DIFF_INVERSE) |
2079 |
||
| 17694 | 2080 |
lemma DIFF_INVERSE_LT: "ALL (f::real => real) (g::real => real) (l::real) (x::real) d::real. |
2081 |
0 < d & |
|
2082 |
(ALL z::real. abs (z - x) < d --> g (f z) = z) & |
|
2083 |
(ALL z::real. abs (z - x) < d --> contl f z) & diffl f l x & l ~= 0 --> |
|
2084 |
diffl g (inverse l) (f x)" |
|
| 14516 | 2085 |
by (import lim DIFF_INVERSE_LT) |
2086 |
||
| 17694 | 2087 |
lemma INTERVAL_CLEMMA: "ALL (a::real) (b::real) x::real. |
2088 |
a < x & x < b --> |
|
2089 |
(EX d>0. ALL y::real. abs (y - x) <= d --> a < y & y < b)" |
|
| 14516 | 2090 |
by (import lim INTERVAL_CLEMMA) |
2091 |
||
| 17694 | 2092 |
lemma DIFF_INVERSE_OPEN: "ALL (f::real => real) (g::real => real) (l::real) (a::real) (x::real) |
2093 |
b::real. |
|
2094 |
a < x & |
|
2095 |
x < b & |
|
2096 |
(ALL z::real. a < z & z < b --> g (f z) = z & contl f z) & |
|
2097 |
diffl f l x & l ~= 0 --> |
|
2098 |
diffl g (inverse l) (f x)" |
|
| 14516 | 2099 |
by (import lim DIFF_INVERSE_OPEN) |
2100 |
||
2101 |
;end_setup |
|
2102 |
||
2103 |
;setup_theory powser |
|
2104 |
||
| 17644 | 2105 |
lemma POWDIFF_LEMMA: "ALL (n::nat) (x::real) y::real. |
| 17652 | 2106 |
real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (Suc n - p)) = |
2107 |
y * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))" |
|
| 14516 | 2108 |
by (import powser POWDIFF_LEMMA) |
2109 |
||
| 17644 | 2110 |
lemma POWDIFF: "ALL (n::nat) (x::real) y::real. |
| 14516 | 2111 |
x ^ Suc n - y ^ Suc n = |
| 17652 | 2112 |
(x - y) * real.sum (0, Suc n) (%p::nat. x ^ p * y ^ (n - p))" |
| 14516 | 2113 |
by (import powser POWDIFF) |
2114 |
||
| 17644 | 2115 |
lemma POWREV: "ALL (n::nat) (x::real) y::real. |
| 17652 | 2116 |
real.sum (0, Suc n) (%xa::nat. x ^ xa * y ^ (n - xa)) = |
2117 |
real.sum (0, Suc n) (%xa::nat. x ^ (n - xa) * y ^ xa)" |
|
| 14516 | 2118 |
by (import powser POWREV) |
2119 |
||
| 17694 | 2120 |
lemma POWSER_INSIDEA: "ALL (f::nat => real) (x::real) z::real. |
2121 |
summable (%n::nat. f n * x ^ n) & abs z < abs x --> |
|
2122 |
summable (%n::nat. abs (f n) * z ^ n)" |
|
| 14516 | 2123 |
by (import powser POWSER_INSIDEA) |
2124 |
||
| 17694 | 2125 |
lemma POWSER_INSIDE: "ALL (f::nat => real) (x::real) z::real. |
2126 |
summable (%n::nat. f n * x ^ n) & abs z < abs x --> |
|
2127 |
summable (%n::nat. f n * z ^ n)" |
|
| 14516 | 2128 |
by (import powser POWSER_INSIDE) |
2129 |
||
2130 |
constdefs |
|
2131 |
diffs :: "(nat => real) => nat => real" |
|
| 17644 | 2132 |
"diffs == %(c::nat => real) n::nat. real (Suc n) * c (Suc n)" |
2133 |
||
2134 |
lemma diffs: "ALL c::nat => real. diffs c = (%n::nat. real (Suc n) * c (Suc n))" |
|
| 14516 | 2135 |
by (import powser diffs) |
2136 |
||
| 17644 | 2137 |
lemma DIFFS_NEG: "ALL c::nat => real. diffs (%n::nat. - c n) = (%x::nat. - diffs c x)" |
| 14516 | 2138 |
by (import powser DIFFS_NEG) |
2139 |
||
| 17644 | 2140 |
lemma DIFFS_LEMMA: "ALL (n::nat) (c::nat => real) x::real. |
| 17652 | 2141 |
real.sum (0, n) (%n::nat. diffs c n * x ^ n) = |
2142 |
real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) + |
|
2143 |
real n * (c n * x ^ (n - 1))" |
|
| 14516 | 2144 |
by (import powser DIFFS_LEMMA) |
2145 |
||
| 17644 | 2146 |
lemma DIFFS_LEMMA2: "ALL (n::nat) (c::nat => real) x::real. |
| 17652 | 2147 |
real.sum (0, n) (%n::nat. real n * (c n * x ^ (n - 1))) = |
2148 |
real.sum (0, n) (%n::nat. diffs c n * x ^ n) - |
|
2149 |
real n * (c n * x ^ (n - 1))" |
|
| 14516 | 2150 |
by (import powser DIFFS_LEMMA2) |
2151 |
||
| 17694 | 2152 |
lemma DIFFS_EQUIV: "ALL (c::nat => real) x::real. |
2153 |
summable (%n::nat. diffs c n * x ^ n) --> |
|
2154 |
sums (%n::nat. real n * (c n * x ^ (n - 1))) |
|
2155 |
(suminf (%n::nat. diffs c n * x ^ n))" |
|
| 14516 | 2156 |
by (import powser DIFFS_EQUIV) |
2157 |
||
| 17644 | 2158 |
lemma TERMDIFF_LEMMA1: "ALL (m::nat) (z::real) h::real. |
| 17652 | 2159 |
real.sum (0, m) (%p::nat. (z + h) ^ (m - p) * z ^ p - z ^ m) = |
2160 |
real.sum (0, m) (%p::nat. z ^ p * ((z + h) ^ (m - p) - z ^ (m - p)))" |
|
| 14516 | 2161 |
by (import powser TERMDIFF_LEMMA1) |
2162 |
||
| 17694 | 2163 |
lemma TERMDIFF_LEMMA2: "ALL (z::real) (h::real) n::nat. |
2164 |
h ~= 0 --> |
|
2165 |
((z + h) ^ n - z ^ n) / h - real n * z ^ (n - 1) = |
|
2166 |
h * |
|
2167 |
real.sum (0, n - 1) |
|
2168 |
(%p::nat. |
|
2169 |
z ^ p * |
|
2170 |
real.sum (0, n - 1 - p) |
|
2171 |
(%q::nat. (z + h) ^ q * z ^ (n - 2 - p - q)))" |
|
| 14516 | 2172 |
by (import powser TERMDIFF_LEMMA2) |
2173 |
||
| 17694 | 2174 |
lemma TERMDIFF_LEMMA3: "ALL (z::real) (h::real) (n::nat) k'::real. |
2175 |
h ~= 0 & abs z <= k' & abs (z + h) <= k' --> |
|
2176 |
abs (((z + h) ^ n - z ^ n) / h - real n * z ^ (n - 1)) |
|
2177 |
<= real n * (real (n - 1) * (k' ^ (n - 2) * abs h))" |
|
| 14516 | 2178 |
by (import powser TERMDIFF_LEMMA3) |
2179 |
||
| 17694 | 2180 |
lemma TERMDIFF_LEMMA4: "ALL (f::real => real) (k'::real) k::real. |
2181 |
0 < k & |
|
2182 |
(ALL h::real. 0 < abs h & abs h < k --> abs (f h) <= k' * abs h) --> |
|
2183 |
tends_real_real f 0 0" |
|
| 14516 | 2184 |
by (import powser TERMDIFF_LEMMA4) |
2185 |
||
| 17694 | 2186 |
lemma TERMDIFF_LEMMA5: "ALL (f::nat => real) (g::real => nat => real) k::real. |
2187 |
0 < k & |
|
2188 |
summable f & |
|
2189 |
(ALL h::real. |
|
2190 |
0 < abs h & abs h < k --> |
|
2191 |
(ALL n::nat. abs (g h n) <= f n * abs h)) --> |
|
2192 |
tends_real_real (%h::real. suminf (g h)) 0 0" |
|
| 14516 | 2193 |
by (import powser TERMDIFF_LEMMA5) |
2194 |
||
| 17694 | 2195 |
lemma TERMDIFF: "ALL (c::nat => real) (k'::real) x::real. |
2196 |
summable (%n::nat. c n * k' ^ n) & |
|
2197 |
summable (%n::nat. diffs c n * k' ^ n) & |
|
2198 |
summable (%n::nat. diffs (diffs c) n * k' ^ n) & abs x < abs k' --> |
|
2199 |
diffl (%x::real. suminf (%n::nat. c n * x ^ n)) |
|
2200 |
(suminf (%n::nat. diffs c n * x ^ n)) x" |
|
| 14516 | 2201 |
by (import powser TERMDIFF) |
2202 |
||
2203 |
;end_setup |
|
2204 |
||
2205 |
;setup_theory transc |
|
2206 |
||
2207 |
constdefs |
|
2208 |
exp :: "real => real" |
|
| 17644 | 2209 |
"exp == %x::real. suminf (%n::nat. inverse (real (FACT n)) * x ^ n)" |
2210 |
||
2211 |
lemma exp: "ALL x::real. exp x = suminf (%n::nat. inverse (real (FACT n)) * x ^ n)" |
|
| 14516 | 2212 |
by (import transc exp) |
2213 |
||
2214 |
constdefs |
|
2215 |
cos :: "real => real" |
|
| 17652 | 2216 |
"cos == |
2217 |
%x::real. |
|
2218 |
suminf |
|
2219 |
(%n::nat. |
|
2220 |
(if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)" |
|
2221 |
||
2222 |
lemma cos: "ALL x::real. |
|
2223 |
cos x = |
|
2224 |
suminf |
|
2225 |
(%n::nat. |
|
2226 |
(if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n)" |
|
| 14516 | 2227 |
by (import transc cos) |
2228 |
||
2229 |
constdefs |
|
2230 |
sin :: "real => real" |
|
2231 |
"sin == |
|
| 17644 | 2232 |
%x::real. |
2233 |
suminf |
|
2234 |
(%n::nat. |
|
| 17652 | 2235 |
(if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) * |
| 17644 | 2236 |
x ^ n)" |
2237 |
||
2238 |
lemma sin: "ALL x::real. |
|
| 14516 | 2239 |
sin x = |
2240 |
suminf |
|
| 17644 | 2241 |
(%n::nat. |
| 17652 | 2242 |
(if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) * |
| 17644 | 2243 |
x ^ n)" |
| 14516 | 2244 |
by (import transc sin) |
2245 |
||
| 17644 | 2246 |
lemma EXP_CONVERGES: "ALL x::real. sums (%n::nat. inverse (real (FACT n)) * x ^ n) (exp x)" |
| 14516 | 2247 |
by (import transc EXP_CONVERGES) |
2248 |
||
| 17644 | 2249 |
lemma SIN_CONVERGES: "ALL x::real. |
| 14516 | 2250 |
sums |
| 17644 | 2251 |
(%n::nat. |
| 17652 | 2252 |
(if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) * |
| 17644 | 2253 |
x ^ n) |
| 14516 | 2254 |
(sin x)" |
2255 |
by (import transc SIN_CONVERGES) |
|
2256 |
||
| 17652 | 2257 |
lemma COS_CONVERGES: "ALL x::real. |
2258 |
sums |
|
2259 |
(%n::nat. |
|
2260 |
(if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) * x ^ n) |
|
2261 |
(cos x)" |
|
| 14516 | 2262 |
by (import transc COS_CONVERGES) |
2263 |
||
| 17644 | 2264 |
lemma EXP_FDIFF: "diffs (%n::nat. inverse (real (FACT n))) = |
2265 |
(%n::nat. inverse (real (FACT n)))" |
|
| 14516 | 2266 |
by (import transc EXP_FDIFF) |
2267 |
||
| 17652 | 2268 |
lemma SIN_FDIFF: "diffs |
2269 |
(%n::nat. if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) = |
|
2270 |
(%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0)" |
|
| 14516 | 2271 |
by (import transc SIN_FDIFF) |
2272 |
||
| 17652 | 2273 |
lemma COS_FDIFF: "diffs (%n::nat. if EVEN n then (- 1) ^ (n div 2) / real (FACT n) else 0) = |
2274 |
(%n::nat. - (if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)))" |
|
| 14516 | 2275 |
by (import transc COS_FDIFF) |
2276 |
||
| 17644 | 2277 |
lemma SIN_NEGLEMMA: "ALL x::real. |
| 14516 | 2278 |
- sin x = |
2279 |
suminf |
|
| 17644 | 2280 |
(%n::nat. |
| 17652 | 2281 |
- ((if EVEN n then 0 else (- 1) ^ ((n - 1) div 2) / real (FACT n)) * |
| 17644 | 2282 |
x ^ n))" |
| 14516 | 2283 |
by (import transc SIN_NEGLEMMA) |
2284 |
||
| 17644 | 2285 |
lemma DIFF_EXP: "ALL x::real. diffl exp (exp x) x" |
| 14516 | 2286 |
by (import transc DIFF_EXP) |
2287 |
||
| 17644 | 2288 |
lemma DIFF_SIN: "ALL x::real. diffl sin (cos x) x" |
| 14516 | 2289 |
by (import transc DIFF_SIN) |
2290 |
||
| 17644 | 2291 |
lemma DIFF_COS: "ALL x::real. diffl cos (- sin x) x" |
| 14516 | 2292 |
by (import transc DIFF_COS) |
2293 |
||
| 17694 | 2294 |
lemma DIFF_COMPOSITE: "(diffl (f::real => real) (l::real) (x::real) & f x ~= 0 --> |
2295 |
diffl (%x::real. inverse (f x)) (- (l / f x ^ 2)) x) & |
|
2296 |
(diffl f l x & diffl (g::real => real) (m::real) x & g x ~= 0 --> |
|
2297 |
diffl (%x::real. f x / g x) ((l * g x - m * f x) / g x ^ 2) x) & |
|
2298 |
(diffl f l x & diffl g m x --> diffl (%x::real. f x + g x) (l + m) x) & |
|
2299 |
(diffl f l x & diffl g m x --> |
|
2300 |
diffl (%x::real. f x * g x) (l * g x + m * f x) x) & |
|
2301 |
(diffl f l x & diffl g m x --> diffl (%x::real. f x - g x) (l - m) x) & |
|
2302 |
(diffl f l x --> diffl (%x::real. - f x) (- l) x) & |
|
2303 |
(diffl g m x --> |
|
2304 |
diffl (%x::real. g x ^ (n::nat)) (real n * g x ^ (n - 1) * m) x) & |
|
2305 |
(diffl g m x --> diffl (%x::real. exp (g x)) (exp (g x) * m) x) & |
|
2306 |
(diffl g m x --> diffl (%x::real. sin (g x)) (cos (g x) * m) x) & |
|
2307 |
(diffl g m x --> diffl (%x::real. cos (g x)) (- sin (g x) * m) x)" |
|
| 14516 | 2308 |
by (import transc DIFF_COMPOSITE) |
2309 |
||
| 17652 | 2310 |
lemma EXP_0: "exp 0 = 1" |
| 14516 | 2311 |
by (import transc EXP_0) |
2312 |
||
| 17652 | 2313 |
lemma EXP_LE_X: "ALL x>=0. 1 + x <= exp x" |
| 14516 | 2314 |
by (import transc EXP_LE_X) |
2315 |
||
| 17652 | 2316 |
lemma EXP_LT_1: "ALL x>0. 1 < exp x" |
| 14516 | 2317 |
by (import transc EXP_LT_1) |
2318 |
||
| 17644 | 2319 |
lemma EXP_ADD_MUL: "ALL (x::real) y::real. exp (x + y) * exp (- x) = exp y" |
| 14516 | 2320 |
by (import transc EXP_ADD_MUL) |
2321 |
||
| 17652 | 2322 |
lemma EXP_NEG_MUL: "ALL x::real. exp x * exp (- x) = 1" |
| 14516 | 2323 |
by (import transc EXP_NEG_MUL) |
2324 |
||
| 17652 | 2325 |
lemma EXP_NEG_MUL2: "ALL x::real. exp (- x) * exp x = 1" |
| 14516 | 2326 |
by (import transc EXP_NEG_MUL2) |
2327 |
||
| 17644 | 2328 |
lemma EXP_NEG: "ALL x::real. exp (- x) = inverse (exp x)" |
| 14516 | 2329 |
by (import transc EXP_NEG) |
2330 |
||
| 17644 | 2331 |
lemma EXP_ADD: "ALL (x::real) y::real. exp (x + y) = exp x * exp y" |
| 14516 | 2332 |
by (import transc EXP_ADD) |
2333 |
||
| 17652 | 2334 |
lemma EXP_POS_LE: "ALL x::real. 0 <= exp x" |
| 14516 | 2335 |
by (import transc EXP_POS_LE) |
2336 |
||
| 17652 | 2337 |
lemma EXP_NZ: "ALL x::real. exp x ~= 0" |
| 14516 | 2338 |
by (import transc EXP_NZ) |
2339 |
||
| 17652 | 2340 |
lemma EXP_POS_LT: "ALL x::real. 0 < exp x" |
| 14516 | 2341 |
by (import transc EXP_POS_LT) |
2342 |
||
| 17644 | 2343 |
lemma EXP_N: "ALL (n::nat) x::real. exp (real n * x) = exp x ^ n" |
| 14516 | 2344 |
by (import transc EXP_N) |
2345 |
||
| 17644 | 2346 |
lemma EXP_SUB: "ALL (x::real) y::real. exp (x - y) = exp x / exp y" |
| 14516 | 2347 |
by (import transc EXP_SUB) |
2348 |
||
| 17694 | 2349 |
lemma EXP_MONO_IMP: "ALL (x::real) y::real. x < y --> exp x < exp y" |
| 14516 | 2350 |
by (import transc EXP_MONO_IMP) |
2351 |
||
| 17644 | 2352 |
lemma EXP_MONO_LT: "ALL (x::real) y::real. (exp x < exp y) = (x < y)" |
| 14516 | 2353 |
by (import transc EXP_MONO_LT) |
2354 |
||
| 17644 | 2355 |
lemma EXP_MONO_LE: "ALL (x::real) y::real. (exp x <= exp y) = (x <= y)" |
| 14516 | 2356 |
by (import transc EXP_MONO_LE) |
2357 |
||
| 17644 | 2358 |
lemma EXP_INJ: "ALL (x::real) y::real. (exp x = exp y) = (x = y)" |
| 14516 | 2359 |
by (import transc EXP_INJ) |
2360 |
||
| 17652 | 2361 |
lemma EXP_TOTAL_LEMMA: "ALL y>=1. EX x>=0. x <= y - 1 & exp x = y" |
| 14516 | 2362 |
by (import transc EXP_TOTAL_LEMMA) |
2363 |
||
| 17652 | 2364 |
lemma EXP_TOTAL: "ALL y>0. EX x::real. exp x = y" |
| 14516 | 2365 |
by (import transc EXP_TOTAL) |
2366 |
||
2367 |
constdefs |
|
2368 |
ln :: "real => real" |
|
| 17644 | 2369 |
"ln == %x::real. SOME u::real. exp u = x" |
2370 |
||
2371 |
lemma ln: "ALL x::real. ln x = (SOME u::real. exp u = x)" |
|
| 14516 | 2372 |
by (import transc ln) |
2373 |
||
| 17644 | 2374 |
lemma LN_EXP: "ALL x::real. ln (exp x) = x" |
| 14516 | 2375 |
by (import transc LN_EXP) |
2376 |
||
| 17652 | 2377 |
lemma EXP_LN: "ALL x::real. (exp (ln x) = x) = (0 < x)" |
| 14516 | 2378 |
by (import transc EXP_LN) |
2379 |
||
| 17694 | 2380 |
lemma LN_MUL: "ALL (x::real) y::real. 0 < x & 0 < y --> ln (x * y) = ln x + ln y" |
| 14516 | 2381 |
by (import transc LN_MUL) |
2382 |
||
| 17694 | 2383 |
lemma LN_INJ: "ALL (x::real) y::real. 0 < x & 0 < y --> (ln x = ln y) = (x = y)" |
| 14516 | 2384 |
by (import transc LN_INJ) |
2385 |
||
| 17652 | 2386 |
lemma LN_1: "ln 1 = 0" |
| 14516 | 2387 |
by (import transc LN_1) |
2388 |
||
| 17652 | 2389 |
lemma LN_INV: "ALL x>0. ln (inverse x) = - ln x" |
| 14516 | 2390 |
by (import transc LN_INV) |
2391 |
||
| 17694 | 2392 |
lemma LN_DIV: "ALL (x::real) y::real. 0 < x & 0 < y --> ln (x / y) = ln x - ln y" |
| 14516 | 2393 |
by (import transc LN_DIV) |
2394 |
||
| 17694 | 2395 |
lemma LN_MONO_LT: "ALL (x::real) y::real. 0 < x & 0 < y --> (ln x < ln y) = (x < y)" |
| 14516 | 2396 |
by (import transc LN_MONO_LT) |
2397 |
||
| 17694 | 2398 |
lemma LN_MONO_LE: "ALL (x::real) y::real. 0 < x & 0 < y --> (ln x <= ln y) = (x <= y)" |
| 14516 | 2399 |
by (import transc LN_MONO_LE) |
2400 |
||
| 17694 | 2401 |
lemma LN_POW: "ALL (n::nat) x::real. 0 < x --> ln (x ^ n) = real n * ln x" |
| 14516 | 2402 |
by (import transc LN_POW) |
2403 |
||
| 17652 | 2404 |
lemma LN_LE: "ALL x>=0. ln (1 + x) <= x" |
| 14516 | 2405 |
by (import transc LN_LE) |
2406 |
||
| 17652 | 2407 |
lemma LN_LT_X: "ALL x>0. ln x < x" |
| 14516 | 2408 |
by (import transc LN_LT_X) |
2409 |
||
| 17652 | 2410 |
lemma LN_POS: "ALL x>=1. 0 <= ln x" |
| 14516 | 2411 |
by (import transc LN_POS) |
2412 |
||
2413 |
constdefs |
|
2414 |
root :: "nat => real => real" |
|
| 17694 | 2415 |
"root == %(n::nat) x::real. SOME u::real. (0 < x --> 0 < u) & u ^ n = x" |
2416 |
||
2417 |
lemma root: "ALL (n::nat) x::real. |
|
2418 |
root n x = (SOME u::real. (0 < x --> 0 < u) & u ^ n = x)" |
|
| 14516 | 2419 |
by (import transc root) |
2420 |
||
2421 |
constdefs |
|
2422 |
sqrt :: "real => real" |
|
| 17652 | 2423 |
"sqrt == root 2" |
2424 |
||
2425 |
lemma sqrt: "ALL x::real. sqrt x = root 2 x" |
|
| 14516 | 2426 |
by (import transc sqrt) |
2427 |
||
| 17694 | 2428 |
lemma ROOT_LT_LEMMA: "ALL (n::nat) x::real. 0 < x --> exp (ln x / real (Suc n)) ^ Suc n = x" |
| 14516 | 2429 |
by (import transc ROOT_LT_LEMMA) |
2430 |
||
| 17694 | 2431 |
lemma ROOT_LN: "ALL (n::nat) x::real. 0 < x --> root (Suc n) x = exp (ln x / real (Suc n))" |
| 14516 | 2432 |
by (import transc ROOT_LN) |
2433 |
||
| 17652 | 2434 |
lemma ROOT_0: "ALL n::nat. root (Suc n) 0 = 0" |
| 14516 | 2435 |
by (import transc ROOT_0) |
2436 |
||
| 17652 | 2437 |
lemma ROOT_1: "ALL n::nat. root (Suc n) 1 = 1" |
| 14516 | 2438 |
by (import transc ROOT_1) |
2439 |
||
| 17694 | 2440 |
lemma ROOT_POS_LT: "ALL (n::nat) x::real. 0 < x --> 0 < root (Suc n) x" |
| 14516 | 2441 |
by (import transc ROOT_POS_LT) |
2442 |
||
| 17694 | 2443 |
lemma ROOT_POW_POS: "ALL (n::nat) x::real. 0 <= x --> root (Suc n) x ^ Suc n = x" |
| 14516 | 2444 |
by (import transc ROOT_POW_POS) |
2445 |
||
| 17694 | 2446 |
lemma POW_ROOT_POS: "ALL (n::nat) x::real. 0 <= x --> root (Suc n) (x ^ Suc n) = x" |
| 14516 | 2447 |
by (import transc POW_ROOT_POS) |
2448 |
||
| 17694 | 2449 |
lemma ROOT_POS: "ALL (n::nat) x::real. 0 <= x --> 0 <= root (Suc n) x" |
| 14516 | 2450 |
by (import transc ROOT_POS) |
2451 |
||
| 17694 | 2452 |
lemma ROOT_POS_UNIQ: "ALL (n::nat) (x::real) y::real. |
2453 |
0 <= x & 0 <= y & y ^ Suc n = x --> root (Suc n) x = y" |
|
| 14516 | 2454 |
by (import transc ROOT_POS_UNIQ) |
2455 |
||
| 17694 | 2456 |
lemma ROOT_MUL: "ALL (n::nat) (x::real) y::real. |
2457 |
0 <= x & 0 <= y --> |
|
2458 |
root (Suc n) (x * y) = root (Suc n) x * root (Suc n) y" |
|
| 14516 | 2459 |
by (import transc ROOT_MUL) |
2460 |
||
| 17694 | 2461 |
lemma ROOT_INV: "ALL (n::nat) x::real. |
2462 |
0 <= x --> root (Suc n) (inverse x) = inverse (root (Suc n) x)" |
|
| 14516 | 2463 |
by (import transc ROOT_INV) |
2464 |
||
| 17694 | 2465 |
lemma ROOT_DIV: "ALL (x::nat) (xa::real) xb::real. |
2466 |
0 <= xa & 0 <= xb --> |
|
2467 |
root (Suc x) (xa / xb) = root (Suc x) xa / root (Suc x) xb" |
|
| 14516 | 2468 |
by (import transc ROOT_DIV) |
2469 |
||
| 17694 | 2470 |
lemma ROOT_MONO_LE: "ALL (x::real) y::real. |
2471 |
0 <= x & x <= y --> root (Suc (n::nat)) x <= root (Suc n) y" |
|
| 14516 | 2472 |
by (import transc ROOT_MONO_LE) |
2473 |
||
| 17652 | 2474 |
lemma SQRT_0: "sqrt 0 = 0" |
| 14516 | 2475 |
by (import transc SQRT_0) |
2476 |
||
| 17652 | 2477 |
lemma SQRT_1: "sqrt 1 = 1" |
| 14516 | 2478 |
by (import transc SQRT_1) |
2479 |
||
| 17652 | 2480 |
lemma SQRT_POS_LT: "ALL x>0. 0 < sqrt x" |
| 14516 | 2481 |
by (import transc SQRT_POS_LT) |
2482 |
||
| 17652 | 2483 |
lemma SQRT_POS_LE: "ALL x>=0. 0 <= sqrt x" |
| 14516 | 2484 |
by (import transc SQRT_POS_LE) |
2485 |
||
| 17652 | 2486 |
lemma SQRT_POW2: "ALL x::real. (sqrt x ^ 2 = x) = (0 <= x)" |
| 14516 | 2487 |
by (import transc SQRT_POW2) |
2488 |
||
| 17652 | 2489 |
lemma SQRT_POW_2: "ALL x>=0. sqrt x ^ 2 = x" |
| 14516 | 2490 |
by (import transc SQRT_POW_2) |
2491 |
||
| 17694 | 2492 |
lemma POW_2_SQRT: "0 <= (x::real) --> sqrt (x ^ 2) = x" |
| 14516 | 2493 |
by (import transc POW_2_SQRT) |
2494 |
||
| 17694 | 2495 |
lemma SQRT_POS_UNIQ: "ALL (x::real) xa::real. 0 <= x & 0 <= xa & xa ^ 2 = x --> sqrt x = xa" |
| 14516 | 2496 |
by (import transc SQRT_POS_UNIQ) |
2497 |
||
| 17694 | 2498 |
lemma SQRT_MUL: "ALL (x::real) xa::real. |
2499 |
0 <= x & 0 <= xa --> sqrt (x * xa) = sqrt x * sqrt xa" |
|
| 14516 | 2500 |
by (import transc SQRT_MUL) |
2501 |
||
| 17652 | 2502 |
lemma SQRT_INV: "ALL x>=0. sqrt (inverse x) = inverse (sqrt x)" |
| 14516 | 2503 |
by (import transc SQRT_INV) |
2504 |
||
| 17694 | 2505 |
lemma SQRT_DIV: "ALL (x::real) xa::real. |
2506 |
0 <= x & 0 <= xa --> sqrt (x / xa) = sqrt x / sqrt xa" |
|
| 14516 | 2507 |
by (import transc SQRT_DIV) |
2508 |
||
| 17694 | 2509 |
lemma SQRT_MONO_LE: "ALL (x::real) xa::real. 0 <= x & x <= xa --> sqrt x <= sqrt xa" |
| 14516 | 2510 |
by (import transc SQRT_MONO_LE) |
2511 |
||
| 17694 | 2512 |
lemma SQRT_EVEN_POW2: "ALL n::nat. EVEN n --> sqrt (2 ^ n) = 2 ^ (n div 2)" |
| 14516 | 2513 |
by (import transc SQRT_EVEN_POW2) |
2514 |
||
| 17652 | 2515 |
lemma REAL_DIV_SQRT: "ALL x>=0. x / sqrt x = sqrt x" |
| 14516 | 2516 |
by (import transc REAL_DIV_SQRT) |
2517 |
||
| 17694 | 2518 |
lemma SQRT_EQ: "ALL (x::real) y::real. x ^ 2 = y & 0 <= x --> x = sqrt y" |
| 14516 | 2519 |
by (import transc SQRT_EQ) |
2520 |
||
| 17652 | 2521 |
lemma SIN_0: "sin 0 = 0" |
| 14516 | 2522 |
by (import transc SIN_0) |
2523 |
||
| 17652 | 2524 |
lemma COS_0: "cos 0 = 1" |
| 14516 | 2525 |
by (import transc COS_0) |
2526 |
||
| 17652 | 2527 |
lemma SIN_CIRCLE: "ALL x::real. sin x ^ 2 + cos x ^ 2 = 1" |
| 14516 | 2528 |
by (import transc SIN_CIRCLE) |
2529 |
||
| 17652 | 2530 |
lemma SIN_BOUND: "ALL x::real. abs (sin x) <= 1" |
| 14516 | 2531 |
by (import transc SIN_BOUND) |
2532 |
||
| 17652 | 2533 |
lemma SIN_BOUNDS: "ALL x::real. - 1 <= sin x & sin x <= 1" |
| 14516 | 2534 |
by (import transc SIN_BOUNDS) |
2535 |
||
| 17652 | 2536 |
lemma COS_BOUND: "ALL x::real. abs (cos x) <= 1" |
| 14516 | 2537 |
by (import transc COS_BOUND) |
2538 |
||
| 17652 | 2539 |
lemma COS_BOUNDS: "ALL x::real. - 1 <= cos x & cos x <= 1" |
| 14516 | 2540 |
by (import transc COS_BOUNDS) |
2541 |
||
| 17644 | 2542 |
lemma SIN_COS_ADD: "ALL (x::real) y::real. |
| 14516 | 2543 |
(sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 + |
2544 |
(cos (x + y) - (cos x * cos y - sin x * sin y)) ^ 2 = |
|
| 17652 | 2545 |
0" |
| 14516 | 2546 |
by (import transc SIN_COS_ADD) |
2547 |
||
| 17652 | 2548 |
lemma SIN_COS_NEG: "ALL x::real. (sin (- x) + sin x) ^ 2 + (cos (- x) - cos x) ^ 2 = 0" |
| 14516 | 2549 |
by (import transc SIN_COS_NEG) |
2550 |
||
| 17644 | 2551 |
lemma SIN_ADD: "ALL (x::real) y::real. sin (x + y) = sin x * cos y + cos x * sin y" |
| 14516 | 2552 |
by (import transc SIN_ADD) |
2553 |
||
| 17644 | 2554 |
lemma COS_ADD: "ALL (x::real) y::real. cos (x + y) = cos x * cos y - sin x * sin y" |
| 14516 | 2555 |
by (import transc COS_ADD) |
2556 |
||
| 17644 | 2557 |
lemma SIN_NEG: "ALL x::real. sin (- x) = - sin x" |
| 14516 | 2558 |
by (import transc SIN_NEG) |
2559 |
||
| 17644 | 2560 |
lemma COS_NEG: "ALL x::real. cos (- x) = cos x" |
| 14516 | 2561 |
by (import transc COS_NEG) |
2562 |
||
| 17652 | 2563 |
lemma SIN_DOUBLE: "ALL x::real. sin (2 * x) = 2 * (sin x * cos x)" |
| 14516 | 2564 |
by (import transc SIN_DOUBLE) |
2565 |
||
| 17652 | 2566 |
lemma COS_DOUBLE: "ALL x::real. cos (2 * x) = cos x ^ 2 - sin x ^ 2" |
| 14516 | 2567 |
by (import transc COS_DOUBLE) |
2568 |
||
| 17644 | 2569 |
lemma SIN_PAIRED: "ALL x::real. |
| 17652 | 2570 |
sums (%n::nat. (- 1) ^ n / real (FACT (2 * n + 1)) * x ^ (2 * n + 1)) |
| 17644 | 2571 |
(sin x)" |
| 14516 | 2572 |
by (import transc SIN_PAIRED) |
2573 |
||
| 17694 | 2574 |
lemma SIN_POS: "ALL x::real. 0 < x & x < 2 --> 0 < sin x" |
| 14516 | 2575 |
by (import transc SIN_POS) |
2576 |
||
| 17644 | 2577 |
lemma COS_PAIRED: "ALL x::real. |
| 17652 | 2578 |
sums (%n::nat. (- 1) ^ n / real (FACT (2 * n)) * x ^ (2 * n)) (cos x)" |
| 14516 | 2579 |
by (import transc COS_PAIRED) |
2580 |
||
| 17652 | 2581 |
lemma COS_2: "cos 2 < 0" |
| 14516 | 2582 |
by (import transc COS_2) |
2583 |
||
| 17652 | 2584 |
lemma COS_ISZERO: "EX! x::real. 0 <= x & x <= 2 & cos x = 0" |
| 14516 | 2585 |
by (import transc COS_ISZERO) |
2586 |
||
2587 |
constdefs |
|
2588 |
pi :: "real" |
|
| 17652 | 2589 |
"pi == 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)" |
2590 |
||
2591 |
lemma pi: "pi = 2 * (SOME x::real. 0 <= x & x <= 2 & cos x = 0)" |
|
| 14516 | 2592 |
by (import transc pi) |
2593 |
||
| 17652 | 2594 |
lemma PI2: "pi / 2 = (SOME x::real. 0 <= x & x <= 2 & cos x = 0)" |
| 14516 | 2595 |
by (import transc PI2) |
2596 |
||
| 17652 | 2597 |
lemma COS_PI2: "cos (pi / 2) = 0" |
| 14516 | 2598 |
by (import transc COS_PI2) |
2599 |
||
| 17652 | 2600 |
lemma PI2_BOUNDS: "0 < pi / 2 & pi / 2 < 2" |
| 14516 | 2601 |
by (import transc PI2_BOUNDS) |
2602 |
||
| 17652 | 2603 |
lemma PI_POS: "0 < pi" |
| 14516 | 2604 |
by (import transc PI_POS) |
2605 |
||
| 17652 | 2606 |
lemma SIN_PI2: "sin (pi / 2) = 1" |
| 14516 | 2607 |
by (import transc SIN_PI2) |
2608 |
||
| 17652 | 2609 |
lemma COS_PI: "cos pi = - 1" |
| 14516 | 2610 |
by (import transc COS_PI) |
2611 |
||
| 17652 | 2612 |
lemma SIN_PI: "sin pi = 0" |
| 14516 | 2613 |
by (import transc SIN_PI) |
2614 |
||
| 17652 | 2615 |
lemma SIN_COS: "ALL x::real. sin x = cos (pi / 2 - x)" |
| 14516 | 2616 |
by (import transc SIN_COS) |
2617 |
||
| 17652 | 2618 |
lemma COS_SIN: "ALL x::real. cos x = sin (pi / 2 - x)" |
| 14516 | 2619 |
by (import transc COS_SIN) |
2620 |
||
| 17644 | 2621 |
lemma SIN_PERIODIC_PI: "ALL x::real. sin (x + pi) = - sin x" |
| 14516 | 2622 |
by (import transc SIN_PERIODIC_PI) |
2623 |
||
| 17644 | 2624 |
lemma COS_PERIODIC_PI: "ALL x::real. cos (x + pi) = - cos x" |
| 14516 | 2625 |
by (import transc COS_PERIODIC_PI) |
2626 |
||
| 17652 | 2627 |
lemma SIN_PERIODIC: "ALL x::real. sin (x + 2 * pi) = sin x" |
| 14516 | 2628 |
by (import transc SIN_PERIODIC) |
2629 |
||
| 17652 | 2630 |
lemma COS_PERIODIC: "ALL x::real. cos (x + 2 * pi) = cos x" |
| 14516 | 2631 |
by (import transc COS_PERIODIC) |
2632 |
||
| 17652 | 2633 |
lemma COS_NPI: "ALL n::nat. cos (real n * pi) = (- 1) ^ n" |
| 14516 | 2634 |
by (import transc COS_NPI) |
2635 |
||
| 17652 | 2636 |
lemma SIN_NPI: "ALL n::nat. sin (real n * pi) = 0" |
| 14516 | 2637 |
by (import transc SIN_NPI) |
2638 |
||
| 17694 | 2639 |
lemma SIN_POS_PI2: "ALL x::real. 0 < x & x < pi / 2 --> 0 < sin x" |
| 14516 | 2640 |
by (import transc SIN_POS_PI2) |
2641 |
||
| 17694 | 2642 |
lemma COS_POS_PI2: "ALL x::real. 0 < x & x < pi / 2 --> 0 < cos x" |
| 14516 | 2643 |
by (import transc COS_POS_PI2) |
2644 |
||
| 17694 | 2645 |
lemma COS_POS_PI: "ALL x::real. - (pi / 2) < x & x < pi / 2 --> 0 < cos x" |
| 14516 | 2646 |
by (import transc COS_POS_PI) |
2647 |
||
| 17694 | 2648 |
lemma SIN_POS_PI: "ALL x::real. 0 < x & x < pi --> 0 < sin x" |
| 14516 | 2649 |
by (import transc SIN_POS_PI) |
2650 |
||
| 17694 | 2651 |
lemma COS_POS_PI2_LE: "ALL x::real. 0 <= x & x <= pi / 2 --> 0 <= cos x" |
| 14516 | 2652 |
by (import transc COS_POS_PI2_LE) |
2653 |
||
| 17694 | 2654 |
lemma COS_POS_PI_LE: "ALL x::real. - (pi / 2) <= x & x <= pi / 2 --> 0 <= cos x" |
| 14516 | 2655 |
by (import transc COS_POS_PI_LE) |
2656 |
||
| 17694 | 2657 |
lemma SIN_POS_PI2_LE: "ALL x::real. 0 <= x & x <= pi / 2 --> 0 <= sin x" |
| 14516 | 2658 |
by (import transc SIN_POS_PI2_LE) |
2659 |
||
| 17694 | 2660 |
lemma SIN_POS_PI_LE: "ALL x::real. 0 <= x & x <= pi --> 0 <= sin x" |
| 14516 | 2661 |
by (import transc SIN_POS_PI_LE) |
2662 |
||
| 17694 | 2663 |
lemma COS_TOTAL: "ALL y::real. |
2664 |
- 1 <= y & y <= 1 --> (EX! x::real. 0 <= x & x <= pi & cos x = y)" |
|
| 14516 | 2665 |
by (import transc COS_TOTAL) |
2666 |
||
| 17694 | 2667 |
lemma SIN_TOTAL: "ALL y::real. |
2668 |
- 1 <= y & y <= 1 --> |
|
2669 |
(EX! x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y)" |
|
| 14516 | 2670 |
by (import transc SIN_TOTAL) |
2671 |
||
| 17694 | 2672 |
lemma COS_ZERO_LEMMA: "ALL x::real. |
2673 |
0 <= x & cos x = 0 --> (EX n::nat. ~ EVEN n & x = real n * (pi / 2))" |
|
| 14516 | 2674 |
by (import transc COS_ZERO_LEMMA) |
2675 |
||
| 17694 | 2676 |
lemma SIN_ZERO_LEMMA: "ALL x::real. |
2677 |
0 <= x & sin x = 0 --> (EX n::nat. EVEN n & x = real n * (pi / 2))" |
|
| 14516 | 2678 |
by (import transc SIN_ZERO_LEMMA) |
2679 |
||
| 17644 | 2680 |
lemma COS_ZERO: "ALL x::real. |
| 17652 | 2681 |
(cos x = 0) = |
2682 |
((EX n::nat. ~ EVEN n & x = real n * (pi / 2)) | |
|
2683 |
(EX n::nat. ~ EVEN n & x = - (real n * (pi / 2))))" |
|
| 14516 | 2684 |
by (import transc COS_ZERO) |
2685 |
||
| 17644 | 2686 |
lemma SIN_ZERO: "ALL x::real. |
| 17652 | 2687 |
(sin x = 0) = |
2688 |
((EX n::nat. EVEN n & x = real n * (pi / 2)) | |
|
2689 |
(EX n::nat. EVEN n & x = - (real n * (pi / 2))))" |
|
| 14516 | 2690 |
by (import transc SIN_ZERO) |
2691 |
||
2692 |
constdefs |
|
2693 |
tan :: "real => real" |
|
| 17644 | 2694 |
"tan == %x::real. sin x / cos x" |
2695 |
||
2696 |
lemma tan: "ALL x::real. tan x = sin x / cos x" |
|
| 14516 | 2697 |
by (import transc tan) |
2698 |
||
| 17652 | 2699 |
lemma TAN_0: "tan 0 = 0" |
| 14516 | 2700 |
by (import transc TAN_0) |
2701 |
||
| 17652 | 2702 |
lemma TAN_PI: "tan pi = 0" |
| 14516 | 2703 |
by (import transc TAN_PI) |
2704 |
||
| 17652 | 2705 |
lemma TAN_NPI: "ALL n::nat. tan (real n * pi) = 0" |
| 14516 | 2706 |
by (import transc TAN_NPI) |
2707 |
||
| 17644 | 2708 |
lemma TAN_NEG: "ALL x::real. tan (- x) = - tan x" |
| 14516 | 2709 |
by (import transc TAN_NEG) |
2710 |
||
| 17652 | 2711 |
lemma TAN_PERIODIC: "ALL x::real. tan (x + 2 * pi) = tan x" |
| 14516 | 2712 |
by (import transc TAN_PERIODIC) |
2713 |
||
| 17694 | 2714 |
lemma TAN_ADD: "ALL (x::real) y::real. |
2715 |
cos x ~= 0 & cos y ~= 0 & cos (x + y) ~= 0 --> |
|
2716 |
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y)" |
|
| 14516 | 2717 |
by (import transc TAN_ADD) |
2718 |
||
| 17694 | 2719 |
lemma TAN_DOUBLE: "ALL x::real. |
2720 |
cos x ~= 0 & cos (2 * x) ~= 0 --> |
|
2721 |
tan (2 * x) = 2 * tan x / (1 - tan x ^ 2)" |
|
| 14516 | 2722 |
by (import transc TAN_DOUBLE) |
2723 |
||
| 17694 | 2724 |
lemma TAN_POS_PI2: "ALL x::real. 0 < x & x < pi / 2 --> 0 < tan x" |
| 14516 | 2725 |
by (import transc TAN_POS_PI2) |
2726 |
||
| 17694 | 2727 |
lemma DIFF_TAN: "ALL x::real. cos x ~= 0 --> diffl tan (inverse (cos x ^ 2)) x" |
| 14516 | 2728 |
by (import transc DIFF_TAN) |
2729 |
||
| 17652 | 2730 |
lemma TAN_TOTAL_LEMMA: "ALL y>0. EX x>0. x < pi / 2 & y < tan x" |
| 14516 | 2731 |
by (import transc TAN_TOTAL_LEMMA) |
2732 |
||
| 17652 | 2733 |
lemma TAN_TOTAL_POS: "ALL y>=0. EX x>=0. x < pi / 2 & tan x = y" |
| 14516 | 2734 |
by (import transc TAN_TOTAL_POS) |
2735 |
||
| 17652 | 2736 |
lemma TAN_TOTAL: "ALL y::real. EX! x::real. - (pi / 2) < x & x < pi / 2 & tan x = y" |
| 14516 | 2737 |
by (import transc TAN_TOTAL) |
2738 |
||
2739 |
constdefs |
|
2740 |
asn :: "real => real" |
|
| 17652 | 2741 |
"asn == %y::real. SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y" |
| 17644 | 2742 |
|
2743 |
lemma asn: "ALL y::real. |
|
| 17652 | 2744 |
asn y = (SOME x::real. - (pi / 2) <= x & x <= pi / 2 & sin x = y)" |
| 14516 | 2745 |
by (import transc asn) |
2746 |
||
2747 |
constdefs |
|
2748 |
acs :: "real => real" |
|
| 17652 | 2749 |
"acs == %y::real. SOME x::real. 0 <= x & x <= pi & cos x = y" |
2750 |
||
2751 |
lemma acs: "ALL y::real. acs y = (SOME x::real. 0 <= x & x <= pi & cos x = y)" |
|
| 14516 | 2752 |
by (import transc acs) |
2753 |
||
2754 |
constdefs |
|
2755 |
atn :: "real => real" |
|
| 17652 | 2756 |
"atn == %y::real. SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y" |
2757 |
||
2758 |
lemma atn: "ALL y::real. atn y = (SOME x::real. - (pi / 2) < x & x < pi / 2 & tan x = y)" |
|
| 14516 | 2759 |
by (import transc atn) |
2760 |
||
| 17694 | 2761 |
lemma ASN: "ALL y::real. |
2762 |
- 1 <= y & y <= 1 --> |
|
2763 |
- (pi / 2) <= asn y & asn y <= pi / 2 & sin (asn y) = y" |
|
| 14516 | 2764 |
by (import transc ASN) |
2765 |
||
| 17694 | 2766 |
lemma ASN_SIN: "ALL y::real. - 1 <= y & y <= 1 --> sin (asn y) = y" |
| 14516 | 2767 |
by (import transc ASN_SIN) |
2768 |
||
| 17694 | 2769 |
lemma ASN_BOUNDS: "ALL y::real. - 1 <= y & y <= 1 --> - (pi / 2) <= asn y & asn y <= pi / 2" |
| 14516 | 2770 |
by (import transc ASN_BOUNDS) |
2771 |
||
| 17694 | 2772 |
lemma ASN_BOUNDS_LT: "ALL y::real. - 1 < y & y < 1 --> - (pi / 2) < asn y & asn y < pi / 2" |
| 14516 | 2773 |
by (import transc ASN_BOUNDS_LT) |
2774 |
||
| 17694 | 2775 |
lemma SIN_ASN: "ALL x::real. - (pi / 2) <= x & x <= pi / 2 --> asn (sin x) = x" |
| 14516 | 2776 |
by (import transc SIN_ASN) |
2777 |
||
| 17694 | 2778 |
lemma ACS: "ALL y::real. |
2779 |
- 1 <= y & y <= 1 --> 0 <= acs y & acs y <= pi & cos (acs y) = y" |
|
| 14516 | 2780 |
by (import transc ACS) |
2781 |
||
| 17694 | 2782 |
lemma ACS_COS: "ALL y::real. - 1 <= y & y <= 1 --> cos (acs y) = y" |
| 14516 | 2783 |
by (import transc ACS_COS) |
2784 |
||
| 17694 | 2785 |
lemma ACS_BOUNDS: "ALL y::real. - 1 <= y & y <= 1 --> 0 <= acs y & acs y <= pi" |
| 14516 | 2786 |
by (import transc ACS_BOUNDS) |
2787 |
||
| 17694 | 2788 |
lemma ACS_BOUNDS_LT: "ALL y::real. - 1 < y & y < 1 --> 0 < acs y & acs y < pi" |
| 14516 | 2789 |
by (import transc ACS_BOUNDS_LT) |
2790 |
||
| 17694 | 2791 |
lemma COS_ACS: "ALL x::real. 0 <= x & x <= pi --> acs (cos x) = x" |
| 14516 | 2792 |
by (import transc COS_ACS) |
2793 |
||
| 17652 | 2794 |
lemma ATN: "ALL y::real. - (pi / 2) < atn y & atn y < pi / 2 & tan (atn y) = y" |
| 14516 | 2795 |
by (import transc ATN) |
2796 |
||
| 17644 | 2797 |
lemma ATN_TAN: "ALL x::real. tan (atn x) = x" |
| 14516 | 2798 |
by (import transc ATN_TAN) |
2799 |
||
| 17652 | 2800 |
lemma ATN_BOUNDS: "ALL x::real. - (pi / 2) < atn x & atn x < pi / 2" |
| 14516 | 2801 |
by (import transc ATN_BOUNDS) |
2802 |
||
| 17694 | 2803 |
lemma TAN_ATN: "ALL x::real. - (pi / 2) < x & x < pi / 2 --> atn (tan x) = x" |
| 14516 | 2804 |
by (import transc TAN_ATN) |
2805 |
||
| 17694 | 2806 |
lemma TAN_SEC: "ALL x::real. cos x ~= 0 --> 1 + tan x ^ 2 = inverse (cos x) ^ 2" |
| 14516 | 2807 |
by (import transc TAN_SEC) |
2808 |
||
| 17694 | 2809 |
lemma SIN_COS_SQ: "ALL x::real. 0 <= x & x <= pi --> sin x = sqrt (1 - cos x ^ 2)" |
| 14516 | 2810 |
by (import transc SIN_COS_SQ) |
2811 |
||
| 17694 | 2812 |
lemma COS_SIN_SQ: "ALL x::real. - (pi / 2) <= x & x <= pi / 2 --> cos x = sqrt (1 - sin x ^ 2)" |
| 14516 | 2813 |
by (import transc COS_SIN_SQ) |
2814 |
||
| 17652 | 2815 |
lemma COS_ATN_NZ: "ALL x::real. cos (atn x) ~= 0" |
| 14516 | 2816 |
by (import transc COS_ATN_NZ) |
2817 |
||
| 17694 | 2818 |
lemma COS_ASN_NZ: "ALL x::real. - 1 < x & x < 1 --> cos (asn x) ~= 0" |
| 14516 | 2819 |
by (import transc COS_ASN_NZ) |
2820 |
||
| 17694 | 2821 |
lemma SIN_ACS_NZ: "ALL x::real. - 1 < x & x < 1 --> sin (acs x) ~= 0" |
| 14516 | 2822 |
by (import transc SIN_ACS_NZ) |
2823 |
||
| 17694 | 2824 |
lemma COS_SIN_SQRT: "ALL x::real. 0 <= cos x --> cos x = sqrt (1 - sin x ^ 2)" |
| 14516 | 2825 |
by (import transc COS_SIN_SQRT) |
2826 |
||
| 17694 | 2827 |
lemma SIN_COS_SQRT: "ALL x::real. 0 <= sin x --> sin x = sqrt (1 - cos x ^ 2)" |
| 14516 | 2828 |
by (import transc SIN_COS_SQRT) |
2829 |
||
| 17652 | 2830 |
lemma DIFF_LN: "ALL x>0. diffl ln (inverse x) x" |
| 14516 | 2831 |
by (import transc DIFF_LN) |
2832 |
||
| 17694 | 2833 |
lemma DIFF_ASN_LEMMA: "ALL x::real. - 1 < x & x < 1 --> diffl asn (inverse (cos (asn x))) x" |
| 14516 | 2834 |
by (import transc DIFF_ASN_LEMMA) |
2835 |
||
| 17694 | 2836 |
lemma DIFF_ASN: "ALL x::real. - 1 < x & x < 1 --> diffl asn (inverse (sqrt (1 - x ^ 2))) x" |
| 14516 | 2837 |
by (import transc DIFF_ASN) |
2838 |
||
| 17694 | 2839 |
lemma DIFF_ACS_LEMMA: "ALL x::real. - 1 < x & x < 1 --> diffl acs (inverse (- sin (acs x))) x" |
| 14516 | 2840 |
by (import transc DIFF_ACS_LEMMA) |
2841 |
||
| 17694 | 2842 |
lemma DIFF_ACS: "ALL x::real. - 1 < x & x < 1 --> diffl acs (- inverse (sqrt (1 - x ^ 2))) x" |
| 14516 | 2843 |
by (import transc DIFF_ACS) |
2844 |
||
| 17652 | 2845 |
lemma DIFF_ATN: "ALL x::real. diffl atn (inverse (1 + x ^ 2)) x" |
| 14516 | 2846 |
by (import transc DIFF_ATN) |
2847 |
||
2848 |
constdefs |
|
2849 |
division :: "real * real => (nat => real) => bool" |
|
2850 |
"(op ==::(real * real => (nat => real) => bool) |
|
2851 |
=> (real * real => (nat => real) => bool) => prop) |
|
2852 |
(division::real * real => (nat => real) => bool) |
|
2853 |
((split::(real => real => (nat => real) => bool) |
|
2854 |
=> real * real => (nat => real) => bool) |
|
2855 |
(%(a::real) (b::real) D::nat => real. |
|
2856 |
(op &::bool => bool => bool) |
|
2857 |
((op =::real => real => bool) (D (0::nat)) a) |
|
2858 |
((Ex::(nat => bool) => bool) |
|
2859 |
(%N::nat. |
|
2860 |
(op &::bool => bool => bool) |
|
2861 |
((All::(nat => bool) => bool) |
|
2862 |
(%n::nat. |
|
2863 |
(op -->::bool => bool => bool) |
|
2864 |
((op <::nat => nat => bool) n N) |
|
2865 |
((op <::real => real => bool) (D n) |
|
2866 |
(D ((Suc::nat => nat) n))))) |
|
2867 |
((All::(nat => bool) => bool) |
|
2868 |
(%n::nat. |
|
2869 |
(op -->::bool => bool => bool) |
|
2870 |
((op <=::nat => nat => bool) N n) |
|
2871 |
((op =::real => real => bool) (D n) b)))))))" |
|
2872 |
||
2873 |
lemma division: "(All::(real => bool) => bool) |
|
2874 |
(%a::real. |
|
2875 |
(All::(real => bool) => bool) |
|
2876 |
(%b::real. |
|
2877 |
(All::((nat => real) => bool) => bool) |
|
2878 |
(%D::nat => real. |
|
2879 |
(op =::bool => bool => bool) |
|
2880 |
((division::real * real => (nat => real) => bool) |
|
2881 |
((Pair::real => real => real * real) a b) D) |
|
2882 |
((op &::bool => bool => bool) |
|
2883 |
((op =::real => real => bool) (D (0::nat)) a) |
|
2884 |
((Ex::(nat => bool) => bool) |
|
2885 |
(%N::nat. |
|
2886 |
(op &::bool => bool => bool) |
|
2887 |
((All::(nat => bool) => bool) |
|
2888 |
(%n::nat. |
|
2889 |
(op -->::bool => bool => bool) |
|
2890 |
((op <::nat => nat => bool) n N) |
|
2891 |
((op <::real => real => bool) (D n) |
|
2892 |
(D ((Suc::nat => nat) n))))) |
|
2893 |
((All::(nat => bool) => bool) |
|
2894 |
(%n::nat. |
|
2895 |
(op -->::bool => bool => bool) |
|
2896 |
((op <=::nat => nat => bool) N n) |
|
2897 |
((op =::real => real => bool) (D n) |
|
2898 |
b)))))))))" |
|
2899 |
by (import transc division) |
|
2900 |
||
2901 |
constdefs |
|
2902 |
dsize :: "(nat => real) => nat" |
|
2903 |
"(op ==::((nat => real) => nat) => ((nat => real) => nat) => prop) |
|
2904 |
(dsize::(nat => real) => nat) |
|
2905 |
(%D::nat => real. |
|
2906 |
(Eps::(nat => bool) => nat) |
|
2907 |
(%N::nat. |
|
2908 |
(op &::bool => bool => bool) |
|
2909 |
((All::(nat => bool) => bool) |
|
2910 |
(%n::nat. |
|
2911 |
(op -->::bool => bool => bool) |
|
2912 |
((op <::nat => nat => bool) n N) |
|
2913 |
((op <::real => real => bool) (D n) |
|
2914 |
(D ((Suc::nat => nat) n))))) |
|
2915 |
((All::(nat => bool) => bool) |
|
2916 |
(%n::nat. |
|
2917 |
(op -->::bool => bool => bool) |
|
2918 |
((op <=::nat => nat => bool) N n) |
|
2919 |
((op =::real => real => bool) (D n) (D N))))))" |
|
2920 |
||
2921 |
lemma dsize: "(All::((nat => real) => bool) => bool) |
|
2922 |
(%D::nat => real. |
|
2923 |
(op =::nat => nat => bool) ((dsize::(nat => real) => nat) D) |
|
2924 |
((Eps::(nat => bool) => nat) |
|
2925 |
(%N::nat. |
|
2926 |
(op &::bool => bool => bool) |
|
2927 |
((All::(nat => bool) => bool) |
|
2928 |
(%n::nat. |
|
2929 |
(op -->::bool => bool => bool) |
|
2930 |
((op <::nat => nat => bool) n N) |
|
2931 |
((op <::real => real => bool) (D n) |
|
2932 |
(D ((Suc::nat => nat) n))))) |
|
2933 |
((All::(nat => bool) => bool) |
|
2934 |
(%n::nat. |
|
2935 |
(op -->::bool => bool => bool) |
|
2936 |
((op <=::nat => nat => bool) N n) |
|
2937 |
((op =::real => real => bool) (D n) (D N)))))))" |
|
2938 |
by (import transc dsize) |
|
2939 |
||
2940 |
constdefs |
|
2941 |
tdiv :: "real * real => (nat => real) * (nat => real) => bool" |
|
2942 |
"tdiv == |
|
| 17644 | 2943 |
%(a::real, b::real) (D::nat => real, p::nat => real). |
2944 |
division (a, b) D & (ALL n::nat. D n <= p n & p n <= D (Suc n))" |
|
2945 |
||
2946 |
lemma tdiv: "ALL (a::real) (b::real) (D::nat => real) p::nat => real. |
|
| 14516 | 2947 |
tdiv (a, b) (D, p) = |
| 17644 | 2948 |
(division (a, b) D & (ALL n::nat. D n <= p n & p n <= D (Suc n)))" |
| 14516 | 2949 |
by (import transc tdiv) |
2950 |
||
2951 |
constdefs |
|
2952 |
gauge :: "(real => bool) => (real => real) => bool" |
|
| 17694 | 2953 |
"gauge == %(E::real => bool) g::real => real. ALL x::real. E x --> 0 < g x" |
2954 |
||
2955 |
lemma gauge: "ALL (E::real => bool) g::real => real. |
|
2956 |
gauge E g = (ALL x::real. E x --> 0 < g x)" |
|
| 14516 | 2957 |
by (import transc gauge) |
2958 |
||
2959 |
constdefs |
|
2960 |
fine :: "(real => real) => (nat => real) * (nat => real) => bool" |
|
| 14847 | 2961 |
"(op ==::((real => real) => (nat => real) * (nat => real) => bool) |
2962 |
=> ((real => real) => (nat => real) * (nat => real) => bool) |
|
2963 |
=> prop) |
|
2964 |
(fine::(real => real) => (nat => real) * (nat => real) => bool) |
|
2965 |
(%g::real => real. |
|
2966 |
(split::((nat => real) => (nat => real) => bool) |
|
2967 |
=> (nat => real) * (nat => real) => bool) |
|
2968 |
(%(D::nat => real) p::nat => real. |
|
2969 |
(All::(nat => bool) => bool) |
|
2970 |
(%n::nat. |
|
2971 |
(op -->::bool => bool => bool) |
|
2972 |
((op <::nat => nat => bool) n |
|
2973 |
((dsize::(nat => real) => nat) D)) |
|
2974 |
((op <::real => real => bool) |
|
2975 |
((op -::real => real => real) (D ((Suc::nat => nat) n)) |
|
2976 |
(D n)) |
|
2977 |
(g (p n))))))" |
|
2978 |
||
2979 |
lemma fine: "(All::((real => real) => bool) => bool) |
|
2980 |
(%g::real => real. |
|
2981 |
(All::((nat => real) => bool) => bool) |
|
2982 |
(%D::nat => real. |
|
2983 |
(All::((nat => real) => bool) => bool) |
|
2984 |
(%p::nat => real. |
|
2985 |
(op =::bool => bool => bool) |
|
2986 |
((fine::(real => real) |
|
2987 |
=> (nat => real) * (nat => real) => bool) |
|
2988 |
g ((Pair::(nat => real) |
|
2989 |
=> (nat => real) |
|
2990 |
=> (nat => real) * (nat => real)) |
|
2991 |
D p)) |
|
2992 |
((All::(nat => bool) => bool) |
|
2993 |
(%n::nat. |
|
2994 |
(op -->::bool => bool => bool) |
|
2995 |
((op <::nat => nat => bool) n |
|
2996 |
((dsize::(nat => real) => nat) D)) |
|
2997 |
((op <::real => real => bool) |
|
2998 |
((op -::real => real => real) |
|
2999 |
(D ((Suc::nat => nat) n)) (D n)) |
|
3000 |
(g (p n))))))))" |
|
| 14516 | 3001 |
by (import transc fine) |
3002 |
||
3003 |
constdefs |
|
3004 |
rsum :: "(nat => real) * (nat => real) => (real => real) => real" |
|
| 17644 | 3005 |
"rsum == |
3006 |
%(D::nat => real, p::nat => real) f::real => real. |
|
| 17652 | 3007 |
real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))" |
| 17644 | 3008 |
|
3009 |
lemma rsum: "ALL (D::nat => real) (p::nat => real) f::real => real. |
|
3010 |
rsum (D, p) f = |
|
| 17652 | 3011 |
real.sum (0, dsize D) (%n::nat. f (p n) * (D (Suc n) - D n))" |
| 14516 | 3012 |
by (import transc rsum) |
3013 |
||
3014 |
constdefs |
|
3015 |
Dint :: "real * real => (real => real) => real => bool" |
|
| 17694 | 3016 |
"Dint == |
3017 |
%(a::real, b::real) (f::real => real) k::real. |
|
3018 |
ALL e>0. |
|
3019 |
EX g::real => real. |
|
3020 |
gauge (%x::real. a <= x & x <= b) g & |
|
3021 |
(ALL (D::nat => real) p::nat => real. |
|
3022 |
tdiv (a, b) (D, p) & fine g (D, p) --> |
|
3023 |
abs (rsum (D, p) f - k) < e)" |
|
3024 |
||
3025 |
lemma Dint: "ALL (a::real) (b::real) (f::real => real) k::real. |
|
3026 |
Dint (a, b) f k = |
|
3027 |
(ALL e>0. |
|
3028 |
EX g::real => real. |
|
3029 |
gauge (%x::real. a <= x & x <= b) g & |
|
3030 |
(ALL (D::nat => real) p::nat => real. |
|
3031 |
tdiv (a, b) (D, p) & fine g (D, p) --> |
|
3032 |
abs (rsum (D, p) f - k) < e))" |
|
| 14516 | 3033 |
by (import transc Dint) |
3034 |
||
| 17694 | 3035 |
lemma DIVISION_0: "ALL (a::real) b::real. a = b --> dsize (%n::nat. if n = 0 then a else b) = 0" |
| 14516 | 3036 |
by (import transc DIVISION_0) |
3037 |
||
| 17694 | 3038 |
lemma DIVISION_1: "ALL (a::real) b::real. a < b --> dsize (%n::nat. if n = 0 then a else b) = 1" |
| 14516 | 3039 |
by (import transc DIVISION_1) |
3040 |
||
| 17694 | 3041 |
lemma DIVISION_SINGLE: "ALL (a::real) b::real. |
3042 |
a <= b --> division (a, b) (%n::nat. if n = 0 then a else b)" |
|
| 14516 | 3043 |
by (import transc DIVISION_SINGLE) |
3044 |
||
| 17694 | 3045 |
lemma DIVISION_LHS: "ALL (D::nat => real) (a::real) b::real. division (a, b) D --> D 0 = a" |
| 14516 | 3046 |
by (import transc DIVISION_LHS) |
3047 |
||
3048 |
lemma DIVISION_THM: "(All::((nat => real) => bool) => bool) |
|
3049 |
(%D::nat => real. |
|
3050 |
(All::(real => bool) => bool) |
|
3051 |
(%a::real. |
|
3052 |
(All::(real => bool) => bool) |
|
3053 |
(%b::real. |
|
3054 |
(op =::bool => bool => bool) |
|
3055 |
((division::real * real => (nat => real) => bool) |
|
3056 |
((Pair::real => real => real * real) a b) D) |
|
3057 |
((op &::bool => bool => bool) |
|
3058 |
((op =::real => real => bool) (D (0::nat)) a) |
|
3059 |
((op &::bool => bool => bool) |
|
3060 |
((All::(nat => bool) => bool) |
|
3061 |
(%n::nat. |
|
3062 |
(op -->::bool => bool => bool) |
|
3063 |
((op <::nat => nat => bool) n |
|
3064 |
((dsize::(nat => real) => nat) D)) |
|
3065 |
((op <::real => real => bool) (D n) |
|
3066 |
(D ((Suc::nat => nat) n))))) |
|
3067 |
((All::(nat => bool) => bool) |
|
3068 |
(%n::nat. |
|
3069 |
(op -->::bool => bool => bool) |
|
3070 |
((op <=::nat => nat => bool) |
|
3071 |
((dsize::(nat => real) => nat) D) n) |
|
3072 |
((op =::real => real => bool) (D n) b))))))))" |
|
3073 |
by (import transc DIVISION_THM) |
|
3074 |
||
| 17694 | 3075 |
lemma DIVISION_RHS: "ALL (D::nat => real) (a::real) b::real. |
3076 |
division (a, b) D --> D (dsize D) = b" |
|
| 14516 | 3077 |
by (import transc DIVISION_RHS) |
3078 |
||
| 17694 | 3079 |
lemma DIVISION_LT_GEN: "ALL (D::nat => real) (a::real) (b::real) (m::nat) n::nat. |
3080 |
division (a, b) D & m < n & n <= dsize D --> D m < D n" |
|
| 14516 | 3081 |
by (import transc DIVISION_LT_GEN) |
3082 |
||
3083 |
lemma DIVISION_LT: "(All::((nat => real) => bool) => bool) |
|
3084 |
(%D::nat => real. |
|
3085 |
(All::(real => bool) => bool) |
|
3086 |
(%a::real. |
|
3087 |
(All::(real => bool) => bool) |
|
3088 |
(%b::real. |
|
3089 |
(op -->::bool => bool => bool) |
|
3090 |
((division::real * real => (nat => real) => bool) |
|
3091 |
((Pair::real => real => real * real) a b) D) |
|
3092 |
((All::(nat => bool) => bool) |
|
3093 |
(%n::nat. |
|
3094 |
(op -->::bool => bool => bool) |
|
3095 |
((op <::nat => nat => bool) n |
|
3096 |
((dsize::(nat => real) => nat) D)) |
|
3097 |
((op <::real => real => bool) (D (0::nat)) |
|
3098 |
(D ((Suc::nat => nat) n))))))))" |
|
3099 |
by (import transc DIVISION_LT) |
|
3100 |
||
| 17694 | 3101 |
lemma DIVISION_LE: "ALL (D::nat => real) (a::real) b::real. division (a, b) D --> a <= b" |
| 14516 | 3102 |
by (import transc DIVISION_LE) |
3103 |
||
3104 |
lemma DIVISION_GT: "(All::((nat => real) => bool) => bool) |
|
3105 |
(%D::nat => real. |
|
3106 |
(All::(real => bool) => bool) |
|
3107 |
(%a::real. |
|
3108 |
(All::(real => bool) => bool) |
|
3109 |
(%b::real. |
|
3110 |
(op -->::bool => bool => bool) |
|
3111 |
((division::real * real => (nat => real) => bool) |
|
3112 |
((Pair::real => real => real * real) a b) D) |
|
3113 |
((All::(nat => bool) => bool) |
|
3114 |
(%n::nat. |
|
3115 |
(op -->::bool => bool => bool) |
|
3116 |
((op <::nat => nat => bool) n |
|
3117 |
((dsize::(nat => real) => nat) D)) |
|
3118 |
((op <::real => real => bool) (D n) |
|
3119 |
(D ((dsize::(nat => real) => nat) D))))))))" |
|
3120 |
by (import transc DIVISION_GT) |
|
3121 |
||
| 17694 | 3122 |
lemma DIVISION_EQ: "ALL (D::nat => real) (a::real) b::real. |
3123 |
division (a, b) D --> (a = b) = (dsize D = 0)" |
|
| 14516 | 3124 |
by (import transc DIVISION_EQ) |
3125 |
||
| 17694 | 3126 |
lemma DIVISION_LBOUND: "ALL (D::nat => real) (a::real) b::real. |
3127 |
division (a, b) D --> (ALL r::nat. a <= D r)" |
|
| 14516 | 3128 |
by (import transc DIVISION_LBOUND) |
3129 |
||
| 17694 | 3130 |
lemma DIVISION_LBOUND_LT: "ALL (D::nat => real) (a::real) b::real. |
3131 |
division (a, b) D & dsize D ~= 0 --> (ALL n::nat. a < D (Suc n))" |
|
| 14516 | 3132 |
by (import transc DIVISION_LBOUND_LT) |
3133 |
||
| 17694 | 3134 |
lemma DIVISION_UBOUND: "ALL (D::nat => real) (a::real) b::real. |
3135 |
division (a, b) D --> (ALL r::nat. D r <= b)" |
|
| 14516 | 3136 |
by (import transc DIVISION_UBOUND) |
3137 |
||
| 17694 | 3138 |
lemma DIVISION_UBOUND_LT: "ALL (D::nat => real) (a::real) (b::real) n::nat. |
3139 |
division (a, b) D & n < dsize D --> D n < b" |
|
| 14516 | 3140 |
by (import transc DIVISION_UBOUND_LT) |
3141 |
||
| 17694 | 3142 |
lemma DIVISION_APPEND: "ALL (a::real) (b::real) c::real. |
3143 |
(EX (D1::nat => real) p1::nat => real. |
|
3144 |
tdiv (a, b) (D1, p1) & fine (g::real => real) (D1, p1)) & |
|
3145 |
(EX (D2::nat => real) p2::nat => real. |
|
3146 |
tdiv (b, c) (D2, p2) & fine g (D2, p2)) --> |
|
3147 |
(EX (x::nat => real) p::nat => real. tdiv (a, c) (x, p) & fine g (x, p))" |
|
| 14516 | 3148 |
by (import transc DIVISION_APPEND) |
3149 |
||
| 17694 | 3150 |
lemma DIVISION_EXISTS: "ALL (a::real) (b::real) g::real => real. |
3151 |
a <= b & gauge (%x::real. a <= x & x <= b) g --> |
|
3152 |
(EX (D::nat => real) p::nat => real. tdiv (a, b) (D, p) & fine g (D, p))" |
|
| 14516 | 3153 |
by (import transc DIVISION_EXISTS) |
3154 |
||
| 17694 | 3155 |
lemma GAUGE_MIN: "ALL (E::real => bool) (g1::real => real) g2::real => real. |
3156 |
gauge E g1 & gauge E g2 --> |
|
3157 |
gauge E (%x::real. if g1 x < g2 x then g1 x else g2 x)" |
|
| 14516 | 3158 |
by (import transc GAUGE_MIN) |
3159 |
||
| 17694 | 3160 |
lemma FINE_MIN: "ALL (g1::real => real) (g2::real => real) (D::nat => real) p::nat => real. |
3161 |
fine (%x::real. if g1 x < g2 x then g1 x else g2 x) (D, p) --> |
|
3162 |
fine g1 (D, p) & fine g2 (D, p)" |
|
| 14516 | 3163 |
by (import transc FINE_MIN) |
3164 |
||
| 17694 | 3165 |
lemma DINT_UNIQ: "ALL (a::real) (b::real) (f::real => real) (k1::real) k2::real. |
3166 |
a <= b & Dint (a, b) f k1 & Dint (a, b) f k2 --> k1 = k2" |
|
| 14516 | 3167 |
by (import transc DINT_UNIQ) |
3168 |
||
| 17652 | 3169 |
lemma INTEGRAL_NULL: "ALL (f::real => real) a::real. Dint (a, a) f 0" |
| 14516 | 3170 |
by (import transc INTEGRAL_NULL) |
3171 |
||
| 17694 | 3172 |
lemma FTC1: "ALL (f::real => real) (f'::real => real) (a::real) b::real. |
3173 |
a <= b & (ALL x::real. a <= x & x <= b --> diffl f (f' x) x) --> |
|
3174 |
Dint (a, b) f' (f b - f a)" |
|
| 14516 | 3175 |
by (import transc FTC1) |
3176 |
||
| 17694 | 3177 |
lemma MCLAURIN: "ALL (f::real => real) (diff::nat => real => real) (h::real) n::nat. |
3178 |
0 < h & |
|
3179 |
0 < n & |
|
3180 |
diff 0 = f & |
|
3181 |
(ALL (m::nat) t::real. |
|
3182 |
m < n & 0 <= t & t <= h --> diffl (diff m) (diff (Suc m) t) t) --> |
|
3183 |
(EX t>0. |
|
3184 |
t < h & |
|
3185 |
f h = |
|
3186 |
real.sum (0, n) (%m::nat. diff m 0 / real (FACT m) * h ^ m) + |
|
3187 |
diff n t / real (FACT n) * h ^ n)" |
|
| 14516 | 3188 |
by (import transc MCLAURIN) |
3189 |
||
| 17694 | 3190 |
lemma MCLAURIN_NEG: "ALL (f::real => real) (diff::nat => real => real) (h::real) n::nat. |
3191 |
h < 0 & |
|
3192 |
0 < n & |
|
3193 |
diff 0 = f & |
|
3194 |
(ALL (m::nat) t::real. |
|
3195 |
m < n & h <= t & t <= 0 --> diffl (diff m) (diff (Suc m) t) t) --> |
|
3196 |
(EX t::real. |
|
3197 |
h < t & |
|
3198 |
t < 0 & |
|
3199 |
f h = |
|
3200 |
real.sum (0, n) (%m::nat. diff m 0 / real (FACT m) * h ^ m) + |
|
3201 |
diff n t / real (FACT n) * h ^ n)" |
|
| 14516 | 3202 |
by (import transc MCLAURIN_NEG) |
3203 |
||
| 17694 | 3204 |
lemma MCLAURIN_ALL_LT: "ALL (f::real => real) diff::nat => real => real. |
3205 |
diff 0 = f & |
|
3206 |
(ALL (m::nat) x::real. diffl (diff m) (diff (Suc m) x) x) --> |
|
3207 |
(ALL (x::real) n::nat. |
|
3208 |
x ~= 0 & 0 < n --> |
|
3209 |
(EX t::real. |
|
3210 |
0 < abs t & |
|
3211 |
abs t < abs x & |
|
3212 |
f x = |
|
3213 |
real.sum (0, n) (%m::nat. diff m 0 / real (FACT m) * x ^ m) + |
|
3214 |
diff n t / real (FACT n) * x ^ n))" |
|
| 14516 | 3215 |
by (import transc MCLAURIN_ALL_LT) |
3216 |
||
| 17694 | 3217 |
lemma MCLAURIN_ZERO: "ALL (diff::nat => real => real) (n::nat) x::real. |
3218 |
x = 0 & 0 < n --> |
|
3219 |
real.sum (0, n) (%m::nat. diff m 0 / real (FACT m) * x ^ m) = diff 0 0" |
|
| 14516 | 3220 |
by (import transc MCLAURIN_ZERO) |
3221 |
||
| 17694 | 3222 |
lemma MCLAURIN_ALL_LE: "ALL (f::real => real) diff::nat => real => real. |
3223 |
diff 0 = f & |
|
3224 |
(ALL (m::nat) x::real. diffl (diff m) (diff (Suc m) x) x) --> |
|
3225 |
(ALL (x::real) n::nat. |
|
3226 |
EX t::real. |
|
3227 |
abs t <= abs x & |
|
3228 |
f x = |
|
3229 |
real.sum (0, n) (%m::nat. diff m 0 / real (FACT m) * x ^ m) + |
|
3230 |
diff n t / real (FACT n) * x ^ n)" |
|
| 14516 | 3231 |
by (import transc MCLAURIN_ALL_LE) |
3232 |
||
| 17694 | 3233 |
lemma MCLAURIN_EXP_LT: "ALL (x::real) n::nat. |
3234 |
x ~= 0 & 0 < n --> |
|
3235 |
(EX xa::real. |
|
3236 |
0 < abs xa & |
|
3237 |
abs xa < abs x & |
|
3238 |
exp x = |
|
3239 |
real.sum (0, n) (%m::nat. x ^ m / real (FACT m)) + |
|
3240 |
exp xa / real (FACT n) * x ^ n)" |
|
| 14516 | 3241 |
by (import transc MCLAURIN_EXP_LT) |
3242 |
||
| 17644 | 3243 |
lemma MCLAURIN_EXP_LE: "ALL (x::real) n::nat. |
3244 |
EX xa::real. |
|
| 14516 | 3245 |
abs xa <= abs x & |
3246 |
exp x = |
|
| 17652 | 3247 |
real.sum (0, n) (%m::nat. x ^ m / real (FACT m)) + |
| 14516 | 3248 |
exp xa / real (FACT n) * x ^ n" |
3249 |
by (import transc MCLAURIN_EXP_LE) |
|
3250 |
||
| 17694 | 3251 |
lemma DIFF_LN_COMPOSITE: "ALL (g::real => real) (m::real) x::real. |
3252 |
diffl g m x & 0 < g x --> |
|
3253 |
diffl (%x::real. ln (g x)) (inverse (g x) * m) x" |
|
| 14516 | 3254 |
by (import transc DIFF_LN_COMPOSITE) |
3255 |
||
3256 |
;end_setup |
|
3257 |
||
3258 |
;setup_theory poly |
|
3259 |
||
3260 |
consts |
|
3261 |
poly :: "real list => real => real" |
|
3262 |
||
| 17652 | 3263 |
specification (poly_primdef: poly) poly_def: "(ALL x::real. poly [] x = 0) & |
| 17644 | 3264 |
(ALL (h::real) (t::real list) x::real. poly (h # t) x = h + x * poly t x)" |
| 14516 | 3265 |
by (import poly poly_def) |
3266 |
||
3267 |
consts |
|
3268 |
poly_add :: "real list => real list => real list" |
|
3269 |
||
| 17644 | 3270 |
specification (poly_add_primdef: poly_add) poly_add_def: "(ALL l2::real list. poly_add [] l2 = l2) & |
3271 |
(ALL (h::real) (t::real list) l2::real list. |
|
| 14516 | 3272 |
poly_add (h # t) l2 = |
3273 |
(if l2 = [] then h # t else (h + hd l2) # poly_add t (tl l2)))" |
|
3274 |
by (import poly poly_add_def) |
|
3275 |
||
3276 |
consts |
|
3277 |
"##" :: "real => real list => real list" ("##")
|
|
3278 |
||
| 17644 | 3279 |
specification ("##") poly_cmul_def: "(ALL c::real. ## c [] = []) &
|
3280 |
(ALL (c::real) (h::real) t::real list. ## c (h # t) = c * h # ## c t)" |
|
| 14516 | 3281 |
by (import poly poly_cmul_def) |
3282 |
||
3283 |
consts |
|
3284 |
poly_neg :: "real list => real list" |
|
3285 |
||
3286 |
defs |
|
| 17652 | 3287 |
poly_neg_primdef: "poly_neg == ## (- 1)" |
3288 |
||
3289 |
lemma poly_neg_def: "poly_neg = ## (- 1)" |
|
| 14516 | 3290 |
by (import poly poly_neg_def) |
3291 |
||
3292 |
consts |
|
3293 |
poly_mul :: "real list => real list => real list" |
|
3294 |
||
| 17644 | 3295 |
specification (poly_mul_primdef: poly_mul) poly_mul_def: "(ALL l2::real list. poly_mul [] l2 = []) & |
3296 |
(ALL (h::real) (t::real list) l2::real list. |
|
| 14516 | 3297 |
poly_mul (h # t) l2 = |
| 17652 | 3298 |
(if t = [] then ## h l2 else poly_add (## h l2) (0 # poly_mul t l2)))" |
| 14516 | 3299 |
by (import poly poly_mul_def) |
3300 |
||
3301 |
consts |
|
3302 |
poly_exp :: "real list => nat => real list" |
|
3303 |
||
| 17652 | 3304 |
specification (poly_exp_primdef: poly_exp) poly_exp_def: "(ALL p::real list. poly_exp p 0 = [1]) & |
| 17644 | 3305 |
(ALL (p::real list) n::nat. poly_exp p (Suc n) = poly_mul p (poly_exp p n))" |
| 14516 | 3306 |
by (import poly poly_exp_def) |
3307 |
||
3308 |
consts |
|
3309 |
poly_diff_aux :: "nat => real list => real list" |
|
3310 |
||
| 17644 | 3311 |
specification (poly_diff_aux_primdef: poly_diff_aux) poly_diff_aux_def: "(ALL n::nat. poly_diff_aux n [] = []) & |
3312 |
(ALL (n::nat) (h::real) t::real list. |
|
3313 |
poly_diff_aux n (h # t) = real n * h # poly_diff_aux (Suc n) t)" |
|
| 14516 | 3314 |
by (import poly poly_diff_aux_def) |
3315 |
||
3316 |
constdefs |
|
3317 |
diff :: "real list => real list" |
|
| 17652 | 3318 |
"diff == %l::real list. if l = [] then [] else poly_diff_aux 1 (tl l)" |
3319 |
||
3320 |
lemma poly_diff_def: "ALL l::real list. diff l = (if l = [] then [] else poly_diff_aux 1 (tl l))" |
|
| 14516 | 3321 |
by (import poly poly_diff_def) |
3322 |
||
| 17644 | 3323 |
lemma POLY_ADD_CLAUSES: "poly_add [] (p2::real list) = p2 & |
3324 |
poly_add (p1::real list) [] = p1 & |
|
3325 |
poly_add ((h1::real) # (t1::real list)) ((h2::real) # (t2::real list)) = |
|
3326 |
(h1 + h2) # poly_add t1 t2" |
|
| 14516 | 3327 |
by (import poly POLY_ADD_CLAUSES) |
3328 |
||
| 17644 | 3329 |
lemma POLY_CMUL_CLAUSES: "## (c::real) [] = [] & ## c ((h::real) # (t::real list)) = c * h # ## c t" |
| 14516 | 3330 |
by (import poly POLY_CMUL_CLAUSES) |
3331 |
||
| 17644 | 3332 |
lemma POLY_NEG_CLAUSES: "poly_neg [] = [] & poly_neg ((h::real) # (t::real list)) = - h # poly_neg t" |
| 14516 | 3333 |
by (import poly POLY_NEG_CLAUSES) |
3334 |
||
| 17644 | 3335 |
lemma POLY_MUL_CLAUSES: "poly_mul [] (p2::real list) = [] & |
3336 |
poly_mul [h1::real] p2 = ## h1 p2 & |
|
3337 |
poly_mul (h1 # (k1::real) # (t1::real list)) p2 = |
|
| 17652 | 3338 |
poly_add (## h1 p2) (0 # poly_mul (k1 # t1) p2)" |
| 14516 | 3339 |
by (import poly POLY_MUL_CLAUSES) |
3340 |
||
| 17644 | 3341 |
lemma POLY_DIFF_CLAUSES: "diff [] = [] & |
| 17652 | 3342 |
diff [c::real] = [] & diff ((h::real) # (t::real list)) = poly_diff_aux 1 t" |
| 14516 | 3343 |
by (import poly POLY_DIFF_CLAUSES) |
3344 |
||
| 17644 | 3345 |
lemma POLY_ADD: "ALL (t::real list) (p2::real list) x::real. |
3346 |
poly (poly_add t p2) x = poly t x + poly p2 x" |
|
| 14516 | 3347 |
by (import poly POLY_ADD) |
3348 |
||
| 17644 | 3349 |
lemma POLY_CMUL: "ALL (t::real list) (c::real) x::real. poly (## c t) x = c * poly t x" |
| 14516 | 3350 |
by (import poly POLY_CMUL) |
3351 |
||
| 17644 | 3352 |
lemma POLY_NEG: "ALL (x::real list) xa::real. poly (poly_neg x) xa = - poly x xa" |
| 14516 | 3353 |
by (import poly POLY_NEG) |
3354 |
||
| 17644 | 3355 |
lemma POLY_MUL: "ALL (x::real) (t::real list) p2::real list. |
3356 |
poly (poly_mul t p2) x = poly t x * poly p2 x" |
|
| 14516 | 3357 |
by (import poly POLY_MUL) |
3358 |
||
| 17644 | 3359 |
lemma POLY_EXP: "ALL (p::real list) (n::nat) x::real. poly (poly_exp p n) x = poly p x ^ n" |
| 14516 | 3360 |
by (import poly POLY_EXP) |
3361 |
||
| 17644 | 3362 |
lemma POLY_DIFF_LEMMA: "ALL (t::real list) (n::nat) x::real. |
3363 |
diffl (%x::real. x ^ Suc n * poly t x) |
|
| 14516 | 3364 |
(x ^ n * poly (poly_diff_aux (Suc n) t) x) x" |
3365 |
by (import poly POLY_DIFF_LEMMA) |
|
3366 |
||
| 17644 | 3367 |
lemma POLY_DIFF: "ALL (t::real list) x::real. diffl (poly t) (poly (diff t) x) x" |
| 14516 | 3368 |
by (import poly POLY_DIFF) |
3369 |
||
| 17644 | 3370 |
lemma POLY_DIFFERENTIABLE: "ALL l::real list. All (differentiable (poly l))" |
| 14516 | 3371 |
by (import poly POLY_DIFFERENTIABLE) |
3372 |
||
| 17644 | 3373 |
lemma POLY_CONT: "ALL l::real list. All (contl (poly l))" |
| 14516 | 3374 |
by (import poly POLY_CONT) |
3375 |
||
| 17694 | 3376 |
lemma POLY_IVT_POS: "ALL (x::real list) (xa::real) xb::real. |
3377 |
xa < xb & poly x xa < 0 & 0 < poly x xb --> |
|
3378 |
(EX xc::real. xa < xc & xc < xb & poly x xc = 0)" |
|
| 14516 | 3379 |
by (import poly POLY_IVT_POS) |
3380 |
||
| 17694 | 3381 |
lemma POLY_IVT_NEG: "ALL (p::real list) (a::real) b::real. |
3382 |
a < b & 0 < poly p a & poly p b < 0 --> |
|
3383 |
(EX x::real. a < x & x < b & poly p x = 0)" |
|
| 14516 | 3384 |
by (import poly POLY_IVT_NEG) |
3385 |
||
| 17694 | 3386 |
lemma POLY_MVT: "ALL (p::real list) (a::real) b::real. |
3387 |
a < b --> |
|
3388 |
(EX x::real. |
|
3389 |
a < x & x < b & poly p b - poly p a = (b - a) * poly (diff p) x)" |
|
| 14516 | 3390 |
by (import poly POLY_MVT) |
3391 |
||
| 17644 | 3392 |
lemma POLY_ADD_RZERO: "ALL x::real list. poly (poly_add x []) = poly x" |
| 14516 | 3393 |
by (import poly POLY_ADD_RZERO) |
3394 |
||
| 17644 | 3395 |
lemma POLY_MUL_ASSOC: "ALL (x::real list) (xa::real list) xb::real list. |
| 14516 | 3396 |
poly (poly_mul x (poly_mul xa xb)) = poly (poly_mul (poly_mul x xa) xb)" |
3397 |
by (import poly POLY_MUL_ASSOC) |
|
3398 |
||
| 17644 | 3399 |
lemma POLY_EXP_ADD: "ALL (x::nat) (xa::nat) xb::real list. |
| 14516 | 3400 |
poly (poly_exp xb (xa + x)) = |
3401 |
poly (poly_mul (poly_exp xb xa) (poly_exp xb x))" |
|
3402 |
by (import poly POLY_EXP_ADD) |
|
3403 |
||
| 17644 | 3404 |
lemma POLY_DIFF_AUX_ADD: "ALL (t::real list) (p2::real list) n::nat. |
| 14516 | 3405 |
poly (poly_diff_aux n (poly_add t p2)) = |
3406 |
poly (poly_add (poly_diff_aux n t) (poly_diff_aux n p2))" |
|
3407 |
by (import poly POLY_DIFF_AUX_ADD) |
|
3408 |
||
| 17644 | 3409 |
lemma POLY_DIFF_AUX_CMUL: "ALL (t::real list) (c::real) n::nat. |
3410 |
poly (poly_diff_aux n (## c t)) = poly (## c (poly_diff_aux n t))" |
|
| 14516 | 3411 |
by (import poly POLY_DIFF_AUX_CMUL) |
3412 |
||
| 17644 | 3413 |
lemma POLY_DIFF_AUX_NEG: "ALL (x::real list) xa::nat. |
| 14516 | 3414 |
poly (poly_diff_aux xa (poly_neg x)) = |
3415 |
poly (poly_neg (poly_diff_aux xa x))" |
|
3416 |
by (import poly POLY_DIFF_AUX_NEG) |
|
3417 |
||
| 17644 | 3418 |
lemma POLY_DIFF_AUX_MUL_LEMMA: "ALL (t::real list) n::nat. |
| 14516 | 3419 |
poly (poly_diff_aux (Suc n) t) = poly (poly_add (poly_diff_aux n t) t)" |
3420 |
by (import poly POLY_DIFF_AUX_MUL_LEMMA) |
|
3421 |
||
| 17644 | 3422 |
lemma POLY_DIFF_ADD: "ALL (t::real list) p2::real list. |
3423 |
poly (diff (poly_add t p2)) = poly (poly_add (diff t) (diff p2))" |
|
| 14516 | 3424 |
by (import poly POLY_DIFF_ADD) |
3425 |
||
| 17644 | 3426 |
lemma POLY_DIFF_CMUL: "ALL (t::real list) c::real. poly (diff (## c t)) = poly (## c (diff t))" |
| 14516 | 3427 |
by (import poly POLY_DIFF_CMUL) |
3428 |
||
| 17644 | 3429 |
lemma POLY_DIFF_NEG: "ALL x::real list. poly (diff (poly_neg x)) = poly (poly_neg (diff x))" |
| 14516 | 3430 |
by (import poly POLY_DIFF_NEG) |
3431 |
||
| 17644 | 3432 |
lemma POLY_DIFF_MUL_LEMMA: "ALL (x::real list) xa::real. |
| 17652 | 3433 |
poly (diff (xa # x)) = poly (poly_add (0 # diff x) x)" |
| 14516 | 3434 |
by (import poly POLY_DIFF_MUL_LEMMA) |
3435 |
||
| 17644 | 3436 |
lemma POLY_DIFF_MUL: "ALL (t::real list) p2::real list. |
| 14516 | 3437 |
poly (diff (poly_mul t p2)) = |
3438 |
poly (poly_add (poly_mul t (diff p2)) (poly_mul (diff t) p2))" |
|
3439 |
by (import poly POLY_DIFF_MUL) |
|
3440 |
||
| 17644 | 3441 |
lemma POLY_DIFF_EXP: "ALL (p::real list) n::nat. |
| 14516 | 3442 |
poly (diff (poly_exp p (Suc n))) = |
3443 |
poly (poly_mul (## (real (Suc n)) (poly_exp p n)) (diff p))" |
|
3444 |
by (import poly POLY_DIFF_EXP) |
|
3445 |
||
| 17644 | 3446 |
lemma POLY_DIFF_EXP_PRIME: "ALL (n::nat) a::real. |
| 17652 | 3447 |
poly (diff (poly_exp [- a, 1] (Suc n))) = |
3448 |
poly (## (real (Suc n)) (poly_exp [- a, 1] n))" |
|
| 14516 | 3449 |
by (import poly POLY_DIFF_EXP_PRIME) |
3450 |
||
| 17644 | 3451 |
lemma POLY_LINEAR_REM: "ALL (t::real list) h::real. |
3452 |
EX (q::real list) r::real. |
|
| 17652 | 3453 |
h # t = poly_add [r] (poly_mul [- (a::real), 1] q)" |
| 14516 | 3454 |
by (import poly POLY_LINEAR_REM) |
3455 |
||
| 17644 | 3456 |
lemma POLY_LINEAR_DIVIDES: "ALL (a::real) t::real list. |
| 17652 | 3457 |
(poly t a = 0) = (t = [] | (EX q::real list. t = poly_mul [- a, 1] q))" |
| 14516 | 3458 |
by (import poly POLY_LINEAR_DIVIDES) |
3459 |
||
| 17652 | 3460 |
lemma POLY_LENGTH_MUL: "ALL x::real list. length (poly_mul [- (a::real), 1] x) = Suc (length x)" |
| 14516 | 3461 |
by (import poly POLY_LENGTH_MUL) |
3462 |
||
3463 |
lemma POLY_ROOTS_INDEX_LEMMA: "(All::(nat => bool) => bool) |
|
3464 |
(%n::nat. |
|
3465 |
(All::(real list => bool) => bool) |
|
3466 |
(%p::real list. |
|
3467 |
(op -->::bool => bool => bool) |
|
3468 |
((op &::bool => bool => bool) |
|
3469 |
((Not::bool => bool) |
|
3470 |
((op =::(real => real) => (real => real) => bool) |
|
3471 |
((poly::real list => real => real) p) |
|
3472 |
((poly::real list => real => real) ([]::real list)))) |
|
3473 |
((op =::nat => nat => bool) ((size::real list => nat) p) n)) |
|
3474 |
((Ex::((nat => real) => bool) => bool) |
|
3475 |
(%i::nat => real. |
|
3476 |
(All::(real => bool) => bool) |
|
3477 |
(%x::real. |
|
3478 |
(op -->::bool => bool => bool) |
|
3479 |
((op =::real => real => bool) |
|
3480 |
((poly::real list => real => real) p x) (0::real)) |
|
3481 |
((Ex::(nat => bool) => bool) |
|
3482 |
(%m::nat. |
|
3483 |
(op &::bool => bool => bool) |
|
3484 |
((op <=::nat => nat => bool) m n) |
|
3485 |
((op =::real => real => bool) x (i m)))))))))" |
|
3486 |
by (import poly POLY_ROOTS_INDEX_LEMMA) |
|
3487 |
||
3488 |
lemma POLY_ROOTS_INDEX_LENGTH: "(All::(real list => bool) => bool) |
|
3489 |
(%p::real list. |
|
3490 |
(op -->::bool => bool => bool) |
|
3491 |
((Not::bool => bool) |
|
3492 |
((op =::(real => real) => (real => real) => bool) |
|
3493 |
((poly::real list => real => real) p) |
|
3494 |
((poly::real list => real => real) ([]::real list)))) |
|
3495 |
((Ex::((nat => real) => bool) => bool) |
|
3496 |
(%i::nat => real. |
|
3497 |
(All::(real => bool) => bool) |
|
3498 |
(%x::real. |
|
3499 |
(op -->::bool => bool => bool) |
|
3500 |
((op =::real => real => bool) |
|
3501 |
((poly::real list => real => real) p x) (0::real)) |
|
3502 |
((Ex::(nat => bool) => bool) |
|
3503 |
(%n::nat. |
|
3504 |
(op &::bool => bool => bool) |
|
3505 |
((op <=::nat => nat => bool) n |
|
3506 |
((size::real list => nat) p)) |
|
3507 |
((op =::real => real => bool) x (i n))))))))" |
|
3508 |
by (import poly POLY_ROOTS_INDEX_LENGTH) |
|
3509 |
||
3510 |
lemma POLY_ROOTS_FINITE_LEMMA: "(All::(real list => bool) => bool) |
|
3511 |
(%p::real list. |
|
3512 |
(op -->::bool => bool => bool) |
|
3513 |
((Not::bool => bool) |
|
3514 |
((op =::(real => real) => (real => real) => bool) |
|
3515 |
((poly::real list => real => real) p) |
|
3516 |
((poly::real list => real => real) ([]::real list)))) |
|
3517 |
((Ex::(nat => bool) => bool) |
|
3518 |
(%N::nat. |
|
3519 |
(Ex::((nat => real) => bool) => bool) |
|
3520 |
(%i::nat => real. |
|
3521 |
(All::(real => bool) => bool) |
|
3522 |
(%x::real. |
|
3523 |
(op -->::bool => bool => bool) |
|
3524 |
((op =::real => real => bool) |
|
3525 |
((poly::real list => real => real) p x) (0::real)) |
|
3526 |
((Ex::(nat => bool) => bool) |
|
3527 |
(%n::nat. |
|
3528 |
(op &::bool => bool => bool) |
|
3529 |
((op <::nat => nat => bool) n N) |
|
3530 |
((op =::real => real => bool) x (i n)))))))))" |
|
3531 |
by (import poly POLY_ROOTS_FINITE_LEMMA) |
|
3532 |
||
3533 |
lemma FINITE_LEMMA: "(All::((nat => real) => bool) => bool) |
|
3534 |
(%i::nat => real. |
|
3535 |
(All::(nat => bool) => bool) |
|
3536 |
(%x::nat. |
|
3537 |
(All::((real => bool) => bool) => bool) |
|
3538 |
(%xa::real => bool. |
|
3539 |
(op -->::bool => bool => bool) |
|
3540 |
((All::(real => bool) => bool) |
|
3541 |
(%xb::real. |
|
3542 |
(op -->::bool => bool => bool) (xa xb) |
|
3543 |
((Ex::(nat => bool) => bool) |
|
3544 |
(%n::nat. |
|
3545 |
(op &::bool => bool => bool) |
|
3546 |
((op <::nat => nat => bool) n x) |
|
3547 |
((op =::real => real => bool) xb (i n)))))) |
|
3548 |
((Ex::(real => bool) => bool) |
|
3549 |
(%a::real. |
|
3550 |
(All::(real => bool) => bool) |
|
3551 |
(%x::real. |
|
3552 |
(op -->::bool => bool => bool) (xa x) |
|
3553 |
((op <::real => real => bool) x a)))))))" |
|
3554 |
by (import poly FINITE_LEMMA) |
|
3555 |
||
3556 |
lemma POLY_ROOTS_FINITE: "(All::(real list => bool) => bool) |
|
3557 |
(%p::real list. |
|
3558 |
(op =::bool => bool => bool) |
|
3559 |
((Not::bool => bool) |
|
3560 |
((op =::(real => real) => (real => real) => bool) |
|
3561 |
((poly::real list => real => real) p) |
|
3562 |
((poly::real list => real => real) ([]::real list)))) |
|
3563 |
((Ex::(nat => bool) => bool) |
|
3564 |
(%N::nat. |
|
3565 |
(Ex::((nat => real) => bool) => bool) |
|
3566 |
(%i::nat => real. |
|
3567 |
(All::(real => bool) => bool) |
|
3568 |
(%x::real. |
|
3569 |
(op -->::bool => bool => bool) |
|
3570 |
((op =::real => real => bool) |
|
3571 |
((poly::real list => real => real) p x) (0::real)) |
|
3572 |
((Ex::(nat => bool) => bool) |
|
3573 |
(%n::nat. |
|
3574 |
(op &::bool => bool => bool) |
|
3575 |
((op <::nat => nat => bool) n N) |
|
3576 |
((op =::real => real => bool) x (i n)))))))))" |
|
3577 |
by (import poly POLY_ROOTS_FINITE) |
|
3578 |
||
| 17694 | 3579 |
lemma POLY_ENTIRE_LEMMA: "ALL (p::real list) q::real list. |
3580 |
poly p ~= poly [] & poly q ~= poly [] --> poly (poly_mul p q) ~= poly []" |
|
| 14516 | 3581 |
by (import poly POLY_ENTIRE_LEMMA) |
3582 |
||
| 17644 | 3583 |
lemma POLY_ENTIRE: "ALL (p::real list) q::real list. |
| 14516 | 3584 |
(poly (poly_mul p q) = poly []) = (poly p = poly [] | poly q = poly [])" |
3585 |
by (import poly POLY_ENTIRE) |
|
3586 |
||
| 17644 | 3587 |
lemma POLY_MUL_LCANCEL: "ALL (x::real list) (xa::real list) xb::real list. |
| 14516 | 3588 |
(poly (poly_mul x xa) = poly (poly_mul x xb)) = |
3589 |
(poly x = poly [] | poly xa = poly xb)" |
|
3590 |
by (import poly POLY_MUL_LCANCEL) |
|
3591 |
||
| 17644 | 3592 |
lemma POLY_EXP_EQ_0: "ALL (p::real list) n::nat. |
| 17652 | 3593 |
(poly (poly_exp p n) = poly []) = (poly p = poly [] & n ~= 0)" |
| 14516 | 3594 |
by (import poly POLY_EXP_EQ_0) |
3595 |
||
| 17652 | 3596 |
lemma POLY_PRIME_EQ_0: "ALL a::real. poly [a, 1] ~= poly []" |
| 14516 | 3597 |
by (import poly POLY_PRIME_EQ_0) |
3598 |
||
| 17652 | 3599 |
lemma POLY_EXP_PRIME_EQ_0: "ALL (a::real) n::nat. poly (poly_exp [a, 1] n) ~= poly []" |
| 14516 | 3600 |
by (import poly POLY_EXP_PRIME_EQ_0) |
3601 |
||
| 17694 | 3602 |
lemma POLY_ZERO_LEMMA: "ALL (h::real) t::real list. |
3603 |
poly (h # t) = poly [] --> h = 0 & poly t = poly []" |
|
| 14516 | 3604 |
by (import poly POLY_ZERO_LEMMA) |
3605 |
||
| 17652 | 3606 |
lemma POLY_ZERO: "ALL t::real list. (poly t = poly []) = list_all (%c::real. c = 0) t" |
| 14516 | 3607 |
by (import poly POLY_ZERO) |
3608 |
||
| 17644 | 3609 |
lemma POLY_DIFF_AUX_ISZERO: "ALL (t::real list) n::nat. |
| 17652 | 3610 |
list_all (%c::real. c = 0) (poly_diff_aux (Suc n) t) = |
3611 |
list_all (%c::real. c = 0) t" |
|
| 14516 | 3612 |
by (import poly POLY_DIFF_AUX_ISZERO) |
3613 |
||
| 17694 | 3614 |
lemma POLY_DIFF_ISZERO: "ALL x::real list. |
3615 |
poly (diff x) = poly [] --> (EX h::real. poly x = poly [h])" |
|
| 14516 | 3616 |
by (import poly POLY_DIFF_ISZERO) |
3617 |
||
| 17694 | 3618 |
lemma POLY_DIFF_ZERO: "ALL x::real list. poly x = poly [] --> poly (diff x) = poly []" |
| 14516 | 3619 |
by (import poly POLY_DIFF_ZERO) |
3620 |
||
| 17694 | 3621 |
lemma POLY_DIFF_WELLDEF: "ALL (p::real list) q::real list. |
3622 |
poly p = poly q --> poly (diff p) = poly (diff q)" |
|
| 14516 | 3623 |
by (import poly POLY_DIFF_WELLDEF) |
3624 |
||
3625 |
constdefs |
|
3626 |
poly_divides :: "real list => real list => bool" |
|
| 17644 | 3627 |
"poly_divides == |
3628 |
%(p1::real list) p2::real list. |
|
3629 |
EX q::real list. poly p2 = poly (poly_mul p1 q)" |
|
3630 |
||
3631 |
lemma poly_divides: "ALL (p1::real list) p2::real list. |
|
3632 |
poly_divides p1 p2 = (EX q::real list. poly p2 = poly (poly_mul p1 q))" |
|
| 14516 | 3633 |
by (import poly poly_divides) |
3634 |
||
| 17644 | 3635 |
lemma POLY_PRIMES: "ALL (a::real) (p::real list) q::real list. |
| 17652 | 3636 |
poly_divides [a, 1] (poly_mul p q) = |
3637 |
(poly_divides [a, 1] p | poly_divides [a, 1] q)" |
|
| 14516 | 3638 |
by (import poly POLY_PRIMES) |
3639 |
||
| 17644 | 3640 |
lemma POLY_DIVIDES_REFL: "ALL p::real list. poly_divides p p" |
| 14516 | 3641 |
by (import poly POLY_DIVIDES_REFL) |
3642 |
||
| 17694 | 3643 |
lemma POLY_DIVIDES_TRANS: "ALL (p::real list) (q::real list) r::real list. |
3644 |
poly_divides p q & poly_divides q r --> poly_divides p r" |
|
| 14516 | 3645 |
by (import poly POLY_DIVIDES_TRANS) |
3646 |
||
| 17694 | 3647 |
lemma POLY_DIVIDES_EXP: "ALL (p::real list) (m::nat) n::nat. |
3648 |
m <= n --> poly_divides (poly_exp p m) (poly_exp p n)" |
|
| 14516 | 3649 |
by (import poly POLY_DIVIDES_EXP) |
3650 |
||
| 17694 | 3651 |
lemma POLY_EXP_DIVIDES: "ALL (p::real list) (q::real list) (m::nat) n::nat. |
3652 |
poly_divides (poly_exp p n) q & m <= n --> poly_divides (poly_exp p m) q" |
|
| 14516 | 3653 |
by (import poly POLY_EXP_DIVIDES) |
3654 |
||
| 17694 | 3655 |
lemma POLY_DIVIDES_ADD: "ALL (p::real list) (q::real list) r::real list. |
3656 |
poly_divides p q & poly_divides p r --> poly_divides p (poly_add q r)" |
|
| 14516 | 3657 |
by (import poly POLY_DIVIDES_ADD) |
3658 |
||
| 17694 | 3659 |
lemma POLY_DIVIDES_SUB: "ALL (p::real list) (q::real list) r::real list. |
3660 |
poly_divides p q & poly_divides p (poly_add q r) --> poly_divides p r" |
|
| 14516 | 3661 |
by (import poly POLY_DIVIDES_SUB) |
3662 |
||
| 17694 | 3663 |
lemma POLY_DIVIDES_SUB2: "ALL (p::real list) (q::real list) r::real list. |
3664 |
poly_divides p r & poly_divides p (poly_add q r) --> poly_divides p q" |
|
| 14516 | 3665 |
by (import poly POLY_DIVIDES_SUB2) |
3666 |
||
| 17694 | 3667 |
lemma POLY_DIVIDES_ZERO: "ALL (p::real list) q::real list. poly p = poly [] --> poly_divides q p" |
| 14516 | 3668 |
by (import poly POLY_DIVIDES_ZERO) |
3669 |
||
| 17694 | 3670 |
lemma POLY_ORDER_EXISTS: "ALL (a::real) (d::nat) p::real list. |
3671 |
length p = d & poly p ~= poly [] --> |
|
3672 |
(EX x::nat. |
|
3673 |
poly_divides (poly_exp [- a, 1] x) p & |
|
3674 |
~ poly_divides (poly_exp [- a, 1] (Suc x)) p)" |
|
| 14516 | 3675 |
by (import poly POLY_ORDER_EXISTS) |
3676 |
||
| 17694 | 3677 |
lemma POLY_ORDER: "ALL (p::real list) a::real. |
3678 |
poly p ~= poly [] --> |
|
3679 |
(EX! n::nat. |
|
3680 |
poly_divides (poly_exp [- a, 1] n) p & |
|
3681 |
~ poly_divides (poly_exp [- a, 1] (Suc n)) p)" |
|
| 14516 | 3682 |
by (import poly POLY_ORDER) |
3683 |
||
3684 |
constdefs |
|
3685 |
poly_order :: "real => real list => nat" |
|
3686 |
"poly_order == |
|
| 17644 | 3687 |
%(a::real) p::real list. |
3688 |
SOME n::nat. |
|
| 17652 | 3689 |
poly_divides (poly_exp [- a, 1] n) p & |
3690 |
~ poly_divides (poly_exp [- a, 1] (Suc n)) p" |
|
| 17644 | 3691 |
|
3692 |
lemma poly_order: "ALL (a::real) p::real list. |
|
| 14516 | 3693 |
poly_order a p = |
| 17644 | 3694 |
(SOME n::nat. |
| 17652 | 3695 |
poly_divides (poly_exp [- a, 1] n) p & |
3696 |
~ poly_divides (poly_exp [- a, 1] (Suc n)) p)" |
|
| 14516 | 3697 |
by (import poly poly_order) |
3698 |
||
| 17644 | 3699 |
lemma ORDER: "ALL (p::real list) (a::real) n::nat. |
| 17652 | 3700 |
(poly_divides (poly_exp [- a, 1] n) p & |
3701 |
~ poly_divides (poly_exp [- a, 1] (Suc n)) p) = |
|
| 14516 | 3702 |
(n = poly_order a p & poly p ~= poly [])" |
3703 |
by (import poly ORDER) |
|
3704 |
||
| 17694 | 3705 |
lemma ORDER_THM: "ALL (p::real list) a::real. |
3706 |
poly p ~= poly [] --> |
|
3707 |
poly_divides (poly_exp [- a, 1] (poly_order a p)) p & |
|
3708 |
~ poly_divides (poly_exp [- a, 1] (Suc (poly_order a p))) p" |
|
| 14516 | 3709 |
by (import poly ORDER_THM) |
3710 |
||
| 17694 | 3711 |
lemma ORDER_UNIQUE: "ALL (p::real list) (a::real) n::nat. |
3712 |
poly p ~= poly [] & |
|
3713 |
poly_divides (poly_exp [- a, 1] n) p & |
|
3714 |
~ poly_divides (poly_exp [- a, 1] (Suc n)) p --> |
|
3715 |
n = poly_order a p" |
|
| 14516 | 3716 |
by (import poly ORDER_UNIQUE) |
3717 |
||
| 17694 | 3718 |
lemma ORDER_POLY: "ALL (p::real list) (q::real list) a::real. |
3719 |
poly p = poly q --> poly_order a p = poly_order a q" |
|
| 14516 | 3720 |
by (import poly ORDER_POLY) |
3721 |
||
| 17644 | 3722 |
lemma ORDER_ROOT: "ALL (p::real list) a::real. |
| 17652 | 3723 |
(poly p a = 0) = (poly p = poly [] | poly_order a p ~= 0)" |
| 14516 | 3724 |
by (import poly ORDER_ROOT) |
3725 |
||
| 17644 | 3726 |
lemma ORDER_DIVIDES: "ALL (p::real list) (a::real) n::nat. |
| 17652 | 3727 |
poly_divides (poly_exp [- a, 1] n) p = |
| 14516 | 3728 |
(poly p = poly [] | n <= poly_order a p)" |
3729 |
by (import poly ORDER_DIVIDES) |
|
3730 |
||
| 17694 | 3731 |
lemma ORDER_DECOMP: "ALL (p::real list) a::real. |
3732 |
poly p ~= poly [] --> |
|
3733 |
(EX x::real list. |
|
3734 |
poly p = poly (poly_mul (poly_exp [- a, 1] (poly_order a p)) x) & |
|
3735 |
~ poly_divides [- a, 1] x)" |
|
| 14516 | 3736 |
by (import poly ORDER_DECOMP) |
3737 |
||
| 17694 | 3738 |
lemma ORDER_MUL: "ALL (a::real) (p::real list) q::real list. |
3739 |
poly (poly_mul p q) ~= poly [] --> |
|
3740 |
poly_order a (poly_mul p q) = poly_order a p + poly_order a q" |
|
| 14516 | 3741 |
by (import poly ORDER_MUL) |
3742 |
||
| 17694 | 3743 |
lemma ORDER_DIFF: "ALL (p::real list) a::real. |
3744 |
poly (diff p) ~= poly [] & poly_order a p ~= 0 --> |
|
3745 |
poly_order a p = Suc (poly_order a (diff p))" |
|
| 14516 | 3746 |
by (import poly ORDER_DIFF) |
3747 |
||
| 17694 | 3748 |
lemma POLY_SQUAREFREE_DECOMP_ORDER: "ALL (p::real list) (q::real list) (d::real list) (e::real list) |
3749 |
(r::real list) s::real list. |
|
3750 |
poly (diff p) ~= poly [] & |
|
3751 |
poly p = poly (poly_mul q d) & |
|
3752 |
poly (diff p) = poly (poly_mul e d) & |
|
3753 |
poly d = poly (poly_add (poly_mul r p) (poly_mul s (diff p))) --> |
|
3754 |
(ALL a::real. poly_order a q = (if poly_order a p = 0 then 0 else 1))" |
|
| 14516 | 3755 |
by (import poly POLY_SQUAREFREE_DECOMP_ORDER) |
3756 |
||
3757 |
constdefs |
|
3758 |
rsquarefree :: "real list => bool" |
|
3759 |
"rsquarefree == |
|
| 17644 | 3760 |
%p::real list. |
3761 |
poly p ~= poly [] & |
|
| 17652 | 3762 |
(ALL a::real. poly_order a p = 0 | poly_order a p = 1)" |
| 17644 | 3763 |
|
3764 |
lemma rsquarefree: "ALL p::real list. |
|
| 14516 | 3765 |
rsquarefree p = |
| 17644 | 3766 |
(poly p ~= poly [] & |
| 17652 | 3767 |
(ALL a::real. poly_order a p = 0 | poly_order a p = 1))" |
| 14516 | 3768 |
by (import poly rsquarefree) |
3769 |
||
| 17644 | 3770 |
lemma RSQUAREFREE_ROOTS: "ALL p::real list. |
| 17652 | 3771 |
rsquarefree p = (ALL a::real. ~ (poly p a = 0 & poly (diff p) a = 0))" |
| 14516 | 3772 |
by (import poly RSQUAREFREE_ROOTS) |
3773 |
||
| 17694 | 3774 |
lemma RSQUAREFREE_DECOMP: "ALL (p::real list) a::real. |
3775 |
rsquarefree p & poly p a = 0 --> |
|
3776 |
(EX q::real list. poly p = poly (poly_mul [- a, 1] q) & poly q a ~= 0)" |
|
| 14516 | 3777 |
by (import poly RSQUAREFREE_DECOMP) |
3778 |
||
| 17694 | 3779 |
lemma POLY_SQUAREFREE_DECOMP: "ALL (p::real list) (q::real list) (d::real list) (e::real list) |
3780 |
(r::real list) s::real list. |
|
3781 |
poly (diff p) ~= poly [] & |
|
3782 |
poly p = poly (poly_mul q d) & |
|
3783 |
poly (diff p) = poly (poly_mul e d) & |
|
3784 |
poly d = poly (poly_add (poly_mul r p) (poly_mul s (diff p))) --> |
|
3785 |
rsquarefree q & (ALL x::real. (poly q x = 0) = (poly p x = 0))" |
|
| 14516 | 3786 |
by (import poly POLY_SQUAREFREE_DECOMP) |
3787 |
||
3788 |
consts |
|
3789 |
normalize :: "real list => real list" |
|
3790 |
||
3791 |
specification (normalize) normalize: "normalize [] = [] & |
|
| 17644 | 3792 |
(ALL (h::real) t::real list. |
| 14516 | 3793 |
normalize (h # t) = |
| 17652 | 3794 |
(if normalize t = [] then if h = 0 then [] else [h] |
| 14516 | 3795 |
else h # normalize t))" |
3796 |
by (import poly normalize) |
|
3797 |
||
| 17644 | 3798 |
lemma POLY_NORMALIZE: "ALL t::real list. poly (normalize t) = poly t" |
| 14516 | 3799 |
by (import poly POLY_NORMALIZE) |
3800 |
||
3801 |
constdefs |
|
3802 |
degree :: "real list => nat" |
|
| 17644 | 3803 |
"degree == %p::real list. PRE (length (normalize p))" |
3804 |
||
3805 |
lemma degree: "ALL p::real list. degree p = PRE (length (normalize p))" |
|
| 14516 | 3806 |
by (import poly degree) |
3807 |
||
| 17694 | 3808 |
lemma DEGREE_ZERO: "ALL p::real list. poly p = poly [] --> degree p = 0" |
| 14516 | 3809 |
by (import poly DEGREE_ZERO) |
3810 |
||
| 17694 | 3811 |
lemma POLY_ROOTS_FINITE_SET: "ALL p::real list. |
3812 |
poly p ~= poly [] --> FINITE (GSPEC (%x::real. (x, poly p x = 0)))" |
|
| 14516 | 3813 |
by (import poly POLY_ROOTS_FINITE_SET) |
3814 |
||
| 17694 | 3815 |
lemma POLY_MONO: "ALL (x::real) (k::real) xa::real list. |
3816 |
abs x <= k --> abs (poly xa x) <= poly (map abs xa) k" |
|
| 14516 | 3817 |
by (import poly POLY_MONO) |
3818 |
||
3819 |
;end_setup |
|
3820 |
||
3821 |
end |
|
3822 |