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