author | wenzelm |
Mon, 28 Aug 2000 14:09:33 +0200 | |
changeset 9697 | c5fc121c2067 |
parent 9422 | 4b6bc2b347e5 |
child 9969 | 4753185f1dd2 |
permissions | -rw-r--r-- |
5588 | 1 |
(* Title : Real/RealDef.ML |
7219 | 2 |
ID : $Id$ |
5588 | 3 |
Author : Jacques D. Fleuriot |
4 |
Copyright : 1998 University of Cambridge |
|
5 |
Description : The reals |
|
6 |
*) |
|
7 |
||
8 |
(*** Proving that realrel is an equivalence relation ***) |
|
9 |
||
10 |
Goal "[| (x1::preal) + y2 = x2 + y1; x2 + y3 = x3 + y2 |] \ |
|
11 |
\ ==> x1 + y3 = x3 + y1"; |
|
12 |
by (res_inst_tac [("C","y2")] preal_add_right_cancel 1); |
|
13 |
by (rotate_tac 1 1 THEN dtac sym 1); |
|
14 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
15 |
by (rtac (preal_add_left_commute RS subst) 1); |
|
16 |
by (res_inst_tac [("x1","x1")] (preal_add_assoc RS subst) 1); |
|
17 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
18 |
qed "preal_trans_lemma"; |
|
19 |
||
20 |
(** Natural deduction for realrel **) |
|
21 |
||
22 |
Goalw [realrel_def] |
|
23 |
"(((x1,y1),(x2,y2)): realrel) = (x1 + y2 = x2 + y1)"; |
|
24 |
by (Blast_tac 1); |
|
25 |
qed "realrel_iff"; |
|
26 |
||
27 |
Goalw [realrel_def] |
|
28 |
"[| x1 + y2 = x2 + y1 |] ==> ((x1,y1),(x2,y2)): realrel"; |
|
29 |
by (Blast_tac 1); |
|
30 |
qed "realrelI"; |
|
31 |
||
32 |
Goalw [realrel_def] |
|
33 |
"p: realrel --> (EX x1 y1 x2 y2. \ |
|
34 |
\ p = ((x1,y1),(x2,y2)) & x1 + y2 = x2 + y1)"; |
|
35 |
by (Blast_tac 1); |
|
36 |
qed "realrelE_lemma"; |
|
37 |
||
9422 | 38 |
val [major,minor] = goal (the_context ()) |
5588 | 39 |
"[| p: realrel; \ |
40 |
\ !!x1 y1 x2 y2. [| p = ((x1,y1),(x2,y2)); x1+y2 = x2+y1 \ |
|
41 |
\ |] ==> Q |] ==> Q"; |
|
42 |
by (cut_facts_tac [major RS (realrelE_lemma RS mp)] 1); |
|
43 |
by (REPEAT (eresolve_tac [asm_rl,exE,conjE,minor] 1)); |
|
44 |
qed "realrelE"; |
|
45 |
||
46 |
AddSIs [realrelI]; |
|
47 |
AddSEs [realrelE]; |
|
48 |
||
49 |
Goal "(x,x): realrel"; |
|
9369 | 50 |
by (pair_tac "x" 1); |
51 |
by (rtac realrelI 1); |
|
52 |
by (rtac refl 1); |
|
5588 | 53 |
qed "realrel_refl"; |
54 |
||
9391 | 55 |
Goalw [equiv_def, refl_def, sym_def, trans_def] "equiv UNIV realrel"; |
5588 | 56 |
by (fast_tac (claset() addSIs [realrel_refl] |
9391 | 57 |
addSEs [sym, preal_trans_lemma]) 1); |
5588 | 58 |
qed "equiv_realrel"; |
59 |
||
9391 | 60 |
(* (realrel ^^ {x} = realrel ^^ {y}) = ((x,y) : realrel) *) |
9108 | 61 |
bind_thm ("equiv_realrel_iff", |
9391 | 62 |
[equiv_realrel, UNIV_I, UNIV_I] MRS eq_equiv_class_iff); |
5588 | 63 |
|
64 |
Goalw [real_def,realrel_def,quotient_def] "realrel^^{(x,y)}:real"; |
|
65 |
by (Blast_tac 1); |
|
66 |
qed "realrel_in_real"; |
|
67 |
||
68 |
Goal "inj_on Abs_real real"; |
|
69 |
by (rtac inj_on_inverseI 1); |
|
70 |
by (etac Abs_real_inverse 1); |
|
71 |
qed "inj_on_Abs_real"; |
|
72 |
||
73 |
Addsimps [equiv_realrel_iff,inj_on_Abs_real RS inj_on_iff, |
|
74 |
realrel_iff, realrel_in_real, Abs_real_inverse]; |
|
75 |
||
76 |
Addsimps [equiv_realrel RS eq_equiv_class_iff]; |
|
9108 | 77 |
bind_thm ("eq_realrelD", equiv_realrel RSN (2,eq_equiv_class)); |
5588 | 78 |
|
79 |
Goal "inj(Rep_real)"; |
|
80 |
by (rtac inj_inverseI 1); |
|
81 |
by (rtac Rep_real_inverse 1); |
|
82 |
qed "inj_Rep_real"; |
|
83 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
84 |
(** real_of_preal: the injection from preal to real **) |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
85 |
Goal "inj(real_of_preal)"; |
5588 | 86 |
by (rtac injI 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
87 |
by (rewtac real_of_preal_def); |
5588 | 88 |
by (dtac (inj_on_Abs_real RS inj_onD) 1); |
89 |
by (REPEAT (rtac realrel_in_real 1)); |
|
90 |
by (dtac eq_equiv_class 1); |
|
91 |
by (rtac equiv_realrel 1); |
|
92 |
by (Blast_tac 1); |
|
93 |
by Safe_tac; |
|
94 |
by (Asm_full_simp_tac 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
95 |
qed "inj_real_of_preal"; |
5588 | 96 |
|
9422 | 97 |
val [prem] = goal (the_context ()) |
5588 | 98 |
"(!!x y. z = Abs_real(realrel^^{(x,y)}) ==> P) ==> P"; |
99 |
by (res_inst_tac [("x1","z")] |
|
100 |
(rewrite_rule [real_def] Rep_real RS quotientE) 1); |
|
101 |
by (dres_inst_tac [("f","Abs_real")] arg_cong 1); |
|
102 |
by (res_inst_tac [("p","x")] PairE 1); |
|
103 |
by (rtac prem 1); |
|
104 |
by (asm_full_simp_tac (simpset() addsimps [Rep_real_inverse]) 1); |
|
105 |
qed "eq_Abs_real"; |
|
106 |
||
107 |
(**** real_minus: additive inverse on real ****) |
|
108 |
||
109 |
Goalw [congruent_def] |
|
9369 | 110 |
"congruent realrel (%p. (%(x,y). realrel^^{(y,x)}) p)"; |
5588 | 111 |
by Safe_tac; |
112 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_commute]) 1); |
|
113 |
qed "real_minus_congruent"; |
|
114 |
||
115 |
Goalw [real_minus_def] |
|
116 |
"- (Abs_real(realrel^^{(x,y)})) = Abs_real(realrel ^^ {(y,x)})"; |
|
117 |
by (res_inst_tac [("f","Abs_real")] arg_cong 1); |
|
118 |
by (simp_tac (simpset() addsimps |
|
9391 | 119 |
[realrel_in_real RS Abs_real_inverse, |
120 |
[equiv_realrel, real_minus_congruent] MRS UN_equiv_class]) 1); |
|
5588 | 121 |
qed "real_minus"; |
122 |
||
123 |
Goal "- (- z) = (z::real)"; |
|
124 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
|
125 |
by (asm_simp_tac (simpset() addsimps [real_minus]) 1); |
|
126 |
qed "real_minus_minus"; |
|
127 |
||
128 |
Addsimps [real_minus_minus]; |
|
129 |
||
130 |
Goal "inj(%r::real. -r)"; |
|
131 |
by (rtac injI 1); |
|
132 |
by (dres_inst_tac [("f","uminus")] arg_cong 1); |
|
133 |
by (asm_full_simp_tac (simpset() addsimps [real_minus_minus]) 1); |
|
134 |
qed "inj_real_minus"; |
|
135 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
136 |
Goalw [real_zero_def] "-0 = (0::real)"; |
5588 | 137 |
by (simp_tac (simpset() addsimps [real_minus]) 1); |
138 |
qed "real_minus_zero"; |
|
139 |
||
140 |
Addsimps [real_minus_zero]; |
|
141 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
142 |
Goal "(-x = 0) = (x = (0::real))"; |
5588 | 143 |
by (res_inst_tac [("z","x")] eq_Abs_real 1); |
144 |
by (auto_tac (claset(), |
|
145 |
simpset() addsimps [real_zero_def, real_minus] @ preal_add_ac)); |
|
146 |
qed "real_minus_zero_iff"; |
|
147 |
||
148 |
Addsimps [real_minus_zero_iff]; |
|
149 |
||
150 |
(*** Congruence property for addition ***) |
|
151 |
Goalw [congruent2_def] |
|
152 |
"congruent2 realrel (%p1 p2. \ |
|
9369 | 153 |
\ (%(x1,y1). (%(x2,y2). realrel^^{(x1+x2, y1+y2)}) p2) p1)"; |
5588 | 154 |
by Safe_tac; |
155 |
by (asm_simp_tac (simpset() addsimps [preal_add_assoc]) 1); |
|
156 |
by (res_inst_tac [("z1.1","x1a")] (preal_add_left_commute RS ssubst) 1); |
|
157 |
by (asm_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1); |
|
158 |
by (asm_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
159 |
qed "real_add_congruent2"; |
|
160 |
||
161 |
Goalw [real_add_def] |
|
162 |
"Abs_real(realrel^^{(x1,y1)}) + Abs_real(realrel^^{(x2,y2)}) = \ |
|
163 |
\ Abs_real(realrel^^{(x1+x2, y1+y2)})"; |
|
9391 | 164 |
by (simp_tac (simpset() addsimps |
165 |
[[equiv_realrel, real_add_congruent2] MRS UN_equiv_class2]) 1); |
|
5588 | 166 |
qed "real_add"; |
167 |
||
168 |
Goal "(z::real) + w = w + z"; |
|
169 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
|
170 |
by (res_inst_tac [("z","w")] eq_Abs_real 1); |
|
171 |
by (asm_simp_tac (simpset() addsimps preal_add_ac @ [real_add]) 1); |
|
172 |
qed "real_add_commute"; |
|
173 |
||
174 |
Goal "((z1::real) + z2) + z3 = z1 + (z2 + z3)"; |
|
175 |
by (res_inst_tac [("z","z1")] eq_Abs_real 1); |
|
176 |
by (res_inst_tac [("z","z2")] eq_Abs_real 1); |
|
177 |
by (res_inst_tac [("z","z3")] eq_Abs_real 1); |
|
178 |
by (asm_simp_tac (simpset() addsimps [real_add, preal_add_assoc]) 1); |
|
179 |
qed "real_add_assoc"; |
|
180 |
||
181 |
(*For AC rewriting*) |
|
182 |
Goal "(x::real)+(y+z)=y+(x+z)"; |
|
183 |
by (rtac (real_add_commute RS trans) 1); |
|
184 |
by (rtac (real_add_assoc RS trans) 1); |
|
185 |
by (rtac (real_add_commute RS arg_cong) 1); |
|
186 |
qed "real_add_left_commute"; |
|
187 |
||
188 |
(* real addition is an AC operator *) |
|
7428 | 189 |
bind_thms ("real_add_ac", [real_add_assoc,real_add_commute,real_add_left_commute]); |
5588 | 190 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
191 |
Goalw [real_of_preal_def,real_zero_def] "(0::real) + z = z"; |
5588 | 192 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
193 |
by (asm_full_simp_tac (simpset() addsimps [real_add] @ preal_add_ac) 1); |
|
194 |
qed "real_add_zero_left"; |
|
195 |
Addsimps [real_add_zero_left]; |
|
196 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
197 |
Goal "z + (0::real) = z"; |
5588 | 198 |
by (simp_tac (simpset() addsimps [real_add_commute]) 1); |
199 |
qed "real_add_zero_right"; |
|
200 |
Addsimps [real_add_zero_right]; |
|
201 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
202 |
Goalw [real_zero_def] "z + (-z) = (0::real)"; |
5588 | 203 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
204 |
by (asm_full_simp_tac (simpset() addsimps [real_minus, |
|
205 |
real_add, preal_add_commute]) 1); |
|
206 |
qed "real_add_minus"; |
|
207 |
Addsimps [real_add_minus]; |
|
208 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
209 |
Goal "(-z) + z = (0::real)"; |
5588 | 210 |
by (simp_tac (simpset() addsimps [real_add_commute]) 1); |
211 |
qed "real_add_minus_left"; |
|
212 |
Addsimps [real_add_minus_left]; |
|
213 |
||
214 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
215 |
Goal "z + ((- z) + w) = (w::real)"; |
5588 | 216 |
by (simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
217 |
qed "real_add_minus_cancel"; |
|
218 |
||
219 |
Goal "(-z) + (z + w) = (w::real)"; |
|
220 |
by (simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
|
221 |
qed "real_minus_add_cancel"; |
|
222 |
||
223 |
Addsimps [real_add_minus_cancel, real_minus_add_cancel]; |
|
224 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
225 |
Goal "EX y. (x::real) + y = 0"; |
5588 | 226 |
by (blast_tac (claset() addIs [real_add_minus]) 1); |
227 |
qed "real_minus_ex"; |
|
228 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
229 |
Goal "EX! y. (x::real) + y = 0"; |
5588 | 230 |
by (auto_tac (claset() addIs [real_add_minus],simpset())); |
231 |
by (dres_inst_tac [("f","%x. ya+x")] arg_cong 1); |
|
232 |
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
|
233 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
|
234 |
qed "real_minus_ex1"; |
|
235 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
236 |
Goal "EX! y. y + (x::real) = 0"; |
5588 | 237 |
by (auto_tac (claset() addIs [real_add_minus_left],simpset())); |
238 |
by (dres_inst_tac [("f","%x. x+ya")] arg_cong 1); |
|
239 |
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1); |
|
240 |
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1); |
|
241 |
qed "real_minus_left_ex1"; |
|
242 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
243 |
Goal "x + y = (0::real) ==> x = -y"; |
5588 | 244 |
by (cut_inst_tac [("z","y")] real_add_minus_left 1); |
245 |
by (res_inst_tac [("x1","y")] (real_minus_left_ex1 RS ex1E) 1); |
|
246 |
by (Blast_tac 1); |
|
247 |
qed "real_add_minus_eq_minus"; |
|
248 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
249 |
Goal "EX (y::real). x = -y"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
250 |
by (cut_inst_tac [("x","x")] real_minus_ex 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
251 |
by (etac exE 1 THEN dtac real_add_minus_eq_minus 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
252 |
by (Fast_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
253 |
qed "real_as_add_inverse_ex"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
254 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
255 |
Goal "-(x + y) = (-x) + (- y :: real)"; |
5588 | 256 |
by (res_inst_tac [("z","x")] eq_Abs_real 1); |
257 |
by (res_inst_tac [("z","y")] eq_Abs_real 1); |
|
258 |
by (auto_tac (claset(),simpset() addsimps [real_minus,real_add])); |
|
259 |
qed "real_minus_add_distrib"; |
|
260 |
||
261 |
Addsimps [real_minus_add_distrib]; |
|
262 |
||
263 |
Goal "((x::real) + y = x + z) = (y = z)"; |
|
264 |
by (Step_tac 1); |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
265 |
by (dres_inst_tac [("f","%t. (-x) + t")] arg_cong 1); |
5588 | 266 |
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
267 |
qed "real_add_left_cancel"; |
|
268 |
||
269 |
Goal "(y + (x::real)= z + x) = (y = z)"; |
|
270 |
by (simp_tac (simpset() addsimps [real_add_commute,real_add_left_cancel]) 1); |
|
271 |
qed "real_add_right_cancel"; |
|
272 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
273 |
Goal "((x::real) = y) = (0 = x + (- y))"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
274 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
275 |
by (res_inst_tac [("x1","-y")] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
276 |
(real_add_right_cancel RS iffD1) 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
277 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
278 |
qed "real_eq_minus_iff"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
279 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
280 |
Goal "((x::real) = y) = (x + (- y) = 0)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
281 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
282 |
by (res_inst_tac [("x1","-y")] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
283 |
(real_add_right_cancel RS iffD1) 2); |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
284 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
285 |
qed "real_eq_minus_iff2"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
286 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
287 |
Goal "(0::real) - x = -x"; |
5588 | 288 |
by (simp_tac (simpset() addsimps [real_diff_def]) 1); |
289 |
qed "real_diff_0"; |
|
290 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
291 |
Goal "x - (0::real) = x"; |
5588 | 292 |
by (simp_tac (simpset() addsimps [real_diff_def]) 1); |
293 |
qed "real_diff_0_right"; |
|
294 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
295 |
Goal "x - x = (0::real)"; |
5588 | 296 |
by (simp_tac (simpset() addsimps [real_diff_def]) 1); |
297 |
qed "real_diff_self"; |
|
298 |
||
299 |
Addsimps [real_diff_0, real_diff_0_right, real_diff_self]; |
|
300 |
||
301 |
||
302 |
(*** Congruence property for multiplication ***) |
|
303 |
||
304 |
Goal "!!(x1::preal). [| x1 + y2 = x2 + y1 |] ==> \ |
|
305 |
\ x * x1 + y * y1 + (x * y2 + x2 * y) = \ |
|
306 |
\ x * x2 + y * y2 + (x * y1 + x1 * y)"; |
|
307 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_left_commute, |
|
308 |
preal_add_assoc RS sym,preal_add_mult_distrib2 RS sym]) 1); |
|
309 |
by (rtac (preal_mult_commute RS subst) 1); |
|
310 |
by (res_inst_tac [("y1","x2")] (preal_mult_commute RS subst) 1); |
|
311 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_assoc, |
|
312 |
preal_add_mult_distrib2 RS sym]) 1); |
|
313 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_commute]) 1); |
|
314 |
qed "real_mult_congruent2_lemma"; |
|
315 |
||
316 |
Goal |
|
317 |
"congruent2 realrel (%p1 p2. \ |
|
9369 | 318 |
\ (%(x1,y1). (%(x2,y2). realrel^^{(x1*x2 + y1*y2, x1*y2+x2*y1)}) p2) p1)"; |
5588 | 319 |
by (rtac (equiv_realrel RS congruent2_commuteI) 1); |
320 |
by Safe_tac; |
|
321 |
by (rewtac split_def); |
|
322 |
by (asm_simp_tac (simpset() addsimps [preal_mult_commute,preal_add_commute]) 1); |
|
323 |
by (auto_tac (claset(),simpset() addsimps [real_mult_congruent2_lemma])); |
|
324 |
qed "real_mult_congruent2"; |
|
325 |
||
326 |
Goalw [real_mult_def] |
|
327 |
"Abs_real((realrel^^{(x1,y1)})) * Abs_real((realrel^^{(x2,y2)})) = \ |
|
328 |
\ Abs_real(realrel ^^ {(x1*x2+y1*y2,x1*y2+x2*y1)})"; |
|
9391 | 329 |
by (simp_tac (simpset() addsimps |
330 |
[[equiv_realrel, real_mult_congruent2] MRS UN_equiv_class2]) 1); |
|
5588 | 331 |
qed "real_mult"; |
332 |
||
333 |
Goal "(z::real) * w = w * z"; |
|
334 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
|
335 |
by (res_inst_tac [("z","w")] eq_Abs_real 1); |
|
336 |
by (asm_simp_tac |
|
337 |
(simpset() addsimps [real_mult] @ preal_add_ac @ preal_mult_ac) 1); |
|
338 |
qed "real_mult_commute"; |
|
339 |
||
340 |
Goal "((z1::real) * z2) * z3 = z1 * (z2 * z3)"; |
|
341 |
by (res_inst_tac [("z","z1")] eq_Abs_real 1); |
|
342 |
by (res_inst_tac [("z","z2")] eq_Abs_real 1); |
|
343 |
by (res_inst_tac [("z","z3")] eq_Abs_real 1); |
|
344 |
by (asm_simp_tac (simpset() addsimps [preal_add_mult_distrib2,real_mult] @ |
|
345 |
preal_add_ac @ preal_mult_ac) 1); |
|
346 |
qed "real_mult_assoc"; |
|
347 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
348 |
Goal "(z1::real) * (z2 * z3) = z2 * (z1 * z3)"; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
349 |
by (rtac (real_mult_commute RS trans) 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
350 |
by (rtac (real_mult_assoc RS trans) 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
351 |
by (rtac (real_mult_commute RS arg_cong) 1); |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
352 |
qed "real_mult_left_commute"; |
5588 | 353 |
|
354 |
(* real multiplication is an AC operator *) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
355 |
bind_thms ("real_mult_ac", |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
356 |
[real_mult_assoc, real_mult_commute, real_mult_left_commute]); |
5588 | 357 |
|
358 |
Goalw [real_one_def,pnat_one_def] "1r * z = z"; |
|
359 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
|
360 |
by (asm_full_simp_tac |
|
361 |
(simpset() addsimps [real_mult, |
|
362 |
preal_add_mult_distrib2,preal_mult_1_right] |
|
363 |
@ preal_mult_ac @ preal_add_ac) 1); |
|
364 |
qed "real_mult_1"; |
|
365 |
||
366 |
Addsimps [real_mult_1]; |
|
367 |
||
368 |
Goal "z * 1r = z"; |
|
369 |
by (simp_tac (simpset() addsimps [real_mult_commute]) 1); |
|
370 |
qed "real_mult_1_right"; |
|
371 |
||
372 |
Addsimps [real_mult_1_right]; |
|
373 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
374 |
Goalw [real_zero_def,pnat_one_def] "0 * z = (0::real)"; |
5588 | 375 |
by (res_inst_tac [("z","z")] eq_Abs_real 1); |
376 |
by (asm_full_simp_tac (simpset() addsimps [real_mult, |
|
377 |
preal_add_mult_distrib2,preal_mult_1_right] |
|
378 |
@ preal_mult_ac @ preal_add_ac) 1); |
|
379 |
qed "real_mult_0"; |
|
380 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
381 |
Goal "z * 0 = (0::real)"; |
5588 | 382 |
by (simp_tac (simpset() addsimps [real_mult_commute, real_mult_0]) 1); |
383 |
qed "real_mult_0_right"; |
|
384 |
||
385 |
Addsimps [real_mult_0_right, real_mult_0]; |
|
386 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
387 |
Goal "-(x * y) = (-x) * (y::real)"; |
5588 | 388 |
by (res_inst_tac [("z","x")] eq_Abs_real 1); |
389 |
by (res_inst_tac [("z","y")] eq_Abs_real 1); |
|
390 |
by (auto_tac (claset(), |
|
391 |
simpset() addsimps [real_minus,real_mult] |
|
9391 | 392 |
@ preal_mult_ac @ preal_add_ac)); |
5588 | 393 |
qed "real_minus_mult_eq1"; |
394 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
395 |
Goal "-(x * y) = x * (- y :: real)"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
396 |
by (simp_tac (simpset() addsimps [inst "z" "x" real_mult_commute, |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
397 |
real_minus_mult_eq1]) 1); |
5588 | 398 |
qed "real_minus_mult_eq2"; |
399 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
400 |
Addsimps [real_minus_mult_eq1 RS sym, real_minus_mult_eq2 RS sym]; |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
401 |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
402 |
Goal "(- 1r) * z = -z"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
403 |
by (Simp_tac 1); |
5588 | 404 |
qed "real_mult_minus_1"; |
405 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
406 |
Goal "z * (- 1r) = -z"; |
5588 | 407 |
by (stac real_mult_commute 1); |
408 |
by (Simp_tac 1); |
|
409 |
qed "real_mult_minus_1_right"; |
|
410 |
||
411 |
Addsimps [real_mult_minus_1_right]; |
|
412 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
413 |
Goal "(-x) * (-y) = x * (y::real)"; |
5588 | 414 |
by (full_simp_tac (simpset() addsimps [real_minus_mult_eq2 RS sym, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
415 |
real_minus_mult_eq1 RS sym]) 1); |
5588 | 416 |
qed "real_minus_mult_cancel"; |
417 |
||
418 |
Addsimps [real_minus_mult_cancel]; |
|
419 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
420 |
Goal "(-x) * y = x * (- y :: real)"; |
5588 | 421 |
by (full_simp_tac (simpset() addsimps [real_minus_mult_eq2 RS sym, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
422 |
real_minus_mult_eq1 RS sym]) 1); |
5588 | 423 |
qed "real_minus_mult_commute"; |
424 |
||
425 |
(*----------------------------------------------------------------------------- |
|
426 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
427 |
----------------------------------------------------------------------------*) |
5588 | 428 |
|
429 |
(** Lemmas **) |
|
430 |
||
9266 | 431 |
Goal "(z::real) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"; |
432 |
by (asm_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1); |
|
433 |
qed "real_add_assoc_cong"; |
|
5588 | 434 |
|
9266 | 435 |
Goal "(z::real) + (v + w) = v + (z + w)"; |
436 |
by (REPEAT (ares_tac [real_add_commute RS real_add_assoc_cong] 1)); |
|
437 |
qed "real_add_assoc_swap"; |
|
5588 | 438 |
|
439 |
Goal "((z1::real) + z2) * w = (z1 * w) + (z2 * w)"; |
|
440 |
by (res_inst_tac [("z","z1")] eq_Abs_real 1); |
|
441 |
by (res_inst_tac [("z","z2")] eq_Abs_real 1); |
|
442 |
by (res_inst_tac [("z","w")] eq_Abs_real 1); |
|
443 |
by (asm_simp_tac |
|
444 |
(simpset() addsimps [preal_add_mult_distrib2, real_add, real_mult] @ |
|
445 |
preal_add_ac @ preal_mult_ac) 1); |
|
446 |
qed "real_add_mult_distrib"; |
|
447 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
448 |
val real_mult_commute'= inst "z" "w" real_mult_commute; |
5588 | 449 |
|
450 |
Goal "(w::real) * (z1 + z2) = (w * z1) + (w * z2)"; |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
451 |
by (simp_tac (simpset() addsimps [real_mult_commute', |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
452 |
real_add_mult_distrib]) 1); |
5588 | 453 |
qed "real_add_mult_distrib2"; |
454 |
||
8027 | 455 |
Goalw [real_diff_def] "((z1::real) - z2) * w = (z1 * w) - (z2 * w)"; |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
456 |
by (simp_tac (simpset() addsimps [real_add_mult_distrib]) 1); |
8027 | 457 |
qed "real_diff_mult_distrib"; |
458 |
||
459 |
Goal "(w::real) * (z1 - z2) = (w * z1) - (w * z2)"; |
|
460 |
by (simp_tac (simpset() addsimps [real_mult_commute', |
|
461 |
real_diff_mult_distrib]) 1); |
|
462 |
qed "real_diff_mult_distrib2"; |
|
463 |
||
5588 | 464 |
(*** one and zero are distinct ***) |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
465 |
Goalw [real_zero_def,real_one_def] "0 ~= 1r"; |
5588 | 466 |
by (auto_tac (claset(), |
467 |
simpset() addsimps [preal_self_less_add_left RS preal_not_refl2])); |
|
468 |
qed "real_zero_not_eq_one"; |
|
469 |
||
470 |
(*** existence of inverse ***) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
471 |
(** lemma -- alternative definition of 0 **) |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
472 |
Goalw [real_zero_def] "0 = Abs_real (realrel ^^ {(x, x)})"; |
5588 | 473 |
by (auto_tac (claset(),simpset() addsimps [preal_add_commute])); |
474 |
qed "real_zero_iff"; |
|
475 |
||
476 |
Goalw [real_zero_def,real_one_def] |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
477 |
"!!(x::real). x ~= 0 ==> EX y. x*y = 1r"; |
5588 | 478 |
by (res_inst_tac [("z","x")] eq_Abs_real 1); |
479 |
by (cut_inst_tac [("r1.0","xa"),("r2.0","y")] preal_linear 1); |
|
480 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
|
481 |
simpset() addsimps [real_zero_iff RS sym])); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
482 |
by (res_inst_tac [("x","Abs_real (realrel ^^ \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
483 |
\ {(preal_of_prat(prat_of_pnat 1p),pinv(D)+\ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
484 |
\ preal_of_prat(prat_of_pnat 1p))})")] exI 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
485 |
by (res_inst_tac [("x","Abs_real (realrel ^^ \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
486 |
\ {(pinv(D)+preal_of_prat(prat_of_pnat 1p),\ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
487 |
\ preal_of_prat(prat_of_pnat 1p))})")] exI 2); |
5588 | 488 |
by (auto_tac (claset(), |
489 |
simpset() addsimps [real_mult, |
|
490 |
pnat_one_def,preal_mult_1_right,preal_add_mult_distrib2, |
|
491 |
preal_add_mult_distrib,preal_mult_1,preal_mult_inv_right] |
|
492 |
@ preal_add_ac @ preal_mult_ac)); |
|
493 |
qed "real_mult_inv_right_ex"; |
|
494 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
495 |
Goal "!!(x::real). x ~= 0 ==> EX y. y*x = 1r"; |
5588 | 496 |
by (asm_simp_tac (simpset() addsimps [real_mult_commute, |
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
497 |
real_mult_inv_right_ex]) 1); |
5588 | 498 |
qed "real_mult_inv_left_ex"; |
499 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
500 |
Goalw [rinv_def] "x ~= 0 ==> rinv(x)*x = 1r"; |
7499 | 501 |
by (ftac real_mult_inv_left_ex 1); |
5588 | 502 |
by (Step_tac 1); |
503 |
by (rtac selectI2 1); |
|
504 |
by Auto_tac; |
|
505 |
qed "real_mult_inv_left"; |
|
506 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
507 |
Goal "x ~= 0 ==> x*rinv(x) = 1r"; |
5588 | 508 |
by (auto_tac (claset() addIs [real_mult_commute RS subst], |
509 |
simpset() addsimps [real_mult_inv_left])); |
|
510 |
qed "real_mult_inv_right"; |
|
511 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
512 |
Goal "(c::real) ~= 0 ==> (c*a=c*b) = (a=b)"; |
5588 | 513 |
by Auto_tac; |
514 |
by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1); |
|
515 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_inv_right] @ real_mult_ac) 1); |
|
516 |
qed "real_mult_left_cancel"; |
|
517 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
518 |
Goal "(c::real) ~= 0 ==> (a*c=b*c) = (a=b)"; |
5588 | 519 |
by (Step_tac 1); |
520 |
by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1); |
|
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
521 |
by (asm_full_simp_tac |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
522 |
(simpset() addsimps [real_mult_inv_right] @ real_mult_ac) 1); |
5588 | 523 |
qed "real_mult_right_cancel"; |
524 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
525 |
Goal "c*a ~= c*b ==> a ~= b"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
526 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
527 |
qed "real_mult_left_cancel_ccontr"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
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 "a*c ~= b*c ==> a ~= b"; |
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
530 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
531 |
qed "real_mult_right_cancel_ccontr"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
532 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
533 |
Goalw [rinv_def] "x ~= 0 ==> rinv(x) ~= 0"; |
7499 | 534 |
by (ftac real_mult_inv_left_ex 1); |
5588 | 535 |
by (etac exE 1); |
536 |
by (rtac selectI2 1); |
|
537 |
by (auto_tac (claset(), |
|
538 |
simpset() addsimps [real_mult_0, |
|
539 |
real_zero_not_eq_one])); |
|
540 |
qed "rinv_not_zero"; |
|
541 |
||
542 |
Addsimps [real_mult_inv_left,real_mult_inv_right]; |
|
543 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
544 |
Goal "[| x ~= 0; y ~= 0 |] ==> x * y ~= (0::real)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
545 |
by (Step_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
546 |
by (dres_inst_tac [("f","%z. rinv x*z")] arg_cong 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
547 |
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
548 |
qed "real_mult_not_zero"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
549 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
550 |
bind_thm ("real_mult_not_zeroE",real_mult_not_zero RS notE); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
551 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
552 |
Goal "x ~= 0 ==> rinv(rinv x) = x"; |
5588 | 553 |
by (res_inst_tac [("c1","rinv x")] (real_mult_right_cancel RS iffD1) 1); |
554 |
by (etac rinv_not_zero 1); |
|
555 |
by (auto_tac (claset() addDs [rinv_not_zero],simpset())); |
|
556 |
qed "real_rinv_rinv"; |
|
557 |
||
558 |
Goalw [rinv_def] "rinv(1r) = 1r"; |
|
559 |
by (cut_facts_tac [real_zero_not_eq_one RS |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
560 |
not_sym RS real_mult_inv_left_ex] 1); |
5588 | 561 |
by (auto_tac (claset(), |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
562 |
simpset() addsimps [real_zero_not_eq_one RS not_sym])); |
5588 | 563 |
qed "real_rinv_1"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
564 |
Addsimps [real_rinv_1]; |
5588 | 565 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
566 |
Goal "x ~= 0 ==> rinv(-x) = -rinv(x)"; |
5588 | 567 |
by (res_inst_tac [("c1","-x")] (real_mult_right_cancel RS iffD1) 1); |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
568 |
by (stac real_mult_inv_left 2); |
5588 | 569 |
by Auto_tac; |
570 |
qed "real_minus_rinv"; |
|
571 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
572 |
Goal "[| x ~= 0; y ~= 0 |] ==> rinv(x*y) = rinv(x)*rinv(y)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
573 |
by (forw_inst_tac [("y","y")] real_mult_not_zero 1 THEN assume_tac 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
574 |
by (res_inst_tac [("c1","x")] (real_mult_left_cancel RS iffD1) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
575 |
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym])); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
576 |
by (res_inst_tac [("c1","y")] (real_mult_left_cancel RS iffD1) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
577 |
by (auto_tac (claset(),simpset() addsimps [real_mult_left_commute])); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
578 |
by (asm_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
579 |
qed "real_rinv_distrib"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
580 |
|
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
581 |
(*--------------------------------------------------------- |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
582 |
Theorems for ordering |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
583 |
--------------------------------------------------------*) |
5588 | 584 |
(* prove introduction and elimination rules for real_less *) |
585 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
586 |
(* real_less is a strong order i.e. nonreflexive and transitive *) |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
587 |
|
5588 | 588 |
(*** lemmas ***) |
589 |
Goal "!!(x::preal). [| x = y; x1 = y1 |] ==> x + y1 = x1 + y"; |
|
590 |
by (asm_simp_tac (simpset() addsimps [preal_add_commute]) 1); |
|
591 |
qed "preal_lemma_eq_rev_sum"; |
|
592 |
||
593 |
Goal "!!(b::preal). x + (b + y) = x1 + (b + y1) ==> x + y = x1 + y1"; |
|
594 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
595 |
qed "preal_add_left_commute_cancel"; |
|
596 |
||
597 |
Goal "!!(x::preal). [| x + y2a = x2a + y; \ |
|
598 |
\ x + y2b = x2b + y |] \ |
|
599 |
\ ==> x2a + y2b = x2b + y2a"; |
|
600 |
by (dtac preal_lemma_eq_rev_sum 1); |
|
601 |
by (assume_tac 1); |
|
602 |
by (thin_tac "x + y2b = x2b + y" 1); |
|
603 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
604 |
by (dtac preal_add_left_commute_cancel 1); |
|
605 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
606 |
qed "preal_lemma_for_not_refl"; |
|
607 |
||
608 |
Goal "~ (R::real) < R"; |
|
609 |
by (res_inst_tac [("z","R")] eq_Abs_real 1); |
|
610 |
by (auto_tac (claset(),simpset() addsimps [real_less_def])); |
|
611 |
by (dtac preal_lemma_for_not_refl 1); |
|
612 |
by (assume_tac 1 THEN rotate_tac 2 1); |
|
613 |
by (auto_tac (claset(),simpset() addsimps [preal_less_not_refl])); |
|
614 |
qed "real_less_not_refl"; |
|
615 |
||
616 |
(*** y < y ==> P ***) |
|
617 |
bind_thm("real_less_irrefl", real_less_not_refl RS notE); |
|
618 |
AddSEs [real_less_irrefl]; |
|
619 |
||
620 |
Goal "!!(x::real). x < y ==> x ~= y"; |
|
621 |
by (auto_tac (claset(),simpset() addsimps [real_less_not_refl])); |
|
622 |
qed "real_not_refl2"; |
|
623 |
||
624 |
(* lemma re-arranging and eliminating terms *) |
|
625 |
Goal "!! (a::preal). [| a + b = c + d; \ |
|
626 |
\ x2b + d + (c + y2e) < a + y2b + (x2e + b) |] \ |
|
627 |
\ ==> x2b + y2e < x2e + y2b"; |
|
628 |
by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
629 |
by (res_inst_tac [("C","c+d")] preal_add_left_less_cancel 1); |
|
630 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1); |
|
631 |
qed "preal_lemma_trans"; |
|
632 |
||
633 |
(** heavy re-writing involved*) |
|
634 |
Goal "!!(R1::real). [| R1 < R2; R2 < R3 |] ==> R1 < R3"; |
|
635 |
by (res_inst_tac [("z","R1")] eq_Abs_real 1); |
|
636 |
by (res_inst_tac [("z","R2")] eq_Abs_real 1); |
|
637 |
by (res_inst_tac [("z","R3")] eq_Abs_real 1); |
|
638 |
by (auto_tac (claset(),simpset() addsimps [real_less_def])); |
|
639 |
by (REPEAT(rtac exI 1)); |
|
640 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
641 |
by (REPEAT(Blast_tac 2)); |
|
642 |
by (dtac preal_lemma_for_not_refl 1 THEN assume_tac 1); |
|
643 |
by (blast_tac (claset() addDs [preal_add_less_mono] |
|
644 |
addIs [preal_lemma_trans]) 1); |
|
645 |
qed "real_less_trans"; |
|
646 |
||
9167 | 647 |
Goal "!! (R1::real). R1 < R2 ==> ~ (R2 < R1)"; |
648 |
by (rtac notI 1); |
|
5588 | 649 |
by (dtac real_less_trans 1 THEN assume_tac 1); |
650 |
by (asm_full_simp_tac (simpset() addsimps [real_less_not_refl]) 1); |
|
9167 | 651 |
qed "real_less_not_sym"; |
652 |
||
653 |
(* [| x < y; ~P ==> y < x |] ==> P *) |
|
654 |
bind_thm ("real_less_asym", real_less_not_sym RS swap); |
|
5588 | 655 |
|
656 |
(****)(****)(****)(****)(****)(****)(****)(****)(****)(****) |
|
657 |
(****** Map and more real_less ******) |
|
658 |
(*** mapping from preal into real ***) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
659 |
Goalw [real_of_preal_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
660 |
"real_of_preal ((z1::preal) + z2) = \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
661 |
\ real_of_preal z1 + real_of_preal z2"; |
5588 | 662 |
by (asm_simp_tac (simpset() addsimps [real_add, |
663 |
preal_add_mult_distrib,preal_mult_1] addsimps preal_add_ac) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
664 |
qed "real_of_preal_add"; |
5588 | 665 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
666 |
Goalw [real_of_preal_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
667 |
"real_of_preal ((z1::preal) * z2) = \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
668 |
\ real_of_preal z1* real_of_preal z2"; |
5588 | 669 |
by (full_simp_tac (simpset() addsimps [real_mult, |
670 |
preal_add_mult_distrib2,preal_mult_1, |
|
671 |
preal_mult_1_right,pnat_one_def] |
|
672 |
@ preal_add_ac @ preal_mult_ac) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
673 |
qed "real_of_preal_mult"; |
5588 | 674 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
675 |
Goalw [real_of_preal_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
676 |
"!!(x::preal). y < x ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
677 |
\ EX m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m"; |
5588 | 678 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
679 |
simpset() addsimps preal_add_ac)); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
680 |
qed "real_of_preal_ExI"; |
5588 | 681 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
682 |
Goalw [real_of_preal_def] |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
683 |
"!!(x::preal). EX m. Abs_real (realrel ^^ {(x,y)}) = \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
684 |
\ real_of_preal m ==> y < x"; |
5588 | 685 |
by (auto_tac (claset(), |
686 |
simpset() addsimps |
|
687 |
[preal_add_commute,preal_add_assoc])); |
|
688 |
by (asm_full_simp_tac (simpset() addsimps |
|
689 |
[preal_add_assoc RS sym,preal_self_less_add_left]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
690 |
qed "real_of_preal_ExD"; |
5588 | 691 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
692 |
Goal "(EX m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m) = (y < x)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
693 |
by (blast_tac (claset() addSIs [real_of_preal_ExI,real_of_preal_ExD]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
694 |
qed "real_of_preal_iff"; |
5588 | 695 |
|
696 |
(*** Gleason prop 9-4.4 p 127 ***) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
697 |
Goalw [real_of_preal_def,real_zero_def] |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
698 |
"EX m. (x::real) = real_of_preal m | x = 0 | x = -(real_of_preal m)"; |
5588 | 699 |
by (res_inst_tac [("z","x")] eq_Abs_real 1); |
700 |
by (auto_tac (claset(),simpset() addsimps [real_minus] @ preal_add_ac)); |
|
701 |
by (cut_inst_tac [("r1.0","x"),("r2.0","y")] preal_linear 1); |
|
702 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
|
703 |
simpset() addsimps [preal_add_assoc RS sym])); |
|
704 |
by (auto_tac (claset(),simpset() addsimps [preal_add_commute])); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
705 |
qed "real_of_preal_trichotomy"; |
5588 | 706 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
707 |
Goal "!!P. [| !!m. x = real_of_preal m ==> P; \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
708 |
\ x = 0 ==> P; \ |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
709 |
\ !!m. x = -(real_of_preal m) ==> P |] ==> P"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
710 |
by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1); |
5588 | 711 |
by Auto_tac; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
712 |
qed "real_of_preal_trichotomyE"; |
5588 | 713 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
714 |
Goalw [real_of_preal_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
715 |
"real_of_preal m1 < real_of_preal m2 ==> m1 < m2"; |
5588 | 716 |
by (auto_tac (claset(),simpset() addsimps [real_less_def] @ preal_add_ac)); |
717 |
by (auto_tac (claset(),simpset() addsimps [preal_add_assoc RS sym])); |
|
718 |
by (auto_tac (claset(),simpset() addsimps preal_add_ac)); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
719 |
qed "real_of_preal_lessD"; |
5588 | 720 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
721 |
Goal "m1 < m2 ==> real_of_preal m1 < real_of_preal m2"; |
5588 | 722 |
by (dtac preal_less_add_left_Ex 1); |
723 |
by (auto_tac (claset(), |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
724 |
simpset() addsimps [real_of_preal_add, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
725 |
real_of_preal_def,real_less_def])); |
5588 | 726 |
by (REPEAT(rtac exI 1)); |
727 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
728 |
by (REPEAT(Blast_tac 2)); |
|
729 |
by (simp_tac (simpset() addsimps [preal_self_less_add_left] |
|
730 |
delsimps [preal_add_less_iff2]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
731 |
qed "real_of_preal_lessI"; |
5588 | 732 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
733 |
Goal "(real_of_preal m1 < real_of_preal m2) = (m1 < m2)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
734 |
by (blast_tac (claset() addIs [real_of_preal_lessI,real_of_preal_lessD]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
735 |
qed "real_of_preal_less_iff1"; |
5588 | 736 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
737 |
Addsimps [real_of_preal_less_iff1]; |
5588 | 738 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
739 |
Goal "- real_of_preal m < real_of_preal m"; |
5588 | 740 |
by (auto_tac (claset(), |
741 |
simpset() addsimps |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
742 |
[real_of_preal_def,real_less_def,real_minus])); |
5588 | 743 |
by (REPEAT(rtac exI 1)); |
744 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
745 |
by (REPEAT(Blast_tac 2)); |
|
746 |
by (full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
747 |
by (full_simp_tac (simpset() addsimps [preal_self_less_add_right, |
|
748 |
preal_add_assoc RS sym]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
749 |
qed "real_of_preal_minus_less_self"; |
5588 | 750 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
751 |
Goalw [real_zero_def] "- real_of_preal m < 0"; |
5588 | 752 |
by (auto_tac (claset(), |
7292 | 753 |
simpset() addsimps [real_of_preal_def, |
754 |
real_less_def,real_minus])); |
|
5588 | 755 |
by (REPEAT(rtac exI 1)); |
756 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
757 |
by (REPEAT(Blast_tac 2)); |
|
758 |
by (full_simp_tac (simpset() addsimps |
|
759 |
[preal_self_less_add_right] @ preal_add_ac) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
760 |
qed "real_of_preal_minus_less_zero"; |
5588 | 761 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
762 |
Goal "~ 0 < - real_of_preal m"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
763 |
by (cut_facts_tac [real_of_preal_minus_less_zero] 1); |
5588 | 764 |
by (fast_tac (claset() addDs [real_less_trans] |
765 |
addEs [real_less_irrefl]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
766 |
qed "real_of_preal_not_minus_gt_zero"; |
5588 | 767 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
768 |
Goalw [real_zero_def] "0 < real_of_preal m"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
769 |
by (auto_tac (claset(),simpset() addsimps |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
770 |
[real_of_preal_def,real_less_def,real_minus])); |
5588 | 771 |
by (REPEAT(rtac exI 1)); |
772 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
773 |
by (REPEAT(Blast_tac 2)); |
|
774 |
by (full_simp_tac (simpset() addsimps |
|
775 |
[preal_self_less_add_right] @ preal_add_ac) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
776 |
qed "real_of_preal_zero_less"; |
5588 | 777 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
778 |
Goal "~ real_of_preal m < 0"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
779 |
by (cut_facts_tac [real_of_preal_zero_less] 1); |
5588 | 780 |
by (blast_tac (claset() addDs [real_less_trans] |
7292 | 781 |
addEs [real_less_irrefl]) 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
782 |
qed "real_of_preal_not_less_zero"; |
5588 | 783 |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
784 |
Goal "0 < - (- real_of_preal m)"; |
5588 | 785 |
by (simp_tac (simpset() addsimps |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
786 |
[real_of_preal_zero_less]) 1); |
5588 | 787 |
qed "real_minus_minus_zero_less"; |
788 |
||
789 |
(* another lemma *) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
790 |
Goalw [real_zero_def] |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
791 |
"0 < real_of_preal m + real_of_preal m1"; |
5588 | 792 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
793 |
simpset() addsimps [real_of_preal_def, |
7292 | 794 |
real_less_def,real_add])); |
5588 | 795 |
by (REPEAT(rtac exI 1)); |
796 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
797 |
by (REPEAT(Blast_tac 2)); |
|
798 |
by (full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
799 |
by (full_simp_tac (simpset() addsimps [preal_self_less_add_right, |
|
800 |
preal_add_assoc RS sym]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
801 |
qed "real_of_preal_sum_zero_less"; |
5588 | 802 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
803 |
Goal "- real_of_preal m < real_of_preal m1"; |
5588 | 804 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
805 |
simpset() addsimps [real_of_preal_def, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
806 |
real_less_def,real_minus])); |
5588 | 807 |
by (REPEAT(rtac exI 1)); |
808 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
809 |
by (REPEAT(Blast_tac 2)); |
|
810 |
by (full_simp_tac (simpset() addsimps preal_add_ac) 1); |
|
811 |
by (full_simp_tac (simpset() addsimps [preal_self_less_add_right, |
|
812 |
preal_add_assoc RS sym]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
813 |
qed "real_of_preal_minus_less_all"; |
5588 | 814 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
815 |
Goal "~ real_of_preal m < - real_of_preal m1"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
816 |
by (cut_facts_tac [real_of_preal_minus_less_all] 1); |
5588 | 817 |
by (blast_tac (claset() addDs [real_less_trans] |
818 |
addEs [real_less_irrefl]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
819 |
qed "real_of_preal_not_minus_gt_all"; |
5588 | 820 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
821 |
Goal "- real_of_preal m1 < - real_of_preal m2 \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
822 |
\ ==> real_of_preal m2 < real_of_preal m1"; |
5588 | 823 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
824 |
simpset() addsimps [real_of_preal_def, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
825 |
real_less_def,real_minus])); |
5588 | 826 |
by (REPEAT(rtac exI 1)); |
827 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
828 |
by (REPEAT(Blast_tac 2)); |
|
829 |
by (auto_tac (claset(),simpset() addsimps preal_add_ac)); |
|
830 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1); |
|
831 |
by (auto_tac (claset(),simpset() addsimps preal_add_ac)); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
832 |
qed "real_of_preal_minus_less_rev1"; |
5588 | 833 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
834 |
Goal "real_of_preal m1 < real_of_preal m2 \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
835 |
\ ==> - real_of_preal m2 < - real_of_preal m1"; |
5588 | 836 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
837 |
simpset() addsimps [real_of_preal_def, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
838 |
real_less_def,real_minus])); |
5588 | 839 |
by (REPEAT(rtac exI 1)); |
840 |
by (EVERY[rtac conjI 1, rtac conjI 2]); |
|
841 |
by (REPEAT(Blast_tac 2)); |
|
842 |
by (auto_tac (claset(),simpset() addsimps preal_add_ac)); |
|
843 |
by (asm_full_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1); |
|
844 |
by (auto_tac (claset(),simpset() addsimps preal_add_ac)); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
845 |
qed "real_of_preal_minus_less_rev2"; |
5588 | 846 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
847 |
Goal "(- real_of_preal m1 < - real_of_preal m2) = \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
848 |
\ (real_of_preal m2 < real_of_preal m1)"; |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
849 |
by (blast_tac (claset() addSIs [real_of_preal_minus_less_rev1, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
850 |
real_of_preal_minus_less_rev2]) 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
851 |
qed "real_of_preal_minus_less_rev_iff"; |
5588 | 852 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
853 |
Addsimps [real_of_preal_minus_less_rev_iff]; |
5588 | 854 |
|
855 |
(*** linearity ***) |
|
856 |
Goal "(R1::real) < R2 | R1 = R2 | R2 < R1"; |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
857 |
by (res_inst_tac [("x","R1")] real_of_preal_trichotomyE 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
858 |
by (ALLGOALS(res_inst_tac [("x","R2")] real_of_preal_trichotomyE)); |
5588 | 859 |
by (auto_tac (claset() addSDs [preal_le_anti_sym], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
860 |
simpset() addsimps [preal_less_le_iff,real_of_preal_minus_less_zero, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
861 |
real_of_preal_zero_less,real_of_preal_minus_less_all])); |
5588 | 862 |
qed "real_linear"; |
863 |
||
864 |
Goal "!!w::real. (w ~= z) = (w<z | z<w)"; |
|
865 |
by (cut_facts_tac [real_linear] 1); |
|
866 |
by (Blast_tac 1); |
|
867 |
qed "real_neq_iff"; |
|
868 |
||
869 |
Goal "!!(R1::real). [| R1 < R2 ==> P; R1 = R2 ==> P; \ |
|
870 |
\ R2 < R1 ==> P |] ==> P"; |
|
871 |
by (cut_inst_tac [("R1.0","R1"),("R2.0","R2")] real_linear 1); |
|
872 |
by Auto_tac; |
|
873 |
qed "real_linear_less2"; |
|
874 |
||
875 |
(*** Properties of <= ***) |
|
876 |
||
877 |
Goalw [real_le_def] "~(w < z) ==> z <= (w::real)"; |
|
878 |
by (assume_tac 1); |
|
879 |
qed "real_leI"; |
|
880 |
||
881 |
Goalw [real_le_def] "z<=w ==> ~(w<(z::real))"; |
|
882 |
by (assume_tac 1); |
|
883 |
qed "real_leD"; |
|
884 |
||
7428 | 885 |
bind_thm ("real_leE", make_elim real_leD); |
5588 | 886 |
|
887 |
Goal "(~(w < z)) = (z <= (w::real))"; |
|
888 |
by (blast_tac (claset() addSIs [real_leI,real_leD]) 1); |
|
889 |
qed "real_less_le_iff"; |
|
890 |
||
891 |
Goalw [real_le_def] "~ z <= w ==> w<(z::real)"; |
|
892 |
by (Blast_tac 1); |
|
893 |
qed "not_real_leE"; |
|
894 |
||
895 |
Goalw [real_le_def] "z < w ==> z <= (w::real)"; |
|
896 |
by (blast_tac (claset() addEs [real_less_asym]) 1); |
|
897 |
qed "real_less_imp_le"; |
|
898 |
||
899 |
Goalw [real_le_def] "!!(x::real). x <= y ==> x < y | x = y"; |
|
900 |
by (cut_facts_tac [real_linear] 1); |
|
901 |
by (blast_tac (claset() addEs [real_less_irrefl,real_less_asym]) 1); |
|
902 |
qed "real_le_imp_less_or_eq"; |
|
903 |
||
904 |
Goalw [real_le_def] "z<w | z=w ==> z <=(w::real)"; |
|
905 |
by (cut_facts_tac [real_linear] 1); |
|
906 |
by (fast_tac (claset() addEs [real_less_irrefl,real_less_asym]) 1); |
|
907 |
qed "real_less_or_eq_imp_le"; |
|
908 |
||
909 |
Goal "(x <= (y::real)) = (x < y | x=y)"; |
|
910 |
by (REPEAT(ares_tac [iffI, real_less_or_eq_imp_le, real_le_imp_less_or_eq] 1)); |
|
911 |
qed "real_le_less"; |
|
912 |
||
913 |
Goal "w <= (w::real)"; |
|
914 |
by (simp_tac (simpset() addsimps [real_le_less]) 1); |
|
915 |
qed "real_le_refl"; |
|
916 |
||
917 |
AddIffs [real_le_refl]; |
|
918 |
||
919 |
(* Axiom 'linorder_linear' of class 'linorder': *) |
|
920 |
Goal "(z::real) <= w | w <= z"; |
|
921 |
by (simp_tac (simpset() addsimps [real_le_less]) 1); |
|
922 |
by (cut_facts_tac [real_linear] 1); |
|
923 |
by (Blast_tac 1); |
|
924 |
qed "real_le_linear"; |
|
925 |
||
926 |
Goal "[| i <= j; j < k |] ==> i < (k::real)"; |
|
927 |
by (dtac real_le_imp_less_or_eq 1); |
|
928 |
by (blast_tac (claset() addIs [real_less_trans]) 1); |
|
929 |
qed "real_le_less_trans"; |
|
930 |
||
931 |
Goal "!! (i::real). [| i < j; j <= k |] ==> i < k"; |
|
932 |
by (dtac real_le_imp_less_or_eq 1); |
|
933 |
by (blast_tac (claset() addIs [real_less_trans]) 1); |
|
934 |
qed "real_less_le_trans"; |
|
935 |
||
936 |
Goal "[| i <= j; j <= k |] ==> i <= (k::real)"; |
|
937 |
by (EVERY1 [dtac real_le_imp_less_or_eq, dtac real_le_imp_less_or_eq, |
|
938 |
rtac real_less_or_eq_imp_le, blast_tac (claset() addIs [real_less_trans])]); |
|
939 |
qed "real_le_trans"; |
|
940 |
||
941 |
Goal "[| z <= w; w <= z |] ==> z = (w::real)"; |
|
942 |
by (EVERY1 [dtac real_le_imp_less_or_eq, dtac real_le_imp_less_or_eq, |
|
943 |
fast_tac (claset() addEs [real_less_irrefl,real_less_asym])]); |
|
944 |
qed "real_le_anti_sym"; |
|
945 |
||
946 |
Goal "[| ~ y < x; y ~= x |] ==> x < (y::real)"; |
|
947 |
by (rtac not_real_leE 1); |
|
948 |
by (blast_tac (claset() addDs [real_le_imp_less_or_eq]) 1); |
|
949 |
qed "not_less_not_eq_real_less"; |
|
950 |
||
951 |
(* Axiom 'order_less_le' of class 'order': *) |
|
952 |
Goal "(w::real) < z = (w <= z & w ~= z)"; |
|
953 |
by (simp_tac (simpset() addsimps [real_le_def, real_neq_iff]) 1); |
|
954 |
by (blast_tac (claset() addSEs [real_less_asym]) 1); |
|
955 |
qed "real_less_le"; |
|
956 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
957 |
Goal "(0 < -R) = (R < (0::real))"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
958 |
by (res_inst_tac [("x","R")] real_of_preal_trichotomyE 1); |
5588 | 959 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
960 |
simpset() addsimps [real_of_preal_not_minus_gt_zero, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
961 |
real_of_preal_not_less_zero,real_of_preal_zero_less, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
962 |
real_of_preal_minus_less_zero])); |
5588 | 963 |
qed "real_minus_zero_less_iff"; |
964 |
||
965 |
Addsimps [real_minus_zero_less_iff]; |
|
966 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
967 |
Goal "(-R < 0) = ((0::real) < R)"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
968 |
by (res_inst_tac [("x","R")] real_of_preal_trichotomyE 1); |
5588 | 969 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
970 |
simpset() addsimps [real_of_preal_not_minus_gt_zero, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
971 |
real_of_preal_not_less_zero,real_of_preal_zero_less, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
972 |
real_of_preal_minus_less_zero])); |
5588 | 973 |
qed "real_minus_zero_less_iff2"; |
974 |
||
975 |
(*Alternative definition for real_less*) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
976 |
Goal "R < S ==> EX T::real. 0 < T & R + T = S"; |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
977 |
by (res_inst_tac [("x","R")] real_of_preal_trichotomyE 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
978 |
by (ALLGOALS(res_inst_tac [("x","S")] real_of_preal_trichotomyE)); |
5588 | 979 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
980 |
simpset() addsimps [real_of_preal_not_minus_gt_all, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
981 |
real_of_preal_add, real_of_preal_not_less_zero, |
5588 | 982 |
real_less_not_refl, |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
983 |
real_of_preal_not_minus_gt_zero])); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
984 |
by (res_inst_tac [("x","real_of_preal D")] exI 1); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
985 |
by (res_inst_tac [("x","real_of_preal m+real_of_preal ma")] exI 2); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
986 |
by (res_inst_tac [("x","real_of_preal m")] exI 3); |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
987 |
by (res_inst_tac [("x","real_of_preal D")] exI 4); |
5588 | 988 |
by (auto_tac (claset(), |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
989 |
simpset() addsimps [real_of_preal_zero_less, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
990 |
real_of_preal_sum_zero_less,real_add_assoc])); |
5588 | 991 |
qed "real_less_add_positive_left_Ex"; |
992 |
||
993 |
(** change naff name(s)! **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
994 |
Goal "(W < S) ==> (0 < S + (-W::real))"; |
5588 | 995 |
by (dtac real_less_add_positive_left_Ex 1); |
996 |
by (auto_tac (claset(), |
|
997 |
simpset() addsimps [real_add_minus, |
|
998 |
real_add_zero_right] @ real_add_ac)); |
|
999 |
qed "real_less_sum_gt_zero"; |
|
1000 |
||
7127
48e235179ffb
added parentheses to cope with a possible reduction of the precedence of unary
paulson
parents:
7077
diff
changeset
|
1001 |
Goal "!!S::real. T = S + W ==> S = T + (-W)"; |
5588 | 1002 |
by (asm_simp_tac (simpset() addsimps real_add_ac) 1); |
1003 |
qed "real_lemma_change_eq_subj"; |
|
1004 |
||
1005 |
(* FIXME: long! *) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
1006 |
Goal "(0 < S + (-W::real)) ==> (W < S)"; |
5588 | 1007 |
by (rtac ccontr 1); |
1008 |
by (dtac (real_leI RS real_le_imp_less_or_eq) 1); |
|
1009 |
by (auto_tac (claset(), |
|
1010 |
simpset() addsimps [real_less_not_refl])); |
|
1011 |
by (EVERY1[dtac real_less_add_positive_left_Ex, etac exE, etac conjE]); |
|
1012 |
by (Asm_full_simp_tac 1); |
|
1013 |
by (dtac real_lemma_change_eq_subj 1); |
|
1014 |
by Auto_tac; |
|
1015 |
by (dtac real_less_sum_gt_zero 1); |
|
1016 |
by (asm_full_simp_tac (simpset() addsimps real_add_ac) 1); |
|
1017 |
by (EVERY1[rotate_tac 1, dtac (real_add_left_commute RS ssubst)]); |
|
1018 |
by (auto_tac (claset() addEs [real_less_asym], simpset())); |
|
1019 |
qed "real_sum_gt_zero_less"; |
|
1020 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
1021 |
Goal "(0 < S + (-W::real)) = (W < S)"; |
5588 | 1022 |
by (blast_tac (claset() addIs [real_less_sum_gt_zero, |
1023 |
real_sum_gt_zero_less]) 1); |
|
1024 |
qed "real_less_sum_gt_0_iff"; |
|
1025 |
||
1026 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8027
diff
changeset
|
1027 |
Goalw [real_diff_def] "(x<y) = (x-y < (0::real))"; |
5588 | 1028 |
by (stac (real_minus_zero_less_iff RS sym) 1); |
1029 |
by (simp_tac (simpset() addsimps [real_add_commute, |
|
1030 |
real_less_sum_gt_0_iff]) 1); |
|
1031 |
qed "real_less_eq_diff"; |
|
1032 |
||
1033 |
||
1034 |
(*** Subtraction laws ***) |
|
1035 |
||
1036 |
Goal "x + (y - z) = (x + y) - (z::real)"; |
|
1037 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1038 |
qed "real_add_diff_eq"; |
|
1039 |
||
1040 |
Goal "(x - y) + z = (x + z) - (y::real)"; |
|
1041 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1042 |
qed "real_diff_add_eq"; |
|
1043 |
||
1044 |
Goal "(x - y) - z = x - (y + (z::real))"; |
|
1045 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1046 |
qed "real_diff_diff_eq"; |
|
1047 |
||
1048 |
Goal "x - (y - z) = (x + z) - (y::real)"; |
|
1049 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1050 |
qed "real_diff_diff_eq2"; |
|
1051 |
||
1052 |
Goal "(x-y < z) = (x < z + (y::real))"; |
|
1053 |
by (stac real_less_eq_diff 1); |
|
1054 |
by (res_inst_tac [("y1", "z")] (real_less_eq_diff RS ssubst) 1); |
|
1055 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1056 |
qed "real_diff_less_eq"; |
|
1057 |
||
1058 |
Goal "(x < z-y) = (x + (y::real) < z)"; |
|
1059 |
by (stac real_less_eq_diff 1); |
|
1060 |
by (res_inst_tac [("y1", "z-y")] (real_less_eq_diff RS ssubst) 1); |
|
1061 |
by (simp_tac (simpset() addsimps real_diff_def::real_add_ac) 1); |
|
1062 |
qed "real_less_diff_eq"; |
|
1063 |
||
1064 |
Goalw [real_le_def] "(x-y <= z) = (x <= z + (y::real))"; |
|
1065 |
by (simp_tac (simpset() addsimps [real_less_diff_eq]) 1); |
|
1066 |
qed "real_diff_le_eq"; |
|
1067 |
||
1068 |
Goalw [real_le_def] "(x <= z-y) = (x + (y::real) <= z)"; |
|
1069 |
by (simp_tac (simpset() addsimps [real_diff_less_eq]) 1); |
|
1070 |
qed "real_le_diff_eq"; |
|
1071 |
||
1072 |
Goalw [real_diff_def] "(x-y = z) = (x = z + (y::real))"; |
|
1073 |
by (auto_tac (claset(), simpset() addsimps [real_add_assoc])); |
|
1074 |
qed "real_diff_eq_eq"; |
|
1075 |
||
1076 |
Goalw [real_diff_def] "(x = z-y) = (x + (y::real) = z)"; |
|
1077 |
by (auto_tac (claset(), simpset() addsimps [real_add_assoc])); |
|
1078 |
qed "real_eq_diff_eq"; |
|
1079 |
||
1080 |
(*This list of rewrites simplifies (in)equalities by bringing subtractions |
|
1081 |
to the top and then moving negative terms to the other side. |
|
1082 |
Use with real_add_ac*) |
|
9108 | 1083 |
bind_thms ("real_compare_rls", |
5588 | 1084 |
[symmetric real_diff_def, |
1085 |
real_add_diff_eq, real_diff_add_eq, real_diff_diff_eq, real_diff_diff_eq2, |
|
1086 |
real_diff_less_eq, real_less_diff_eq, real_diff_le_eq, real_le_diff_eq, |
|
9108 | 1087 |
real_diff_eq_eq, real_eq_diff_eq]); |
5588 | 1088 |
|
1089 |
||
1090 |
(** For the cancellation simproc. |
|
1091 |
The idea is to cancel like terms on opposite sides by subtraction **) |
|
1092 |
||
1093 |
Goal "(x::real) - y = x' - y' ==> (x<y) = (x'<y')"; |
|
1094 |
by (stac real_less_eq_diff 1); |
|
1095 |
by (res_inst_tac [("y1", "y")] (real_less_eq_diff RS ssubst) 1); |
|
1096 |
by (Asm_simp_tac 1); |
|
1097 |
qed "real_less_eqI"; |
|
1098 |
||
1099 |
Goal "(x::real) - y = x' - y' ==> (y<=x) = (y'<=x')"; |
|
1100 |
by (dtac real_less_eqI 1); |
|
1101 |
by (asm_simp_tac (simpset() addsimps [real_le_def]) 1); |
|
1102 |
qed "real_le_eqI"; |
|
1103 |
||
1104 |
Goal "(x::real) - y = x' - y' ==> (x=y) = (x'=y')"; |
|
1105 |
by Safe_tac; |
|
1106 |
by (ALLGOALS |
|
1107 |
(asm_full_simp_tac |
|
1108 |
(simpset() addsimps [real_eq_diff_eq, real_diff_eq_eq]))); |
|
1109 |
qed "real_eq_eqI"; |