| author | wenzelm | 
| Tue, 12 Mar 2024 15:31:44 +0100 | |
| changeset 79872 | 85ff8d62c414 | 
| parent 78475 | a5f6d2fc1b1f | 
| child 82538 | 4b132ea7d575 | 
| permissions | -rw-r--r-- | 
| 66835 | 1 | (* Author: L C Paulson, University of Cambridge | 
| 2 | Material split off from Topology_Euclidean_Space | |
| 3 | *) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 4 | |
| 69617 | 5 | section \<open>Connected Components\<close> | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 6 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7 | theory Connected | 
| 69544 
5aa5a8d6e5b5
split off theorems involving classes below metric_space and real_normed_vector
 immler parents: 
69529diff
changeset | 8 | imports | 
| 69617 | 9 | Abstract_Topology_2 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 10 | begin | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 11 | |
| 70136 | 12 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Connectedness\<close> | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 13 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 14 | lemma connected_local: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 15 | "connected S \<longleftrightarrow> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 16 | \<not> (\<exists>e1 e2. | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 17 | openin (top_of_set S) e1 \<and> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 18 | openin (top_of_set S) e2 \<and> | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 19 | S \<subseteq> e1 \<union> e2 \<and> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 20 |       e1 \<inter> e2 = {} \<and>
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 21 |       e1 \<noteq> {} \<and>
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 22 |       e2 \<noteq> {})"
 | 
| 78475 | 23 | using connected_openin by blast | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 24 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 25 | lemma exists_diff: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 26 | fixes P :: "'a set \<Rightarrow> bool" | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 27 | shows "(\<exists>S. P (- S)) \<longleftrightarrow> (\<exists>S. P S)" | 
| 78475 | 28 | by (metis boolean_algebra_class.boolean_algebra.double_compl) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 29 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 30 | lemma connected_clopen: "connected S \<longleftrightarrow> | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 31 | (\<forall>T. openin (top_of_set S) T \<and> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 32 |      closedin (top_of_set S) T \<longrightarrow> T = {} \<or> T = S)" (is "?lhs \<longleftrightarrow> ?rhs")
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 33 | proof - | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 34 | have "\<not> connected S \<longleftrightarrow> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 35 |     (\<exists>e1 e2. open e1 \<and> open (- e2) \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})"
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 36 | unfolding connected_def openin_open closedin_closed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 37 | by (metis double_complement) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 38 | then have th0: "connected S \<longleftrightarrow> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 39 |     \<not> (\<exists>e2 e1. closed e2 \<and> open e1 \<and> S \<subseteq> e1 \<union> (- e2) \<and> e1 \<inter> (- e2) \<inter> S = {} \<and> e1 \<inter> S \<noteq> {} \<and> (- e2) \<inter> S \<noteq> {})"
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 40 | (is " _ \<longleftrightarrow> \<not> (\<exists>e2 e1. ?P e2 e1)") | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 41 | by (simp add: closed_def) metis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 42 |   have th1: "?rhs \<longleftrightarrow> \<not> (\<exists>t' t. closed t'\<and>t = S\<inter>t' \<and> t\<noteq>{} \<and> t\<noteq>S \<and> (\<exists>t'. open t' \<and> t = S \<inter> t'))"
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 43 | (is "_ \<longleftrightarrow> \<not> (\<exists>t' t. ?Q t' t)") | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 44 | unfolding connected_def openin_open closedin_closed by auto | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 45 | have "(\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" for e2 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 46 | proof - | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 47 |     have "?P e2 e1 \<longleftrightarrow> (\<exists>t. closed e2 \<and> t = S\<inter>e2 \<and> open e1 \<and> t = S\<inter>e1 \<and> t\<noteq>{} \<and> t \<noteq> S)" for e1
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 48 | by auto | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 49 | then show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 50 | by metis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 51 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 52 | then have "\<forall>e2. (\<exists>e1. ?P e2 e1) \<longleftrightarrow> (\<exists>t. ?Q e2 t)" | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 53 | by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 54 | then show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 55 | by (simp add: th0 th1) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 56 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 57 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 58 | subsection \<open>Connected components, considered as a connectedness relation or a set\<close> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 59 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 60 | definition\<^marker>\<open>tag important\<close> "connected_component S x y \<equiv> \<exists>T. connected T \<and> T \<subseteq> S \<and> x \<in> T \<and> y \<in> T" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 61 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 62 | abbreviation "connected_component_set S x \<equiv> Collect (connected_component S x)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 63 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 64 | lemma connected_componentI: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 65 | "connected T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> x \<in> T \<Longrightarrow> y \<in> T \<Longrightarrow> connected_component S x y" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 66 | by (auto simp: connected_component_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 67 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 68 | lemma connected_component_in: "connected_component S x y \<Longrightarrow> x \<in> S \<and> y \<in> S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 69 | by (auto simp: connected_component_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 70 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 71 | lemma connected_component_refl: "x \<in> S \<Longrightarrow> connected_component S x x" | 
| 78475 | 72 | using connected_component_def connected_sing by blast | 
| 73 | ||
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 74 | lemma connected_component_refl_eq [simp]: "connected_component S x x \<longleftrightarrow> x \<in> S" | 
| 78475 | 75 | using connected_component_in connected_component_refl by blast | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 76 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 77 | lemma connected_component_sym: "connected_component S x y \<Longrightarrow> connected_component S y x" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 78 | by (auto simp: connected_component_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 79 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 80 | lemma connected_component_trans: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 81 | "connected_component S x y \<Longrightarrow> connected_component S y z \<Longrightarrow> connected_component S x z" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 82 | unfolding connected_component_def | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 83 | by (metis Int_iff Un_iff Un_subset_iff equals0D connected_Un) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 84 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 85 | lemma connected_component_of_subset: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 86 | "connected_component S x y \<Longrightarrow> S \<subseteq> T \<Longrightarrow> connected_component T x y" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 87 | by (auto simp: connected_component_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 88 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 89 | lemma connected_component_Union: "connected_component_set S x = \<Union>{T. connected T \<and> x \<in> T \<and> T \<subseteq> S}"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | by (auto simp: connected_component_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 91 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 92 | lemma connected_connected_component [iff]: "connected (connected_component_set S x)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | by (auto simp: connected_component_Union intro: connected_Union) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 94 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 95 | lemma connected_iff_eq_connected_component_set: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 96 | "connected S \<longleftrightarrow> (\<forall>x \<in> S. connected_component_set S x = S)" | 
| 78475 | 97 | by (metis connected_component_def connected_component_in connected_connected_component mem_Collect_eq subsetI subset_antisym) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 98 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 99 | lemma connected_component_subset: "connected_component_set S x \<subseteq> S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 100 | using connected_component_in by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 101 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 102 | lemma connected_component_eq_self: "connected S \<Longrightarrow> x \<in> S \<Longrightarrow> connected_component_set S x = S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 103 | by (simp add: connected_iff_eq_connected_component_set) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 104 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 105 | lemma connected_iff_connected_component: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 106 | "connected S \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y \<in> S. connected_component S x y)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | using connected_component_in by (auto simp: connected_iff_eq_connected_component_set) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 | lemma connected_component_maximal: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 110 | "x \<in> T \<Longrightarrow> connected T \<Longrightarrow> T \<subseteq> S \<Longrightarrow> T \<subseteq> (connected_component_set S x)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 111 | using connected_component_eq_self connected_component_of_subset by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 112 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 113 | lemma connected_component_mono: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 114 | "S \<subseteq> T \<Longrightarrow> connected_component_set S x \<subseteq> connected_component_set T x" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 115 | by (simp add: Collect_mono connected_component_of_subset) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 116 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 117 | lemma connected_component_eq_empty [simp]: "connected_component_set S x = {} \<longleftrightarrow> x \<notin> S"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 118 | using connected_component_refl by (fastforce simp: connected_component_in) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 119 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 120 | lemma connected_component_set_empty [simp]: "connected_component_set {} x = {}"
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 121 | using connected_component_eq_empty by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 122 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 123 | lemma connected_component_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 124 | "y \<in> connected_component_set S x \<Longrightarrow> (connected_component_set S y = connected_component_set S x)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 125 | by (metis (no_types, lifting) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 126 | Collect_cong connected_component_sym connected_component_trans mem_Collect_eq) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 127 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 128 | lemma closed_connected_component: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 129 | assumes S: "closed S" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 130 | shows "closed (connected_component_set S x)" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 131 | proof (cases "x \<in> S") | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 132 | case False | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 133 | then show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 134 | by (metis connected_component_eq_empty closed_empty) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 135 | next | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 136 | case True | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 137 | show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 138 | unfolding closure_eq [symmetric] | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 139 | proof | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 140 | show "closure (connected_component_set S x) \<subseteq> connected_component_set S x" | 
| 78475 | 141 | proof (rule connected_component_maximal) | 
| 142 | show "x \<in> closure (connected_component_set S x)" | |
| 143 | by (simp add: closure_def True) | |
| 144 | show "connected (closure (connected_component_set S x))" | |
| 145 | by (simp add: connected_imp_connected_closure) | |
| 146 | show "closure (connected_component_set S x) \<subseteq> S" | |
| 147 | by (simp add: S closure_minimal connected_component_subset) | |
| 148 | qed | |
| 149 | qed (simp add: closure_subset) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 150 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 151 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 152 | lemma connected_component_disjoint: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 153 |   "connected_component_set S a \<inter> connected_component_set S b = {} \<longleftrightarrow>
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 154 | a \<notin> connected_component_set S b" | 
| 78475 | 155 | by (smt (verit) connected_component_eq connected_component_eq_empty connected_component_refl_eq | 
| 156 | disjoint_iff_not_equal mem_Collect_eq) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 157 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 158 | lemma connected_component_nonoverlap: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 159 |   "connected_component_set S a \<inter> connected_component_set S b = {} \<longleftrightarrow>
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 160 | a \<notin> S \<or> b \<notin> S \<or> connected_component_set S a \<noteq> connected_component_set S b" | 
| 78475 | 161 | by (metis connected_component_disjoint connected_component_eq connected_component_eq_empty inf.idem) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 | lemma connected_component_overlap: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 164 |   "connected_component_set S a \<inter> connected_component_set S b \<noteq> {} \<longleftrightarrow>
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 165 | a \<in> S \<and> b \<in> S \<and> connected_component_set S a = connected_component_set S b" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 | by (auto simp: connected_component_nonoverlap) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 168 | lemma connected_component_sym_eq: "connected_component S x y \<longleftrightarrow> connected_component S y x" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 | using connected_component_sym by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | lemma connected_component_eq_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 172 | "connected_component_set S x = connected_component_set S y \<longleftrightarrow> | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 173 | x \<notin> S \<and> y \<notin> S \<or> x \<in> S \<and> y \<in> S \<and> connected_component S x y" | 
| 78475 | 174 | by (metis connected_component_eq connected_component_eq_empty connected_component_refl mem_Collect_eq) | 
| 175 | ||
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 176 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | lemma connected_iff_connected_component_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 178 | "connected S \<longleftrightarrow> (\<forall>x \<in> S. \<forall>y \<in> S. connected_component_set S x = connected_component_set S y)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 179 | by (simp add: connected_component_eq_eq connected_iff_connected_component) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 180 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 181 | lemma connected_component_idemp: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 182 | "connected_component_set (connected_component_set S x) x = connected_component_set S x" | 
| 78475 | 183 | by (metis Int_absorb connected_component_disjoint connected_component_eq_empty connected_component_eq_self connected_connected_component) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 184 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | lemma connected_component_unique: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 186 | "\<lbrakk>x \<in> c; c \<subseteq> S; connected c; | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 187 | \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk> | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 188 | \<Longrightarrow> connected_component_set S x = c" | 
| 78475 | 189 | by (meson connected_component_maximal connected_component_subset connected_connected_component subsetD subset_antisym) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 191 | lemma joinable_connected_component_eq: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 192 | "\<lbrakk>connected T; T \<subseteq> S; | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 193 |     connected_component_set S x \<inter> T \<noteq> {};
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 194 |     connected_component_set S y \<inter> T \<noteq> {}\<rbrakk>
 | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 195 | \<Longrightarrow> connected_component_set S x = connected_component_set S y" | 
| 77223 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 196 | by (metis (full_types) subsetD connected_component_eq connected_component_maximal disjoint_iff_not_equal) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 197 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 198 | lemma Union_connected_component: "\<Union>(connected_component_set S ` S) = S" | 
| 78475 | 199 | proof | 
| 200 | show "\<Union>(connected_component_set S ` S) \<subseteq> S" | |
| 201 | by (simp add: SUP_least connected_component_subset) | |
| 202 | qed (use connected_component_refl_eq in force) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 203 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 204 | lemma complement_connected_component_unions: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 205 | "S - connected_component_set S x = | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 206 |      \<Union>(connected_component_set S ` S - {connected_component_set S x})"
 | 
| 78475 | 207 | (is "?lhs = ?rhs") | 
| 208 | proof | |
| 209 | show "?lhs \<subseteq> ?rhs" | |
| 210 | by (metis Diff_subset Diff_subset_conv Sup_insert Union_connected_component insert_Diff_single) | |
| 211 | show "?rhs \<subseteq> ?lhs" | |
| 212 | by clarsimp (metis connected_component_eq_eq connected_component_in) | |
| 213 | qed | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 215 | lemma connected_component_intermediate_subset: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 216 | "\<lbrakk>connected_component_set U a \<subseteq> T; T \<subseteq> U\<rbrakk> | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 217 | \<Longrightarrow> connected_component_set T a = connected_component_set U a" | 
| 77223 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 218 | by (metis connected_component_idemp connected_component_mono subset_antisym) | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 219 | |
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 220 | lemma connected_component_homeomorphismI: | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 221 | assumes "homeomorphism A B f g" "connected_component A x y" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 222 | shows "connected_component B (f x) (f y)" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 223 | proof - | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 224 | from assms obtain T where T: "connected T" "T \<subseteq> A" "x \<in> T" "y \<in> T" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 225 | unfolding connected_component_def by blast | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 226 | have "connected (f ` T)" "f ` T \<subseteq> B" "f x \<in> f ` T" "f y \<in> f ` T" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 227 | using assms T continuous_on_subset[of A f T] | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 228 | by (auto intro!: connected_continuous_image simp: homeomorphism_def) | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 229 | thus ?thesis | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 230 | unfolding connected_component_def by blast | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 231 | qed | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 232 | |
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 233 | lemma connected_component_homeomorphism_iff: | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 234 | assumes "homeomorphism A B f g" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 235 | shows "connected_component A x y \<longleftrightarrow> x \<in> A \<and> y \<in> A \<and> connected_component B (f x) (f y)" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 236 | by (metis assms connected_component_homeomorphismI connected_component_in homeomorphism_apply1 homeomorphism_sym) | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 237 | |
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 238 | lemma connected_component_set_homeomorphism: | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 239 | assumes "homeomorphism A B f g" "x \<in> A" | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 240 | shows "connected_component_set B (f x) = f ` connected_component_set A x" (is "?lhs = ?rhs") | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 241 | proof - | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 242 | have "y \<in> ?lhs \<longleftrightarrow> y \<in> ?rhs" for y | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 243 | by (smt (verit, best) assms connected_component_homeomorphism_iff homeomorphism_def image_iff mem_Collect_eq) | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 244 | thus ?thesis | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 245 | by blast | 
| 
607e1e345e8f
Lots of new material chiefly about complex analysis
 paulson <lp15@cam.ac.uk> parents: 
73932diff
changeset | 246 | qed | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 247 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 248 | subsection \<open>The set of connected components of a set\<close> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 249 | |
| 70136 | 250 | definition\<^marker>\<open>tag important\<close> components:: "'a::topological_space set \<Rightarrow> 'a set set" | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 251 | where "components S \<equiv> connected_component_set S ` S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 252 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 253 | lemma components_iff: "S \<in> components U \<longleftrightarrow> (\<exists>x. x \<in> U \<and> S = connected_component_set U x)" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 254 | by (auto simp: components_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 255 | |
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 256 | lemma componentsI: "x \<in> U \<Longrightarrow> connected_component_set U x \<in> components U" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 257 | by (auto simp: components_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 258 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 259 | lemma componentsE: | 
| 72228 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 260 | assumes "S \<in> components U" | 
| 
aa7cb84983e9
minor tidying, also s->S and t->T
 paulson <lp15@cam.ac.uk> parents: 
71172diff
changeset | 261 | obtains x where "x \<in> U" "S = connected_component_set U x" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 262 | using assms by (auto simp: components_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 263 | |
| 78475 | 264 | lemma Union_components [simp]: "\<Union>(components U) = U" | 
| 265 | by (simp add: Union_connected_component components_def) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 266 | |
| 78475 | 267 | lemma pairwise_disjoint_components: "pairwise (\<lambda>X Y. X \<inter> Y = {}) (components U)"
 | 
| 268 | unfolding pairwise_def | |
| 269 | by (metis (full_types) components_iff connected_component_nonoverlap) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 270 | |
| 78475 | 271 | lemma in_components_nonempty: "C \<in> components S \<Longrightarrow> C \<noteq> {}"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 272 | by (metis components_iff connected_component_eq_empty) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 273 | |
| 78475 | 274 | lemma in_components_subset: "C \<in> components S \<Longrightarrow> C \<subseteq> S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 275 | using Union_components by blast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 276 | |
| 78475 | 277 | lemma in_components_connected: "C \<in> components S \<Longrightarrow> connected C" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 278 | by (metis components_iff connected_connected_component) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 279 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 280 | lemma in_components_maximal: | 
| 78475 | 281 | "C \<in> components S \<longleftrightarrow> | 
| 282 |     C \<noteq> {} \<and> C \<subseteq> S \<and> connected C \<and> (\<forall>d. d \<noteq> {} \<and> C \<subseteq> d \<and> d \<subseteq> S \<and> connected d \<longrightarrow> d = C)"
 | |
| 283 | (is "?lhs \<longleftrightarrow> ?rhs") | |
| 284 | proof | |
| 285 | assume L: ?lhs | |
| 286 | then have "C \<subseteq> S" "connected C" | |
| 287 | by (simp_all add: in_components_subset in_components_connected) | |
| 288 | then show ?rhs | |
| 289 | by (metis (full_types) L components_iff connected_component_maximal connected_component_refl empty_iff mem_Collect_eq subsetD subset_antisym) | |
| 290 | next | |
| 291 | show "?rhs \<Longrightarrow> ?lhs" | |
| 292 | by (metis bot.extremum_uniqueI components_iff connected_component_eq_empty connected_component_maximal connected_component_subset connected_connected_component subset_emptyI) | |
| 293 | qed | |
| 294 | ||
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 295 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 296 | lemma joinable_components_eq: | 
| 78475 | 297 |   "connected T \<and> T \<subseteq> S \<and> c1 \<in> components S \<and> c2 \<in> components S \<and> c1 \<inter> T \<noteq> {} \<and> c2 \<inter> T \<noteq> {} \<Longrightarrow> c1 = c2"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 298 | by (metis (full_types) components_iff joinable_connected_component_eq) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 299 | |
| 78475 | 300 | lemma closed_components: "\<lbrakk>closed S; C \<in> components S\<rbrakk> \<Longrightarrow> closed C" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 301 | by (metis closed_connected_component components_iff) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 302 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 303 | lemma components_nonoverlap: | 
| 78475 | 304 |     "\<lbrakk>C \<in> components S; C' \<in> components S\<rbrakk> \<Longrightarrow> (C \<inter> C' = {}) \<longleftrightarrow> (C \<noteq> C')"
 | 
| 305 | by (metis (full_types) components_iff connected_component_nonoverlap) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 306 | |
| 78475 | 307 | lemma components_eq: "\<lbrakk>C \<in> components S; C' \<in> components S\<rbrakk> \<Longrightarrow> (C = C' \<longleftrightarrow> C \<inter> C' \<noteq> {})"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 308 | by (metis components_nonoverlap) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 309 | |
| 78475 | 310 | lemma components_eq_empty [simp]: "components S = {} \<longleftrightarrow> S = {}"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 311 | by (simp add: components_def) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 312 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 313 | lemma components_empty [simp]: "components {} = {}"
 | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 314 | by simp | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 315 | |
| 78475 | 316 | lemma connected_eq_connected_components_eq: "connected S \<longleftrightarrow> (\<forall>C \<in> components S. \<forall>C' \<in> components S. C = C')" | 
| 73932 
fd21b4a93043
added opaque_combs and renamed hide_lams to opaque_lifting
 desharna parents: 
72228diff
changeset | 317 | by (metis (no_types, opaque_lifting) components_iff connected_component_eq_eq connected_iff_connected_component) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 318 | |
| 78475 | 319 | lemma components_eq_sing_iff: "components S = {S} \<longleftrightarrow> connected S \<and> S \<noteq> {}" (is "?lhs \<longleftrightarrow> ?rhs")
 | 
| 320 | proof | |
| 321 | show "?rhs \<Longrightarrow> ?lhs" | |
| 322 | by (metis components_iff connected_component_eq_self equals0I insert_iff mk_disjoint_insert) | |
| 323 | qed (use in_components_connected in fastforce) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 324 | |
| 78475 | 325 | lemma components_eq_sing_exists: "(\<exists>a. components S = {a}) \<longleftrightarrow> connected S \<and> S \<noteq> {}"
 | 
| 326 | by (metis Union_components ccpo_Sup_singleton components_eq_sing_iff) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 327 | |
| 78475 | 328 | lemma connected_eq_components_subset_sing: "connected S \<longleftrightarrow> components S \<subseteq> {S}"
 | 
| 329 | by (metis components_eq_empty components_eq_sing_iff connected_empty subset_singleton_iff) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 330 | |
| 78475 | 331 | lemma connected_eq_components_subset_sing_exists: "connected S \<longleftrightarrow> (\<exists>a. components S \<subseteq> {a})"
 | 
| 332 | by (metis components_eq_sing_exists connected_eq_components_subset_sing subset_singleton_iff) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 333 | |
| 78475 | 334 | lemma in_components_self: "S \<in> components S \<longleftrightarrow> connected S \<and> S \<noteq> {}"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 335 | by (metis components_empty components_eq_sing_iff empty_iff in_components_connected insertI1) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 336 | |
| 78475 | 337 | lemma components_maximal: "\<lbrakk>C \<in> components S; connected T; T \<subseteq> S; C \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow> T \<subseteq> C"
 | 
| 338 | by (smt (verit, best) Int_Un_eq(4) Un_upper1 bot_eq_sup_iff connected_Un in_components_maximal inf.orderE sup.mono sup.orderI) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 339 | |
| 78475 | 340 | lemma exists_component_superset: "\<lbrakk>T \<subseteq> S; S \<noteq> {}; connected T\<rbrakk> \<Longrightarrow> \<exists>C. C \<in> components S \<and> T \<subseteq> C"
 | 
| 341 | by (meson componentsI connected_component_maximal equals0I subset_eq) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 342 | |
| 78475 | 343 | lemma components_intermediate_subset: "\<lbrakk>S \<in> components U; S \<subseteq> T; T \<subseteq> U\<rbrakk> \<Longrightarrow> S \<in> components T" | 
| 344 | by (smt (verit, best) dual_order.trans in_components_maximal) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 345 | |
| 78475 | 346 | lemma in_components_unions_complement: "C \<in> components S \<Longrightarrow> S - C = \<Union>(components S - {C})"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 347 | by (metis complement_connected_component_unions components_def components_iff) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 348 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 349 | lemma connected_intermediate_closure: | 
| 78475 | 350 | assumes cs: "connected S" and st: "S \<subseteq> T" and ts: "T \<subseteq> closure S" | 
| 351 | shows "connected T" | |
| 352 | using assms unfolding connected_def | |
| 353 | by (smt (verit) Int_assoc inf.absorb_iff2 inf_bot_left open_Int_closure_eq_empty) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 354 | |
| 78475 | 355 | lemma closedin_connected_component: "closedin (top_of_set S) (connected_component_set S x)" | 
| 356 | proof (cases "connected_component_set S x = {}")
 | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 357 | case True | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 358 | then show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 359 | by (metis closedin_empty) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 360 | next | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 361 | case False | 
| 78475 | 362 | then obtain y where y: "connected_component S x y" and "x \<in> S" | 
| 363 | using connected_component_eq_empty by blast | |
| 364 | have *: "connected_component_set S x \<subseteq> S \<inter> closure (connected_component_set S x)" | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 365 | by (auto simp: closure_def connected_component_in) | 
| 78475 | 366 | have **: "x \<in> closure (connected_component_set S x)" | 
| 367 | by (simp add: \<open>x \<in> S\<close> closure_def) | |
| 368 | have "S \<inter> closure (connected_component_set S x) \<subseteq> connected_component_set S x" if "connected_component S x y" | |
| 369 | proof (rule connected_component_maximal) | |
| 370 | show "connected (S \<inter> closure (connected_component_set S x))" | |
| 371 | using "*" connected_intermediate_closure by blast | |
| 372 | qed (use \<open>x \<in> S\<close> ** in auto) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 373 | with y * show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 374 | by (auto simp: closedin_closed) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 375 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 376 | |
| 66939 
04678058308f
New results in topology, mostly from HOL Light's moretop.ml
 paulson <lp15@cam.ac.uk> parents: 
66884diff
changeset | 377 | lemma closedin_component: | 
| 78475 | 378 | "C \<in> components S \<Longrightarrow> closedin (top_of_set S) C" | 
| 66939 
04678058308f
New results in topology, mostly from HOL Light's moretop.ml
 paulson <lp15@cam.ac.uk> parents: 
66884diff
changeset | 379 | using closedin_connected_component componentsE by blast | 
| 
04678058308f
New results in topology, mostly from HOL Light's moretop.ml
 paulson <lp15@cam.ac.uk> parents: 
66884diff
changeset | 380 | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 381 | |
| 70136 | 382 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Proving a function is constant on a connected set | 
| 69615 
e502cd4d7062
moved material from Connected.thy to more appropriate places
 immler parents: 
69614diff
changeset | 383 | by proving that a level set is open\<close> | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 384 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 385 | lemma continuous_levelset_openin_cases: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 386 | fixes f :: "_ \<Rightarrow> 'b::t1_space" | 
| 78475 | 387 | shows "connected S \<Longrightarrow> continuous_on S f \<Longrightarrow> | 
| 388 |         openin (top_of_set S) {x \<in> S. f x = a}
 | |
| 389 | \<Longrightarrow> (\<forall>x \<in> S. f x \<noteq> a) \<or> (\<forall>x \<in> S. f x = a)" | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 390 | unfolding connected_clopen | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 391 | using continuous_closedin_preimage_constant by auto | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 392 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 393 | lemma continuous_levelset_openin: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 394 | fixes f :: "_ \<Rightarrow> 'b::t1_space" | 
| 78475 | 395 | shows "connected S \<Longrightarrow> continuous_on S f \<Longrightarrow> | 
| 396 |         openin (top_of_set S) {x \<in> S. f x = a} \<Longrightarrow>
 | |
| 397 | (\<exists>x \<in> S. f x = a) \<Longrightarrow> (\<forall>x \<in> S. f x = a)" | |
| 398 | using continuous_levelset_openin_cases[of S f ] | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 399 | by meson | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 400 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 401 | lemma continuous_levelset_open: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 402 | fixes f :: "_ \<Rightarrow> 'b::t1_space" | 
| 78475 | 403 | assumes S: "connected S" "continuous_on S f" | 
| 404 |     and a: "open {x \<in> S. f x = a}" "\<exists>x \<in> S.  f x = a"
 | |
| 405 | shows "\<forall>x \<in> S. f x = a" | |
| 406 | using a continuous_levelset_openin[OF S, of a, unfolded openin_open] | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 407 | by fast | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 408 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 409 | |
| 70136 | 410 | subsection\<^marker>\<open>tag unimportant\<close> \<open>Preservation of Connectedness\<close> | 
| 67727 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 immler parents: 
67707diff
changeset | 411 | |
| 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 immler parents: 
67707diff
changeset | 412 | lemma homeomorphic_connectedness: | 
| 78475 | 413 | assumes "S homeomorphic T" | 
| 414 | shows "connected S \<longleftrightarrow> connected T" | |
| 67727 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 immler parents: 
67707diff
changeset | 415 | using assms unfolding homeomorphic_def homeomorphism_def by (metis connected_continuous_image) | 
| 
ce3e87a51488
moved Lipschitz continuity from AFP/Ordinary_Differential_Equations and AFP/Gromov_Hyperbolicity; moved lemmas from AFP/Gromov_Hyperbolicity/Library_Complements
 immler parents: 
67707diff
changeset | 416 | |
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 417 | lemma connected_monotone_quotient_preimage: | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 418 | assumes "connected T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 419 | and contf: "continuous_on S f" and fim: "f ` S = T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 420 | and opT: "\<And>U. U \<subseteq> T | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 421 | \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` U) \<longleftrightarrow> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 422 | openin (top_of_set T) U" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 423 |       and connT: "\<And>y. y \<in> T \<Longrightarrow> connected (S \<inter> f -` {y})"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 424 | shows "connected S" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 425 | proof (rule connectedI) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 426 | fix U V | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 427 |   assume "open U" and "open V" and "U \<inter> S \<noteq> {}" and "V \<inter> S \<noteq> {}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 428 |     and "U \<inter> V \<inter> S = {}" and "S \<subseteq> U \<union> V"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 429 | moreover | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 430 |   have disjoint: "f ` (S \<inter> U) \<inter> f ` (S \<inter> V) = {}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 431 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 432 | have False if "y \<in> f ` (S \<inter> U) \<inter> f ` (S \<inter> V)" for y | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 433 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 434 | have "y \<in> T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 435 | using fim that by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 436 | show ?thesis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 437 | using connectedD [OF connT [OF \<open>y \<in> T\<close>] \<open>open U\<close> \<open>open V\<close>] | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 438 |               \<open>S \<subseteq> U \<union> V\<close> \<open>U \<inter> V \<inter> S = {}\<close> that by fastforce
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 439 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 440 | then show ?thesis by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 441 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 442 | ultimately have UU: "(S \<inter> f -` f ` (S \<inter> U)) = S \<inter> U" and VV: "(S \<inter> f -` f ` (S \<inter> V)) = S \<inter> V" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 443 | by auto | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 444 | have opeU: "openin (top_of_set T) (f ` (S \<inter> U))" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 445 | by (metis UU \<open>open U\<close> fim image_Int_subset le_inf_iff opT openin_open_Int) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 446 | have opeV: "openin (top_of_set T) (f ` (S \<inter> V))" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 447 | by (metis opT fim VV \<open>open V\<close> openin_open_Int image_Int_subset inf.bounded_iff) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 448 | have "T \<subseteq> f ` (S \<inter> U) \<union> f ` (S \<inter> V)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 449 | using \<open>S \<subseteq> U \<union> V\<close> fim by auto | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 450 | then show False | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 451 |     using \<open>connected T\<close> disjoint opeU opeV \<open>U \<inter> S \<noteq> {}\<close> \<open>V \<inter> S \<noteq> {}\<close>
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 452 | by (auto simp: connected_openin) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 453 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 454 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 455 | lemma connected_open_monotone_preimage: | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 456 | assumes contf: "continuous_on S f" and fim: "f ` S = T" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 457 | and ST: "\<And>C. openin (top_of_set S) C \<Longrightarrow> openin (top_of_set T) (f ` C)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 458 |     and connT: "\<And>y. y \<in> T \<Longrightarrow> connected (S \<inter> f -` {y})"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 459 | and "connected C" "C \<subseteq> T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 460 | shows "connected (S \<inter> f -` C)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 461 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 462 | have contf': "continuous_on (S \<inter> f -` C) f" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 463 | by (meson contf continuous_on_subset inf_le1) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 464 | have eqC: "f ` (S \<inter> f -` C) = C" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 465 | using \<open>C \<subseteq> T\<close> fim by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 466 | show ?thesis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 467 | proof (rule connected_monotone_quotient_preimage [OF \<open>connected C\<close> contf' eqC]) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 468 |     show "connected (S \<inter> f -` C \<inter> f -` {y})" if "y \<in> C" for y
 | 
| 78475 | 469 | by (metis Int_assoc Int_empty_right Int_insert_right_if1 assms(6) connT in_mono that vimage_Int) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 470 | have "\<And>U. openin (top_of_set (S \<inter> f -` C)) U | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 471 | \<Longrightarrow> openin (top_of_set C) (f ` U)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 472 | using open_map_restrict [OF _ ST \<open>C \<subseteq> T\<close>] by metis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 473 | then show "\<And>D. D \<subseteq> C | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 474 | \<Longrightarrow> openin (top_of_set (S \<inter> f -` C)) (S \<inter> f -` C \<inter> f -` D) = | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 475 | openin (top_of_set C) D" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 476 | using open_map_imp_quotient_map [of "(S \<inter> f -` C)" f] contf' by (simp add: eqC) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 477 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 478 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 479 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 480 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 481 | lemma connected_closed_monotone_preimage: | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 482 | assumes contf: "continuous_on S f" and fim: "f ` S = T" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 483 | and ST: "\<And>C. closedin (top_of_set S) C \<Longrightarrow> closedin (top_of_set T) (f ` C)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 484 |     and connT: "\<And>y. y \<in> T \<Longrightarrow> connected (S \<inter> f -` {y})"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 485 | and "connected C" "C \<subseteq> T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 486 | shows "connected (S \<inter> f -` C)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 487 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 488 | have contf': "continuous_on (S \<inter> f -` C) f" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 489 | by (meson contf continuous_on_subset inf_le1) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 490 | have eqC: "f ` (S \<inter> f -` C) = C" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 491 | using \<open>C \<subseteq> T\<close> fim by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 492 | show ?thesis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 493 | proof (rule connected_monotone_quotient_preimage [OF \<open>connected C\<close> contf' eqC]) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 494 |     show "connected (S \<inter> f -` C \<inter> f -` {y})" if "y \<in> C" for y
 | 
| 78475 | 495 | by (metis Int_assoc Int_empty_right Int_insert_right_if1 \<open>C \<subseteq> T\<close> connT subsetD that vimage_Int) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 496 | have "\<And>U. closedin (top_of_set (S \<inter> f -` C)) U | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 497 | \<Longrightarrow> closedin (top_of_set C) (f ` U)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 498 | using closed_map_restrict [OF _ ST \<open>C \<subseteq> T\<close>] by metis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 499 | then show "\<And>D. D \<subseteq> C | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 500 | \<Longrightarrow> openin (top_of_set (S \<inter> f -` C)) (S \<inter> f -` C \<inter> f -` D) = | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 501 | openin (top_of_set C) D" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 502 | using closed_map_imp_quotient_map [of "(S \<inter> f -` C)" f] contf' by (simp add: eqC) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 503 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 504 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 505 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 506 | |
| 71137 | 507 | subsection\<open>Lemmas about components\<close> | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 508 | |
| 71137 | 509 | text \<open>See Newman IV, 3.3 and 3.4.\<close> | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 510 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 511 | lemma connected_Un_clopen_in_complement: | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 512 | fixes S U :: "'a::metric_space set" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 513 | assumes "connected S" "connected U" "S \<subseteq> U" | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 514 | and opeT: "openin (top_of_set (U - S)) T" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 515 | and cloT: "closedin (top_of_set (U - S)) T" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 516 | shows "connected (S \<union> T)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 517 | proof - | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 518 | have *: "\<lbrakk>\<And>x y. P x y \<longleftrightarrow> P y x; \<And>x y. P x y \<Longrightarrow> S \<subseteq> x \<or> S \<subseteq> y; | 
| 69508 | 519 | \<And>x y. \<lbrakk>P x y; S \<subseteq> x\<rbrakk> \<Longrightarrow> False\<rbrakk> \<Longrightarrow> \<not>(\<exists>x y. (P x y))" for P | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 520 | by metis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 521 | show ?thesis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 522 | unfolding connected_closedin_eq | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 523 | proof (rule *) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 524 | fix H1 H2 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 525 | assume H: "closedin (top_of_set (S \<union> T)) H1 \<and> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 526 | closedin (top_of_set (S \<union> T)) H2 \<and> | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 527 |                H1 \<union> H2 = S \<union> T \<and> H1 \<inter> H2 = {} \<and> H1 \<noteq> {} \<and> H2 \<noteq> {}"
 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 528 | then have clo: "closedin (top_of_set S) (S \<inter> H1)" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 529 | "closedin (top_of_set S) (S \<inter> H2)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 530 | by (metis Un_upper1 closedin_closed_subset inf_commute)+ | 
| 78475 | 531 | moreover have "S \<inter> ((S \<union> T) \<inter> H1) \<union> S \<inter> ((S \<union> T) \<inter> H2) = S" | 
| 532 | using H by blast | |
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 533 |     moreover have "H1 \<inter> (S \<inter> ((S \<union> T) \<inter> H2)) = {}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 534 | using H by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 535 |     ultimately have "S \<inter> H1 = {} \<or> S \<inter> H2 = {}"
 | 
| 78475 | 536 | by (smt (verit) Int_assoc \<open>connected S\<close> connected_closedin_eq inf_commute inf_sup_absorb) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 537 | then show "S \<subseteq> H1 \<or> S \<subseteq> H2" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 538 | using H \<open>connected S\<close> unfolding connected_closedin by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 539 | next | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 540 | fix H1 H2 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 541 | assume H: "closedin (top_of_set (S \<union> T)) H1 \<and> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 542 | closedin (top_of_set (S \<union> T)) H2 \<and> | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 543 |                H1 \<union> H2 = S \<union> T \<and> H1 \<inter> H2 = {} \<and> H1 \<noteq> {} \<and> H2 \<noteq> {}" 
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 544 | and "S \<subseteq> H1" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 545 | then have H2T: "H2 \<subseteq> T" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 546 | by auto | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 547 | have "T \<subseteq> U" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 548 | using Diff_iff opeT openin_imp_subset by auto | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 549 | with \<open>S \<subseteq> U\<close> have Ueq: "U = (U - S) \<union> (S \<union> T)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 550 | by auto | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 551 | have "openin (top_of_set ((U - S) \<union> (S \<union> T))) H2" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 552 | proof (rule openin_subtopology_Un) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 553 | show "openin (top_of_set (S \<union> T)) H2" | 
| 78475 | 554 | by (metis Diff_cancel H Un_Diff Un_Diff_Int closedin_subset openin_closedin_eq topspace_euclidean_subtopology) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 555 | then show "openin (top_of_set (U - S)) H2" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 556 | by (meson H2T Un_upper2 opeT openin_subset_trans openin_trans) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 557 | qed | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 558 | moreover have "closedin (top_of_set ((U - S) \<union> (S \<union> T))) H2" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 559 | proof (rule closedin_subtopology_Un) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 560 | show "closedin (top_of_set (U - S)) H2" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 561 | using H H2T cloT closedin_subset_trans | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 562 | by (blast intro: closedin_subtopology_Un closedin_trans) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 563 | qed (simp add: H) | 
| 78475 | 564 |     ultimately have H2: "H2 = {} \<or> H2 = U"
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 565 | using Ueq \<open>connected U\<close> unfolding connected_clopen by metis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 566 | then have "H2 \<subseteq> S" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 567 | by (metis Diff_partition H Un_Diff_cancel Un_subset_iff \<open>H2 \<subseteq> T\<close> assms(3) inf.orderE opeT openin_imp_subset) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 568 | moreover have "T \<subseteq> H2 - S" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 569 | by (metis (no_types) H2 H opeT openin_closedin_eq topspace_euclidean_subtopology) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 570 | ultimately show False | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 571 | using H \<open>S \<subseteq> H1\<close> by blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 572 | qed blast | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 573 | qed | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 574 | |
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 575 | |
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 576 | proposition component_diff_connected: | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 577 | fixes S :: "'a::metric_space set" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 578 | assumes "connected S" "connected U" "S \<subseteq> U" and C: "C \<in> components (U - S)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 579 | shows "connected(U - C)" | 
| 68607 
67bb59e49834
make theorem, corollary, and proposition %important for HOL-Analysis manual
 immler parents: 
68527diff
changeset | 580 | using \<open>connected S\<close> unfolding connected_closedin_eq not_ex de_Morgan_conj | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 581 | proof clarify | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 582 | fix H3 H4 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 583 | assume clo3: "closedin (top_of_set (U - C)) H3" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 584 | and clo4: "closedin (top_of_set (U - C)) H4" | 
| 78475 | 585 |     and H34: "H3 \<union> H4 = U - C" "H3 \<inter> H4 = {}" and "H3 \<noteq> {}" and "H4 \<noteq> {}"
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 586 | and * [rule_format]: | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 587 | "\<forall>H1 H2. \<not> closedin (top_of_set S) H1 \<or> | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 588 | \<not> closedin (top_of_set S) H2 \<or> | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 589 |                       H1 \<union> H2 \<noteq> S \<or> H1 \<inter> H2 \<noteq> {} \<or> \<not> H1 \<noteq> {} \<or> \<not> H2 \<noteq> {}"
 | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 590 | then have "H3 \<subseteq> U-C" and ope3: "openin (top_of_set (U - C)) (U - C - H3)" | 
| 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 591 | and "H4 \<subseteq> U-C" and ope4: "openin (top_of_set (U - C)) (U - C - H4)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 592 | by (auto simp: closedin_def) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 593 |   have "C \<noteq> {}" "C \<subseteq> U-S" "connected C"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 594 | using C in_components_nonempty in_components_subset in_components_maximal by blast+ | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 595 | have cCH3: "connected (C \<union> H3)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 596 | proof (rule connected_Un_clopen_in_complement [OF \<open>connected C\<close> \<open>connected U\<close> _ _ clo3]) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 597 | show "openin (top_of_set (U - C)) H3" | 
| 78475 | 598 |       by (metis Diff_cancel Un_Diff Un_Diff_Int \<open>H3 \<inter> H4 = {}\<close> \<open>H3 \<union> H4 = U - C\<close> ope4)
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 599 | qed (use clo3 \<open>C \<subseteq> U - S\<close> in auto) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 600 | have cCH4: "connected (C \<union> H4)" | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 601 | proof (rule connected_Un_clopen_in_complement [OF \<open>connected C\<close> \<open>connected U\<close> _ _ clo4]) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 602 | show "openin (top_of_set (U - C)) H4" | 
| 78475 | 603 | by (metis Diff_cancel Diff_triv Int_Un_eq(2) Un_Diff H34 inf_commute ope3) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 604 | qed (use clo4 \<open>C \<subseteq> U - S\<close> in auto) | 
| 69922 
4a9167f377b0
new material about topology, etc.; also fixes for yesterday's
 paulson <lp15@cam.ac.uk> parents: 
69617diff
changeset | 605 | have "closedin (top_of_set S) (S \<inter> H3)" "closedin (top_of_set S) (S \<inter> H4)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 606 | using clo3 clo4 \<open>S \<subseteq> U\<close> \<open>C \<subseteq> U - S\<close> by (auto simp: closedin_closed) | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 607 |   moreover have "S \<inter> H3 \<noteq> {}"      
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 608 |     using components_maximal [OF C cCH3] \<open>C \<noteq> {}\<close> \<open>C \<subseteq> U - S\<close> \<open>H3 \<noteq> {}\<close> \<open>H3 \<subseteq> U - C\<close> by auto
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 609 |   moreover have "S \<inter> H4 \<noteq> {}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 610 |     using components_maximal [OF C cCH4] \<open>C \<noteq> {}\<close> \<open>C \<subseteq> U - S\<close> \<open>H4 \<noteq> {}\<close> \<open>H4 \<subseteq> U - C\<close> by auto
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 611 | ultimately show False | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 612 |     using * [of "S \<inter> H3" "S \<inter> H4"] \<open>H3 \<inter> H4 = {}\<close> \<open>C \<subseteq> U - S\<close> \<open>H3 \<union> H4 = U - C\<close> \<open>S \<subseteq> U\<close> 
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 613 | by auto | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 614 | qed | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 615 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 616 | |
| 70136 | 617 | subsection\<^marker>\<open>tag unimportant\<close>\<open>Constancy of a function from a connected set into a finite, disconnected or discrete set\<close> | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 618 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 619 | text\<open>Still missing: versions for a set that is smaller than R, or countable.\<close> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 620 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 621 | lemma continuous_disconnected_range_constant: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 622 | assumes S: "connected S" | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 623 | and conf: "continuous_on S f" | 
| 78475 | 624 | and fim: "f \<in> S \<rightarrow> T" | 
| 625 |       and cct: "\<And>y. y \<in> T \<Longrightarrow> connected_component_set T y = {y}"
 | |
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 626 | shows "f constant_on S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 627 | proof (cases "S = {}")
 | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 628 | case True then show ?thesis | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 629 | by (simp add: constant_on_def) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 630 | next | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 631 | case False | 
| 78475 | 632 |   then have "f ` S \<subseteq> {f x}" if "x \<in> S" for x
 | 
| 633 | by (metis PiE S cct connected_component_maximal connected_continuous_image [OF conf] fim image_eqI | |
| 634 | image_subset_iff that) | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 635 | with False show ?thesis | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 636 | unfolding constant_on_def by blast | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 637 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 639 | |
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 640 | text\<open>This proof requires the existence of two separate values of the range type.\<close> | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 641 | lemma finite_range_constant_imp_connected: | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 642 | assumes "\<And>f::'a::topological_space \<Rightarrow> 'b::real_normed_algebra_1. | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 643 | \<lbrakk>continuous_on S f; finite(f ` S)\<rbrakk> \<Longrightarrow> f constant_on S" | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 644 | shows "connected S" | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 645 | proof - | 
| 78475 | 646 |   { fix T U
 | 
| 647 | assume clt: "closedin (top_of_set S) T" | |
| 648 | and clu: "closedin (top_of_set S) U" | |
| 649 |        and tue: "T \<inter> U = {}" and tus: "T \<union> U = S"
 | |
| 650 | have "continuous_on (T \<union> U) (\<lambda>x. if x \<in> T then 0 else 1)" | |
| 651 | using clt clu tue by (intro continuous_on_cases_local) (auto simp: tus) | |
| 652 | then have conif: "continuous_on S (\<lambda>x. if x \<in> T then 0 else 1)" | |
| 653 | using tus by blast | |
| 654 | have fi: "finite ((\<lambda>x. if x \<in> T then 0 else 1) ` S)" | |
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 655 |       by (rule finite_subset [of _ "{0,1}"]) auto
 | 
| 78475 | 656 |     have "T = {} \<or> U = {}"
 | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 657 | using assms [OF conif fi] tus [symmetric] | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66835diff
changeset | 658 | by (auto simp: Ball_def constant_on_def) (metis IntI empty_iff one_neq_zero tue) | 
| 66827 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 659 | } | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 660 | then show ?thesis | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 661 | by (simp add: connected_closedin_eq) | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 662 | qed | 
| 
c94531b5007d
Divided Topology_Euclidean_Space in two, creating new theory Connected. Also deleted some duplicate / variant theorems
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 663 | |
| 69617 | 664 | end |