1 (* Title : HyperPow.thy |
1 (* Title : HyperPow.thy |
2 Author : Jacques D. Fleuriot |
2 Author : Jacques D. Fleuriot |
3 Copyright : 1998 University of Cambridge |
3 Copyright : 1998 University of Cambridge |
4 Description : Powers theory for hyperreals |
|
5 Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
4 Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
6 *) |
5 *) |
7 |
6 |
8 header{*Exponentials on the Hyperreals*} |
7 header{*Exponentials on the Hyperreals*} |
9 |
8 |
39 |
38 |
40 lemma hrealpow_two: "(r::hypreal) ^ Suc (Suc 0) = r * r" |
39 lemma hrealpow_two: "(r::hypreal) ^ Suc (Suc 0) = r * r" |
41 apply (simp (no_asm)) |
40 apply (simp (no_asm)) |
42 done |
41 done |
43 |
42 |
44 lemma hrabs_hrealpow_minus_one [simp]: "abs(-1 ^ n) = (1::hypreal)" |
|
45 by (simp add: power_abs) |
|
46 |
|
47 lemma hrealpow_two_le: "(0::hypreal) \<le> r ^ Suc (Suc 0)" |
43 lemma hrealpow_two_le: "(0::hypreal) \<le> r ^ Suc (Suc 0)" |
48 by (auto simp add: zero_le_mult_iff) |
44 by (auto simp add: zero_le_mult_iff) |
49 declare hrealpow_two_le [simp] |
45 declare hrealpow_two_le [simp] |
50 |
46 |
51 lemma hrealpow_two_le_add_order: |
47 lemma hrealpow_two_le_add_order: |
88 apply (induct_tac "n") |
84 apply (induct_tac "n") |
89 apply (auto simp add: hypreal_of_nat_Suc left_distrib) |
85 apply (auto simp add: hypreal_of_nat_Suc left_distrib) |
90 apply (cut_tac n = n in two_hrealpow_ge_one, arith) |
86 apply (cut_tac n = n in two_hrealpow_ge_one, arith) |
91 done |
87 done |
92 declare two_hrealpow_gt [simp] |
88 declare two_hrealpow_gt [simp] |
93 |
|
94 lemma hrealpow_minus_one: "-1 ^ (2*n) = (1::hypreal)" |
|
95 by (induct_tac "n", auto) |
|
96 |
|
97 lemma double_lemma: "n+n = (2*n::nat)" |
|
98 by auto |
|
99 |
|
100 (*ugh: need to get rid fo the n+n*) |
|
101 lemma hrealpow_minus_one2: "-1 ^ (n + n) = (1::hypreal)" |
|
102 by (auto simp add: double_lemma hrealpow_minus_one) |
|
103 declare hrealpow_minus_one2 [simp] |
|
104 |
89 |
105 lemma hrealpow: |
90 lemma hrealpow: |
106 "Abs_hypreal(hyprel``{%n. X n}) ^ m = Abs_hypreal(hyprel``{%n. (X n) ^ m})" |
91 "Abs_hypreal(hyprel``{%n. X n}) ^ m = Abs_hypreal(hyprel``{%n. (X n) ^ m})" |
107 apply (induct_tac "m") |
92 apply (induct_tac "m") |
108 apply (auto simp add: hypreal_one_def hypreal_mult) |
93 apply (auto simp add: hypreal_one_def hypreal_mult) |
289 "-1 pow ((1 + 1)*n) = (1::hypreal)" |
274 "-1 pow ((1 + 1)*n) = (1::hypreal)" |
290 apply (subgoal_tac " (- ((1::hypreal))) pow ((1 + 1)*n) = (1::hypreal) ") |
275 apply (subgoal_tac " (- ((1::hypreal))) pow ((1 + 1)*n) = (1::hypreal) ") |
291 apply simp |
276 apply simp |
292 apply (simp only: hypreal_one_def) |
277 apply (simp only: hypreal_one_def) |
293 apply (rule eq_Abs_hypnat [of n]) |
278 apply (rule eq_Abs_hypnat [of n]) |
294 apply (auto simp add: double_lemma hyperpow hypnat_add hypreal_minus |
279 apply (auto simp add: nat_mult_2 [symmetric] hyperpow hypnat_add hypreal_minus |
295 left_distrib) |
280 left_distrib) |
296 done |
281 done |
297 declare hyperpow_minus_one2 [simp] |
282 declare hyperpow_minus_one2 [simp] |
298 |
283 |
299 lemma hyperpow_less_le: |
284 lemma hyperpow_less_le: |
367 simp del: hypnat_of_nat_less_iff) |
352 simp del: hypnat_of_nat_less_iff) |
368 |
353 |
369 ML |
354 ML |
370 {* |
355 {* |
371 val hrealpow_two = thm "hrealpow_two"; |
356 val hrealpow_two = thm "hrealpow_two"; |
372 val hrabs_hrealpow_minus_one = thm "hrabs_hrealpow_minus_one"; |
|
373 val hrealpow_two_le = thm "hrealpow_two_le"; |
357 val hrealpow_two_le = thm "hrealpow_two_le"; |
374 val hrealpow_two_le_add_order = thm "hrealpow_two_le_add_order"; |
358 val hrealpow_two_le_add_order = thm "hrealpow_two_le_add_order"; |
375 val hrealpow_two_le_add_order2 = thm "hrealpow_two_le_add_order2"; |
359 val hrealpow_two_le_add_order2 = thm "hrealpow_two_le_add_order2"; |
376 val hypreal_add_nonneg_eq_0_iff = thm "hypreal_add_nonneg_eq_0_iff"; |
360 val hypreal_add_nonneg_eq_0_iff = thm "hypreal_add_nonneg_eq_0_iff"; |
377 val hypreal_three_squares_add_zero_iff = thm "hypreal_three_squares_add_zero_iff"; |
361 val hypreal_three_squares_add_zero_iff = thm "hypreal_three_squares_add_zero_iff"; |
378 val hrealpow_three_squares_add_zero_iff = thm "hrealpow_three_squares_add_zero_iff"; |
362 val hrealpow_three_squares_add_zero_iff = thm "hrealpow_three_squares_add_zero_iff"; |
379 val hrabs_hrealpow_two = thm "hrabs_hrealpow_two"; |
363 val hrabs_hrealpow_two = thm "hrabs_hrealpow_two"; |
380 val two_hrealpow_ge_one = thm "two_hrealpow_ge_one"; |
364 val two_hrealpow_ge_one = thm "two_hrealpow_ge_one"; |
381 val two_hrealpow_gt = thm "two_hrealpow_gt"; |
365 val two_hrealpow_gt = thm "two_hrealpow_gt"; |
382 val hrealpow_minus_one = thm "hrealpow_minus_one"; |
|
383 val double_lemma = thm "double_lemma"; |
|
384 val hrealpow_minus_one2 = thm "hrealpow_minus_one2"; |
|
385 val hrealpow = thm "hrealpow"; |
366 val hrealpow = thm "hrealpow"; |
386 val hrealpow_sum_square_expand = thm "hrealpow_sum_square_expand"; |
367 val hrealpow_sum_square_expand = thm "hrealpow_sum_square_expand"; |
387 val hypreal_of_real_power = thm "hypreal_of_real_power"; |
368 val hypreal_of_real_power = thm "hypreal_of_real_power"; |
388 val power_hypreal_of_real_number_of = thm "power_hypreal_of_real_number_of"; |
369 val power_hypreal_of_real_number_of = thm "power_hypreal_of_real_number_of"; |
389 val hrealpow_HFinite = thm "hrealpow_HFinite"; |
370 val hrealpow_HFinite = thm "hrealpow_HFinite"; |