src/HOL/Power.thy
author paulson
Fri Jan 09 10:46:18 2004 +0100 (2004-01-09)
changeset 14348 744c868ee0b7
parent 8844 db71c334e854
child 14353 79f9fbef9106
permissions -rw-r--r--
Defining the type class "ringpower" and deleting superseded theorems for
types nat, int, real, hypreal
paulson@3390
     1
(*  Title:      HOL/Power.thy
paulson@3390
     2
    ID:         $Id$
paulson@3390
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@3390
     4
    Copyright   1997  University of Cambridge
paulson@3390
     5
paulson@3390
     6
*)
paulson@3390
     7
paulson@14348
     8
header{*Exponentiation and Binomial Coefficients*}
paulson@14348
     9
paulson@14348
    10
theory Power = Divides:
paulson@14348
    11
paulson@14348
    12
subsection{*Powers for Arbitrary (Semi)Rings*}
paulson@14348
    13
paulson@14348
    14
axclass ringpower \<subseteq> semiring, power
paulson@14348
    15
  power_0 [simp]:   "a ^ 0       = 1"
paulson@14348
    16
  power_Suc: "a ^ (Suc n) = a * (a ^ n)"
paulson@14348
    17
paulson@14348
    18
lemma power_0_Suc [simp]: "(0::'a::ringpower) ^ (Suc n) = 0"
paulson@14348
    19
by (simp add: power_Suc)
paulson@14348
    20
paulson@14348
    21
text{*It looks plausible as a simprule, but its effect can be strange.*}
paulson@14348
    22
lemma power_0_left: "0^n = (if n=0 then 1 else (0::'a::ringpower))"
paulson@14348
    23
by (induct_tac "n", auto)
paulson@14348
    24
paulson@14348
    25
lemma power_one [simp]: "1^n = (1::'a::ringpower)"
paulson@14348
    26
apply (induct_tac "n")
paulson@14348
    27
apply (auto simp add: power_Suc)  
paulson@14348
    28
done
paulson@14348
    29
paulson@14348
    30
lemma power_one_right [simp]: "(a::'a::ringpower) ^ 1 = a"
paulson@14348
    31
by (simp add: power_Suc)
paulson@14348
    32
paulson@14348
    33
lemma power_add: "(a::'a::ringpower) ^ (m+n) = (a^m) * (a^n)"
paulson@14348
    34
apply (induct_tac "n")
paulson@14348
    35
apply (simp_all add: power_Suc mult_ac)
paulson@14348
    36
done
paulson@14348
    37
paulson@14348
    38
lemma power_mult: "(a::'a::ringpower) ^ (m*n) = (a^m) ^ n"
paulson@14348
    39
apply (induct_tac "n")
paulson@14348
    40
apply (simp_all add: power_Suc power_add)
paulson@14348
    41
done
paulson@14348
    42
paulson@14348
    43
lemma power_mult_distrib: "((a::'a::ringpower) * b) ^ n = (a^n) * (b^n)"
paulson@14348
    44
apply (induct_tac "n") 
paulson@14348
    45
apply (auto simp add: power_Suc mult_ac)
paulson@14348
    46
done
paulson@14348
    47
paulson@14348
    48
lemma zero_less_power:
paulson@14348
    49
     "0 < (a::'a::{ordered_semiring,ringpower}) ==> 0 < a^n"
paulson@14348
    50
apply (induct_tac "n")
paulson@14348
    51
apply (simp_all add: power_Suc zero_less_one mult_pos)
paulson@14348
    52
done
paulson@14348
    53
paulson@14348
    54
lemma zero_le_power:
paulson@14348
    55
     "0 \<le> (a::'a::{ordered_semiring,ringpower}) ==> 0 \<le> a^n"
paulson@14348
    56
apply (simp add: order_le_less)
paulson@14348
    57
apply (erule disjE) 
paulson@14348
    58
apply (simp_all add: zero_less_power zero_less_one power_0_left)
paulson@14348
    59
done
paulson@14348
    60
paulson@14348
    61
lemma one_le_power:
paulson@14348
    62
     "1 \<le> (a::'a::{ordered_semiring,ringpower}) ==> 1 \<le> a^n"
paulson@14348
    63
apply (induct_tac "n")
paulson@14348
    64
apply (simp_all add: power_Suc)
paulson@14348
    65
apply (rule order_trans [OF _ mult_mono [of 1 _ 1]]) 
paulson@14348
    66
apply (simp_all add: zero_le_one order_trans [OF zero_le_one]) 
paulson@14348
    67
done
paulson@14348
    68
paulson@14348
    69
lemma gt1_imp_ge0: "1 < a ==> 0 \<le> (a::'a::ordered_semiring)"
paulson@14348
    70
  by (simp add: order_trans [OF zero_le_one order_less_imp_le])
paulson@14348
    71
paulson@14348
    72
lemma power_gt1_lemma:
paulson@14348
    73
     assumes gt1: "1 < (a::'a::{ordered_semiring,ringpower})"
paulson@14348
    74
        shows     "1 < a * a^n"
paulson@14348
    75
proof -
paulson@14348
    76
  have "1*1 < a * a^n"
paulson@14348
    77
    proof (rule order_less_le_trans) 
paulson@14348
    78
      show "1*1 < a*1" by (simp add: gt1)
paulson@14348
    79
      show  "a*1 \<le> a * a^n"
paulson@14348
    80
   by (simp only: mult_mono gt1 gt1_imp_ge0 one_le_power order_less_imp_le 
paulson@14348
    81
                  zero_le_one order_refl)
paulson@14348
    82
    qed
paulson@14348
    83
  thus ?thesis by simp
paulson@14348
    84
qed
paulson@14348
    85
paulson@14348
    86
lemma power_gt1:
paulson@14348
    87
     "1 < (a::'a::{ordered_semiring,ringpower}) ==> 1 < a ^ (Suc n)"
paulson@14348
    88
by (simp add: power_gt1_lemma power_Suc)
paulson@14348
    89
paulson@14348
    90
lemma power_le_imp_le_exp:
paulson@14348
    91
     assumes gt1: "(1::'a::{ringpower,ordered_semiring}) < a"
paulson@14348
    92
       shows      "!!n. a^m \<le> a^n ==> m \<le> n"
paulson@14348
    93
proof (induct "m")
paulson@14348
    94
  case 0
paulson@14348
    95
    show ?case by simp
paulson@14348
    96
next
paulson@14348
    97
  case (Suc m)
paulson@14348
    98
    show ?case 
paulson@14348
    99
      proof (cases n)
paulson@14348
   100
        case 0
paulson@14348
   101
          from prems have "a * a^m \<le> 1" by (simp add: power_Suc)
paulson@14348
   102
          with gt1 show ?thesis
paulson@14348
   103
            by (force simp only: power_gt1_lemma 
paulson@14348
   104
                                 linorder_not_less [symmetric])
paulson@14348
   105
      next
paulson@14348
   106
        case (Suc n)
paulson@14348
   107
          from prems show ?thesis 
paulson@14348
   108
	    by (force dest: mult_left_le_imp_le
paulson@14348
   109
	          simp add: power_Suc order_less_trans [OF zero_less_one gt1]) 
paulson@14348
   110
      qed
paulson@14348
   111
qed
paulson@14348
   112
paulson@14348
   113
text{*Surely we can strengthen this? It holds for 0<a<1 too.*}
paulson@14348
   114
lemma power_inject_exp [simp]:
paulson@14348
   115
     "1 < (a::'a::{ordered_semiring,ringpower}) ==> (a^m = a^n) = (m=n)"
paulson@14348
   116
  by (force simp add: order_antisym power_le_imp_le_exp)  
paulson@14348
   117
paulson@14348
   118
text{*Can relax the first premise to @{term "0<a"} in the case of the
paulson@14348
   119
natural numbers.*}
paulson@14348
   120
lemma power_less_imp_less_exp:
paulson@14348
   121
     "[| (1::'a::{ringpower,ordered_semiring}) < a; a^m < a^n |] ==> m < n"
paulson@14348
   122
by (simp add: order_less_le [of m n] order_less_le [of "a^m" "a^n"] 
paulson@14348
   123
              power_le_imp_le_exp) 
paulson@14348
   124
paulson@14348
   125
paulson@14348
   126
lemma power_mono:
paulson@14348
   127
     "[|a \<le> b; (0::'a::{ringpower,ordered_semiring}) \<le> a|] ==> a^n \<le> b^n"
paulson@14348
   128
apply (induct_tac "n") 
paulson@14348
   129
apply (simp_all add: power_Suc)
paulson@14348
   130
apply (auto intro: mult_mono zero_le_power order_trans [of 0 a b])
paulson@14348
   131
done
paulson@14348
   132
paulson@14348
   133
lemma power_strict_mono [rule_format]:
paulson@14348
   134
     "[|a < b; (0::'a::{ringpower,ordered_semiring}) \<le> a|] 
paulson@14348
   135
      ==> 0 < n --> a^n < b^n" 
paulson@14348
   136
apply (induct_tac "n") 
paulson@14348
   137
apply (auto simp add: mult_strict_mono zero_le_power power_Suc
paulson@14348
   138
                      order_le_less_trans [of 0 a b])
paulson@14348
   139
done
paulson@14348
   140
paulson@14348
   141
lemma power_eq_0_iff [simp]:
paulson@14348
   142
     "(a^n = 0) = (a = (0::'a::{ordered_ring,ringpower}) & 0<n)"
paulson@14348
   143
apply (induct_tac "n")
paulson@14348
   144
apply (auto simp add: power_Suc zero_neq_one [THEN not_sym])
paulson@14348
   145
done
paulson@14348
   146
paulson@14348
   147
lemma field_power_eq_0_iff [simp]:
paulson@14348
   148
     "(a^n = 0) = (a = (0::'a::{field,ringpower}) & 0<n)"
paulson@14348
   149
apply (induct_tac "n")
paulson@14348
   150
apply (auto simp add: power_Suc field_mult_eq_0_iff zero_neq_one[THEN not_sym])
paulson@14348
   151
done
paulson@14348
   152
paulson@14348
   153
lemma field_power_not_zero: "a \<noteq> (0::'a::{field,ringpower}) ==> a^n \<noteq> 0"
paulson@14348
   154
by force
paulson@14348
   155
paulson@14348
   156
text{*Perhaps these should be simprules.*}
paulson@14348
   157
lemma power_inverse:
paulson@14348
   158
  "inverse ((a::'a::{field,division_by_zero,ringpower}) ^ n) = (inverse a) ^ n"
paulson@14348
   159
apply (induct_tac "n")
paulson@14348
   160
apply (auto simp add: power_Suc inverse_mult_distrib)
paulson@14348
   161
done
paulson@14348
   162
paulson@14348
   163
lemma power_abs: "abs(a ^ n) = abs(a::'a::{ordered_field,ringpower}) ^ n"
paulson@14348
   164
apply (induct_tac "n")
paulson@14348
   165
apply (auto simp add: power_Suc abs_mult)
paulson@14348
   166
done
paulson@14348
   167
paulson@14348
   168
lemma power_minus: "(-a) ^ n = (- 1)^n * (a::'a::{ring,ringpower}) ^ n"
paulson@14348
   169
proof -
paulson@14348
   170
  have "-a = (- 1) * a"  by (simp add: minus_mult_left [symmetric])
paulson@14348
   171
  thus ?thesis by (simp only: power_mult_distrib)
paulson@14348
   172
qed
paulson@14348
   173
paulson@14348
   174
text{*Lemma for @{text power_strict_decreasing}*}
paulson@14348
   175
lemma power_Suc_less:
paulson@14348
   176
     "[|(0::'a::{ordered_semiring,ringpower}) < a; a < 1|]
paulson@14348
   177
      ==> a * a^n < a^n"
paulson@14348
   178
apply (induct_tac n) 
paulson@14348
   179
apply (auto simp add: power_Suc mult_strict_left_mono) 
paulson@14348
   180
done
paulson@14348
   181
paulson@14348
   182
lemma power_strict_decreasing:
paulson@14348
   183
     "[|n < N; 0 < a; a < (1::'a::{ordered_semiring,ringpower})|]
paulson@14348
   184
      ==> a^N < a^n"
paulson@14348
   185
apply (erule rev_mp) 
paulson@14348
   186
apply (induct_tac "N")  
paulson@14348
   187
apply (auto simp add: power_Suc power_Suc_less less_Suc_eq) 
paulson@14348
   188
apply (rename_tac m)  
paulson@14348
   189
apply (subgoal_tac "a * a^m < 1 * a^n", simp)
paulson@14348
   190
apply (rule mult_strict_mono) 
paulson@14348
   191
apply (auto simp add: zero_le_power zero_less_one order_less_imp_le)
paulson@14348
   192
done
paulson@14348
   193
paulson@14348
   194
text{*Proof resembles that of @{text power_strict_decreasing}*}
paulson@14348
   195
lemma power_decreasing:
paulson@14348
   196
     "[|n \<le> N; 0 \<le> a; a \<le> (1::'a::{ordered_semiring,ringpower})|]
paulson@14348
   197
      ==> a^N \<le> a^n"
paulson@14348
   198
apply (erule rev_mp) 
paulson@14348
   199
apply (induct_tac "N") 
paulson@14348
   200
apply (auto simp add: power_Suc  le_Suc_eq) 
paulson@14348
   201
apply (rename_tac m)  
paulson@14348
   202
apply (subgoal_tac "a * a^m \<le> 1 * a^n", simp)
paulson@14348
   203
apply (rule mult_mono) 
paulson@14348
   204
apply (auto simp add: zero_le_power zero_le_one)
paulson@14348
   205
done
paulson@14348
   206
paulson@14348
   207
lemma power_Suc_less_one:
paulson@14348
   208
     "[| 0 < a; a < (1::'a::{ordered_semiring,ringpower}) |] ==> a ^ Suc n < 1"
paulson@14348
   209
apply (insert power_strict_decreasing [of 0 "Suc n" a], simp) 
paulson@14348
   210
done
paulson@14348
   211
paulson@14348
   212
text{*Proof again resembles that of @{text power_strict_decreasing}*}
paulson@14348
   213
lemma power_increasing:
paulson@14348
   214
     "[|n \<le> N; (1::'a::{ordered_semiring,ringpower}) \<le> a|] ==> a^n \<le> a^N"
paulson@14348
   215
apply (erule rev_mp) 
paulson@14348
   216
apply (induct_tac "N") 
paulson@14348
   217
apply (auto simp add: power_Suc le_Suc_eq) 
paulson@14348
   218
apply (rename_tac m)
paulson@14348
   219
apply (subgoal_tac "1 * a^n \<le> a * a^m", simp)
paulson@14348
   220
apply (rule mult_mono) 
paulson@14348
   221
apply (auto simp add: order_trans [OF zero_le_one] zero_le_power)
paulson@14348
   222
done
paulson@14348
   223
paulson@14348
   224
text{*Lemma for @{text power_strict_increasing}*}
paulson@14348
   225
lemma power_less_power_Suc:
paulson@14348
   226
     "(1::'a::{ordered_semiring,ringpower}) < a ==> a^n < a * a^n"
paulson@14348
   227
apply (induct_tac n) 
paulson@14348
   228
apply (auto simp add: power_Suc mult_strict_left_mono order_less_trans [OF zero_less_one]) 
paulson@14348
   229
done
paulson@14348
   230
paulson@14348
   231
lemma power_strict_increasing:
paulson@14348
   232
     "[|n < N; (1::'a::{ordered_semiring,ringpower}) < a|] ==> a^n < a^N"
paulson@14348
   233
apply (erule rev_mp) 
paulson@14348
   234
apply (induct_tac "N")  
paulson@14348
   235
apply (auto simp add: power_less_power_Suc power_Suc less_Suc_eq) 
paulson@14348
   236
apply (rename_tac m)
paulson@14348
   237
apply (subgoal_tac "1 * a^n < a * a^m", simp)
paulson@14348
   238
apply (rule mult_strict_mono)  
paulson@14348
   239
apply (auto simp add: order_less_trans [OF zero_less_one] zero_le_power
paulson@14348
   240
                 order_less_imp_le)
paulson@14348
   241
done
paulson@14348
   242
paulson@14348
   243
lemma power_le_imp_le_base:
paulson@14348
   244
  assumes le: "a ^ Suc n \<le> b ^ Suc n"
paulson@14348
   245
      and xnonneg: "(0::'a::{ordered_semiring,ringpower}) \<le> a"
paulson@14348
   246
      and ynonneg: "0 \<le> b"
paulson@14348
   247
  shows "a \<le> b"
paulson@14348
   248
 proof (rule ccontr)
paulson@14348
   249
   assume "~ a \<le> b"
paulson@14348
   250
   then have "b < a" by (simp only: linorder_not_le)
paulson@14348
   251
   then have "b ^ Suc n < a ^ Suc n"
paulson@14348
   252
     by (simp only: prems power_strict_mono) 
paulson@14348
   253
   from le and this show "False"
paulson@14348
   254
      by (simp add: linorder_not_less [symmetric])
paulson@14348
   255
 qed
paulson@14348
   256
  
paulson@14348
   257
lemma power_inject_base:
paulson@14348
   258
     "[| a ^ Suc n = b ^ Suc n; 0 \<le> a; 0 \<le> b |] 
paulson@14348
   259
      ==> a = (b::'a::{ordered_semiring,ringpower})"
paulson@14348
   260
by (blast intro: power_le_imp_le_base order_antisym order_eq_refl sym)
paulson@14348
   261
paulson@14348
   262
paulson@14348
   263
subsection{*Exponentiation for the Natural Numbers*}
paulson@3390
   264
wenzelm@8844
   265
primrec (power)
paulson@3390
   266
  "p ^ 0 = 1"
paulson@3390
   267
  "p ^ (Suc n) = (p::nat) * (p ^ n)"
paulson@3390
   268
  
paulson@14348
   269
instance nat :: ringpower
paulson@14348
   270
proof
paulson@14348
   271
  fix z :: nat
paulson@14348
   272
  fix n :: nat
paulson@14348
   273
  show "z^0 = 1" by simp
paulson@14348
   274
  show "z^(Suc n) = z * (z^n)" by simp
paulson@14348
   275
qed
paulson@14348
   276
paulson@14348
   277
lemma nat_one_le_power [simp]: "1 \<le> i ==> Suc 0 \<le> i^n"
paulson@14348
   278
by (insert one_le_power [of i n], simp)
paulson@14348
   279
paulson@14348
   280
lemma le_imp_power_dvd: "!!i::nat. m \<le> n ==> i^m dvd i^n"
paulson@14348
   281
apply (unfold dvd_def)
paulson@14348
   282
apply (erule not_less_iff_le [THEN iffD2, THEN add_diff_inverse, THEN subst])
paulson@14348
   283
apply (simp add: power_add)
paulson@14348
   284
done
paulson@14348
   285
paulson@14348
   286
text{*Valid for the naturals, but what if @{text"0<i<1"}?
paulson@14348
   287
Premises cannot be weakened: consider the case where @{term "i=0"},
paulson@14348
   288
@{term "m=1"} and @{term "n=0"}.*}
paulson@14348
   289
lemma nat_power_less_imp_less: "!!i::nat. [| 0 < i; i^m < i^n |] ==> m < n"
paulson@14348
   290
apply (rule ccontr)
paulson@14348
   291
apply (drule leI [THEN le_imp_power_dvd, THEN dvd_imp_le, THEN leD])
paulson@14348
   292
apply (erule zero_less_power, auto) 
paulson@14348
   293
done
paulson@14348
   294
paulson@14348
   295
lemma nat_zero_less_power_iff [simp]: "(0 < x^n) = (x \<noteq> (0::nat) | n=0)"
paulson@14348
   296
by (induct_tac "n", auto)
paulson@14348
   297
paulson@14348
   298
lemma power_le_dvd [rule_format]: "k^j dvd n --> i\<le>j --> k^i dvd (n::nat)"
paulson@14348
   299
apply (induct_tac "j")
paulson@14348
   300
apply (simp_all add: le_Suc_eq)
paulson@14348
   301
apply (blast dest!: dvd_mult_right)
paulson@14348
   302
done
paulson@14348
   303
paulson@14348
   304
lemma power_dvd_imp_le: "[|i^m dvd i^n;  (1::nat) < i|] ==> m \<le> n"
paulson@14348
   305
apply (rule power_le_imp_le_exp, assumption)
paulson@14348
   306
apply (erule dvd_imp_le, simp)
paulson@14348
   307
done
paulson@14348
   308
paulson@14348
   309
paulson@14348
   310
subsection{*Binomial Coefficients*}
paulson@14348
   311
paulson@14348
   312
text{*This development is based on the work of Andy Gordon and 
paulson@14348
   313
Florian Kammueller*}
paulson@14348
   314
paulson@14348
   315
consts
paulson@14348
   316
  binomial :: "[nat,nat] => nat"      (infixl "choose" 65)
paulson@14348
   317
berghofe@5183
   318
primrec
paulson@14348
   319
  binomial_0:   "(0     choose k) = (if k = 0 then 1 else 0)"
paulson@14348
   320
paulson@14348
   321
  binomial_Suc: "(Suc n choose k) =
paulson@14348
   322
                 (if k = 0 then 1 else (n choose (k - 1)) + (n choose k))"
paulson@14348
   323
paulson@14348
   324
lemma binomial_n_0 [simp]: "(n choose 0) = 1"
paulson@14348
   325
by (case_tac "n", simp_all)
paulson@14348
   326
paulson@14348
   327
lemma binomial_0_Suc [simp]: "(0 choose Suc k) = 0"
paulson@14348
   328
by simp
paulson@14348
   329
paulson@14348
   330
lemma binomial_Suc_Suc [simp]:
paulson@14348
   331
     "(Suc n choose Suc k) = (n choose k) + (n choose Suc k)"
paulson@14348
   332
by simp
paulson@14348
   333
paulson@14348
   334
lemma binomial_eq_0 [rule_format]: "\<forall>k. n < k --> (n choose k) = 0"
paulson@14348
   335
apply (induct_tac "n", auto)
paulson@14348
   336
apply (erule allE)
paulson@14348
   337
apply (erule mp, arith)
paulson@14348
   338
done
paulson@14348
   339
paulson@14348
   340
declare binomial_0 [simp del] binomial_Suc [simp del]
paulson@14348
   341
paulson@14348
   342
lemma binomial_n_n [simp]: "(n choose n) = 1"
paulson@14348
   343
apply (induct_tac "n")
paulson@14348
   344
apply (simp_all add: binomial_eq_0)
paulson@14348
   345
done
paulson@14348
   346
paulson@14348
   347
lemma binomial_Suc_n [simp]: "(Suc n choose n) = Suc n"
paulson@14348
   348
by (induct_tac "n", simp_all)
paulson@14348
   349
paulson@14348
   350
lemma binomial_1 [simp]: "(n choose Suc 0) = n"
paulson@14348
   351
by (induct_tac "n", simp_all)
paulson@14348
   352
paulson@14348
   353
lemma zero_less_binomial [rule_format]: "k \<le> n --> 0 < (n choose k)"
paulson@14348
   354
by (rule_tac m = n and n = k in diff_induct, simp_all)
paulson@3390
   355
paulson@14348
   356
lemma binomial_eq_0_iff: "(n choose k = 0) = (n<k)"
paulson@14348
   357
apply (safe intro!: binomial_eq_0)
paulson@14348
   358
apply (erule contrapos_pp)
paulson@14348
   359
apply (simp add: zero_less_binomial)
paulson@14348
   360
done
paulson@14348
   361
paulson@14348
   362
lemma zero_less_binomial_iff: "(0 < n choose k) = (k\<le>n)"
paulson@14348
   363
by (simp add: linorder_not_less [symmetric] binomial_eq_0_iff [symmetric])
paulson@14348
   364
paulson@14348
   365
(*Might be more useful if re-oriented*)
paulson@14348
   366
lemma Suc_times_binomial_eq [rule_format]:
paulson@14348
   367
     "\<forall>k. k \<le> n --> Suc n * (n choose k) = (Suc n choose Suc k) * Suc k"
paulson@14348
   368
apply (induct_tac "n")
paulson@14348
   369
apply (simp add: binomial_0, clarify)
paulson@14348
   370
apply (case_tac "k")
paulson@14348
   371
apply (auto simp add: add_mult_distrib add_mult_distrib2 le_Suc_eq 
paulson@14348
   372
                      binomial_eq_0)
paulson@14348
   373
done
paulson@14348
   374
paulson@14348
   375
text{*This is the well-known version, but it's harder to use because of the
paulson@14348
   376
  need to reason about division.*}
paulson@14348
   377
lemma binomial_Suc_Suc_eq_times:
paulson@14348
   378
     "k \<le> n ==> (Suc n choose Suc k) = (Suc n * (n choose k)) div Suc k"
paulson@14348
   379
by (simp add: Suc_times_binomial_eq div_mult_self_is_m zero_less_Suc 
paulson@14348
   380
        del: mult_Suc mult_Suc_right)
paulson@14348
   381
paulson@14348
   382
text{*Another version, with -1 instead of Suc.*}
paulson@14348
   383
lemma times_binomial_minus1_eq:
paulson@14348
   384
     "[|k \<le> n;  0<k|] ==> (n choose k) * k = n * ((n - 1) choose (k - 1))"
paulson@14348
   385
apply (cut_tac n = "n - 1" and k = "k - 1" in Suc_times_binomial_eq)
paulson@14348
   386
apply (simp split add: nat_diff_split, auto)
paulson@14348
   387
done
paulson@14348
   388
paulson@14348
   389
text{*ML bindings for the general exponentiation theorems*}
paulson@14348
   390
ML
paulson@14348
   391
{*
paulson@14348
   392
val power_0 = thm"power_0";
paulson@14348
   393
val power_Suc = thm"power_Suc";
paulson@14348
   394
val power_0_Suc = thm"power_0_Suc";
paulson@14348
   395
val power_0_left = thm"power_0_left";
paulson@14348
   396
val power_one = thm"power_one";
paulson@14348
   397
val power_one_right = thm"power_one_right";
paulson@14348
   398
val power_add = thm"power_add";
paulson@14348
   399
val power_mult = thm"power_mult";
paulson@14348
   400
val power_mult_distrib = thm"power_mult_distrib";
paulson@14348
   401
val zero_less_power = thm"zero_less_power";
paulson@14348
   402
val zero_le_power = thm"zero_le_power";
paulson@14348
   403
val one_le_power = thm"one_le_power";
paulson@14348
   404
val gt1_imp_ge0 = thm"gt1_imp_ge0";
paulson@14348
   405
val power_gt1_lemma = thm"power_gt1_lemma";
paulson@14348
   406
val power_gt1 = thm"power_gt1";
paulson@14348
   407
val power_le_imp_le_exp = thm"power_le_imp_le_exp";
paulson@14348
   408
val power_inject_exp = thm"power_inject_exp";
paulson@14348
   409
val power_less_imp_less_exp = thm"power_less_imp_less_exp";
paulson@14348
   410
val power_mono = thm"power_mono";
paulson@14348
   411
val power_strict_mono = thm"power_strict_mono";
paulson@14348
   412
val power_eq_0_iff = thm"power_eq_0_iff";
paulson@14348
   413
val field_power_eq_0_iff = thm"field_power_eq_0_iff";
paulson@14348
   414
val field_power_not_zero = thm"field_power_not_zero";
paulson@14348
   415
val power_inverse = thm"power_inverse";
paulson@14348
   416
val power_abs = thm"power_abs";
paulson@14348
   417
val power_minus = thm"power_minus";
paulson@14348
   418
val power_Suc_less = thm"power_Suc_less";
paulson@14348
   419
val power_strict_decreasing = thm"power_strict_decreasing";
paulson@14348
   420
val power_decreasing = thm"power_decreasing";
paulson@14348
   421
val power_Suc_less_one = thm"power_Suc_less_one";
paulson@14348
   422
val power_increasing = thm"power_increasing";
paulson@14348
   423
val power_strict_increasing = thm"power_strict_increasing";
paulson@14348
   424
val power_le_imp_le_base = thm"power_le_imp_le_base";
paulson@14348
   425
val power_inject_base = thm"power_inject_base";
paulson@14348
   426
*}
paulson@14348
   427
 
paulson@14348
   428
text{*ML bindings for the remaining theorems*}
paulson@14348
   429
ML
paulson@14348
   430
{*
paulson@14348
   431
val nat_one_le_power = thm"nat_one_le_power";
paulson@14348
   432
val le_imp_power_dvd = thm"le_imp_power_dvd";
paulson@14348
   433
val nat_power_less_imp_less = thm"nat_power_less_imp_less";
paulson@14348
   434
val nat_zero_less_power_iff = thm"nat_zero_less_power_iff";
paulson@14348
   435
val power_le_dvd = thm"power_le_dvd";
paulson@14348
   436
val power_dvd_imp_le = thm"power_dvd_imp_le";
paulson@14348
   437
val binomial_n_0 = thm"binomial_n_0";
paulson@14348
   438
val binomial_0_Suc = thm"binomial_0_Suc";
paulson@14348
   439
val binomial_Suc_Suc = thm"binomial_Suc_Suc";
paulson@14348
   440
val binomial_eq_0 = thm"binomial_eq_0";
paulson@14348
   441
val binomial_n_n = thm"binomial_n_n";
paulson@14348
   442
val binomial_Suc_n = thm"binomial_Suc_n";
paulson@14348
   443
val binomial_1 = thm"binomial_1";
paulson@14348
   444
val zero_less_binomial = thm"zero_less_binomial";
paulson@14348
   445
val binomial_eq_0_iff = thm"binomial_eq_0_iff";
paulson@14348
   446
val zero_less_binomial_iff = thm"zero_less_binomial_iff";
paulson@14348
   447
val Suc_times_binomial_eq = thm"Suc_times_binomial_eq";
paulson@14348
   448
val binomial_Suc_Suc_eq_times = thm"binomial_Suc_Suc_eq_times";
paulson@14348
   449
val times_binomial_minus1_eq = thm"times_binomial_minus1_eq";
paulson@14348
   450
*}
paulson@3390
   451
paulson@3390
   452
end
paulson@3390
   453