author | paulson |
Thu, 06 Jul 2000 15:01:52 +0200 | |
changeset 9266 | 1b917b8b1b38 |
parent 9189 | 69b71b554e91 |
child 9427 | a9c60e655107 |
permissions | -rw-r--r-- |
5078 | 1 |
(* Title : PReal.ML |
7219 | 2 |
ID : $Id$ |
5078 | 3 |
Author : Jacques D. Fleuriot |
4 |
Copyright : 1998 University of Cambridge |
|
5 |
Description : The positive reals as Dedekind sections of positive |
|
6 |
rationals. Fundamentals of Abstract Analysis |
|
7 |
[Gleason- p. 121] provides some of the definitions. |
|
8 |
*) |
|
9 |
||
5521 | 10 |
claset_ref() := claset() delWrapper "bspec"; |
11 |
||
5078 | 12 |
Goal "inj_on Abs_preal preal"; |
13 |
by (rtac inj_on_inverseI 1); |
|
14 |
by (etac Abs_preal_inverse 1); |
|
15 |
qed "inj_on_Abs_preal"; |
|
16 |
||
17 |
Addsimps [inj_on_Abs_preal RS inj_on_iff]; |
|
18 |
||
19 |
Goal "inj(Rep_preal)"; |
|
20 |
by (rtac inj_inverseI 1); |
|
21 |
by (rtac Rep_preal_inverse 1); |
|
22 |
qed "inj_Rep_preal"; |
|
23 |
||
24 |
Goalw [preal_def] "{} ~: preal"; |
|
25 |
by (Fast_tac 1); |
|
26 |
qed "empty_not_mem_preal"; |
|
27 |
||
28 |
(* {} : preal ==> P *) |
|
29 |
bind_thm ("empty_not_mem_prealE", empty_not_mem_preal RS notE); |
|
30 |
||
31 |
Addsimps [empty_not_mem_preal]; |
|
32 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
33 |
Goalw [preal_def] "{x::prat. x < prat_of_pnat (Abs_pnat 1)} : preal"; |
5078 | 34 |
by (rtac preal_1 1); |
35 |
qed "one_set_mem_preal"; |
|
36 |
||
37 |
Addsimps [one_set_mem_preal]; |
|
38 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
39 |
Goalw [preal_def] "x : preal ==> {} < x"; |
5078 | 40 |
by (Fast_tac 1); |
41 |
qed "preal_psubset_empty"; |
|
42 |
||
43 |
Goal "{} < Rep_preal x"; |
|
44 |
by (rtac (Rep_preal RS preal_psubset_empty) 1); |
|
45 |
qed "Rep_preal_psubset_empty"; |
|
46 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
47 |
Goal "EX x. x: Rep_preal X"; |
5078 | 48 |
by (cut_inst_tac [("x","X")] Rep_preal_psubset_empty 1); |
49 |
by (auto_tac (claset() addIs [(equals0I RS sym)], |
|
50 |
simpset() addsimps [psubset_def])); |
|
51 |
qed "mem_Rep_preal_Ex"; |
|
52 |
||
53 |
Goalw [preal_def] |
|
7825
1be9b63e7d93
replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents:
7499
diff
changeset
|
54 |
"[| {} < A; A < UNIV; \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
55 |
\ (ALL y: A. ((ALL z. z < y --> z: A) & \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
56 |
\ (EX u: A. y < u))) |] ==> A : preal"; |
5078 | 57 |
by (Fast_tac 1); |
58 |
qed "prealI1"; |
|
59 |
||
60 |
Goalw [preal_def] |
|
7825
1be9b63e7d93
replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents:
7499
diff
changeset
|
61 |
"[| {} < A; A < UNIV; \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
62 |
\ ALL y: A. (ALL z. z < y --> z: A); \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
63 |
\ ALL y: A. (EX u: A. y < u) |] ==> A : preal"; |
5078 | 64 |
by (Best_tac 1); |
65 |
qed "prealI2"; |
|
66 |
||
67 |
Goalw [preal_def] |
|
7825
1be9b63e7d93
replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents:
7499
diff
changeset
|
68 |
"A : preal ==> {} < A & A < UNIV & \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
69 |
\ (ALL y: A. ((ALL z. z < y --> z: A) & \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
70 |
\ (EX u: A. y < u)))"; |
5078 | 71 |
by (Fast_tac 1); |
72 |
qed "prealE_lemma"; |
|
73 |
||
74 |
||
75 |
AddSIs [prealI1,prealI2]; |
|
76 |
||
77 |
Addsimps [Abs_preal_inverse]; |
|
78 |
||
79 |
||
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
80 |
Goalw [preal_def] "A : preal ==> {} < A"; |
5078 | 81 |
by (Fast_tac 1); |
82 |
qed "prealE_lemma1"; |
|
83 |
||
7825
1be9b63e7d93
replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents:
7499
diff
changeset
|
84 |
Goalw [preal_def] "A : preal ==> A < UNIV"; |
5078 | 85 |
by (Fast_tac 1); |
86 |
qed "prealE_lemma2"; |
|
87 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
88 |
Goalw [preal_def] "A : preal ==> ALL y: A. (ALL z. z < y --> z: A)"; |
5078 | 89 |
by (Fast_tac 1); |
90 |
qed "prealE_lemma3"; |
|
91 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
92 |
Goal "[| A : preal; y: A |] ==> (ALL z. z < y --> z: A)"; |
5078 | 93 |
by (fast_tac (claset() addSDs [prealE_lemma3]) 1); |
94 |
qed "prealE_lemma3a"; |
|
95 |
||
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
96 |
Goal "[| A : preal; y: A; z < y |] ==> z: A"; |
5078 | 97 |
by (fast_tac (claset() addSDs [prealE_lemma3a]) 1); |
98 |
qed "prealE_lemma3b"; |
|
99 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
100 |
Goalw [preal_def] "A : preal ==> ALL y: A. (EX u: A. y < u)"; |
5078 | 101 |
by (Fast_tac 1); |
102 |
qed "prealE_lemma4"; |
|
103 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
104 |
Goal "[| A : preal; y: A |] ==> EX u: A. y < u"; |
5078 | 105 |
by (fast_tac (claset() addSDs [prealE_lemma4]) 1); |
106 |
qed "prealE_lemma4a"; |
|
107 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
108 |
Goal "EX x. x~: Rep_preal X"; |
5078 | 109 |
by (cut_inst_tac [("x","X")] Rep_preal 1); |
110 |
by (dtac prealE_lemma2 1); |
|
111 |
by (rtac ccontr 1); |
|
112 |
by (auto_tac (claset(),simpset() addsimps [psubset_def])); |
|
113 |
by (blast_tac (claset() addIs [set_ext] addEs [swap]) 1); |
|
114 |
qed "not_mem_Rep_preal_Ex"; |
|
115 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
116 |
(** preal_of_prat: the injection from prat to preal **) |
5078 | 117 |
(** A few lemmas **) |
118 |
||
119 |
Goal "{xa::prat. xa < y} : preal"; |
|
120 |
by (cut_facts_tac [qless_Ex] 1); |
|
8919 | 121 |
by (auto_tac (claset() addIs[prat_less_trans] |
122 |
addSEs [equalityCE, prat_less_irrefl], |
|
123 |
simpset())); |
|
124 |
by (blast_tac (claset() addDs [prat_dense]) 1); |
|
5078 | 125 |
qed "lemma_prat_less_set_mem_preal"; |
126 |
||
127 |
Goal "!!(x::prat). {xa. xa < x} = {x. x < y} ==> x = y"; |
|
128 |
by (cut_inst_tac [("q1.0","x"),("q2.0","y")] prat_linear 1); |
|
129 |
by Auto_tac; |
|
8919 | 130 |
by (dtac prat_dense 2 THEN etac exE 2); |
5078 | 131 |
by (dtac prat_dense 1 THEN etac exE 1); |
8919 | 132 |
by (auto_tac (claset() addDs [prat_less_not_sym] addSEs [equalityCE], |
133 |
simpset())); |
|
5078 | 134 |
qed "lemma_prat_set_eq"; |
135 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
136 |
Goal "inj(preal_of_prat)"; |
5078 | 137 |
by (rtac injI 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
138 |
by (rewtac preal_of_prat_def); |
5078 | 139 |
by (dtac (inj_on_Abs_preal RS inj_onD) 1); |
140 |
by (rtac lemma_prat_less_set_mem_preal 1); |
|
141 |
by (rtac lemma_prat_less_set_mem_preal 1); |
|
142 |
by (etac lemma_prat_set_eq 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
143 |
qed "inj_preal_of_prat"; |
5078 | 144 |
|
145 |
(*** theorems for ordering ***) |
|
146 |
(* prove introduction and elimination rules for preal_less *) |
|
147 |
||
148 |
(* A positive fraction not in a positive real is an upper bound *) |
|
149 |
(* Gleason p. 122 - Remark (1) *) |
|
150 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
151 |
Goal "x ~: Rep_preal(R) ==> ALL y: Rep_preal(R). y < x"; |
5078 | 152 |
by (cut_inst_tac [("x1","R")] (Rep_preal RS prealE_lemma) 1); |
153 |
by (auto_tac (claset() addIs [not_less_not_eq_prat_less],simpset())); |
|
154 |
qed "not_in_preal_ub"; |
|
155 |
||
156 |
(* preal_less is a strong order i.e nonreflexive and transitive *) |
|
157 |
||
158 |
Goalw [preal_less_def] "~ (x::preal) < x"; |
|
159 |
by (simp_tac (simpset() addsimps [psubset_def]) 1); |
|
160 |
qed "preal_less_not_refl"; |
|
161 |
||
162 |
(*** y < y ==> P ***) |
|
163 |
bind_thm("preal_less_irrefl",preal_less_not_refl RS notE); |
|
164 |
||
165 |
Goal "!!(x::preal). x < y ==> x ~= y"; |
|
166 |
by (auto_tac (claset(),simpset() addsimps [preal_less_not_refl])); |
|
167 |
qed "preal_not_refl2"; |
|
168 |
||
169 |
Goalw [preal_less_def] "!!(x::preal). [| x < y; y < z |] ==> x < z"; |
|
170 |
by (auto_tac (claset() addDs [subsetD,equalityI], |
|
171 |
simpset() addsimps [psubset_def])); |
|
172 |
qed "preal_less_trans"; |
|
173 |
||
5459 | 174 |
Goal "!! (q1::preal). q1 < q2 ==> ~ q2 < q1"; |
175 |
by (rtac notI 1); |
|
5078 | 176 |
by (dtac preal_less_trans 1 THEN assume_tac 1); |
177 |
by (asm_full_simp_tac (simpset() addsimps [preal_less_not_refl]) 1); |
|
5459 | 178 |
qed "preal_less_not_sym"; |
179 |
||
180 |
(* [| x < y; ~P ==> y < x |] ==> P *) |
|
181 |
bind_thm ("preal_less_asym", preal_less_not_sym RS swap); |
|
5078 | 182 |
|
183 |
Goalw [preal_less_def] |
|
184 |
"(r1::preal) < r2 | r1 = r2 | r2 < r1"; |
|
185 |
by (auto_tac (claset() addSDs [inj_Rep_preal RS injD], |
|
186 |
simpset() addsimps [psubset_def])); |
|
187 |
by (rtac prealE_lemma3b 1 THEN rtac Rep_preal 1); |
|
188 |
by (assume_tac 1); |
|
189 |
by (fast_tac (claset() addDs [not_in_preal_ub]) 1); |
|
190 |
qed "preal_linear"; |
|
191 |
||
5459 | 192 |
Goal "!!(r1::preal). [| r1 < r2 ==> P; r1 = r2 ==> P; \ |
193 |
\ r2 < r1 ==> P |] ==> P"; |
|
5078 | 194 |
by (cut_inst_tac [("r1.0","r1"),("r2.0","r2")] preal_linear 1); |
195 |
by Auto_tac; |
|
196 |
qed "preal_linear_less2"; |
|
197 |
||
198 |
(*** Properties of addition ***) |
|
199 |
||
200 |
Goalw [preal_add_def] "(x::preal) + y = y + x"; |
|
201 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
|
202 |
by (rtac set_ext 1); |
|
203 |
by (blast_tac (claset() addIs [prat_add_commute RS subst]) 1); |
|
204 |
qed "preal_add_commute"; |
|
205 |
||
206 |
(** addition of two positive reals gives a positive real **) |
|
207 |
(** lemmas for proving positive reals addition set in preal **) |
|
208 |
||
209 |
(** Part 1 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
210 |
Goal "{} < {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y}"; |
5078 | 211 |
by (cut_facts_tac [mem_Rep_preal_Ex,mem_Rep_preal_Ex] 1); |
212 |
by (auto_tac (claset() addSIs [psubsetI] addEs [equalityCE],simpset())); |
|
213 |
qed "preal_add_set_not_empty"; |
|
214 |
||
215 |
(** Part 2 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
216 |
Goal "EX q. q ~: {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y}"; |
5078 | 217 |
by (cut_inst_tac [("X","R")] not_mem_Rep_preal_Ex 1); |
218 |
by (cut_inst_tac [("X","S")] not_mem_Rep_preal_Ex 1); |
|
219 |
by (REPEAT(etac exE 1)); |
|
220 |
by (REPEAT(dtac not_in_preal_ub 1)); |
|
221 |
by (res_inst_tac [("x","x+xa")] exI 1); |
|
222 |
by (Auto_tac THEN (REPEAT(etac ballE 1)) THEN Auto_tac); |
|
223 |
by (dtac prat_add_less_mono 1); |
|
224 |
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl])); |
|
225 |
qed "preal_not_mem_add_set_Ex"; |
|
226 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
227 |
Goal "{w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y} < UNIV"; |
5078 | 228 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
229 |
by (cut_inst_tac [("R","R"),("S","S")] preal_not_mem_add_set_Ex 1); |
|
230 |
by (etac exE 1); |
|
231 |
by (eres_inst_tac [("c","q")] equalityCE 1); |
|
232 |
by Auto_tac; |
|
233 |
qed "preal_add_set_not_prat_set"; |
|
234 |
||
235 |
(** Part 3 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
236 |
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
237 |
\ ALL z. z < y --> z : {w. EX x:Rep_preal R. EX y:Rep_preal S. w = x + y}"; |
5078 | 238 |
by Auto_tac; |
7499 | 239 |
by (ftac prat_mult_qinv_less_1 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
240 |
by (forw_inst_tac [("x","x"),("q2.0","prat_of_pnat (Abs_pnat 1)")] |
5078 | 241 |
prat_mult_less2_mono1 1); |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
242 |
by (forw_inst_tac [("x","ya"),("q2.0","prat_of_pnat (Abs_pnat 1)")] |
5078 | 243 |
prat_mult_less2_mono1 1); |
244 |
by (Asm_full_simp_tac 1); |
|
245 |
by (REPEAT(dtac (Rep_preal RS prealE_lemma3a) 1)); |
|
246 |
by (REPEAT(etac allE 1)); |
|
247 |
by Auto_tac; |
|
248 |
by (REPEAT(rtac bexI 1)); |
|
249 |
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib2 |
|
250 |
RS sym,prat_add_assoc RS sym,prat_mult_assoc])); |
|
251 |
qed "preal_add_set_lemma3"; |
|
252 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
253 |
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
254 |
\ EX u: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. y < u"; |
5078 | 255 |
by Auto_tac; |
256 |
by (dtac (Rep_preal RS prealE_lemma4a) 1); |
|
257 |
by (auto_tac (claset() addIs [prat_add_less2_mono1],simpset())); |
|
258 |
qed "preal_add_set_lemma4"; |
|
259 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
260 |
Goal "{w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y} : preal"; |
5078 | 261 |
by (rtac prealI2 1); |
262 |
by (rtac preal_add_set_not_empty 1); |
|
263 |
by (rtac preal_add_set_not_prat_set 1); |
|
264 |
by (rtac preal_add_set_lemma3 1); |
|
265 |
by (rtac preal_add_set_lemma4 1); |
|
266 |
qed "preal_mem_add_set"; |
|
267 |
||
268 |
Goalw [preal_add_def] "((x::preal) + y) + z = x + (y + z)"; |
|
269 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
|
270 |
by (rtac set_ext 1); |
|
271 |
by (rtac (preal_mem_add_set RS Abs_preal_inverse RS ssubst) 1); |
|
272 |
by (rtac (preal_mem_add_set RS Abs_preal_inverse RS ssubst) 1); |
|
273 |
by (auto_tac (claset(),simpset() addsimps prat_add_ac)); |
|
274 |
by (rtac bexI 1); |
|
275 |
by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_add_ac)); |
|
276 |
qed "preal_add_assoc"; |
|
277 |
||
9266 | 278 |
Goal "(z1::preal) + (z2 + z3) = z2 + (z1 + z3)"; |
279 |
by (rtac (preal_add_commute RS trans) 1); |
|
280 |
by (rtac (preal_add_assoc RS trans) 1); |
|
281 |
by (rtac (preal_add_commute RS arg_cong) 1); |
|
282 |
qed "preal_add_left_commute"; |
|
5078 | 283 |
|
284 |
(* Positive Reals addition is an AC operator *) |
|
9108 | 285 |
bind_thms ("preal_add_ac", [preal_add_assoc, preal_add_commute, preal_add_left_commute]); |
5078 | 286 |
|
287 |
(*** Properties of multiplication ***) |
|
288 |
||
289 |
(** Proofs essentially same as for addition **) |
|
290 |
||
291 |
Goalw [preal_mult_def] "(x::preal) * y = y * x"; |
|
292 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
|
293 |
by (rtac set_ext 1); |
|
294 |
by (blast_tac (claset() addIs [prat_mult_commute RS subst]) 1); |
|
295 |
qed "preal_mult_commute"; |
|
296 |
||
297 |
(** multiplication of two positive reals gives a positive real **) |
|
298 |
(** lemmas for proving positive reals multiplication set in preal **) |
|
299 |
||
300 |
(** Part 1 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
301 |
Goal "{} < {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y}"; |
5078 | 302 |
by (cut_facts_tac [mem_Rep_preal_Ex,mem_Rep_preal_Ex] 1); |
303 |
by (auto_tac (claset() addSIs [psubsetI] addEs [equalityCE],simpset())); |
|
304 |
qed "preal_mult_set_not_empty"; |
|
305 |
||
306 |
(** Part 2 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
307 |
Goal "EX q. q ~: {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y}"; |
5078 | 308 |
by (cut_inst_tac [("X","R")] not_mem_Rep_preal_Ex 1); |
309 |
by (cut_inst_tac [("X","S")] not_mem_Rep_preal_Ex 1); |
|
310 |
by (REPEAT(etac exE 1)); |
|
311 |
by (REPEAT(dtac not_in_preal_ub 1)); |
|
312 |
by (res_inst_tac [("x","x*xa")] exI 1); |
|
313 |
by (Auto_tac THEN (REPEAT(etac ballE 1)) THEN Auto_tac ); |
|
314 |
by (dtac prat_mult_less_mono 1); |
|
315 |
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl])); |
|
316 |
qed "preal_not_mem_mult_set_Ex"; |
|
317 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
318 |
Goal "{w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y} < UNIV"; |
5078 | 319 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
320 |
by (cut_inst_tac [("R","R"),("S","S")] preal_not_mem_mult_set_Ex 1); |
|
321 |
by (etac exE 1); |
|
322 |
by (eres_inst_tac [("c","q")] equalityCE 1); |
|
323 |
by Auto_tac; |
|
324 |
qed "preal_mult_set_not_prat_set"; |
|
325 |
||
326 |
(** Part 3 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
327 |
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
328 |
\ ALL z. z < y --> z : {w. EX x:Rep_preal R. EX y:Rep_preal S. w = x * y}"; |
5078 | 329 |
by Auto_tac; |
330 |
by (forw_inst_tac [("x","qinv(ya)"),("q1.0","z")] |
|
331 |
prat_mult_left_less2_mono1 1); |
|
332 |
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1); |
|
333 |
by (dtac (Rep_preal RS prealE_lemma3a) 1); |
|
334 |
by (etac allE 1); |
|
335 |
by (REPEAT(rtac bexI 1)); |
|
336 |
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc])); |
|
337 |
qed "preal_mult_set_lemma3"; |
|
338 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
339 |
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
340 |
\ EX u: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. y < u"; |
5078 | 341 |
by Auto_tac; |
342 |
by (dtac (Rep_preal RS prealE_lemma4a) 1); |
|
343 |
by (auto_tac (claset() addIs [prat_mult_less2_mono1],simpset())); |
|
344 |
qed "preal_mult_set_lemma4"; |
|
345 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
346 |
Goal "{w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y} : preal"; |
5078 | 347 |
by (rtac prealI2 1); |
348 |
by (rtac preal_mult_set_not_empty 1); |
|
349 |
by (rtac preal_mult_set_not_prat_set 1); |
|
350 |
by (rtac preal_mult_set_lemma3 1); |
|
351 |
by (rtac preal_mult_set_lemma4 1); |
|
352 |
qed "preal_mem_mult_set"; |
|
353 |
||
354 |
Goalw [preal_mult_def] "((x::preal) * y) * z = x * (y * z)"; |
|
355 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
|
356 |
by (rtac set_ext 1); |
|
357 |
by (rtac (preal_mem_mult_set RS Abs_preal_inverse RS ssubst) 1); |
|
358 |
by (rtac (preal_mem_mult_set RS Abs_preal_inverse RS ssubst) 1); |
|
359 |
by (auto_tac (claset(),simpset() addsimps prat_mult_ac)); |
|
360 |
by (rtac bexI 1); |
|
361 |
by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_mult_ac)); |
|
362 |
qed "preal_mult_assoc"; |
|
363 |
||
9266 | 364 |
Goal "(z1::preal) * (z2 * z3) = z2 * (z1 * z3)"; |
365 |
by (rtac (preal_mult_commute RS trans) 1); |
|
366 |
by (rtac (preal_mult_assoc RS trans) 1); |
|
367 |
by (rtac (preal_mult_commute RS arg_cong) 1); |
|
368 |
qed "preal_mult_left_commute"; |
|
5078 | 369 |
|
370 |
(* Positive Reals multiplication is an AC operator *) |
|
9108 | 371 |
bind_thms ("preal_mult_ac", [preal_mult_assoc, |
5078 | 372 |
preal_mult_commute, |
9108 | 373 |
preal_mult_left_commute]); |
5078 | 374 |
|
375 |
(* Positive Real 1 is the multiplicative identity element *) |
|
376 |
(* long *) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
377 |
Goalw [preal_of_prat_def,preal_mult_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
378 |
"(preal_of_prat (prat_of_pnat (Abs_pnat 1))) * z = z"; |
5078 | 379 |
by (rtac (Rep_preal_inverse RS subst) 1); |
380 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
|
381 |
by (rtac (one_set_mem_preal RS Abs_preal_inverse RS ssubst) 1); |
|
382 |
by (rtac set_ext 1); |
|
383 |
by (auto_tac(claset(),simpset() addsimps [Rep_preal_inverse])); |
|
384 |
by (EVERY1[dtac (Rep_preal RS prealE_lemma4a),etac bexE]); |
|
385 |
by (dtac prat_mult_less_mono 1); |
|
386 |
by (auto_tac (claset() addDs [Rep_preal RS prealE_lemma3a],simpset())); |
|
387 |
by (EVERY1[forward_tac [Rep_preal RS prealE_lemma4a],etac bexE]); |
|
388 |
by (forw_inst_tac [("x","qinv(u)"),("q1.0","x")] |
|
389 |
prat_mult_less2_mono1 1); |
|
390 |
by (rtac exI 1 THEN Auto_tac THEN res_inst_tac [("x","u")] bexI 1); |
|
391 |
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc])); |
|
392 |
qed "preal_mult_1"; |
|
393 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
394 |
Goal "z * (preal_of_prat (prat_of_pnat (Abs_pnat 1))) = z"; |
5078 | 395 |
by (rtac (preal_mult_commute RS subst) 1); |
396 |
by (rtac preal_mult_1 1); |
|
397 |
qed "preal_mult_1_right"; |
|
398 |
||
399 |
(** Lemmas **) |
|
400 |
||
9266 | 401 |
Goal "(z::preal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"; |
402 |
by (asm_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1); |
|
403 |
qed "preal_add_assoc_cong"; |
|
5078 | 404 |
|
9266 | 405 |
Goal "(z::preal) + (v + w) = v + (z + w)"; |
406 |
by (REPEAT (ares_tac [preal_add_commute RS preal_add_assoc_cong] 1)); |
|
407 |
qed "preal_add_assoc_swap"; |
|
5078 | 408 |
|
409 |
(** Distribution of multiplication across addition **) |
|
410 |
(** lemmas for the proof **) |
|
411 |
||
412 |
(** lemmas **) |
|
413 |
Goalw [preal_add_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
414 |
"z: Rep_preal(R+S) ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
415 |
\ EX x: Rep_preal(R). EX y: Rep_preal(S). z = x + y"; |
5078 | 416 |
by (dtac (preal_mem_add_set RS Abs_preal_inverse RS subst) 1); |
417 |
by (Fast_tac 1); |
|
418 |
qed "mem_Rep_preal_addD"; |
|
419 |
||
420 |
Goalw [preal_add_def] |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
421 |
"EX x: Rep_preal(R). EX y: Rep_preal(S). z = x + y \ |
5078 | 422 |
\ ==> z: Rep_preal(R+S)"; |
423 |
by (rtac (preal_mem_add_set RS Abs_preal_inverse RS ssubst) 1); |
|
424 |
by (Fast_tac 1); |
|
425 |
qed "mem_Rep_preal_addI"; |
|
426 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
427 |
Goal " z: Rep_preal(R+S) = (EX x: Rep_preal(R). \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
428 |
\ EX y: Rep_preal(S). z = x + y)"; |
5078 | 429 |
by (fast_tac (claset() addSIs [mem_Rep_preal_addD,mem_Rep_preal_addI]) 1); |
430 |
qed "mem_Rep_preal_add_iff"; |
|
431 |
||
432 |
Goalw [preal_mult_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
433 |
"z: Rep_preal(R*S) ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
434 |
\ EX x: Rep_preal(R). EX y: Rep_preal(S). z = x * y"; |
5078 | 435 |
by (dtac (preal_mem_mult_set RS Abs_preal_inverse RS subst) 1); |
436 |
by (Fast_tac 1); |
|
437 |
qed "mem_Rep_preal_multD"; |
|
438 |
||
439 |
Goalw [preal_mult_def] |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
440 |
"EX x: Rep_preal(R). EX y: Rep_preal(S). z = x * y \ |
5078 | 441 |
\ ==> z: Rep_preal(R*S)"; |
442 |
by (rtac (preal_mem_mult_set RS Abs_preal_inverse RS ssubst) 1); |
|
443 |
by (Fast_tac 1); |
|
444 |
qed "mem_Rep_preal_multI"; |
|
445 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
446 |
Goal " z: Rep_preal(R*S) = (EX x: Rep_preal(R). \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
447 |
\ EX y: Rep_preal(S). z = x * y)"; |
5078 | 448 |
by (fast_tac (claset() addSIs [mem_Rep_preal_multD,mem_Rep_preal_multI]) 1); |
449 |
qed "mem_Rep_preal_mult_iff"; |
|
450 |
||
451 |
(** More lemmas for preal_add_mult_distrib2 **) |
|
452 |
goal PRat.thy "!!(a1::prat). a1 < a2 ==> a1 * b + a2 * c < a2 * (b + c)"; |
|
453 |
by (auto_tac (claset() addSIs [prat_add_less2_mono1,prat_mult_less2_mono1], |
|
454 |
simpset() addsimps [prat_add_mult_distrib2])); |
|
455 |
qed "lemma_prat_add_mult_mono"; |
|
456 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
457 |
Goal "[| xb: Rep_preal z1; xc: Rep_preal z2; ya: \ |
5078 | 458 |
\ Rep_preal w; yb: Rep_preal w |] ==> \ |
459 |
\ xb * ya + xc * yb: Rep_preal (z1 * w + z2 * w)"; |
|
460 |
by (fast_tac (claset() addIs [mem_Rep_preal_addI,mem_Rep_preal_multI]) 1); |
|
461 |
qed "lemma_add_mult_mem_Rep_preal"; |
|
462 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
463 |
Goal "[| xb: Rep_preal z1; xc: Rep_preal z2; ya: \ |
5078 | 464 |
\ Rep_preal w; yb: Rep_preal w |] ==> \ |
465 |
\ yb*(xb + xc): Rep_preal (w*(z1 + z2))"; |
|
466 |
by (fast_tac (claset() addIs [mem_Rep_preal_addI,mem_Rep_preal_multI]) 1); |
|
467 |
qed "lemma_add_mult_mem_Rep_preal1"; |
|
468 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
469 |
Goal "x: Rep_preal (w * z1 + w * z2) ==> \ |
5078 | 470 |
\ x: Rep_preal (w * (z1 + z2))"; |
471 |
by (auto_tac (claset() addSDs [mem_Rep_preal_addD,mem_Rep_preal_multD], |
|
472 |
simpset())); |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
473 |
by (forw_inst_tac [("ya","xa"),("yb","xb"),("xb","ya"),("xc","yb")] |
5078 | 474 |
lemma_add_mult_mem_Rep_preal1 1); |
475 |
by Auto_tac; |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
476 |
by (res_inst_tac [("q1.0","xa"),("q2.0","xb")] prat_linear_less2 1); |
5078 | 477 |
by (dres_inst_tac [("b","ya"),("c","yb")] lemma_prat_add_mult_mono 1); |
478 |
by (rtac (Rep_preal RS prealE_lemma3b) 1); |
|
479 |
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib2])); |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
480 |
by (dres_inst_tac [("ya","xb"),("yb","xa"),("xc","ya"),("xb","yb")] |
5078 | 481 |
lemma_add_mult_mem_Rep_preal1 1); |
482 |
by Auto_tac; |
|
483 |
by (dres_inst_tac [("b","yb"),("c","ya")] lemma_prat_add_mult_mono 1); |
|
484 |
by (rtac (Rep_preal RS prealE_lemma3b) 1); |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
485 |
by (thin_tac "xb * ya + xb * yb : Rep_preal (w * (z1 + z2))" 1); |
5078 | 486 |
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib, |
487 |
prat_add_commute] @ preal_add_ac )); |
|
488 |
qed "lemma_preal_add_mult_distrib"; |
|
489 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
490 |
Goal "x: Rep_preal (w * (z1 + z2)) ==> \ |
5078 | 491 |
\ x: Rep_preal (w * z1 + w * z2)"; |
492 |
by (auto_tac (claset() addSDs [mem_Rep_preal_addD,mem_Rep_preal_multD] |
|
493 |
addSIs [bexI,mem_Rep_preal_addI,mem_Rep_preal_multI], |
|
494 |
simpset() addsimps [prat_add_mult_distrib2])); |
|
495 |
qed "lemma_preal_add_mult_distrib2"; |
|
496 |
||
497 |
Goal "(w * ((z1::preal) + z2)) = (w * z1) + (w * z2)"; |
|
498 |
by (rtac (inj_Rep_preal RS injD) 1); |
|
499 |
by (rtac set_ext 1); |
|
500 |
by (fast_tac (claset() addIs [lemma_preal_add_mult_distrib, |
|
501 |
lemma_preal_add_mult_distrib2]) 1); |
|
502 |
qed "preal_add_mult_distrib2"; |
|
503 |
||
504 |
Goal "(((z1::preal) + z2) * w) = (z1 * w) + (z2 * w)"; |
|
505 |
by (simp_tac (simpset() addsimps [preal_mult_commute, |
|
506 |
preal_add_mult_distrib2]) 1); |
|
507 |
qed "preal_add_mult_distrib"; |
|
508 |
||
509 |
(*** Prove existence of inverse ***) |
|
510 |
(*** Inverse is a positive real ***) |
|
511 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
512 |
Goal "EX y. qinv(y) ~: Rep_preal X"; |
5078 | 513 |
by (cut_inst_tac [("X","X")] not_mem_Rep_preal_Ex 1); |
514 |
by (etac exE 1 THEN cut_inst_tac [("x","x")] prat_as_inverse_ex 1); |
|
515 |
by Auto_tac; |
|
516 |
qed "qinv_not_mem_Rep_preal_Ex"; |
|
517 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
518 |
Goal "EX q. q: {x. EX y. x < y & qinv y ~: Rep_preal A}"; |
5078 | 519 |
by (cut_inst_tac [("X","A")] qinv_not_mem_Rep_preal_Ex 1); |
520 |
by Auto_tac; |
|
521 |
by (cut_inst_tac [("y","y")] qless_Ex 1); |
|
522 |
by (Fast_tac 1); |
|
523 |
qed "lemma_preal_mem_inv_set_ex"; |
|
524 |
||
525 |
(** Part 1 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
526 |
Goal "{} < {x. EX y. x < y & qinv y ~: Rep_preal A}"; |
5078 | 527 |
by (cut_facts_tac [lemma_preal_mem_inv_set_ex] 1); |
528 |
by (auto_tac (claset() addSIs [psubsetI] addEs [equalityCE],simpset())); |
|
529 |
qed "preal_inv_set_not_empty"; |
|
530 |
||
531 |
(** Part 2 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
532 |
Goal "EX y. qinv(y) : Rep_preal X"; |
5078 | 533 |
by (cut_inst_tac [("X","X")] mem_Rep_preal_Ex 1); |
534 |
by (etac exE 1 THEN cut_inst_tac [("x","x")] prat_as_inverse_ex 1); |
|
535 |
by Auto_tac; |
|
536 |
qed "qinv_mem_Rep_preal_Ex"; |
|
537 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
538 |
Goal "EX x. x ~: {x. EX y. x < y & qinv y ~: Rep_preal A}"; |
5078 | 539 |
by (rtac ccontr 1); |
540 |
by (cut_inst_tac [("X","A")] qinv_mem_Rep_preal_Ex 1); |
|
541 |
by Auto_tac; |
|
542 |
by (EVERY1[etac allE, etac exE, etac conjE]); |
|
543 |
by (dtac qinv_prat_less 1 THEN dtac not_in_preal_ub 1); |
|
544 |
by (eres_inst_tac [("x","qinv y")] ballE 1); |
|
545 |
by (dtac prat_less_trans 1); |
|
546 |
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl])); |
|
547 |
qed "preal_not_mem_inv_set_Ex"; |
|
548 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
549 |
Goal "{x. EX y. x < y & qinv y ~: Rep_preal A} < UNIV"; |
5078 | 550 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
551 |
by (cut_inst_tac [("A","A")] preal_not_mem_inv_set_Ex 1); |
|
552 |
by (etac exE 1); |
|
553 |
by (eres_inst_tac [("c","x")] equalityCE 1); |
|
554 |
by Auto_tac; |
|
555 |
qed "preal_inv_set_not_prat_set"; |
|
556 |
||
557 |
(** Part 3 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
558 |
Goal "ALL y: {x. EX y. x < y & qinv y ~: Rep_preal A}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
559 |
\ ALL z. z < y --> z : {x. EX y. x < y & qinv y ~: Rep_preal A}"; |
5078 | 560 |
by Auto_tac; |
561 |
by (res_inst_tac [("x","ya")] exI 1); |
|
562 |
by (auto_tac (claset() addIs [prat_less_trans],simpset())); |
|
563 |
qed "preal_inv_set_lemma3"; |
|
564 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
565 |
Goal "ALL y: {x. EX y. x < y & qinv y ~: Rep_preal A}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
566 |
\ Bex {x. EX y. x < y & qinv y ~: Rep_preal A} (op < y)"; |
5078 | 567 |
by (blast_tac (claset() addDs [prat_dense]) 1); |
568 |
qed "preal_inv_set_lemma4"; |
|
569 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
570 |
Goal "{x. EX y. x < y & qinv(y) ~: Rep_preal(A)} : preal"; |
5078 | 571 |
by (rtac prealI2 1); |
572 |
by (rtac preal_inv_set_not_empty 1); |
|
573 |
by (rtac preal_inv_set_not_prat_set 1); |
|
574 |
by (rtac preal_inv_set_lemma3 1); |
|
575 |
by (rtac preal_inv_set_lemma4 1); |
|
576 |
qed "preal_mem_inv_set"; |
|
577 |
||
578 |
(*more lemmas for inverse *) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
579 |
Goal "x: Rep_preal(pinv(A)*A) ==> \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
580 |
\ x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat 1)))"; |
5078 | 581 |
by (auto_tac (claset() addSDs [mem_Rep_preal_multD], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
582 |
simpset() addsimps [pinv_def,preal_of_prat_def] )); |
5078 | 583 |
by (dtac (preal_mem_inv_set RS Abs_preal_inverse RS subst) 1); |
584 |
by (auto_tac (claset() addSDs [not_in_preal_ub],simpset())); |
|
585 |
by (dtac prat_mult_less_mono 1 THEN Blast_tac 1); |
|
586 |
by (auto_tac (claset(),simpset())); |
|
587 |
qed "preal_mem_mult_invD"; |
|
588 |
||
589 |
(*** Gleason's Lemma 9-3.4 p 122 ***) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
590 |
Goal "ALL xa : Rep_preal(A). xa + x : Rep_preal(A) ==> \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
591 |
\ EX xb : Rep_preal(A). xb + (prat_of_pnat p)*x : Rep_preal(A)"; |
5078 | 592 |
by (cut_facts_tac [mem_Rep_preal_Ex] 1); |
593 |
by (res_inst_tac [("n","p")] pnat_induct 1); |
|
594 |
by (auto_tac (claset(),simpset() addsimps [pnat_one_def, |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
595 |
pSuc_is_plus_one,prat_add_mult_distrib, |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
596 |
prat_of_pnat_add,prat_add_assoc RS sym])); |
5078 | 597 |
qed "lemma1_gleason9_34"; |
598 |
||
599 |
Goal "Abs_prat (ratrel ^^ {(y, z)}) < xb + \ |
|
600 |
\ Abs_prat (ratrel ^^ {(x*y, Abs_pnat 1)})*Abs_prat (ratrel ^^ {(w, x)})"; |
|
601 |
by (res_inst_tac [("j","Abs_prat (ratrel ^^ {(x * y, Abs_pnat 1)}) *\ |
|
602 |
\ Abs_prat (ratrel ^^ {(w, x)})")] prat_le_less_trans 1); |
|
603 |
by (rtac prat_self_less_add_right 2); |
|
604 |
by (auto_tac (claset() addIs [lemma_Abs_prat_le3], |
|
605 |
simpset() addsimps [prat_mult,pre_lemma_gleason9_34b,pnat_mult_assoc])); |
|
606 |
qed "lemma1b_gleason9_34"; |
|
607 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
608 |
Goal "ALL xa : Rep_preal(A). xa + x : Rep_preal(A) ==> False"; |
5078 | 609 |
by (cut_inst_tac [("X","A")] not_mem_Rep_preal_Ex 1); |
610 |
by (etac exE 1); |
|
611 |
by (dtac not_in_preal_ub 1); |
|
612 |
by (res_inst_tac [("z","x")] eq_Abs_prat 1); |
|
613 |
by (res_inst_tac [("z","xa")] eq_Abs_prat 1); |
|
614 |
by (dres_inst_tac [("p","y*xb")] lemma1_gleason9_34 1); |
|
615 |
by (etac bexE 1); |
|
616 |
by (cut_inst_tac [("x","y"),("y","xb"),("w","xaa"), |
|
617 |
("z","ya"),("xb","xba")] lemma1b_gleason9_34 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
618 |
by (dres_inst_tac [("x","xba + prat_of_pnat (y * xb) * x")] bspec 1); |
5078 | 619 |
by (auto_tac (claset() addIs [prat_less_asym], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
620 |
simpset() addsimps [prat_of_pnat_def])); |
5078 | 621 |
qed "lemma_gleason9_34a"; |
622 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
623 |
Goal "EX r: Rep_preal(R). r + x ~: Rep_preal(R)"; |
5078 | 624 |
by (rtac ccontr 1); |
625 |
by (blast_tac (claset() addIs [lemma_gleason9_34a]) 1); |
|
626 |
qed "lemma_gleason9_34"; |
|
627 |
||
628 |
(*** Gleason's Lemma 9-3.6 ***) |
|
629 |
(* lemmas for Gleason 9-3.6 *) |
|
630 |
(* *) |
|
631 |
(******************************) |
|
632 |
||
633 |
Goal "r + r*qinv(xa)*Q3 = r*qinv(xa)*(xa + Q3)"; |
|
634 |
by (full_simp_tac (simpset() addsimps [prat_add_mult_distrib2, |
|
635 |
prat_mult_assoc]) 1); |
|
636 |
qed "lemma1_gleason9_36"; |
|
637 |
||
638 |
Goal "r*qinv(xa)*(xa*x) = r*x"; |
|
639 |
by (full_simp_tac (simpset() addsimps prat_mult_ac) 1); |
|
640 |
qed "lemma2_gleason9_36"; |
|
641 |
(******) |
|
642 |
||
643 |
(*** FIXME: long! ***) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
644 |
Goal "prat_of_pnat 1p < x ==> EX r: Rep_preal(A). r*x ~: Rep_preal(A)"; |
5078 | 645 |
by (res_inst_tac [("X1","A")] (mem_Rep_preal_Ex RS exE) 1); |
646 |
by (res_inst_tac [("Q","xa*x : Rep_preal(A)")] (excluded_middle RS disjE) 1); |
|
647 |
by (Fast_tac 1); |
|
648 |
by (dres_inst_tac [("x","xa")] prat_self_less_mult_right 1); |
|
649 |
by (etac prat_lessE 1); |
|
650 |
by (cut_inst_tac [("R","A"),("x","Q3")] lemma_gleason9_34 1); |
|
651 |
by (dtac sym 1 THEN Auto_tac ); |
|
7499 | 652 |
by (ftac not_in_preal_ub 1); |
5078 | 653 |
by (dres_inst_tac [("x","xa + Q3")] bspec 1 THEN assume_tac 1); |
654 |
by (dtac prat_add_right_less_cancel 1); |
|
655 |
by (dres_inst_tac [("x","qinv(xa)*Q3")] prat_mult_less2_mono1 1); |
|
656 |
by (dres_inst_tac [("x","r")] prat_add_less2_mono2 1); |
|
657 |
by (asm_full_simp_tac (simpset() addsimps |
|
658 |
[prat_mult_assoc RS sym,lemma1_gleason9_36]) 1); |
|
659 |
by (dtac sym 1); |
|
660 |
by (auto_tac (claset(),simpset() addsimps [lemma2_gleason9_36])); |
|
661 |
by (res_inst_tac [("x","r")] bexI 1); |
|
662 |
by (rtac notI 1); |
|
663 |
by (dres_inst_tac [("y","r*x")] (Rep_preal RS prealE_lemma3b) 1); |
|
664 |
by Auto_tac; |
|
665 |
qed "lemma_gleason9_36"; |
|
666 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
667 |
Goal "prat_of_pnat (Abs_pnat 1) < x ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
668 |
\ EX r: Rep_preal(A). r*x ~: Rep_preal(A)"; |
5078 | 669 |
by (rtac lemma_gleason9_36 1); |
670 |
by (asm_simp_tac (simpset() addsimps [pnat_one_def]) 1); |
|
671 |
qed "lemma_gleason9_36a"; |
|
672 |
||
673 |
(*** Part 2 of existence of inverse ***) |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
674 |
Goal "x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat 1))) \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
675 |
\ ==> x: Rep_preal(pinv(A)*A)"; |
5078 | 676 |
by (auto_tac (claset() addSIs [mem_Rep_preal_multI], |
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
677 |
simpset() addsimps [pinv_def,preal_of_prat_def] )); |
5078 | 678 |
by (rtac (preal_mem_inv_set RS Abs_preal_inverse RS ssubst) 1); |
679 |
by (dtac prat_qinv_gt_1 1); |
|
680 |
by (dres_inst_tac [("A","A")] lemma_gleason9_36a 1); |
|
681 |
by Auto_tac; |
|
682 |
by (dtac (Rep_preal RS prealE_lemma4a) 1); |
|
683 |
by (Auto_tac THEN dtac qinv_prat_less 1); |
|
684 |
by (res_inst_tac [("x","qinv(u)*x")] exI 1); |
|
685 |
by (rtac conjI 1); |
|
686 |
by (res_inst_tac [("x","qinv(r)*x")] exI 1); |
|
687 |
by (auto_tac (claset() addIs [prat_mult_less2_mono1], |
|
688 |
simpset() addsimps [qinv_mult_eq,qinv_qinv])); |
|
689 |
by (res_inst_tac [("x","u")] bexI 1); |
|
690 |
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc, |
|
691 |
prat_mult_left_commute])); |
|
692 |
qed "preal_mem_mult_invI"; |
|
693 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
694 |
Goal "pinv(A)*A = (preal_of_prat (prat_of_pnat (Abs_pnat 1)))"; |
5078 | 695 |
by (rtac (inj_Rep_preal RS injD) 1); |
696 |
by (rtac set_ext 1); |
|
697 |
by (fast_tac (claset() addDs [preal_mem_mult_invD,preal_mem_mult_invI]) 1); |
|
698 |
qed "preal_mult_inv"; |
|
699 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
700 |
Goal "A*pinv(A) = (preal_of_prat (prat_of_pnat (Abs_pnat 1)))"; |
5078 | 701 |
by (rtac (preal_mult_commute RS subst) 1); |
702 |
by (rtac preal_mult_inv 1); |
|
703 |
qed "preal_mult_inv_right"; |
|
704 |
||
705 |
val [prem] = goal thy |
|
706 |
"(!!u. z = Abs_preal(u) ==> P) ==> P"; |
|
707 |
by (cut_inst_tac [("x1","z")] |
|
708 |
(rewrite_rule [preal_def] (Rep_preal RS Abs_preal_inverse)) 1); |
|
709 |
by (res_inst_tac [("u","Rep_preal z")] prem 1); |
|
710 |
by (dtac (inj_Rep_preal RS injD) 1); |
|
711 |
by (Asm_simp_tac 1); |
|
712 |
qed "eq_Abs_preal"; |
|
713 |
||
714 |
(*** Lemmas/Theorem(s) need lemma_gleason9_34 ***) |
|
715 |
Goal "Rep_preal (R1) <= Rep_preal(R1 + R2)"; |
|
716 |
by (cut_inst_tac [("X","R2")] mem_Rep_preal_Ex 1); |
|
717 |
by (auto_tac (claset() addSIs [bexI] addIs [(Rep_preal RS prealE_lemma3b), |
|
718 |
prat_self_less_add_left,mem_Rep_preal_addI],simpset())); |
|
719 |
qed "Rep_preal_self_subset"; |
|
720 |
||
721 |
Goal "~ Rep_preal (R1 + R2) <= Rep_preal(R1)"; |
|
722 |
by (cut_inst_tac [("X","R2")] mem_Rep_preal_Ex 1); |
|
723 |
by (etac exE 1); |
|
724 |
by (cut_inst_tac [("R","R1")] lemma_gleason9_34 1); |
|
725 |
by (auto_tac (claset() addIs [mem_Rep_preal_addI],simpset())); |
|
726 |
qed "Rep_preal_sum_not_subset"; |
|
727 |
||
728 |
Goal "Rep_preal (R1 + R2) ~= Rep_preal(R1)"; |
|
729 |
by (rtac notI 1); |
|
730 |
by (etac equalityE 1); |
|
731 |
by (asm_full_simp_tac (simpset() addsimps [Rep_preal_sum_not_subset]) 1); |
|
732 |
qed "Rep_preal_sum_not_eq"; |
|
733 |
||
734 |
(*** at last --- Gleason prop. 9-3.5(iii) p. 123 ***) |
|
735 |
Goalw [preal_less_def,psubset_def] "(R1::preal) < R1 + R2"; |
|
736 |
by (simp_tac (simpset() addsimps [Rep_preal_self_subset, |
|
737 |
Rep_preal_sum_not_eq RS not_sym]) 1); |
|
738 |
qed "preal_self_less_add_left"; |
|
739 |
||
740 |
Goal "(R1::preal) < R2 + R1"; |
|
741 |
by (simp_tac (simpset() addsimps [preal_add_commute,preal_self_less_add_left]) 1); |
|
742 |
qed "preal_self_less_add_right"; |
|
743 |
||
744 |
(*** Properties of <= ***) |
|
745 |
||
746 |
Goalw [preal_le_def,psubset_def,preal_less_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
747 |
"z<=w ==> ~(w<(z::preal))"; |
5078 | 748 |
by (auto_tac (claset() addDs [equalityI],simpset())); |
749 |
qed "preal_leD"; |
|
750 |
||
9108 | 751 |
bind_thm ("preal_leE", make_elim preal_leD); |
5078 | 752 |
|
753 |
Goalw [preal_le_def,psubset_def,preal_less_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
754 |
"~ z <= w ==> w<(z::preal)"; |
5078 | 755 |
by (cut_inst_tac [("r1.0","w"),("r2.0","z")] preal_linear 1); |
756 |
by (auto_tac (claset(),simpset() addsimps [preal_less_def,psubset_def])); |
|
757 |
qed "not_preal_leE"; |
|
758 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
759 |
Goal "~(w < z) ==> z <= (w::preal)"; |
5078 | 760 |
by (fast_tac (claset() addIs [not_preal_leE]) 1); |
761 |
qed "preal_leI"; |
|
762 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
763 |
Goal "(~(w < z)) = (z <= (w::preal))"; |
5078 | 764 |
by (fast_tac (claset() addSIs [preal_leI,preal_leD]) 1); |
765 |
qed "preal_less_le_iff"; |
|
766 |
||
767 |
Goalw [preal_le_def,preal_less_def,psubset_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
768 |
"z < w ==> z <= (w::preal)"; |
5078 | 769 |
by (Fast_tac 1); |
770 |
qed "preal_less_imp_le"; |
|
771 |
||
772 |
Goalw [preal_le_def,preal_less_def,psubset_def] |
|
773 |
"!!(x::preal). x <= y ==> x < y | x = y"; |
|
774 |
by (auto_tac (claset() addIs [inj_Rep_preal RS injD],simpset())); |
|
775 |
qed "preal_le_imp_less_or_eq"; |
|
776 |
||
777 |
Goalw [preal_le_def,preal_less_def,psubset_def] |
|
778 |
"!!(x::preal). x < y | x = y ==> x <=y"; |
|
779 |
by Auto_tac; |
|
780 |
qed "preal_less_or_eq_imp_le"; |
|
781 |
||
782 |
Goalw [preal_le_def] "w <= (w::preal)"; |
|
783 |
by (Simp_tac 1); |
|
784 |
qed "preal_le_refl"; |
|
785 |
||
786 |
val prems = goal thy "!!i. [| i <= j; j < k |] ==> i < (k::preal)"; |
|
787 |
by (dtac preal_le_imp_less_or_eq 1); |
|
788 |
by (fast_tac (claset() addIs [preal_less_trans]) 1); |
|
789 |
qed "preal_le_less_trans"; |
|
790 |
||
791 |
val prems = goal thy "!!i. [| i < j; j <= k |] ==> i < (k::preal)"; |
|
792 |
by (dtac preal_le_imp_less_or_eq 1); |
|
793 |
by (fast_tac (claset() addIs [preal_less_trans]) 1); |
|
794 |
qed "preal_less_le_trans"; |
|
795 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
796 |
Goal "[| i <= j; j <= k |] ==> i <= (k::preal)"; |
5078 | 797 |
by (EVERY1 [dtac preal_le_imp_less_or_eq, dtac preal_le_imp_less_or_eq, |
798 |
rtac preal_less_or_eq_imp_le, fast_tac (claset() addIs [preal_less_trans])]); |
|
799 |
qed "preal_le_trans"; |
|
800 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
801 |
Goal "[| z <= w; w <= z |] ==> z = (w::preal)"; |
5078 | 802 |
by (EVERY1 [dtac preal_le_imp_less_or_eq, dtac preal_le_imp_less_or_eq, |
803 |
fast_tac (claset() addEs [preal_less_irrefl,preal_less_asym])]); |
|
804 |
qed "preal_le_anti_sym"; |
|
805 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
806 |
Goal "[| ~ y < x; y ~= x |] ==> x < (y::preal)"; |
5078 | 807 |
by (rtac not_preal_leE 1); |
808 |
by (fast_tac (claset() addDs [preal_le_imp_less_or_eq]) 1); |
|
809 |
qed "not_less_not_eq_preal_less"; |
|
810 |
||
811 |
(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****) |
|
812 |
||
813 |
(**** Set up all lemmas for proving A < B ==> ?D. A + D = B ****) |
|
814 |
(**** Gleason prop. 9-3.5(iv) p. 123 ****) |
|
815 |
(**** Define the D required and show that it is a positive real ****) |
|
816 |
||
817 |
(* useful lemmas - proved elsewhere? *) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
818 |
Goalw [psubset_def] "A < B ==> EX x. x ~: A & x : B"; |
5078 | 819 |
by (etac conjE 1); |
820 |
by (etac swap 1); |
|
821 |
by (etac equalityI 1); |
|
822 |
by Auto_tac; |
|
823 |
qed "lemma_psubset_mem"; |
|
824 |
||
825 |
Goalw [psubset_def] "~ (A::'a set) < A"; |
|
826 |
by (Fast_tac 1); |
|
827 |
qed "lemma_psubset_not_refl"; |
|
828 |
||
829 |
Goalw [psubset_def] "!!(A::'a set). [| A < B; B < C |] ==> A < C"; |
|
830 |
by (auto_tac (claset() addDs [subset_antisym],simpset())); |
|
831 |
qed "psubset_trans"; |
|
832 |
||
833 |
Goalw [psubset_def] "!!(A::'a set). [| A <= B; B < C |] ==> A < C"; |
|
834 |
by (auto_tac (claset() addDs [subset_antisym],simpset())); |
|
835 |
qed "subset_psubset_trans"; |
|
836 |
||
837 |
Goalw [psubset_def] "!!(A::'a set). [| A < B; B <= C |] ==> A < C"; |
|
838 |
by (auto_tac (claset() addDs [subset_antisym],simpset())); |
|
839 |
qed "subset_psubset_trans2"; |
|
840 |
||
841 |
Goalw [psubset_def] "!!(A::'a set). [| A < B; c : A |] ==> c : B"; |
|
842 |
by (auto_tac (claset() addDs [subsetD],simpset())); |
|
843 |
qed "psubsetD"; |
|
844 |
||
845 |
(** Part 1 of Dedekind sections def **) |
|
846 |
Goalw [preal_less_def] |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
847 |
"A < B ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
848 |
\ EX q. q : {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}"; |
5078 | 849 |
by (EVERY1[dtac lemma_psubset_mem, etac exE, etac conjE]); |
850 |
by (dres_inst_tac [("x1","B")] (Rep_preal RS prealE_lemma4a) 1); |
|
851 |
by (auto_tac (claset(),simpset() addsimps [prat_less_def])); |
|
852 |
qed "lemma_ex_mem_less_left_add1"; |
|
853 |
||
854 |
Goal |
|
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
855 |
"A < B ==> \ |
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
856 |
\ {} < {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}"; |
5078 | 857 |
by (dtac lemma_ex_mem_less_left_add1 1); |
858 |
by (auto_tac (claset() addSIs [psubsetI] addEs [equalityCE],simpset())); |
|
859 |
qed "preal_less_set_not_empty"; |
|
860 |
||
861 |
(** Part 2 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
862 |
Goal "EX q. q ~: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}"; |
5078 | 863 |
by (cut_inst_tac [("X","B")] not_mem_Rep_preal_Ex 1); |
864 |
by (etac exE 1); |
|
865 |
by (res_inst_tac [("x","x")] exI 1); |
|
866 |
by Auto_tac; |
|
867 |
by (cut_inst_tac [("x","x"),("y","n")] prat_self_less_add_right 1); |
|
868 |
by (auto_tac (claset() addDs [Rep_preal RS prealE_lemma3b],simpset())); |
|
869 |
qed "lemma_ex_not_mem_less_left_add1"; |
|
870 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
871 |
Goal "{d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)} < UNIV"; |
5078 | 872 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
873 |
by (cut_inst_tac [("A","A"),("B","B")] lemma_ex_not_mem_less_left_add1 1); |
|
874 |
by (etac exE 1); |
|
875 |
by (eres_inst_tac [("c","q")] equalityCE 1); |
|
876 |
by Auto_tac; |
|
877 |
qed "preal_less_set_not_prat_set"; |
|
878 |
||
879 |
(** Part 3 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
880 |
Goal "A < B ==> ALL y: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
881 |
\ ALL z. z < y --> z : {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}"; |
5078 | 882 |
by Auto_tac; |
883 |
by (dres_inst_tac [("x","n")] prat_add_less2_mono2 1); |
|
884 |
by (dtac (Rep_preal RS prealE_lemma3b) 1); |
|
885 |
by Auto_tac; |
|
886 |
qed "preal_less_set_lemma3"; |
|
887 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
888 |
Goal "A < B ==> ALL y: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
889 |
\ Bex {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)} (op < y)"; |
5078 | 890 |
by Auto_tac; |
891 |
by (dtac (Rep_preal RS prealE_lemma4a) 1); |
|
892 |
by (auto_tac (claset(),simpset() addsimps [prat_less_def,prat_add_assoc])); |
|
893 |
qed "preal_less_set_lemma4"; |
|
894 |
||
895 |
Goal |
|
896 |
"!! (A::preal). A < B ==> \ |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
897 |
\ {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}: preal"; |
5078 | 898 |
by (rtac prealI2 1); |
899 |
by (rtac preal_less_set_not_empty 1); |
|
900 |
by (rtac preal_less_set_not_prat_set 2); |
|
901 |
by (rtac preal_less_set_lemma3 2); |
|
902 |
by (rtac preal_less_set_lemma4 3); |
|
903 |
by Auto_tac; |
|
904 |
qed "preal_mem_less_set"; |
|
905 |
||
906 |
(** proving that A + D <= B **) |
|
907 |
Goalw [preal_le_def] |
|
908 |
"!! (A::preal). A < B ==> \ |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
909 |
\ A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}) <= B"; |
5078 | 910 |
by (rtac subsetI 1); |
911 |
by (dtac mem_Rep_preal_addD 1); |
|
912 |
by (auto_tac (claset(),simpset() addsimps [ |
|
913 |
preal_mem_less_set RS Abs_preal_inverse])); |
|
914 |
by (dtac not_in_preal_ub 1); |
|
915 |
by (dtac bspec 1 THEN assume_tac 1); |
|
916 |
by (dres_inst_tac [("x","y")] prat_add_less2_mono1 1); |
|
917 |
by (dres_inst_tac [("x1","B")] (Rep_preal RS prealE_lemma3b) 1); |
|
918 |
by Auto_tac; |
|
919 |
qed "preal_less_add_left_subsetI"; |
|
920 |
||
921 |
(** proving that B <= A + D --- trickier **) |
|
922 |
(** lemma **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
923 |
Goal "x : Rep_preal(B) ==> EX e. x + e : Rep_preal(B)"; |
5078 | 924 |
by (dtac (Rep_preal RS prealE_lemma4a) 1); |
925 |
by (auto_tac (claset(),simpset() addsimps [prat_less_def])); |
|
926 |
qed "lemma_sum_mem_Rep_preal_ex"; |
|
927 |
||
928 |
Goalw [preal_le_def] |
|
929 |
"!! (A::preal). A < B ==> \ |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
930 |
\ B <= A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)})"; |
5078 | 931 |
by (rtac subsetI 1); |
932 |
by (res_inst_tac [("Q","x: Rep_preal(A)")] (excluded_middle RS disjE) 1); |
|
933 |
by (rtac mem_Rep_preal_addI 1); |
|
934 |
by (dtac lemma_sum_mem_Rep_preal_ex 1); |
|
935 |
by (etac exE 1); |
|
936 |
by (cut_inst_tac [("R","A"),("x","e")] lemma_gleason9_34 1 THEN etac bexE 1); |
|
937 |
by (dtac not_in_preal_ub 1 THEN dtac bspec 1 THEN assume_tac 1); |
|
938 |
by (etac prat_lessE 1); |
|
939 |
by (res_inst_tac [("x","r")] bexI 1); |
|
940 |
by (res_inst_tac [("x","Q3")] bexI 1); |
|
941 |
by (cut_facts_tac [Rep_preal_self_subset] 4); |
|
942 |
by (auto_tac (claset(),simpset() addsimps [ |
|
943 |
preal_mem_less_set RS Abs_preal_inverse])); |
|
944 |
by (res_inst_tac [("x","r+e")] exI 1); |
|
945 |
by (asm_full_simp_tac (simpset() addsimps prat_add_ac) 1); |
|
946 |
qed "preal_less_add_left_subsetI2"; |
|
947 |
||
948 |
(*** required proof ***) |
|
949 |
Goal "!! (A::preal). A < B ==> \ |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
950 |
\ A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}) = B"; |
5078 | 951 |
by (blast_tac (claset() addIs [preal_le_anti_sym, |
952 |
preal_less_add_left_subsetI,preal_less_add_left_subsetI2]) 1); |
|
953 |
qed "preal_less_add_left"; |
|
954 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
955 |
Goal "!! (A::preal). A < B ==> EX D. A + D = B"; |
5078 | 956 |
by (fast_tac (claset() addDs [preal_less_add_left]) 1); |
957 |
qed "preal_less_add_left_Ex"; |
|
958 |
||
959 |
Goal "!!(A::preal). A < B ==> A + C < B + C"; |
|
960 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
|
961 |
simpset() addsimps [preal_add_assoc])); |
|
962 |
by (res_inst_tac [("y1","D")] (preal_add_commute RS subst) 1); |
|
963 |
by (auto_tac (claset() addIs [preal_self_less_add_left], |
|
964 |
simpset() addsimps [preal_add_assoc RS sym])); |
|
965 |
qed "preal_add_less2_mono1"; |
|
966 |
||
967 |
Goal "!!(A::preal). A < B ==> C + A < C + B"; |
|
968 |
by (auto_tac (claset() addIs [preal_add_less2_mono1], |
|
969 |
simpset() addsimps [preal_add_commute])); |
|
970 |
qed "preal_add_less2_mono2"; |
|
971 |
||
972 |
Goal |
|
973 |
"!!(q1::preal). q1 < q2 ==> q1 * x < q2 * x"; |
|
974 |
by (dtac preal_less_add_left_Ex 1); |
|
975 |
by (auto_tac (claset(),simpset() addsimps [preal_add_mult_distrib, |
|
976 |
preal_self_less_add_left])); |
|
977 |
qed "preal_mult_less_mono1"; |
|
978 |
||
979 |
Goal "!!(q1::preal). q1 < q2 ==> x * q1 < x * q2"; |
|
980 |
by (auto_tac (claset() addDs [preal_mult_less_mono1], |
|
981 |
simpset() addsimps [preal_mult_commute])); |
|
982 |
qed "preal_mult_left_less_mono1"; |
|
983 |
||
984 |
Goal "!!(q1::preal). q1 <= q2 ==> x * q1 <= x * q2"; |
|
985 |
by (dtac preal_le_imp_less_or_eq 1); |
|
986 |
by (Step_tac 1); |
|
987 |
by (auto_tac (claset() addSIs [preal_le_refl, |
|
988 |
preal_less_imp_le,preal_mult_left_less_mono1],simpset())); |
|
989 |
qed "preal_mult_left_le_mono1"; |
|
990 |
||
991 |
Goal "!!(q1::preal). q1 <= q2 ==> q1 * x <= q2 * x"; |
|
992 |
by (auto_tac (claset() addDs [preal_mult_left_le_mono1], |
|
993 |
simpset() addsimps [preal_mult_commute])); |
|
994 |
qed "preal_mult_le_mono1"; |
|
995 |
||
996 |
Goal "!!(q1::preal). q1 <= q2 ==> x + q1 <= x + q2"; |
|
997 |
by (dtac preal_le_imp_less_or_eq 1); |
|
998 |
by (Step_tac 1); |
|
999 |
by (auto_tac (claset() addSIs [preal_le_refl, |
|
1000 |
preal_less_imp_le,preal_add_less2_mono1], |
|
1001 |
simpset() addsimps [preal_add_commute])); |
|
1002 |
qed "preal_add_left_le_mono1"; |
|
1003 |
||
1004 |
Goal "!!(q1::preal). q1 <= q2 ==> q1 + x <= q2 + x"; |
|
1005 |
by (auto_tac (claset() addDs [preal_add_left_le_mono1], |
|
1006 |
simpset() addsimps [preal_add_commute])); |
|
1007 |
qed "preal_add_le_mono1"; |
|
1008 |
||
1009 |
Goal "!!(A::preal). A + C < B + C ==> A < B"; |
|
1010 |
by (cut_facts_tac [preal_linear] 1); |
|
1011 |
by (auto_tac (claset() addEs [preal_less_irrefl],simpset())); |
|
1012 |
by (dres_inst_tac [("A","B"),("C","C")] preal_add_less2_mono1 1); |
|
1013 |
by (fast_tac (claset() addDs [preal_less_trans] |
|
1014 |
addEs [preal_less_irrefl]) 1); |
|
1015 |
qed "preal_add_right_less_cancel"; |
|
1016 |
||
1017 |
Goal "!!(A::preal). C + A < C + B ==> A < B"; |
|
1018 |
by (auto_tac (claset() addEs [preal_add_right_less_cancel], |
|
1019 |
simpset() addsimps [preal_add_commute])); |
|
1020 |
qed "preal_add_left_less_cancel"; |
|
1021 |
||
1022 |
Goal "((A::preal) + C < B + C) = (A < B)"; |
|
1023 |
by (REPEAT(ares_tac [iffI,preal_add_less2_mono1, |
|
1024 |
preal_add_right_less_cancel] 1)); |
|
1025 |
qed "preal_add_less_iff1"; |
|
1026 |
||
1027 |
Addsimps [preal_add_less_iff1]; |
|
1028 |
||
1029 |
Goal "(C + (A::preal) < C + B) = (A < B)"; |
|
1030 |
by (REPEAT(ares_tac [iffI,preal_add_less2_mono2, |
|
1031 |
preal_add_left_less_cancel] 1)); |
|
1032 |
qed "preal_add_less_iff2"; |
|
1033 |
||
1034 |
Addsimps [preal_add_less_iff2]; |
|
1035 |
||
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
1036 |
Goal "[| x1 < y1; x2 < y2 |] ==> x1 + x2 < y1 + (y2::preal)"; |
5078 | 1037 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
1038 |
simpset() addsimps preal_add_ac)); |
|
1039 |
by (rtac (preal_add_assoc RS subst) 1); |
|
1040 |
by (rtac preal_self_less_add_right 1); |
|
1041 |
qed "preal_add_less_mono"; |
|
1042 |
||
5148
74919e8f221c
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
1043 |
Goal "[| x1 < y1; x2 < y2 |] ==> x1 * x2 < y1 * (y2::preal)"; |
5078 | 1044 |
by (auto_tac (claset() addSDs [preal_less_add_left_Ex], |
1045 |
simpset() addsimps [preal_add_mult_distrib, |
|
1046 |
preal_add_mult_distrib2,preal_self_less_add_left, |
|
1047 |
preal_add_assoc] @ preal_mult_ac)); |
|
1048 |
qed "preal_mult_less_mono"; |
|
1049 |
||
1050 |
Goal "!!(A::preal). A + C = B + C ==> A = B"; |
|
1051 |
by (cut_facts_tac [preal_linear] 1); |
|
1052 |
by Auto_tac; |
|
1053 |
by (ALLGOALS(dres_inst_tac [("C","C")] preal_add_less2_mono1)); |
|
1054 |
by (auto_tac (claset() addEs [preal_less_irrefl],simpset())); |
|
1055 |
qed "preal_add_right_cancel"; |
|
1056 |
||
1057 |
Goal "!!(A::preal). C + A = C + B ==> A = B"; |
|
1058 |
by (auto_tac (claset() addIs [preal_add_right_cancel], |
|
1059 |
simpset() addsimps [preal_add_commute])); |
|
1060 |
qed "preal_add_left_cancel"; |
|
1061 |
||
1062 |
Goal "(C + A = C + B) = ((A::preal) = B)"; |
|
1063 |
by (fast_tac (claset() addIs [preal_add_left_cancel]) 1); |
|
1064 |
qed "preal_add_left_cancel_iff"; |
|
1065 |
||
1066 |
Goal "(A + C = B + C) = ((A::preal) = B)"; |
|
1067 |
by (fast_tac (claset() addIs [preal_add_right_cancel]) 1); |
|
1068 |
qed "preal_add_right_cancel_iff"; |
|
1069 |
||
1070 |
Addsimps [preal_add_left_cancel_iff,preal_add_right_cancel_iff]; |
|
1071 |
||
1072 |
(*** Completeness of preal ***) |
|
1073 |
||
1074 |
(*** prove that supremum is a cut ***) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1075 |
Goal "EX (X::preal). X: P ==> \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1076 |
\ EX q. q: {w. EX X. X : P & w : Rep_preal X}"; |
5078 | 1077 |
by Safe_tac; |
1078 |
by (cut_inst_tac [("X","X")] mem_Rep_preal_Ex 1); |
|
1079 |
by Auto_tac; |
|
1080 |
qed "preal_sup_mem_Ex"; |
|
1081 |
||
1082 |
(** Part 1 of Dedekind def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1083 |
Goal "EX (X::preal). X: P ==> \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1084 |
\ {} < {w. EX X : P. w : Rep_preal X}"; |
5078 | 1085 |
by (dtac preal_sup_mem_Ex 1); |
1086 |
by (auto_tac (claset() addSIs [psubsetI] addEs [equalityCE],simpset())); |
|
1087 |
qed "preal_sup_set_not_empty"; |
|
1088 |
||
1089 |
(** Part 2 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1090 |
Goalw [preal_less_def] "EX Y. (ALL X: P. X < Y) \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1091 |
\ ==> EX q. q ~: {w. EX X. X: P & w: Rep_preal(X)}"; (**) |
5078 | 1092 |
by (auto_tac (claset(),simpset() addsimps [psubset_def])); |
1093 |
by (cut_inst_tac [("X","Y")] not_mem_Rep_preal_Ex 1); |
|
1094 |
by (etac exE 1); |
|
1095 |
by (res_inst_tac [("x","x")] exI 1); |
|
1096 |
by (auto_tac (claset() addSDs [bspec],simpset())); |
|
1097 |
qed "preal_sup_not_mem_Ex"; |
|
1098 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1099 |
Goalw [preal_le_def] "EX Y. (ALL X: P. X <= Y) \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1100 |
\ ==> EX q. q ~: {w. EX X. X: P & w: Rep_preal(X)}"; |
5078 | 1101 |
by (Step_tac 1); |
1102 |
by (cut_inst_tac [("X","Y")] not_mem_Rep_preal_Ex 1); |
|
1103 |
by (etac exE 1); |
|
1104 |
by (res_inst_tac [("x","x")] exI 1); |
|
1105 |
by (auto_tac (claset() addSDs [bspec],simpset())); |
|
1106 |
qed "preal_sup_not_mem_Ex1"; |
|
1107 |
||
9189 | 1108 |
Goal "EX Y. (ALL X: P. X < Y) ==> {w. EX X: P. w: Rep_preal(X)} < UNIV"; (**) |
5078 | 1109 |
by (dtac preal_sup_not_mem_Ex 1); |
1110 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
|
1111 |
qed "preal_sup_set_not_prat_set"; |
|
1112 |
||
9189 | 1113 |
Goal "EX Y. (ALL X: P. X <= Y) ==> {w. EX X: P. w: Rep_preal(X)} < UNIV"; |
5078 | 1114 |
by (dtac preal_sup_not_mem_Ex1 1); |
1115 |
by (auto_tac (claset() addSIs [psubsetI],simpset())); |
|
1116 |
qed "preal_sup_set_not_prat_set1"; |
|
1117 |
||
1118 |
(** Part 3 of Dedekind sections def **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1119 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1120 |
\ ==> ALL y: {w. EX X: P. w: Rep_preal X}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1121 |
\ ALL z. z < y --> z: {w. EX X: P. w: Rep_preal X}"; (**) |
9189 | 1122 |
by (auto_tac(claset() addEs [Rep_preal RS prealE_lemma3b], simpset())); |
5078 | 1123 |
qed "preal_sup_set_lemma3"; |
1124 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1125 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1126 |
\ ==> ALL y: {w. EX X: P. w: Rep_preal X}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1127 |
\ ALL z. z < y --> z: {w. EX X: P. w: Rep_preal X}"; |
5078 | 1128 |
by (auto_tac(claset() addEs [Rep_preal RS prealE_lemma3b],simpset())); |
1129 |
qed "preal_sup_set_lemma3_1"; |
|
1130 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1131 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1132 |
\ ==> ALL y: {w. EX X: P. w: Rep_preal X}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1133 |
\ Bex {w. EX X: P. w: Rep_preal X} (op < y)"; (**) |
5078 | 1134 |
by (blast_tac (claset() addDs [(Rep_preal RS prealE_lemma4a)]) 1); |
1135 |
qed "preal_sup_set_lemma4"; |
|
1136 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1137 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1138 |
\ ==> ALL y: {w. EX X: P. w: Rep_preal X}. \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1139 |
\ Bex {w. EX X: P. w: Rep_preal X} (op < y)"; |
5078 | 1140 |
by (blast_tac (claset() addDs [(Rep_preal RS prealE_lemma4a)]) 1); |
1141 |
qed "preal_sup_set_lemma4_1"; |
|
1142 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1143 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1144 |
\ ==> {w. EX X: P. w: Rep_preal(X)}: preal"; (**) |
5078 | 1145 |
by (rtac prealI2 1); |
1146 |
by (rtac preal_sup_set_not_empty 1); |
|
1147 |
by (rtac preal_sup_set_not_prat_set 2); |
|
1148 |
by (rtac preal_sup_set_lemma3 3); |
|
1149 |
by (rtac preal_sup_set_lemma4 5); |
|
1150 |
by Auto_tac; |
|
1151 |
qed "preal_sup"; |
|
1152 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1153 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1154 |
\ ==> {w. EX X: P. w: Rep_preal(X)}: preal"; |
5078 | 1155 |
by (rtac prealI2 1); |
1156 |
by (rtac preal_sup_set_not_empty 1); |
|
1157 |
by (rtac preal_sup_set_not_prat_set1 2); |
|
1158 |
by (rtac preal_sup_set_lemma3_1 3); |
|
1159 |
by (rtac preal_sup_set_lemma4_1 5); |
|
1160 |
by Auto_tac; |
|
1161 |
qed "preal_sup1"; |
|
1162 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1163 |
Goalw [psup_def] "EX Y. (ALL X:P. X < Y) ==> ALL x: P. x <= psup P"; (**) |
5078 | 1164 |
by (auto_tac (claset(),simpset() addsimps [preal_le_def])); |
1165 |
by (rtac (preal_sup RS Abs_preal_inverse RS ssubst) 1); |
|
1166 |
by Auto_tac; |
|
1167 |
qed "preal_psup_leI"; |
|
1168 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1169 |
Goalw [psup_def] "EX Y. (ALL X:P. X <= Y) ==> ALL x: P. x <= psup P"; |
5078 | 1170 |
by (auto_tac (claset(),simpset() addsimps [preal_le_def])); |
1171 |
by (rtac (preal_sup1 RS Abs_preal_inverse RS ssubst) 1); |
|
1172 |
by (auto_tac (claset(),simpset() addsimps [preal_le_def])); |
|
1173 |
qed "preal_psup_leI2"; |
|
1174 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1175 |
Goal "[| EX Y. (ALL X:P. X < Y); x : P |] ==> x <= psup P"; (**) |
5078 | 1176 |
by (blast_tac (claset() addSDs [preal_psup_leI]) 1); |
1177 |
qed "preal_psup_leI2b"; |
|
1178 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1179 |
Goal "[| EX Y. (ALL X:P. X <= Y); x : P |] ==> x <= psup P"; |
5078 | 1180 |
by (blast_tac (claset() addSDs [preal_psup_leI2]) 1); |
1181 |
qed "preal_psup_leI2a"; |
|
1182 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1183 |
Goalw [psup_def] "[| EX X. X : P; ALL X:P. X < Y |] ==> psup P <= Y"; (**) |
5078 | 1184 |
by (auto_tac (claset(),simpset() addsimps [preal_le_def])); |
1185 |
by (dtac (([exI,exI] MRS preal_sup) RS Abs_preal_inverse RS subst) 1); |
|
1186 |
by (rotate_tac 1 2); |
|
1187 |
by (assume_tac 2); |
|
1188 |
by (auto_tac (claset() addSDs [bspec],simpset() addsimps [preal_less_def,psubset_def])); |
|
1189 |
qed "psup_le_ub"; |
|
1190 |
||
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1191 |
Goalw [psup_def] "[| EX X. X : P; ALL X:P. X <= Y |] ==> psup P <= Y"; |
5078 | 1192 |
by (auto_tac (claset(),simpset() addsimps [preal_le_def])); |
1193 |
by (dtac (([exI,exI] MRS preal_sup1) RS Abs_preal_inverse RS subst) 1); |
|
1194 |
by (rotate_tac 1 2); |
|
1195 |
by (assume_tac 2); |
|
1196 |
by (auto_tac (claset() addSDs [bspec], |
|
1197 |
simpset() addsimps [preal_less_def,psubset_def,preal_le_def])); |
|
1198 |
qed "psup_le_ub1"; |
|
1199 |
||
1200 |
(** supremum property **) |
|
9043
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1201 |
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \ |
ca761fe227d8
First round of changes, towards installation of simprocs
paulson
parents:
8919
diff
changeset
|
1202 |
\ ==> (ALL Y. (EX X: P. Y < X) = (Y < psup P))"; |
5078 | 1203 |
by (forward_tac [preal_sup RS Abs_preal_inverse] 1); |
1204 |
by (Fast_tac 1); |
|
1205 |
by (auto_tac (claset() addSIs [psubsetI],simpset() addsimps [psup_def,preal_less_def])); |
|
1206 |
by (blast_tac (claset() addDs [psubset_def RS meta_eq_to_obj_eq RS iffD1]) 1); |
|
1207 |
by (rotate_tac 4 1); |
|
1208 |
by (asm_full_simp_tac (simpset() addsimps [psubset_def]) 1); |
|
1209 |
by (dtac bspec 1 THEN assume_tac 1); |
|
1210 |
by (REPEAT(etac conjE 1)); |
|
1211 |
by (EVERY1[rtac swap, assume_tac, rtac set_ext]); |
|
1212 |
by (auto_tac (claset() addSDs [lemma_psubset_mem],simpset())); |
|
1213 |
by (cut_inst_tac [("r1.0","Xa"),("r2.0","Ya")] preal_linear 1); |
|
1214 |
by (auto_tac (claset() addDs [psubsetD],simpset() addsimps [preal_less_def])); |
|
1215 |
qed "preal_complete"; |
|
1216 |
||
1217 |
(****)(****)(****)(****)(****)(****)(****)(****)(****)(****) |
|
1218 |
(****** Embedding ******) |
|
1219 |
(*** mapping from prat into preal ***) |
|
1220 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
1221 |
Goal "x < z1 + z2 ==> x * z1 * qinv (z1 + z2) < z1"; |
5078 | 1222 |
by (dres_inst_tac [("x","z1 * qinv (z1 + z2)")] prat_mult_less2_mono1 1); |
1223 |
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1); |
|
1224 |
qed "lemma_preal_rat_less"; |
|
1225 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
1226 |
Goal "x < z1 + z2 ==> x * z2 * qinv (z1 + z2) < z2"; |
5078 | 1227 |
by (stac prat_add_commute 1); |
1228 |
by (dtac (prat_add_commute RS subst) 1); |
|
1229 |
by (etac lemma_preal_rat_less 1); |
|
1230 |
qed "lemma_preal_rat_less2"; |
|
1231 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1232 |
Goalw [preal_of_prat_def,preal_add_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1233 |
"preal_of_prat ((z1::prat) + z2) = \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1234 |
\ preal_of_prat z1 + preal_of_prat z2"; |
5078 | 1235 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
1236 |
by (auto_tac (claset() addIs [prat_add_less_mono] addSIs [set_ext],simpset() addsimps |
|
1237 |
[lemma_prat_less_set_mem_preal RS Abs_preal_inverse])); |
|
1238 |
by (res_inst_tac [("x","x*z1*qinv(z1+z2)")] exI 1 THEN rtac conjI 1); |
|
1239 |
by (etac lemma_preal_rat_less 1); |
|
1240 |
by (res_inst_tac [("x","x*z2*qinv(z1+z2)")] exI 1 THEN rtac conjI 1); |
|
1241 |
by (etac lemma_preal_rat_less2 1); |
|
1242 |
by (asm_full_simp_tac (simpset() addsimps [prat_add_mult_distrib RS sym, |
|
1243 |
prat_add_mult_distrib2 RS sym] @ prat_mult_ac) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1244 |
qed "preal_of_prat_add"; |
5078 | 1245 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
1246 |
Goal "x < xa ==> x*z1*qinv(xa) < z1"; |
5078 | 1247 |
by (dres_inst_tac [("x","z1 * qinv xa")] prat_mult_less2_mono1 1); |
1248 |
by (dtac (prat_mult_left_commute RS subst) 1); |
|
1249 |
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1); |
|
1250 |
qed "lemma_preal_rat_less3"; |
|
1251 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5078
diff
changeset
|
1252 |
Goal "xa < z1 * z2 ==> xa*z2*qinv(z1*z2) < z2"; |
5078 | 1253 |
by (dres_inst_tac [("x","z2 * qinv(z1*z2)")] prat_mult_less2_mono1 1); |
1254 |
by (dtac (prat_mult_left_commute RS subst) 1); |
|
1255 |
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1); |
|
1256 |
qed "lemma_preal_rat_less4"; |
|
1257 |
||
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1258 |
Goalw [preal_of_prat_def,preal_mult_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1259 |
"preal_of_prat ((z1::prat) * z2) = \ |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1260 |
\ preal_of_prat z1 * preal_of_prat z2"; |
5078 | 1261 |
by (res_inst_tac [("f","Abs_preal")] arg_cong 1); |
1262 |
by (auto_tac (claset() addIs [prat_mult_less_mono] addSIs [set_ext],simpset() addsimps |
|
1263 |
[lemma_prat_less_set_mem_preal RS Abs_preal_inverse])); |
|
1264 |
by (dtac prat_dense 1); |
|
1265 |
by (Step_tac 1); |
|
1266 |
by (res_inst_tac [("x","x*z1*qinv(xa)")] exI 1 THEN rtac conjI 1); |
|
1267 |
by (etac lemma_preal_rat_less3 1); |
|
1268 |
by (res_inst_tac [("x"," xa*z2*qinv(z1*z2)")] exI 1 THEN rtac conjI 1); |
|
1269 |
by (etac lemma_preal_rat_less4 1); |
|
1270 |
by (asm_full_simp_tac (simpset() |
|
1271 |
addsimps [qinv_mult_eq RS sym] @ prat_mult_ac) 1); |
|
1272 |
by (asm_full_simp_tac (simpset() |
|
1273 |
addsimps [prat_mult_assoc RS sym]) 1); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1274 |
qed "preal_of_prat_mult"; |
5078 | 1275 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1276 |
Goalw [preal_of_prat_def,preal_less_def] |
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1277 |
"(preal_of_prat p < preal_of_prat q) = (p < q)"; |
5078 | 1278 |
by (auto_tac (claset() addSDs [lemma_prat_set_eq] addEs [prat_less_trans], |
1279 |
simpset() addsimps [lemma_prat_less_set_mem_preal, |
|
1280 |
psubset_def,prat_less_not_refl])); |
|
1281 |
by (res_inst_tac [("q1.0","p"),("q2.0","q")] prat_linear_less2 1); |
|
1282 |
by (auto_tac (claset() addIs [prat_less_irrefl],simpset())); |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1283 |
qed "preal_of_prat_less_iff"; |
5078 | 1284 |
|
7077
60b098bb8b8a
heavily revised by Jacques: coercions have alphabetic names;
paulson
parents:
5588
diff
changeset
|
1285 |
Addsimps [preal_of_prat_less_iff]; |