equal
deleted
inserted
replaced
52 by (induct m) (simp_all add: algebra_simps) |
52 by (induct m) (simp_all add: algebra_simps) |
53 |
53 |
54 lemma power_mult: "a ^ (m * n) = (a ^ m) ^ n" |
54 lemma power_mult: "a ^ (m * n) = (a ^ m) ^ n" |
55 by (induct n) (simp_all add: power_add) |
55 by (induct n) (simp_all add: power_add) |
56 |
56 |
57 lemma power2_eq_square: "a\<^sup>2 = a * a" |
|
58 by (simp add: numeral_2_eq_2) |
|
59 |
|
60 lemma power3_eq_cube: "a ^ 3 = a * a * a" |
|
61 by (simp add: numeral_3_eq_3 mult.assoc) |
|
62 |
|
63 lemma power_even_eq: "a ^ (2 * n) = (a ^ n)\<^sup>2" |
57 lemma power_even_eq: "a ^ (2 * n) = (a ^ n)\<^sup>2" |
64 by (subst mult.commute) (simp add: power_mult) |
58 by (subst mult.commute) (simp add: power_mult) |
65 |
59 |
66 lemma power_odd_eq: "a ^ Suc (2*n) = a * (a ^ n)\<^sup>2" |
60 lemma power_odd_eq: "a ^ Suc (2*n) = a * (a ^ n)\<^sup>2" |
67 by (simp add: power_even_eq) |
61 by (simp add: power_even_eq) |
70 by (simp only: numeral_Bit0 power_add Let_def) |
64 by (simp only: numeral_Bit0 power_add Let_def) |
71 |
65 |
72 lemma power_numeral_odd: "z ^ numeral (Num.Bit1 w) = (let w = z ^ (numeral w) in z * w * w)" |
66 lemma power_numeral_odd: "z ^ numeral (Num.Bit1 w) = (let w = z ^ (numeral w) in z * w * w)" |
73 by (simp only: numeral_Bit1 One_nat_def add_Suc_right add_0_right |
67 by (simp only: numeral_Bit1 One_nat_def add_Suc_right add_0_right |
74 power_Suc power_add Let_def mult.assoc) |
68 power_Suc power_add Let_def mult.assoc) |
|
69 |
|
70 lemma power2_eq_square: "a\<^sup>2 = a * a" |
|
71 by (simp add: numeral_2_eq_2) |
|
72 |
|
73 lemma power3_eq_cube: "a ^ 3 = a * a * a" |
|
74 by (simp add: numeral_3_eq_3 mult.assoc) |
|
75 |
|
76 lemma power4_eq_xxxx: "x^4 = x * x * x * x" |
|
77 by (simp add: mult.assoc power_numeral_even) |
75 |
78 |
76 lemma funpow_times_power: "(times x ^^ f x) = times (x ^ f x)" |
79 lemma funpow_times_power: "(times x ^^ f x) = times (x ^ f x)" |
77 proof (induct "f x" arbitrary: f) |
80 proof (induct "f x" arbitrary: f) |
78 case 0 |
81 case 0 |
79 then show ?case by (simp add: fun_eq_iff) |
82 then show ?case by (simp add: fun_eq_iff) |