| author | paulson | 
| Tue, 06 May 2003 10:40:43 +0200 | |
| changeset 13963 | ba7aa8c426ad | 
| parent 13551 | b7f64ee8da84 | 
| permissions | -rw-r--r-- | 
| 10750 | 1 | (* Title : Filter.ML | 
| 2 | ID : $Id$ | |
| 3 | Author : Jacques D. Fleuriot | |
| 4 | Copyright : 1998 University of Cambridge | |
| 5 | Description : Filters and Ultrafilter | |
| 6 | *) | |
| 7 | ||
| 13551 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 8 | (*ML bindings for Library/Zorn theorems*) | 
| 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 9 | val chain_def = thm "chain_def"; | 
| 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 10 | val chainD = thm "chainD"; | 
| 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 11 | val chainD2 = thm "chainD2"; | 
| 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 12 | val Zorn_Lemma2 = thm "Zorn_Lemma2"; | 
| 
b7f64ee8da84
converted Hyperreal/Zorn to Isar format and moved to Library
 paulson parents: 
10750diff
changeset | 13 | |
| 10750 | 14 | (*------------------------------------------------------------------ | 
| 15 | Properties of Filters and Freefilters - | |
| 16 | rules for intro, destruction etc. | |
| 17 | ------------------------------------------------------------------*) | |
| 18 | ||
| 19 | Goalw [is_Filter_def] "is_Filter X S ==> X <= Pow(S)"; | |
| 20 | by (Blast_tac 1); | |
| 21 | qed "is_FilterD1"; | |
| 22 | ||
| 23 | Goalw [is_Filter_def] "is_Filter X S ==> X ~= {}";
 | |
| 24 | by (Blast_tac 1); | |
| 25 | qed "is_FilterD2"; | |
| 26 | ||
| 27 | Goalw [is_Filter_def] "is_Filter X S ==> {} ~: X";
 | |
| 28 | by (Blast_tac 1); | |
| 29 | qed "is_FilterD3"; | |
| 30 | ||
| 31 | Goalw [Filter_def] "is_Filter X S ==> X : Filter S"; | |
| 32 | by (Blast_tac 1); | |
| 33 | qed "mem_FiltersetI"; | |
| 34 | ||
| 35 | Goalw [Filter_def] "X : Filter S ==> is_Filter X S"; | |
| 36 | by (Blast_tac 1); | |
| 37 | qed "mem_FiltersetD"; | |
| 38 | ||
| 39 | Goal "X : Filter S ==> {} ~: X";
 | |
| 40 | by (etac (mem_FiltersetD RS is_FilterD3) 1); | |
| 41 | qed "Filter_empty_not_mem"; | |
| 42 | ||
| 43 | bind_thm ("Filter_empty_not_memE",(Filter_empty_not_mem RS notE));
 | |
| 44 | ||
| 45 | Goalw [Filter_def,is_Filter_def] | |
| 46 | "[| X: Filter S; A: X; B: X |] ==> A Int B : X"; | |
| 47 | by (Blast_tac 1); | |
| 48 | qed "mem_FiltersetD1"; | |
| 49 | ||
| 50 | Goalw [Filter_def,is_Filter_def] | |
| 51 | "[| X: Filter S; A: X; A <= B; B <= S|] ==> B : X"; | |
| 52 | by (Blast_tac 1); | |
| 53 | qed "mem_FiltersetD2"; | |
| 54 | ||
| 55 | Goalw [Filter_def,is_Filter_def] | |
| 56 | "[| X: Filter S; A: X |] ==> A : Pow S"; | |
| 57 | by (Blast_tac 1); | |
| 58 | qed "mem_FiltersetD3"; | |
| 59 | ||
| 60 | Goalw [Filter_def,is_Filter_def] | |
| 61 | "X: Filter S ==> S : X"; | |
| 62 | by (Blast_tac 1); | |
| 63 | qed "mem_FiltersetD4"; | |
| 64 | ||
| 65 | Goalw [is_Filter_def] | |
| 66 | "[| X <= Pow(S);\ | |
| 67 | \ S : X; \ | |
| 68 | \              X ~= {}; \
 | |
| 69 | \              {} ~: X; \
 | |
| 70 | \ ALL u: X. ALL v: X. u Int v : X; \ | |
| 71 | \ ALL u v. u: X & u<=v & v<=S --> v: X \ | |
| 72 | \ |] ==> is_Filter X S"; | |
| 73 | by (Blast_tac 1); | |
| 74 | qed "is_FilterI"; | |
| 75 | ||
| 76 | Goal "[| X <= Pow(S);\ | |
| 77 | \ S : X; \ | |
| 78 | \              X ~= {}; \
 | |
| 79 | \              {} ~: X; \
 | |
| 80 | \ ALL u: X. ALL v: X. u Int v : X; \ | |
| 81 | \ ALL u v. u: X & u<=v & v<=S --> v: X \ | |
| 82 | \ |] ==> X: Filter S"; | |
| 83 | by (blast_tac (claset() addIs [mem_FiltersetI,is_FilterI]) 1); | |
| 84 | qed "mem_FiltersetI2"; | |
| 85 | ||
| 86 | Goalw [is_Filter_def] | |
| 87 | "is_Filter X S ==> X <= Pow(S) & \ | |
| 88 | \ S : X & \ | |
| 89 | \                          X ~= {} & \
 | |
| 90 | \                          {} ~: X  & \
 | |
| 91 | \ (ALL u: X. ALL v: X. u Int v : X) & \ | |
| 92 | \ (ALL u v. u: X & u <= v & v<=S --> v: X)"; | |
| 93 | by (Fast_tac 1); | |
| 94 | qed "is_FilterE_lemma"; | |
| 95 | ||
| 96 | Goalw [is_Filter_def] | |
| 97 | "X : Filter S ==> X <= Pow(S) &\ | |
| 98 | \ S : X & \ | |
| 99 | \                          X ~= {} & \
 | |
| 100 | \                          {} ~: X  & \
 | |
| 101 | \ (ALL u: X. ALL v: X. u Int v : X) & \ | |
| 102 | \ (ALL u v. u: X & u <= v & v<=S --> v: X)"; | |
| 103 | by (etac (mem_FiltersetD RS is_FilterE_lemma) 1); | |
| 104 | qed "memFiltersetE_lemma"; | |
| 105 | ||
| 106 | Goalw [Filter_def,Freefilter_def] | |
| 107 | "X: Freefilter S ==> X: Filter S"; | |
| 108 | by (Fast_tac 1); | |
| 109 | qed "Freefilter_Filter"; | |
| 110 | ||
| 111 | Goalw [Freefilter_def] | |
| 112 | "X: Freefilter S ==> ALL y: X. ~finite(y)"; | |
| 113 | by (Blast_tac 1); | |
| 114 | qed "mem_Freefilter_not_finite"; | |
| 115 | ||
| 116 | Goal "[| X: Freefilter S; x: X |] ==> ~ finite x"; | |
| 117 | by (blast_tac (claset() addSDs [mem_Freefilter_not_finite]) 1); | |
| 118 | qed "mem_FreefiltersetD1"; | |
| 119 | ||
| 120 | bind_thm ("mem_FreefiltersetE1", (mem_FreefiltersetD1 RS notE));
 | |
| 121 | ||
| 122 | Goal "[| X: Freefilter S; finite x|] ==> x ~: X"; | |
| 123 | by (blast_tac (claset() addSDs [mem_Freefilter_not_finite]) 1); | |
| 124 | qed "mem_FreefiltersetD2"; | |
| 125 | ||
| 126 | Goalw [Freefilter_def] | |
| 127 | "[| X: Filter S; ALL x. ~(x: X & finite x) |] ==> X: Freefilter S"; | |
| 128 | by (Blast_tac 1); | |
| 129 | qed "mem_FreefiltersetI1"; | |
| 130 | ||
| 131 | Goalw [Freefilter_def] | |
| 132 | "[| X: Filter S; ALL x. (x ~: X | ~ finite x) |] ==> X: Freefilter S"; | |
| 133 | by (Blast_tac 1); | |
| 134 | qed "mem_FreefiltersetI2"; | |
| 135 | ||
| 136 | Goal "[| X: Filter S; A: X; B: X |] ==> A Int B ~= {}";
 | |
| 137 | by (forw_inst_tac [("A","A"),("B","B")] mem_FiltersetD1 1);
 | |
| 138 | by (auto_tac (claset() addSDs [Filter_empty_not_mem],simpset())); | |
| 139 | qed "Filter_Int_not_empty"; | |
| 140 | ||
| 141 | bind_thm ("Filter_Int_not_emptyE",(Filter_Int_not_empty RS notE));
 | |
| 142 | ||
| 143 | (*---------------------------------------------------------------------------------- | |
| 144 | Ultrafilters and Free ultrafilters | |
| 145 | ----------------------------------------------------------------------------------*) | |
| 146 | ||
| 147 | Goalw [Ultrafilter_def] "X : Ultrafilter S ==> X: Filter S"; | |
| 148 | by (Blast_tac 1); | |
| 149 | qed "Ultrafilter_Filter"; | |
| 150 | ||
| 151 | Goalw [Ultrafilter_def] | |
| 152 | "X : Ultrafilter S ==> !A: Pow(S). A : X | S - A: X"; | |
| 153 | by (Blast_tac 1); | |
| 154 | qed "mem_UltrafiltersetD2"; | |
| 155 | ||
| 156 | Goalw [Ultrafilter_def] | |
| 157 | "[|X : Ultrafilter S; A <= S; A ~: X |] ==> S - A: X"; | |
| 158 | by (Blast_tac 1); | |
| 159 | qed "mem_UltrafiltersetD3"; | |
| 160 | ||
| 161 | Goalw [Ultrafilter_def] | |
| 162 | "[|X : Ultrafilter S; A <= S; S - A ~: X |] ==> A: X"; | |
| 163 | by (Blast_tac 1); | |
| 164 | qed "mem_UltrafiltersetD4"; | |
| 165 | ||
| 166 | Goalw [Ultrafilter_def] | |
| 167 | "[| X: Filter S; \ | |
| 168 | \ ALL A: Pow(S). A: X | S - A : X |] ==> X: Ultrafilter S"; | |
| 169 | by (Blast_tac 1); | |
| 170 | qed "mem_UltrafiltersetI"; | |
| 171 | ||
| 172 | Goalw [Ultrafilter_def,FreeUltrafilter_def] | |
| 173 | "X: FreeUltrafilter S ==> X: Ultrafilter S"; | |
| 174 | by (Blast_tac 1); | |
| 175 | qed "FreeUltrafilter_Ultrafilter"; | |
| 176 | ||
| 177 | Goalw [FreeUltrafilter_def] | |
| 178 | "X: FreeUltrafilter S ==> ALL y: X. ~finite(y)"; | |
| 179 | by (Blast_tac 1); | |
| 180 | qed "mem_FreeUltrafilter_not_finite"; | |
| 181 | ||
| 182 | Goal "[| X: FreeUltrafilter S; x: X |] ==> ~ finite x"; | |
| 183 | by (blast_tac (claset() addSDs [mem_FreeUltrafilter_not_finite]) 1); | |
| 184 | qed "mem_FreeUltrafiltersetD1"; | |
| 185 | ||
| 186 | bind_thm ("mem_FreeUltrafiltersetE1", (mem_FreeUltrafiltersetD1 RS notE));
 | |
| 187 | ||
| 188 | Goal "[| X: FreeUltrafilter S; finite x|] ==> x ~: X"; | |
| 189 | by (blast_tac (claset() addSDs [mem_FreeUltrafilter_not_finite]) 1); | |
| 190 | qed "mem_FreeUltrafiltersetD2"; | |
| 191 | ||
| 192 | Goalw [FreeUltrafilter_def] | |
| 193 | "[| X: Ultrafilter S; \ | |
| 194 | \ ALL x. ~(x: X & finite x) |] ==> X: FreeUltrafilter S"; | |
| 195 | by (Blast_tac 1); | |
| 196 | qed "mem_FreeUltrafiltersetI1"; | |
| 197 | ||
| 198 | Goalw [FreeUltrafilter_def] | |
| 199 | "[| X: Ultrafilter S; \ | |
| 200 | \ ALL x. (x ~: X | ~ finite x) |] ==> X: FreeUltrafilter S"; | |
| 201 | by (Blast_tac 1); | |
| 202 | qed "mem_FreeUltrafiltersetI2"; | |
| 203 | ||
| 204 | Goalw [FreeUltrafilter_def,Freefilter_def,Ultrafilter_def] | |
| 205 | "(X: FreeUltrafilter S) = (X: Freefilter S & (ALL x:Pow(S). x: X | S - x: X))"; | |
| 206 | by (Blast_tac 1); | |
| 207 | qed "FreeUltrafilter_iff"; | |
| 208 | ||
| 209 | (*------------------------------------------------------------------- | |
| 210 | A Filter F on S is an ultrafilter iff it is a maximal filter | |
| 211 | i.e. whenever G is a filter on I and F <= F then F = G | |
| 212 | --------------------------------------------------------------------*) | |
| 213 | (*--------------------------------------------------------------------- | |
| 214 | lemmas that shows existence of an extension to what was assumed to | |
| 215 | be a maximal filter. Will be used to derive contradiction in proof of | |
| 216 | property of ultrafilter | |
| 217 | ---------------------------------------------------------------------*) | |
| 218 | Goal "[| F ~= {}; A <= S |] ==> \
 | |
| 219 | \        EX x. x: {X. X <= S & (EX f:F. A Int f <= X)}";
 | |
| 220 | by (Blast_tac 1); | |
| 221 | qed "lemma_set_extend"; | |
| 222 | ||
| 223 | Goal "a: X ==> X ~= {}";
 | |
| 224 | by (Step_tac 1); | |
| 225 | qed "lemma_set_not_empty"; | |
| 226 | ||
| 227 | Goal "x Int F <= {} ==> F <= - x";
 | |
| 228 | by (Blast_tac 1); | |
| 229 | qed "lemma_empty_Int_subset_Compl"; | |
| 230 | ||
| 231 | Goalw [Filter_def,is_Filter_def] | |
| 232 | "[| F: Filter S; A ~: F; A <= S|] \ | |
| 233 | \ ==> ALL B. B ~: F | ~ B <= A"; | |
| 234 | by (Blast_tac 1); | |
| 235 | qed "mem_Filterset_disjI"; | |
| 236 | ||
| 237 | Goal "F : Ultrafilter S ==> \ | |
| 238 | \ (F: Filter S & (ALL G: Filter S. F <= G --> F = G))"; | |
| 239 | by (auto_tac (claset(),simpset() addsimps [Ultrafilter_def])); | |
| 240 | by (dres_inst_tac [("x","x")] bspec 1);
 | |
| 241 | by (etac mem_FiltersetD3 1 THEN assume_tac 1); | |
| 242 | by (Step_tac 1); | |
| 243 | by (dtac subsetD 1 THEN assume_tac 1); | |
| 244 | by (blast_tac (claset() addSDs [Filter_Int_not_empty]) 1); | |
| 245 | qed "Ultrafilter_max_Filter"; | |
| 246 | ||
| 247 | ||
| 248 | (*-------------------------------------------------------------------------------- | |
| 249 | This is a very long and tedious proof; need to break it into parts. | |
| 250 |      Have proof that {X. X <= S & (EX f: F. A Int f <= X)} is a filter as 
 | |
| 251 | a lemma | |
| 252 | --------------------------------------------------------------------------------*) | |
| 253 | Goalw [Ultrafilter_def] | |
| 254 | "[| F: Filter S; \ | |
| 255 | \ ALL G: Filter S. F <= G --> F = G |] ==> F : Ultrafilter S"; | |
| 256 | by (Step_tac 1); | |
| 257 | by (rtac ccontr 1); | |
| 258 | by (forward_tac [mem_FiltersetD RS is_FilterD2] 1); | |
| 259 | by (forw_inst_tac [("x","{X. X <= S & (EX f: F. A Int f <= X)}")] bspec 1);
 | |
| 260 | by (EVERY1[rtac mem_FiltersetI2, Blast_tac, Asm_full_simp_tac]); | |
| 261 | by (blast_tac (claset() addDs [mem_FiltersetD3]) 1); | |
| 262 | by (etac (lemma_set_extend RS exE) 1); | |
| 263 | by (assume_tac 1 THEN etac lemma_set_not_empty 1); | |
| 264 | by (REPEAT(rtac ballI 2) THEN Asm_full_simp_tac 2); | |
| 265 | by (rtac conjI 2 THEN Blast_tac 2); | |
| 266 | by (REPEAT(etac conjE 2) THEN REPEAT(etac bexE 2)); | |
| 267 | by (res_inst_tac [("x","f Int fa")] bexI 2);
 | |
| 268 | by (etac mem_FiltersetD1 3); | |
| 269 | by (assume_tac 3 THEN assume_tac 3); | |
| 270 | by (Fast_tac 2); | |
| 271 | by (EVERY[REPEAT(rtac allI 2), rtac impI 2,Asm_full_simp_tac 2]); | |
| 272 | by (EVERY[REPEAT(etac conjE 2), etac bexE 2]); | |
| 273 | by (res_inst_tac [("x","f")] bexI 2);
 | |
| 274 | by (rtac subsetI 2); | |
| 275 | by (Fast_tac 2 THEN assume_tac 2); | |
| 276 | by (Step_tac 2); | |
| 277 | by (Blast_tac 3); | |
| 278 | by (eres_inst_tac [("c","A")] equalityCE 3);
 | |
| 279 | by (REPEAT(Blast_tac 3)); | |
| 280 | by (dres_inst_tac [("A","xa")] mem_FiltersetD3 2 THEN assume_tac 2);
 | |
| 281 | by (Blast_tac 2); | |
| 282 | by (dtac lemma_empty_Int_subset_Compl 1); | |
| 283 | by (EVERY1[ftac mem_Filterset_disjI , assume_tac, Fast_tac]); | |
| 284 | by (dtac mem_FiltersetD3 1 THEN assume_tac 1); | |
| 285 | by (dres_inst_tac [("x","f")] spec 1);
 | |
| 286 | by (Blast_tac 1); | |
| 287 | qed "max_Filter_Ultrafilter"; | |
| 288 | ||
| 289 | Goal "(F : Ultrafilter S) = (F: Filter S & (ALL G: Filter S. F <= G --> F = G))"; | |
| 290 | by (blast_tac (claset() addSIs [Ultrafilter_max_Filter,max_Filter_Ultrafilter]) 1); | |
| 291 | qed "Ultrafilter_iff"; | |
| 292 | ||
| 293 | (*-------------------------------------------------------------------- | |
| 294 | A few properties of freefilters | |
| 295 | -------------------------------------------------------------------*) | |
| 296 | ||
| 297 | Goal "F1 Int F2 = ((F1 Int Y) Int F2) Un ((F2 Int (- Y)) Int F1)"; | |
| 298 | by (Auto_tac); | |
| 299 | qed "lemma_Compl_cancel_eq"; | |
| 300 | ||
| 301 | Goal "finite X ==> finite (X Int Y)"; | |
| 302 | by (etac (Int_lower1 RS finite_subset) 1); | |
| 303 | qed "finite_IntI1"; | |
| 304 | ||
| 305 | Goal "finite Y ==> finite (X Int Y)"; | |
| 306 | by (etac (Int_lower2 RS finite_subset) 1); | |
| 307 | qed "finite_IntI2"; | |
| 308 | ||
| 309 | Goal "[| finite (F1 Int Y); \ | |
| 310 | \ finite (F2 Int (- Y)) \ | |
| 311 | \ |] ==> finite (F1 Int F2)"; | |
| 312 | by (res_inst_tac [("Y1","Y")] (lemma_Compl_cancel_eq RS ssubst) 1);
 | |
| 313 | by (rtac finite_UnI 1); | |
| 314 | by (auto_tac (claset() addSIs [finite_IntI1,finite_IntI2],simpset())); | |
| 315 | qed "finite_Int_Compl_cancel"; | |
| 316 | ||
| 317 | Goal "U: Freefilter S ==> \ | |
| 318 | \ ~ (EX f1: U. EX f2: U. finite (f1 Int x) \ | |
| 319 | \ & finite (f2 Int (- x)))"; | |
| 320 | by (Step_tac 1); | |
| 321 | by (forw_inst_tac [("A","f1"),("B","f2")] 
 | |
| 322 | (Freefilter_Filter RS mem_FiltersetD1) 1); | |
| 323 | by (dres_inst_tac [("x","f1 Int f2")] mem_FreefiltersetD1 3);
 | |
| 324 | by (dtac finite_Int_Compl_cancel 4); | |
| 325 | by (Auto_tac); | |
| 326 | qed "Freefilter_lemma_not_finite"; | |
| 327 | ||
| 328 | (* the lemmas below follow *) | |
| 329 | Goal "U: Freefilter S ==> \ | |
| 330 | \ ALL f: U. ~ finite (f Int x) | ~finite (f Int (- x))"; | |
| 331 | by (blast_tac (claset() addSDs [Freefilter_lemma_not_finite,bspec]) 1); | |
| 332 | qed "Freefilter_Compl_not_finite_disjI"; | |
| 333 | ||
| 334 | Goal "U: Freefilter S ==> \ | |
| 335 | \ (ALL f: U. ~ finite (f Int x)) | (ALL f:U. ~finite (f Int (- x)))"; | |
| 336 | by (blast_tac (claset() addSDs [Freefilter_lemma_not_finite,bspec]) 1); | |
| 337 | qed "Freefilter_Compl_not_finite_disjI2"; | |
| 338 | ||
| 339 | Goal "- UNIV = {}";
 | |
| 340 | by (Auto_tac ); | |
| 341 | qed "Compl_UNIV_eq"; | |
| 342 | ||
| 343 | Addsimps [Compl_UNIV_eq]; | |
| 344 | ||
| 345 | Goal "- {} = UNIV";
 | |
| 346 | by (Auto_tac ); | |
| 347 | qed "Compl_empty_eq"; | |
| 348 | ||
| 349 | Addsimps [Compl_empty_eq]; | |
| 350 | ||
| 351 | val [prem] = goal (the_context ()) "~ finite (UNIV:: 'a set) ==> \ | |
| 352 | \            {A:: 'a set. finite (- A)} : Filter UNIV";
 | |
| 353 | by (cut_facts_tac [prem] 1); | |
| 354 | by (rtac mem_FiltersetI2 1); | |
| 355 | by (auto_tac (claset(), simpset() delsimps [Collect_empty_eq])); | |
| 356 | by (eres_inst_tac [("c","UNIV")] equalityCE 1);
 | |
| 357 | by (Auto_tac); | |
| 358 | by (etac (Compl_anti_mono RS finite_subset) 1); | |
| 359 | by (assume_tac 1); | |
| 360 | qed "cofinite_Filter"; | |
| 361 | ||
| 362 | Goal "~finite(UNIV :: 'a set) ==> ~finite (X :: 'a set) | ~finite (- X)"; | |
| 363 | by (dres_inst_tac [("A1","X")] (Compl_partition RS ssubst) 1);
 | |
| 364 | by (Asm_full_simp_tac 1); | |
| 365 | qed "not_finite_UNIV_disjI"; | |
| 366 | ||
| 367 | Goal "[| ~finite(UNIV :: 'a set); \ | |
| 368 | \ finite (X :: 'a set) \ | |
| 369 | \ |] ==> ~finite (- X)"; | |
| 370 | by (dres_inst_tac [("X","X")] not_finite_UNIV_disjI 1);
 | |
| 371 | by (Blast_tac 1); | |
| 372 | qed "not_finite_UNIV_Compl"; | |
| 373 | ||
| 374 | val [prem] = goal (the_context ()) "~ finite (UNIV:: 'a set) ==> \ | |
| 375 | \            !X: {A:: 'a set. finite (- A)}. ~ finite X";
 | |
| 376 | by (cut_facts_tac [prem] 1); | |
| 377 | by (auto_tac (claset() addDs [not_finite_UNIV_disjI],simpset())); | |
| 378 | qed "mem_cofinite_Filter_not_finite"; | |
| 379 | ||
| 380 | val [prem] = goal (the_context ()) "~ finite (UNIV:: 'a set) ==> \ | |
| 381 | \            {A:: 'a set. finite (- A)} : Freefilter UNIV";
 | |
| 382 | by (cut_facts_tac [prem] 1); | |
| 383 | by (rtac mem_FreefiltersetI2 1); | |
| 384 | by (rtac cofinite_Filter 1 THEN assume_tac 1); | |
| 385 | by (blast_tac (claset() addSDs [mem_cofinite_Filter_not_finite]) 1); | |
| 386 | qed "cofinite_Freefilter"; | |
| 387 | ||
| 388 | Goal "UNIV - x = - x"; | |
| 389 | by (Auto_tac); | |
| 390 | qed "UNIV_diff_Compl"; | |
| 391 | Addsimps [UNIV_diff_Compl]; | |
| 392 | ||
| 393 | Goalw [Ultrafilter_def,FreeUltrafilter_def] | |
| 394 | "[| ~finite(UNIV :: 'a set); (U :: 'a set set): FreeUltrafilter UNIV\ | |
| 395 | \         |] ==> {X. finite(- X)} <= U";
 | |
| 396 | by (ftac cofinite_Filter 1); | |
| 397 | by (Step_tac 1); | |
| 398 | by (forw_inst_tac [("X","- x :: 'a set")] not_finite_UNIV_Compl 1);
 | |
| 399 | by (assume_tac 1); | |
| 400 | by (Step_tac 1 THEN Fast_tac 1); | |
| 401 | by (dres_inst_tac [("x","x")] bspec 1);
 | |
| 402 | by (Blast_tac 1); | |
| 403 | by (asm_full_simp_tac (simpset() addsimps [UNIV_diff_Compl]) 1); | |
| 404 | qed "FreeUltrafilter_contains_cofinite_set"; | |
| 405 | ||
| 406 | (*-------------------------------------------------------------------- | |
| 407 | We prove: 1. Existence of maximal filter i.e. ultrafilter | |
| 408 | 2. Freeness property i.e ultrafilter is free | |
| 409 | Use a locale to prove various lemmas and then | |
| 410 | export main result: The Ultrafilter Theorem | |
| 411 | -------------------------------------------------------------------*) | |
| 412 | Open_locale "UFT"; | |
| 413 | ||
| 414 | Goalw [chain_def, thm "superfrechet_def", thm "frechet_def"] | |
| 415 | "!!(c :: 'a set set set). c : chain (superfrechet S) ==> Union c <= Pow S"; | |
| 416 | by (Step_tac 1); | |
| 417 | by (dtac subsetD 1 THEN assume_tac 1); | |
| 418 | by (Step_tac 1); | |
| 419 | by (dres_inst_tac [("X","X")] mem_FiltersetD3 1);
 | |
| 420 | by (Auto_tac); | |
| 421 | qed "chain_Un_subset_Pow"; | |
| 422 | ||
| 423 | Goalw [chain_def,Filter_def,is_Filter_def, | |
| 424 | thm "superfrechet_def", thm "frechet_def"] | |
| 425 | "!!(c :: 'a set set set). c: chain (superfrechet S) \ | |
| 426 | \         ==> !x: c. {} < x";
 | |
| 427 | by (blast_tac (claset() addSIs [psubsetI]) 1); | |
| 428 | qed "mem_chain_psubset_empty"; | |
| 429 | ||
| 430 | Goal "!!(c :: 'a set set set). \ | |
| 431 | \ [| c: chain (superfrechet S);\ | |
| 432 | \               c ~= {} \
 | |
| 433 | \ |]\ | |
| 434 | \            ==> Union(c) ~= {}";
 | |
| 435 | by (dtac mem_chain_psubset_empty 1); | |
| 436 | by (Step_tac 1); | |
| 437 | by (dtac bspec 1 THEN assume_tac 1); | |
| 438 | by (auto_tac (claset() addDs [Union_upper,bspec], | |
| 439 | simpset() addsimps [psubset_def])); | |
| 440 | qed "chain_Un_not_empty"; | |
| 441 | ||
| 442 | Goalw [is_Filter_def,Filter_def,chain_def,thm "superfrechet_def"] | |
| 443 | "!!(c :: 'a set set set). \ | |
| 444 | \ c : chain (superfrechet S) \ | |
| 445 | \           ==> {} ~: Union(c)";
 | |
| 446 | by (Blast_tac 1); | |
| 447 | qed "Filter_empty_not_mem_Un"; | |
| 448 | ||
| 449 | Goal "c: chain (superfrechet S) \ | |
| 450 | \ ==> ALL u : Union(c). ALL v: Union(c). u Int v : Union(c)"; | |
| 451 | by (Step_tac 1); | |
| 452 | by (forw_inst_tac [("x","X"),("y","Xa")] chainD 1);
 | |
| 453 | by (REPEAT(assume_tac 1)); | |
| 454 | by (dtac chainD2 1); | |
| 455 | by (etac disjE 1); | |
| 456 | by (res_inst_tac [("X","Xa")] UnionI 1 THEN assume_tac 1);
 | |
| 457 | by (dres_inst_tac [("A","X")] subsetD 1 THEN assume_tac 1);
 | |
| 458 | by (dres_inst_tac [("c","Xa")] subsetD 1 THEN assume_tac 1);
 | |
| 459 | by (res_inst_tac [("X","X")] UnionI 2 THEN assume_tac 2);
 | |
| 460 | by (dres_inst_tac [("A","Xa")] subsetD 2 THEN assume_tac 2);
 | |
| 461 | by (dres_inst_tac [("c","X")] subsetD 2 THEN assume_tac 2);
 | |
| 462 | by (auto_tac (claset() addIs [mem_FiltersetD1], | |
| 463 | simpset() addsimps [thm "superfrechet_def"])); | |
| 464 | qed "Filter_Un_Int"; | |
| 465 | ||
| 466 | Goal "c: chain (superfrechet S) \ | |
| 467 | \ ==> ALL u v. u: Union(c) & \ | |
| 468 | \ (u :: 'a set) <= v & v <= S --> v: Union(c)"; | |
| 469 | by (Step_tac 1); | |
| 470 | by (dtac chainD2 1); | |
| 471 | by (dtac subsetD 1 THEN assume_tac 1); | |
| 472 | by (rtac UnionI 1 THEN assume_tac 1); | |
| 473 | by (auto_tac (claset() addIs [mem_FiltersetD2], | |
| 474 | simpset() addsimps [thm "superfrechet_def"])); | |
| 475 | qed "Filter_Un_subset"; | |
| 476 | ||
| 477 | Goalw [chain_def,thm "superfrechet_def"] | |
| 478 | "!!(c :: 'a set set set). \ | |
| 479 | \ [| c: chain (superfrechet S);\ | |
| 480 | \ x: c \ | |
| 481 | \ |] ==> x : Filter S"; | |
| 482 | by (Blast_tac 1); | |
| 483 | qed "lemma_mem_chain_Filter"; | |
| 484 | ||
| 485 | Goalw [chain_def,thm "superfrechet_def"] | |
| 486 | "!!(c :: 'a set set set). \ | |
| 487 | \ [| c: chain (superfrechet S);\ | |
| 488 | \ x: c \ | |
| 489 | \ |] ==> frechet S <= x"; | |
| 490 | by (Blast_tac 1); | |
| 491 | qed "lemma_mem_chain_frechet_subset"; | |
| 492 | ||
| 493 | Goal "!!(c :: 'a set set set). \ | |
| 494 | \         [| c ~= {}; \
 | |
| 495 | \ c : chain (superfrechet (UNIV :: 'a set))\ | |
| 496 | \ |] ==> Union c : superfrechet (UNIV)"; | |
| 497 | by (simp_tac (simpset() addsimps | |
| 498 | [thm "superfrechet_def",thm "frechet_def"]) 1); | |
| 499 | by (Step_tac 1); | |
| 500 | by (rtac mem_FiltersetI2 1); | |
| 501 | by (etac chain_Un_subset_Pow 1); | |
| 502 | by (rtac UnionI 1 THEN assume_tac 1); | |
| 503 | by (etac (lemma_mem_chain_Filter RS mem_FiltersetD4) 1 THEN assume_tac 1); | |
| 504 | by (etac chain_Un_not_empty 1); | |
| 505 | by (etac Filter_empty_not_mem_Un 2); | |
| 506 | by (etac Filter_Un_Int 2); | |
| 507 | by (etac Filter_Un_subset 2); | |
| 508 | by (subgoal_tac "xa : frechet (UNIV)" 2); | |
| 509 | by (rtac UnionI 2 THEN assume_tac 2); | |
| 510 | by (rtac (lemma_mem_chain_frechet_subset RS subsetD) 2); | |
| 511 | by (auto_tac (claset(),simpset() addsimps [thm "frechet_def"])); | |
| 512 | qed "Un_chain_mem_cofinite_Filter_set"; | |
| 513 | ||
| 514 | Goal "EX U: superfrechet (UNIV). \ | |
| 515 | \ ALL G: superfrechet (UNIV). U <= G --> U = G"; | |
| 516 | by (rtac Zorn_Lemma2 1); | |
| 517 | by (cut_facts_tac [thm "not_finite_UNIV" RS cofinite_Filter] 1); | |
| 518 | by (Step_tac 1); | |
| 519 | by (res_inst_tac [("Q","c={}")] (excluded_middle RS disjE) 1);
 | |
| 520 | by (res_inst_tac [("x","Union c")] bexI 1 THEN Blast_tac 1);
 | |
| 521 | by (rtac Un_chain_mem_cofinite_Filter_set 1 THEN REPEAT(assume_tac 1)); | |
| 522 | by (res_inst_tac [("x","frechet (UNIV)")] bexI 1 THEN Blast_tac 1);
 | |
| 523 | by (auto_tac (claset(), | |
| 524 | simpset() addsimps | |
| 525 | [thm "superfrechet_def", thm "frechet_def"])); | |
| 526 | qed "max_cofinite_Filter_Ex"; | |
| 527 | ||
| 528 | Goal "EX U: superfrechet UNIV. (\ | |
| 529 | \ ALL G: superfrechet UNIV. U <= G --> U = G) \ | |
| 530 | \ & (ALL x: U. ~finite x)"; | |
| 531 | by (cut_facts_tac [thm "not_finite_UNIV" RS | |
| 532 | (export max_cofinite_Filter_Ex)] 1); | |
| 533 | by (Step_tac 1); | |
| 534 | by (res_inst_tac [("x","U")] bexI 1);
 | |
| 535 | by (auto_tac (claset(),simpset() addsimps | |
| 536 | [thm "superfrechet_def", thm "frechet_def"])); | |
| 537 | by (dres_inst_tac [("c","- x")] subsetD 1);
 | |
| 538 | by (Asm_simp_tac 1); | |
| 539 | by (forw_inst_tac [("A","x"),("B","- x")] mem_FiltersetD1 1);
 | |
| 540 | by (dtac Filter_empty_not_mem 3); | |
| 541 | by (ALLGOALS(Asm_full_simp_tac )); | |
| 542 | qed "max_cofinite_Freefilter_Ex"; | |
| 543 | ||
| 544 | (*-------------------------------------------------------------------------------- | |
| 545 | There exists a free ultrafilter on any infinite set | |
| 546 | --------------------------------------------------------------------------------*) | |
| 547 | ||
| 548 | Goalw [FreeUltrafilter_def] "EX U. U: FreeUltrafilter (UNIV :: 'a set)"; | |
| 549 | by (cut_facts_tac [thm "not_finite_UNIV" RS (export max_cofinite_Freefilter_Ex)] 1); | |
| 550 | by (asm_full_simp_tac (simpset() addsimps | |
| 551 | [thm "superfrechet_def", Ultrafilter_iff, thm "frechet_def"]) 1); | |
| 552 | by (Step_tac 1); | |
| 553 | by (res_inst_tac [("x","U")] exI 1);
 | |
| 554 | by (Step_tac 1); | |
| 555 | by (Blast_tac 1); | |
| 556 | qed "FreeUltrafilter_ex"; | |
| 557 | ||
| 558 | bind_thm ("FreeUltrafilter_Ex", export FreeUltrafilter_ex);
 | |
| 559 | ||
| 560 | Close_locale "UFT"; |