author | paulson |
Mon, 16 Aug 1999 18:41:32 +0200 | |
changeset 7219 | 4e3f386c2e37 |
parent 7127 | 48e235179ffb |
child 7292 | dff3470c5c62 |
permissions | -rw-r--r-- |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
1 |
(* Title: HOL/Real/Real.ML |
7219 | 2 |
ID: $Id$ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
3 |
Author: Lawrence C. Paulson |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
4 |
Jacques D. Fleuriot |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
5 |
Copyright: 1998 University of Cambridge |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
6 |
Description: Type "real" is a linear order |
5078 | 7 |
*) |
8 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
9 |
Goal "(0r < x) = (? y. x = real_of_preal y)"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
10 |
by (auto_tac (claset(), simpset() addsimps [real_of_preal_zero_less])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
11 |
by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1); |
5078 | 12 |
by (blast_tac (claset() addSEs [real_less_irrefl, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
13 |
real_of_preal_not_minus_gt_zero RS notE]) 1); |
5078 | 14 |
qed "real_gt_zero_preal_Ex"; |
15 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
16 |
Goal "real_of_preal z < x ==> ? y. x = real_of_preal y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
17 |
by (blast_tac (claset() addSDs [real_of_preal_zero_less RS real_less_trans] |
5078 | 18 |
addIs [real_gt_zero_preal_Ex RS iffD1]) 1); |
19 |
qed "real_gt_preal_preal_Ex"; |
|
20 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
21 |
Goal "real_of_preal z <= x ==> ? y. x = real_of_preal y"; |
5078 | 22 |
by (blast_tac (claset() addDs [real_le_imp_less_or_eq, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
23 |
real_gt_preal_preal_Ex]) 1); |
5078 | 24 |
qed "real_ge_preal_preal_Ex"; |
25 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
26 |
Goal "y <= 0r ==> !x. y < real_of_preal x"; |
5078 | 27 |
by (auto_tac (claset() addEs [real_le_imp_less_or_eq RS disjE] |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
28 |
addIs [real_of_preal_zero_less RSN(2,real_less_trans)], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
29 |
simpset() addsimps [real_of_preal_zero_less])); |
5078 | 30 |
qed "real_less_all_preal"; |
31 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
32 |
Goal "~ 0r < y ==> !x. y < real_of_preal x"; |
5078 | 33 |
by (blast_tac (claset() addSIs [real_less_all_preal,real_leI]) 1); |
34 |
qed "real_less_all_real2"; |
|
35 |
||
5588 | 36 |
Goal "((x::real) < y) = (-y < -x)"; |
5078 | 37 |
by (rtac (real_less_sum_gt_0_iff RS subst) 1); |
38 |
by (res_inst_tac [("W1","x")] (real_less_sum_gt_0_iff RS subst) 1); |
|
39 |
by (simp_tac (simpset() addsimps [real_add_commute]) 1); |
|
40 |
qed "real_less_swap_iff"; |
|
41 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
42 |
Goal "[| R + L = S; 0r < L |] ==> R < S"; |
5078 | 43 |
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1); |
5588 | 44 |
by (auto_tac (claset(), simpset() addsimps real_add_ac)); |
5078 | 45 |
qed "real_lemma_add_positive_imp_less"; |
46 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
47 |
Goal "? T. 0r < T & R + T = S ==> R < S"; |
5078 | 48 |
by (blast_tac (claset() addIs [real_lemma_add_positive_imp_less]) 1); |
49 |
qed "real_ex_add_positive_left_less"; |
|
50 |
||
5588 | 51 |
(*Alternative definition for real_less. NOT for rewriting*) |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
52 |
Goal "(R < S) = (? T. 0r < T & R + T = S)"; |
5459 | 53 |
by (blast_tac (claset() addSIs [real_less_add_positive_left_Ex, |
5588 | 54 |
real_ex_add_positive_left_less]) 1); |
55 |
qed "real_less_iff_add"; |
|
5078 | 56 |
|
5588 | 57 |
Goal "(0r < x) = (-x < x)"; |
5459 | 58 |
by Safe_tac; |
5078 | 59 |
by (rtac ccontr 2 THEN forward_tac |
60 |
[real_leI RS real_le_imp_less_or_eq] 2); |
|
61 |
by (Step_tac 2); |
|
62 |
by (dtac (real_minus_zero_less_iff RS iffD2) 2); |
|
5459 | 63 |
by (blast_tac (claset() addIs [real_less_trans]) 2); |
5588 | 64 |
by (auto_tac (claset(), |
65 |
simpset() addsimps |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
66 |
[real_gt_zero_preal_Ex,real_of_preal_minus_less_self])); |
5078 | 67 |
qed "real_gt_zero_iff"; |
68 |
||
5588 | 69 |
Goal "(x < 0r) = (x < -x)"; |
5078 | 70 |
by (rtac (real_minus_zero_less_iff RS subst) 1); |
71 |
by (stac real_gt_zero_iff 1); |
|
72 |
by (Full_simp_tac 1); |
|
73 |
qed "real_lt_zero_iff"; |
|
74 |
||
5588 | 75 |
Goalw [real_le_def] "(0r <= x) = (-x <= x)"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
76 |
by (auto_tac (claset(), simpset() addsimps [real_lt_zero_iff RS sym])); |
5078 | 77 |
qed "real_ge_zero_iff"; |
78 |
||
5588 | 79 |
Goalw [real_le_def] "(x <= 0r) = (x <= -x)"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
80 |
by (auto_tac (claset(), simpset() addsimps [real_gt_zero_iff RS sym])); |
5078 | 81 |
qed "real_le_zero_iff"; |
82 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
83 |
Goal "(real_of_preal m1 <= real_of_preal m2) = (m1 <= m2)"; |
5078 | 84 |
by (auto_tac (claset() addSIs [preal_leI], |
85 |
simpset() addsimps [real_less_le_iff RS sym])); |
|
86 |
by (dtac preal_le_less_trans 1 THEN assume_tac 1); |
|
87 |
by (etac preal_less_irrefl 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
88 |
qed "real_of_preal_le_iff"; |
5078 | 89 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
90 |
Goal "[| 0r < x; 0r < y |] ==> 0r < x * y"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
91 |
by (auto_tac (claset(), simpset() addsimps [real_gt_zero_preal_Ex])); |
5078 | 92 |
by (res_inst_tac [("x","y*ya")] exI 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
93 |
by (full_simp_tac (simpset() addsimps [real_of_preal_mult]) 1); |
5078 | 94 |
qed "real_mult_order"; |
95 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
96 |
Goal "[| x < 0r; y < 0r |] ==> 0r < x * y"; |
5078 | 97 |
by (REPEAT(dtac (real_minus_zero_less_iff RS iffD2) 1)); |
98 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
99 |
by (Asm_full_simp_tac 1); |
|
100 |
qed "real_mult_less_zero1"; |
|
101 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
102 |
Goal "[| 0r <= x; 0r <= y |] ==> 0r <= x * y"; |
5078 | 103 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
5588 | 104 |
by (auto_tac (claset() addIs [real_mult_order, real_less_imp_le], |
105 |
simpset())); |
|
5078 | 106 |
qed "real_le_mult_order"; |
107 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
108 |
Goal "[| 0r < x; 0r <= y |] ==> 0r <= x * y"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
109 |
by (dtac real_le_imp_less_or_eq 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
110 |
by (auto_tac (claset() addIs [real_mult_order, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
111 |
real_less_imp_le],simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
112 |
qed "real_less_le_mult_order"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
113 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
114 |
Goal "[| x <= 0r; y <= 0r |] ==> 0r <= x * y"; |
5078 | 115 |
by (rtac real_less_or_eq_imp_le 1); |
116 |
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1); |
|
117 |
by Auto_tac; |
|
118 |
by (dtac real_le_imp_less_or_eq 1); |
|
119 |
by (auto_tac (claset() addDs [real_mult_less_zero1],simpset())); |
|
120 |
qed "real_mult_le_zero1"; |
|
121 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
122 |
Goal "[| 0r <= x; y < 0r |] ==> x * y <= 0r"; |
5078 | 123 |
by (rtac real_less_or_eq_imp_le 1); |
124 |
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1); |
|
125 |
by Auto_tac; |
|
126 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
|
127 |
by (rtac (real_minus_zero_less_iff RS subst) 1); |
|
128 |
by (blast_tac (claset() addDs [real_mult_order] |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
129 |
addIs [real_minus_mult_eq2 RS ssubst]) 1); |
5078 | 130 |
qed "real_mult_le_zero"; |
131 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
132 |
Goal "[| 0r < x; y < 0r |] ==> x*y < 0r"; |
5078 | 133 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
134 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
135 |
by (rtac (real_minus_zero_less_iff RS iffD1) 1); |
|
136 |
by (asm_full_simp_tac (simpset() addsimps [real_minus_mult_eq2]) 1); |
|
137 |
qed "real_mult_less_zero"; |
|
138 |
||
139 |
Goalw [real_one_def] "0r < 1r"; |
|
140 |
by (auto_tac (claset() addIs [real_gt_zero_preal_Ex RS iffD2], |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
141 |
simpset() addsimps [real_of_preal_def])); |
5078 | 142 |
qed "real_zero_less_one"; |
143 |
||
5588 | 144 |
(*** Monotonicity results ***) |
145 |
||
146 |
Goal "(v+z < w+z) = (v < (w::real))"; |
|
147 |
by (Simp_tac 1); |
|
148 |
qed "real_add_right_cancel_less"; |
|
5078 | 149 |
|
5588 | 150 |
Goal "(z+v < z+w) = (v < (w::real))"; |
151 |
by (Simp_tac 1); |
|
152 |
qed "real_add_left_cancel_less"; |
|
153 |
||
154 |
Addsimps [real_add_right_cancel_less, real_add_left_cancel_less]; |
|
155 |
||
156 |
Goal "(v+z <= w+z) = (v <= (w::real))"; |
|
157 |
by (Simp_tac 1); |
|
158 |
qed "real_add_right_cancel_le"; |
|
5078 | 159 |
|
5588 | 160 |
Goal "(z+v <= z+w) = (v <= (w::real))"; |
161 |
by (Simp_tac 1); |
|
162 |
qed "real_add_left_cancel_le"; |
|
163 |
||
164 |
Addsimps [real_add_right_cancel_le, real_add_left_cancel_le]; |
|
165 |
||
166 |
(*"v<=w ==> v+z <= w+z"*) |
|
167 |
bind_thm ("real_add_less_mono1", real_add_right_cancel_less RS iffD2); |
|
168 |
||
169 |
(*"v<=w ==> v+z <= w+z"*) |
|
170 |
bind_thm ("real_add_le_mono1", real_add_right_cancel_le RS iffD2); |
|
171 |
||
172 |
Goal "!!z z'::real. [| w'<w; z'<=z |] ==> w' + z' < w + z"; |
|
173 |
by (etac (real_add_less_mono1 RS real_less_le_trans) 1); |
|
174 |
by (Simp_tac 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
175 |
qed "real_add_less_le_mono"; |
5588 | 176 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
177 |
Goal "!!z z'::real. [| w'<=w; z'<z |] ==> w' + z' < w + z"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
178 |
by (etac (real_add_le_mono1 RS real_le_less_trans) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
179 |
by (Simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
180 |
qed "real_add_le_less_mono"; |
5078 | 181 |
|
182 |
Goal "!!(A::real). A < B ==> C + A < C + B"; |
|
5588 | 183 |
by (Simp_tac 1); |
5078 | 184 |
qed "real_add_less_mono2"; |
185 |
||
186 |
Goal "!!(A::real). A + C < B + C ==> A < B"; |
|
5588 | 187 |
by (Full_simp_tac 1); |
5078 | 188 |
qed "real_less_add_right_cancel"; |
189 |
||
190 |
Goal "!!(A::real). C + A < C + B ==> A < B"; |
|
5588 | 191 |
by (Full_simp_tac 1); |
5078 | 192 |
qed "real_less_add_left_cancel"; |
193 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
194 |
Goal "!!(A::real). A + C <= B + C ==> A <= B"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
195 |
by (Full_simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
196 |
qed "real_le_add_right_cancel"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
197 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
198 |
Goal "!!(A::real). C + A <= C + B ==> A <= B"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
199 |
by (Full_simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
200 |
qed "real_le_add_left_cancel"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
201 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
202 |
Goal "[| 0r < x; 0r < y |] ==> 0r < x + y"; |
6162 | 203 |
by (etac real_less_trans 1); |
204 |
by (dtac real_add_less_mono2 1); |
|
5588 | 205 |
by (Full_simp_tac 1); |
5078 | 206 |
qed "real_add_order"; |
207 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
208 |
Goal "[| 0r <= x; 0r <= y |] ==> 0r <= x + y"; |
5078 | 209 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
5588 | 210 |
by (auto_tac (claset() addIs [real_add_order, real_less_imp_le], |
211 |
simpset())); |
|
5078 | 212 |
qed "real_le_add_order"; |
213 |
||
5588 | 214 |
Goal "[| R1 < S1; R2 < S2 |] ==> R1 + R2 < S1 + (S2::real)"; |
6162 | 215 |
by (dtac real_add_less_mono1 1); |
216 |
by (etac real_less_trans 1); |
|
217 |
by (etac real_add_less_mono2 1); |
|
5078 | 218 |
qed "real_add_less_mono"; |
219 |
||
220 |
Goal "!!(q1::real). q1 <= q2 ==> x + q1 <= x + q2"; |
|
5588 | 221 |
by (Simp_tac 1); |
5078 | 222 |
qed "real_add_left_le_mono1"; |
223 |
||
5588 | 224 |
Goal "[|i<=j; k<=l |] ==> i + k <= j + (l::real)"; |
6162 | 225 |
by (dtac real_add_le_mono1 1); |
226 |
by (etac real_le_trans 1); |
|
5588 | 227 |
by (Simp_tac 1); |
5078 | 228 |
qed "real_add_le_mono"; |
229 |
||
230 |
Goal "EX (x::real). x < y"; |
|
231 |
by (rtac (real_add_zero_right RS subst) 1); |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
232 |
by (res_inst_tac [("x","y + (-1r)")] exI 1); |
5078 | 233 |
by (auto_tac (claset() addSIs [real_add_less_mono2], |
5588 | 234 |
simpset() addsimps [real_minus_zero_less_iff2, real_zero_less_one])); |
5078 | 235 |
qed "real_less_Ex"; |
5588 | 236 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
237 |
Goal "0r < r ==> u + (-r) < u"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
238 |
by (res_inst_tac [("C","r")] real_less_add_right_cancel 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
239 |
by (simp_tac (simpset() addsimps [real_add_assoc]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
240 |
qed "real_add_minus_positive_less_self"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
241 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
242 |
Goal "((r::real) <= s) = (-s <= -r)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
243 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
244 |
by (dres_inst_tac [("x","-s")] real_add_left_le_mono1 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
245 |
by (dres_inst_tac [("x","r")] real_add_left_le_mono1 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
246 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
247 |
by (dres_inst_tac [("z","-r")] real_add_le_mono1 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
248 |
by (dres_inst_tac [("z","s")] real_add_le_mono1 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
249 |
by (auto_tac (claset(), simpset() addsimps [real_add_assoc])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
250 |
qed "real_le_minus_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
251 |
Addsimps [real_le_minus_iff RS sym]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
252 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
253 |
Goal "0r <= 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
254 |
by (rtac (real_zero_less_one RS real_less_imp_le) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
255 |
qed "real_zero_le_one"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
256 |
Addsimps [real_zero_le_one]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
257 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
258 |
Goal "0r <= x*x"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
259 |
by (res_inst_tac [("R2.0","0r"),("R1.0","x")] real_linear_less2 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
260 |
by (auto_tac (claset() addIs [real_mult_order, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
261 |
real_mult_less_zero1,real_less_imp_le], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
262 |
simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
263 |
qed "real_le_square"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
264 |
Addsimps [real_le_square]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
265 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
266 |
(*---------------------------------------------------------------------------- |
5078 | 267 |
An embedding of the naturals in the reals |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
268 |
----------------------------------------------------------------------------*) |
5078 | 269 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
270 |
Goalw [real_of_posnat_def] "real_of_posnat 0 = 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
271 |
by (full_simp_tac (simpset() addsimps [pnat_one_iff RS sym,real_of_preal_def]) 1); |
5078 | 272 |
by (fold_tac [real_one_def]); |
273 |
by (rtac refl 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
274 |
qed "real_of_posnat_one"; |
5078 | 275 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
276 |
Goalw [real_of_posnat_def] "real_of_posnat 1 = 1r + 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
277 |
by (full_simp_tac (simpset() addsimps [real_of_preal_def,real_one_def, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
278 |
pnat_two_eq,real_add,prat_of_pnat_add RS sym,preal_of_prat_add RS sym |
5078 | 279 |
] @ pnat_add_ac) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
280 |
qed "real_of_posnat_two"; |
5078 | 281 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
282 |
Goalw [real_of_posnat_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
283 |
"real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
284 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_one RS sym, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
285 |
real_of_posnat_def,real_of_preal_add RS sym,preal_of_prat_add RS sym, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
286 |
prat_of_pnat_add RS sym,pnat_of_nat_add]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
287 |
qed "real_of_posnat_add"; |
5078 | 288 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
289 |
Goal "real_of_posnat (n + 1) = real_of_posnat n + 1r"; |
5078 | 290 |
by (res_inst_tac [("x1","1r")] (real_add_right_cancel RS iffD1) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
291 |
by (rtac (real_of_posnat_add RS subst) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
292 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_two,real_add_assoc]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
293 |
qed "real_of_posnat_add_one"; |
5078 | 294 |
|
295 |
Goal "Suc n = n + 1"; |
|
296 |
by Auto_tac; |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
297 |
qed "lemmaS"; |
5078 | 298 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
299 |
Goal "real_of_posnat (Suc n) = real_of_posnat n + 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
300 |
by (stac lemmaS 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
301 |
by (rtac real_of_posnat_add_one 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
302 |
qed "real_of_posnat_Suc"; |
5078 | 303 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
304 |
Goal "inj(real_of_posnat)"; |
5078 | 305 |
by (rtac injI 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
306 |
by (rewtac real_of_posnat_def); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
307 |
by (dtac (inj_real_of_preal RS injD) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
308 |
by (dtac (inj_preal_of_prat RS injD) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
309 |
by (dtac (inj_prat_of_pnat RS injD) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
310 |
by (etac (inj_pnat_of_nat RS injD) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
311 |
qed "inj_real_of_posnat"; |
5078 | 312 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
313 |
Goalw [real_of_posnat_def] "0r < real_of_posnat n"; |
5078 | 314 |
by (rtac (real_gt_zero_preal_Ex RS iffD2) 1); |
315 |
by (Blast_tac 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
316 |
qed "real_of_posnat_less_zero"; |
5078 | 317 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
318 |
Goal "real_of_posnat n ~= 0r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
319 |
by (rtac (real_of_posnat_less_zero RS real_not_refl2 RS not_sym) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
320 |
qed "real_of_posnat_not_eq_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
321 |
Addsimps[real_of_posnat_not_eq_zero]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
322 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
323 |
Goal "1r <= real_of_posnat n"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
324 |
by (simp_tac (simpset() addsimps [real_of_posnat_one RS sym]) 1); |
5184 | 325 |
by (induct_tac "n" 1); |
5588 | 326 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
327 |
simpset () addsimps [real_of_posnat_Suc,real_of_posnat_one, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
328 |
real_of_posnat_less_zero, real_less_imp_le])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
329 |
qed "real_of_posnat_less_one"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
330 |
Addsimps [real_of_posnat_less_one]; |
5078 | 331 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
332 |
Goal "rinv(real_of_posnat n) ~= 0r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
333 |
by (rtac ((real_of_posnat_less_zero RS |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
334 |
real_not_refl2 RS not_sym) RS rinv_not_zero) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
335 |
qed "real_of_posnat_rinv_not_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
336 |
Addsimps [real_of_posnat_rinv_not_zero]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
337 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
338 |
Goal "rinv(real_of_posnat x) = rinv(real_of_posnat y) ==> x = y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
339 |
by (rtac (inj_real_of_posnat RS injD) 1); |
5078 | 340 |
by (res_inst_tac [("n2","x")] |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
341 |
(real_of_posnat_rinv_not_zero RS real_mult_left_cancel RS iffD1) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
342 |
by (full_simp_tac (simpset() addsimps [(real_of_posnat_less_zero RS |
5078 | 343 |
real_not_refl2 RS not_sym) RS real_mult_inv_left]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
344 |
by (asm_full_simp_tac (simpset() addsimps [(real_of_posnat_less_zero RS |
5078 | 345 |
real_not_refl2 RS not_sym)]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
346 |
qed "real_of_posnat_rinv_inj"; |
5078 | 347 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
348 |
Goal "0r < x ==> 0r < rinv x"; |
5078 | 349 |
by (EVERY1[rtac ccontr, dtac real_leI]); |
350 |
by (forward_tac [real_minus_zero_less_iff2 RS iffD2] 1); |
|
351 |
by (forward_tac [real_not_refl2 RS not_sym] 1); |
|
352 |
by (dtac (real_not_refl2 RS not_sym RS rinv_not_zero) 1); |
|
353 |
by (EVERY1[dtac real_le_imp_less_or_eq, Step_tac]); |
|
354 |
by (dtac real_mult_less_zero1 1 THEN assume_tac 1); |
|
355 |
by (auto_tac (claset() addIs [real_zero_less_one RS real_less_asym], |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
356 |
simpset() addsimps [real_minus_mult_eq1 RS sym])); |
5078 | 357 |
qed "real_rinv_gt_zero"; |
358 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
359 |
Goal "x < 0r ==> rinv x < 0r"; |
5078 | 360 |
by (forward_tac [real_not_refl2] 1); |
361 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
|
362 |
by (rtac (real_minus_zero_less_iff RS iffD1) 1); |
|
363 |
by (dtac (real_minus_rinv RS sym) 1); |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
364 |
by (auto_tac (claset() addIs [real_rinv_gt_zero], simpset())); |
5078 | 365 |
qed "real_rinv_less_zero"; |
366 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
367 |
Goal "0r < rinv(real_of_posnat n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
368 |
by (rtac (real_of_posnat_less_zero RS real_rinv_gt_zero) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
369 |
qed "real_of_posnat_rinv_gt_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
370 |
Addsimps [real_of_posnat_rinv_gt_zero]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
371 |
|
5078 | 372 |
Goal "x+x=x*(1r+1r)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
373 |
by (simp_tac (simpset() addsimps |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
374 |
[real_add_mult_distrib2]) 1); |
5078 | 375 |
qed "real_add_self"; |
376 |
||
377 |
Goal "x < x + 1r"; |
|
378 |
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1); |
|
379 |
by (full_simp_tac (simpset() addsimps [real_zero_less_one, |
|
5588 | 380 |
real_add_assoc, real_add_left_commute]) 1); |
5078 | 381 |
qed "real_self_less_add_one"; |
382 |
||
383 |
Goal "1r < 1r + 1r"; |
|
384 |
by (rtac real_self_less_add_one 1); |
|
385 |
qed "real_one_less_two"; |
|
386 |
||
387 |
Goal "0r < 1r + 1r"; |
|
388 |
by (rtac ([real_zero_less_one, |
|
5588 | 389 |
real_one_less_two] MRS real_less_trans) 1); |
5078 | 390 |
qed "real_zero_less_two"; |
391 |
||
392 |
Goal "1r + 1r ~= 0r"; |
|
393 |
by (rtac (real_zero_less_two RS real_not_refl2 RS not_sym) 1); |
|
394 |
qed "real_two_not_zero"; |
|
395 |
||
396 |
Addsimps [real_two_not_zero]; |
|
397 |
||
398 |
Goal "x*rinv(1r + 1r) + x*rinv(1r + 1r) = x"; |
|
399 |
by (stac real_add_self 1); |
|
400 |
by (full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
401 |
qed "real_sum_of_halves"; |
|
402 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
403 |
Goal "[| 0r<z; x<y |] ==> x*z<y*z"; |
5078 | 404 |
by (rotate_tac 1 1); |
405 |
by (dtac real_less_sum_gt_zero 1); |
|
406 |
by (rtac real_sum_gt_zero_less 1); |
|
407 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
408 |
by (asm_full_simp_tac (simpset() addsimps [real_add_mult_distrib2, |
|
409 |
real_minus_mult_eq2 RS sym, real_mult_commute ]) 1); |
|
410 |
qed "real_mult_less_mono1"; |
|
411 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
412 |
Goal "[| 0r<z; x<y |] ==> z*x<z*y"; |
5078 | 413 |
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_less_mono1]) 1); |
414 |
qed "real_mult_less_mono2"; |
|
415 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
416 |
Goal "[| 0r<z; x*z<y*z |] ==> x<y"; |
5078 | 417 |
by (forw_inst_tac [("x","x*z")] (real_rinv_gt_zero |
418 |
RS real_mult_less_mono1) 1); |
|
5588 | 419 |
by (auto_tac (claset(), |
420 |
simpset() addsimps |
|
5078 | 421 |
[real_mult_assoc,real_not_refl2 RS not_sym])); |
422 |
qed "real_mult_less_cancel1"; |
|
423 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
424 |
Goal "[| 0r<z; z*x<z*y |] ==> x<y"; |
5078 | 425 |
by (etac real_mult_less_cancel1 1); |
426 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_commute]) 1); |
|
427 |
qed "real_mult_less_cancel2"; |
|
428 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
429 |
Goal "0r < z ==> (x*z < y*z) = (x < y)"; |
5078 | 430 |
by (blast_tac (claset() addIs [real_mult_less_mono1, |
431 |
real_mult_less_cancel1]) 1); |
|
432 |
qed "real_mult_less_iff1"; |
|
433 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
434 |
Goal "0r < z ==> (z*x < z*y) = (x < y)"; |
5078 | 435 |
by (blast_tac (claset() addIs [real_mult_less_mono2, |
436 |
real_mult_less_cancel2]) 1); |
|
437 |
qed "real_mult_less_iff2"; |
|
438 |
||
439 |
Addsimps [real_mult_less_iff1,real_mult_less_iff2]; |
|
440 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
441 |
Goal "[| 0r<=z; x<y |] ==> x*z<=y*z"; |
5078 | 442 |
by (EVERY1 [rtac real_less_or_eq_imp_le, dtac real_le_imp_less_or_eq]); |
443 |
by (auto_tac (claset() addIs [real_mult_less_mono1],simpset())); |
|
444 |
qed "real_mult_le_less_mono1"; |
|
445 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
446 |
Goal "[| 0r<=z; x<y |] ==> z*x<=z*y"; |
5078 | 447 |
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_le_less_mono1]) 1); |
448 |
qed "real_mult_le_less_mono2"; |
|
449 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
450 |
Goal "[| 0r<=z; x<=y |] ==> z*x<=z*y"; |
5078 | 451 |
by (dres_inst_tac [("x","x")] real_le_imp_less_or_eq 1); |
5588 | 452 |
by (auto_tac (claset() addIs [real_mult_le_less_mono2], simpset())); |
5078 | 453 |
qed "real_mult_le_le_mono1"; |
454 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
455 |
Goal "[| 0r < r1; r1 <r2; 0r < x; x < y|] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
456 |
\ ==> r1 * x < r2 * y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
457 |
by (dres_inst_tac [("x","x")] real_mult_less_mono2 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
458 |
by (dres_inst_tac [("R1.0","0r")] real_less_trans 2); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
459 |
by (dres_inst_tac [("x","r1")] real_mult_less_mono1 3); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
460 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
461 |
by (blast_tac (claset() addIs [real_less_trans]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
462 |
qed "real_mult_less_mono"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
463 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
464 |
Goal "[| 0r < r1; r1 <r2; 0r < y|] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
465 |
\ ==> 0r < r2 * y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
466 |
by (dres_inst_tac [("R1.0","0r")] real_less_trans 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
467 |
by (assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
468 |
by (blast_tac (claset() addIs [real_mult_order]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
469 |
qed "real_mult_order_trans"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
470 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
471 |
Goal "[| 0r < r1; r1 <r2; 0r <= x; x < y|] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
472 |
\ ==> r1 * x < r2 * y"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
473 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
474 |
addIs [real_mult_less_mono,real_mult_order_trans], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
475 |
simpset())); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
476 |
qed "real_mult_less_mono3"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
477 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
478 |
Goal "[| 0r <= r1; r1 <r2; 0r <= x; x < y|] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
479 |
\ ==> r1 * x < r2 * y"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
480 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
481 |
addIs [real_mult_less_mono,real_mult_order_trans, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
482 |
real_mult_order], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
483 |
simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
484 |
by (dres_inst_tac [("R2.0","x")] real_less_trans 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
485 |
by (assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
486 |
by (blast_tac (claset() addIs [real_mult_order]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
487 |
qed "real_mult_less_mono4"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
488 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
489 |
Goal "[| 0r < r1; r1 <= r2; 0r <= x; x <= y |] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
490 |
\ ==> r1 * x <= r2 * y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
491 |
by (rtac real_less_or_eq_imp_le 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
492 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
493 |
by (auto_tac (claset() addIs [real_mult_less_mono, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
494 |
real_mult_order_trans,real_mult_order], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
495 |
simpset())); |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
496 |
qed "real_mult_le_mono"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
497 |
|
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
498 |
Goal "[| 0r < r1; r1 < r2; 0r <= x; x <= y |] \ |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
499 |
\ ==> r1 * x <= r2 * y"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
500 |
by (rtac real_less_or_eq_imp_le 1); |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
501 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
502 |
by (auto_tac (claset() addIs [real_mult_less_mono, real_mult_order_trans, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
503 |
real_mult_order], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
504 |
simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
505 |
qed "real_mult_le_mono2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
506 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
507 |
Goal "[| 0r <= r1; r1 < r2; 0r <= x; x <= y |] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
508 |
\ ==> r1 * x <= r2 * y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
509 |
by (dtac real_le_imp_less_or_eq 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
510 |
by (auto_tac (claset() addIs [real_mult_le_mono2],simpset())); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
511 |
by (dtac real_le_trans 1 THEN assume_tac 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
512 |
by (auto_tac (claset() addIs [real_less_le_mult_order], simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
513 |
qed "real_mult_le_mono3"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
514 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
515 |
Goal "[| 0r <= r1; r1 <= r2; 0r <= x; x <= y |] \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
516 |
\ ==> r1 * x <= r2 * y"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
517 |
by (dres_inst_tac [("x","r1")] real_le_imp_less_or_eq 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
518 |
by (auto_tac (claset() addIs [real_mult_le_mono3, real_mult_le_le_mono1], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
519 |
simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
520 |
qed "real_mult_le_mono4"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
521 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
522 |
Goal "1r <= x ==> 0r < x"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
523 |
by (rtac ccontr 1 THEN dtac real_leI 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
524 |
by (dtac real_le_trans 1 THEN assume_tac 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
525 |
by (auto_tac (claset() addDs [real_zero_less_one RSN (2,real_le_less_trans)], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
526 |
simpset() addsimps [real_less_not_refl])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
527 |
qed "real_gt_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
528 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
529 |
Goal "[| 1r < r; 1r <= x |] ==> x <= r * x"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
530 |
by (dtac (real_gt_zero RS real_less_imp_le) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
531 |
by (auto_tac (claset() addSDs [real_mult_le_less_mono1], |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
532 |
simpset())); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
533 |
qed "real_mult_self_le"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
534 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
535 |
Goal "[| 1r <= r; 1r <= x |] ==> x <= r * x"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
536 |
by (dtac real_le_imp_less_or_eq 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
537 |
by (auto_tac (claset() addIs [real_mult_self_le], |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
538 |
simpset() addsimps [real_le_refl])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
539 |
qed "real_mult_self_le2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
540 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
541 |
Goal "x < y ==> x < (x + y)*rinv(1r + 1r)"; |
5078 | 542 |
by (dres_inst_tac [("C","x")] real_add_less_mono2 1); |
543 |
by (dtac (real_add_self RS subst) 1); |
|
544 |
by (dtac (real_zero_less_two RS real_rinv_gt_zero RS |
|
545 |
real_mult_less_mono1) 1); |
|
546 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
547 |
qed "real_less_half_sum"; |
|
548 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
549 |
Goal "x < y ==> (x + y)*rinv(1r + 1r) < y"; |
5588 | 550 |
by (dtac real_add_less_mono1 1); |
5078 | 551 |
by (dtac (real_add_self RS subst) 1); |
552 |
by (dtac (real_zero_less_two RS real_rinv_gt_zero RS |
|
553 |
real_mult_less_mono1) 1); |
|
554 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
555 |
qed "real_gt_half_sum"; |
|
556 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
557 |
Goal "x < y ==> EX r::real. x < r & r < y"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
558 |
by (blast_tac (claset() addSIs [real_less_half_sum, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
559 |
real_gt_half_sum]) 1); |
5078 | 560 |
qed "real_dense"; |
561 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
562 |
Goal "(EX n. rinv(real_of_posnat n) < r) = (EX n. 1r < r * real_of_posnat n)"; |
5078 | 563 |
by (Step_tac 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
564 |
by (dres_inst_tac [("n1","n")] (real_of_posnat_less_zero |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
565 |
RS real_mult_less_mono1) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
566 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_less_zero RS |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
567 |
real_rinv_gt_zero RS real_mult_less_mono1) 2); |
5588 | 568 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
569 |
simpset() addsimps [(real_of_posnat_less_zero RS |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
570 |
real_not_refl2 RS not_sym), |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
571 |
real_mult_assoc])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
572 |
qed "real_of_posnat_rinv_Ex_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
573 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
574 |
Goal "(rinv(real_of_posnat n) < r) = (1r < r * real_of_posnat n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
575 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
576 |
by (dres_inst_tac [("n1","n")] (real_of_posnat_less_zero |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
577 |
RS real_mult_less_mono1) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
578 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_less_zero RS |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
579 |
real_rinv_gt_zero RS real_mult_less_mono1) 2); |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
580 |
by (auto_tac (claset(), simpset() addsimps [real_mult_assoc])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
581 |
qed "real_of_posnat_rinv_iff"; |
5078 | 582 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
583 |
Goal "(rinv(real_of_posnat n) <= r) = (1r <= r * real_of_posnat n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
584 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
585 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_less_zero RS |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
586 |
real_less_imp_le RS real_mult_le_le_mono1) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
587 |
by (dres_inst_tac [("n3","n")] (real_of_posnat_less_zero RS |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
588 |
real_rinv_gt_zero RS real_less_imp_le RS |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
589 |
real_mult_le_le_mono1) 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
590 |
by (auto_tac (claset(), simpset() addsimps real_mult_ac)); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
591 |
qed "real_of_posnat_rinv_le_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
592 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
593 |
Goalw [real_of_posnat_def] "(real_of_posnat n < real_of_posnat m) = (n < m)"; |
5078 | 594 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
595 |
qed "real_of_posnat_less_iff"; |
5078 | 596 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
597 |
Addsimps [real_of_posnat_less_iff]; |
5078 | 598 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
599 |
Goal "0r < u ==> (u < rinv (real_of_posnat n)) = (real_of_posnat n < rinv(u))"; |
5078 | 600 |
by (Step_tac 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
601 |
by (res_inst_tac [("n2","n")] (real_of_posnat_less_zero RS |
5078 | 602 |
real_rinv_gt_zero RS real_mult_less_cancel1) 1); |
603 |
by (res_inst_tac [("x1","u")] ( real_rinv_gt_zero |
|
604 |
RS real_mult_less_cancel1) 2); |
|
5588 | 605 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
606 |
simpset() addsimps [real_of_posnat_less_zero, |
5078 | 607 |
real_not_refl2 RS not_sym])); |
608 |
by (res_inst_tac [("z","u")] real_mult_less_cancel2 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
609 |
by (res_inst_tac [("n1","n")] (real_of_posnat_less_zero RS |
5078 | 610 |
real_mult_less_cancel2) 3); |
5588 | 611 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
612 |
simpset() addsimps [real_of_posnat_less_zero, |
5078 | 613 |
real_not_refl2 RS not_sym,real_mult_assoc RS sym])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
614 |
qed "real_of_posnat_less_rinv_iff"; |
5078 | 615 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
616 |
Goal "0r < u ==> (u = rinv(real_of_posnat n)) = (real_of_posnat n = rinv u)"; |
5588 | 617 |
by (auto_tac (claset(), |
618 |
simpset() addsimps [real_rinv_rinv, |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
619 |
real_of_posnat_less_zero,real_not_refl2 RS not_sym])); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
620 |
qed "real_of_posnat_rinv_eq_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
621 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
622 |
Goal "[| 0r < r; r < x |] ==> rinv x < rinv r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
623 |
by (forward_tac [real_less_trans] 1 THEN assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
624 |
by (forward_tac [real_rinv_gt_zero] 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
625 |
by (forw_inst_tac [("x","x")] real_rinv_gt_zero 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
626 |
by (forw_inst_tac [("x","r"),("z","rinv r")] real_mult_less_mono1 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
627 |
by (assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
628 |
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
629 |
not_sym RS real_mult_inv_right]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
630 |
by (forward_tac [real_rinv_gt_zero] 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
631 |
by (forw_inst_tac [("x","1r"),("z","rinv x")] real_mult_less_mono2 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
632 |
by (assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
633 |
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
634 |
not_sym RS real_mult_inv_left,real_mult_assoc RS sym]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
635 |
qed "real_rinv_less_swap"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
636 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
637 |
Goal "[| 0r < r; 0r < x|] ==> (r < x) = (rinv x < rinv r)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
638 |
by (auto_tac (claset() addIs [real_rinv_less_swap],simpset())); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
639 |
by (res_inst_tac [("t","r")] (real_rinv_rinv RS subst) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
640 |
by (etac (real_not_refl2 RS not_sym) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
641 |
by (res_inst_tac [("t","x")] (real_rinv_rinv RS subst) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
642 |
by (etac (real_not_refl2 RS not_sym) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
643 |
by (auto_tac (claset() addIs [real_rinv_less_swap], |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
644 |
simpset() addsimps [real_rinv_gt_zero])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
645 |
qed "real_rinv_less_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
646 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
647 |
Goal "r < r + rinv(real_of_posnat n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
648 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
649 |
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
650 |
qed "real_add_rinv_real_of_posnat_less"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
651 |
Addsimps [real_add_rinv_real_of_posnat_less]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
652 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
653 |
Goal "r <= r + rinv(real_of_posnat n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
654 |
by (rtac real_less_imp_le 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
655 |
by (Simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
656 |
qed "real_add_rinv_real_of_posnat_le"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
657 |
Addsimps [real_add_rinv_real_of_posnat_le]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
658 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
659 |
Goal "r + (-rinv(real_of_posnat n)) < r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
660 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
661 |
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
662 |
real_minus_zero_less_iff2]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
663 |
qed "real_add_minus_rinv_real_of_posnat_less"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
664 |
Addsimps [real_add_minus_rinv_real_of_posnat_less]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
665 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
666 |
Goal "r + (-rinv(real_of_posnat n)) <= r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
667 |
by (rtac real_less_imp_le 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
668 |
by (Simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
669 |
qed "real_add_minus_rinv_real_of_posnat_le"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
670 |
Addsimps [real_add_minus_rinv_real_of_posnat_le]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
671 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
672 |
Goal "0r < r ==> r*(1r + (-rinv(real_of_posnat n))) < r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
673 |
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
674 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
675 |
by (auto_tac (claset() addIs [real_mult_order], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
676 |
simpset() addsimps [real_add_assoc RS sym, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
677 |
real_minus_mult_eq2 RS sym, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
678 |
real_minus_zero_less_iff2])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
679 |
qed "real_mult_less_self"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
680 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
681 |
Goal "0r <= 1r + (-rinv(real_of_posnat n))"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
682 |
by (res_inst_tac [("C","rinv(real_of_posnat n)")] real_le_add_right_cancel 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
683 |
by (simp_tac (simpset() addsimps [real_add_assoc, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
684 |
real_of_posnat_rinv_le_iff]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
685 |
qed "real_add_one_minus_rinv_ge_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
686 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
687 |
Goal "0r < r ==> 0r <= r*(1r + (-rinv(real_of_posnat n)))"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
688 |
by (dtac (real_add_one_minus_rinv_ge_zero RS real_mult_le_less_mono1) 1); |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
689 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
690 |
qed "real_mult_add_one_minus_ge_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
691 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
692 |
Goal "x*y = 0r ==> x = 0r | y = 0r"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
693 |
by (auto_tac (claset() addIs [ccontr] addDs [real_mult_not_zero], |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
694 |
simpset())); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
695 |
qed "real_mult_zero_disj"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
696 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
697 |
Goal "x + x*y = x*(1r + y)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
698 |
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
699 |
qed "real_add_mult_distrib_one"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
700 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
701 |
Goal "[| x ~= 1r; y * x = y |] ==> y = 0r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
702 |
by (dtac (sym RS (real_eq_minus_iff RS iffD1)) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
703 |
by (dtac sym 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
704 |
by (asm_full_simp_tac (simpset() addsimps [real_minus_mult_eq2, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
705 |
real_add_mult_distrib_one]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
706 |
by (dtac real_mult_zero_disj 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
707 |
by (auto_tac (claset(), |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
708 |
simpset() addsimps [real_eq_minus_iff2 RS sym])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
709 |
qed "real_mult_eq_self_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
710 |
Addsimps [real_mult_eq_self_zero]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
711 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
712 |
Goal "[| x ~= 1r; y = y * x |] ==> y = 0r"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
713 |
by (dtac sym 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
714 |
by (Asm_full_simp_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
715 |
qed "real_mult_eq_self_zero2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
716 |
Addsimps [real_mult_eq_self_zero2]; |
5078 | 717 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
718 |
Goal "[| 0r <= x*y; 0r < x |] ==> 0r <= y"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
719 |
by (forward_tac [real_rinv_gt_zero] 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
720 |
by (dres_inst_tac [("x","rinv x")] real_less_le_mult_order 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
721 |
by (dtac (real_not_refl2 RS not_sym RS real_mult_inv_left) 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
722 |
by (auto_tac (claset(), |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
723 |
simpset() addsimps [real_mult_assoc RS sym])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
724 |
qed "real_mult_ge_zero_cancel"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
725 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
726 |
Goal "[|x ~= 0r; y ~= 0r |] ==> rinv(x) + rinv(y) = (x + y)*rinv(x*y)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
727 |
by (asm_full_simp_tac (simpset() addsimps |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
728 |
[real_rinv_distrib,real_add_mult_distrib, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
729 |
real_mult_assoc RS sym]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
730 |
by (rtac (real_mult_assoc RS ssubst) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
731 |
by (rtac (real_mult_left_commute RS subst) 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
732 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
733 |
qed "real_rinv_add"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
734 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
735 |
(*---------------------------------------------------------------------------- |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
736 |
Another embedding of the naturals in the reals (see real_of_posnat) |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
737 |
----------------------------------------------------------------------------*) |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
738 |
Goalw [real_of_nat_def] "real_of_nat 0 = 0r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
739 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_one]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
740 |
qed "real_of_nat_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
741 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
742 |
Goalw [real_of_nat_def] "real_of_nat 1 = 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
743 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_two, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
744 |
real_add_assoc]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
745 |
qed "real_of_nat_one"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
746 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
747 |
Goalw [real_of_nat_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
748 |
"real_of_nat n1 + real_of_nat n2 = real_of_nat (n1 + n2)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
749 |
by (simp_tac (simpset() addsimps |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
750 |
[real_of_posnat_add,real_add_assoc RS sym]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
751 |
qed "real_of_nat_add"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
752 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
753 |
Goalw [real_of_nat_def] "real_of_nat (Suc n) = real_of_nat n + 1r"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
754 |
by (simp_tac (simpset() addsimps [real_of_posnat_Suc] @ real_add_ac) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
755 |
qed "real_of_nat_Suc"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
756 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
757 |
Goalw [real_of_nat_def] "(n < m) = (real_of_nat n < real_of_nat m)"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
758 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
759 |
qed "real_of_nat_less_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
760 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
761 |
Addsimps [real_of_nat_less_iff RS sym]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
762 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
763 |
Goal "inj real_of_nat"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
764 |
by (rtac injI 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
765 |
by (auto_tac (claset() addSIs [inj_real_of_posnat RS injD], |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
766 |
simpset() addsimps [real_of_nat_def,real_add_right_cancel])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
767 |
qed "inj_real_of_nat"; |
5078 | 768 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
769 |
Goalw [real_of_nat_def] "0r <= real_of_nat n"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
770 |
by (res_inst_tac [("C","1r")] real_le_add_right_cancel 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
771 |
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
772 |
qed "real_of_nat_ge_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
773 |
Addsimps [real_of_nat_ge_zero]; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
774 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
775 |
Goal "real_of_nat n1 * real_of_nat n2 = real_of_nat (n1 * n2)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
776 |
by (induct_tac "n1" 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
777 |
by (dtac sym 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
778 |
by (auto_tac (claset(), |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
779 |
simpset() addsimps [real_of_nat_zero, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
780 |
real_of_nat_add RS sym,real_of_nat_Suc, |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
781 |
real_add_mult_distrib, real_add_commute])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
782 |
qed "real_of_nat_mult"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
783 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
784 |
Goal "(real_of_nat n = real_of_nat m) = (n = m)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
785 |
by (auto_tac (claset() addDs [inj_real_of_nat RS injD], |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
786 |
simpset())); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
787 |
qed "real_of_nat_eq_cancel"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
788 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
789 |
(*------- lemmas -------*) |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
790 |
goal NatDef.thy "!!m. [| m < Suc n; n <= m |] ==> m = n"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
791 |
by (auto_tac (claset() addSDs [le_imp_less_or_eq] addIs [less_asym], |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
792 |
simpset() addsimps [less_Suc_eq])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
793 |
qed "lemma_nat_not_dense"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
794 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
795 |
goal NatDef.thy "!!m. [| m <= Suc n; n < m |] ==> m = Suc n"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
796 |
by (auto_tac (claset() addSDs [le_imp_less_or_eq] addIs [less_asym], |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
797 |
simpset() addsimps [le_Suc_eq])); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
798 |
qed "lemma_nat_not_dense2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
799 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
800 |
goal NatDef.thy "!!m. m < Suc n ==> ~ Suc n <= m"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
801 |
by (blast_tac (claset() addDs [less_le_trans] addIs [less_asym]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
802 |
qed "lemma_not_leI"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
803 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
804 |
goalw NatDef.thy [le_def] "!!m. ~ Suc n <= m ==> ~ Suc (Suc n) <= m"; |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
805 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
806 |
qed "lemma_not_leI2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
807 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
808 |
(*------- lemmas -------*) |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
809 |
val [prem] = goal Arith.thy "n < Suc(m) ==> Suc(m)-n = Suc(m-n)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
810 |
by (rtac (prem RS rev_mp) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
811 |
by (res_inst_tac [("m","m"),("n","n")] diff_induct 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
812 |
by (ALLGOALS Asm_simp_tac); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
813 |
qed "Suc_diff_n"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
814 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
815 |
(* Goalw [real_of_nat_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
816 |
"real_of_nat (n1 - n2) = real_of_nat n1 + -real_of_nat n2";*) |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
817 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
818 |
Goal "n2 < n1 --> real_of_nat (n1 - n2) = real_of_nat n1 + (-real_of_nat n2)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
819 |
by (induct_tac "n1" 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
820 |
by (Step_tac 1 THEN dtac leI 1 THEN dtac sym 2); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
821 |
by (dtac lemma_nat_not_dense 1); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
822 |
by (auto_tac (claset(), |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
823 |
simpset() addsimps [real_of_nat_Suc, real_of_nat_zero] @ |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
824 |
real_add_ac)); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
825 |
by (asm_full_simp_tac (simpset() addsimps [real_of_nat_one RS sym, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
826 |
real_of_nat_add,Suc_diff_n]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
6162
diff
changeset
|
827 |
qed "real_of_nat_minus"; |
5588 | 828 |
|
829 |