237 apply (drule_tac n = n in realpow_Suc_less_one) |
237 apply (drule_tac n = n in realpow_Suc_less_one) |
238 apply (drule_tac [4] n = n in power_gt1_lemma) |
238 apply (drule_tac [4] n = n in power_gt1_lemma) |
239 apply (auto) |
239 apply (auto) |
240 done |
240 done |
241 |
241 |
|
242 lemma real_root_less_mono: |
|
243 "[| 0 \<le> x; x < y |] ==> root(Suc n) x < root(Suc n) y" |
|
244 apply (frule order_le_less_trans, assumption) |
|
245 apply (frule_tac n1 = n in real_root_pow_pos2 [THEN ssubst]) |
|
246 apply (rotate_tac 1, assumption) |
|
247 apply (frule_tac n1 = n in real_root_pow_pos [THEN ssubst]) |
|
248 apply (rotate_tac 3, assumption) |
|
249 apply (drule_tac y = "root (Suc n) y ^ Suc n" in order_less_imp_le) |
|
250 apply (frule_tac n = n in real_root_pos_pos_le) |
|
251 apply (frule_tac n = n in real_root_pos_pos) |
|
252 apply (drule_tac x = "root (Suc n) x" and y = "root (Suc n) y" in realpow_increasing) |
|
253 apply (assumption, assumption) |
|
254 apply (drule_tac x = "root (Suc n) x" in order_le_imp_less_or_eq) |
|
255 apply auto |
|
256 apply (drule_tac f = "%x. x ^ (Suc n)" in arg_cong) |
|
257 apply (auto simp add: real_root_pow_pos2 simp del: realpow_Suc) |
|
258 done |
|
259 |
|
260 lemma real_root_le_mono: |
|
261 "[| 0 \<le> x; x \<le> y |] ==> root(Suc n) x \<le> root(Suc n) y" |
|
262 apply (drule_tac y = y in order_le_imp_less_or_eq) |
|
263 apply (auto dest: real_root_less_mono intro: order_less_imp_le) |
|
264 done |
|
265 |
|
266 lemma real_root_less_iff [simp]: |
|
267 "[| 0 \<le> x; 0 \<le> y |] ==> (root(Suc n) x < root(Suc n) y) = (x < y)" |
|
268 apply (auto intro: real_root_less_mono) |
|
269 apply (rule ccontr, drule linorder_not_less [THEN iffD1]) |
|
270 apply (drule_tac x = y and n = n in real_root_le_mono, auto) |
|
271 done |
|
272 |
|
273 lemma real_root_le_iff [simp]: |
|
274 "[| 0 \<le> x; 0 \<le> y |] ==> (root(Suc n) x \<le> root(Suc n) y) = (x \<le> y)" |
|
275 apply (auto intro: real_root_le_mono) |
|
276 apply (simp (no_asm) add: linorder_not_less [symmetric]) |
|
277 apply auto |
|
278 apply (drule_tac x = y and n = n in real_root_less_mono, auto) |
|
279 done |
|
280 |
|
281 lemma real_root_eq_iff [simp]: |
|
282 "[| 0 \<le> x; 0 \<le> y |] ==> (root(Suc n) x = root(Suc n) y) = (x = y)" |
|
283 apply (auto intro!: order_antisym [where 'a = real]) |
|
284 apply (rule_tac n1 = n in real_root_le_iff [THEN iffD1]) |
|
285 apply (rule_tac [4] n1 = n in real_root_le_iff [THEN iffD1], auto) |
|
286 done |
|
287 |
|
288 lemma real_root_pos_unique: |
|
289 "[| 0 \<le> x; 0 \<le> y; y ^ (Suc n) = x |] ==> root (Suc n) x = y" |
|
290 by (auto dest: real_root_pos2 simp del: realpow_Suc) |
|
291 |
|
292 lemma real_root_mult: |
|
293 "[| 0 \<le> x; 0 \<le> y |] |
|
294 ==> root(Suc n) (x * y) = root(Suc n) x * root(Suc n) y" |
|
295 apply (rule real_root_pos_unique) |
|
296 apply (auto intro!: real_root_pos_pos_le |
|
297 simp add: power_mult_distrib zero_le_mult_iff real_root_pow_pos2 |
|
298 simp del: realpow_Suc) |
|
299 done |
|
300 |
|
301 lemma real_root_inverse: |
|
302 "0 \<le> x ==> (root(Suc n) (inverse x) = inverse(root(Suc n) x))" |
|
303 apply (rule real_root_pos_unique) |
|
304 apply (auto intro: real_root_pos_pos_le |
|
305 simp add: power_inverse [symmetric] real_root_pow_pos2 |
|
306 simp del: realpow_Suc) |
|
307 done |
|
308 |
|
309 lemma real_root_divide: |
|
310 "[| 0 \<le> x; 0 \<le> y |] |
|
311 ==> (root(Suc n) (x / y) = root(Suc n) x / root(Suc n) y)" |
|
312 apply (simp add: divide_inverse) |
|
313 apply (auto simp add: real_root_mult real_root_inverse) |
|
314 done |
|
315 |
242 |
316 |
243 subsection{*Square Root*} |
317 subsection{*Square Root*} |
244 |
318 |
245 text{*needed because 2 is a binary numeral!*} |
319 text{*needed because 2 is a binary numeral!*} |
246 lemma root_2_eq [simp]: "root 2 = root (Suc (Suc 0))" |
320 lemma root_2_eq [simp]: "root 2 = root (Suc (Suc 0))" |
405 by (simp add: divide_inverse mult_assoc [symmetric] |
479 by (simp add: divide_inverse mult_assoc [symmetric] |
406 power2_eq_square [symmetric] real_inv_sqrt_pow2 pos nz) |
480 power2_eq_square [symmetric] real_inv_sqrt_pow2 pos nz) |
407 qed |
481 qed |
408 qed |
482 qed |
409 |
483 |
|
484 |
|
485 lemma real_sqrt_less_mono: "[| 0 \<le> x; x < y |] ==> sqrt(x) < sqrt(y)" |
|
486 by (simp add: sqrt_def) |
|
487 |
|
488 lemma real_sqrt_le_mono: "[| 0 \<le> x; x \<le> y |] ==> sqrt(x) \<le> sqrt(y)" |
|
489 by (simp add: sqrt_def) |
|
490 |
|
491 lemma real_sqrt_less_iff [simp]: |
|
492 "[| 0 \<le> x; 0 \<le> y |] ==> (sqrt(x) < sqrt(y)) = (x < y)" |
|
493 by (simp add: sqrt_def) |
|
494 |
|
495 lemma real_sqrt_le_iff [simp]: |
|
496 "[| 0 \<le> x; 0 \<le> y |] ==> (sqrt(x) \<le> sqrt(y)) = (x \<le> y)" |
|
497 by (simp add: sqrt_def) |
|
498 |
|
499 lemma real_sqrt_eq_iff [simp]: |
|
500 "[| 0 \<le> x; 0 \<le> y |] ==> (sqrt(x) = sqrt(y)) = (x = y)" |
|
501 by (simp add: sqrt_def) |
|
502 |
|
503 lemma real_sqrt_sos_less_one_iff [simp]: "(sqrt(x\<twosuperior> + y\<twosuperior>) < 1) = (x\<twosuperior> + y\<twosuperior> < 1)" |
|
504 apply (rule real_sqrt_one [THEN subst], safe) |
|
505 apply (rule_tac [2] real_sqrt_less_mono) |
|
506 apply (drule real_sqrt_less_iff [THEN [2] rev_iffD1], auto) |
|
507 done |
|
508 |
|
509 lemma real_sqrt_sos_eq_one_iff [simp]: "(sqrt(x\<twosuperior> + y\<twosuperior>) = 1) = (x\<twosuperior> + y\<twosuperior> = 1)" |
|
510 apply (rule real_sqrt_one [THEN subst], safe) |
|
511 apply (drule real_sqrt_eq_iff [THEN [2] rev_iffD1], auto) |
|
512 done |
|
513 |
|
514 lemma real_divide_square_eq [simp]: "(((r::real) * a) / (r * r)) = a / r" |
|
515 apply (simp add: divide_inverse) |
|
516 apply (case_tac "r=0") |
|
517 apply (auto simp add: mult_ac) |
|
518 done |
|
519 |
|
520 |
410 end |
521 end |