author | paulson |
Thu, 01 Jan 2004 10:06:32 +0100 | |
changeset 14334 | 6137d24eef79 |
parent 14305 | f17ca9f6dc8c |
child 14365 | 3d4df8c166ae |
permissions | -rw-r--r-- |
12224 | 1 |
(* Title : Log.ML |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 2000,2001 University of Edinburgh |
|
4 |
Description : standard logarithms only |
|
5 |
*) |
|
6 |
||
7 |
||
8 |
Goalw [powr_def] "1 powr a = 1"; |
|
9 |
by (Simp_tac 1); |
|
10 |
qed "powr_one_eq_one"; |
|
11 |
Addsimps [powr_one_eq_one]; |
|
12 |
||
13 |
Goalw [powr_def] "x powr 0 = 1"; |
|
14 |
by (Simp_tac 1); |
|
15 |
qed "powr_zero_eq_one"; |
|
16 |
Addsimps [powr_zero_eq_one]; |
|
17 |
||
18 |
Goalw [powr_def] |
|
19 |
"(x powr 1 = x) = (0 < x)"; |
|
20 |
by (Simp_tac 1); |
|
21 |
qed "powr_one_gt_zero_iff"; |
|
22 |
Addsimps [powr_one_gt_zero_iff]; |
|
23 |
Addsimps [powr_one_gt_zero_iff RS iffD2]; |
|
24 |
||
25 |
Goalw [powr_def] |
|
26 |
"[| 0 < x; 0 < y |] ==> (x * y) powr a = (x powr a) * (y powr a)"; |
|
27 |
by (asm_simp_tac (simpset() addsimps [exp_add RS sym,ln_mult, |
|
14334 | 28 |
right_distrib]) 1); |
12224 | 29 |
qed "powr_mult"; |
30 |
||
31 |
Goalw [powr_def] "0 < x powr a"; |
|
32 |
by (Simp_tac 1); |
|
33 |
qed "powr_gt_zero"; |
|
34 |
Addsimps [powr_gt_zero]; |
|
35 |
||
36 |
Goalw [powr_def] "x powr a ~= 0"; |
|
37 |
by (Simp_tac 1); |
|
38 |
qed "powr_not_zero"; |
|
39 |
Addsimps [powr_not_zero]; |
|
40 |
||
41 |
Goal "[| 0 < x; 0 < y |] ==> (x / y) powr a = (x powr a)/(y powr a)"; |
|
14334 | 42 |
by (asm_simp_tac (simpset() addsimps [real_divide_def,positive_imp_inverse_positive, powr_mult]) 1); |
12224 | 43 |
by (asm_simp_tac (simpset() addsimps [powr_def,exp_minus RS sym, |
44 |
exp_add RS sym,ln_inverse]) 1); |
|
45 |
qed "powr_divide"; |
|
46 |
||
47 |
Goalw [powr_def] "x powr (a + b) = (x powr a) * (x powr b)"; |
|
48 |
by (asm_simp_tac (simpset() addsimps [exp_add RS sym, |
|
14334 | 49 |
left_distrib]) 1); |
12224 | 50 |
qed "powr_add"; |
51 |
||
52 |
Goalw [powr_def] "(x powr a) powr b = x powr (a * b)"; |
|
14334 | 53 |
by (simp_tac (simpset() addsimps mult_ac) 1); |
12224 | 54 |
qed "powr_powr"; |
55 |
||
56 |
Goal "(x powr a) powr b = (x powr b) powr a"; |
|
57 |
by (simp_tac (simpset() addsimps [powr_powr,real_mult_commute]) 1); |
|
58 |
qed "powr_powr_swap"; |
|
59 |
||
60 |
Goalw [powr_def] "x powr (-a) = inverse (x powr a)"; |
|
61 |
by (simp_tac (simpset() addsimps [exp_minus RS sym]) 1); |
|
62 |
qed "powr_minus"; |
|
63 |
||
64 |
Goalw [real_divide_def] "x powr (-a) = 1/(x powr a)"; |
|
65 |
by (simp_tac (simpset() addsimps [powr_minus]) 1); |
|
66 |
qed "powr_minus_divide"; |
|
67 |
||
68 |
Goalw [powr_def] |
|
69 |
"[| a < b; 1 < x |] ==> x powr a < x powr b"; |
|
70 |
by Auto_tac; |
|
71 |
qed "powr_less_mono"; |
|
72 |
||
73 |
Goalw [powr_def] |
|
74 |
"[| x powr a < x powr b; 1 < x |] ==> a < b"; |
|
75 |
by (auto_tac (claset() addDs [ln_gt_zero], |
|
14305
f17ca9f6dc8c
tidying first part of HyperArith0.ML, using generic lemmas
paulson
parents:
12224
diff
changeset
|
76 |
simpset() addsimps [mult_less_cancel_right])); |
12224 | 77 |
qed "powr_less_cancel"; |
78 |
||
79 |
Goal "1 < x ==> (x powr a < x powr b) = (a < b)"; |
|
80 |
by (blast_tac (claset() addIs [powr_less_cancel,powr_less_mono]) 1); |
|
81 |
qed "powr_less_cancel_iff"; |
|
82 |
Addsimps [powr_less_cancel_iff]; |
|
83 |
||
84 |
Goalw [real_le_def] "1 < x ==> (x powr a <= x powr b) = (a <= b)"; |
|
85 |
by (Auto_tac); |
|
86 |
qed "powr_le_cancel_iff"; |
|
87 |
Addsimps [powr_le_cancel_iff]; |
|
88 |
||
89 |
Goalw [log_def] "ln x = log (exp(1)) x"; |
|
90 |
by (Simp_tac 1); |
|
91 |
qed "log_ln"; |
|
92 |
||
93 |
Goalw [powr_def,log_def] |
|
94 |
"[| 0 < a; a ~= 1; 0 < x |] ==> a powr (log a x) = x"; |
|
95 |
by Auto_tac; |
|
96 |
qed "powr_log_cancel"; |
|
97 |
Addsimps [powr_log_cancel]; |
|
98 |
||
99 |
Goalw [log_def,powr_def] |
|
100 |
"[| 0 < a; a ~= 1 |] ==> log a (a powr y) = y"; |
|
101 |
by (auto_tac (claset(),simpset() addsimps [real_divide_def, |
|
102 |
real_mult_assoc])); |
|
103 |
qed "log_powr_cancel"; |
|
104 |
Addsimps [log_powr_cancel]; |
|
105 |
||
106 |
Goalw [log_def] |
|
107 |
"[| 0 < a; a ~= 1; 0 < x; 0 < y |] \ |
|
108 |
\ ==> log a (x * y) = log a x + log a y"; |
|
109 |
by (auto_tac (claset(),simpset() addsimps [ln_mult,real_divide_def, |
|
14334 | 110 |
left_distrib])); |
12224 | 111 |
qed "log_mult"; |
112 |
||
113 |
Goalw [log_def,real_divide_def] |
|
114 |
"[| 0 < a; a ~= 1; 0 < b; b ~= 1; 0 < x |] \ |
|
115 |
\ ==> log a x = (ln b/ln a) * log b x"; |
|
116 |
by Auto_tac; |
|
117 |
qed "log_eq_div_ln_mult_log"; |
|
118 |
||
119 |
(* specific case *) |
|
120 |
Goal "0 < x ==> log 10 x = (ln (exp 1) / ln 10) * ln x"; |
|
121 |
by (auto_tac (claset(),simpset() addsimps [log_def])); |
|
122 |
qed "log_base_10_eq1"; |
|
123 |
||
124 |
Goal "0 < x ==> log 10 x = (log 10 (exp 1)) * ln x"; |
|
125 |
by (auto_tac (claset(),simpset() addsimps [log_def])); |
|
126 |
qed "log_base_10_eq2"; |
|
127 |
||
128 |
Goalw [log_def] "log a 1 = 0"; |
|
129 |
by Auto_tac; |
|
130 |
qed "log_one"; |
|
131 |
Addsimps [log_one]; |
|
132 |
||
133 |
Goalw [log_def] |
|
134 |
"[| 0 < a; a ~= 1 |] ==> log a a = 1"; |
|
135 |
by Auto_tac; |
|
136 |
qed "log_eq_one"; |
|
137 |
Addsimps [log_eq_one]; |
|
138 |
||
139 |
Goal "[| 0 < a; a ~= 1; 0 < x |] ==> log a (inverse x) = - log a x"; |
|
14334 | 140 |
by (res_inst_tac [("a1","log a x")] (add_left_cancel RS iffD1) 1); |
12224 | 141 |
by (auto_tac (claset(),simpset() addsimps [log_mult RS sym])); |
142 |
qed "log_inverse"; |
|
143 |
||
144 |
Goal "[|0 < a; a ~= 1; 0 < x; 0 < y|] \ |
|
145 |
\ ==> log a (x/y) = log a x - log a y"; |
|
146 |
by (auto_tac (claset(),simpset() addsimps [log_mult,real_divide_def, |
|
147 |
log_inverse])); |
|
148 |
qed "log_divide"; |
|
149 |
||
150 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (log a x < log a y) = (x < y)"; |
|
151 |
by (Step_tac 1); |
|
152 |
by (rtac powr_less_cancel 2); |
|
153 |
by (dres_inst_tac [("a","log a x")] powr_less_mono 1); |
|
154 |
by Auto_tac; |
|
155 |
qed "log_less_cancel_iff"; |
|
156 |
Addsimps [log_less_cancel_iff]; |
|
157 |
||
158 |
Goal "[| 1 < a; 0 < x; 0 < y |] ==> (log a x <= log a y) = (x <= y)"; |
|
159 |
by (auto_tac (claset(),simpset() addsimps [real_le_def])); |
|
160 |
qed "log_le_cancel_iff"; |
|
161 |
Addsimps [log_le_cancel_iff]; |
|
162 |