src/HOL/Hyperreal/Log.thy
author paulson
Thu, 29 Jul 2004 16:14:42 +0200
changeset 15085 5693a977a767
parent 15053 405be2b48f5b
child 15131 c69542757a4d
permissions -rw-r--r--
removed some [iff] declarations from RealDef.thy, concerning inequalities
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12224
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     1
(*  Title       : Log.thy
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     3
    Copyright   : 2000,2001 University of Edinburgh
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     4
*)
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     5
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
     6
header{*Logarithms: Standard Version*}
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
     7
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
     8
theory Log = Transcendental:
12224
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
     9
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    10
constdefs
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    11
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    12
  powr  :: "[real,real] => real"     (infixr "powr" 80)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    13
    --{*exponentation with real exponent*}
12224
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    14
    "x powr a == exp(a * ln x)"
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    15
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    16
  log :: "[real,real] => real"
15053
405be2b48f5b Corrected TeX problems.
nipkow
parents: 14430
diff changeset
    17
    --{*logarithm of @{term x} to base @{term a}*}
12224
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    18
    "log a x == ln x / ln a"
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
    19
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    20
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    21
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    22
lemma powr_one_eq_one [simp]: "1 powr a = 1"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    23
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    24
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    25
lemma powr_zero_eq_one [simp]: "x powr 0 = 1"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    26
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    27
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    28
lemma powr_one_gt_zero_iff [simp]: "(x powr 1 = x) = (0 < x)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    29
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    30
declare powr_one_gt_zero_iff [THEN iffD2, simp]
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    31
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    32
lemma powr_mult: 
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    33
      "[| 0 < x; 0 < y |] ==> (x * y) powr a = (x powr a) * (y powr a)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    34
by (simp add: powr_def exp_add [symmetric] ln_mult right_distrib)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    35
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    36
lemma powr_gt_zero [simp]: "0 < x powr a"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    37
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    38
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    39
lemma powr_not_zero [simp]: "x powr a \<noteq> 0"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    40
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    41
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    42
lemma powr_divide:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    43
     "[| 0 < x; 0 < y |] ==> (x / y) powr a = (x powr a)/(y powr a)"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14411
diff changeset
    44
apply (simp add: divide_inverse positive_imp_inverse_positive powr_mult)
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    45
apply (simp add: powr_def exp_minus [symmetric] exp_add [symmetric] ln_inverse)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    46
done
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    47
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    48
lemma powr_add: "x powr (a + b) = (x powr a) * (x powr b)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    49
by (simp add: powr_def exp_add [symmetric] left_distrib)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    50
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    51
lemma powr_powr: "(x powr a) powr b = x powr (a * b)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    52
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    53
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    54
lemma powr_powr_swap: "(x powr a) powr b = (x powr b) powr a"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    55
by (simp add: powr_powr real_mult_commute)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    56
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    57
lemma powr_minus: "x powr (-a) = inverse (x powr a)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    58
by (simp add: powr_def exp_minus [symmetric])
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    59
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    60
lemma powr_minus_divide: "x powr (-a) = 1/(x powr a)"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14411
diff changeset
    61
by (simp add: divide_inverse powr_minus)
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    62
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    63
lemma powr_less_mono: "[| a < b; 1 < x |] ==> x powr a < x powr b"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    64
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    65
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    66
lemma powr_less_cancel: "[| x powr a < x powr b; 1 < x |] ==> a < b"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    67
by (simp add: powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    68
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    69
lemma powr_less_cancel_iff [simp]: "1 < x ==> (x powr a < x powr b) = (a < b)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    70
by (blast intro: powr_less_cancel powr_less_mono)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    71
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    72
lemma powr_le_cancel_iff [simp]: "1 < x ==> (x powr a \<le> x powr b) = (a \<le> b)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    73
by (simp add: linorder_not_less [symmetric])
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    74
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    75
lemma log_ln: "ln x = log (exp(1)) x"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    76
by (simp add: log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    77
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    78
lemma powr_log_cancel [simp]:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    79
     "[| 0 < a; a \<noteq> 1; 0 < x |] ==> a powr (log a x) = x"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    80
by (simp add: powr_def log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    81
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    82
lemma log_powr_cancel [simp]: "[| 0 < a; a \<noteq> 1 |] ==> log a (a powr y) = y"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    83
by (simp add: log_def powr_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    84
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    85
lemma log_mult: 
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    86
     "[| 0 < a; a \<noteq> 1; 0 < x; 0 < y |]  
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    87
      ==> log a (x * y) = log a x + log a y"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14411
diff changeset
    88
by (simp add: log_def ln_mult divide_inverse left_distrib)
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    89
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    90
lemma log_eq_div_ln_mult_log: 
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    91
     "[| 0 < a; a \<noteq> 1; 0 < b; b \<noteq> 1; 0 < x |]  
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    92
      ==> log a x = (ln b/ln a) * log b x"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14411
diff changeset
    93
by (simp add: log_def divide_inverse)
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    94
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    95
text{*Base 10 logarithms*}
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    96
lemma log_base_10_eq1: "0 < x ==> log 10 x = (ln (exp 1) / ln 10) * ln x"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    97
by (simp add: log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    98
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
    99
lemma log_base_10_eq2: "0 < x ==> log 10 x = (log 10 (exp 1)) * ln x"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   100
by (simp add: log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   101
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   102
lemma log_one [simp]: "log a 1 = 0"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   103
by (simp add: log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   104
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   105
lemma log_eq_one [simp]: "[| 0 < a; a \<noteq> 1 |] ==> log a a = 1"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   106
by (simp add: log_def)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   107
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   108
lemma log_inverse:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   109
     "[| 0 < a; a \<noteq> 1; 0 < x |] ==> log a (inverse x) = - log a x"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   110
apply (rule_tac a1 = "log a x" in add_left_cancel [THEN iffD1])
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   111
apply (simp add: log_mult [symmetric])
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   112
done
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   113
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   114
lemma log_divide:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   115
     "[|0 < a; a \<noteq> 1; 0 < x; 0 < y|] ==> log a (x/y) = log a x - log a y"
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14411
diff changeset
   116
by (simp add: log_mult divide_inverse log_inverse)
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   117
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   118
lemma log_less_cancel_iff [simp]:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   119
     "[| 1 < a; 0 < x; 0 < y |] ==> (log a x < log a y) = (x < y)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   120
apply safe
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   121
apply (rule_tac [2] powr_less_cancel)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   122
apply (drule_tac a = "log a x" in powr_less_mono, auto)
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   123
done
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   124
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   125
lemma log_le_cancel_iff [simp]:
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   126
     "[| 1 < a; 0 < x; 0 < y |] ==> (log a x \<le> log a y) = (x \<le> y)"
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   127
by (simp add: linorder_not_less [symmetric])
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   128
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   129
15085
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   130
subsection{*Further Results Courtesy Jeremy Avigad*}
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   131
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   132
lemma powr_realpow: "0 < x ==> x powr (real n) = x^n"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   133
  apply (induct n, simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   134
  apply (subgoal_tac "real(Suc n) = real n + 1")
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   135
  apply (erule ssubst)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   136
  apply (subst powr_add, simp, simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   137
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   138
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   139
lemma powr_realpow2: "0 <= x ==> 0 < n ==> x^n = (if (x = 0) then 0
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   140
  else x powr (real n))"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   141
  apply (case_tac "x = 0", simp, simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   142
  apply (rule powr_realpow [THEN sym], simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   143
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   144
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   145
lemma ln_pwr: "0 < x ==> 0 < y ==> ln(x powr y) = y * ln x"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   146
by (unfold powr_def, simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   147
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   148
lemma ln_bound: "1 <= x ==> ln x <= x"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   149
  apply (subgoal_tac "ln(1 + (x - 1)) <= x - 1")
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   150
  apply simp
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   151
  apply (rule ln_add_one_self_le_self, simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   152
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   153
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   154
lemma powr_mono: "a <= b ==> 1 <= x ==> x powr a <= x powr b"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   155
  apply (case_tac "x = 1", simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   156
  apply (case_tac "a = b", simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   157
  apply (rule order_less_imp_le)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   158
  apply (rule powr_less_mono, auto)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   159
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   160
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   161
lemma ge_one_powr_ge_zero: "1 <= x ==> 0 <= a ==> 1 <= x powr a"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   162
  apply (subst powr_zero_eq_one [THEN sym])
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   163
  apply (rule powr_mono, assumption+)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   164
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   165
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   166
lemma powr_less_mono2: "0 < a ==> 0 < x ==> x < y ==> x powr a <
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   167
    y powr a"
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   168
  apply (unfold powr_def)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   169
  apply (rule exp_less_mono)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   170
  apply (rule mult_strict_left_mono)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   171
  apply (subst ln_less_cancel_iff, assumption)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   172
  apply (rule order_less_trans)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   173
  prefer 2
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   174
  apply assumption+
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   175
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   176
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   177
lemma powr_mono2: "0 <= a ==> 0 < x ==> x <= y ==> x powr a <= y powr a";
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   178
  apply (case_tac "a = 0", simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   179
  apply (case_tac "x = y", simp)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   180
  apply (rule order_less_imp_le)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   181
  apply (rule powr_less_mono2, auto)
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   182
done
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   183
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15053
diff changeset
   184
14411
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   185
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   186
ML
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   187
{*
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   188
val powr_one_eq_one = thm "powr_one_eq_one";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   189
val powr_zero_eq_one = thm "powr_zero_eq_one";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   190
val powr_one_gt_zero_iff = thm "powr_one_gt_zero_iff";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   191
val powr_mult = thm "powr_mult";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   192
val powr_gt_zero = thm "powr_gt_zero";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   193
val powr_not_zero = thm "powr_not_zero";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   194
val powr_divide = thm "powr_divide";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   195
val powr_add = thm "powr_add";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   196
val powr_powr = thm "powr_powr";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   197
val powr_powr_swap = thm "powr_powr_swap";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   198
val powr_minus = thm "powr_minus";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   199
val powr_minus_divide = thm "powr_minus_divide";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   200
val powr_less_mono = thm "powr_less_mono";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   201
val powr_less_cancel = thm "powr_less_cancel";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   202
val powr_less_cancel_iff = thm "powr_less_cancel_iff";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   203
val powr_le_cancel_iff = thm "powr_le_cancel_iff";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   204
val log_ln = thm "log_ln";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   205
val powr_log_cancel = thm "powr_log_cancel";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   206
val log_powr_cancel = thm "log_powr_cancel";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   207
val log_mult = thm "log_mult";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   208
val log_eq_div_ln_mult_log = thm "log_eq_div_ln_mult_log";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   209
val log_base_10_eq1 = thm "log_base_10_eq1";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   210
val log_base_10_eq2 = thm "log_base_10_eq2";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   211
val log_one = thm "log_one";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   212
val log_eq_one = thm "log_eq_one";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   213
val log_inverse = thm "log_inverse";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   214
val log_divide = thm "log_divide";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   215
val log_less_cancel_iff = thm "log_less_cancel_iff";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   216
val log_le_cancel_iff = thm "log_le_cancel_iff";
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   217
*}
7851e526b8b7 converted Hyperreal/Log and Hyperreal/HLog to Isar scripts
paulson
parents: 12224
diff changeset
   218
12224
02df7cbe7d25 even more theories from Jacques
paulson
parents:
diff changeset
   219
end