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