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