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