author | paulson |
Wed, 13 Dec 2000 10:34:45 +0100 | |
changeset 10660 | a196b944569b |
parent 10648 | a8c647cfa31f |
child 10677 | 36625483213f |
permissions | -rw-r--r-- |
7334 | 1 |
(* Title: HOL/Real/Real.ML |
2 |
ID: $Id$ |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
3 |
Author: Jacques D. Fleuriot and Lawrence C. Paulson |
7334 | 4 |
Copyright: 1998 University of Cambridge |
5 |
Description: Type "real" is a linear order |
|
6 |
*) |
|
7 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
8 |
(**** The simproc abel_cancel ****) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
9 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
10 |
(*** Two lemmas needed for the simprocs ***) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
11 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
12 |
(*Deletion of other terms in the formula, seeking the -x at the front of z*) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
13 |
Goal "((x::real) + (y + z) = y + u) = ((x + z) = u)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
14 |
by (stac real_add_left_commute 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
15 |
by (rtac real_add_left_cancel 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
16 |
qed "real_add_cancel_21"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
17 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
18 |
(*A further rule to deal with the case that |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
19 |
everything gets cancelled on the right.*) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
20 |
Goal "((x::real) + (y + z) = y) = (x = -z)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
21 |
by (stac real_add_left_commute 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
22 |
by (res_inst_tac [("t", "y")] (real_add_zero_right RS subst) 1 |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
23 |
THEN stac real_add_left_cancel 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
24 |
by (simp_tac (simpset() addsimps [real_eq_diff_eq RS sym]) 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
25 |
qed "real_add_cancel_end"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
26 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
27 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
28 |
structure Real_Cancel_Data = |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
29 |
struct |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
30 |
val ss = HOL_ss |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
31 |
val eq_reflection = eq_reflection |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
32 |
|
9434 | 33 |
val sg_ref = Sign.self_ref (Theory.sign_of (the_context ())) |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
34 |
val T = HOLogic.realT |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
35 |
val zero = Const ("0", T) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
36 |
val restrict_to_left = restrict_to_left |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
37 |
val add_cancel_21 = real_add_cancel_21 |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
38 |
val add_cancel_end = real_add_cancel_end |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
39 |
val add_left_cancel = real_add_left_cancel |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
40 |
val add_assoc = real_add_assoc |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
41 |
val add_commute = real_add_commute |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
42 |
val add_left_commute = real_add_left_commute |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
43 |
val add_0 = real_add_zero_left |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
44 |
val add_0_right = real_add_zero_right |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
45 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
46 |
val eq_diff_eq = real_eq_diff_eq |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
47 |
val eqI_rules = [real_less_eqI, real_eq_eqI, real_le_eqI] |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
48 |
fun dest_eqI th = |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
49 |
#1 (HOLogic.dest_bin "op =" HOLogic.boolT |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
50 |
(HOLogic.dest_Trueprop (concl_of th))) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
51 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
52 |
val diff_def = real_diff_def |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
53 |
val minus_add_distrib = real_minus_add_distrib |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
54 |
val minus_minus = real_minus_minus |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
55 |
val minus_0 = real_minus_zero |
10606 | 56 |
val add_inverses = [real_add_minus, real_add_minus_left] |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
57 |
val cancel_simps = [real_add_minus_cancel, real_minus_add_cancel] |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
58 |
end; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
59 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
60 |
structure Real_Cancel = Abel_Cancel (Real_Cancel_Data); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
61 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
62 |
Addsimprocs [Real_Cancel.sum_conv, Real_Cancel.rel_conv]; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
63 |
|
9081 | 64 |
Goal "- (z - y) = y - (z::real)"; |
65 |
by (Simp_tac 1); |
|
66 |
qed "real_minus_diff_eq"; |
|
67 |
Addsimps [real_minus_diff_eq]; |
|
68 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
69 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
70 |
(**** Theorems about the ordering ****) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
71 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
72 |
Goal "(0 < x) = (EX y. x = real_of_preal y)"; |
7334 | 73 |
by (auto_tac (claset(), simpset() addsimps [real_of_preal_zero_less])); |
74 |
by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1); |
|
75 |
by (blast_tac (claset() addSEs [real_less_irrefl, |
|
76 |
real_of_preal_not_minus_gt_zero RS notE]) 1); |
|
77 |
qed "real_gt_zero_preal_Ex"; |
|
78 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
79 |
Goal "real_of_preal z < x ==> EX y. x = real_of_preal y"; |
7334 | 80 |
by (blast_tac (claset() addSDs [real_of_preal_zero_less RS real_less_trans] |
81 |
addIs [real_gt_zero_preal_Ex RS iffD1]) 1); |
|
82 |
qed "real_gt_preal_preal_Ex"; |
|
83 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
84 |
Goal "real_of_preal z <= x ==> EX y. x = real_of_preal y"; |
7334 | 85 |
by (blast_tac (claset() addDs [real_le_imp_less_or_eq, |
86 |
real_gt_preal_preal_Ex]) 1); |
|
87 |
qed "real_ge_preal_preal_Ex"; |
|
88 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
89 |
Goal "y <= 0 ==> ALL x. y < real_of_preal x"; |
7334 | 90 |
by (auto_tac (claset() addEs [real_le_imp_less_or_eq RS disjE] |
91 |
addIs [real_of_preal_zero_less RSN(2,real_less_trans)], |
|
92 |
simpset() addsimps [real_of_preal_zero_less])); |
|
93 |
qed "real_less_all_preal"; |
|
94 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
95 |
Goal "~ 0 < y ==> ALL x. y < real_of_preal x"; |
7334 | 96 |
by (blast_tac (claset() addSIs [real_less_all_preal,real_leI]) 1); |
97 |
qed "real_less_all_real2"; |
|
98 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
99 |
Goal "[| R + L = S; (0::real) < L |] ==> R < S"; |
7334 | 100 |
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1); |
101 |
by (auto_tac (claset(), simpset() addsimps real_add_ac)); |
|
102 |
qed "real_lemma_add_positive_imp_less"; |
|
103 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
104 |
Goal "EX T::real. 0 < T & R + T = S ==> R < S"; |
7334 | 105 |
by (blast_tac (claset() addIs [real_lemma_add_positive_imp_less]) 1); |
106 |
qed "real_ex_add_positive_left_less"; |
|
107 |
||
108 |
(*Alternative definition for real_less. NOT for rewriting*) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
109 |
Goal "(R < S) = (EX T::real. 0 < T & R + T = S)"; |
7334 | 110 |
by (blast_tac (claset() addSIs [real_less_add_positive_left_Ex, |
111 |
real_ex_add_positive_left_less]) 1); |
|
112 |
qed "real_less_iff_add"; |
|
113 |
||
114 |
Goal "(real_of_preal m1 <= real_of_preal m2) = (m1 <= m2)"; |
|
115 |
by (auto_tac (claset() addSIs [preal_leI], |
|
116 |
simpset() addsimps [real_less_le_iff RS sym])); |
|
117 |
by (dtac preal_le_less_trans 1 THEN assume_tac 1); |
|
118 |
by (etac preal_less_irrefl 1); |
|
119 |
qed "real_of_preal_le_iff"; |
|
120 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
121 |
Goal "[| 0 < x; 0 < y |] ==> (0::real) < x * y"; |
7334 | 122 |
by (auto_tac (claset(), simpset() addsimps [real_gt_zero_preal_Ex])); |
123 |
by (res_inst_tac [("x","y*ya")] exI 1); |
|
124 |
by (full_simp_tac (simpset() addsimps [real_of_preal_mult]) 1); |
|
125 |
qed "real_mult_order"; |
|
126 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
127 |
Goal "[| x < 0; y < 0 |] ==> (0::real) < x * y"; |
7334 | 128 |
by (REPEAT(dtac (real_minus_zero_less_iff RS iffD2) 1)); |
129 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
130 |
by (Asm_full_simp_tac 1); |
|
131 |
qed "real_mult_less_zero1"; |
|
132 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
133 |
Goal "[| 0 <= x; 0 <= y |] ==> (0::real) <= x * y"; |
7334 | 134 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
135 |
by (auto_tac (claset() addIs [real_mult_order, real_less_imp_le], |
|
136 |
simpset())); |
|
137 |
qed "real_le_mult_order"; |
|
138 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
139 |
Goal "[| 0 < x; 0 <= y |] ==> (0::real) <= x * y"; |
7334 | 140 |
by (dtac real_le_imp_less_or_eq 1); |
141 |
by (auto_tac (claset() addIs [real_mult_order, |
|
142 |
real_less_imp_le],simpset())); |
|
143 |
qed "real_less_le_mult_order"; |
|
144 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
145 |
Goal "[| x <= 0; y <= 0 |] ==> (0::real) <= x * y"; |
7334 | 146 |
by (rtac real_less_or_eq_imp_le 1); |
147 |
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1); |
|
148 |
by Auto_tac; |
|
149 |
by (dtac real_le_imp_less_or_eq 1); |
|
150 |
by (auto_tac (claset() addDs [real_mult_less_zero1],simpset())); |
|
151 |
qed "real_mult_le_zero1"; |
|
152 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
153 |
Goal "[| 0 <= x; y < 0 |] ==> x * y <= (0::real)"; |
7334 | 154 |
by (rtac real_less_or_eq_imp_le 1); |
155 |
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1); |
|
156 |
by Auto_tac; |
|
157 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
|
158 |
by (rtac (real_minus_zero_less_iff RS subst) 1); |
|
159 |
by (blast_tac (claset() addDs [real_mult_order] |
|
160 |
addIs [real_minus_mult_eq2 RS ssubst]) 1); |
|
161 |
qed "real_mult_le_zero"; |
|
162 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
163 |
Goal "[| 0 < x; y < 0 |] ==> x*y < (0::real)"; |
7334 | 164 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
165 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
166 |
by (rtac (real_minus_zero_less_iff RS iffD1) 1); |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
167 |
by (Asm_full_simp_tac 1); |
7334 | 168 |
qed "real_mult_less_zero"; |
169 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
170 |
Goalw [real_one_def] "0 < 1r"; |
7334 | 171 |
by (auto_tac (claset() addIs [real_gt_zero_preal_Ex RS iffD2], |
172 |
simpset() addsimps [real_of_preal_def])); |
|
173 |
qed "real_zero_less_one"; |
|
174 |
||
175 |
(*** Monotonicity results ***) |
|
176 |
||
177 |
Goal "(v+z < w+z) = (v < (w::real))"; |
|
178 |
by (Simp_tac 1); |
|
179 |
qed "real_add_right_cancel_less"; |
|
180 |
||
181 |
Goal "(z+v < z+w) = (v < (w::real))"; |
|
182 |
by (Simp_tac 1); |
|
183 |
qed "real_add_left_cancel_less"; |
|
184 |
||
185 |
Addsimps [real_add_right_cancel_less, real_add_left_cancel_less]; |
|
186 |
||
187 |
Goal "(v+z <= w+z) = (v <= (w::real))"; |
|
188 |
by (Simp_tac 1); |
|
189 |
qed "real_add_right_cancel_le"; |
|
190 |
||
191 |
Goal "(z+v <= z+w) = (v <= (w::real))"; |
|
192 |
by (Simp_tac 1); |
|
193 |
qed "real_add_left_cancel_le"; |
|
194 |
||
195 |
Addsimps [real_add_right_cancel_le, real_add_left_cancel_le]; |
|
196 |
||
197 |
(*"v<=w ==> v+z <= w+z"*) |
|
198 |
bind_thm ("real_add_less_mono1", real_add_right_cancel_less RS iffD2); |
|
199 |
||
200 |
(*"v<=w ==> v+z <= w+z"*) |
|
201 |
bind_thm ("real_add_le_mono1", real_add_right_cancel_le RS iffD2); |
|
202 |
||
203 |
Goal "!!z z'::real. [| w'<w; z'<=z |] ==> w' + z' < w + z"; |
|
204 |
by (etac (real_add_less_mono1 RS real_less_le_trans) 1); |
|
205 |
by (Simp_tac 1); |
|
206 |
qed "real_add_less_le_mono"; |
|
207 |
||
208 |
Goal "!!z z'::real. [| w'<=w; z'<z |] ==> w' + z' < w + z"; |
|
209 |
by (etac (real_add_le_mono1 RS real_le_less_trans) 1); |
|
210 |
by (Simp_tac 1); |
|
211 |
qed "real_add_le_less_mono"; |
|
212 |
||
213 |
Goal "!!(A::real). A < B ==> C + A < C + B"; |
|
214 |
by (Simp_tac 1); |
|
215 |
qed "real_add_less_mono2"; |
|
216 |
||
217 |
Goal "!!(A::real). A + C < B + C ==> A < B"; |
|
218 |
by (Full_simp_tac 1); |
|
219 |
qed "real_less_add_right_cancel"; |
|
220 |
||
221 |
Goal "!!(A::real). C + A < C + B ==> A < B"; |
|
222 |
by (Full_simp_tac 1); |
|
223 |
qed "real_less_add_left_cancel"; |
|
224 |
||
225 |
Goal "!!(A::real). A + C <= B + C ==> A <= B"; |
|
226 |
by (Full_simp_tac 1); |
|
227 |
qed "real_le_add_right_cancel"; |
|
228 |
||
229 |
Goal "!!(A::real). C + A <= C + B ==> A <= B"; |
|
230 |
by (Full_simp_tac 1); |
|
231 |
qed "real_le_add_left_cancel"; |
|
232 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
233 |
Goal "[| 0 < x; 0 < y |] ==> (0::real) < x + y"; |
7334 | 234 |
by (etac real_less_trans 1); |
235 |
by (dtac real_add_less_mono2 1); |
|
236 |
by (Full_simp_tac 1); |
|
237 |
qed "real_add_order"; |
|
238 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
239 |
Goal "[| 0 <= x; 0 <= y |] ==> (0::real) <= x + y"; |
7334 | 240 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
241 |
by (auto_tac (claset() addIs [real_add_order, real_less_imp_le], |
|
242 |
simpset())); |
|
243 |
qed "real_le_add_order"; |
|
244 |
||
245 |
Goal "[| R1 < S1; R2 < S2 |] ==> R1 + R2 < S1 + (S2::real)"; |
|
246 |
by (dtac real_add_less_mono1 1); |
|
247 |
by (etac real_less_trans 1); |
|
248 |
by (etac real_add_less_mono2 1); |
|
249 |
qed "real_add_less_mono"; |
|
250 |
||
251 |
Goal "!!(q1::real). q1 <= q2 ==> x + q1 <= x + q2"; |
|
252 |
by (Simp_tac 1); |
|
253 |
qed "real_add_left_le_mono1"; |
|
254 |
||
255 |
Goal "[|i<=j; k<=l |] ==> i + k <= j + (l::real)"; |
|
256 |
by (dtac real_add_le_mono1 1); |
|
257 |
by (etac real_le_trans 1); |
|
258 |
by (Simp_tac 1); |
|
259 |
qed "real_add_le_mono"; |
|
260 |
||
261 |
Goal "EX (x::real). x < y"; |
|
262 |
by (rtac (real_add_zero_right RS subst) 1); |
|
263 |
by (res_inst_tac [("x","y + (-1r)")] exI 1); |
|
264 |
by (auto_tac (claset() addSIs [real_add_less_mono2], |
|
265 |
simpset() addsimps [real_minus_zero_less_iff2, real_zero_less_one])); |
|
266 |
qed "real_less_Ex"; |
|
267 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
268 |
Goal "(0::real) < r ==> u + (-r) < u"; |
7334 | 269 |
by (res_inst_tac [("C","r")] real_less_add_right_cancel 1); |
270 |
by (simp_tac (simpset() addsimps [real_add_assoc]) 1); |
|
271 |
qed "real_add_minus_positive_less_self"; |
|
272 |
||
273 |
Goal "((r::real) <= s) = (-s <= -r)"; |
|
274 |
by (Step_tac 1); |
|
275 |
by (dres_inst_tac [("x","-s")] real_add_left_le_mono1 1); |
|
276 |
by (dres_inst_tac [("x","r")] real_add_left_le_mono1 2); |
|
277 |
by Auto_tac; |
|
278 |
by (dres_inst_tac [("z","-r")] real_add_le_mono1 1); |
|
279 |
by (dres_inst_tac [("z","s")] real_add_le_mono1 2); |
|
280 |
by (auto_tac (claset(), simpset() addsimps [real_add_assoc])); |
|
281 |
qed "real_le_minus_iff"; |
|
282 |
Addsimps [real_le_minus_iff RS sym]; |
|
283 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
284 |
Goal "0 <= 1r"; |
7334 | 285 |
by (rtac (real_zero_less_one RS real_less_imp_le) 1); |
286 |
qed "real_zero_le_one"; |
|
287 |
Addsimps [real_zero_le_one]; |
|
288 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
289 |
Goal "(0::real) <= x*x"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
290 |
by (res_inst_tac [("R2.0","0"),("R1.0","x")] real_linear_less2 1); |
7334 | 291 |
by (auto_tac (claset() addIs [real_mult_order, |
292 |
real_mult_less_zero1,real_less_imp_le], |
|
293 |
simpset())); |
|
294 |
qed "real_le_square"; |
|
295 |
Addsimps [real_le_square]; |
|
296 |
||
297 |
(*---------------------------------------------------------------------------- |
|
298 |
An embedding of the naturals in the reals |
|
299 |
----------------------------------------------------------------------------*) |
|
300 |
||
301 |
Goalw [real_of_posnat_def] "real_of_posnat 0 = 1r"; |
|
302 |
by (full_simp_tac (simpset() addsimps [pnat_one_iff RS sym,real_of_preal_def]) 1); |
|
303 |
by (fold_tac [real_one_def]); |
|
304 |
by (rtac refl 1); |
|
305 |
qed "real_of_posnat_one"; |
|
306 |
||
307 |
Goalw [real_of_posnat_def] "real_of_posnat 1 = 1r + 1r"; |
|
308 |
by (full_simp_tac (simpset() addsimps [real_of_preal_def,real_one_def, |
|
309 |
pnat_two_eq,real_add,prat_of_pnat_add RS sym,preal_of_prat_add RS sym |
|
310 |
] @ pnat_add_ac) 1); |
|
311 |
qed "real_of_posnat_two"; |
|
312 |
||
313 |
Goalw [real_of_posnat_def] |
|
314 |
"real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + 1r"; |
|
315 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_one RS sym, |
|
316 |
real_of_posnat_def,real_of_preal_add RS sym,preal_of_prat_add RS sym, |
|
317 |
prat_of_pnat_add RS sym,pnat_of_nat_add]) 1); |
|
318 |
qed "real_of_posnat_add"; |
|
319 |
||
320 |
Goal "real_of_posnat (n + 1) = real_of_posnat n + 1r"; |
|
321 |
by (res_inst_tac [("x1","1r")] (real_add_right_cancel RS iffD1) 1); |
|
322 |
by (rtac (real_of_posnat_add RS subst) 1); |
|
323 |
by (full_simp_tac (simpset() addsimps [real_of_posnat_two,real_add_assoc]) 1); |
|
324 |
qed "real_of_posnat_add_one"; |
|
325 |
||
326 |
Goal "real_of_posnat (Suc n) = real_of_posnat n + 1r"; |
|
327 |
by (stac (real_of_posnat_add_one RS sym) 1); |
|
328 |
by (Simp_tac 1); |
|
329 |
qed "real_of_posnat_Suc"; |
|
330 |
||
331 |
Goal "inj(real_of_posnat)"; |
|
332 |
by (rtac injI 1); |
|
333 |
by (rewtac real_of_posnat_def); |
|
334 |
by (dtac (inj_real_of_preal RS injD) 1); |
|
335 |
by (dtac (inj_preal_of_prat RS injD) 1); |
|
336 |
by (dtac (inj_prat_of_pnat RS injD) 1); |
|
337 |
by (etac (inj_pnat_of_nat RS injD) 1); |
|
338 |
qed "inj_real_of_posnat"; |
|
339 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
340 |
Goalw [real_of_posnat_def] "0 < real_of_posnat n"; |
7334 | 341 |
by (rtac (real_gt_zero_preal_Ex RS iffD2) 1); |
342 |
by (Blast_tac 1); |
|
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
343 |
qed "real_of_posnat_gt_zero"; |
7334 | 344 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
345 |
Goal "real_of_posnat n ~= 0"; |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
346 |
by (rtac (real_of_posnat_gt_zero RS real_not_refl2 RS not_sym) 1); |
7334 | 347 |
qed "real_of_posnat_not_eq_zero"; |
348 |
Addsimps[real_of_posnat_not_eq_zero]; |
|
349 |
||
350 |
Goal "1r <= real_of_posnat n"; |
|
351 |
by (simp_tac (simpset() addsimps [real_of_posnat_one RS sym]) 1); |
|
352 |
by (induct_tac "n" 1); |
|
353 |
by (auto_tac (claset(), |
|
354 |
simpset () addsimps [real_of_posnat_Suc,real_of_posnat_one, |
|
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
355 |
real_of_posnat_gt_zero, real_less_imp_le])); |
7334 | 356 |
qed "real_of_posnat_less_one"; |
357 |
Addsimps [real_of_posnat_less_one]; |
|
358 |
||
10606 | 359 |
Goal "inverse (real_of_posnat n) ~= 0"; |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
360 |
by (rtac ((real_of_posnat_gt_zero RS |
10606 | 361 |
real_not_refl2 RS not_sym) RS real_inverse_not_zero) 1); |
362 |
qed "real_of_posnat_inverse_not_zero"; |
|
363 |
Addsimps [real_of_posnat_inverse_not_zero]; |
|
7334 | 364 |
|
10606 | 365 |
Goal "inverse (real_of_posnat x) = inverse (real_of_posnat y) ==> x = y"; |
7334 | 366 |
by (rtac (inj_real_of_posnat RS injD) 1); |
367 |
by (res_inst_tac [("n2","x")] |
|
10606 | 368 |
(real_of_posnat_inverse_not_zero RS real_mult_left_cancel RS iffD1) 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
369 |
by (full_simp_tac (simpset() addsimps [(real_of_posnat_gt_zero RS |
7334 | 370 |
real_not_refl2 RS not_sym) RS real_mult_inv_left]) 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
371 |
by (asm_full_simp_tac (simpset() addsimps [(real_of_posnat_gt_zero RS |
7334 | 372 |
real_not_refl2 RS not_sym)]) 1); |
10606 | 373 |
qed "real_of_posnat_inverse_inj"; |
7334 | 374 |
|
10606 | 375 |
Goal "0 < x ==> 0 < inverse (x::real)"; |
7334 | 376 |
by (EVERY1[rtac ccontr, dtac real_leI]); |
377 |
by (forward_tac [real_minus_zero_less_iff2 RS iffD2] 1); |
|
378 |
by (forward_tac [real_not_refl2 RS not_sym] 1); |
|
10606 | 379 |
by (dtac (real_not_refl2 RS not_sym RS real_inverse_not_zero) 1); |
7334 | 380 |
by (EVERY1[dtac real_le_imp_less_or_eq, Step_tac]); |
381 |
by (dtac real_mult_less_zero1 1 THEN assume_tac 1); |
|
382 |
by (auto_tac (claset() addIs [real_zero_less_one RS real_less_asym], |
|
9053 | 383 |
simpset())); |
10606 | 384 |
qed "real_inverse_gt_zero"; |
7334 | 385 |
|
10606 | 386 |
Goal "x < 0 ==> inverse (x::real) < 0"; |
7499 | 387 |
by (ftac real_not_refl2 1); |
7334 | 388 |
by (dtac (real_minus_zero_less_iff RS iffD2) 1); |
389 |
by (rtac (real_minus_zero_less_iff RS iffD1) 1); |
|
10648 | 390 |
by (stac (real_minus_inverse RS sym) 1); |
10606 | 391 |
by (auto_tac (claset() addIs [real_inverse_gt_zero], simpset())); |
392 |
qed "real_inverse_less_zero"; |
|
7334 | 393 |
|
10606 | 394 |
Goal "0 < inverse (real_of_posnat n)"; |
395 |
by (rtac (real_of_posnat_gt_zero RS real_inverse_gt_zero) 1); |
|
396 |
qed "real_of_posnat_inverse_gt_zero"; |
|
397 |
Addsimps [real_of_posnat_inverse_gt_zero]; |
|
7334 | 398 |
|
10043 | 399 |
Goal "real_of_preal (preal_of_prat (prat_of_pnat (pnat_of_nat N))) = \ |
400 |
\ real_of_nat (Suc N)"; |
|
401 |
by (simp_tac (simpset() addsimps [real_of_nat_def,real_of_posnat_Suc, |
|
402 |
real_add_assoc,(real_of_posnat_def RS meta_eq_to_obj_eq) RS sym]) 1); |
|
403 |
qed "real_of_preal_real_of_nat_Suc"; |
|
404 |
||
7334 | 405 |
Goal "x+x = x*(1r+1r)"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
406 |
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1); |
7334 | 407 |
qed "real_add_self"; |
408 |
||
409 |
Goal "x < x + 1r"; |
|
410 |
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1); |
|
411 |
by (full_simp_tac (simpset() addsimps [real_zero_less_one, |
|
412 |
real_add_assoc, real_add_left_commute]) 1); |
|
413 |
qed "real_self_less_add_one"; |
|
414 |
||
415 |
Goal "1r < 1r + 1r"; |
|
416 |
by (rtac real_self_less_add_one 1); |
|
417 |
qed "real_one_less_two"; |
|
418 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
419 |
Goal "0 < 1r + 1r"; |
7334 | 420 |
by (rtac ([real_zero_less_one, |
421 |
real_one_less_two] MRS real_less_trans) 1); |
|
422 |
qed "real_zero_less_two"; |
|
423 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
424 |
Goal "1r + 1r ~= 0"; |
7334 | 425 |
by (rtac (real_zero_less_two RS real_not_refl2 RS not_sym) 1); |
426 |
qed "real_two_not_zero"; |
|
427 |
||
428 |
Addsimps [real_two_not_zero]; |
|
429 |
||
10606 | 430 |
Goal "x * inverse (1r + 1r) + x * inverse(1r + 1r) = x"; |
7334 | 431 |
by (stac real_add_self 1); |
432 |
by (full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
433 |
qed "real_sum_of_halves"; |
|
434 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
435 |
Goal "[| (0::real) < z; x < y |] ==> x*z < y*z"; |
7334 | 436 |
by (rotate_tac 1 1); |
437 |
by (dtac real_less_sum_gt_zero 1); |
|
438 |
by (rtac real_sum_gt_zero_less 1); |
|
439 |
by (dtac real_mult_order 1 THEN assume_tac 1); |
|
440 |
by (asm_full_simp_tac (simpset() addsimps [real_add_mult_distrib2, |
|
9053 | 441 |
real_mult_commute ]) 1); |
7334 | 442 |
qed "real_mult_less_mono1"; |
443 |
||
10606 | 444 |
Goal "[| (0::real) < z; x < y |] ==> z * x < z * y"; |
7334 | 445 |
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_less_mono1]) 1); |
446 |
qed "real_mult_less_mono2"; |
|
447 |
||
10606 | 448 |
Goal "[| (0::real) < z; x * z < y * z |] ==> x < y"; |
449 |
by (forw_inst_tac [("x","x*z")] (real_inverse_gt_zero |
|
7334 | 450 |
RS real_mult_less_mono1) 1); |
451 |
by (auto_tac (claset(), |
|
452 |
simpset() addsimps |
|
453 |
[real_mult_assoc,real_not_refl2 RS not_sym])); |
|
454 |
qed "real_mult_less_cancel1"; |
|
455 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
456 |
Goal "[| (0::real) < z; z*x < z*y |] ==> x < y"; |
7334 | 457 |
by (etac real_mult_less_cancel1 1); |
458 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_commute]) 1); |
|
459 |
qed "real_mult_less_cancel2"; |
|
460 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
461 |
Goal "(0::real) < z ==> (x*z < y*z) = (x < y)"; |
7334 | 462 |
by (blast_tac (claset() addIs [real_mult_less_mono1, |
463 |
real_mult_less_cancel1]) 1); |
|
464 |
qed "real_mult_less_iff1"; |
|
465 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
466 |
Goal "(0::real) < z ==> (z*x < z*y) = (x < y)"; |
7334 | 467 |
by (blast_tac (claset() addIs [real_mult_less_mono2, |
468 |
real_mult_less_cancel2]) 1); |
|
469 |
qed "real_mult_less_iff2"; |
|
470 |
||
471 |
Addsimps [real_mult_less_iff1,real_mult_less_iff2]; |
|
472 |
||
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
473 |
(* 05/00 *) |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
474 |
Goalw [real_le_def] "(0::real) < z ==> (x*z <= y*z) = (x <= y)"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
475 |
by (Auto_tac); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
476 |
qed "real_mult_le_cancel_iff1"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
477 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
478 |
Goalw [real_le_def] "(0::real) < z ==> (z*x <= z*y) = (x <= y)"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
479 |
by (Auto_tac); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
480 |
qed "real_mult_le_cancel_iff2"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
481 |
|
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
482 |
Addsimps [real_mult_le_cancel_iff1,real_mult_le_cancel_iff2]; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
483 |
|
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
484 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
485 |
Goal "[| (0::real) <= z; x < y |] ==> x*z <= y*z"; |
7334 | 486 |
by (EVERY1 [rtac real_less_or_eq_imp_le, dtac real_le_imp_less_or_eq]); |
487 |
by (auto_tac (claset() addIs [real_mult_less_mono1],simpset())); |
|
488 |
qed "real_mult_le_less_mono1"; |
|
489 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
490 |
Goal "[| (0::real) <= z; x < y |] ==> z*x <= z*y"; |
7334 | 491 |
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_le_less_mono1]) 1); |
492 |
qed "real_mult_le_less_mono2"; |
|
493 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
494 |
Goal "[| (0::real) <= z; x <= y |] ==> z*x <= z*y"; |
7334 | 495 |
by (dres_inst_tac [("x","x")] real_le_imp_less_or_eq 1); |
496 |
by (auto_tac (claset() addIs [real_mult_le_less_mono2], simpset())); |
|
497 |
qed "real_mult_le_le_mono1"; |
|
498 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
499 |
Goal "[| (0::real) < r1; r1 < r2; 0 < x; x < y|] ==> r1 * x < r2 * y"; |
7334 | 500 |
by (dres_inst_tac [("x","x")] real_mult_less_mono2 1); |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
501 |
by (dres_inst_tac [("R1.0","0")] real_less_trans 2); |
7334 | 502 |
by (dres_inst_tac [("x","r1")] real_mult_less_mono1 3); |
503 |
by Auto_tac; |
|
504 |
by (blast_tac (claset() addIs [real_less_trans]) 1); |
|
505 |
qed "real_mult_less_mono"; |
|
506 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
507 |
Goal "[| (0::real) < r1; r1 < r2; 0 < y|] ==> 0 < r2 * y"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
508 |
by (rtac real_mult_order 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
509 |
by (assume_tac 2); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
510 |
by (blast_tac (claset() addIs [real_less_trans]) 1); |
7334 | 511 |
qed "real_mult_order_trans"; |
512 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
513 |
Goal "[| (0::real) < r1; r1 < r2; 0 <= x; x < y|] ==> r1 * x < r2 * y"; |
7334 | 514 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
515 |
addIs [real_mult_less_mono,real_mult_order_trans], |
|
516 |
simpset())); |
|
517 |
qed "real_mult_less_mono3"; |
|
518 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
519 |
Goal "[| (0::real) <= r1; r1 < r2; 0 <= x; x < y|] ==> r1 * x < r2 * y"; |
7334 | 520 |
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] |
521 |
addIs [real_mult_less_mono,real_mult_order_trans, |
|
522 |
real_mult_order], |
|
523 |
simpset())); |
|
524 |
by (dres_inst_tac [("R2.0","x")] real_less_trans 1); |
|
525 |
by (assume_tac 1); |
|
526 |
by (blast_tac (claset() addIs [real_mult_order]) 1); |
|
527 |
qed "real_mult_less_mono4"; |
|
528 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
529 |
Goal "[| (0::real) < r1; r1 <= r2; 0 <= x; x <= y |] ==> r1 * x <= r2 * y"; |
7334 | 530 |
by (rtac real_less_or_eq_imp_le 1); |
531 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
|
532 |
by (auto_tac (claset() addIs [real_mult_less_mono, |
|
533 |
real_mult_order_trans,real_mult_order], |
|
534 |
simpset())); |
|
535 |
qed "real_mult_le_mono"; |
|
536 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
537 |
Goal "[| (0::real) < r1; r1 < r2; 0 <= x; x <= y |] ==> r1 * x <= r2 * y"; |
7334 | 538 |
by (rtac real_less_or_eq_imp_le 1); |
539 |
by (REPEAT(dtac real_le_imp_less_or_eq 1)); |
|
540 |
by (auto_tac (claset() addIs [real_mult_less_mono, real_mult_order_trans, |
|
541 |
real_mult_order], |
|
542 |
simpset())); |
|
543 |
qed "real_mult_le_mono2"; |
|
544 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
545 |
Goal "[| (0::real) <= r1; r1 < r2; 0 <= x; x <= y |] ==> r1 * x <= r2 * y"; |
7334 | 546 |
by (dtac real_le_imp_less_or_eq 1); |
547 |
by (auto_tac (claset() addIs [real_mult_le_mono2],simpset())); |
|
548 |
by (dtac real_le_trans 1 THEN assume_tac 1); |
|
549 |
by (auto_tac (claset() addIs [real_less_le_mult_order], simpset())); |
|
550 |
qed "real_mult_le_mono3"; |
|
551 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
552 |
Goal "[| (0::real) <= r1; r1 <= r2; 0 <= x; x <= y |] ==> r1 * x <= r2 * y"; |
7334 | 553 |
by (dres_inst_tac [("x","r1")] real_le_imp_less_or_eq 1); |
554 |
by (auto_tac (claset() addIs [real_mult_le_mono3, real_mult_le_le_mono1], |
|
555 |
simpset())); |
|
556 |
qed "real_mult_le_mono4"; |
|
557 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
558 |
Goal "1r <= x ==> 0 < x"; |
7334 | 559 |
by (rtac ccontr 1 THEN dtac real_leI 1); |
560 |
by (dtac real_le_trans 1 THEN assume_tac 1); |
|
561 |
by (auto_tac (claset() addDs [real_zero_less_one RSN (2,real_le_less_trans)], |
|
562 |
simpset() addsimps [real_less_not_refl])); |
|
563 |
qed "real_gt_zero"; |
|
564 |
||
565 |
Goal "[| 1r < r; 1r <= x |] ==> x <= r * x"; |
|
566 |
by (dtac (real_gt_zero RS real_less_imp_le) 1); |
|
567 |
by (auto_tac (claset() addSDs [real_mult_le_less_mono1], |
|
568 |
simpset())); |
|
569 |
qed "real_mult_self_le"; |
|
570 |
||
571 |
Goal "[| 1r <= r; 1r <= x |] ==> x <= r * x"; |
|
572 |
by (dtac real_le_imp_less_or_eq 1); |
|
573 |
by (auto_tac (claset() addIs [real_mult_self_le], |
|
574 |
simpset() addsimps [real_le_refl])); |
|
575 |
qed "real_mult_self_le2"; |
|
576 |
||
10606 | 577 |
Goal "x < y ==> x < (x + y) * inverse (1r + 1r)"; |
7334 | 578 |
by (dres_inst_tac [("C","x")] real_add_less_mono2 1); |
579 |
by (dtac (real_add_self RS subst) 1); |
|
10606 | 580 |
by (dtac (real_zero_less_two RS real_inverse_gt_zero RS |
7334 | 581 |
real_mult_less_mono1) 1); |
582 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
583 |
qed "real_less_half_sum"; |
|
584 |
||
10606 | 585 |
Goal "x < y ==> (x + y) * inverse (1r + 1r) < y"; |
7334 | 586 |
by (dtac real_add_less_mono1 1); |
587 |
by (dtac (real_add_self RS subst) 1); |
|
10606 | 588 |
by (dtac (real_zero_less_two RS real_inverse_gt_zero RS |
7334 | 589 |
real_mult_less_mono1) 1); |
590 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1); |
|
591 |
qed "real_gt_half_sum"; |
|
592 |
||
593 |
Goal "x < y ==> EX r::real. x < r & r < y"; |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
594 |
by (blast_tac (claset() addSIs [real_less_half_sum, real_gt_half_sum]) 1); |
7334 | 595 |
qed "real_dense"; |
596 |
||
10606 | 597 |
Goal "(EX n. inverse (real_of_posnat n) < r) = (EX n. 1r < r * real_of_posnat n)"; |
7334 | 598 |
by (Step_tac 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
599 |
by (dres_inst_tac [("n1","n")] (real_of_posnat_gt_zero |
7334 | 600 |
RS real_mult_less_mono1) 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
601 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS |
10606 | 602 |
real_inverse_gt_zero RS real_mult_less_mono1) 2); |
7334 | 603 |
by (auto_tac (claset(), |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
604 |
simpset() addsimps [(real_of_posnat_gt_zero RS |
7334 | 605 |
real_not_refl2 RS not_sym), |
606 |
real_mult_assoc])); |
|
10606 | 607 |
qed "real_of_posnat_inverse_Ex_iff"; |
7334 | 608 |
|
10606 | 609 |
Goal "(inverse(real_of_posnat n) < r) = (1r < r * real_of_posnat n)"; |
7334 | 610 |
by (Step_tac 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
611 |
by (dres_inst_tac [("n1","n")] (real_of_posnat_gt_zero |
7334 | 612 |
RS real_mult_less_mono1) 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
613 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS |
10606 | 614 |
real_inverse_gt_zero RS real_mult_less_mono1) 2); |
7334 | 615 |
by (auto_tac (claset(), simpset() addsimps [real_mult_assoc])); |
10606 | 616 |
qed "real_of_posnat_inverse_iff"; |
7334 | 617 |
|
10606 | 618 |
Goal "(inverse (real_of_posnat n) <= r) = (1r <= r * real_of_posnat n)"; |
7334 | 619 |
by (Step_tac 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
620 |
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS |
7334 | 621 |
real_less_imp_le RS real_mult_le_le_mono1) 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
622 |
by (dres_inst_tac [("n3","n")] (real_of_posnat_gt_zero RS |
10606 | 623 |
real_inverse_gt_zero RS real_less_imp_le RS |
7334 | 624 |
real_mult_le_le_mono1) 2); |
625 |
by (auto_tac (claset(), simpset() addsimps real_mult_ac)); |
|
10606 | 626 |
qed "real_of_posnat_inverse_le_iff"; |
7334 | 627 |
|
628 |
Goalw [real_of_posnat_def] "(real_of_posnat n < real_of_posnat m) = (n < m)"; |
|
629 |
by Auto_tac; |
|
630 |
qed "real_of_posnat_less_iff"; |
|
631 |
||
632 |
Addsimps [real_of_posnat_less_iff]; |
|
633 |
||
10606 | 634 |
Goal "0 < u ==> (u < inverse (real_of_posnat n)) = (real_of_posnat n < inverse u)"; |
7334 | 635 |
by (Step_tac 1); |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
636 |
by (res_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS |
10606 | 637 |
real_inverse_gt_zero RS real_mult_less_cancel1) 1); |
638 |
by (res_inst_tac [("x1","u")] ( real_inverse_gt_zero |
|
7334 | 639 |
RS real_mult_less_cancel1) 2); |
640 |
by (auto_tac (claset(), |
|
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
641 |
simpset() addsimps [real_of_posnat_gt_zero, |
7334 | 642 |
real_not_refl2 RS not_sym])); |
643 |
by (res_inst_tac [("z","u")] real_mult_less_cancel2 1); |
|
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
644 |
by (res_inst_tac [("n1","n")] (real_of_posnat_gt_zero RS |
7334 | 645 |
real_mult_less_cancel2) 3); |
646 |
by (auto_tac (claset(), |
|
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
647 |
simpset() addsimps [real_of_posnat_gt_zero, |
7334 | 648 |
real_not_refl2 RS not_sym,real_mult_assoc RS sym])); |
10606 | 649 |
qed "real_of_posnat_less_inverse_iff"; |
7334 | 650 |
|
10606 | 651 |
Goal "0 < u ==> (u = inverse (real_of_posnat n)) = (real_of_posnat n = inverse u)"; |
7334 | 652 |
by (auto_tac (claset(), |
10606 | 653 |
simpset() addsimps [real_inverse_inverse, real_of_posnat_gt_zero, |
9825
a0fcf6f0436c
Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents:
9434
diff
changeset
|
654 |
real_not_refl2 RS not_sym])); |
10606 | 655 |
qed "real_of_posnat_inverse_eq_iff"; |
7334 | 656 |
|
10606 | 657 |
Goal "[| 0 < r; r < x |] ==> inverse x < inverse (r::real)"; |
7499 | 658 |
by (ftac real_less_trans 1 THEN assume_tac 1); |
10606 | 659 |
by (ftac real_inverse_gt_zero 1); |
660 |
by (forw_inst_tac [("x","x")] real_inverse_gt_zero 1); |
|
661 |
by (forw_inst_tac [("x","r"),("z","inverse r")] real_mult_less_mono1 1); |
|
7334 | 662 |
by (assume_tac 1); |
663 |
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS |
|
664 |
not_sym RS real_mult_inv_right]) 1); |
|
10606 | 665 |
by (ftac real_inverse_gt_zero 1); |
666 |
by (forw_inst_tac [("x","1r"),("z","inverse x")] real_mult_less_mono2 1); |
|
7334 | 667 |
by (assume_tac 1); |
668 |
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS |
|
669 |
not_sym RS real_mult_inv_left,real_mult_assoc RS sym]) 1); |
|
10606 | 670 |
qed "real_inverse_less_swap"; |
7334 | 671 |
|
10606 | 672 |
Goal "r < r + inverse (real_of_posnat n)"; |
7334 | 673 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
674 |
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
|
10606 | 675 |
qed "real_add_inverse_real_of_posnat_less"; |
676 |
Addsimps [real_add_inverse_real_of_posnat_less]; |
|
7334 | 677 |
|
10606 | 678 |
Goal "r <= r + inverse (real_of_posnat n)"; |
7334 | 679 |
by (rtac real_less_imp_le 1); |
680 |
by (Simp_tac 1); |
|
10606 | 681 |
qed "real_add_inverse_real_of_posnat_le"; |
682 |
Addsimps [real_add_inverse_real_of_posnat_le]; |
|
7334 | 683 |
|
10606 | 684 |
Goal "r + (-inverse (real_of_posnat n)) < r"; |
7334 | 685 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
686 |
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym, |
|
687 |
real_minus_zero_less_iff2]) 1); |
|
10606 | 688 |
qed "real_add_minus_inverse_real_of_posnat_less"; |
689 |
Addsimps [real_add_minus_inverse_real_of_posnat_less]; |
|
7334 | 690 |
|
10606 | 691 |
Goal "r + (-inverse (real_of_posnat n)) <= r"; |
7334 | 692 |
by (rtac real_less_imp_le 1); |
693 |
by (Simp_tac 1); |
|
10606 | 694 |
qed "real_add_minus_inverse_real_of_posnat_le"; |
695 |
Addsimps [real_add_minus_inverse_real_of_posnat_le]; |
|
7334 | 696 |
|
10606 | 697 |
Goal "0 < r ==> r*(1r + (-inverse (real_of_posnat n))) < r"; |
7334 | 698 |
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1); |
699 |
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1); |
|
700 |
by (auto_tac (claset() addIs [real_mult_order], |
|
701 |
simpset() addsimps [real_add_assoc RS sym, |
|
702 |
real_minus_zero_less_iff2])); |
|
703 |
qed "real_mult_less_self"; |
|
704 |
||
10606 | 705 |
Goal "0 <= 1r + (-inverse (real_of_posnat n))"; |
706 |
by (res_inst_tac [("C","inverse (real_of_posnat n)")] real_le_add_right_cancel 1); |
|
7334 | 707 |
by (simp_tac (simpset() addsimps [real_add_assoc, |
10606 | 708 |
real_of_posnat_inverse_le_iff]) 1); |
709 |
qed "real_add_one_minus_inverse_ge_zero"; |
|
7334 | 710 |
|
10606 | 711 |
Goal "0 < r ==> 0 <= r*(1r + (-inverse (real_of_posnat n)))"; |
712 |
by (dtac (real_add_one_minus_inverse_ge_zero RS real_mult_le_less_mono1) 1); |
|
7334 | 713 |
by Auto_tac; |
714 |
qed "real_mult_add_one_minus_ge_zero"; |
|
715 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
716 |
Goal "(x*y = 0) = (x = 0 | y = (0::real))"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
717 |
by Auto_tac; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
718 |
by (blast_tac (claset() addIs [ccontr] addDs [real_mult_not_zero]) 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
719 |
qed "real_mult_is_0"; |
7334 | 720 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
721 |
Goal "(0 = x*y) = (0 = x | (0::real) = y)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
722 |
by (stac eq_commute 1 THEN stac real_mult_is_0 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
723 |
by Auto_tac; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
724 |
qed "real_0_is_mult"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
725 |
AddIffs [real_mult_is_0, real_0_is_mult]; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
726 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
727 |
Goal "[| x ~= 1r; y * x = y |] ==> y = 0"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
728 |
by (subgoal_tac "y*(1r + -x) = 0" 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
729 |
by (stac real_add_mult_distrib2 2); |
7334 | 730 |
by (auto_tac (claset(), |
731 |
simpset() addsimps [real_eq_minus_iff2 RS sym])); |
|
732 |
qed "real_mult_eq_self_zero"; |
|
733 |
Addsimps [real_mult_eq_self_zero]; |
|
734 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
735 |
Goal "[| x ~= 1r; y = y * x |] ==> y = 0"; |
7334 | 736 |
by (dtac sym 1); |
737 |
by (Asm_full_simp_tac 1); |
|
738 |
qed "real_mult_eq_self_zero2"; |
|
739 |
Addsimps [real_mult_eq_self_zero2]; |
|
740 |
||
10606 | 741 |
Goal "[| 0 <= x * y; 0 < x |] ==> (0::real) <= y"; |
742 |
by (ftac real_inverse_gt_zero 1); |
|
743 |
by (dres_inst_tac [("x","inverse x")] real_less_le_mult_order 1); |
|
7334 | 744 |
by (dtac (real_not_refl2 RS not_sym RS real_mult_inv_left) 2); |
745 |
by (auto_tac (claset(), |
|
746 |
simpset() addsimps [real_mult_assoc RS sym])); |
|
747 |
qed "real_mult_ge_zero_cancel"; |
|
748 |
||
10606 | 749 |
Goal "[|x ~= 0; y ~= 0 |] ==> inverse x + inverse y = (x + y) * inverse (x * (y::real))"; |
7334 | 750 |
by (asm_full_simp_tac (simpset() addsimps |
10606 | 751 |
[real_inverse_distrib,real_add_mult_distrib, |
7334 | 752 |
real_mult_assoc RS sym]) 1); |
753 |
by (stac real_mult_assoc 1); |
|
754 |
by (rtac (real_mult_left_commute RS subst) 1); |
|
755 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
|
10606 | 756 |
qed "real_inverse_add"; |
7334 | 757 |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
758 |
(* 05/00 *) |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
759 |
Goal "(0 <= -R) = (R <= (0::real))"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
760 |
by (auto_tac (claset() addDs [sym], |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
761 |
simpset() addsimps [real_le_less])); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
762 |
qed "real_minus_zero_le_iff"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
763 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
764 |
Goal "(-R <= 0) = ((0::real) <= R)"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
765 |
by (auto_tac (claset(),simpset() addsimps |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
766 |
[real_minus_zero_less_iff2,real_le_less])); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
767 |
qed "real_minus_zero_le_iff2"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
768 |
|
9053 | 769 |
Addsimps [real_minus_zero_le_iff, real_minus_zero_le_iff2]; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
770 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
771 |
Goal "x * x + y * y = 0 ==> x = (0::real)"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
772 |
by (dtac real_add_minus_eq_minus 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
773 |
by (cut_inst_tac [("x","x")] real_le_square 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
774 |
by (Auto_tac THEN dtac real_le_anti_sym 1); |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
775 |
by Auto_tac; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
776 |
qed "real_sum_squares_cancel"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
777 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
778 |
Goal "x * x + y * y = 0 ==> y = (0::real)"; |
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
779 |
by (res_inst_tac [("y","x")] real_sum_squares_cancel 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
780 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
781 |
qed "real_sum_squares_cancel2"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
782 |
|
7334 | 783 |
(*---------------------------------------------------------------------------- |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
784 |
Some convenient biconditionals for products of signs (lcp) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
785 |
----------------------------------------------------------------------------*) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
786 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
787 |
Goal "((0::real) < x*y) = (0 < x & 0 < y | x < 0 & y < 0)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
788 |
by (auto_tac (claset(), |
9069 | 789 |
simpset() addsimps [order_le_less, linorder_not_less, |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
790 |
real_mult_order, real_mult_less_zero1])); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
791 |
by (ALLGOALS (rtac ccontr)); |
9069 | 792 |
by (auto_tac (claset(), simpset() addsimps [order_le_less, linorder_not_less])); |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
793 |
by (ALLGOALS (etac rev_mp)); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
794 |
by (ALLGOALS (dtac real_mult_less_zero THEN' assume_tac)); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
795 |
by (auto_tac (claset() addDs [order_less_not_sym], |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
796 |
simpset() addsimps [real_mult_commute])); |
9069 | 797 |
qed "real_zero_less_mult_iff"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
798 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
799 |
Goal "((0::real) <= x*y) = (0 <= x & 0 <= y | x <= 0 & y <= 0)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
800 |
by (auto_tac (claset(), |
9069 | 801 |
simpset() addsimps [order_le_less, linorder_not_less, |
802 |
real_zero_less_mult_iff])); |
|
803 |
qed "real_zero_le_mult_iff"; |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
804 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
805 |
Goal "(x*y < (0::real)) = (0 < x & y < 0 | x < 0 & 0 < y)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
806 |
by (auto_tac (claset(), |
9069 | 807 |
simpset() addsimps [real_zero_le_mult_iff, |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
808 |
linorder_not_le RS sym])); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
809 |
by (auto_tac (claset() addDs [order_less_not_sym], |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
810 |
simpset() addsimps [linorder_not_le])); |
9069 | 811 |
qed "real_mult_less_zero_iff"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
812 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
813 |
Goal "(x*y <= (0::real)) = (0 <= x & y <= 0 | x <= 0 & 0 <= y)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
814 |
by (auto_tac (claset() addDs [order_less_not_sym], |
9069 | 815 |
simpset() addsimps [real_zero_less_mult_iff, |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
816 |
linorder_not_less RS sym])); |
9069 | 817 |
qed "real_mult_le_zero_iff"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
818 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
819 |
|
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
820 |
(*---------------------------------------------------------------------------- |
7334 | 821 |
Another embedding of the naturals in the reals (see real_of_posnat) |
822 |
----------------------------------------------------------------------------*) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
823 |
Goalw [real_of_nat_def] "real_of_nat 0 = 0"; |
9069 | 824 |
by (simp_tac (simpset() addsimps [real_of_posnat_one]) 1); |
7334 | 825 |
qed "real_of_nat_zero"; |
826 |
||
827 |
Goalw [real_of_nat_def] "real_of_nat 1 = 1r"; |
|
9069 | 828 |
by (simp_tac (simpset() addsimps [real_of_posnat_two, real_add_assoc]) 1); |
7334 | 829 |
qed "real_of_nat_one"; |
9069 | 830 |
Addsimps [real_of_nat_zero, real_of_nat_one]; |
7334 | 831 |
|
832 |
Goalw [real_of_nat_def] |
|
9069 | 833 |
"real_of_nat (m + n) = real_of_nat m + real_of_nat n"; |
7334 | 834 |
by (simp_tac (simpset() addsimps |
9069 | 835 |
[real_of_posnat_add,real_add_assoc RS sym]) 1); |
7334 | 836 |
qed "real_of_nat_add"; |
837 |
||
838 |
Goalw [real_of_nat_def] "real_of_nat (Suc n) = real_of_nat n + 1r"; |
|
839 |
by (simp_tac (simpset() addsimps [real_of_posnat_Suc] @ real_add_ac) 1); |
|
840 |
qed "real_of_nat_Suc"; |
|
9069 | 841 |
Addsimps [real_of_nat_Suc]; |
7334 | 842 |
|
9069 | 843 |
Goalw [real_of_nat_def] "(real_of_nat n < real_of_nat m) = (n < m)"; |
7334 | 844 |
by Auto_tac; |
845 |
qed "real_of_nat_less_iff"; |
|
846 |
||
9069 | 847 |
AddIffs [real_of_nat_less_iff]; |
7334 | 848 |
|
849 |
Goal "inj real_of_nat"; |
|
850 |
by (rtac injI 1); |
|
851 |
by (auto_tac (claset() addSIs [inj_real_of_posnat RS injD], |
|
852 |
simpset() addsimps [real_of_nat_def,real_add_right_cancel])); |
|
853 |
qed "inj_real_of_nat"; |
|
854 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
9013
diff
changeset
|
855 |
Goalw [real_of_nat_def] "0 <= real_of_nat n"; |
7334 | 856 |
by (res_inst_tac [("C","1r")] real_le_add_right_cancel 1); |
857 |
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1); |
|
858 |
qed "real_of_nat_ge_zero"; |
|
9069 | 859 |
AddIffs [real_of_nat_ge_zero]; |
7334 | 860 |
|
9069 | 861 |
Goal "real_of_nat (m * n) = real_of_nat m * real_of_nat n"; |
862 |
by (induct_tac "m" 1); |
|
7334 | 863 |
by (auto_tac (claset(), |
9069 | 864 |
simpset() addsimps [real_of_nat_add, |
7334 | 865 |
real_add_mult_distrib, real_add_commute])); |
866 |
qed "real_of_nat_mult"; |
|
867 |
||
868 |
Goal "(real_of_nat n = real_of_nat m) = (n = m)"; |
|
869 |
by (auto_tac (claset() addDs [inj_real_of_nat RS injD], |
|
870 |
simpset())); |
|
871 |
qed "real_of_nat_eq_cancel"; |
|
872 |
||
9069 | 873 |
Goal "n <= m --> real_of_nat (m - n) = real_of_nat m + (-real_of_nat n)"; |
874 |
by (induct_tac "m" 1); |
|
7334 | 875 |
by (auto_tac (claset(), |
8867 | 876 |
simpset() addsimps [Suc_diff_le, le_Suc_eq, real_of_nat_Suc, |
877 |
real_of_nat_zero] @ real_add_ac)); |
|
878 |
qed_spec_mp "real_of_nat_minus"; |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
879 |
|
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
880 |
(* 05/00 *) |
9069 | 881 |
Goal "n < m ==> real_of_nat (m - n) = \ |
882 |
\ real_of_nat m + -real_of_nat n"; |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
883 |
by (auto_tac (claset() addIs [real_of_nat_minus],simpset())); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
884 |
qed "real_of_nat_minus2"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
885 |
|
9069 | 886 |
Goalw [real_diff_def] |
887 |
"n < m ==> real_of_nat (m - n) = real_of_nat m - real_of_nat n"; |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
888 |
by (etac real_of_nat_minus2 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
889 |
qed "real_of_nat_diff"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
890 |
|
9069 | 891 |
Goalw [real_diff_def] |
892 |
"n <= m ==> real_of_nat (m - n) = real_of_nat m - real_of_nat n"; |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
893 |
by (etac real_of_nat_minus 1); |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
894 |
qed "real_of_nat_diff2"; |
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
895 |
|
9069 | 896 |
Goal "(real_of_nat n = 0) = (n = 0)"; |
897 |
by (auto_tac (claset() addIs [inj_real_of_nat RS injD], simpset())); |
|
898 |
qed "real_of_nat_zero_iff"; |
|
899 |
AddIffs [real_of_nat_zero_iff]; |
|
9013
9dd0274f76af
Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents:
8867
diff
changeset
|
900 |
|
9069 | 901 |
Goal "neg z ==> real_of_nat (nat z) = 0"; |
902 |
by (asm_simp_tac (simpset() addsimps [neg_nat, real_of_nat_zero]) 1); |
|
903 |
qed "real_of_nat_neg_int"; |
|
904 |
Addsimps [real_of_nat_neg_int]; |
|
905 |