419 subsection {* Topological spaces *} |
419 subsection {* Topological spaces *} |
420 |
420 |
421 class topo = |
421 class topo = |
422 fixes topo :: "'a set set" |
422 fixes topo :: "'a set set" |
423 |
423 |
|
424 text {* |
|
425 The syntactic class uses @{term topo} instead of @{text "open"} |
|
426 so that @{text "open"} and @{text closed} will have the same type. |
|
427 Maybe we could use extra type constraints instead, like with |
|
428 @{text dist} and @{text norm}? |
|
429 *} |
|
430 |
424 class topological_space = topo + |
431 class topological_space = topo + |
425 assumes topo_UNIV: "UNIV \<in> topo" |
432 assumes topo_UNIV: "UNIV \<in> topo" |
426 assumes topo_Int: "A \<in> topo \<Longrightarrow> B \<in> topo \<Longrightarrow> A \<inter> B \<in> topo" |
433 assumes topo_Int: "A \<in> topo \<Longrightarrow> B \<in> topo \<Longrightarrow> A \<inter> B \<in> topo" |
427 assumes topo_Union: "T \<subseteq> topo \<Longrightarrow> \<Union>T \<in> topo" |
434 assumes topo_Union: "T \<subseteq> topo \<Longrightarrow> \<Union>T \<in> topo" |
|
435 begin |
|
436 |
|
437 definition |
|
438 "open" :: "'a set \<Rightarrow> bool" where |
|
439 "open S \<longleftrightarrow> S \<in> topo" |
|
440 |
|
441 definition |
|
442 closed :: "'a set \<Rightarrow> bool" where |
|
443 "closed S \<longleftrightarrow> open (- S)" |
|
444 |
|
445 lemma open_UNIV [intro, simp]: "open UNIV" |
|
446 unfolding open_def by (rule topo_UNIV) |
|
447 |
|
448 lemma open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)" |
|
449 unfolding open_def by (rule topo_Int) |
|
450 |
|
451 lemma open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union> K)" |
|
452 unfolding open_def subset_eq [symmetric] by (rule topo_Union) |
|
453 |
|
454 lemma open_empty [intro, simp]: "open {}" |
|
455 using open_Union [of "{}"] by simp |
|
456 |
|
457 lemma open_Un [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<union> T)" |
|
458 using open_Union [of "{S, T}"] by simp |
|
459 |
|
460 lemma open_UN [intro]: "\<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union>x\<in>A. B x)" |
|
461 unfolding UN_eq by (rule open_Union) auto |
|
462 |
|
463 lemma open_INT [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Inter>x\<in>A. B x)" |
|
464 by (induct set: finite) auto |
|
465 |
|
466 lemma open_Inter [intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)" |
|
467 unfolding Inter_def by (rule open_INT) |
|
468 |
|
469 lemma closed_empty [intro, simp]: "closed {}" |
|
470 unfolding closed_def by simp |
|
471 |
|
472 lemma closed_Un [intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<union> T)" |
|
473 unfolding closed_def by auto |
|
474 |
|
475 lemma closed_Inter [intro]: "\<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter> K)" |
|
476 unfolding closed_def Inter_def by auto |
|
477 |
|
478 lemma closed_UNIV [intro, simp]: "closed UNIV" |
|
479 unfolding closed_def by simp |
|
480 |
|
481 lemma closed_Int [intro]: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<inter> T)" |
|
482 unfolding closed_def by auto |
|
483 |
|
484 lemma closed_INT [intro]: "\<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Inter>x\<in>A. B x)" |
|
485 unfolding closed_def by auto |
|
486 |
|
487 lemma closed_UN [intro]: "finite A \<Longrightarrow> \<forall>x\<in>A. closed (B x) \<Longrightarrow> closed (\<Union>x\<in>A. B x)" |
|
488 by (induct set: finite) auto |
|
489 |
|
490 lemma closed_Union [intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. closed T \<Longrightarrow> closed (\<Union>S)" |
|
491 unfolding Union_def by (rule closed_UN) |
|
492 |
|
493 lemma open_closed: "open S \<longleftrightarrow> closed (- S)" |
|
494 unfolding closed_def by simp |
|
495 |
|
496 lemma closed_open: "closed S \<longleftrightarrow> open (- S)" |
|
497 unfolding closed_def by simp |
|
498 |
|
499 lemma open_Diff [intro]: "open S \<Longrightarrow> closed T \<Longrightarrow> open (S - T)" |
|
500 unfolding closed_open Diff_eq by (rule open_Int) |
|
501 |
|
502 lemma closed_Diff [intro]: "closed S \<Longrightarrow> open T \<Longrightarrow> closed (S - T)" |
|
503 unfolding open_closed Diff_eq by (rule closed_Int) |
|
504 |
|
505 lemma open_Compl [intro]: "closed S \<Longrightarrow> open (- S)" |
|
506 unfolding closed_open . |
|
507 |
|
508 lemma closed_Compl [intro]: "open S \<Longrightarrow> closed (- S)" |
|
509 unfolding open_closed . |
|
510 |
|
511 end |
428 |
512 |
429 |
513 |
430 subsection {* Metric spaces *} |
514 subsection {* Metric spaces *} |
431 |
515 |
432 class dist = |
516 class dist = |