| author | wenzelm | 
| Thu, 08 Nov 2007 14:51:28 +0100 | |
| changeset 25343 | 31c55418de5a | 
| parent 25231 | 1aa9c8f022d0 | 
| child 25836 | f7771e4f7064 | 
| permissions | -rw-r--r-- | 
| 3390 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 1 | (* Title: HOL/Power.thy | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 2 | ID: $Id$ | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 3 | Author: Lawrence C Paulson, Cambridge University Computer Laboratory | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 4 | Copyright 1997 University of Cambridge | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 5 | |
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 6 | *) | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 7 | |
| 16733 
236dfafbeb63
linear arithmetic now takes "&" in assumptions apart.
 nipkow parents: 
15251diff
changeset | 8 | header{*Exponentiation*}
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 9 | |
| 15131 | 10 | theory Power | 
| 21413 | 11 | imports Nat | 
| 15131 | 12 | begin | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 13 | |
| 24996 | 14 | class power = type + | 
| 25062 | 15 | fixes power :: "'a \<Rightarrow> nat \<Rightarrow> 'a" (infixr "^" 80) | 
| 24996 | 16 | |
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 17 | subsection{*Powers for Arbitrary Monoids*}
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 18 | |
| 22390 | 19 | class recpower = monoid_mult + power + | 
| 25062 | 20 | assumes power_0 [simp]: "a ^ 0 = 1" | 
| 21 | assumes power_Suc: "a ^ Suc n = a * (a ^ n)" | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 22 | |
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 23 | lemma power_0_Suc [simp]: "(0::'a::{recpower,semiring_0}) ^ (Suc n) = 0"
 | 
| 23183 | 24 | by (simp add: power_Suc) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 25 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 26 | text{*It looks plausible as a simprule, but its effect can be strange.*}
 | 
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 27 | lemma power_0_left: "0^n = (if n=0 then 1 else (0::'a::{recpower,semiring_0}))"
 | 
| 23183 | 28 | by (induct n) simp_all | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 29 | |
| 15004 | 30 | lemma power_one [simp]: "1^n = (1::'a::recpower)" | 
| 23183 | 31 | by (induct n) (simp_all add: power_Suc) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 32 | |
| 15004 | 33 | lemma power_one_right [simp]: "(a::'a::recpower) ^ 1 = a" | 
| 23183 | 34 | by (simp add: power_Suc) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 35 | |
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 36 | lemma power_commutes: "(a::'a::recpower) ^ n * a = a * a ^ n" | 
| 23183 | 37 | by (induct n) (simp_all add: power_Suc mult_assoc) | 
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 38 | |
| 15004 | 39 | lemma power_add: "(a::'a::recpower) ^ (m+n) = (a^m) * (a^n)" | 
| 23183 | 40 | by (induct m) (simp_all add: power_Suc mult_ac) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 41 | |
| 15004 | 42 | lemma power_mult: "(a::'a::recpower) ^ (m*n) = (a^m) ^ n" | 
| 23183 | 43 | by (induct n) (simp_all add: power_Suc power_add) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 44 | |
| 21199 
2d83f93c3580
* Added annihilation axioms ("x * 0 = 0") to axclass semiring_0.
 krauss parents: 
17149diff
changeset | 45 | lemma power_mult_distrib: "((a::'a::{recpower,comm_monoid_mult}) * b) ^ n = (a^n) * (b^n)"
 | 
| 23183 | 46 | by (induct n) (simp_all add: power_Suc mult_ac) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 47 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 48 | lemma zero_less_power: | 
| 15004 | 49 |      "0 < (a::'a::{ordered_semidom,recpower}) ==> 0 < a^n"
 | 
| 15251 | 50 | apply (induct "n") | 
| 16775 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 51 | apply (simp_all add: power_Suc zero_less_one mult_pos_pos) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 52 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 53 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 54 | lemma zero_le_power: | 
| 15004 | 55 |      "0 \<le> (a::'a::{ordered_semidom,recpower}) ==> 0 \<le> a^n"
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 56 | apply (simp add: order_le_less) | 
| 14577 | 57 | apply (erule disjE) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 58 | apply (simp_all add: zero_less_power zero_less_one power_0_left) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 59 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 60 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 61 | lemma one_le_power: | 
| 15004 | 62 |      "1 \<le> (a::'a::{ordered_semidom,recpower}) ==> 1 \<le> a^n"
 | 
| 15251 | 63 | apply (induct "n") | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 64 | apply (simp_all add: power_Suc) | 
| 14577 | 65 | apply (rule order_trans [OF _ mult_mono [of 1 _ 1]]) | 
| 66 | apply (simp_all add: zero_le_one order_trans [OF zero_le_one]) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 67 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 68 | |
| 14738 | 69 | lemma gt1_imp_ge0: "1 < a ==> 0 \<le> (a::'a::ordered_semidom)" | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 70 | by (simp add: order_trans [OF zero_le_one order_less_imp_le]) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 71 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 72 | lemma power_gt1_lemma: | 
| 15004 | 73 |   assumes gt1: "1 < (a::'a::{ordered_semidom,recpower})"
 | 
| 14577 | 74 | shows "1 < a * a^n" | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 75 | proof - | 
| 14577 | 76 | have "1*1 < a*1" using gt1 by simp | 
| 77 | also have "\<dots> \<le> a * a^n" using gt1 | |
| 78 | by (simp only: mult_mono gt1_imp_ge0 one_le_power order_less_imp_le | |
| 79 | zero_le_one order_refl) | |
| 80 | finally show ?thesis by simp | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 81 | qed | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 82 | |
| 24376 | 83 | lemma one_less_power: | 
| 84 |   "\<lbrakk>1 < (a::'a::{ordered_semidom,recpower}); 0 < n\<rbrakk> \<Longrightarrow> 1 < a ^ n"
 | |
| 85 | by (cases n, simp_all add: power_gt1_lemma power_Suc) | |
| 86 | ||
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 87 | lemma power_gt1: | 
| 15004 | 88 |      "1 < (a::'a::{ordered_semidom,recpower}) ==> 1 < a ^ (Suc n)"
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 89 | by (simp add: power_gt1_lemma power_Suc) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 90 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 91 | lemma power_le_imp_le_exp: | 
| 15004 | 92 |   assumes gt1: "(1::'a::{recpower,ordered_semidom}) < a"
 | 
| 14577 | 93 | shows "!!n. a^m \<le> a^n ==> m \<le> n" | 
| 94 | proof (induct m) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 95 | case 0 | 
| 14577 | 96 | show ?case by simp | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 97 | next | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 98 | case (Suc m) | 
| 14577 | 99 | show ?case | 
| 100 | proof (cases n) | |
| 101 | case 0 | |
| 102 | from prems have "a * a^m \<le> 1" by (simp add: power_Suc) | |
| 103 | with gt1 show ?thesis | |
| 104 | by (force simp only: power_gt1_lemma | |
| 105 | linorder_not_less [symmetric]) | |
| 106 | next | |
| 107 | case (Suc n) | |
| 108 | from prems show ?thesis | |
| 109 | by (force dest: mult_left_le_imp_le | |
| 110 | simp add: power_Suc order_less_trans [OF zero_less_one gt1]) | |
| 111 | qed | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 112 | qed | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 113 | |
| 14577 | 114 | text{*Surely we can strengthen this? It holds for @{text "0<a<1"} too.*}
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 115 | lemma power_inject_exp [simp]: | 
| 15004 | 116 |      "1 < (a::'a::{ordered_semidom,recpower}) ==> (a^m = a^n) = (m=n)"
 | 
| 14577 | 117 | by (force simp add: order_antisym power_le_imp_le_exp) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 118 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 119 | text{*Can relax the first premise to @{term "0<a"} in the case of the
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 120 | natural numbers.*} | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 121 | lemma power_less_imp_less_exp: | 
| 15004 | 122 |      "[| (1::'a::{recpower,ordered_semidom}) < a; a^m < a^n |] ==> m < n"
 | 
| 14577 | 123 | by (simp add: order_less_le [of m n] order_less_le [of "a^m" "a^n"] | 
| 124 | power_le_imp_le_exp) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 125 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 126 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 127 | lemma power_mono: | 
| 15004 | 128 |      "[|a \<le> b; (0::'a::{recpower,ordered_semidom}) \<le> a|] ==> a^n \<le> b^n"
 | 
| 15251 | 129 | apply (induct "n") | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 130 | apply (simp_all add: power_Suc) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 131 | apply (auto intro: mult_mono zero_le_power order_trans [of 0 a b]) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 132 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 133 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 134 | lemma power_strict_mono [rule_format]: | 
| 15004 | 135 |      "[|a < b; (0::'a::{recpower,ordered_semidom}) \<le> a|]
 | 
| 14577 | 136 | ==> 0 < n --> a^n < b^n" | 
| 15251 | 137 | apply (induct "n") | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 138 | apply (auto simp add: mult_strict_mono zero_le_power power_Suc | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 139 | order_le_less_trans [of 0 a b]) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 140 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 141 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 142 | lemma power_eq_0_iff [simp]: | 
| 25162 | 143 |   "(a^n = 0) = (a = (0::'a::{ring_1_no_zero_divisors,recpower}) & n>0)"
 | 
| 15251 | 144 | apply (induct "n") | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 145 | apply (auto simp add: power_Suc zero_neq_one [THEN not_sym]) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 146 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 147 | |
| 25134 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 148 | lemma field_power_not_zero: | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 149 |   "a \<noteq> (0::'a::{ring_1_no_zero_divisors,recpower}) ==> a^n \<noteq> 0"
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 150 | by force | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 151 | |
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 152 | lemma nonzero_power_inverse: | 
| 22991 | 153 |   fixes a :: "'a::{division_ring,recpower}"
 | 
| 154 | shows "a \<noteq> 0 ==> inverse (a ^ n) = (inverse a) ^ n" | |
| 15251 | 155 | apply (induct "n") | 
| 22988 
f6b8184f5b4a
generalize some lemmas from field to division_ring
 huffman parents: 
22957diff
changeset | 156 | apply (auto simp add: power_Suc nonzero_inverse_mult_distrib power_commutes) | 
| 22991 | 157 | done (* TODO: reorient or rename to nonzero_inverse_power *) | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 158 | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 159 | text{*Perhaps these should be simprules.*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 160 | lemma power_inverse: | 
| 22991 | 161 |   fixes a :: "'a::{division_ring,division_by_zero,recpower}"
 | 
| 162 | shows "inverse (a ^ n) = (inverse a) ^ n" | |
| 163 | apply (cases "a = 0") | |
| 164 | apply (simp add: power_0_left) | |
| 165 | apply (simp add: nonzero_power_inverse) | |
| 166 | done (* TODO: reorient or rename to inverse_power *) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 167 | |
| 16775 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 168 | lemma power_one_over: "1 / (a::'a::{field,division_by_zero,recpower})^n = 
 | 
| 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 169 | (1 / a)^n" | 
| 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 170 | apply (simp add: divide_inverse) | 
| 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 171 | apply (rule power_inverse) | 
| 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 172 | done | 
| 
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
 avigad parents: 
16733diff
changeset | 173 | |
| 14577 | 174 | lemma nonzero_power_divide: | 
| 15004 | 175 |     "b \<noteq> 0 ==> (a/b) ^ n = ((a::'a::{field,recpower}) ^ n) / (b ^ n)"
 | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 176 | by (simp add: divide_inverse power_mult_distrib nonzero_power_inverse) | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 177 | |
| 14577 | 178 | lemma power_divide: | 
| 15004 | 179 |     "(a/b) ^ n = ((a::'a::{field,division_by_zero,recpower}) ^ n / b ^ n)"
 | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 180 | apply (case_tac "b=0", simp add: power_0_left) | 
| 14577 | 181 | apply (rule nonzero_power_divide) | 
| 182 | apply assumption | |
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 183 | done | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 184 | |
| 15004 | 185 | lemma power_abs: "abs(a ^ n) = abs(a::'a::{ordered_idom,recpower}) ^ n"
 | 
| 15251 | 186 | apply (induct "n") | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 187 | apply (auto simp add: power_Suc abs_mult) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 188 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 189 | |
| 24286 
7619080e49f0
ATP blacklisting is now in theory data, attribute noatp
 paulson parents: 
23544diff
changeset | 190 | lemma zero_less_power_abs_iff [simp,noatp]: | 
| 15004 | 191 |      "(0 < (abs a)^n) = (a \<noteq> (0::'a::{ordered_idom,recpower}) | n=0)"
 | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 192 | proof (induct "n") | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 193 | case 0 | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 194 | show ?case by (simp add: zero_less_one) | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 195 | next | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 196 | case (Suc n) | 
| 25231 | 197 | show ?case by (auto simp add: prems power_Suc zero_less_mult_iff | 
| 198 | abs_zero) | |
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 199 | qed | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 200 | |
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 201 | lemma zero_le_power_abs [simp]: | 
| 15004 | 202 |      "(0::'a::{ordered_idom,recpower}) \<le> (abs a)^n"
 | 
| 22957 | 203 | by (rule zero_le_power [OF abs_ge_zero]) | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 204 | |
| 15004 | 205 | lemma power_minus: "(-a) ^ n = (- 1)^n * (a::'a::{comm_ring_1,recpower}) ^ n"
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 206 | proof - | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 207 | have "-a = (- 1) * a" by (simp add: minus_mult_left [symmetric]) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 208 | thus ?thesis by (simp only: power_mult_distrib) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 209 | qed | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 210 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 211 | text{*Lemma for @{text power_strict_decreasing}*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 212 | lemma power_Suc_less: | 
| 15004 | 213 |      "[|(0::'a::{ordered_semidom,recpower}) < a; a < 1|]
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 214 | ==> a * a^n < a^n" | 
| 15251 | 215 | apply (induct n) | 
| 14577 | 216 | apply (auto simp add: power_Suc mult_strict_left_mono) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 217 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 218 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 219 | lemma power_strict_decreasing: | 
| 15004 | 220 |      "[|n < N; 0 < a; a < (1::'a::{ordered_semidom,recpower})|]
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 221 | ==> a^N < a^n" | 
| 14577 | 222 | apply (erule rev_mp) | 
| 15251 | 223 | apply (induct "N") | 
| 14577 | 224 | apply (auto simp add: power_Suc power_Suc_less less_Suc_eq) | 
| 225 | apply (rename_tac m) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 226 | apply (subgoal_tac "a * a^m < 1 * a^n", simp) | 
| 14577 | 227 | apply (rule mult_strict_mono) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 228 | apply (auto simp add: zero_le_power zero_less_one order_less_imp_le) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 229 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 230 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 231 | text{*Proof resembles that of @{text power_strict_decreasing}*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 232 | lemma power_decreasing: | 
| 15004 | 233 |      "[|n \<le> N; 0 \<le> a; a \<le> (1::'a::{ordered_semidom,recpower})|]
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 234 | ==> a^N \<le> a^n" | 
| 14577 | 235 | apply (erule rev_mp) | 
| 15251 | 236 | apply (induct "N") | 
| 14577 | 237 | apply (auto simp add: power_Suc le_Suc_eq) | 
| 238 | apply (rename_tac m) | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 239 | apply (subgoal_tac "a * a^m \<le> 1 * a^n", simp) | 
| 14577 | 240 | apply (rule mult_mono) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 241 | apply (auto simp add: zero_le_power zero_le_one) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 242 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 243 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 244 | lemma power_Suc_less_one: | 
| 15004 | 245 |      "[| 0 < a; a < (1::'a::{ordered_semidom,recpower}) |] ==> a ^ Suc n < 1"
 | 
| 14577 | 246 | apply (insert power_strict_decreasing [of 0 "Suc n" a], simp) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 247 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 248 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 249 | text{*Proof again resembles that of @{text power_strict_decreasing}*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 250 | lemma power_increasing: | 
| 15004 | 251 |      "[|n \<le> N; (1::'a::{ordered_semidom,recpower}) \<le> a|] ==> a^n \<le> a^N"
 | 
| 14577 | 252 | apply (erule rev_mp) | 
| 15251 | 253 | apply (induct "N") | 
| 14577 | 254 | apply (auto simp add: power_Suc le_Suc_eq) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 255 | apply (rename_tac m) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 256 | apply (subgoal_tac "1 * a^n \<le> a * a^m", simp) | 
| 14577 | 257 | apply (rule mult_mono) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 258 | apply (auto simp add: order_trans [OF zero_le_one] zero_le_power) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 259 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 260 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 261 | text{*Lemma for @{text power_strict_increasing}*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 262 | lemma power_less_power_Suc: | 
| 15004 | 263 |      "(1::'a::{ordered_semidom,recpower}) < a ==> a^n < a * a^n"
 | 
| 15251 | 264 | apply (induct n) | 
| 14577 | 265 | apply (auto simp add: power_Suc mult_strict_left_mono order_less_trans [OF zero_less_one]) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 266 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 267 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 268 | lemma power_strict_increasing: | 
| 15004 | 269 |      "[|n < N; (1::'a::{ordered_semidom,recpower}) < a|] ==> a^n < a^N"
 | 
| 14577 | 270 | apply (erule rev_mp) | 
| 15251 | 271 | apply (induct "N") | 
| 14577 | 272 | apply (auto simp add: power_less_power_Suc power_Suc less_Suc_eq) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 273 | apply (rename_tac m) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 274 | apply (subgoal_tac "1 * a^n < a * a^m", simp) | 
| 14577 | 275 | apply (rule mult_strict_mono) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 276 | apply (auto simp add: order_less_trans [OF zero_less_one] zero_le_power | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 277 | order_less_imp_le) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 278 | done | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 279 | |
| 25134 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 280 | lemma power_increasing_iff [simp]: | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 281 |   "1 < (b::'a::{ordered_semidom,recpower}) ==> (b ^ x \<le> b ^ y) = (x \<le> y)"
 | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 282 | by (blast intro: power_le_imp_le_exp power_increasing order_less_imp_le) | 
| 15066 | 283 | |
| 284 | lemma power_strict_increasing_iff [simp]: | |
| 25134 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 285 |   "1 < (b::'a::{ordered_semidom,recpower}) ==> (b ^ x < b ^ y) = (x < y)"
 | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 286 | by (blast intro: power_less_imp_less_exp power_strict_increasing) | 
| 15066 | 287 | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 288 | lemma power_le_imp_le_base: | 
| 25134 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 289 | assumes le: "a ^ Suc n \<le> b ^ Suc n" | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 290 |     and ynonneg: "(0::'a::{ordered_semidom,recpower}) \<le> b"
 | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 291 | shows "a \<le> b" | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 292 | proof (rule ccontr) | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 293 | assume "~ a \<le> b" | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 294 | then have "b < a" by (simp only: linorder_not_le) | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 295 | then have "b ^ Suc n < a ^ Suc n" | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 296 | by (simp only: prems power_strict_mono) | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 297 | from le and this show "False" | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 298 | by (simp add: linorder_not_less [symmetric]) | 
| 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 299 | qed | 
| 14577 | 300 | |
| 22853 | 301 | lemma power_less_imp_less_base: | 
| 302 |   fixes a b :: "'a::{ordered_semidom,recpower}"
 | |
| 303 | assumes less: "a ^ n < b ^ n" | |
| 304 | assumes nonneg: "0 \<le> b" | |
| 305 | shows "a < b" | |
| 306 | proof (rule contrapos_pp [OF less]) | |
| 307 | assume "~ a < b" | |
| 308 | hence "b \<le> a" by (simp only: linorder_not_less) | |
| 309 | hence "b ^ n \<le> a ^ n" using nonneg by (rule power_mono) | |
| 310 | thus "~ a ^ n < b ^ n" by (simp only: linorder_not_less) | |
| 311 | qed | |
| 312 | ||
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 313 | lemma power_inject_base: | 
| 14577 | 314 | "[| a ^ Suc n = b ^ Suc n; 0 \<le> a; 0 \<le> b |] | 
| 15004 | 315 |       ==> a = (b::'a::{ordered_semidom,recpower})"
 | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 316 | by (blast intro: power_le_imp_le_base order_antisym order_eq_refl sym) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 317 | |
| 22955 | 318 | lemma power_eq_imp_eq_base: | 
| 319 |   fixes a b :: "'a::{ordered_semidom,recpower}"
 | |
| 320 | shows "\<lbrakk>a ^ n = b ^ n; 0 \<le> a; 0 \<le> b; 0 < n\<rbrakk> \<Longrightarrow> a = b" | |
| 321 | by (cases n, simp_all, rule power_inject_base) | |
| 322 | ||
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 323 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 324 | subsection{*Exponentiation for the Natural Numbers*}
 | 
| 3390 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 325 | |
| 21456 | 326 | instance nat :: power .. | 
| 327 | ||
| 8844 | 328 | primrec (power) | 
| 3390 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 329 | "p ^ 0 = 1" | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 330 | "p ^ (Suc n) = (p::nat) * (p ^ n)" | 
| 14577 | 331 | |
| 15004 | 332 | instance nat :: recpower | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 333 | proof | 
| 14438 | 334 | fix z n :: nat | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 335 | show "z^0 = 1" by simp | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 336 | show "z^(Suc n) = z * (z^n)" by simp | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 337 | qed | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 338 | |
| 23305 | 339 | lemma of_nat_power: | 
| 340 |   "of_nat (m ^ n) = (of_nat m::'a::{semiring_1,recpower}) ^ n"
 | |
| 23431 
25ca91279a9b
change simp rules for of_nat to work like int did previously (reorient of_nat_Suc, remove of_nat_mult [simp]); preserve original variable names in legacy int theorems
 huffman parents: 
23305diff
changeset | 341 | by (induct n, simp_all add: power_Suc of_nat_mult) | 
| 23305 | 342 | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 343 | lemma nat_one_le_power [simp]: "1 \<le> i ==> Suc 0 \<le> i^n" | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 344 | by (insert one_le_power [of i n], simp) | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 345 | |
| 25162 | 346 | lemma nat_zero_less_power_iff [simp]: "(x^n > 0) = (x > (0::nat) | n=0)" | 
| 21413 | 347 | by (induct "n", auto) | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 348 | |
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 349 | text{*Valid for the naturals, but what if @{text"0<i<1"}?
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 350 | Premises cannot be weakened: consider the case where @{term "i=0"},
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 351 | @{term "m=1"} and @{term "n=0"}.*}
 | 
| 21413 | 352 | lemma nat_power_less_imp_less: | 
| 353 | assumes nonneg: "0 < (i\<Colon>nat)" | |
| 354 | assumes less: "i^m < i^n" | |
| 355 | shows "m < n" | |
| 356 | proof (cases "i = 1") | |
| 357 | case True with less power_one [where 'a = nat] show ?thesis by simp | |
| 358 | next | |
| 359 | case False with nonneg have "1 < i" by auto | |
| 360 | from power_strict_increasing_iff [OF this] less show ?thesis .. | |
| 361 | qed | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 362 | |
| 17149 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 363 | lemma power_diff: | 
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 364 | assumes nz: "a ~= 0" | 
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 365 |   shows "n <= m ==> (a::'a::{recpower, field}) ^ (m-n) = (a^m) / (a^n)"
 | 
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 366 | by (induct m n rule: diff_induct) | 
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 367 | (simp_all add: power_Suc nonzero_mult_divide_cancel_left nz) | 
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 368 | |
| 
e2b19c92ef51
Lemmas on dvd, power and finite summation added or strengthened.
 ballarin parents: 
16796diff
changeset | 369 | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 370 | text{*ML bindings for the general exponentiation theorems*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 371 | ML | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 372 | {*
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 373 | val power_0 = thm"power_0"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 374 | val power_Suc = thm"power_Suc"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 375 | val power_0_Suc = thm"power_0_Suc"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 376 | val power_0_left = thm"power_0_left"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 377 | val power_one = thm"power_one"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 378 | val power_one_right = thm"power_one_right"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 379 | val power_add = thm"power_add"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 380 | val power_mult = thm"power_mult"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 381 | val power_mult_distrib = thm"power_mult_distrib"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 382 | val zero_less_power = thm"zero_less_power"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 383 | val zero_le_power = thm"zero_le_power"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 384 | val one_le_power = thm"one_le_power"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 385 | val gt1_imp_ge0 = thm"gt1_imp_ge0"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 386 | val power_gt1_lemma = thm"power_gt1_lemma"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 387 | val power_gt1 = thm"power_gt1"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 388 | val power_le_imp_le_exp = thm"power_le_imp_le_exp"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 389 | val power_inject_exp = thm"power_inject_exp"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 390 | val power_less_imp_less_exp = thm"power_less_imp_less_exp"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 391 | val power_mono = thm"power_mono"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 392 | val power_strict_mono = thm"power_strict_mono"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 393 | val power_eq_0_iff = thm"power_eq_0_iff"; | 
| 25134 
3d4953e88449
Eliminated most of the neq0_conv occurrences. As a result, many
 nipkow parents: 
25062diff
changeset | 394 | val field_power_eq_0_iff = thm"power_eq_0_iff"; | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 395 | val field_power_not_zero = thm"field_power_not_zero"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 396 | val power_inverse = thm"power_inverse"; | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 397 | val nonzero_power_divide = thm"nonzero_power_divide"; | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 398 | val power_divide = thm"power_divide"; | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 399 | val power_abs = thm"power_abs"; | 
| 14353 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 400 | val zero_less_power_abs_iff = thm"zero_less_power_abs_iff"; | 
| 
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
 paulson parents: 
14348diff
changeset | 401 | val zero_le_power_abs = thm "zero_le_power_abs"; | 
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 402 | val power_minus = thm"power_minus"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 403 | val power_Suc_less = thm"power_Suc_less"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 404 | val power_strict_decreasing = thm"power_strict_decreasing"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 405 | val power_decreasing = thm"power_decreasing"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 406 | val power_Suc_less_one = thm"power_Suc_less_one"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 407 | val power_increasing = thm"power_increasing"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 408 | val power_strict_increasing = thm"power_strict_increasing"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 409 | val power_le_imp_le_base = thm"power_le_imp_le_base"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 410 | val power_inject_base = thm"power_inject_base"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 411 | *} | 
| 14577 | 412 | |
| 14348 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 413 | text{*ML bindings for the remaining theorems*}
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 414 | ML | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 415 | {*
 | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 416 | val nat_one_le_power = thm"nat_one_le_power"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 417 | val nat_power_less_imp_less = thm"nat_power_less_imp_less"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 418 | val nat_zero_less_power_iff = thm"nat_zero_less_power_iff"; | 
| 
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
 paulson parents: 
8844diff
changeset | 419 | *} | 
| 3390 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 420 | |
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 421 | end | 
| 
0c7625196d95
New theory "Power" of exponentiation (and binomial coefficients)
 paulson parents: diff
changeset | 422 |