src/HOL/Analysis/Homotopy.thy
author wenzelm
Thu, 10 Sep 2020 16:04:12 +0200
changeset 72248 71378e7d148e
parent 71770 33e886e21ed4
child 72372 1a333166b6b8
permissions -rw-r--r--
clarified modules;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     1
(*  Title:      HOL/Analysis/Path_Connected.thy
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     2
    Authors:    LC Paulson and Robert Himmelmann (TU Muenchen), based on material from HOL Light
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     3
*)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     4
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     5
section \<open>Homotopy of Maps\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     6
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     7
theory Homotopy
71770
33e886e21ed4 Sketch_and_Explore — oops
paulson <lp15@cam.ac.uk>
parents: 71769
diff changeset
     8
  imports Path_Connected Continuum_Not_Denumerable Product_Topology
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     9
begin
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    10
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
    11
definition\<^marker>\<open>tag important\<close> homotopic_with
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    12
where
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    13
 "homotopic_with P X Y f g \<equiv>
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    14
   (\<exists>h. continuous_map (prod_topology (top_of_set {0..1::real}) X) Y h \<and>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    15
       (\<forall>x. h(0, x) = f x) \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    16
       (\<forall>x. h(1, x) = g x) \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    17
       (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t,x))))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    18
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    19
text\<open>\<open>p\<close>, \<open>q\<close> are functions \<open>X \<rightarrow> Y\<close>, and the property \<open>P\<close> restricts all intermediate maps.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    20
We often just want to require that \<open>P\<close> fixes some subset, but to include the case of a loop homotopy,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    21
it is convenient to have a general property \<open>P\<close>.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    22
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    23
abbreviation homotopic_with_canon ::
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    24
  "[('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool, 'a set, 'b set, 'a \<Rightarrow> 'b, 'a \<Rightarrow> 'b] \<Rightarrow> bool"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    25
where
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    26
 "homotopic_with_canon P S T p q \<equiv> homotopic_with P (top_of_set S) (top_of_set T) p q"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    27
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    28
lemma split_01: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    29
  by force
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    30
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    31
lemma split_01_prod: "{0..1::real} \<times> X = ({0..1/2} \<times> X) \<union> ({1/2..1} \<times> X)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    32
  by force
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    33
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    34
lemma image_Pair_const: "(\<lambda>x. (x, c)) ` A = A \<times> {c}"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    35
  by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    36
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    37
lemma fst_o_paired [simp]: "fst \<circ> (\<lambda>(x,y). (f x y, g x y)) = (\<lambda>(x,y). f x y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    38
  by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    39
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    40
lemma snd_o_paired [simp]: "snd \<circ> (\<lambda>(x,y). (f x y, g x y)) = (\<lambda>(x,y). g x y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    41
  by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    42
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    43
lemma continuous_on_o_Pair: "\<lbrakk>continuous_on (T \<times> X) h; t \<in> T\<rbrakk> \<Longrightarrow> continuous_on X (h \<circ> Pair t)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    44
  by (fast intro: continuous_intros elim!: continuous_on_subset)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    45
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    46
lemma continuous_map_o_Pair: 
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    47
  assumes h: "continuous_map (prod_topology X Y) Z h" and t: "t \<in> topspace X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    48
  shows "continuous_map Y Z (h \<circ> Pair t)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    49
  by (intro continuous_map_compose [OF _ h] continuous_intros; simp add: t)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    50
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
    51
subsection\<^marker>\<open>tag unimportant\<close>\<open>Trivial properties\<close>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    52
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    53
text \<open>We often want to just localize the ending function equality or whatever.\<close>
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
    54
text\<^marker>\<open>tag important\<close> \<open>%whitespace\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    55
proposition homotopic_with:
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    56
  assumes "\<And>h k. (\<And>x. x \<in> topspace X \<Longrightarrow> h x = k x) \<Longrightarrow> (P h \<longleftrightarrow> P k)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    57
  shows "homotopic_with P X Y p q \<longleftrightarrow>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    58
           (\<exists>h. continuous_map (prod_topology (subtopology euclideanreal {0..1}) X) Y h \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    59
              (\<forall>x \<in> topspace X. h(0,x) = p x) \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    60
              (\<forall>x \<in> topspace X. h(1,x) = q x) \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    61
              (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t, x))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    62
  unfolding homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    63
  apply (rule iffI, blast, clarify)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    64
  apply (rule_tac x="\<lambda>(u,v). if v \<in> topspace X then h(u,v) else if u = 0 then p v else q v" in exI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    65
  apply auto
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    66
  using continuous_map_eq apply fastforce
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    67
  apply (drule_tac x=t in bspec, force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    68
  apply (subst assms; simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    69
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    70
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    71
lemma homotopic_with_mono:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    72
  assumes hom: "homotopic_with P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    73
    and Q: "\<And>h. \<lbrakk>continuous_map X Y h; P h\<rbrakk> \<Longrightarrow> Q h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    74
  shows "homotopic_with Q X Y f g"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    75
  using hom unfolding homotopic_with_def
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    76
  by (force simp: o_def dest: continuous_map_o_Pair intro: Q)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    77
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    78
lemma homotopic_with_imp_continuous_maps:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    79
    assumes "homotopic_with P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    80
    shows "continuous_map X Y f \<and> continuous_map X Y g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    81
proof -
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    82
  obtain h :: "real \<times> 'a \<Rightarrow> 'b"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
    83
    where conth: "continuous_map (prod_topology (top_of_set {0..1}) X) Y h"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    84
      and h: "\<forall>x. h (0, x) = f x" "\<forall>x. h (1, x) = g x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    85
    using assms by (auto simp: homotopic_with_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    86
  have *: "t \<in> {0..1} \<Longrightarrow> continuous_map X Y (h \<circ> (\<lambda>x. (t,x)))" for t
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    87
    by (rule continuous_map_compose [OF _ conth]) (simp add: o_def continuous_map_pairwise)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    88
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    89
    using h *[of 0] *[of 1] by (simp add: continuous_map_eq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    90
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    91
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    92
lemma homotopic_with_imp_continuous:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    93
    assumes "homotopic_with_canon P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    94
    shows "continuous_on X f \<and> continuous_on X g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    95
  by (meson assms continuous_map_subtopology_eu homotopic_with_imp_continuous_maps)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    96
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    97
lemma homotopic_with_imp_property:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    98
  assumes "homotopic_with P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
    99
  shows "P f \<and> P g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   100
proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   101
  obtain h where h: "\<And>x. h(0, x) = f x" "\<And>x. h(1, x) = g x" and P: "\<And>t. t \<in> {0..1::real} \<Longrightarrow> P(\<lambda>x. h(t,x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   102
    using assms by (force simp: homotopic_with_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   103
  show "P f" "P g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   104
    using P [of 0] P [of 1] by (force simp: h)+
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   105
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   106
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   107
lemma homotopic_with_equal:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   108
  assumes "P f" "P g" and contf: "continuous_map X Y f" and fg: "\<And>x. x \<in> topspace X \<Longrightarrow> f x = g x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   109
  shows "homotopic_with P X Y f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   110
  unfolding homotopic_with_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   111
proof (intro exI conjI allI ballI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   112
  let ?h = "\<lambda>(t::real,x). if t = 1 then g x else f x"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   113
  show "continuous_map (prod_topology (top_of_set {0..1}) X) Y ?h"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   114
  proof (rule continuous_map_eq)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   115
    show "continuous_map (prod_topology (top_of_set {0..1}) X) Y (f \<circ> snd)"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   116
      by (simp add: contf continuous_map_of_snd)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   117
  qed (auto simp: fg)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   118
  show "P (\<lambda>x. ?h (t, x))" if "t \<in> {0..1}" for t
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   119
    by (cases "t = 1") (simp_all add: assms)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   120
qed auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   121
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   122
lemma homotopic_with_imp_subset1:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   123
     "homotopic_with_canon P X Y f g \<Longrightarrow> f ` X \<subseteq> Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   124
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   125
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   126
lemma homotopic_with_imp_subset2:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   127
     "homotopic_with_canon P X Y f g \<Longrightarrow> g ` X \<subseteq> Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   128
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   129
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   130
lemma homotopic_with_subset_left:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   131
     "\<lbrakk>homotopic_with_canon P X Y f g; Z \<subseteq> X\<rbrakk> \<Longrightarrow> homotopic_with_canon P Z Y f g"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   132
  unfolding homotopic_with_def by (auto elim!: continuous_on_subset ex_forward)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   133
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   134
lemma homotopic_with_subset_right:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   135
     "\<lbrakk>homotopic_with_canon P X Y f g; Y \<subseteq> Z\<rbrakk> \<Longrightarrow> homotopic_with_canon P X Z f g"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   136
  unfolding homotopic_with_def by (auto elim!: continuous_on_subset ex_forward)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   137
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   138
subsection\<open>Homotopy with P is an equivalence relation\<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   139
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   140
text \<open>(on continuous functions mapping X into Y that satisfy P, though this only affects reflexivity)\<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   141
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   142
lemma homotopic_with_refl [simp]: "homotopic_with P X Y f f \<longleftrightarrow> continuous_map X Y f \<and> P f"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   143
  by (auto simp: homotopic_with_imp_continuous_maps intro: homotopic_with_equal dest: homotopic_with_imp_property)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   144
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   145
lemma homotopic_with_symD:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   146
    assumes "homotopic_with P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   147
      shows "homotopic_with P X Y g f"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   148
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   149
  let ?I01 = "subtopology euclideanreal {0..1}"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   150
  let ?j = "\<lambda>y. (1 - fst y, snd y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   151
  have 1: "continuous_map (prod_topology ?I01 X) (prod_topology euclideanreal X) ?j"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   152
    by (intro continuous_intros; simp add: continuous_map_subtopology_fst prod_topology_subtopology)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   153
  have *: "continuous_map (prod_topology ?I01 X) (prod_topology ?I01 X) ?j"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   154
  proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   155
    have "continuous_map (prod_topology ?I01 X) (subtopology (prod_topology euclideanreal X) ({0..1} \<times> topspace X)) ?j"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   156
      by (simp add: continuous_map_into_subtopology [OF 1] image_subset_iff)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   157
    then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   158
      by (simp add: prod_topology_subtopology(1))
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   159
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   160
  show ?thesis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   161
    using assms
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   162
    apply (clarsimp simp add: homotopic_with_def)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   163
    subgoal for h
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   164
      by (rule_tac x="h \<circ> (\<lambda>y. (1 - fst y, snd y))" in exI) (simp add: continuous_map_compose [OF *])
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   165
    done
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   166
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   167
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   168
lemma homotopic_with_sym:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   169
   "homotopic_with P X Y f g \<longleftrightarrow> homotopic_with P X Y g f"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   170
  by (metis homotopic_with_symD)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   171
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   172
proposition homotopic_with_trans:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   173
    assumes "homotopic_with P X Y f g"  "homotopic_with P X Y g h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   174
    shows "homotopic_with P X Y f h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   175
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   176
  let ?X01 = "prod_topology (subtopology euclideanreal {0..1}) X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   177
  obtain k1 k2
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   178
    where contk1: "continuous_map ?X01 Y k1" and contk2: "continuous_map ?X01 Y k2"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   179
      and k12: "\<forall>x. k1 (1, x) = g x" "\<forall>x. k2 (0, x) = g x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   180
      "\<forall>x. k1 (0, x) = f x" "\<forall>x. k2 (1, x) = h x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   181
      and P:   "\<forall>t\<in>{0..1}. P (\<lambda>x. k1 (t, x))" "\<forall>t\<in>{0..1}. P (\<lambda>x. k2 (t, x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   182
    using assms by (auto simp: homotopic_with_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   183
  define k where "k \<equiv> \<lambda>y. if fst y \<le> 1/2
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   184
                             then (k1 \<circ> (\<lambda>x. (2 *\<^sub>R fst x, snd x))) y
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   185
                             else (k2 \<circ> (\<lambda>x. (2 *\<^sub>R fst x -1, snd x))) y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   186
  have keq: "k1 (2 * u, v) = k2 (2 * u -1, v)" if "u = 1/2"  for u v
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   187
    by (simp add: k12 that)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   188
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   189
    unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   190
  proof (intro exI conjI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   191
    show "continuous_map ?X01 Y k"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   192
      unfolding k_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   193
    proof (rule continuous_map_cases_le)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   194
      show fst: "continuous_map ?X01 euclideanreal fst"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   195
        using continuous_map_fst continuous_map_in_subtopology by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   196
      show "continuous_map ?X01 euclideanreal (\<lambda>x. 1/2)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   197
        by simp
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   198
      show "continuous_map (subtopology ?X01 {y \<in> topspace ?X01. fst y \<le> 1/2}) Y
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   199
               (k1 \<circ> (\<lambda>x. (2 *\<^sub>R fst x, snd x)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   200
        apply (intro fst continuous_map_compose [OF _ contk1] continuous_intros continuous_map_into_subtopology fst continuous_map_from_subtopology | simp)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   201
        by (force simp: prod_topology_subtopology)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   202
      show "continuous_map (subtopology ?X01 {y \<in> topspace ?X01. 1/2 \<le> fst y}) Y
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   203
               (k2 \<circ> (\<lambda>x. (2 *\<^sub>R fst x -1, snd x)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   204
        apply (intro fst continuous_map_compose [OF _ contk2] continuous_intros continuous_map_into_subtopology fst continuous_map_from_subtopology | simp)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   205
        by (force simp: prod_topology_subtopology)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   206
      show "(k1 \<circ> (\<lambda>x. (2 *\<^sub>R fst x, snd x))) y = (k2 \<circ> (\<lambda>x. (2 *\<^sub>R fst x -1, snd x))) y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   207
        if "y \<in> topspace ?X01" and "fst y = 1/2" for y
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   208
        using that by (simp add: keq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   209
    qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   210
    show "\<forall>x. k (0, x) = f x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   211
      by (simp add: k12 k_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   212
    show "\<forall>x. k (1, x) = h x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   213
      by (simp add: k12 k_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   214
    show "\<forall>t\<in>{0..1}. P (\<lambda>x. k (t, x))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   215
    proof 
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   216
      fix t show "t\<in>{0..1} \<Longrightarrow> P (\<lambda>x. k (t, x))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   217
        by (cases "t \<le> 1/2") (auto simp add: k_def P)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   218
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   219
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   220
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   221
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   222
lemma homotopic_with_id2: 
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   223
  "(\<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x) \<Longrightarrow> homotopic_with (\<lambda>x. True) X X (g \<circ> f) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   224
  by (metis comp_apply continuous_map_id eq_id_iff homotopic_with_equal homotopic_with_symD)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   225
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   226
subsection\<open>Continuity lemmas\<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   227
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   228
lemma homotopic_with_compose_continuous_map_left:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   229
  "\<lbrakk>homotopic_with p X1 X2 f g; continuous_map X2 X3 h; \<And>j. p j \<Longrightarrow> q(h \<circ> j)\<rbrakk>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   230
   \<Longrightarrow> homotopic_with q X1 X3 (h \<circ> f) (h \<circ> g)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   231
  unfolding homotopic_with_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   232
  apply clarify
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   233
  subgoal for k
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   234
    by (rule_tac x="h \<circ> k" in exI) (rule conjI continuous_map_compose | simp add: o_def)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   235
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   236
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   237
lemma homotopic_with_compose_continuous_map_right:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   238
  assumes hom: "homotopic_with p X2 X3 f g" and conth: "continuous_map X1 X2 h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   239
    and q: "\<And>j. p j \<Longrightarrow> q(j \<circ> h)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   240
  shows "homotopic_with q X1 X3 (f \<circ> h) (g \<circ> h)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   241
proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   242
  obtain k
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   243
    where contk: "continuous_map (prod_topology (subtopology euclideanreal {0..1}) X2) X3 k"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   244
      and k: "\<forall>x. k (0, x) = f x" "\<forall>x. k (1, x) = g x" and p: "\<And>t. t\<in>{0..1} \<Longrightarrow> p (\<lambda>x. k (t, x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   245
    using hom unfolding homotopic_with_def by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   246
  have hsnd: "continuous_map (prod_topology (subtopology euclideanreal {0..1}) X1) X2 (h \<circ> snd)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   247
    by (rule continuous_map_compose [OF continuous_map_snd conth])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   248
  let ?h = "k \<circ> (\<lambda>(t,x). (t,h x))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   249
  show ?thesis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   250
    unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   251
  proof (intro exI conjI allI ballI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   252
    have "continuous_map (prod_topology (top_of_set {0..1}) X1)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   253
     (prod_topology (top_of_set {0..1::real}) X2) (\<lambda>(t, x). (t, h x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   254
      by (metis (mono_tags, lifting) case_prod_beta' comp_def continuous_map_eq continuous_map_fst continuous_map_pairedI hsnd)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   255
    then show "continuous_map (prod_topology (subtopology euclideanreal {0..1}) X1) X3 ?h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   256
      by (intro conjI continuous_map_compose [OF _ contk])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   257
    show "q (\<lambda>x. ?h (t, x))" if "t \<in> {0..1}" for t
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   258
      using q [OF p [OF that]] by (simp add: o_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   259
  qed (auto simp: k)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   260
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   261
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   262
corollary homotopic_compose:
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   263
  assumes "homotopic_with (\<lambda>x. True) X Y f f'" "homotopic_with (\<lambda>x. True) Y Z g g'"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   264
  shows "homotopic_with (\<lambda>x. True) X Z (g \<circ> f) (g' \<circ> f')"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   265
proof (rule homotopic_with_trans [where g = "g \<circ> f'"])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   266
  show "homotopic_with (\<lambda>x. True) X Z (g \<circ> f) (g \<circ> f')"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   267
    using assms by (simp add: homotopic_with_compose_continuous_map_left homotopic_with_imp_continuous_maps)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   268
  show "homotopic_with (\<lambda>x. True) X Z (g \<circ> f') (g' \<circ> f')"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   269
    using assms by (simp add: homotopic_with_compose_continuous_map_right homotopic_with_imp_continuous_maps)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   270
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   271
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   272
proposition homotopic_with_compose_continuous_right:
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   273
    "\<lbrakk>homotopic_with_canon (\<lambda>f. p (f \<circ> h)) X Y f g; continuous_on W h; h ` W \<subseteq> X\<rbrakk>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   274
     \<Longrightarrow> homotopic_with_canon p W Y (f \<circ> h) (g \<circ> h)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   275
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   276
  apply (rename_tac k)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   277
  apply (rule_tac x="k \<circ> (\<lambda>y. (fst y, h (snd y)))" in exI)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   278
  apply (rule conjI continuous_intros continuous_on_compose2 [where f=snd and g=h] | simp)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   279
  apply (fastforce simp: o_def elim: continuous_on_subset)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   280
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   281
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   282
proposition homotopic_with_compose_continuous_left:
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   283
     "\<lbrakk>homotopic_with_canon (\<lambda>f. p (h \<circ> f)) X Y f g; continuous_on Y h; h ` Y \<subseteq> Z\<rbrakk>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   284
      \<Longrightarrow> homotopic_with_canon p X Z (h \<circ> f) (h \<circ> g)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   285
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   286
  apply (rename_tac k)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   287
  apply (rule_tac x="h \<circ> k" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   288
  apply (rule conjI continuous_intros continuous_on_compose [where f=snd and g=h, unfolded o_def] | simp)+
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   289
  apply (fastforce simp: o_def elim: continuous_on_subset)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   290
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   291
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   292
lemma homotopic_from_subtopology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   293
   "homotopic_with P X X' f g \<Longrightarrow> homotopic_with P (subtopology X s) X' f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   294
  unfolding homotopic_with_def
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   295
  by (force simp add: continuous_map_from_subtopology prod_topology_subtopology(2) elim!: ex_forward)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   296
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   297
lemma homotopic_on_emptyI:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   298
    assumes "topspace X = {}" "P f" "P g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   299
    shows "homotopic_with P X X' f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   300
  unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   301
proof (intro exI conjI ballI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   302
  show "P (\<lambda>x. (\<lambda>(t,x). if t = 0 then f x else g x) (t, x))" if "t \<in> {0..1}" for t::real
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   303
    by (cases "t = 0", auto simp: assms)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   304
qed (auto simp: continuous_map_atin assms)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   305
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   306
lemma homotopic_on_empty:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   307
   "topspace X = {} \<Longrightarrow> (homotopic_with P X X' f g \<longleftrightarrow> P f \<and> P g)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   308
  using homotopic_on_emptyI homotopic_with_imp_property by metis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   309
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   310
lemma homotopic_with_canon_on_empty [simp]: "homotopic_with_canon (\<lambda>x. True) {} t f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   311
  by (auto intro: homotopic_with_equal)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   312
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   313
lemma homotopic_constant_maps:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   314
   "homotopic_with (\<lambda>x. True) X X' (\<lambda>x. a) (\<lambda>x. b) \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   315
    topspace X = {} \<or> path_component_of X' a b" (is "?lhs = ?rhs")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   316
proof (cases "topspace X = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   317
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   318
  then obtain c where c: "c \<in> topspace X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   319
    by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   320
  have "\<exists>g. continuous_map (top_of_set {0..1::real}) X' g \<and> g 0 = a \<and> g 1 = b"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   321
    if "x \<in> topspace X" and hom: "homotopic_with (\<lambda>x. True) X X' (\<lambda>x. a) (\<lambda>x. b)" for x
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   322
  proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   323
    obtain h :: "real \<times> 'a \<Rightarrow> 'b"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   324
      where conth: "continuous_map (prod_topology (top_of_set {0..1}) X) X' h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   325
        and h: "\<And>x. h (0, x) = a" "\<And>x. h (1, x) = b"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   326
      using hom by (auto simp: homotopic_with_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   327
    have cont: "continuous_map (top_of_set {0..1}) X' (h \<circ> (\<lambda>t. (t, c)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   328
      by (rule continuous_map_compose [OF _ conth] continuous_intros c | simp)+
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   329
    then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   330
      by (force simp: h)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   331
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   332
  moreover have "homotopic_with (\<lambda>x. True) X X' (\<lambda>x. g 0) (\<lambda>x. g 1)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   333
    if "x \<in> topspace X" "a = g 0" "b = g 1" "continuous_map (top_of_set {0..1}) X' g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   334
    for x and g :: "real \<Rightarrow> 'b"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   335
    unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   336
    by (force intro!: continuous_map_compose continuous_intros c that)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   337
  ultimately show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   338
    using False by (auto simp: path_component_of_def pathin_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   339
qed (simp add: homotopic_on_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   340
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   341
proposition homotopic_with_eq:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   342
   assumes h: "homotopic_with P X Y f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   343
       and f': "\<And>x. x \<in> topspace X \<Longrightarrow> f' x = f x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   344
       and g': "\<And>x. x \<in> topspace X \<Longrightarrow> g' x = g x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   345
       and P:  "(\<And>h k. (\<And>x. x \<in> topspace X \<Longrightarrow> h x = k x) \<Longrightarrow> P h \<longleftrightarrow> P k)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   346
   shows "homotopic_with P X Y f' g'"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   347
  using h unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   348
  apply safe
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   349
  apply (rule_tac x="\<lambda>(u,v). if v \<in> topspace X then h(u,v) else if u = 0 then f' v else g' v" in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   350
  apply (simp add: f' g', safe)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   351
  apply (fastforce intro: continuous_map_eq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   352
  apply (subst P; fastforce)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   353
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   354
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   355
lemma homotopic_with_prod_topology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   356
  assumes "homotopic_with p X1 Y1 f f'" and "homotopic_with q X2 Y2 g g'"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   357
    and r: "\<And>i j. \<lbrakk>p i; q j\<rbrakk> \<Longrightarrow> r(\<lambda>(x,y). (i x, j y))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   358
  shows "homotopic_with r (prod_topology X1 X2) (prod_topology Y1 Y2)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   359
                          (\<lambda>z. (f(fst z),g(snd z))) (\<lambda>z. (f'(fst z), g'(snd z)))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   360
proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   361
  obtain h
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   362
    where h: "continuous_map (prod_topology (subtopology euclideanreal {0..1}) X1) Y1 h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   363
      and h0: "\<And>x. h (0, x) = f x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   364
      and h1: "\<And>x. h (1, x) = f' x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   365
      and p: "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> p (\<lambda>x. h (t,x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   366
    using assms unfolding homotopic_with_def by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   367
  obtain k
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   368
    where k: "continuous_map (prod_topology (subtopology euclideanreal {0..1}) X2) Y2 k"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   369
      and k0: "\<And>x. k (0, x) = g x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   370
      and k1: "\<And>x. k (1, x) = g' x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   371
      and q: "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> q (\<lambda>x. k (t,x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   372
    using assms unfolding homotopic_with_def by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   373
  let ?hk = "\<lambda>(t,x,y). (h(t,x), k(t,y))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   374
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   375
    unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   376
  proof (intro conjI allI exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   377
    show "continuous_map (prod_topology (subtopology euclideanreal {0..1}) (prod_topology X1 X2))
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   378
                         (prod_topology Y1 Y2) ?hk"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   379
      unfolding continuous_map_pairwise case_prod_unfold
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   380
      by (rule conjI continuous_map_pairedI continuous_intros continuous_map_id [unfolded id_def]
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   381
          continuous_map_fst_of [unfolded o_def] continuous_map_snd_of [unfolded o_def]
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   382
          continuous_map_compose [OF _ h, unfolded o_def]
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   383
          continuous_map_compose [OF _ k, unfolded o_def])+
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   384
  next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   385
    fix x
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   386
    show "?hk (0, x) = (f (fst x), g (snd x))" "?hk (1, x) = (f' (fst x), g' (snd x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   387
      by (auto simp: case_prod_beta h0 k0 h1 k1)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   388
  qed (auto simp: p q r)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   389
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   390
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   391
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   392
lemma homotopic_with_product_topology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   393
  assumes ht: "\<And>i. i \<in> I \<Longrightarrow> homotopic_with (p i) (X i) (Y i) (f i) (g i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   394
    and pq: "\<And>h. (\<And>i. i \<in> I \<Longrightarrow> p i (h i)) \<Longrightarrow> q(\<lambda>x. (\<lambda>i\<in>I. h i (x i)))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   395
  shows "homotopic_with q (product_topology X I) (product_topology Y I)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   396
                          (\<lambda>z. (\<lambda>i\<in>I. (f i) (z i))) (\<lambda>z. (\<lambda>i\<in>I. (g i) (z i)))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   397
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   398
  obtain h
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   399
    where h: "\<And>i. i \<in> I \<Longrightarrow> continuous_map (prod_topology (subtopology euclideanreal {0..1}) (X i)) (Y i) (h i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   400
      and h0: "\<And>i x. i \<in> I \<Longrightarrow> h i (0, x) = f i x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   401
      and h1: "\<And>i x. i \<in> I \<Longrightarrow> h i (1, x) = g i x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   402
      and p: "\<And>i t. \<lbrakk>i \<in> I; t \<in> {0..1}\<rbrakk> \<Longrightarrow> p i (\<lambda>x. h i (t,x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   403
    using ht unfolding homotopic_with_def by metis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   404
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   405
    unfolding homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   406
  proof (intro conjI allI exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   407
    let ?h = "\<lambda>(t,z). \<lambda>i\<in>I. h i (t,z i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   408
    have "continuous_map (prod_topology (subtopology euclideanreal {0..1}) (product_topology X I))
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   409
                         (Y i) (\<lambda>x. h i (fst x, snd x i))" if "i \<in> I" for i
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   410
    proof -
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   411
      have \<section>: "continuous_map (prod_topology (top_of_set {0..1}) (product_topology X I)) (X i) (\<lambda>x. snd x i)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   412
        using continuous_map_componentwise continuous_map_snd that by fastforce
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   413
      show ?thesis
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   414
        unfolding continuous_map_pairwise case_prod_unfold
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   415
        by (intro conjI that \<section> continuous_intros continuous_map_compose [OF _ h, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   416
    qed
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   417
    then show "continuous_map (prod_topology (subtopology euclideanreal {0..1}) (product_topology X I))
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   418
         (product_topology Y I) ?h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   419
      by (auto simp: continuous_map_componentwise case_prod_beta)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   420
    show "?h (0, x) = (\<lambda>i\<in>I. f i (x i))" "?h (1, x) = (\<lambda>i\<in>I. g i (x i))" for x
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   421
      by (auto simp: case_prod_beta h0 h1)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   422
    show "\<forall>t\<in>{0..1}. q (\<lambda>x. ?h (t, x))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   423
      by (force intro: p pq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   424
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   425
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   426
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   427
text\<open>Homotopic triviality implicitly incorporates path-connectedness.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   428
lemma homotopic_triviality:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   429
  shows  "(\<forall>f g. continuous_on S f \<and> f ` S \<subseteq> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   430
                 continuous_on S g \<and> g ` S \<subseteq> T
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   431
                 \<longrightarrow> homotopic_with_canon (\<lambda>x. True) S T f g) \<longleftrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   432
          (S = {} \<or> path_connected T) \<and>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   433
          (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> T \<longrightarrow> (\<exists>c. homotopic_with_canon (\<lambda>x. True) S T f (\<lambda>x. c)))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   434
          (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   435
proof (cases "S = {} \<or> T = {}")
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   436
  case True then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   437
    by (auto simp: homotopic_on_emptyI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   438
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   439
  case False show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   440
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   441
    assume LHS [rule_format]: ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   442
    have pab: "path_component T a b" if "a \<in> T" "b \<in> T" for a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   443
    proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   444
      have "homotopic_with_canon (\<lambda>x. True) S T (\<lambda>x. a) (\<lambda>x. b)"
71172
nipkow
parents: 70817
diff changeset
   445
        by (simp add: LHS image_subset_iff that)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   446
      then show ?thesis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   447
        using False homotopic_constant_maps [of "top_of_set S" "top_of_set T" a b] by auto
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   448
    qed
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   449
    moreover
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   450
    have "\<exists>c. homotopic_with_canon (\<lambda>x. True) S T f (\<lambda>x. c)" if "continuous_on S f" "f ` S \<subseteq> T" for f
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   451
      using False LHS continuous_on_const that by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   452
    ultimately show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   453
      by (simp add: path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   454
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   455
    assume RHS: ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   456
    with False have T: "path_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   457
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   458
    show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   459
    proof clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   460
      fix f g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   461
      assume "continuous_on S f" "f ` S \<subseteq> T" "continuous_on S g" "g ` S \<subseteq> T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   462
      obtain c d where c: "homotopic_with_canon (\<lambda>x. True) S T f (\<lambda>x. c)" and d: "homotopic_with_canon (\<lambda>x. True) S T g (\<lambda>x. d)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   463
        using False \<open>continuous_on S f\<close> \<open>f ` S \<subseteq> T\<close>  RHS \<open>continuous_on S g\<close> \<open>g ` S \<subseteq> T\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   464
      then have "c \<in> T" "d \<in> T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   465
        using False homotopic_with_imp_continuous_maps by fastforce+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   466
      with T have "path_component T c d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   467
        using path_connected_component by blast
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   468
      then have "homotopic_with_canon (\<lambda>x. True) S T (\<lambda>x. c) (\<lambda>x. d)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   469
        by (simp add: homotopic_constant_maps)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   470
      with c d show "homotopic_with_canon (\<lambda>x. True) S T f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   471
        by (meson homotopic_with_symD homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   472
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   473
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   474
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   475
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   476
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   477
subsection\<open>Homotopy of paths, maintaining the same endpoints\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   478
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   479
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
   480
definition\<^marker>\<open>tag important\<close> homotopic_paths :: "['a set, real \<Rightarrow> 'a, real \<Rightarrow> 'a::topological_space] \<Rightarrow> bool"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   481
  where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   482
     "homotopic_paths s p q \<equiv>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   483
       homotopic_with_canon (\<lambda>r. pathstart r = pathstart p \<and> pathfinish r = pathfinish p) {0..1} s p q"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   484
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   485
lemma homotopic_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   486
   "homotopic_paths s p q \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   487
      (\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   488
          h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   489
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   490
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   491
          (\<forall>t \<in> {0..1::real}. pathstart(h \<circ> Pair t) = pathstart p \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   492
                        pathfinish(h \<circ> Pair t) = pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   493
  by (auto simp: homotopic_paths_def homotopic_with pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   494
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   495
proposition homotopic_paths_imp_pathstart:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   496
     "homotopic_paths s p q \<Longrightarrow> pathstart p = pathstart q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   497
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   498
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   499
proposition homotopic_paths_imp_pathfinish:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   500
     "homotopic_paths s p q \<Longrightarrow> pathfinish p = pathfinish q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   501
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   502
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   503
lemma homotopic_paths_imp_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   504
     "homotopic_paths s p q \<Longrightarrow> path p \<and> path q"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   505
  using homotopic_paths_def homotopic_with_imp_continuous_maps path_def continuous_map_subtopology_eu by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   506
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   507
lemma homotopic_paths_imp_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   508
     "homotopic_paths s p q \<Longrightarrow> path_image p \<subseteq> s \<and> path_image q \<subseteq> s"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   509
  by (metis (mono_tags) continuous_map_subtopology_eu homotopic_paths_def homotopic_with_imp_continuous_maps path_image_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   510
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   511
proposition homotopic_paths_refl [simp]: "homotopic_paths s p p \<longleftrightarrow> path p \<and> path_image p \<subseteq> s"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   512
  by (simp add: homotopic_paths_def path_def path_image_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   513
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   514
proposition homotopic_paths_sym: "homotopic_paths s p q \<Longrightarrow> homotopic_paths s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   515
  by (metis (mono_tags) homotopic_paths_def homotopic_paths_imp_pathfinish homotopic_paths_imp_pathstart homotopic_with_symD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   516
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   517
proposition homotopic_paths_sym_eq: "homotopic_paths s p q \<longleftrightarrow> homotopic_paths s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   518
  by (metis homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   519
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   520
proposition homotopic_paths_trans [trans]:
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   521
  assumes "homotopic_paths s p q" "homotopic_paths s q r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   522
  shows "homotopic_paths s p r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   523
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   524
  have "pathstart q = pathstart p" "pathfinish q = pathfinish p"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   525
    using assms by (simp_all add: homotopic_paths_imp_pathstart homotopic_paths_imp_pathfinish)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   526
  then have "homotopic_with_canon (\<lambda>f. pathstart f = pathstart p \<and> pathfinish f = pathfinish p) {0..1} s q r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   527
    using \<open>homotopic_paths s q r\<close> homotopic_paths_def by force
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   528
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   529
    using assms homotopic_paths_def homotopic_with_trans by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   530
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   531
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   532
proposition homotopic_paths_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   533
     "\<lbrakk>path p; path_image p \<subseteq> s; \<And>t. t \<in> {0..1} \<Longrightarrow> p t = q t\<rbrakk> \<Longrightarrow> homotopic_paths s p q"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   534
  unfolding homotopic_paths_def
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   535
  by (rule homotopic_with_eq)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   536
     (auto simp: path_def pathstart_def pathfinish_def path_image_def elim: continuous_on_eq)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   537
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   538
proposition homotopic_paths_reparametrize:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   539
  assumes "path p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   540
      and pips: "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   541
      and contf: "continuous_on {0..1} f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   542
      and f01:"f ` {0..1} \<subseteq> {0..1}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   543
      and [simp]: "f(0) = 0" "f(1) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   544
      and q: "\<And>t. t \<in> {0..1} \<Longrightarrow> q(t) = p(f t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   545
    shows "homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   546
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   547
  have contp: "continuous_on {0..1} p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   548
    by (metis \<open>path p\<close> path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   549
  then have "continuous_on {0..1} (p \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   550
    using contf continuous_on_compose continuous_on_subset f01 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   551
  then have "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   552
    by (simp add: path_def) (metis q continuous_on_cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   553
  have piqs: "path_image q \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   554
    by (metis (no_types, hide_lams) pips f01 image_subset_iff path_image_def q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   555
  have fb0: "\<And>a b. \<lbrakk>0 \<le> a; a \<le> 1; 0 \<le> b; b \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> (1 - a) * f b + a * b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   556
    using f01 by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   557
  have fb1: "\<lbrakk>0 \<le> a; a \<le> 1; 0 \<le> b; b \<le> 1\<rbrakk> \<Longrightarrow> (1 - a) * f b + a * b \<le> 1" for a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   558
    using f01 [THEN subsetD, of "f b"] by (simp add: convex_bound_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   559
  have "homotopic_paths s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   560
  proof (rule homotopic_paths_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   561
    show "homotopic_paths s q (p \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   562
      using q by (force intro: homotopic_paths_eq [OF  \<open>path q\<close> piqs])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   563
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   564
    show "homotopic_paths s (p \<circ> f) p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   565
      apply (simp add: homotopic_paths_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   566
      apply (rule_tac x="p \<circ> (\<lambda>y. (1 - (fst y)) *\<^sub>R ((f \<circ> snd) y) + (fst y) *\<^sub>R snd y)"  in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   567
      apply (rule conjI contf continuous_intros continuous_on_subset [OF contp] | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   568
      using pips [unfolded path_image_def]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   569
      apply (auto simp: fb0 fb1 pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   570
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   571
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   572
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   573
    by (simp add: homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   574
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   575
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   576
lemma homotopic_paths_subset: "\<lbrakk>homotopic_paths s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t p q"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   577
  unfolding homotopic_paths by fast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   578
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   579
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   580
text\<open> A slightly ad-hoc but useful lemma in constructing homotopies.\<close>
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   581
lemma continuous_on_homotopic_join_lemma:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   582
  fixes q :: "[real,real] \<Rightarrow> 'a::topological_space"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   583
  assumes p: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. p (fst y) (snd y))" (is "continuous_on ?A ?p")
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   584
      and q: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. q (fst y) (snd y))" (is "continuous_on ?A ?q")
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   585
      and pf: "\<And>t. t \<in> {0..1} \<Longrightarrow> pathfinish(p t) = pathstart(q t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   586
    shows "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. (p(fst y) +++ q(fst y)) (snd y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   587
proof -
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   588
  have \<section>: "(\<lambda>t. p (fst t) (2 * snd t)) = ?p \<circ> (\<lambda>y. (fst y, 2 * snd y))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   589
          "(\<lambda>t. q (fst t) (2 * snd t - 1)) = ?q \<circ> (\<lambda>y. (fst y, 2 * snd y - 1))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   590
    by force+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   591
  show ?thesis
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   592
    unfolding joinpaths_def
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   593
  proof (rule continuous_on_cases_le)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   594
    show "continuous_on {y \<in> ?A. snd y \<le> 1/2} (\<lambda>t. p (fst t) (2 * snd t))" 
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   595
         "continuous_on {y \<in> ?A. 1/2 \<le> snd y} (\<lambda>t. q (fst t) (2 * snd t - 1))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   596
         "continuous_on ?A snd"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   597
      unfolding \<section>
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   598
      by (rule continuous_intros continuous_on_subset [OF p] continuous_on_subset [OF q] | force)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   599
  qed (use pf in \<open>auto simp: mult.commute pathstart_def pathfinish_def\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   600
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   601
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   602
text\<open> Congruence properties of homotopy w.r.t. path-combining operations.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   603
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   604
lemma homotopic_paths_reversepath_D:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   605
      assumes "homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   606
      shows   "homotopic_paths s (reversepath p) (reversepath q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   607
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   608
  apply (simp add: homotopic_paths_def homotopic_with_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   609
  apply (rule_tac x="h \<circ> (\<lambda>x. (fst x, 1 - snd x))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   610
  apply (rule conjI continuous_intros)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   611
  apply (auto simp: reversepath_def pathstart_def pathfinish_def elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   612
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   613
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   614
proposition homotopic_paths_reversepath:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   615
     "homotopic_paths s (reversepath p) (reversepath q) \<longleftrightarrow> homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   616
  using homotopic_paths_reversepath_D by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   617
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   618
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   619
proposition homotopic_paths_join:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   620
    "\<lbrakk>homotopic_paths s p p'; homotopic_paths s q q'; pathfinish p = pathstart q\<rbrakk> \<Longrightarrow> homotopic_paths s (p +++ q) (p' +++ q')"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   621
  apply (clarsimp simp add: homotopic_paths_def homotopic_with_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   622
  apply (rename_tac k1 k2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   623
  apply (rule_tac x="(\<lambda>y. ((k1 \<circ> Pair (fst y)) +++ (k2 \<circ> Pair (fst y))) (snd y))" in exI)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   624
  apply (intro conjI continuous_intros continuous_on_homotopic_join_lemma; force simp: joinpaths_def pathstart_def pathfinish_def path_image_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   625
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   626
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   627
proposition homotopic_paths_continuous_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   628
    "\<lbrakk>homotopic_paths s f g; continuous_on s h; h ` s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t (h \<circ> f) (h \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   629
  unfolding homotopic_paths_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   630
  by (simp add: homotopic_with_compose_continuous_map_left pathfinish_compose pathstart_compose)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   631
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   632
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   633
subsection\<open>Group properties for homotopy of paths\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   634
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
   635
text\<^marker>\<open>tag important\<close>\<open>So taking equivalence classes under homotopy would give the fundamental group\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   636
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   637
proposition homotopic_paths_rid:
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   638
  assumes "path p" "path_image p \<subseteq> s"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   639
  shows "homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p)) p"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   640
proof -
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   641
  have \<section>: "continuous_on {0..1} (\<lambda>t::real. if t \<le> 1/2 then 2 *\<^sub>R t else 1)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   642
    unfolding split_01
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   643
    by (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   644
  show ?thesis
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   645
    using assms
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   646
    apply (subst homotopic_paths_sym)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   647
     apply (rule homotopic_paths_reparametrize [where f = "\<lambda>t. if t \<le> 1/2 then 2 *\<^sub>R t else 1"])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   648
           apply (rule \<section> continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   649
    done
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   650
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   651
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   652
proposition homotopic_paths_lid:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   653
   "\<lbrakk>path p; path_image p \<subseteq> s\<rbrakk> \<Longrightarrow> homotopic_paths s (linepath (pathstart p) (pathstart p) +++ p) p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   654
  using homotopic_paths_rid [of "reversepath p" s]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   655
  by (metis homotopic_paths_reversepath path_image_reversepath path_reversepath pathfinish_linepath
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   656
        pathfinish_reversepath reversepath_joinpaths reversepath_linepath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   657
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   658
proposition homotopic_paths_assoc:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   659
   "\<lbrakk>path p; path_image p \<subseteq> s; path q; path_image q \<subseteq> s; path r; path_image r \<subseteq> s; pathfinish p = pathstart q;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   660
     pathfinish q = pathstart r\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   661
    \<Longrightarrow> homotopic_paths s (p +++ (q +++ r)) ((p +++ q) +++ r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   662
  apply (subst homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   663
  apply (rule homotopic_paths_reparametrize
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   664
           [where f = "\<lambda>t. if  t \<le> 1/2 then inverse 2 *\<^sub>R t
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   665
                           else if  t \<le> 3 / 4 then t - (1 / 4)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   666
                           else 2 *\<^sub>R t - 1"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   667
  apply (simp_all del: le_divide_eq_numeral1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   668
  apply (simp add: subset_path_image_join)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   669
  apply (rule continuous_on_cases_1 continuous_intros | auto simp: joinpaths_def)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   670
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   671
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   672
proposition homotopic_paths_rinv:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   673
  assumes "path p" "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   674
    shows "homotopic_paths s (p +++ reversepath p) (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   675
proof -
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   676
  have p: "continuous_on {0..1} p" 
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   677
    using assms by (auto simp: path_def)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   678
  let ?A = "{0..1} \<times> {0..1}"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   679
  have "continuous_on ?A (\<lambda>x. (subpath 0 (fst x) p +++ reversepath (subpath 0 (fst x) p)) (snd x))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   680
    unfolding joinpaths_def subpath_def reversepath_def path_def add_0_right diff_0_right
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   681
  proof (rule continuous_on_cases_le)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   682
    show "continuous_on {x \<in> ?A. snd x \<le> 1/2} (\<lambda>t. p (fst t * (2 * snd t)))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   683
         "continuous_on {x \<in> ?A. 1/2 \<le> snd x} (\<lambda>t. p (fst t * (1 - (2 * snd t - 1))))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   684
         "continuous_on ?A snd"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   685
      by (intro continuous_on_compose2 [OF p] continuous_intros; auto simp add: mult_le_one)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   686
  qed (auto simp add: algebra_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   687
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   688
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   689
    apply (subst homotopic_paths_sym_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   690
    unfolding homotopic_paths_def homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   691
    apply (rule_tac x="(\<lambda>y. (subpath 0 (fst y) p +++ reversepath(subpath 0 (fst y) p)) (snd y))" in exI)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   692
    apply (force simp: mult_le_one path_defs joinpaths_def subpath_def reversepath_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   693
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   694
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   695
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   696
proposition homotopic_paths_linv:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   697
  assumes "path p" "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   698
    shows "homotopic_paths s (reversepath p +++ p) (linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   699
  using homotopic_paths_rinv [of "reversepath p" s] assms by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   700
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   701
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   702
subsection\<open>Homotopy of loops without requiring preservation of endpoints\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   703
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
   704
definition\<^marker>\<open>tag important\<close> homotopic_loops :: "'a::topological_space set \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> bool"  where
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   705
 "homotopic_loops s p q \<equiv>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   706
     homotopic_with_canon (\<lambda>r. pathfinish r = pathstart r) {0..1} s p q"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   707
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   708
lemma homotopic_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   709
   "homotopic_loops s p q \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   710
      (\<exists>h. continuous_on ({0..1::real} \<times> {0..1}) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   711
          image h ({0..1} \<times> {0..1}) \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   712
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   713
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   714
          (\<forall>t \<in> {0..1}. pathfinish(h \<circ> Pair t) = pathstart(h \<circ> Pair t)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   715
  by (simp add: homotopic_loops_def pathstart_def pathfinish_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   716
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   717
proposition homotopic_loops_imp_loop:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   718
     "homotopic_loops s p q \<Longrightarrow> pathfinish p = pathstart p \<and> pathfinish q = pathstart q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   719
using homotopic_with_imp_property homotopic_loops_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   720
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   721
proposition homotopic_loops_imp_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   722
     "homotopic_loops s p q \<Longrightarrow> path p \<and> path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   723
  unfolding homotopic_loops_def path_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   724
  using homotopic_with_imp_continuous_maps continuous_map_subtopology_eu by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   725
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   726
proposition homotopic_loops_imp_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   727
     "homotopic_loops s p q \<Longrightarrow> path_image p \<subseteq> s \<and> path_image q \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   728
  unfolding homotopic_loops_def path_image_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   729
  by (meson continuous_map_subtopology_eu homotopic_with_imp_continuous_maps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   730
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   731
proposition homotopic_loops_refl:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   732
     "homotopic_loops s p p \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   733
      path p \<and> path_image p \<subseteq> s \<and> pathfinish p = pathstart p"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   734
  by (simp add: homotopic_loops_def path_image_def path_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   735
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   736
proposition homotopic_loops_sym: "homotopic_loops s p q \<Longrightarrow> homotopic_loops s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   737
  by (simp add: homotopic_loops_def homotopic_with_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   738
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   739
proposition homotopic_loops_sym_eq: "homotopic_loops s p q \<longleftrightarrow> homotopic_loops s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   740
  by (metis homotopic_loops_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   741
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   742
proposition homotopic_loops_trans:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   743
   "\<lbrakk>homotopic_loops s p q; homotopic_loops s q r\<rbrakk> \<Longrightarrow> homotopic_loops s p r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   744
  unfolding homotopic_loops_def by (blast intro: homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   745
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   746
proposition homotopic_loops_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   747
   "\<lbrakk>homotopic_loops s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_loops t p q"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   748
  by (fastforce simp add: homotopic_loops)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   749
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   750
proposition homotopic_loops_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   751
   "\<lbrakk>path p; path_image p \<subseteq> s; pathfinish p = pathstart p; \<And>t. t \<in> {0..1} \<Longrightarrow> p(t) = q(t)\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   752
          \<Longrightarrow> homotopic_loops s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   753
  unfolding homotopic_loops_def
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   754
  apply (rule homotopic_with_eq [OF homotopic_with_refl [where f = p, THEN iffD2]])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   755
  apply (simp_all add: path_image_def path_def pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   756
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   757
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   758
proposition homotopic_loops_continuous_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   759
   "\<lbrakk>homotopic_loops s f g; continuous_on s h; h ` s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_loops t (h \<circ> f) (h \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   760
  unfolding homotopic_loops_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   761
  by (simp add: homotopic_with_compose_continuous_map_left pathfinish_def pathstart_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   762
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   763
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   764
subsection\<open>Relations between the two variants of homotopy\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   765
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   766
proposition homotopic_paths_imp_homotopic_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   767
    "\<lbrakk>homotopic_paths s p q; pathfinish p = pathstart p; pathfinish q = pathstart p\<rbrakk> \<Longrightarrow> homotopic_loops s p q"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
   768
  by (auto simp: homotopic_with_def homotopic_paths_def homotopic_loops_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   769
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   770
proposition homotopic_loops_imp_homotopic_paths_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   771
  assumes "homotopic_loops s p (linepath a a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   772
    shows "homotopic_paths s p (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   773
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   774
  have "path p" by (metis assms homotopic_loops_imp_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   775
  have ploop: "pathfinish p = pathstart p" by (metis assms homotopic_loops_imp_loop)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   776
  have pip: "path_image p \<subseteq> s" by (metis assms homotopic_loops_imp_subset)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   777
  let ?A = "{0..1::real} \<times> {0..1::real}"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   778
  obtain h where conth: "continuous_on ?A h"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   779
             and hs: "h ` ?A \<subseteq> s"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   780
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(0,x) = p x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   781
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(1,x) = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   782
             and ends: "\<And>t. t \<in> {0..1} \<Longrightarrow> pathfinish (h \<circ> Pair t) = pathstart (h \<circ> Pair t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   783
    using assms by (auto simp: homotopic_loops homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   784
  have conth0: "path (\<lambda>u. h (u, 0))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   785
    unfolding path_def
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   786
  proof (rule continuous_on_compose [of _ _ h, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   787
    show "continuous_on ((\<lambda>x. (x, 0)) ` {0..1}) h"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   788
      by (force intro: continuous_on_subset [OF conth])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   789
  qed (force intro: continuous_intros)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   790
  have pih0: "path_image (\<lambda>u. h (u, 0)) \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   791
    using hs by (force simp: path_image_def)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   792
  have c1: "continuous_on ?A (\<lambda>x. h (fst x * snd x, 0))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   793
  proof (rule continuous_on_compose [of _ _ h, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   794
    show "continuous_on ((\<lambda>x. (fst x * snd x, 0)) ` ?A) h"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   795
      by (force simp: mult_le_one intro: continuous_on_subset [OF conth])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   796
  qed (force intro: continuous_intros)+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   797
  have c2: "continuous_on ?A (\<lambda>x. h (fst x - fst x * snd x, 0))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   798
  proof (rule continuous_on_compose [of _ _ h, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   799
    show "continuous_on ((\<lambda>x. (fst x - fst x * snd x, 0)) ` ?A) h"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   800
      by (auto simp: algebra_simps add_increasing2 mult_left_le intro: continuous_on_subset [OF conth])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   801
  qed (force intro: continuous_intros)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   802
  have [simp]: "\<And>t. \<lbrakk>0 \<le> t \<and> t \<le> 1\<rbrakk> \<Longrightarrow> h (t, 1) = h (t, 0)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   803
    using ends by (simp add: pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   804
  have adhoc_le: "c * 4 \<le> 1 + c * (d * 4)" if "\<not> d * 4 \<le> 3" "0 \<le> c" "c \<le> 1" for c d::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   805
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   806
    have "c * 3 \<le> c * (d * 4)" using that less_eq_real_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   807
    with \<open>c \<le> 1\<close> show ?thesis by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   808
  qed
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   809
  have *: "\<And>p x. \<lbrakk>path p \<and> path(reversepath p);
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   810
                  path_image p \<subseteq> s \<and> path_image(reversepath p) \<subseteq> s;
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   811
                  pathfinish p = pathstart(linepath a a +++ reversepath p) \<and>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   812
                   pathstart(reversepath p) = a \<and> pathstart p = x\<rbrakk>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   813
                  \<Longrightarrow> homotopic_paths s (p +++ linepath a a +++ reversepath p) (linepath x x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   814
    by (metis homotopic_paths_lid homotopic_paths_join
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   815
              homotopic_paths_trans homotopic_paths_sym homotopic_paths_rinv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   816
  have 1: "homotopic_paths s p (p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   817
    using \<open>path p\<close> homotopic_paths_rid homotopic_paths_sym pip by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   818
  moreover have "homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   819
                                   (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   820
    apply (rule homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   821
    using homotopic_paths_lid [of "p +++ linepath (pathfinish p) (pathfinish p)" s]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   822
    by (metis 1 homotopic_paths_imp_path homotopic_paths_imp_pathstart homotopic_paths_imp_subset)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   823
  moreover 
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   824
  have "homotopic_paths s (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   825
                                   ((\<lambda>u. h (u, 0)) +++ linepath a a +++ reversepath (\<lambda>u. h (u, 0)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   826
    unfolding homotopic_paths_def homotopic_with_def
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   827
  proof (intro exI strip conjI)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   828
    let ?h = "\<lambda>y. (subpath 0 (fst y) (\<lambda>u. h (u, 0)) +++ (\<lambda>u. h (Pair (fst y) u)) 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   829
               +++ subpath (fst y) 0 (\<lambda>u. h (u, 0))) (snd y)" 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   830
    have "continuous_on ?A ?h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   831
      by (intro continuous_on_homotopic_join_lemma; simp add: path_defs joinpaths_def subpath_def conth c1 c2)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   832
    moreover have "?h ` ?A \<subseteq> s"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   833
      unfolding joinpaths_def subpath_def
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   834
      by (force simp: algebra_simps mult_le_one mult_left_le intro: hs [THEN subsetD] adhoc_le)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   835
  ultimately show "continuous_map (prod_topology (top_of_set {0..1}) (top_of_set {0..1}))
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   836
                         (top_of_set s) ?h"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   837
    by (simp add: subpath_reversepath)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   838
  qed (use ploop in \<open>simp_all add: reversepath_def path_defs joinpaths_def o_def subpath_def conth c1 c2\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   839
  moreover have "homotopic_paths s ((\<lambda>u. h (u, 0)) +++ linepath a a +++ reversepath (\<lambda>u. h (u, 0)))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   840
                                   (linepath (pathstart p) (pathstart p))"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   841
  proof (rule *; simp add: pih0 pathstart_def pathfinish_def conth0)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   842
    show "a = (linepath a a +++ reversepath (\<lambda>u. h (u, 0))) 0 \<and> reversepath (\<lambda>u. h (u, 0)) 0 = a"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   843
      by (simp_all add: reversepath_def joinpaths_def)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   844
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   845
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   846
    by (blast intro: homotopic_paths_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   847
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   848
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   849
proposition homotopic_loops_conjugate:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   850
  fixes s :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   851
  assumes "path p" "path q" and pip: "path_image p \<subseteq> s" and piq: "path_image q \<subseteq> s"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   852
      and pq: "pathfinish p = pathstart q" and qloop: "pathfinish q = pathstart q"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   853
    shows "homotopic_loops s (p +++ q +++ reversepath p) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   854
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   855
  have contp: "continuous_on {0..1} p"  using \<open>path p\<close> [unfolded path_def] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   856
  have contq: "continuous_on {0..1} q"  using \<open>path q\<close> [unfolded path_def] by blast
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   857
  let ?A = "{0..1::real} \<times> {0..1::real}"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   858
  have c1: "continuous_on ?A (\<lambda>x. p ((1 - fst x) * snd x + fst x))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   859
  proof (rule continuous_on_compose [of _ _ p, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   860
    show "continuous_on ((\<lambda>x. (1 - fst x) * snd x + fst x) ` ?A) p"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   861
      by (auto intro: continuous_on_subset [OF contp] simp: algebra_simps add_increasing2 mult_right_le_one_le sum_le_prod1)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   862
  qed (force intro: continuous_intros)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   863
  have c2: "continuous_on ?A (\<lambda>x. p ((fst x - 1) * snd x + 1))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   864
  proof (rule continuous_on_compose [of _ _ p, unfolded o_def])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   865
    show "continuous_on ((\<lambda>x. (fst x - 1) * snd x + 1) ` ?A) p"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   866
      by (auto intro: continuous_on_subset [OF contp] simp: algebra_simps add_increasing2 mult_left_le_one_le)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   867
  qed (force intro: continuous_intros)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
   868
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   869
  have ps1: "\<And>a b. \<lbrakk>b * 2 \<le> 1; 0 \<le> b; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> p ((1 - a) * (2 * b) + a) \<in> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   870
    using sum_le_prod1
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   871
    by (force simp: algebra_simps add_increasing2 mult_left_le intro: pip [unfolded path_image_def, THEN subsetD])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   872
  have ps2: "\<And>a b. \<lbrakk>\<not> 4 * b \<le> 3; b \<le> 1; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> p ((a - 1) * (4 * b - 3) + 1) \<in> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   873
    apply (rule pip [unfolded path_image_def, THEN subsetD])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   874
    apply (rule image_eqI, blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   875
    apply (simp add: algebra_simps)
71633
07bec530f02e cleaned proofs
nipkow
parents: 71233
diff changeset
   876
    by (metis add_mono_thms_linordered_semiring(1) affine_ineq linear mult.commute mult.left_neutral mult_right_mono
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   877
              add.commute zero_le_numeral)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   878
  have qs: "\<And>a b. \<lbrakk>4 * b \<le> 3; \<not> b * 2 \<le> 1\<rbrakk> \<Longrightarrow> q (4 * b - 2) \<in> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   879
    using path_image_def piq by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   880
  have "homotopic_loops s (p +++ q +++ reversepath p)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   881
                          (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q))"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   882
    unfolding homotopic_loops_def homotopic_with_def
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   883
  proof (intro exI strip conjI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   884
    let ?h = "(\<lambda>y. (subpath (fst y) 1 p +++ q +++ subpath 1 (fst y) p) (snd y))" 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   885
    have "continuous_on ?A (\<lambda>y. q (snd y))"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   886
      by (force simp: contq intro: continuous_on_compose [of _ _ q, unfolded o_def] continuous_on_id continuous_on_snd)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   887
    then have "continuous_on ?A ?h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   888
      apply (intro continuous_on_homotopic_join_lemma)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   889
      using pq qloop
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   890
      by (auto simp: path_defs joinpaths_def subpath_def c1 c2)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   891
    then show "continuous_map (prod_topology (top_of_set {0..1}) (top_of_set {0..1})) (top_of_set s) ?h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   892
      by (auto simp: joinpaths_def subpath_def  ps1 ps2 qs)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   893
    show "?h (1,x) = (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q)) x"  for x
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   894
      using pq by (simp add: pathfinish_def subpath_refl)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   895
  qed (auto simp: subpath_reversepath)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   896
  moreover have "homotopic_loops s (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q)) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   897
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   898
    have "homotopic_paths s (linepath (pathfinish q) (pathfinish q) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   899
      using \<open>path q\<close> homotopic_paths_lid qloop piq by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   900
    hence 1: "\<And>f. homotopic_paths s f q \<or> \<not> homotopic_paths s f (linepath (pathfinish q) (pathfinish q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   901
      using homotopic_paths_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   902
    hence "homotopic_paths s (linepath (pathfinish q) (pathfinish q) +++ q +++ linepath (pathfinish q) (pathfinish q)) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   903
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   904
      have "homotopic_paths s (q +++ linepath (pathfinish q) (pathfinish q)) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   905
        by (simp add: \<open>path q\<close> homotopic_paths_rid piq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   906
      thus ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   907
        by (metis (no_types) 1 \<open>path q\<close> homotopic_paths_join homotopic_paths_rinv homotopic_paths_sym
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   908
                  homotopic_paths_trans qloop pathfinish_linepath piq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   909
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   910
    thus ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   911
      by (metis (no_types) qloop homotopic_loops_sym homotopic_paths_imp_homotopic_loops homotopic_paths_imp_pathfinish homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   912
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   913
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   914
    by (blast intro: homotopic_loops_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   915
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   916
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   917
lemma homotopic_paths_loop_parts:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   918
  assumes loops: "homotopic_loops S (p +++ reversepath q) (linepath a a)" and "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   919
  shows "homotopic_paths S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   920
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   921
  have paths: "homotopic_paths S (p +++ reversepath q) (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   922
    using homotopic_loops_imp_homotopic_paths_null [OF loops] by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   923
  then have "path p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   924
    using \<open>path q\<close> homotopic_loops_imp_path loops path_join path_join_path_ends path_reversepath by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   925
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   926
  proof (cases "pathfinish p = pathfinish q")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   927
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   928
    have pipq: "path_image p \<subseteq> S" "path_image q \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   929
      by (metis Un_subset_iff paths \<open>path p\<close> \<open>path q\<close> homotopic_loops_imp_subset homotopic_paths_imp_path loops
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   930
           path_image_join path_image_reversepath path_imp_reversepath path_join_eq)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   931
    have "homotopic_paths S p (p +++ (linepath (pathfinish p) (pathfinish p)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   932
      using \<open>path p\<close> \<open>path_image p \<subseteq> S\<close> homotopic_paths_rid homotopic_paths_sym by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   933
    moreover have "homotopic_paths S (p +++ (linepath (pathfinish p) (pathfinish p))) (p +++ (reversepath q +++ q))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   934
      by (simp add: True \<open>path p\<close> \<open>path q\<close> pipq homotopic_paths_join homotopic_paths_linv homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   935
    moreover have "homotopic_paths S (p +++ (reversepath q +++ q)) ((p +++ reversepath q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   936
      by (simp add: True \<open>path p\<close> \<open>path q\<close> homotopic_paths_assoc pipq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   937
    moreover have "homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart p) (pathstart p) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   938
      by (simp add: \<open>path q\<close> homotopic_paths_join paths pipq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   939
    moreover then have "homotopic_paths S (linepath (pathstart p) (pathstart p) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   940
      by (metis \<open>path q\<close> homotopic_paths_imp_path homotopic_paths_lid linepath_trivial path_join_path_ends pathfinish_def pipq(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   941
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   942
      using homotopic_paths_trans by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   943
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   944
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   945
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   946
      using \<open>path q\<close> homotopic_loops_imp_path loops path_join_path_ends by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   947
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   948
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   949
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   950
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
   951
subsection\<^marker>\<open>tag unimportant\<close>\<open>Homotopy of "nearby" function, paths and loops\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   952
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   953
lemma homotopic_with_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   954
  fixes f g :: "_ \<Rightarrow> 'b::real_normed_vector"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   955
  assumes contf: "continuous_on S f"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   956
      and contg:"continuous_on S g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   957
      and sub: "\<And>x. x \<in> S \<Longrightarrow> closed_segment (f x) (g x) \<subseteq> t"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   958
    shows "homotopic_with_canon (\<lambda>z. True) S t f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   959
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   960
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R f(snd y) + (fst y) *\<^sub>R g(snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   961
  apply (intro conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   962
  apply (rule subset_refl continuous_intros continuous_on_subset [OF contf] continuous_on_compose2 [where g=f]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   963
                                            continuous_on_subset [OF contg] continuous_on_compose2 [where g=g]| simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   964
  using sub closed_segment_def apply fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   965
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   966
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   967
lemma homotopic_paths_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   968
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   969
  assumes "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   970
          "\<And>t. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   971
    shows "homotopic_paths S g h"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   972
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   973
  unfolding path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   974
  apply (simp add: closed_segment_def pathstart_def pathfinish_def homotopic_paths_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   975
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R (g \<circ> snd) y + (fst y) *\<^sub>R (h \<circ> snd) y)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   976
  apply (intro conjI subsetI continuous_intros; force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   977
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   978
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   979
lemma homotopic_loops_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   980
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   981
  assumes "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   982
          "\<And>t x. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   983
    shows "homotopic_loops S g h"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   984
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   985
  unfolding path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   986
  apply (simp add: pathstart_def pathfinish_def homotopic_loops_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   987
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R g(snd y) + (fst y) *\<^sub>R h(snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   988
  apply (auto intro!: continuous_intros intro: continuous_on_compose2 [where g=g] continuous_on_compose2 [where g=h])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   989
  apply (force simp: closed_segment_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   990
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   991
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   992
lemma homotopic_paths_nearby_explicit:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   993
  assumes \<section>: "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   994
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> S\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   995
    shows "homotopic_paths S g h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   996
proof (rule homotopic_paths_linear [OF \<section>])
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   997
  show "\<And>t. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   998
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
   999
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1000
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1001
lemma homotopic_loops_nearby_explicit:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1002
  assumes \<section>: "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1003
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> S\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1004
    shows "homotopic_loops S g h"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1005
proof (rule homotopic_loops_linear [OF \<section>])
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1006
  show "\<And>t. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1007
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1008
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1009
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1010
lemma homotopic_nearby_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1011
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1012
  assumes "path g" "open S" "path_image g \<subseteq> S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1013
    shows "\<exists>e. 0 < e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1014
               (\<forall>h. path h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1015
                    pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and>
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1016
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_paths S g h)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1017
proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1018
  obtain e where "e > 0" and e: "\<And>x y. x \<in> path_image g \<Longrightarrow> y \<in> - S \<Longrightarrow> e \<le> dist x y"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1019
    using separate_compact_closed [of "path_image g" "-S"] assms by force
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1020
  show ?thesis
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1021
    apply (intro exI conjI strip)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1022
    using e [unfolded dist_norm] \<open>e > 0\<close>
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1023
    by (fastforce simp: path_image_def intro!: homotopic_paths_nearby_explicit assms)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1024
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1025
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1026
lemma homotopic_nearby_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1027
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1028
  assumes "path g" "open S" "path_image g \<subseteq> S" "pathfinish g = pathstart g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1029
    shows "\<exists>e. 0 < e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1030
               (\<forall>h. path h \<and> pathfinish h = pathstart h \<and>
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1031
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_loops S g h)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1032
proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1033
  obtain e where "e > 0" and e: "\<And>x y. x \<in> path_image g \<Longrightarrow> y \<in> - S \<Longrightarrow> e \<le> dist x y"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1034
    using separate_compact_closed [of "path_image g" "-S"] assms by force
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1035
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1036
    apply (intro exI conjI)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1037
    using e [unfolded dist_norm] \<open>e > 0\<close>
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1038
    by (fastforce simp: path_image_def intro!: homotopic_loops_nearby_explicit assms)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1039
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1040
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1041
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1042
subsection\<open> Homotopy and subpaths\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1043
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1044
lemma homotopic_join_subpaths1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1045
  assumes "path g" and pag: "path_image g \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1046
      and u: "u \<in> {0..1}" and v: "v \<in> {0..1}" and w: "w \<in> {0..1}" "u \<le> v" "v \<le> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1047
    shows "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1048
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1049
  have 1: "t * 2 \<le> 1 \<Longrightarrow> u + t * (v * 2) \<le> v + t * (u * 2)" for t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1050
    using affine_ineq \<open>u \<le> v\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1051
  have 2: "t * 2 > 1 \<Longrightarrow> u + (2*t - 1) * v \<le> v + (2*t - 1) * w" for t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1052
    by (metis add_mono_thms_linordered_semiring(1) diff_gt_0_iff_gt less_eq_real_def mult.commute mult_right_mono \<open>u \<le> v\<close> \<open>v \<le> w\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1053
  have t2: "\<And>t::real. t*2 = 1 \<Longrightarrow> t = 1/2" by auto
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1054
  have "homotopic_paths (path_image g) (subpath u v g +++ subpath v w g) (subpath u w g)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1055
  proof (cases "w = u")
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1056
    case True
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1057
    then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1058
      by (metis \<open>path g\<close> homotopic_paths_rinv path_image_subpath_subset path_subpath pathstart_subpath reversepath_subpath subpath_refl u v)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1059
  next
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1060
    case False
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1061
    let ?f = "\<lambda>t. if  t \<le> 1/2 then inverse((w - u)) *\<^sub>R (2 * (v - u)) *\<^sub>R t
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1062
                               else inverse((w - u)) *\<^sub>R ((v - u) + (w - v) *\<^sub>R (2 *\<^sub>R t - 1))"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1063
    show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1064
    proof (rule homotopic_paths_sym [OF homotopic_paths_reparametrize [where f = ?f]])
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1065
      show "path (subpath u w g)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1066
        using assms(1) path_subpath u w(1) by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1067
      show "path_image (subpath u w g) \<subseteq> path_image g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1068
        by (meson path_image_subpath_subset u w(1))
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1069
      show "continuous_on {0..1} ?f"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1070
        unfolding split_01
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1071
        by (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def dest!: t2)+
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1072
      show "?f ` {0..1} \<subseteq> {0..1}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1073
        using False assms
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1074
        by (force simp: field_simps not_le mult_left_mono affine_ineq dest!: 1 2)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1075
      show "(subpath u v g +++ subpath v w g) t = subpath u w g (?f t)" if "t \<in> {0..1}" for t 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1076
        using assms
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1077
        unfolding joinpaths_def subpath_def by (auto simp add: divide_simps add.commute mult.commute mult.left_commute)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1078
    qed (use False in auto)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1079
  qed
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1080
  then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1081
    by (rule homotopic_paths_subset [OF _ pag])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1082
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1083
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1084
lemma homotopic_join_subpaths2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1085
  assumes "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1086
    shows "homotopic_paths s (subpath w v g +++ subpath v u g) (subpath w u g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1087
by (metis assms homotopic_paths_reversepath_D pathfinish_subpath pathstart_subpath reversepath_joinpaths reversepath_subpath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1088
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1089
lemma homotopic_join_subpaths3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1090
  assumes hom: "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1091
      and "path g" and pag: "path_image g \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1092
      and u: "u \<in> {0..1}" and v: "v \<in> {0..1}" and w: "w \<in> {0..1}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1093
    shows "homotopic_paths s (subpath v w g +++ subpath w u g) (subpath v u g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1094
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1095
  have "homotopic_paths s (subpath u w g +++ subpath w v g) ((subpath u v g +++ subpath v w g) +++ subpath w v g)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1096
  proof (rule homotopic_paths_join)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1097
    show "homotopic_paths s (subpath u w g) (subpath u v g +++ subpath v w g)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1098
      using hom homotopic_paths_sym_eq by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1099
    show "homotopic_paths s (subpath w v g) (subpath w v g)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1100
      by (metis \<open>path g\<close> homotopic_paths_eq pag path_image_subpath_subset path_subpath subset_trans v w)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1101
  qed auto
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1102
  also have "homotopic_paths s ((subpath u v g +++ subpath v w g) +++ subpath w v g) (subpath u v g +++ subpath v w g +++ subpath w v g)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1103
    by (rule homotopic_paths_sym [OF homotopic_paths_assoc])
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1104
       (use assms in \<open>simp_all add: path_image_subpath_subset [THEN order_trans]\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1105
  also have "homotopic_paths s (subpath u v g +++ subpath v w g +++ subpath w v g)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1106
                               (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g)))"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1107
  proof (rule homotopic_paths_join; simp)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1108
    show "path (subpath u v g) \<and> path_image (subpath u v g) \<subseteq> s"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1109
      by (metis \<open>path g\<close> order.trans pag path_image_subpath_subset path_subpath u v)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1110
    show "homotopic_paths s (subpath v w g +++ subpath w v g) (linepath (g v) (g v))"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1111
      by (metis (no_types, lifting) \<open>path g\<close> homotopic_paths_linv order_trans pag path_image_subpath_subset path_subpath pathfinish_subpath reversepath_subpath v w)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1112
  qed 
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1113
  also have "homotopic_paths s (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g))) (subpath u v g)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1114
  proof (rule homotopic_paths_rid)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1115
    show "path (subpath u v g)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1116
      using \<open>path g\<close> path_subpath u v by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1117
    show "path_image (subpath u v g) \<subseteq> s"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1118
      by (meson \<open>path g\<close> order.trans pag path_image_subpath_subset u v)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1119
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1120
  finally have "homotopic_paths s (subpath u w g +++ subpath w v g) (subpath u v g)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1121
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1122
    using homotopic_join_subpaths2 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1123
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1124
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1125
proposition homotopic_join_subpaths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1126
   "\<lbrakk>path g; path_image g \<subseteq> s; u \<in> {0..1}; v \<in> {0..1}; w \<in> {0..1}\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1127
    \<Longrightarrow> homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1128
  using le_cases3 [of u v w] homotopic_join_subpaths1 homotopic_join_subpaths2 homotopic_join_subpaths3 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1129
  by metis
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1130
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1131
text\<open>Relating homotopy of trivial loops to path-connectedness.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1132
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1133
lemma path_component_imp_homotopic_points:
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1134
  assumes "path_component S a b"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1135
  shows "homotopic_loops S (linepath a a) (linepath b b)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1136
proof -
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1137
  obtain g :: "real \<Rightarrow> 'a" where g: "continuous_on {0..1} g" "g ` {0..1} \<subseteq> S" "g 0 = a" "g 1 = b"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1138
    using assms by (auto simp: path_defs)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1139
  then have "continuous_on ({0..1} \<times> {0..1}) (g \<circ> fst)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1140
    by (fastforce intro!: continuous_intros)+
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1141
  with g show ?thesis
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1142
    by (auto simp add: homotopic_loops_def homotopic_with_def path_defs image_subset_iff)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1143
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1144
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1145
lemma homotopic_loops_imp_path_component_value:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1146
   "\<lbrakk>homotopic_loops S p q; 0 \<le> t; t \<le> 1\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1147
        \<Longrightarrow> path_component S (p t) (q t)"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1148
apply (clarsimp simp add: homotopic_loops_def homotopic_with_def path_defs)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1149
apply (rule_tac x="h \<circ> (\<lambda>u. (u, t))" in exI)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1150
apply (fastforce elim!: continuous_on_subset intro!: continuous_intros)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1151
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1152
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1153
lemma homotopic_points_eq_path_component:
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1154
   "homotopic_loops S (linepath a a) (linepath b b) \<longleftrightarrow> path_component S a b"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1155
by (auto simp: path_component_imp_homotopic_points
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1156
         dest: homotopic_loops_imp_path_component_value [where t=1])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1157
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1158
lemma path_connected_eq_homotopic_points:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1159
    "path_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1160
      (\<forall>a b. a \<in> S \<and> b \<in> S \<longrightarrow> homotopic_loops S (linepath a a) (linepath b b))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1161
by (auto simp: path_connected_def path_component_def homotopic_points_eq_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1162
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1163
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1164
subsection\<open>Simply connected sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1165
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  1166
text\<^marker>\<open>tag important\<close>\<open>defined as "all loops are homotopic (as loops)\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  1167
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  1168
definition\<^marker>\<open>tag important\<close> simply_connected where
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1169
  "simply_connected S \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1170
        \<forall>p q. path p \<and> pathfinish p = pathstart p \<and> path_image p \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1171
              path q \<and> pathfinish q = pathstart q \<and> path_image q \<subseteq> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1172
              \<longrightarrow> homotopic_loops S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1173
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1174
lemma simply_connected_empty [iff]: "simply_connected {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1175
  by (simp add: simply_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1176
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1177
lemma simply_connected_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1178
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1179
  shows "simply_connected S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1180
by (simp add: simply_connected_def path_connected_eq_homotopic_points)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1181
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1182
lemma simply_connected_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1183
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1184
  shows "simply_connected S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1185
by (simp add: path_connected_imp_connected simply_connected_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1186
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1187
lemma simply_connected_eq_contractible_loop_any:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1188
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1189
  shows "simply_connected S \<longleftrightarrow>
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1190
            (\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1191
                  \<longrightarrow> homotopic_loops S p (linepath a a))"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1192
        (is "?lhs = ?rhs")
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1193
proof
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1194
  assume ?lhs then show ?rhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1195
    unfolding simply_connected_def by force
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1196
next
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1197
  assume ?rhs then show ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1198
    unfolding simply_connected_def
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1199
    by (metis pathfinish_in_path_image subsetD  homotopic_loops_trans homotopic_loops_sym)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1200
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1201
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1202
lemma simply_connected_eq_contractible_loop_some:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1203
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1204
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1205
                path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1206
                (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1207
                    \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1208
     (is "?lhs = ?rhs")
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1209
proof
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1210
  assume ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1211
  then show ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1212
  using simply_connected_eq_contractible_loop_any by (blast intro: simply_connected_imp_path_connected)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1213
next
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1214
  assume r: ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1215
  note pa = r [THEN conjunct2, rule_format]
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1216
  show ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1217
  proof (clarsimp simp add: simply_connected_eq_contractible_loop_any)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1218
    fix p a
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1219
    assume "path p" and "path_image p \<subseteq> S" "pathfinish p = pathstart p"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1220
      and "a \<in> S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1221
    with pa [of p] show "homotopic_loops S p (linepath a a)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1222
      using homotopic_loops_trans path_connected_eq_homotopic_points r by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1223
  qed
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1224
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1225
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1226
lemma simply_connected_eq_contractible_loop_all:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1227
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1228
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1229
         S = {} \<or>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1230
         (\<exists>a \<in> S. \<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1231
                \<longrightarrow> homotopic_loops S p (linepath a a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1232
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1233
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1234
  case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1235
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1236
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1237
  then obtain a where "a \<in> S" by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1238
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1239
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1240
    assume "simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1241
    then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1242
      using \<open>a \<in> S\<close> \<open>simply_connected S\<close> simply_connected_eq_contractible_loop_any
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1243
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1244
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1245
    assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1246
    then show "simply_connected S"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1247
      unfolding simply_connected_eq_contractible_loop_any 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1248
      by (meson False homotopic_loops_refl homotopic_loops_sym homotopic_loops_trans 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1249
          path_component_imp_homotopic_points path_component_refl)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1250
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1251
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1252
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1253
lemma simply_connected_eq_contractible_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1254
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1255
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1256
           path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1257
           (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1258
            \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1259
     (is "?lhs = ?rhs")
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1260
proof
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1261
  assume ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1262
  then show ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1263
    unfolding simply_connected_imp_path_connected
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1264
    by (metis simply_connected_eq_contractible_loop_some homotopic_loops_imp_homotopic_paths_null)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1265
next
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1266
  assume  ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1267
  then show ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1268
    using homotopic_paths_imp_homotopic_loops simply_connected_eq_contractible_loop_some by fastforce
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1269
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1270
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1271
lemma simply_connected_eq_homotopic_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1272
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1273
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1274
          path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1275
          (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1276
                path q \<and> path_image q \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1277
                pathstart q = pathstart p \<and> pathfinish q = pathfinish p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1278
                \<longrightarrow> homotopic_paths S p q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1279
         (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1280
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1281
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1282
  then have pc: "path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1283
        and *:  "\<And>p. \<lbrakk>path p; path_image p \<subseteq> S;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1284
                       pathfinish p = pathstart p\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1285
                      \<Longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1286
    by (auto simp: simply_connected_eq_contractible_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1287
  have "homotopic_paths S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1288
        if "path p" "path_image p \<subseteq> S" "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1289
           "path_image q \<subseteq> S" "pathstart q = pathstart p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1290
           "pathfinish q = pathfinish p" for p q
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1291
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1292
    have "homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1293
      by (simp add: homotopic_paths_rid homotopic_paths_sym that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1294
    also have "homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1295
                                 (p +++ reversepath q +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1296
      using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1297
      by (metis homotopic_paths_join homotopic_paths_linv homotopic_paths_refl homotopic_paths_sym_eq pathstart_linepath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1298
    also have "homotopic_paths S (p +++ reversepath q +++ q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1299
                                 ((p +++ reversepath q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1300
      by (simp add: that homotopic_paths_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1301
    also have "homotopic_paths S ((p +++ reversepath q) +++ q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1302
                                 (linepath (pathstart q) (pathstart q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1303
      using * [of "p +++ reversepath q"] that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1304
      by (simp add: homotopic_paths_join path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1305
    also have "homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1306
      using that homotopic_paths_lid by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1307
    finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1308
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1309
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1310
    by (blast intro: pc *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1311
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1312
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1313
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1314
    by (force simp: simply_connected_eq_contractible_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1315
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1316
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1317
proposition simply_connected_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1318
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1319
  assumes S: "simply_connected S" and T: "simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1320
    shows "simply_connected(S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1321
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1322
  have "homotopic_loops (S \<times> T) p (linepath (a, b) (a, b))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1323
       if "path p" "path_image p \<subseteq> S \<times> T" "p 1 = p 0" "a \<in> S" "b \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1324
       for p a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1325
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1326
    have "path (fst \<circ> p)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1327
      by (simp add: continuous_on_fst Path_Connected.path_continuous_image [OF \<open>path p\<close>])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1328
    moreover have "path_image (fst \<circ> p) \<subseteq> S"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1329
      using that by (force simp add: path_image_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1330
    ultimately have p1: "homotopic_loops S (fst \<circ> p) (linepath a a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1331
      using S that
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1332
      by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1333
    have "path (snd \<circ> p)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1334
      by (simp add: continuous_on_snd Path_Connected.path_continuous_image [OF \<open>path p\<close>])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1335
    moreover have "path_image (snd \<circ> p) \<subseteq> T"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1336
      using that by (force simp: path_image_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1337
    ultimately have p2: "homotopic_loops T (snd \<circ> p) (linepath b b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1338
      using T that
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1339
      by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1340
    show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1341
      using p1 p2 unfolding homotopic_loops
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1342
      apply clarify
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1343
      apply (rename_tac h k)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1344
      apply (rule_tac x="\<lambda>z. (h z, k z)" in exI)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1345
      apply (force intro: continuous_intros simp: pathstart_def pathfinish_def)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1346
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1347
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1348
  with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1349
    by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1350
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1351
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1352
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1353
subsection\<open>Contractible sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1354
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  1355
definition\<^marker>\<open>tag important\<close> contractible where
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1356
 "contractible S \<equiv> \<exists>a. homotopic_with_canon (\<lambda>x. True) S S id (\<lambda>x. a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1357
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1358
proposition contractible_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1359
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1360
  assumes "contractible S" shows "simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1361
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1362
  case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1363
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1364
  case False
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1365
  obtain a where a: "homotopic_with_canon (\<lambda>x. True) S S id (\<lambda>x. a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1366
    using assms by (force simp: contractible_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1367
  then have "a \<in> S"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1368
    by (metis False homotopic_constant_maps homotopic_with_symD homotopic_with_trans path_component_in_topspace topspace_euclidean_subtopology)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1369
  have "\<forall>p. path p \<and>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1370
            path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1371
            homotopic_loops S p (linepath a a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1372
    using a apply (simp add: homotopic_loops_def homotopic_with_def path_def path_image_def pathfinish_def pathstart_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1373
    apply (rule_tac x="(h \<circ> (\<lambda>y. (fst y, (p \<circ> snd) y)))" in exI)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1374
    apply (intro conjI continuous_on_compose continuous_intros; force elim: continuous_on_subset)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1375
    done
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1376
  with \<open>a \<in> S\<close> show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1377
    by (auto simp add: simply_connected_eq_contractible_loop_all False)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1378
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1379
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1380
corollary contractible_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1381
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1382
  shows "contractible S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1383
by (simp add: contractible_imp_simply_connected simply_connected_imp_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1384
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1385
lemma contractible_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1386
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1387
  shows "contractible S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1388
by (simp add: contractible_imp_simply_connected simply_connected_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1389
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1390
lemma nullhomotopic_through_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1391
  fixes S :: "_::topological_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1392
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1393
      and g: "continuous_on T g" "g ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1394
      and T: "contractible T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1395
    obtains c where "homotopic_with_canon (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1396
proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1397
  obtain b where b: "homotopic_with_canon (\<lambda>x. True) T T id (\<lambda>x. b)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1398
    using assms by (force simp: contractible_def)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1399
  have "homotopic_with_canon (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  1400
    by (metis Abstract_Topology.continuous_map_subtopology_eu b g homotopic_with_compose_continuous_map_left)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1401
  then have "homotopic_with_canon (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1402
    by (simp add: f homotopic_with_compose_continuous_map_right)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1403
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1404
    by (simp add: comp_def that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1405
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1406
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1407
lemma nullhomotopic_into_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1408
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1409
      and T: "contractible T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1410
    obtains c where "homotopic_with_canon (\<lambda>h. True) S T f (\<lambda>x. c)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1411
  by (rule nullhomotopic_through_contractible [OF f, of id T]) (use assms in auto)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1412
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1413
lemma nullhomotopic_from_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1414
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1415
      and S: "contractible S"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1416
    obtains c where "homotopic_with_canon (\<lambda>h. True) S T f (\<lambda>x. c)"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1417
  by (auto simp: comp_def intro: nullhomotopic_through_contractible [OF continuous_on_id _ f S])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1418
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1419
lemma homotopic_through_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1420
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1421
  assumes "continuous_on S f1" "f1 ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1422
          "continuous_on T g1" "g1 ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1423
          "continuous_on S f2" "f2 ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1424
          "continuous_on T g2" "g2 ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1425
          "contractible T" "path_connected U"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1426
   shows "homotopic_with_canon (\<lambda>h. True) S U (g1 \<circ> f1) (g2 \<circ> f2)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1427
proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1428
  obtain c1 where c1: "homotopic_with_canon (\<lambda>h. True) S U (g1 \<circ> f1) (\<lambda>x. c1)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1429
    by (rule nullhomotopic_through_contractible [of S f1 T g1 U]) (use assms in auto)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1430
  obtain c2 where c2: "homotopic_with_canon (\<lambda>h. True) S U (g2 \<circ> f2) (\<lambda>x. c2)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1431
    by (rule nullhomotopic_through_contractible [of S f2 T g2 U]) (use assms in auto)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1432
  have "S = {} \<or> (\<exists>t. path_connected t \<and> t \<subseteq> U \<and> c2 \<in> t \<and> c1 \<in> t)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1433
  proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1434
    case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1435
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1436
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1437
    with c1 c2 have "c1 \<in> U" "c2 \<in> U"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1438
      using homotopic_with_imp_continuous_maps by fastforce+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1439
    with \<open>path_connected U\<close> show ?thesis by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1440
  qed
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1441
  then have "homotopic_with_canon (\<lambda>h. True) S U (\<lambda>x. c2) (\<lambda>x. c1)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1442
    by (simp add: path_component homotopic_constant_maps)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1443
  then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1444
    using c1 c2 homotopic_with_symD homotopic_with_trans by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1445
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1446
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1447
lemma homotopic_into_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1448
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1449
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1450
      and g: "continuous_on S g" "g ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1451
      and T: "contractible T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1452
    shows "homotopic_with_canon (\<lambda>h. True) S T f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1453
using homotopic_through_contractible [of S f T id T g id]
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1454
by (simp add: assms contractible_imp_path_connected)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1455
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1456
lemma homotopic_from_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1457
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1458
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1459
      and g: "continuous_on S g" "g ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1460
      and "contractible S" "path_connected T"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1461
    shows "homotopic_with_canon (\<lambda>h. True) S T f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1462
using homotopic_through_contractible [of S id S f T id g]
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1463
by (simp add: assms contractible_imp_path_connected)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1464
71233
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1465
subsection\<open>Starlike sets\<close>
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1466
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1467
definition\<^marker>\<open>tag important\<close> "starlike S \<longleftrightarrow> (\<exists>a\<in>S. \<forall>x\<in>S. closed_segment a x \<subseteq> S)"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1468
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1469
lemma starlike_UNIV [simp]: "starlike UNIV"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1470
  by (simp add: starlike_def)
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1471
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1472
lemma convex_imp_starlike:
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1473
  "convex S \<Longrightarrow> S \<noteq> {} \<Longrightarrow> starlike S"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1474
  unfolding convex_contains_segment starlike_def by auto
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1475
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1476
lemma starlike_convex_tweak_boundary_points:
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1477
  fixes S :: "'a::euclidean_space set"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1478
  assumes "convex S" "S \<noteq> {}" and ST: "rel_interior S \<subseteq> T" and TS: "T \<subseteq> closure S"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1479
  shows "starlike T"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1480
proof -
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1481
  have "rel_interior S \<noteq> {}"
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1482
    by (simp add: assms rel_interior_eq_empty)
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1483
  then obtain a where a: "a \<in> rel_interior S"  by blast
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1484
  with ST have "a \<in> T"  by blast
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1485
  have "\<And>x. x \<in> T \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1486
    by (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> a]) (use assms in auto)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1487
  then have "\<forall>x\<in>T. a \<in> T \<and> open_segment a x \<subseteq> T"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1488
    using ST by (blast intro: a \<open>a \<in> T\<close> rel_interior_closure_convex_segment [OF \<open>convex S\<close> a])
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1489
  then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1490
    unfolding starlike_def using bexI [OF _ \<open>a \<in> T\<close>]
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1491
    by (simp add: closed_segment_eq_open)
71233
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1492
qed
da28fd2852ed moved starlike where it belongs
nipkow
parents: 71172
diff changeset
  1493
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1494
lemma starlike_imp_contractible_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1495
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1496
  assumes S: "starlike S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1497
      and P: "\<And>a T. \<lbrakk>a \<in> S; 0 \<le> T; T \<le> 1\<rbrakk> \<Longrightarrow> P(\<lambda>x. (1 - T) *\<^sub>R x + T *\<^sub>R a)"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1498
    obtains a where "homotopic_with_canon P S S (\<lambda>x. x) (\<lambda>x. a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1499
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1500
  obtain a where "a \<in> S" and a: "\<And>x. x \<in> S \<Longrightarrow> closed_segment a x \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1501
    using S by (auto simp: starlike_def)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1502
  have "\<And>t b. 0 \<le> t \<and> t \<le> 1 \<Longrightarrow>
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1503
              \<exists>u. (1 - t) *\<^sub>R b + t *\<^sub>R a = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1504
    by (metis add_diff_cancel_right' diff_ge_0_iff_ge le_add_diff_inverse pth_c(1))
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1505
  then have "(\<lambda>y. (1 - fst y) *\<^sub>R snd y + fst y *\<^sub>R a) ` ({0..1} \<times> S) \<subseteq> S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1506
    using a [unfolded closed_segment_def] by force
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1507
  then have "homotopic_with_canon P S S (\<lambda>x. x) (\<lambda>x. a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1508
    using \<open>a \<in> S\<close>
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1509
    unfolding homotopic_with_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1510
    apply (rule_tac x="\<lambda>y. (1 - (fst y)) *\<^sub>R snd y + (fst y) *\<^sub>R a" in exI)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1511
    apply (force simp add: P intro: continuous_intros)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1512
    done
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1513
  then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1514
    using that by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1515
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1516
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1517
lemma starlike_imp_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1518
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1519
  shows "starlike S \<Longrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1520
using starlike_imp_contractible_gen contractible_def by (fastforce simp: id_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1521
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1522
lemma contractible_UNIV [simp]: "contractible (UNIV :: 'a::real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1523
  by (simp add: starlike_imp_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1524
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1525
lemma starlike_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1526
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1527
  shows "starlike S \<Longrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1528
by (simp add: contractible_imp_simply_connected starlike_imp_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1529
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1530
lemma convex_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1531
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1532
  shows "convex S \<Longrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1533
using convex_imp_starlike starlike_imp_simply_connected by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1534
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1535
lemma starlike_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1536
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1537
  shows "starlike S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1538
by (simp add: simply_connected_imp_path_connected starlike_imp_simply_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1539
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1540
lemma starlike_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1541
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1542
  shows "starlike S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1543
by (simp add: path_connected_imp_connected starlike_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1544
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1545
lemma is_interval_simply_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1546
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1547
  shows "is_interval S \<longleftrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1548
using convex_imp_simply_connected is_interval_convex_1 is_interval_path_connected_1 simply_connected_imp_path_connected by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1549
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1550
lemma contractible_empty [simp]: "contractible {}"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  1551
  by (simp add: contractible_def homotopic_on_emptyI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1552
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1553
lemma contractible_convex_tweak_boundary_points:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1554
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1555
  assumes "convex S" and TS: "rel_interior S \<subseteq> T" "T \<subseteq> closure S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1556
  shows "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1557
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1558
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1559
  with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1560
    by (simp add: subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1561
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1562
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1563
  show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1564
    by (meson False assms starlike_convex_tweak_boundary_points starlike_imp_contractible)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1565
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1566
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1567
lemma convex_imp_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1568
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1569
  shows "convex S \<Longrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1570
  using contractible_empty convex_imp_starlike starlike_imp_contractible by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1571
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1572
lemma contractible_sing [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1573
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1574
  shows "contractible {a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1575
by (rule convex_imp_contractible [OF convex_singleton])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1576
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1577
lemma is_interval_contractible_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1578
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1579
  shows  "is_interval S \<longleftrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1580
using contractible_imp_simply_connected convex_imp_contractible is_interval_convex_1
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1581
      is_interval_simply_connected_1 by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1582
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1583
lemma contractible_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1584
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1585
  assumes S: "contractible S" and T: "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1586
  shows "contractible (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1587
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1588
  obtain a h where conth: "continuous_on ({0..1} \<times> S) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1589
             and hsub: "h ` ({0..1} \<times> S) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1590
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow> h (0, x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1591
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow>  h (1::real, x) = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1592
    using S by (auto simp: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1593
  obtain b k where contk: "continuous_on ({0..1} \<times> T) k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1594
             and ksub: "k ` ({0..1} \<times> T) \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1595
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow> k (0, x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1596
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow>  k (1::real, x) = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1597
    using T by (auto simp: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1598
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1599
    apply (simp add: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1600
    apply (rule exI [where x=a])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1601
    apply (rule exI [where x=b])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1602
    apply (rule exI [where x = "\<lambda>z. (h (fst z, fst(snd z)), k (fst z, snd(snd z)))"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1603
    using hsub ksub
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1604
    apply (fastforce intro!: continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF contk])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1605
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1606
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1607
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1608
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1609
subsection\<open>Local versions of topological properties in general\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1610
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  1611
definition\<^marker>\<open>tag important\<close> locally :: "('a::topological_space set \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> bool"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1612
where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1613
 "locally P S \<equiv>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1614
        \<forall>w x. openin (top_of_set S) w \<and> x \<in> w
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1615
              \<longrightarrow> (\<exists>u v. openin (top_of_set S) u \<and> P v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1616
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1617
lemma locallyI:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1618
  assumes "\<And>w x. \<lbrakk>openin (top_of_set S) w; x \<in> w\<rbrakk>
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1619
                  \<Longrightarrow> \<exists>u v. openin (top_of_set S) u \<and> P v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1620
    shows "locally P S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1621
using assms by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1622
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1623
lemma locallyE:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1624
  assumes "locally P S" "openin (top_of_set S) w" "x \<in> w"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1625
  obtains u v where "openin (top_of_set S) u"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1626
                    "P v" "x \<in> u" "u \<subseteq> v" "v \<subseteq> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1627
  using assms unfolding locally_def by meson
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1628
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1629
lemma locally_mono:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  1630
  assumes "locally P S" "\<And>T. P T \<Longrightarrow> Q T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1631
    shows "locally Q S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1632
by (metis assms locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1633
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1634
lemma locally_open_subset:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1635
  assumes "locally P S" "openin (top_of_set S) t"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1636
    shows "locally P t"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1637
  using assms
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1638
  unfolding locally_def
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1639
  by (elim all_forward) (meson dual_order.trans openin_imp_subset openin_subset_trans openin_trans)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1640
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1641
lemma locally_diff_closed:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1642
    "\<lbrakk>locally P S; closedin (top_of_set S) t\<rbrakk> \<Longrightarrow> locally P (S - t)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1643
  using locally_open_subset closedin_def by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1644
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1645
lemma locally_empty [iff]: "locally P {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1646
  by (simp add: locally_def openin_subtopology)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1647
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1648
lemma locally_singleton [iff]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1649
  fixes a :: "'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1650
  shows "locally P {a} \<longleftrightarrow> P {a}"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1651
proof -
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1652
  have "\<forall>x::real. \<not> 0 < x \<Longrightarrow> P {a}"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1653
    using zero_less_one by blast
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1654
  then show ?thesis
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1655
    unfolding locally_def
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1656
    by (auto simp add: openin_euclidean_subtopology_iff subset_singleton_iff conj_disj_distribR)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1657
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1658
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1659
lemma locally_iff:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1660
    "locally P S \<longleftrightarrow>
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1661
     (\<forall>T x. open T \<and> x \<in> S \<inter> T \<longrightarrow> (\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> S \<inter> U \<and> S \<inter> U \<subseteq> V \<and> V \<subseteq> S \<inter> T)))"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1662
  apply (simp add: le_inf_iff locally_def openin_open, safe)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1663
   apply (metis IntE IntI le_inf_iff)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1664
  apply (metis IntI Int_subset_iff)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1665
  done
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1666
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1667
lemma locally_Int:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1668
  assumes S: "locally P S" and T: "locally P T"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1669
      and P: "\<And>S T. P S \<and> P T \<Longrightarrow> P(S \<inter> T)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1670
  shows "locally P (S \<inter> T)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1671
  unfolding locally_iff
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1672
proof clarify
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1673
  fix A x
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1674
  assume "open A" "x \<in> A" "x \<in> S" "x \<in> T"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1675
  then obtain U1 V1 U2 V2 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1676
    where "open U1" "P V1" "x \<in> S \<inter> U1" "S \<inter> U1 \<subseteq> V1 \<and> V1 \<subseteq> S \<inter> A" 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1677
          "open U2" "P V2" "x \<in> T \<inter> U2" "T \<inter> U2 \<subseteq> V2 \<and> V2 \<subseteq> T \<inter> A"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1678
    using S T unfolding locally_iff by (meson IntI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1679
  then have "S \<inter> T \<inter> (U1 \<inter> U2) \<subseteq> V1 \<inter> V2" "V1 \<inter> V2 \<subseteq> S \<inter> T \<inter> A" "x \<in> S \<inter> T \<inter> (U1 \<inter> U2)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1680
    by blast+
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1681
  moreover have "P (V1 \<inter> V2)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1682
    by (simp add: P \<open>P V1\<close> \<open>P V2\<close>)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1683
  ultimately show "\<exists>U. open U \<and> (\<exists>V. P V \<and> x \<in> S \<inter> T \<inter> U \<and> S \<inter> T \<inter> U \<subseteq> V \<and> V \<subseteq> S \<inter> T \<inter> A)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1684
    using \<open>open U1\<close> \<open>open U2\<close> by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1685
qed
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1686
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1687
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1688
lemma locally_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1689
  fixes S :: "('a::metric_space) set" and T :: "('b::metric_space) set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1690
  assumes PS: "locally P S" and QT: "locally Q T" and R: "\<And>S T. P S \<and> Q T \<Longrightarrow> R(S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1691
  shows "locally R (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1692
    unfolding locally_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1693
proof (clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1694
  fix W x y
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1695
  assume W: "openin (top_of_set (S \<times> T)) W" and xy: "(x, y) \<in> W"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1696
  then obtain U V where "openin (top_of_set S) U" "x \<in> U"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1697
                        "openin (top_of_set T) V" "y \<in> V" "U \<times> V \<subseteq> W"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1698
    using Times_in_interior_subtopology by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1699
  then obtain U1 U2 V1 V2
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1700
         where opeS: "openin (top_of_set S) U1 \<and> P U2 \<and> x \<in> U1 \<and> U1 \<subseteq> U2 \<and> U2 \<subseteq> U"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1701
           and opeT: "openin (top_of_set T) V1 \<and> Q V2 \<and> y \<in> V1 \<and> V1 \<subseteq> V2 \<and> V2 \<subseteq> V"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1702
    by (meson PS QT locallyE)
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1703
  then have "openin (top_of_set (S \<times> T)) (U1 \<times> V1)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1704
    by (simp add: openin_Times)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1705
  moreover have "R (U2 \<times> V2)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1706
    by (simp add: R opeS opeT)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1707
  moreover have "U1 \<times> V1 \<subseteq> U2 \<times> V2 \<and> U2 \<times> V2 \<subseteq> W"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1708
    using opeS opeT \<open>U \<times> V \<subseteq> W\<close> by auto 
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1709
  ultimately show "\<exists>U V. openin (top_of_set (S \<times> T)) U \<and> R V \<and> (x,y) \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> W"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1710
    using opeS opeT by auto 
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1711
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1712
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1713
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1714
proposition homeomorphism_locally_imp:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1715
  fixes S :: "'a::metric_space set" and T :: "'b::t2_space set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1716
  assumes S: "locally P S" and hom: "homeomorphism S T f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1717
      and Q: "\<And>S S'. \<lbrakk>P S; homeomorphism S S' f g\<rbrakk> \<Longrightarrow> Q S'"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1718
    shows "locally Q T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1719
proof (clarsimp simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1720
  fix W y
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1721
  assume "y \<in> W" and "openin (top_of_set T) W"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1722
  then obtain A where T: "open A" "W = T \<inter> A"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1723
    by (force simp: openin_open)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1724
  then have "W \<subseteq> T" by auto
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1725
  have f: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "f ` S = T" "continuous_on S f"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1726
   and g: "\<And>y. y \<in> T \<Longrightarrow> f(g y) = y" "g ` T = S" "continuous_on T g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1727
    using hom by (auto simp: homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1728
  have gw: "g ` W = S \<inter> f -` W"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1729
    using \<open>W \<subseteq> T\<close> g by force
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1730
  have \<circ>: "openin (top_of_set S) (g ` W)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1731
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1732
    have "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1733
      using f(3) by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1734
    then show "openin (top_of_set S) (g ` W)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1735
      by (simp add: gw Collect_conj_eq \<open>openin (top_of_set T) W\<close> continuous_on_open f(2))
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1736
  qed
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1737
  then obtain U V
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1738
    where osu: "openin (top_of_set S) U" and uv: "P V" "g y \<in> U" "U \<subseteq> V" "V \<subseteq> g ` W"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1739
    using S [unfolded locally_def, rule_format, of "g ` W" "g y"] \<open>y \<in> W\<close> by force
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1740
  have "V \<subseteq> S" using uv by (simp add: gw)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1741
  have fv: "f ` V = T \<inter> {x. g x \<in> V}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1742
    using \<open>f ` S = T\<close> f \<open>V \<subseteq> S\<close> by auto
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1743
  have "f ` V \<subseteq> W"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1744
    using uv using Int_lower2 gw image_subsetI mem_Collect_eq subset_iff by auto
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1745
  have contvf: "continuous_on V f"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1746
    using \<open>V \<subseteq> S\<close> continuous_on_subset f(3) by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1747
  have contvg: "continuous_on (f ` V) g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1748
    using \<open>f ` V \<subseteq> W\<close> \<open>W \<subseteq> T\<close> continuous_on_subset [OF g(3)] by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1749
  have "V \<subseteq> g ` f ` V"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1750
    by (metis \<open>V \<subseteq> S\<close> hom homeomorphism_def homeomorphism_of_subsets order_refl)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1751
  then have homv: "homeomorphism V (f ` V) f g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1752
    using \<open>V \<subseteq> S\<close> f by (auto simp add: homeomorphism_def contvf contvg)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1753
  have "openin (top_of_set (g ` T)) U"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1754
    using \<open>g ` T = S\<close> by (simp add: osu)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1755
  then have 1: "openin (top_of_set T) (T \<inter> g -` U)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1756
    using \<open>continuous_on T g\<close> continuous_on_open [THEN iffD1] by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1757
  have 2: "\<exists>V. Q V \<and> y \<in> (T \<inter> g -` U) \<and> (T \<inter> g -` U) \<subseteq> V \<and> V \<subseteq> W"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1758
  proof (intro exI conjI)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1759
    show "Q (f ` V)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1760
      using Q homv \<open>P V\<close> by blast
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1761
    show "y \<in> T \<inter> g -` U"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1762
      using T(2) \<open>y \<in> W\<close> \<open>g y \<in> U\<close> by blast
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1763
    show "T \<inter> g -` U \<subseteq> f ` V"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1764
      using g(1) image_iff uv(3) by fastforce
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1765
    show "f ` V \<subseteq> W"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1766
      using \<open>f ` V \<subseteq> W\<close> by blast
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1767
  qed
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1768
  show "\<exists>U. openin (top_of_set T) U \<and> (\<exists>v. Q v \<and> y \<in> U \<and> U \<subseteq> v \<and> v \<subseteq> W)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1769
    by (meson 1 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1770
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1771
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1772
lemma homeomorphism_locally:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1773
  fixes f:: "'a::metric_space \<Rightarrow> 'b::metric_space"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1774
  assumes hom: "homeomorphism S T f g"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1775
      and eq: "\<And>S T. homeomorphism S T f g \<Longrightarrow> (P S \<longleftrightarrow> Q T)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1776
    shows "locally P S \<longleftrightarrow> locally Q T"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1777
     (is "?lhs = ?rhs")
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1778
proof
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1779
  assume ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1780
  then show ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1781
    using eq hom homeomorphism_locally_imp by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1782
next
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1783
  assume ?rhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1784
  then show ?lhs
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1785
    using eq homeomorphism_sym homeomorphism_symD [OF hom] 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1786
    by (blast intro: homeomorphism_locally_imp) 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1787
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1788
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1789
lemma homeomorphic_locally:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1790
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1791
  assumes hom: "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1792
          and iff: "\<And>X Y. X homeomorphic Y \<Longrightarrow> (P X \<longleftrightarrow> Q Y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1793
    shows "locally P S \<longleftrightarrow> locally Q T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1794
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1795
  obtain f g where hom: "homeomorphism S T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1796
    using assms by (force simp: homeomorphic_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1797
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1798
    using homeomorphic_def local.iff
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1799
    by (blast intro!: homeomorphism_locally)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1800
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1801
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1802
lemma homeomorphic_local_compactness:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1803
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1804
  shows "S homeomorphic T \<Longrightarrow> locally compact S \<longleftrightarrow> locally compact T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1805
by (simp add: homeomorphic_compactness homeomorphic_locally)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1806
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1807
lemma locally_translation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1808
  fixes P :: "'a :: real_normed_vector set \<Rightarrow> bool"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1809
  shows "(\<And>S. P ((+) a ` S) = P S) \<Longrightarrow> locally P ((+) a ` S) = locally P S"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1810
  using homeomorphism_locally [OF homeomorphism_translation]
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1811
  by (metis (full_types) homeomorphism_image2)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1812
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1813
lemma locally_injective_linear_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1814
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1815
  assumes f: "linear f" "inj f" and iff: "\<And>S. P (f ` S) \<longleftrightarrow> Q S"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1816
  shows "locally P (f ` S) \<longleftrightarrow> locally Q S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1817
  using homeomorphism_locally [of "f`S" _ _ f] linear_homeomorphism_image [OF f]
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1818
  by (metis (no_types, lifting) homeomorphism_image2 iff)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1819
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1820
lemma locally_open_map_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1821
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1822
  assumes P: "locally P S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1823
      and f: "continuous_on S f"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1824
      and oo: "\<And>T. openin (top_of_set S) T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` T)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1825
      and Q: "\<And>T. \<lbrakk>T \<subseteq> S; P T\<rbrakk> \<Longrightarrow> Q(f ` T)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1826
    shows "locally Q (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1827
proof (clarsimp simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1828
  fix W y
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1829
  assume oiw: "openin (top_of_set (f ` S)) W" and "y \<in> W"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1830
  then have "W \<subseteq> f ` S" by (simp add: openin_euclidean_subtopology_iff)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1831
  have oivf: "openin (top_of_set S) (S \<inter> f -` W)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1832
    by (rule continuous_on_open [THEN iffD1, rule_format, OF f oiw])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1833
  then obtain x where "x \<in> S" "f x = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1834
    using \<open>W \<subseteq> f ` S\<close> \<open>y \<in> W\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1835
  then obtain U V
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1836
    where "openin (top_of_set S) U" "P V" "x \<in> U" "U \<subseteq> V" "V \<subseteq> S \<inter> f -` W"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1837
    using P [unfolded locally_def, rule_format, of "(S \<inter> f -` W)" x] oivf \<open>y \<in> W\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1838
    by auto
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1839
  then have "openin (top_of_set (f ` S)) (f ` U)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1840
    by (simp add: oo)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1841
  then show "\<exists>X. openin (top_of_set (f ` S)) X \<and> (\<exists>Y. Q Y \<and> y \<in> X \<and> X \<subseteq> Y \<and> Y \<subseteq> W)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1842
    using Q \<open>P V\<close> \<open>U \<subseteq> V\<close> \<open>V \<subseteq> S \<inter> f -` W\<close> \<open>f x = y\<close> \<open>x \<in> U\<close> by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1843
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1844
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1845
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1846
subsection\<open>An induction principle for connected sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1847
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1848
proposition connected_induction:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1849
  assumes "connected S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1850
      and opD: "\<And>T a. \<lbrakk>openin (top_of_set S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1851
      and opI: "\<And>a. a \<in> S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1852
             \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1853
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<and> P y \<and> Q x \<longrightarrow> Q y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1854
      and etc: "a \<in> S" "b \<in> S" "P a" "P b" "Q a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1855
    shows "Q b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1856
proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1857
  let ?A = "{b. \<exists>T. openin (top_of_set S) T \<and> b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> Q x)}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1858
  let ?B = "{b. \<exists>T. openin (top_of_set S) T \<and> b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> \<not> Q x)}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1859
  have 1: "openin (top_of_set S) ?A"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1860
    by (subst openin_subopen, blast)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1861
  have 2: "openin (top_of_set S) ?B"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1862
    by (subst openin_subopen, blast)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1863
  have \<section>: "?A \<inter> ?B = {}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1864
    by (clarsimp simp: set_eq_iff) (metis (no_types, hide_lams) Int_iff opD openin_Int)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1865
  have *: "S \<subseteq> ?A \<union> ?B"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1866
    by clarsimp (meson opI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1867
  have "?A = {} \<or> ?B = {}"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1868
    using \<open>connected S\<close> [unfolded connected_openin, simplified, rule_format, OF 1 \<section> * 2] 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1869
    by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1870
  then show ?thesis
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1871
    by clarsimp (meson opI etc)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1872
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1873
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1874
lemma connected_equivalence_relation_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1875
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1876
      and etc: "a \<in> S" "b \<in> S" "P a" "P b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1877
      and trans: "\<And>x y z. \<lbrakk>R x y; R y z\<rbrakk> \<Longrightarrow> R x z"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1878
      and opD: "\<And>T a. \<lbrakk>openin (top_of_set S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1879
      and opI: "\<And>a. a \<in> S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1880
             \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1881
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<and> P y \<longrightarrow> R x y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1882
    shows "R a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1883
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1884
  have "\<And>a b c. \<lbrakk>a \<in> S; P a; b \<in> S; c \<in> S; P b; P c; R a b\<rbrakk> \<Longrightarrow> R a c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1885
    apply (rule connected_induction [OF \<open>connected S\<close> opD], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1886
    by (meson trans opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1887
  then show ?thesis by (metis etc opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1888
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1889
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1890
lemma connected_induction_simple:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1891
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1892
      and etc: "a \<in> S" "b \<in> S" "P a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1893
      and opI: "\<And>a. a \<in> S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1894
             \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1895
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<longrightarrow> P y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1896
    shows "P b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1897
apply (rule connected_induction [OF \<open>connected S\<close> _, where P = "\<lambda>x. True"], blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1898
apply (frule opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1899
using etc apply simp_all
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1900
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1901
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1902
lemma connected_equivalence_relation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1903
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1904
      and etc: "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1905
      and sym: "\<And>x y. \<lbrakk>R x y; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> R y x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1906
      and trans: "\<And>x y z. \<lbrakk>R x y; R y z; x \<in> S; y \<in> S; z \<in> S\<rbrakk> \<Longrightarrow> R x z"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1907
      and opI: "\<And>a. a \<in> S \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. R a x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1908
    shows "R a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1909
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1910
  have "\<And>a b c. \<lbrakk>a \<in> S; b \<in> S; c \<in> S; R a b\<rbrakk> \<Longrightarrow> R a c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1911
    apply (rule connected_induction_simple [OF \<open>connected S\<close>], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1912
    by (meson local.sym local.trans opI openin_imp_subset subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1913
  then show ?thesis by (metis etc opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1914
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1915
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1916
lemma locally_constant_imp_constant:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1917
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1918
      and opI: "\<And>a. a \<in> S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1919
             \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. f x = f a)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1920
    shows "f constant_on S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1921
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1922
  have "\<And>x y. x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> f x = f y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1923
    apply (rule connected_equivalence_relation [OF \<open>connected S\<close>], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1924
    by (metis opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1925
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1926
    by (metis constant_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1927
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1928
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1929
lemma locally_constant:
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1930
  assumes "connected S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1931
  shows "locally (\<lambda>U. f constant_on U) S \<longleftrightarrow> f constant_on S" (is "?lhs = ?rhs")
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1932
proof
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1933
  assume ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1934
  then have "\<And>a. a \<in> S \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and> (\<forall>x\<in>T. f x = f a)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1935
    unfolding locally_def
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1936
    by (metis (mono_tags, hide_lams) constant_on_def constant_on_subset openin_subtopology_self)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1937
  then show ?rhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1938
    using assms
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1939
    by (simp add: locally_constant_imp_constant)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1940
next
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1941
  assume ?rhs then show ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1942
    using assms by (metis constant_on_subset locallyI openin_imp_subset order_refl)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1943
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1944
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1945
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1946
subsection\<open>Basic properties of local compactness\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1947
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1948
proposition locally_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1949
  fixes s :: "'a :: metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1950
  shows
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1951
    "locally compact s \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1952
     (\<forall>x \<in> s. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1953
                    openin (top_of_set s) u \<and> compact v)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1954
     (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1955
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1956
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1957
  then show ?rhs
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1958
    by (meson locallyE openin_subtopology_self)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1959
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1960
  assume r [rule_format]: ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1961
  have *: "\<exists>u v.
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1962
              openin (top_of_set s) u \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1963
              compact v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1964
          if "open T" "x \<in> s" "x \<in> T" for x T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1965
  proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1966
    obtain u v where uv: "x \<in> u" "u \<subseteq> v" "v \<subseteq> s" "compact v" "openin (top_of_set s) u"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1967
      using r [OF \<open>x \<in> s\<close>] by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1968
    obtain e where "e>0" and e: "cball x e \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1969
      using open_contains_cball \<open>open T\<close> \<open>x \<in> T\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1970
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1971
      apply (rule_tac x="(s \<inter> ball x e) \<inter> u" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1972
      apply (rule_tac x="cball x e \<inter> v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1973
      using that \<open>e > 0\<close> e uv
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1974
      apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1975
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1976
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1977
  show ?lhs
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1978
    by (rule locallyI) (metis "*" Int_iff openin_open)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1979
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1980
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1981
lemma locally_compactE:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1982
  fixes S :: "'a :: metric_space set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1983
  assumes "locally compact S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1984
  obtains u v where "\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1985
                             openin (top_of_set S) (u x) \<and> compact (v x)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1986
  using assms unfolding locally_compact by metis
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1987
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1988
lemma locally_compact_alt:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1989
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  1990
  shows "locally compact S \<longleftrightarrow>
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1991
         (\<forall>x \<in> S. \<exists>U. x \<in> U \<and>
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1992
                    openin (top_of_set S) U \<and> compact(closure U) \<and> closure U \<subseteq> S)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1993
        (is "?lhs = ?rhs")
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1994
proof
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1995
  assume ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1996
  then show ?rhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1997
    by (meson bounded_subset closure_minimal compact_closure compact_imp_bounded 
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1998
              compact_imp_closed dual_order.trans locally_compactE)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  1999
next
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2000
  assume ?rhs then show ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2001
    by (meson closure_subset locally_compact)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2002
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2003
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2004
lemma locally_compact_Int_cball:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2005
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2006
  shows "locally compact S \<longleftrightarrow> (\<forall>x \<in> S. \<exists>e. 0 < e \<and> closed(cball x e \<inter> S))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2007
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2008
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2009
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2010
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2011
    apply (simp add: locally_compact openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2012
    apply (clarify | assumption | drule bspec)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2013
    by (metis (no_types, lifting)  compact_cball compact_imp_closed compact_Int inf.absorb_iff2 inf.orderE inf_sup_aci(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2014
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2015
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2016
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2017
    apply (simp add: locally_compact openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2018
    apply (clarify | assumption | drule bspec)+
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2019
    apply (rule_tac x="ball x e \<inter> S" in exI, simp)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2020
    apply (rule_tac x="cball x e \<inter> S" in exI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2021
    using compact_eq_bounded_closed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2022
    apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2023
    apply (metis open_ball le_infI1 mem_ball open_contains_cball_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2024
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2025
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2026
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2027
lemma locally_compact_compact:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2028
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2029
  shows "locally compact S \<longleftrightarrow>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2030
         (\<forall>k. k \<subseteq> S \<and> compact k
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2031
              \<longrightarrow> (\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2032
                         openin (top_of_set S) u \<and> compact v))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2033
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2034
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2035
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2036
  then obtain u v where
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2037
    uv: "\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and>
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2038
                             openin (top_of_set S) (u x) \<and> compact (v x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2039
    by (metis locally_compactE)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2040
  have *: "\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2041
          if "k \<subseteq> S" "compact k" for k
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2042
  proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2043
    have "\<And>C. (\<forall>c\<in>C. openin (top_of_set k) c) \<and> k \<subseteq> \<Union>C \<Longrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2044
                    \<exists>D\<subseteq>C. finite D \<and> k \<subseteq> \<Union>D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2045
      using that by (simp add: compact_eq_openin_cover)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2046
    moreover have "\<forall>c \<in> (\<lambda>x. k \<inter> u x) ` k. openin (top_of_set k) c"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2047
      using that by clarify (metis subsetD inf.absorb_iff2 openin_subset openin_subtopology_Int_subset topspace_euclidean_subtopology uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2048
    moreover have "k \<subseteq> \<Union>((\<lambda>x. k \<inter> u x) ` k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2049
      using that by clarsimp (meson subsetCE uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2050
    ultimately obtain D where "D \<subseteq> (\<lambda>x. k \<inter> u x) ` k" "finite D" "k \<subseteq> \<Union>D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2051
      by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2052
    then obtain T where T: "T \<subseteq> k" "finite T" "k \<subseteq> \<Union>((\<lambda>x. k \<inter> u x) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2053
      by (metis finite_subset_image)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2054
    have Tuv: "\<Union>(u ` T) \<subseteq> \<Union>(v ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2055
      using T that by (force simp: dest!: uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2056
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2057
      apply (rule_tac x="\<Union>(u ` T)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2058
      apply (rule_tac x="\<Union>(v ` T)" in exI)
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2059
      using T that apply (auto simp: Tuv dest!: uv)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2060
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2061
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2062
  show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2063
    by (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2064
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2065
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2066
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2067
    apply (clarsimp simp add: locally_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2068
    apply (drule_tac x="{x}" in spec, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2069
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2070
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2071
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2072
lemma open_imp_locally_compact:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2073
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2074
  assumes "open S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2075
    shows "locally compact S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2076
proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2077
  have *: "\<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2078
          if "x \<in> S" for x
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2079
  proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2080
    obtain e where "e>0" and e: "cball x e \<subseteq> S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2081
      using open_contains_cball assms \<open>x \<in> S\<close> by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2082
    have ope: "openin (top_of_set S) (ball x e)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2083
      by (meson e open_ball ball_subset_cball dual_order.trans open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2084
    show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2085
    proof (intro exI conjI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2086
      let ?U = "ball x e"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2087
      let ?V = "cball x e"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2088
      show "x \<in> ?U" "?U \<subseteq> ?V" "?V \<subseteq> S" "compact ?V"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2089
        using \<open>e > 0\<close> e by auto
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2090
      show "openin (top_of_set S) ?U"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2091
        using ope by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2092
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2093
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2094
  show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2095
    unfolding locally_compact by (blast intro: *)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2096
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2097
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2098
lemma closed_imp_locally_compact:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2099
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2100
  assumes "closed S"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2101
    shows "locally compact S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2102
proof -
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2103
  have *: "\<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2104
          if "x \<in> S" for x
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2105
    apply (rule_tac x = "S \<inter> ball x 1" in exI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2106
    apply (rule_tac x = "S \<inter> cball x 1" in exI)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2107
    using \<open>x \<in> S\<close> assms apply auto
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2108
    done
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2109
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2110
    unfolding locally_compact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2111
    by (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2112
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2113
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2114
lemma locally_compact_UNIV: "locally compact (UNIV :: 'a :: heine_borel set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2115
  by (simp add: closed_imp_locally_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2116
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2117
lemma locally_compact_Int:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2118
  fixes S :: "'a :: t2_space set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2119
  shows "\<lbrakk>locally compact S; locally compact t\<rbrakk> \<Longrightarrow> locally compact (S \<inter> t)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2120
by (simp add: compact_Int locally_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2121
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2122
lemma locally_compact_closedin:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2123
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2124
  shows "\<lbrakk>closedin (top_of_set S) t; locally compact S\<rbrakk>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2125
        \<Longrightarrow> locally compact t"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2126
  unfolding closedin_closed
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2127
  using closed_imp_locally_compact locally_compact_Int by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2128
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2129
lemma locally_compact_delete:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2130
     fixes S :: "'a :: t1_space set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2131
     shows "locally compact S \<Longrightarrow> locally compact (S - {a})"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2132
  by (auto simp: openin_delete locally_open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2133
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2134
lemma locally_closed:
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2135
  fixes S :: "'a :: heine_borel set"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2136
  shows "locally closed S \<longleftrightarrow> locally compact S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2137
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2138
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2139
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2140
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2141
    apply (simp only: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2142
    apply (erule all_forward imp_forward asm_rl exE)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2143
    apply (rule_tac x = "u \<inter> ball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2144
    apply (rule_tac x = "v \<inter> cball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2145
    apply (force intro: openin_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2146
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2147
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2148
  assume ?rhs then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2149
    using compact_eq_bounded_closed locally_mono by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2150
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2151
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2152
lemma locally_compact_openin_Un:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2153
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2154
  assumes LCS: "locally compact S" and LCT:"locally compact T"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2155
      and opS: "openin (top_of_set (S \<union> T)) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2156
      and opT: "openin (top_of_set (S \<union> T)) T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2157
    shows "locally compact (S \<union> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2158
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2159
  have "\<exists>e>0. closed (cball x e \<inter> (S \<union> T))" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2160
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2161
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2162
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2163
    moreover obtain e2 where "e2 > 0" and e2: "cball x e2 \<inter> (S \<union> T) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2164
      by (meson \<open>x \<in> S\<close> opS openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2165
    then have "cball x e2 \<inter> (S \<union> T) = cball x e2 \<inter> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2166
      by force
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2167
    ultimately have "closed (cball x (min e1 e2) \<inter> (S \<union> T))"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2168
      by (metis (no_types, lifting) cball_min_Int closed_Int closed_cball inf_assoc inf_commute)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2169
    then show ?thesis
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2170
      by (metis \<open>0 < e1\<close> \<open>0 < e2\<close> min_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2171
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2172
  moreover have "\<exists>e>0. closed (cball x e \<inter> (S \<union> T))" if "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2173
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2174
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2175
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2176
    moreover obtain e2 where "e2 > 0" and e2: "cball x e2 \<inter> (S \<union> T) \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2177
      by (meson \<open>x \<in> T\<close> opT openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2178
    then have "cball x e2 \<inter> (S \<union> T) = cball x e2 \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2179
      by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2180
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2181
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2182
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2183
      by (metis closed_Int closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2184
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2185
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2186
    by (force simp: locally_compact_Int_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2187
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2188
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2189
lemma locally_compact_closedin_Un:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2190
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2191
  assumes LCS: "locally compact S" and LCT:"locally compact T"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2192
      and clS: "closedin (top_of_set (S \<union> T)) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2193
      and clT: "closedin (top_of_set (S \<union> T)) T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2194
    shows "locally compact (S \<union> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2195
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2196
  have "\<exists>e>0. closed (cball x e \<inter> (S \<union> T))" if "x \<in> S" "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2197
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2198
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2199
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2200
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2201
    obtain e2 where "e2 > 0" and e2: "closed (cball x e2 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2202
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2203
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2204
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2205
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int Int_Un_distrib)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2206
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2207
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2208
  moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2209
  have "\<exists>e>0. closed (cball x e \<inter> (S \<union> T))" if x: "x \<in> S" "x \<notin> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2210
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2211
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2212
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2213
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2214
    obtain e2 where "e2>0" and "cball x e2 \<inter> (S \<union> T) \<subseteq> S - T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2215
      using clT x by (fastforce simp: openin_contains_cball closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2216
    then have "closed (cball x e2 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2217
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2218
      have "{} = T - (T - cball x e2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2219
        using Diff_subset Int_Diff \<open>cball x e2 \<inter> (S \<union> T) \<subseteq> S - T\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2220
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2221
        by (simp add: Diff_Diff_Int inf_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2222
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2223
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2224
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2225
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int Int_Un_distrib)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2226
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2227
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2228
  moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2229
  have "\<exists>e>0. closed (cball x e \<inter> (S \<union> T))" if x: "x \<notin> S" "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2230
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2231
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2232
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2233
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2234
    obtain e2 where "e2>0" and "cball x e2 \<inter> (S \<union> T) \<subseteq> S \<union> T - S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2235
      using clS x by (fastforce simp: openin_contains_cball closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2236
    then have "closed (cball x e2 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2237
      by (metis Diff_disjoint Int_empty_right closed_empty inf.left_commute inf.orderE inf_sup_absorb)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2238
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2239
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2240
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int Int_Un_distrib)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2241
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2242
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2243
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2244
    by (auto simp: locally_compact_Int_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2245
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2246
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2247
lemma locally_compact_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2248
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2249
  shows "\<lbrakk>locally compact S; locally compact T\<rbrakk> \<Longrightarrow> locally compact (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2250
  by (auto simp: compact_Times locally_Times)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2251
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2252
lemma locally_compact_compact_subopen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2253
  fixes S :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2254
  shows
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2255
   "locally compact S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2256
    (\<forall>K T. K \<subseteq> S \<and> compact K \<and> open T \<and> K \<subseteq> T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2257
          \<longrightarrow> (\<exists>U V. K \<subseteq> U \<and> U \<subseteq> V \<and> U \<subseteq> T \<and> V \<subseteq> S \<and>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2258
                     openin (top_of_set S) U \<and> compact V))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2259
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2260
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2261
  assume L: ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2262
  show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2263
  proof clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2264
    fix K :: "'a set" and T :: "'a set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2265
    assume "K \<subseteq> S" and "compact K" and "open T" and "K \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2266
    obtain U V where "K \<subseteq> U" "U \<subseteq> V" "V \<subseteq> S" "compact V"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2267
                 and ope: "openin (top_of_set S) U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2268
      using L unfolding locally_compact_compact by (meson \<open>K \<subseteq> S\<close> \<open>compact K\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2269
    show "\<exists>U V. K \<subseteq> U \<and> U \<subseteq> V \<and> U \<subseteq> T \<and> V \<subseteq> S \<and>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2270
                openin (top_of_set S) U \<and> compact V"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2271
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2272
      show "K \<subseteq> U \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2273
        by (simp add: \<open>K \<subseteq> T\<close> \<open>K \<subseteq> U\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2274
      show "U \<inter> T \<subseteq> closure(U \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2275
        by (rule closure_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2276
      show "closure (U \<inter> T) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2277
        by (metis \<open>U \<subseteq> V\<close> \<open>V \<subseteq> S\<close> \<open>compact V\<close> closure_closed closure_mono compact_imp_closed inf.cobounded1 subset_trans)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2278
      show "openin (top_of_set S) (U \<inter> T)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2279
        by (simp add: \<open>open T\<close> ope openin_Int_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2280
      show "compact (closure (U \<inter> T))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2281
        by (meson Int_lower1 \<open>U \<subseteq> V\<close> \<open>compact V\<close> bounded_subset compact_closure compact_eq_bounded_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2282
    qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2283
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2284
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2285
  assume ?rhs then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2286
    unfolding locally_compact_compact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2287
    by (metis open_openin openin_topspace subtopology_superset top.extremum topspace_euclidean_subtopology)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2288
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2289
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2290
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2291
subsection\<open>Sura-Bura's results about compact components of sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2292
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2293
proposition Sura_Bura_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2294
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2295
  assumes "compact S" and C: "C \<in> components S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2296
  shows "C = \<Inter>{T. C \<subseteq> T \<and> openin (top_of_set S) T \<and>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2297
                           closedin (top_of_set S) T}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2298
         (is "C = \<Inter>?\<T>")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2299
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2300
  obtain x where x: "C = connected_component_set S x" and "x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2301
    using C by (auto simp: components_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2302
  have "C \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2303
    by (simp add: C in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2304
  have "\<Inter>?\<T> \<subseteq> connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2305
  proof (rule connected_component_maximal)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2306
    have "x \<in> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2307
      by (simp add: \<open>x \<in> S\<close> x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2308
    then show "x \<in> \<Inter>?\<T>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2309
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2310
    have clo: "closed (\<Inter>?\<T>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2311
      by (simp add: \<open>compact S\<close> closed_Inter closedin_compact_eq compact_imp_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2312
    have False
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2313
      if K1: "closedin (top_of_set (\<Inter>?\<T>)) K1" and
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2314
         K2: "closedin (top_of_set (\<Inter>?\<T>)) K2" and
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2315
         K12_Int: "K1 \<inter> K2 = {}" and K12_Un: "K1 \<union> K2 = \<Inter>?\<T>" and "K1 \<noteq> {}" "K2 \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2316
       for K1 K2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2317
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2318
      have "closed K1" "closed K2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2319
        using closedin_closed_trans clo K1 K2 by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2320
      then obtain V1 V2 where "open V1" "open V2" "K1 \<subseteq> V1" "K2 \<subseteq> V2" and V12: "V1 \<inter> V2 = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2321
        using separation_normal \<open>K1 \<inter> K2 = {}\<close> by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2322
      have SV12_ne: "(S - (V1 \<union> V2)) \<inter> (\<Inter>?\<T>) \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2323
      proof (rule compact_imp_fip)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2324
        show "compact (S - (V1 \<union> V2))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2325
          by (simp add: \<open>open V1\<close> \<open>open V2\<close> \<open>compact S\<close> compact_diff open_Un)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2326
        show clo\<T>: "closed T" if "T \<in> ?\<T>" for T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2327
          using that \<open>compact S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2328
          by (force intro: closedin_closed_trans simp add: compact_imp_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2329
        show "(S - (V1 \<union> V2)) \<inter> \<Inter>\<F> \<noteq> {}" if "finite \<F>" and \<F>: "\<F> \<subseteq> ?\<T>" for \<F>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2330
        proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2331
          assume djo: "(S - (V1 \<union> V2)) \<inter> \<Inter>\<F> = {}"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2332
          obtain D where opeD: "openin (top_of_set S) D"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2333
                   and cloD: "closedin (top_of_set S) D"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2334
                   and "C \<subseteq> D" and DV12: "D \<subseteq> V1 \<union> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2335
          proof (cases "\<F> = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2336
            case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2337
            with \<open>C \<subseteq> S\<close> djo that show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2338
              by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2339
          next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2340
            case False show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2341
            proof
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2342
              show ope: "openin (top_of_set S) (\<Inter>\<F>)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2343
                using openin_Inter \<open>finite \<F>\<close> False \<F> by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2344
              then show "closedin (top_of_set S) (\<Inter>\<F>)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2345
                by (meson clo\<T> \<F> closed_Inter closed_subset openin_imp_subset subset_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2346
              show "C \<subseteq> \<Inter>\<F>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2347
                using \<F> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2348
              show "\<Inter>\<F> \<subseteq> V1 \<union> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2349
                using ope djo openin_imp_subset by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2350
            qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2351
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2352
          have "connected C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2353
            by (simp add: x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2354
          have "closed D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2355
            using \<open>compact S\<close> cloD closedin_closed_trans compact_imp_closed by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2356
          have cloV1: "closedin (top_of_set D) (D \<inter> closure V1)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2357
            and cloV2: "closedin (top_of_set D) (D \<inter> closure V2)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2358
            by (simp_all add: closedin_closed_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2359
          moreover have "D \<inter> closure V1 = D \<inter> V1" "D \<inter> closure V2 = D \<inter> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2360
            using \<open>D \<subseteq> V1 \<union> V2\<close> \<open>open V1\<close> \<open>open V2\<close> V12
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2361
            by (auto simp add: closure_subset [THEN subsetD] closure_iff_nhds_not_empty, blast+)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2362
          ultimately have cloDV1: "closedin (top_of_set D) (D \<inter> V1)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2363
                      and cloDV2:  "closedin (top_of_set D) (D \<inter> V2)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2364
            by metis+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2365
          then obtain U1 U2 where "closed U1" "closed U2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2366
               and D1: "D \<inter> V1 = D \<inter> U1" and D2: "D \<inter> V2 = D \<inter> U2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2367
            by (auto simp: closedin_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2368
          have "D \<inter> U1 \<inter> C \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2369
          proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2370
            assume "D \<inter> U1 \<inter> C = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2371
            then have *: "C \<subseteq> D \<inter> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2372
              using D1 DV12 \<open>C \<subseteq> D\<close> by auto
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2373
            have 1: "openin (top_of_set S) (D \<inter> V2)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2374
              by (simp add: \<open>open V2\<close> opeD openin_Int_open)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2375
            have 2: "closedin (top_of_set S) (D \<inter> V2)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2376
              using cloD cloDV2 closedin_trans by blast
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2377
            have "\<Inter> ?\<T> \<subseteq> D \<inter> V2"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2378
              by (rule Inter_lower) (use * 1 2 in simp)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2379
            then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2380
              using K1 V12 \<open>K1 \<noteq> {}\<close> \<open>K1 \<subseteq> V1\<close> closedin_imp_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2381
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2382
          moreover have "D \<inter> U2 \<inter> C \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2383
          proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2384
            assume "D \<inter> U2 \<inter> C = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2385
            then have *: "C \<subseteq> D \<inter> V1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2386
              using D2 DV12 \<open>C \<subseteq> D\<close> by auto
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2387
            have 1: "openin (top_of_set S) (D \<inter> V1)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2388
              by (simp add: \<open>open V1\<close> opeD openin_Int_open)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2389
            have 2: "closedin (top_of_set S) (D \<inter> V1)"
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2390
              using cloD cloDV1 closedin_trans by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2391
            have "\<Inter>?\<T> \<subseteq> D \<inter> V1"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2392
              by (rule Inter_lower) (use * 1 2 in simp)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2393
            then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2394
              using K2 V12 \<open>K2 \<noteq> {}\<close> \<open>K2 \<subseteq> V2\<close> closedin_imp_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2395
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2396
          ultimately show False
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2397
            using \<open>connected C\<close> [unfolded connected_closed, simplified, rule_format, of concl: "D \<inter> U1" "D \<inter> U2"]
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2398
            using \<open>C \<subseteq> D\<close> D1 D2 V12 DV12 \<open>closed U1\<close> \<open>closed U2\<close> \<open>closed D\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2399
            by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2400
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2401
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2402
      show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2403
        by (metis (full_types) DiffE UnE Un_upper2 SV12_ne \<open>K1 \<subseteq> V1\<close> \<open>K2 \<subseteq> V2\<close> disjoint_iff_not_equal subsetCE sup_ge1 K12_Un)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2404
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2405
    then show "connected (\<Inter>?\<T>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2406
      by (auto simp: connected_closedin_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2407
    show "\<Inter>?\<T> \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2408
      by (fastforce simp: C in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2409
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2410
  with x show "\<Inter>?\<T> \<subseteq> C" by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2411
qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2412
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2413
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2414
corollary Sura_Bura_clopen_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2415
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2416
  assumes S: "locally compact S" and C: "C \<in> components S" and "compact C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2417
      and U: "open U" "C \<subseteq> U"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2418
  obtains K where "openin (top_of_set S) K" "compact K" "C \<subseteq> K" "K \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2419
proof (rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2420
  assume "\<not> thesis"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2421
  with that have neg: "\<nexists>K. openin (top_of_set S) K \<and> compact K \<and> C \<subseteq> K \<and> K \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2422
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2423
  obtain V K where "C \<subseteq> V" "V \<subseteq> U" "V \<subseteq> K" "K \<subseteq> S" "compact K"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2424
               and opeSV: "openin (top_of_set S) V"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2425
    using S U \<open>compact C\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2426
    apply (simp add: locally_compact_compact_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2427
    by (meson C in_components_subset)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2428
  let ?\<T> = "{T. C \<subseteq> T \<and> openin (top_of_set K) T \<and> compact T \<and> T \<subseteq> K}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2429
  have CK: "C \<in> components K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2430
    by (meson C \<open>C \<subseteq> V\<close> \<open>K \<subseteq> S\<close> \<open>V \<subseteq> K\<close> components_intermediate_subset subset_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2431
  with \<open>compact K\<close>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2432
  have "C = \<Inter>{T. C \<subseteq> T \<and> openin (top_of_set K) T \<and> closedin (top_of_set K) T}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2433
    by (simp add: Sura_Bura_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2434
  then have Ceq: "C = \<Inter>?\<T>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2435
    by (simp add: closedin_compact_eq \<open>compact K\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2436
  obtain W where "open W" and W: "V = S \<inter> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2437
    using opeSV by (auto simp: openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2438
  have "-(U \<inter> W) \<inter> \<Inter>?\<T> \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2439
  proof (rule closed_imp_fip_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2440
    show "- (U \<inter> W) \<inter> \<Inter>\<F> \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2441
      if "finite \<F>" and \<F>: "\<F> \<subseteq> ?\<T>" for \<F>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2442
    proof (cases "\<F> = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2443
      case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2444
      have False if "U = UNIV" "W = UNIV"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2445
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2446
        have "V = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2447
          by (simp add: W \<open>W = UNIV\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2448
        with neg show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2449
          using \<open>C \<subseteq> V\<close> \<open>K \<subseteq> S\<close> \<open>V \<subseteq> K\<close> \<open>V \<subseteq> U\<close> \<open>compact K\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2450
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2451
      with True show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2452
        by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2453
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2454
      case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2455
      show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2456
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2457
        assume "- (U \<inter> W) \<inter> \<Inter>\<F> = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2458
        then have FUW: "\<Inter>\<F> \<subseteq> U \<inter> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2459
          by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2460
        have "C \<subseteq> \<Inter>\<F>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2461
          using \<F> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2462
        moreover have "compact (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2463
          by (metis (no_types, lifting) compact_Inter False mem_Collect_eq subsetCE \<F>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2464
        moreover have "\<Inter>\<F> \<subseteq> K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2465
          using False that(2) by fastforce
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2466
        moreover have opeKF: "openin (top_of_set K) (\<Inter>\<F>)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2467
          using False \<F> \<open>finite \<F>\<close> by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2468
        then have opeVF: "openin (top_of_set V) (\<Inter>\<F>)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2469
          using W \<open>K \<subseteq> S\<close> \<open>V \<subseteq> K\<close> opeKF \<open>\<Inter>\<F> \<subseteq> K\<close> FUW openin_subset_trans by fastforce
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2470
        then have "openin (top_of_set S) (\<Inter>\<F>)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2471
          by (metis opeSV openin_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2472
        moreover have "\<Inter>\<F> \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2473
          by (meson \<open>V \<subseteq> U\<close> opeVF dual_order.trans openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2474
        ultimately show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2475
          using neg by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2476
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2477
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2478
  qed (use \<open>open W\<close> \<open>open U\<close> in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2479
  with W Ceq \<open>C \<subseteq> V\<close> \<open>C \<subseteq> U\<close> show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2480
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2481
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2482
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2483
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2484
corollary Sura_Bura_clopen_subset_alt:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2485
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2486
  assumes S: "locally compact S" and C: "C \<in> components S" and "compact C"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2487
      and opeSU: "openin (top_of_set S) U" and "C \<subseteq> U"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2488
  obtains K where "openin (top_of_set S) K" "compact K" "C \<subseteq> K" "K \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2489
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2490
  obtain V where "open V" "U = S \<inter> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2491
    using opeSU by (auto simp: openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2492
  with \<open>C \<subseteq> U\<close> have "C \<subseteq> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2493
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2494
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2495
    using Sura_Bura_clopen_subset [OF S C \<open>compact C\<close> \<open>open V\<close>]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2496
    by (metis \<open>U = S \<inter> V\<close> inf.bounded_iff openin_imp_subset that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2497
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2498
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2499
corollary Sura_Bura:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2500
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2501
  assumes "locally compact S" "C \<in> components S" "compact C"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2502
  shows "C = \<Inter> {K. C \<subseteq> K \<and> compact K \<and> openin (top_of_set S) K}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2503
         (is "C = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2504
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2505
  show "?rhs \<subseteq> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2506
  proof (clarsimp, rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2507
    fix x
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2508
    assume *: "\<forall>X. C \<subseteq> X \<and> compact X \<and> openin (top_of_set S) X \<longrightarrow> x \<in> X"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2509
      and "x \<notin> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2510
    obtain U V where "open U" "open V" "{x} \<subseteq> U" "C \<subseteq> V" "U \<inter> V = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2511
      using separation_normal [of "{x}" C]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2512
      by (metis Int_empty_left \<open>x \<notin> C\<close> \<open>compact C\<close> closed_empty closed_insert compact_imp_closed insert_disjoint(1))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2513
    have "x \<notin> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2514
      using \<open>U \<inter> V = {}\<close> \<open>{x} \<subseteq> U\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2515
    then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2516
      by (meson "*" Sura_Bura_clopen_subset \<open>C \<subseteq> V\<close> \<open>open V\<close> assms(1) assms(2) assms(3) subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2517
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2518
qed blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2519
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2520
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2521
subsection\<open>Special cases of local connectedness and path connectedness\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2522
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2523
lemma locally_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2524
  assumes
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2525
    "\<And>v x. \<lbrakk>openin (top_of_set S) v; x \<in> v\<rbrakk>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2526
              \<Longrightarrow> \<exists>u. openin (top_of_set S) u \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2527
                      connected u \<and> x \<in> u \<and> u \<subseteq> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2528
   shows "locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2529
apply (clarsimp simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2530
apply (drule assms; blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2531
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2532
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2533
lemma locally_connected_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2534
  assumes "locally connected S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2535
          "openin (top_of_set S) t"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2536
          "x \<in> t"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2537
   shows "openin (top_of_set S) (connected_component_set t x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2538
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2539
  { fix y :: 'a
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2540
    let ?SS = "top_of_set S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2541
    assume 1: "openin ?SS t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2542
              "\<forall>w x. openin ?SS w \<and> x \<in> w \<longrightarrow> (\<exists>u. openin ?SS u \<and> (\<exists>v. connected v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2543
    and "connected_component t x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2544
    then have "y \<in> t" and y: "y \<in> connected_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2545
      using connected_component_subset by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2546
    obtain F where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2547
      "\<forall>x y. (\<exists>w. openin ?SS w \<and> (\<exists>u. connected u \<and> x \<in> w \<and> w \<subseteq> u \<and> u \<subseteq> y)) = (openin ?SS (F x y) \<and> (\<exists>u. connected u \<and> x \<in> F x y \<and> F x y \<subseteq> u \<and> u \<subseteq> y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2548
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2549
    then obtain G where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2550
       "\<forall>a A. (\<exists>U. openin ?SS U \<and> (\<exists>V. connected V \<and> a \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> A)) = (openin ?SS (F a A) \<and> connected (G a A) \<and> a \<in> F a A \<and> F a A \<subseteq> G a A \<and> G a A \<subseteq> A)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2551
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2552
    then have *: "openin ?SS (F y t) \<and> connected (G y t) \<and> y \<in> F y t \<and> F y t \<subseteq> G y t \<and> G y t \<subseteq> t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2553
      using 1 \<open>y \<in> t\<close> by presburger
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2554
    have "G y t \<subseteq> connected_component_set t y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2555
      by (metis (no_types) * connected_component_eq_self connected_component_mono contra_subsetD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2556
    then have "\<exists>A. openin ?SS A \<and> y \<in> A \<and> A \<subseteq> connected_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2557
      by (metis (no_types) * connected_component_eq dual_order.trans y)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2558
  }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2559
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2560
    using assms openin_subopen by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2561
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2562
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2563
lemma locally_connected_3:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2564
  assumes "\<And>t x. \<lbrakk>openin (top_of_set S) t; x \<in> t\<rbrakk>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2565
              \<Longrightarrow> openin (top_of_set S)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2566
                          (connected_component_set t x)"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2567
          "openin (top_of_set S) v" "x \<in> v"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2568
   shows  "\<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2569
using assms connected_component_subset by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2570
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2571
lemma locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2572
  "locally connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2573
   (\<forall>v x. openin (top_of_set S) v \<and> x \<in> v
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2574
          \<longrightarrow> (\<exists>u. openin (top_of_set S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2575
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2576
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2577
lemma locally_connected_open_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2578
  "locally connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2579
   (\<forall>t x. openin (top_of_set S) t \<and> x \<in> t
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2580
          \<longrightarrow> openin (top_of_set S) (connected_component_set t x))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2581
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2582
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2583
lemma locally_path_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2584
  assumes
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2585
    "\<And>v x. \<lbrakk>openin (top_of_set S) v; x \<in> v\<rbrakk>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2586
              \<Longrightarrow> \<exists>u. openin (top_of_set S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2587
   shows "locally path_connected S"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  2588
  by (force simp add: locally_def dest: assms)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2589
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2590
lemma locally_path_connected_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2591
  assumes "locally path_connected S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2592
          "openin (top_of_set S) t"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2593
          "x \<in> t"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2594
   shows "openin (top_of_set S) (path_component_set t x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2595
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2596
  { fix y :: 'a
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2597
    let ?SS = "top_of_set S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2598
    assume 1: "openin ?SS t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2599
              "\<forall>w x. openin ?SS w \<and> x \<in> w \<longrightarrow> (\<exists>u. openin ?SS u \<and> (\<exists>v. path_connected v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2600
    and "path_component t x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2601
    then have "y \<in> t" and y: "y \<in> path_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2602
      using path_component_mem(2) by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2603
    obtain F where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2604
      "\<forall>x y. (\<exists>w. openin ?SS w \<and> (\<exists>u. path_connected u \<and> x \<in> w \<and> w \<subseteq> u \<and> u \<subseteq> y)) = (openin ?SS (F x y) \<and> (\<exists>u. path_connected u \<and> x \<in> F x y \<and> F x y \<subseteq> u \<and> u \<subseteq> y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2605
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2606
    then obtain G where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2607
       "\<forall>a A. (\<exists>U. openin ?SS U \<and> (\<exists>V. path_connected V \<and> a \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> A)) = (openin ?SS (F a A) \<and> path_connected (G a A) \<and> a \<in> F a A \<and> F a A \<subseteq> G a A \<and> G a A \<subseteq> A)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2608
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2609
    then have *: "openin ?SS (F y t) \<and> path_connected (G y t) \<and> y \<in> F y t \<and> F y t \<subseteq> G y t \<and> G y t \<subseteq> t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2610
      using 1 \<open>y \<in> t\<close> by presburger
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2611
    have "G y t \<subseteq> path_component_set t y"
69712
dc85b5b3a532 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 69620
diff changeset
  2612
      using * path_component_maximal rev_subsetD by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2613
    then have "\<exists>A. openin ?SS A \<and> y \<in> A \<and> A \<subseteq> path_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2614
      by (metis "*" \<open>G y t \<subseteq> path_component_set t y\<close> dual_order.trans path_component_eq y)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2615
  }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2616
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2617
    using assms openin_subopen by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2618
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2619
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2620
lemma locally_path_connected_3:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2621
  assumes "\<And>t x. \<lbrakk>openin (top_of_set S) t; x \<in> t\<rbrakk>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2622
              \<Longrightarrow> openin (top_of_set S) (path_component_set t x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2623
          "openin (top_of_set S) v" "x \<in> v"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2624
   shows  "\<exists>u. openin (top_of_set S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2625
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2626
  have "path_component v x x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2627
    by (meson assms(3) path_component_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2628
  then show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  2629
    by (metis assms mem_Collect_eq path_component_subset path_connected_path_component)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2630
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2631
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2632
proposition locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2633
  "locally path_connected S \<longleftrightarrow>
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2634
   (\<forall>V x. openin (top_of_set S) V \<and> x \<in> V
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2635
          \<longrightarrow> (\<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2636
  by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2637
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2638
proposition locally_path_connected_open_path_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2639
  "locally path_connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2640
   (\<forall>t x. openin (top_of_set S) t \<and> x \<in> t
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2641
          \<longrightarrow> openin (top_of_set S) (path_component_set t x))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2642
  by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2643
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2644
lemma locally_connected_open_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2645
  "locally connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2646
   (\<forall>t c. openin (top_of_set S) t \<and> c \<in> components t
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2647
          \<longrightarrow> openin (top_of_set S) c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2648
by (metis components_iff locally_connected_open_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2649
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2650
proposition locally_connected_im_kleinen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2651
  "locally connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2652
   (\<forall>v x. openin (top_of_set S) v \<and> x \<in> v
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2653
       \<longrightarrow> (\<exists>u. openin (top_of_set S) u \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2654
                x \<in> u \<and> u \<subseteq> v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2655
                (\<forall>y. y \<in> u \<longrightarrow> (\<exists>c. connected c \<and> c \<subseteq> v \<and> x \<in> c \<and> y \<in> c))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2656
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2657
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2658
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2659
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2660
    by (fastforce simp add: locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2661
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2662
  assume ?rhs
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2663
  have *: "\<exists>T. openin (top_of_set S) T \<and> x \<in> T \<and> T \<subseteq> c"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2664
       if "openin (top_of_set S) t" and c: "c \<in> components t" and "x \<in> c" for t c x
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2665
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2666
    from that \<open>?rhs\<close> [rule_format, of t x]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2667
    obtain u where u:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2668
      "openin (top_of_set S) u \<and> x \<in> u \<and> u \<subseteq> t \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2669
       (\<forall>y. y \<in> u \<longrightarrow> (\<exists>c. connected c \<and> c \<subseteq> t \<and> x \<in> c \<and> y \<in> c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2670
      using in_components_subset by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2671
    obtain F :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2672
      "\<forall>x y. (\<exists>z. z \<in> x \<and> y = connected_component_set x z) = (F x y \<in> x \<and> y = connected_component_set x (F x y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2673
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2674
    then have F: "F t c \<in> t \<and> c = connected_component_set t (F t c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2675
      by (meson components_iff c)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2676
    obtain G :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2677
        G: "\<forall>x y. (\<exists>z. z \<in> y \<and> z \<notin> x) = (G x y \<in> y \<and> G x y \<notin> x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2678
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2679
     have "G c u \<notin> u \<or> G c u \<in> c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2680
      using F by (metis (full_types) u connected_componentI connected_component_eq mem_Collect_eq that(3))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2681
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2682
      using G u by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2683
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2684
  show ?lhs
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2685
    unfolding locally_connected_open_component by (meson "*" openin_subopen)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2686
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2687
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2688
proposition locally_path_connected_im_kleinen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2689
  "locally path_connected S \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2690
   (\<forall>v x. openin (top_of_set S) v \<and> x \<in> v
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2691
       \<longrightarrow> (\<exists>u. openin (top_of_set S) u \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2692
                x \<in> u \<and> u \<subseteq> v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2693
                (\<forall>y. y \<in> u \<longrightarrow> (\<exists>p. path p \<and> path_image p \<subseteq> v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2694
                                pathstart p = x \<and> pathfinish p = y))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2695
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2696
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2697
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2698
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2699
    apply (simp add: locally_path_connected path_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2700
    apply (erule all_forward ex_forward imp_forward conjE | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2701
    by (meson dual_order.trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2702
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2703
  assume ?rhs
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2704
  have *: "\<exists>T. openin (top_of_set S) T \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2705
               x \<in> T \<and> T \<subseteq> path_component_set u z"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2706
       if "openin (top_of_set S) u" and "z \<in> u" and c: "path_component u z x" for u z x
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2707
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2708
    have "x \<in> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2709
      by (meson c path_component_mem(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2710
    with that \<open>?rhs\<close> [rule_format, of u x]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2711
    obtain U where U:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2712
      "openin (top_of_set S) U \<and> x \<in> U \<and> U \<subseteq> u \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2713
       (\<forall>y. y \<in> U \<longrightarrow> (\<exists>p. path p \<and> path_image p \<subseteq> u \<and> pathstart p = x \<and> pathfinish p = y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2714
       by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2715
    show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2716
      by (metis U c mem_Collect_eq path_component_def path_component_eq subsetI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2717
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2718
  show ?lhs
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2719
    unfolding locally_path_connected_open_path_component
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2720
    using "*" openin_subopen by fastforce
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2721
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2722
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2723
lemma locally_path_connected_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2724
  "locally path_connected S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2725
using locally_mono path_connected_imp_connected by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2726
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2727
lemma locally_connected_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2728
  "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally connected c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2729
by (meson locally_connected_open_component locally_open_subset openin_subtopology_self)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2730
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2731
lemma locally_path_connected_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2732
  "\<lbrakk>locally path_connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally path_connected c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2733
by (meson locally_connected_open_component locally_open_subset locally_path_connected_imp_locally_connected openin_subtopology_self)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2734
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2735
lemma locally_path_connected_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2736
  "locally path_connected S \<Longrightarrow> locally path_connected (connected_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2737
by (metis components_iff connected_component_eq_empty locally_empty locally_path_connected_components)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2738
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2739
lemma open_imp_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2740
  fixes S :: "'a :: real_normed_vector set"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2741
  assumes "open S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2742
  shows "locally path_connected S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2743
proof (rule locally_mono)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2744
  show "locally convex S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2745
    using assms unfolding locally_def
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2746
    by (meson open_ball centre_in_ball convex_ball openE open_subset openin_imp_subset openin_open_trans subset_trans)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2747
  show "\<And>T::'a set. convex T \<Longrightarrow> path_connected T"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2748
    using convex_imp_path_connected by blast
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2749
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2750
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2751
lemma open_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2752
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2753
  shows "open S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2754
by (simp add: locally_path_connected_imp_locally_connected open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2755
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2756
lemma locally_path_connected_UNIV: "locally path_connected (UNIV::'a :: real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2757
  by (simp add: open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2758
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2759
lemma locally_connected_UNIV: "locally connected (UNIV::'a :: real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2760
  by (simp add: open_imp_locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2761
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2762
lemma openin_connected_component_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2763
    "locally connected S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2764
     \<Longrightarrow> openin (top_of_set S) (connected_component_set S x)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2765
  by (metis connected_component_eq_empty locally_connected_2 openin_empty openin_subtopology_self)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2766
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2767
lemma openin_components_locally_connected:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2768
    "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (top_of_set S) c"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2769
  using locally_connected_open_component openin_subtopology_self by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2770
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2771
lemma openin_path_component_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2772
  "locally path_connected S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2773
        \<Longrightarrow> openin (top_of_set S) (path_component_set S x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2774
by (metis (no_types) empty_iff locally_path_connected_2 openin_subopen openin_subtopology_self path_component_eq_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2775
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2776
lemma closedin_path_component_locally_path_connected:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2777
  assumes "locally path_connected S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2778
  shows "closedin (top_of_set S) (path_component_set S x)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2779
proof -
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2780
  have "openin (top_of_set S) (\<Union> ({path_component_set S y |y. y \<in> S} - {path_component_set S x}))"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2781
    using locally_path_connected_2 assms by fastforce
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2782
  then show ?thesis
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2783
    by  (simp add: closedin_def path_component_subset complement_path_component_Union)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2784
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2785
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2786
lemma convex_imp_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2787
  fixes S :: "'a:: real_normed_vector set"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2788
  assumes "convex S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2789
  shows "locally path_connected S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2790
proof (clarsimp simp add: locally_path_connected)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2791
  fix V x
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2792
  assume "openin (top_of_set S) V" and "x \<in> V"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2793
  then obtain T e where  "V = S \<inter> T" "x \<in> S" "0 < e" "ball x e \<subseteq> T"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2794
    by (metis Int_iff openE openin_open)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2795
  then have "openin (top_of_set S) (S \<inter> ball x e)" "path_connected (S \<inter> ball x e)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2796
    by (simp_all add: assms convex_Int convex_imp_path_connected openin_open_Int)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2797
  then show "\<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2798
    using \<open>0 < e\<close> \<open>V = S \<inter> T\<close> \<open>ball x e \<subseteq> T\<close> \<open>x \<in> S\<close> by auto
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2799
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2800
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2801
lemma convex_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2802
  fixes S :: "'a:: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2803
  shows "convex S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2804
  by (simp add: locally_path_connected_imp_locally_connected convex_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2805
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2806
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2807
subsection\<open>Relations between components and path components\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2808
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2809
lemma path_component_eq_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2810
  assumes "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2811
    shows "(path_component S x = connected_component S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2812
proof (cases "x \<in> S")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2813
  case True
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2814
  have "openin (top_of_set (connected_component_set S x)) (path_component_set S x)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2815
  proof (rule openin_subset_trans)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2816
    show "openin (top_of_set S) (path_component_set S x)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2817
      by (simp add: True assms locally_path_connected_2)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2818
    show "connected_component_set S x \<subseteq> S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2819
      by (simp add: connected_component_subset)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2820
  qed (simp add: path_component_subset_connected_component)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2821
  moreover have "closedin (top_of_set (connected_component_set S x)) (path_component_set S x)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2822
    proof (rule closedin_subset_trans [of S])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2823
  show "closedin (top_of_set S) (path_component_set S x)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2824
    by (simp add: assms closedin_path_component_locally_path_connected)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2825
  show "connected_component_set S x \<subseteq> S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2826
    by (simp add: connected_component_subset)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2827
  qed (simp add: path_component_subset_connected_component)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2828
  ultimately have *: "path_component_set S x = connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2829
    by (metis connected_connected_component connected_clopen True path_component_eq_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2830
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2831
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2832
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2833
  case False then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2834
    by (metis Collect_empty_eq_bot connected_component_eq_empty path_component_eq_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2835
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2836
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2837
lemma path_component_eq_connected_component_set:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2838
     "locally path_connected S \<Longrightarrow> (path_component_set S x = connected_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2839
by (simp add: path_component_eq_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2840
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2841
lemma locally_path_connected_path_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2842
     "locally path_connected S \<Longrightarrow> locally path_connected (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2843
using locally_path_connected_connected_component path_component_eq_connected_component by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2844
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2845
lemma open_path_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2846
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2847
  shows "open S \<Longrightarrow> path_component S x = connected_component S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2848
by (simp add: path_component_eq_connected_component open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2849
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2850
lemma open_path_connected_component_set:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2851
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2852
  shows "open S \<Longrightarrow> path_component_set S x = connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2853
by (simp add: open_path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2854
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2855
proposition locally_connected_quotient_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2856
  assumes lcS: "locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2857
      and oo: "\<And>T. T \<subseteq> f ` S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2858
                \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T) \<longleftrightarrow>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2859
                    openin (top_of_set (f ` S)) T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2860
    shows "locally connected (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2861
proof (clarsimp simp: locally_connected_open_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2862
  fix U C
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2863
  assume opefSU: "openin (top_of_set (f ` S)) U" and "C \<in> components U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2864
  then have "C \<subseteq> U" "U \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2865
    by (meson in_components_subset openin_imp_subset)+
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2866
  then have "openin (top_of_set (f ` S)) C \<longleftrightarrow>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2867
             openin (top_of_set S) (S \<inter> f -` C)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2868
    by (auto simp: oo)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2869
  moreover have "openin (top_of_set S) (S \<inter> f -` C)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2870
  proof (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2871
    fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2872
    assume "x \<in> S" "f x \<in> C"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2873
    show "\<exists>T. openin (top_of_set S) T \<and> x \<in> T \<and> T \<subseteq> (S \<inter> f -` C)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2874
    proof (intro conjI exI)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2875
      show "openin (top_of_set S) (connected_component_set (S \<inter> f -` U) x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2876
      proof (rule ccontr)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2877
        assume **: "\<not> openin (top_of_set S) (connected_component_set (S \<inter> f -` U) x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2878
        then have "x \<notin> (S \<inter> f -` U)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2879
          using \<open>U \<subseteq> f ` S\<close> opefSU lcS locally_connected_2 oo by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2880
        with ** show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2881
          by (metis (no_types) connected_component_eq_empty empty_iff openin_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2882
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2883
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2884
      show "x \<in> connected_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2885
        using \<open>C \<subseteq> U\<close> \<open>f x \<in> C\<close> \<open>x \<in> S\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2886
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2887
      have contf: "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2888
        by (simp add: continuous_on_open oo openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2889
      then have "continuous_on (connected_component_set (S \<inter> f -` U) x) f"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2890
        by (meson connected_component_subset continuous_on_subset inf.boundedE)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2891
      then have "connected (f ` connected_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2892
        by (rule connected_continuous_image [OF _ connected_connected_component])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2893
      moreover have "f ` connected_component_set (S \<inter> f -` U) x \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2894
        using connected_component_in by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2895
      moreover have "C \<inter> f ` connected_component_set (S \<inter> f -` U) x \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2896
        using \<open>C \<subseteq> U\<close> \<open>f x \<in> C\<close> \<open>x \<in> S\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2897
      ultimately have fC: "f ` (connected_component_set (S \<inter> f -` U) x) \<subseteq> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2898
        by (rule components_maximal [OF \<open>C \<in> components U\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2899
      have cUC: "connected_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2900
        using connected_component_subset fC by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2901
      have "connected_component_set (S \<inter> f -` U) x \<subseteq> connected_component_set (S \<inter> f -` C) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2902
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2903
        { assume "x \<in> connected_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2904
          then have ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2905
            using cUC connected_component_idemp connected_component_mono by blast }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2906
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2907
          using connected_component_eq_empty by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2908
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2909
      also have "\<dots> \<subseteq> (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2910
        by (rule connected_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2911
      finally show "connected_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` C)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2912
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2913
  qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2914
  ultimately show "openin (top_of_set (f ` S)) C"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2915
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2916
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2917
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2918
text\<open>The proof resembles that above but is not identical!\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2919
proposition locally_path_connected_quotient_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2920
  assumes lcS: "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2921
      and oo: "\<And>T. T \<subseteq> f ` S
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2922
                \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T) \<longleftrightarrow> openin (top_of_set (f ` S)) T"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2923
    shows "locally path_connected (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2924
proof (clarsimp simp: locally_path_connected_open_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2925
  fix U y
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2926
  assume opefSU: "openin (top_of_set (f ` S)) U" and "y \<in> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2927
  then have "path_component_set U y \<subseteq> U" "U \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2928
    by (meson path_component_subset openin_imp_subset)+
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2929
  then have "openin (top_of_set (f ` S)) (path_component_set U y) \<longleftrightarrow>
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2930
             openin (top_of_set S) (S \<inter> f -` path_component_set U y)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2931
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2932
    have "path_component_set U y \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2933
      using \<open>U \<subseteq> f ` S\<close> \<open>path_component_set U y \<subseteq> U\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2934
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2935
      using oo by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2936
  qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2937
  moreover have "openin (top_of_set S) (S \<inter> f -` path_component_set U y)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2938
  proof (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2939
    fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2940
    assume "x \<in> S" and Uyfx: "path_component U y (f x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2941
    then have "f x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2942
      using path_component_mem by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2943
    show "\<exists>T. openin (top_of_set S) T \<and> x \<in> T \<and> T \<subseteq> (S \<inter> f -` path_component_set U y)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2944
    proof (intro conjI exI)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2945
      show "openin (top_of_set S) (path_component_set (S \<inter> f -` U) x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2946
      proof (rule ccontr)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2947
        assume **: "\<not> openin (top_of_set S) (path_component_set (S \<inter> f -` U) x)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2948
        then have "x \<notin> (S \<inter> f -` U)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2949
          by (metis (no_types, lifting) \<open>U \<subseteq> f ` S\<close> opefSU lcS oo locally_path_connected_open_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2950
        then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2951
          using ** \<open>path_component_set U y \<subseteq> U\<close>  \<open>x \<in> S\<close> \<open>path_component U y (f x)\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2952
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2953
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2954
      show "x \<in> path_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2955
        by (simp add: \<open>f x \<in> U\<close> \<open>x \<in> S\<close> path_component_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2956
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2957
      have contf: "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2958
        by (simp add: continuous_on_open oo openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2959
      then have "continuous_on (path_component_set (S \<inter> f -` U) x) f"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2960
        by (meson Int_lower1 continuous_on_subset path_component_subset)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2961
      then have "path_connected (f ` path_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2962
        by (simp add: path_connected_continuous_image)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2963
      moreover have "f ` path_component_set (S \<inter> f -` U) x \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2964
        using path_component_mem by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2965
      moreover have "f x \<in> f ` path_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2966
        by (force simp: \<open>x \<in> S\<close> \<open>f x \<in> U\<close> path_component_refl_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2967
      ultimately have "f ` (path_component_set (S \<inter> f -` U) x) \<subseteq> path_component_set U (f x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2968
        by (meson path_component_maximal)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2969
       also have  "\<dots> \<subseteq> path_component_set U y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2970
        by (simp add: Uyfx path_component_maximal path_component_subset path_component_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2971
      finally have fC: "f ` (path_component_set (S \<inter> f -` U) x) \<subseteq> path_component_set U y" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2972
      have cUC: "path_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2973
        using path_component_subset fC by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2974
      have "path_component_set (S \<inter> f -` U) x \<subseteq> path_component_set (S \<inter> f -` path_component_set U y) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2975
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2976
        have "\<And>a. path_component_set (path_component_set (S \<inter> f -` U) x) a \<subseteq> path_component_set (S \<inter> f -` path_component_set U y) a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2977
          using cUC path_component_mono by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2978
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2979
          using path_component_path_component by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2980
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2981
      also have "\<dots> \<subseteq> (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2982
        by (rule path_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2983
      finally show "path_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` path_component_set U y)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2984
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2985
  qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2986
  ultimately show "openin (top_of_set (f ` S)) (path_component_set U y)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2987
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2988
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2989
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  2990
subsection\<^marker>\<open>tag unimportant\<close>\<open>Components, continuity, openin, closedin\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2991
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2992
lemma continuous_on_components_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2993
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2994
  assumes "\<And>C. C \<in> components S \<Longrightarrow>
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  2995
              openin (top_of_set S) C \<and> continuous_on C f"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2996
    shows "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2997
proof (clarsimp simp: continuous_openin_preimage_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2998
  fix t :: "'b set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2999
  assume "open t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3000
  have *: "S \<inter> f -` t = (\<Union>c \<in> components S. c \<inter> f -` t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3001
    by auto
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  3002
  show "openin (top_of_set S) (S \<inter> f -` t)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3003
    unfolding * using \<open>open t\<close> assms continuous_openin_preimage_gen openin_trans openin_Union by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3004
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3005
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3006
lemma continuous_on_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3007
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3008
  assumes "locally connected S " "\<And>C. C \<in> components S \<Longrightarrow> continuous_on C f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3009
  shows "continuous_on S f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3010
proof (rule continuous_on_components_gen)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3011
  fix C
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3012
  assume "C \<in> components S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3013
  then show "openin (top_of_set S) C \<and> continuous_on C f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3014
    by (simp add: assms openin_components_locally_connected)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3015
qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3016
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3017
lemma continuous_on_components_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3018
    "locally connected S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3019
     \<Longrightarrow> (continuous_on S f \<longleftrightarrow> (\<forall>c \<in> components S. continuous_on c f))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3020
by (meson continuous_on_components continuous_on_subset in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3021
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3022
lemma continuous_on_components_open:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3023
 fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3024
  assumes "open S "
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3025
          "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3026
    shows "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3027
using continuous_on_components open_imp_locally_connected assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3028
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3029
lemma continuous_on_components_open_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3030
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3031
  shows "open S \<Longrightarrow> (continuous_on S f \<longleftrightarrow> (\<forall>c \<in> components S. continuous_on c f))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3032
using continuous_on_subset in_components_subset
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3033
by (blast intro: continuous_on_components_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3034
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3035
lemma closedin_union_complement_components:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3036
  assumes U: "locally connected U"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3037
      and S: "closedin (top_of_set U) S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3038
      and cuS: "c \<subseteq> components(U - S)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3039
    shows "closedin (top_of_set U) (S \<union> \<Union>c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3040
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3041
  have di: "(\<And>S t. S \<in> c \<and> t \<in> c' \<Longrightarrow> disjnt S t) \<Longrightarrow> disjnt (\<Union> c) (\<Union> c')" for c'
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3042
    by (simp add: disjnt_def) blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3043
  have "S \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3044
    using S closedin_imp_subset by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3045
  moreover have "U - S = \<Union>c \<union> \<Union>(components (U - S) - c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3046
    by (metis Diff_partition Union_components Union_Un_distrib assms(3))
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3047
  moreover have "disjnt (\<Union>c) (\<Union>(components (U - S) - c))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3048
    apply (rule di)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3049
    by (metis DiffD1 DiffD2 assms(3) components_nonoverlap disjnt_def subsetCE)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3050
  ultimately have eq: "S \<union> \<Union>c = U - (\<Union>(components(U - S) - c))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3051
    by (auto simp: disjnt_def)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3052
  have *: "openin (top_of_set U) (\<Union>(components (U - S) - c))"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3053
  proof (rule openin_Union [OF openin_trans [of "U - S"]])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3054
    show "openin (top_of_set (U - S)) T" if "T \<in> components (U - S) - c" for T
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3055
      using that by (simp add: U S locally_diff_closed openin_components_locally_connected)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3056
    show "openin (top_of_set U) (U - S)" if "T \<in> components (U - S) - c" for T
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3057
      using that by (simp add: openin_diff S)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3058
  qed
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3059
  have "closedin (top_of_set U) (U - \<Union> (components (U - S) - c))"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3060
    by (metis closedin_diff closedin_topspace topspace_euclidean_subtopology *)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3061
  then have "openin (top_of_set U) (U - (U - \<Union>(components (U - S) - c)))"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3062
    by (simp add: openin_diff)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3063
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3064
    by (force simp: eq closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3065
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3066
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3067
lemma closed_union_complement_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3068
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3069
  assumes S: "closed S" and c: "c \<subseteq> components(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3070
    shows "closed(S \<union> \<Union> c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3071
proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  3072
  have "closedin (top_of_set UNIV) (S \<union> \<Union>c)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3073
    by (metis Compl_eq_Diff_UNIV S c closed_closedin closedin_union_complement_components locally_connected_UNIV subtopology_UNIV)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3074
  then show ?thesis by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3075
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3076
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3077
lemma closedin_Un_complement_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3078
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3079
  assumes u: "locally connected u"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  3080
      and S: "closedin (top_of_set u) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3081
      and c: " c \<in> components(u - S)"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  3082
    shows "closedin (top_of_set u) (S \<union> c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3083
proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  3084
  have "closedin (top_of_set u) (S \<union> \<Union>{c})"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3085
    using c by (blast intro: closedin_union_complement_components [OF u S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3086
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3087
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3088
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3089
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3090
lemma closed_Un_complement_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3091
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3092
  assumes S: "closed S" and c: " c \<in> components(-S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3093
    shows "closed (S \<union> c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3094
  by (metis Compl_eq_Diff_UNIV S c closed_closedin closedin_Un_complement_component
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3095
      locally_connected_UNIV subtopology_UNIV)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3096
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3097
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3098
subsection\<open>Existence of isometry between subspaces of same dimension\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3099
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3100
lemma isometry_subset_subspace:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3101
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3102
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3103
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3104
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3105
      and d: "dim S \<le> dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3106
  obtains f where "linear f" "f ` S \<subseteq> T" "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3107
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3108
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3109
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3110
             and "independent B" "finite B" "card B = dim S" "span B = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3111
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3112
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3113
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3114
             and "independent C" "finite C" "card C = dim T" "span C = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3115
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3116
  obtain fb where "fb ` B \<subseteq> C" "inj_on fb B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3117
    by (metis \<open>card B = dim S\<close> \<open>card C = dim T\<close> \<open>finite B\<close> \<open>finite C\<close> card_le_inj d)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3118
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3119
    using Corth
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3120
    apply (auto simp: pairwise_def orthogonal_clauses inj_on_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3121
    by (meson subsetD image_eqI inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3122
  obtain f where "linear f" and ffb: "\<And>x. x \<in> B \<Longrightarrow> f x = fb x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3123
    using linear_independent_extend \<open>independent B\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3124
  have "span (f ` B) \<subseteq> span C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3125
    by (metis \<open>fb ` B \<subseteq> C\<close> ffb image_cong span_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3126
  then have "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3127
    unfolding \<open>span B = S\<close> \<open>span C = T\<close> span_linear_image[OF \<open>linear f\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3128
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3129
    using B1 C1 \<open>fb ` B \<subseteq> C\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3130
  have "norm (f x) = norm x" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3131
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3132
    interpret linear f by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3133
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3134
      using \<open>finite B\<close> \<open>span B = S\<close> \<open>x \<in> S\<close> span_finite by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3135
    have "norm (f x)^2 = norm (\<Sum>v\<in>B. a v *\<^sub>R fb v)^2" by (simp add: sum scale ffb x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3136
    also have "\<dots> = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3137
    proof (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3138
      show "pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3139
        by (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3140
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3141
    also have "\<dots> = norm x ^2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3142
      by (simp add: x pairwise_ortho_scaleR Borth norm_sum_Pythagorean [OF \<open>finite B\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3143
    finally show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3144
      by (simp add: norm_eq_sqrt_inner)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3145
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3146
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3147
    by (rule that [OF \<open>linear f\<close> \<open>f ` S \<subseteq> T\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3148
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3149
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3150
proposition isometries_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3151
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3152
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3153
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3154
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3155
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3156
  obtains f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3157
                    "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3158
                    "\<And>x. x \<in> T \<Longrightarrow> norm(g x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3159
                    "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3160
                    "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3161
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3162
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3163
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3164
             and "independent B" "finite B" "card B = dim S" "span B = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3165
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3166
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3167
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3168
             and "independent C" "finite C" "card C = dim T" "span C = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3169
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3170
  obtain fb where "bij_betw fb B C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3171
    by (metis \<open>finite B\<close> \<open>finite C\<close> bij_betw_iff_card \<open>card B = dim S\<close> \<open>card C = dim T\<close> d)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3172
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3173
    using Corth
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3174
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3175
    by (meson subsetD image_eqI inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3176
  obtain f where "linear f" and ffb: "\<And>x. x \<in> B \<Longrightarrow> f x = fb x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3177
    using linear_independent_extend \<open>independent B\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3178
  interpret f: linear f by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3179
  define gb where "gb \<equiv> inv_into B fb"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3180
  then have pairwise_orth_gb: "pairwise (\<lambda>v j. orthogonal (gb v) (gb j)) C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3181
    using Borth
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3182
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3183
    by (metis \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on bij_betw_inv_into_right inv_into_into)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3184
  obtain g where "linear g" and ggb: "\<And>x. x \<in> C \<Longrightarrow> g x = gb x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3185
    using linear_independent_extend \<open>independent C\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3186
  interpret g: linear g by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3187
  have "span (f ` B) \<subseteq> span C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3188
    by (metis \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on eq_iff ffb image_cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3189
  then have "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3190
    unfolding \<open>span B = S\<close> \<open>span C = T\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3191
      span_linear_image[OF \<open>linear f\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3192
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3193
    using B1 C1 \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3194
  have f [simp]: "norm (f x) = norm x" "g (f x) = x" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3195
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3196
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3197
      using \<open>finite B\<close> \<open>span B = S\<close> \<open>x \<in> S\<close> span_finite by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3198
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3199
      using linear_sum [OF \<open>linear f\<close>] x by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3200
    also have "\<dots> = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3201
      by (simp add: f.sum f.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3202
    also have "\<dots> = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3203
      by (simp add: ffb cong: sum.cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3204
    finally have *: "f x = (\<Sum>v\<in>B. a v *\<^sub>R fb v)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3205
    then have "(norm (f x))\<^sup>2 = (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2" by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3206
    also have "\<dots> = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3207
    proof (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3208
      show "pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3209
        by (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3210
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3211
    also have "\<dots> = (norm x)\<^sup>2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3212
      by (simp add: x pairwise_ortho_scaleR Borth norm_sum_Pythagorean [OF \<open>finite B\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3213
    finally show "norm (f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3214
      by (simp add: norm_eq_sqrt_inner)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3215
    have "g (f x) = g (\<Sum>v\<in>B. a v *\<^sub>R fb v)" by (simp add: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3216
    also have "\<dots> = (\<Sum>v\<in>B. g (a v *\<^sub>R fb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3217
      by (simp add: g.sum g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3218
    also have "\<dots> = (\<Sum>v\<in>B. a v *\<^sub>R g (fb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3219
      by (simp add: g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3220
    also have "\<dots> = (\<Sum>v\<in>B. a v *\<^sub>R v)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3221
    proof (rule sum.cong [OF refl])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3222
      show "a x *\<^sub>R g (fb x) = a x *\<^sub>R x" if "x \<in> B" for x
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3223
        using that \<open>bij_betw fb B C\<close> bij_betwE bij_betw_inv_into_left gb_def ggb by fastforce
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3224
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3225
    also have "\<dots> = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3226
      using x by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3227
    finally show "g (f x) = x" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3228
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3229
  have [simp]: "\<And>x. x \<in> C \<Longrightarrow> norm (gb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3230
    by (metis B1 C1 \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on gb_def inv_into_into)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3231
  have g [simp]: "f (g x) = x" if "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3232
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3233
    obtain a where x: "x = (\<Sum>v \<in> C. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3234
      using \<open>finite C\<close> \<open>span C = T\<close> \<open>x \<in> T\<close> span_finite by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3235
    have "g x = (\<Sum>v \<in> C. g (a v *\<^sub>R v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3236
      by (simp add: x g.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3237
    also have "\<dots> = (\<Sum>v \<in> C. a v *\<^sub>R g v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3238
      by (simp add: g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3239
    also have "\<dots> = (\<Sum>v \<in> C. a v *\<^sub>R gb v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3240
      by (simp add: ggb cong: sum.cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3241
    finally have "f (g x) = f (\<Sum>v\<in>C. a v *\<^sub>R gb v)" by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3242
    also have "\<dots> = (\<Sum>v\<in>C. f (a v *\<^sub>R gb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3243
      by (simp add: f.scale f.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3244
    also have "\<dots> = (\<Sum>v\<in>C. a v *\<^sub>R f (gb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3245
      by (simp add: f.scale f.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3246
    also have "\<dots> = (\<Sum>v\<in>C. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3247
      using \<open>bij_betw fb B C\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3248
      by (simp add: bij_betw_def gb_def bij_betw_inv_into_right ffb inv_into_into)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3249
    also have "\<dots> = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3250
      using x by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3251
    finally show "f (g x) = x" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3252
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3253
  have gim: "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3254
    by (metis (full_types) S T \<open>f ` S \<subseteq> T\<close> d dim_eq_span dim_image_le f(2) g.linear_axioms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3255
        image_iff linear_subspace_image span_eq_iff subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3256
  have fim: "f ` S = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3257
    using \<open>g ` T = S\<close> image_iff by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3258
  have [simp]: "norm (g x) = norm x" if "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3259
    using fim that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3260
  show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3261
    by (rule that [OF \<open>linear f\<close> \<open>linear g\<close>]) (simp_all add: fim gim)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3262
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3263
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3264
corollary isometry_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3265
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3266
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3267
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3268
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3269
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3270
  obtains f where "linear f" "f ` S = T" "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3271
using isometries_subspaces [OF assms]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3272
by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3273
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3274
corollary isomorphisms_UNIV_UNIV:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3275
  assumes "DIM('M) = DIM('N)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3276
  obtains f::"'M::euclidean_space \<Rightarrow>'N::euclidean_space" and g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3277
  where "linear f" "linear g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3278
                    "\<And>x. norm(f x) = norm x" "\<And>y. norm(g y) = norm y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3279
                    "\<And>x. g (f x) = x" "\<And>y. f(g y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3280
  using assms by (auto intro: isometries_subspaces [of "UNIV::'M set" "UNIV::'N set"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3281
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3282
lemma homeomorphic_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3283
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3284
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3285
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3286
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3287
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3288
    shows "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3289
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3290
  obtain f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3291
                   "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3292
    by (blast intro: isometries_subspaces [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3293
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3294
    apply (simp add: homeomorphic_def homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3295
    apply (rule_tac x=f in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3296
    apply (rule_tac x=g in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3297
    apply (auto simp: linear_continuous_on linear_conv_bounded_linear)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3298
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3299
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3300
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3301
lemma homeomorphic_affine_sets:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3302
  assumes "affine S" "affine T" "aff_dim S = aff_dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3303
    shows "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3304
proof (cases "S = {} \<or> T = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3305
  case True  with assms aff_dim_empty homeomorphic_empty show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3306
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3307
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3308
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3309
  then obtain a b where ab: "a \<in> S" "b \<in> T" by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3310
  then have ss: "subspace ((+) (- a) ` S)" "subspace ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3311
    using affine_diffs_subspace assms by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3312
  have dd: "dim ((+) (- a) ` S) = dim ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3313
    using assms ab  by (simp add: aff_dim_eq_dim  [OF hull_inc] image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3314
  have "S homeomorphic ((+) (- a) ` S)"
69768
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
  3315
    by (fact homeomorphic_translation)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3316
  also have "\<dots> homeomorphic ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3317
    by (rule homeomorphic_subspaces [OF ss dd])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3318
  also have "\<dots> homeomorphic T"
69768
7e4966eaf781 proper congruence rule for image operator
haftmann
parents: 69712
diff changeset
  3319
    using homeomorphic_translation [of T "- b"] by (simp add: homeomorphic_sym [of T])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3320
  finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3321
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3322
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3323
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3324
subsection\<open>Retracts, in a general sense, preserve (co)homotopic triviality)\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3325
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  3326
locale\<^marker>\<open>tag important\<close> Retracts =
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3327
  fixes s h t k
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3328
  assumes conth: "continuous_on s h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3329
      and imh: "h ` s = t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3330
      and contk: "continuous_on t k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3331
      and imk: "k ` t \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3332
      and idhk: "\<And>y. y \<in> t \<Longrightarrow> h(k y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3333
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3334
begin
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3335
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3336
lemma homotopically_trivial_retraction_gen:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3337
  assumes P: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k \<circ> f)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3338
      and Q: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h \<circ> f)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3339
      and Qeq: "\<And>h k. (\<And>x. x \<in> U \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3340
      and hom: "\<And>f g. \<lbrakk>continuous_on U f; f ` U \<subseteq> s; P f;
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3341
                       continuous_on U g; g ` U \<subseteq> s; P g\<rbrakk>
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3342
                       \<Longrightarrow> homotopic_with_canon P U s f g"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3343
      and contf: "continuous_on U f" and imf: "f ` U \<subseteq> t" and Qf: "Q f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3344
      and contg: "continuous_on U g" and img: "g ` U \<subseteq> t" and Qg: "Q g"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3345
    shows "homotopic_with_canon Q U t f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3346
proof -
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3347
  have feq: "\<And>x. x \<in> U \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3348
  have geq: "\<And>x. x \<in> U \<Longrightarrow> (h \<circ> (k \<circ> g)) x = g x" using idhk img by auto
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3349
  have "continuous_on U (k \<circ> f)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3350
    using contf continuous_on_compose continuous_on_subset contk imf by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3351
  moreover have "(k \<circ> f) ` U \<subseteq> s"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3352
    using imf imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3353
  moreover have "P (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3354
    by (simp add: P Qf contf imf)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3355
  moreover have "continuous_on U (k \<circ> g)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3356
    using contg continuous_on_compose continuous_on_subset contk img by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3357
  moreover have "(k \<circ> g) ` U \<subseteq> s"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3358
    using img imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3359
  moreover have "P (k \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3360
    by (simp add: P Qg contg img)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3361
  ultimately have "homotopic_with_canon P U s (k \<circ> f) (k \<circ> g)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3362
    by (rule hom)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3363
  then have "homotopic_with_canon Q U t (h \<circ> (k \<circ> f)) (h \<circ> (k \<circ> g))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3364
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3365
    using Q by (auto simp: conth imh)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3366
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3367
    apply (rule homotopic_with_eq)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3368
    using feq geq apply fastforce+
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3369
    using Qeq topspace_euclidean_subtopology by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3370
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3371
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3372
lemma homotopically_trivial_retraction_null_gen:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3373
  assumes P: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k \<circ> f)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3374
      and Q: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h \<circ> f)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3375
      and Qeq: "\<And>h k. (\<And>x. x \<in> U \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3376
      and hom: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> s; P f\<rbrakk>
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3377
                     \<Longrightarrow> \<exists>c. homotopic_with_canon P U s f (\<lambda>x. c)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3378
      and contf: "continuous_on U f" and imf:"f ` U \<subseteq> t" and Qf: "Q f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3379
  obtains c where "homotopic_with_canon Q U t f (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3380
proof -
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3381
  have feq: "\<And>x. x \<in> U \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3382
  have "continuous_on U (k \<circ> f)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3383
    using contf continuous_on_compose continuous_on_subset contk imf by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3384
  moreover have "(k \<circ> f) ` U \<subseteq> s"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3385
    using imf imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3386
  moreover have "P (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3387
    by (simp add: P Qf contf imf)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3388
  ultimately obtain c where "homotopic_with_canon P U s (k \<circ> f) (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3389
    by (metis hom)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3390
  then have "homotopic_with_canon Q U t (h \<circ> (k \<circ> f)) (h \<circ> (\<lambda>x. c))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3391
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3392
    using Q by (auto simp: conth imh)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3393
  then have "homotopic_with_canon Q U t f (\<lambda>x. h c)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3394
  proof (rule homotopic_with_eq)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3395
    show "\<And>x. x \<in> topspace (top_of_set U) \<Longrightarrow> f x = (h \<circ> (k \<circ> f)) x"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3396
      using feq by auto
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3397
    show "\<And>h k. (\<And>x. x \<in> topspace (top_of_set U) \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3398
      using Qeq topspace_euclidean_subtopology by blast
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3399
  qed auto
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3400
  then show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3401
    using that by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3402
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3403
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3404
lemma cohomotopically_trivial_retraction_gen:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3405
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> U; Q f\<rbrakk> \<Longrightarrow> P(f \<circ> h)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3406
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> U; P f\<rbrakk> \<Longrightarrow> Q(f \<circ> k)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3407
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3408
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> U; P f;
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3409
                       continuous_on s g; g ` s \<subseteq> U; P g\<rbrakk>
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3410
                       \<Longrightarrow> homotopic_with_canon P s U f g"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3411
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> U" and Qf: "Q f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3412
      and contg: "continuous_on t g" and img: "g ` t \<subseteq> U" and Qg: "Q g"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3413
    shows "homotopic_with_canon Q t U f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3414
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3415
  have feq: "\<And>x. x \<in> t \<Longrightarrow> (f \<circ> h \<circ> k) x = f x" using idhk imf by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3416
  have geq: "\<And>x. x \<in> t \<Longrightarrow> (g \<circ> h \<circ> k) x = g x" using idhk img by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3417
  have "continuous_on s (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3418
    using contf conth continuous_on_compose imh by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3419
  moreover have "(f \<circ> h) ` s \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3420
    using imf imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3421
  moreover have "P (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3422
    by (simp add: P Qf contf imf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3423
  moreover have "continuous_on s (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3424
    using contg continuous_on_compose continuous_on_subset conth imh by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3425
  moreover have "(g \<circ> h) ` s \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3426
    using img imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3427
  moreover have "P (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3428
    by (simp add: P Qg contg img)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3429
  ultimately have "homotopic_with_canon P s U (f \<circ> h) (g \<circ> h)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3430
    by (rule hom)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3431
  then have "homotopic_with_canon Q t U (f \<circ> h \<circ> k) (g \<circ> h \<circ> k)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3432
    apply (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3433
    using Q by (auto simp: contk imk)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3434
  then show ?thesis
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3435
  proof (rule homotopic_with_eq)
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3436
    show "f x = (f \<circ> h \<circ> k) x" "g x = (g \<circ> h \<circ> k) x" 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3437
      if "x \<in> topspace (top_of_set t)" for x
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3438
      using feq geq that by force+
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3439
  qed (use Qeq topspace_euclidean_subtopology in blast)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3440
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3441
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3442
lemma cohomotopically_trivial_retraction_null_gen:
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3443
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> U; Q f\<rbrakk> \<Longrightarrow> P(f \<circ> h)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3444
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> U; P f\<rbrakk> \<Longrightarrow> Q(f \<circ> k)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3445
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3446
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> U; P f\<rbrakk>
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3447
                       \<Longrightarrow> \<exists>c. homotopic_with_canon P s U f (\<lambda>x. c)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3448
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> U" and Qf: "Q f"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3449
  obtains c where "homotopic_with_canon Q t U f (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3450
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3451
  have feq: "\<And>x. x \<in> t \<Longrightarrow> (f \<circ> h \<circ> k) x = f x" using idhk imf by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3452
  have "continuous_on s (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3453
    using contf conth continuous_on_compose imh by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3454
  moreover have "(f \<circ> h) ` s \<subseteq> U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3455
    using imf imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3456
  moreover have "P (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3457
    by (simp add: P Qf contf imf)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3458
  ultimately obtain c where "homotopic_with_canon P s U (f \<circ> h) (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3459
    by (metis hom)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3460
  then have \<section>: "homotopic_with_canon Q t U (f \<circ> h \<circ> k) ((\<lambda>x. c) \<circ> k)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3461
  proof (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3462
    show "\<And>h. \<lbrakk>continuous_map (top_of_set s) (top_of_set U) h; P h\<rbrakk> \<Longrightarrow> Q (h \<circ> k)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3463
      using Q by auto
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3464
  qed (auto simp: contk imk)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3465
  moreover have "homotopic_with_canon Q t U f (\<lambda>x. c)"
71746
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3466
    using homotopic_with_eq [OF \<section>] feq Qeq by fastforce
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3467
  ultimately show ?thesis 
da0e18db1517 more cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71745
diff changeset
  3468
    using that by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3469
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3470
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3471
end
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3472
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3473
lemma simply_connected_retraction_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3474
  shows "\<lbrakk>simply_connected S; continuous_on S h; h ` S = T;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3475
          continuous_on T k; k ` T \<subseteq> S; \<And>y. y \<in> T \<Longrightarrow> h(k y) = y\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3476
        \<Longrightarrow> simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3477
apply (simp add: simply_connected_def path_def path_image_def homotopic_loops_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3478
apply (rule Retracts.homotopically_trivial_retraction_gen
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3479
        [of S h _ k _ "\<lambda>p. pathfinish p = pathstart p"  "\<lambda>p. pathfinish p = pathstart p"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3480
apply (simp_all add: Retracts_def pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3481
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3482
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3483
lemma homeomorphic_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3484
    "\<lbrakk>S homeomorphic T; simply_connected S\<rbrakk> \<Longrightarrow> simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3485
  by (auto simp: homeomorphic_def homeomorphism_def intro: simply_connected_retraction_gen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3486
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3487
lemma homeomorphic_simply_connected_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3488
    "S homeomorphic T \<Longrightarrow> (simply_connected S \<longleftrightarrow> simply_connected T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3489
  by (metis homeomorphic_simply_connected homeomorphic_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3490
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3491
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3492
subsection\<open>Homotopy equivalence\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3493
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3494
subsection\<open>Homotopy equivalence of topological spaces.\<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3495
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  3496
definition\<^marker>\<open>tag important\<close> homotopy_equivalent_space
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3497
             (infix "homotopy'_equivalent'_space" 50)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3498
  where "X homotopy_equivalent_space Y \<equiv>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3499
        (\<exists>f g. continuous_map X Y f \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3500
              continuous_map Y X g \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3501
              homotopic_with (\<lambda>x. True) X X (g \<circ> f) id \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3502
              homotopic_with (\<lambda>x. True) Y Y (f \<circ> g) id)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3503
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3504
lemma homeomorphic_imp_homotopy_equivalent_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3505
  "X homeomorphic_space Y \<Longrightarrow> X homotopy_equivalent_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3506
  unfolding homeomorphic_space_def homotopy_equivalent_space_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3507
  apply (erule ex_forward)+
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3508
  by (simp add: homotopic_with_equal homotopic_with_sym homeomorphic_maps_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3509
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3510
lemma homotopy_equivalent_space_refl:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3511
   "X homotopy_equivalent_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3512
  by (simp add: homeomorphic_imp_homotopy_equivalent_space homeomorphic_space_refl)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3513
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3514
lemma homotopy_equivalent_space_sym:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3515
   "X homotopy_equivalent_space Y \<longleftrightarrow> Y homotopy_equivalent_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3516
  by (meson homotopy_equivalent_space_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3517
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3518
lemma homotopy_eqv_trans [trans]:
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3519
  assumes 1: "X homotopy_equivalent_space Y" and 2: "Y homotopy_equivalent_space U"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3520
    shows "X homotopy_equivalent_space U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3521
proof -
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3522
  obtain f1 g1 where f1: "continuous_map X Y f1"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3523
                 and g1: "continuous_map Y X g1"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3524
                 and hom1: "homotopic_with (\<lambda>x. True) X X (g1 \<circ> f1) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3525
                           "homotopic_with (\<lambda>x. True) Y Y (f1 \<circ> g1) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3526
    using 1 by (auto simp: homotopy_equivalent_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3527
  obtain f2 g2 where f2: "continuous_map Y U f2"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3528
                 and g2: "continuous_map U Y g2"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3529
                 and hom2: "homotopic_with (\<lambda>x. True) Y Y (g2 \<circ> f2) id"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3530
                           "homotopic_with (\<lambda>x. True) U U (f2 \<circ> g2) id"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3531
    using 2 by (auto simp: homotopy_equivalent_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3532
  have "homotopic_with (\<lambda>f. True) X Y (g2 \<circ> f2 \<circ> f1) (id \<circ> f1)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3533
    using f1 hom2(1) homotopic_with_compose_continuous_map_right by metis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3534
  then have "homotopic_with (\<lambda>f. True) X Y (g2 \<circ> (f2 \<circ> f1)) (id \<circ> f1)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3535
    by (simp add: o_assoc)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3536
  then have "homotopic_with (\<lambda>x. True) X X
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3537
         (g1 \<circ> (g2 \<circ> (f2 \<circ> f1))) (g1 \<circ> (id \<circ> f1))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3538
    by (simp add: g1 homotopic_with_compose_continuous_map_left)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3539
  moreover have "homotopic_with (\<lambda>x. True) X X (g1 \<circ> id \<circ> f1) id"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3540
    using hom1 by simp
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3541
  ultimately have SS: "homotopic_with (\<lambda>x. True) X X (g1 \<circ> g2 \<circ> (f2 \<circ> f1)) id"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3542
    by (metis comp_assoc homotopic_with_trans id_comp)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3543
  have "homotopic_with (\<lambda>f. True) U Y (f1 \<circ> g1 \<circ> g2) (id \<circ> g2)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3544
    using g2 hom1(2) homotopic_with_compose_continuous_map_right by fastforce
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3545
  then have "homotopic_with (\<lambda>f. True) U Y (f1 \<circ> (g1 \<circ> g2)) (id \<circ> g2)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3546
    by (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3547
  then have "homotopic_with (\<lambda>x. True) U U
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3548
         (f2 \<circ> (f1 \<circ> (g1 \<circ> g2))) (f2 \<circ> (id \<circ> g2))"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3549
    by (simp add: f2 homotopic_with_compose_continuous_map_left)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3550
  moreover have "homotopic_with (\<lambda>x. True) U U (f2 \<circ> id \<circ> g2) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3551
    using hom2 by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3552
  ultimately have UU: "homotopic_with (\<lambda>x. True) U U (f2 \<circ> f1 \<circ> (g1 \<circ> g2)) id"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3553
    by (simp add: fun.map_comp hom2(2) homotopic_with_trans)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3554
  show ?thesis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3555
    unfolding homotopy_equivalent_space_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3556
    by (blast intro: f1 f2 g1 g2 continuous_map_compose SS UU)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3557
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3558
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3559
lemma deformation_retraction_imp_homotopy_equivalent_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3560
  "\<lbrakk>homotopic_with (\<lambda>x. True) X X (s \<circ> r) id; retraction_maps X Y r s\<rbrakk>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3561
    \<Longrightarrow> X homotopy_equivalent_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3562
  unfolding homotopy_equivalent_space_def retraction_maps_def
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3563
  using homotopic_with_id2 by fastforce
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3564
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3565
lemma deformation_retract_imp_homotopy_equivalent_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3566
   "\<lbrakk>homotopic_with (\<lambda>x. True) X X r id; retraction_maps X Y r id\<rbrakk>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3567
    \<Longrightarrow> X homotopy_equivalent_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3568
  using deformation_retraction_imp_homotopy_equivalent_space by force
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3569
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3570
lemma deformation_retract_of_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3571
  "S \<subseteq> topspace X \<and>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3572
   (\<exists>r. homotopic_with (\<lambda>x. True) X X id r \<and> retraction_maps X (subtopology X S) r id) \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3573
   S retract_of_space X \<and> (\<exists>f. homotopic_with (\<lambda>x. True) X X id f \<and> f ` (topspace X) \<subseteq> S)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3574
proof (cases "S \<subseteq> topspace X")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3575
  case True
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3576
  moreover have "(\<exists>r. homotopic_with (\<lambda>x. True) X X id r \<and> retraction_maps X (subtopology X S) r id)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3577
             \<longleftrightarrow> (S retract_of_space X \<and> (\<exists>f. homotopic_with (\<lambda>x. True) X X id f \<and> f ` topspace X \<subseteq> S))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3578
    unfolding retract_of_space_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3579
  proof safe
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3580
    fix f r
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3581
    assume f: "homotopic_with (\<lambda>x. True) X X id f"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3582
      and fS: "f ` topspace X \<subseteq> S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3583
      and r: "continuous_map X (subtopology X S) r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3584
      and req: "\<forall>x\<in>S. r x = x"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3585
    show "\<exists>r. homotopic_with (\<lambda>x. True) X X id r \<and> retraction_maps X (subtopology X S) r id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3586
    proof (intro exI conjI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3587
      have "homotopic_with (\<lambda>x. True) X X f r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3588
        proof (rule homotopic_with_eq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3589
          show "homotopic_with (\<lambda>x. True) X X (r \<circ> f) (r \<circ> id)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3590
            by (metis continuous_map_into_fulltopology f homotopic_with_compose_continuous_map_left homotopic_with_symD r)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3591
          show "f x = (r \<circ> f) x" if "x \<in> topspace X" for x
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3592
            using that fS req by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3593
        qed auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3594
      then show "homotopic_with (\<lambda>x. True) X X id r"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3595
        by (rule homotopic_with_trans [OF f])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3596
    next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3597
      show "retraction_maps X (subtopology X S) r id"
71172
nipkow
parents: 70817
diff changeset
  3598
        by (simp add: r req retraction_maps_def)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3599
    qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3600
  qed (use True in \<open>auto simp: retraction_maps_def topspace_subtopology_subset continuous_map_in_subtopology\<close>)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3601
  ultimately show ?thesis by simp
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3602
qed (auto simp: retract_of_space_def retraction_maps_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3603
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3604
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3605
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3606
subsection\<open>Contractible spaces\<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3607
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3608
text\<open>The definition (which agrees with "contractible" on subsets of Euclidean space)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3609
is a little cryptic because we don't in fact assume that the constant "a" is in the space.
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3610
This forces the convention that the empty space / set is contractible, avoiding some special cases. \<close>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3611
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3612
definition contractible_space where
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3613
  "contractible_space X \<equiv> \<exists>a. homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3614
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3615
lemma contractible_space_top_of_set [simp]:"contractible_space (top_of_set S) \<longleftrightarrow> contractible S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3616
  by (auto simp: contractible_space_def contractible_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3617
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3618
lemma contractible_space_empty:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3619
   "topspace X = {} \<Longrightarrow> contractible_space X"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3620
  unfolding contractible_space_def homotopic_with_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3621
  apply (rule_tac x=undefined in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3622
  apply (rule_tac x="\<lambda>(t,x). if t = 0 then x else undefined" in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3623
  apply (auto simp: continuous_map_on_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3624
  done
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3625
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3626
lemma contractible_space_singleton:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3627
  "topspace X = {a} \<Longrightarrow> contractible_space X"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3628
  unfolding contractible_space_def homotopic_with_def
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3629
  apply (rule_tac x=a in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3630
  apply (rule_tac x="\<lambda>(t,x). if t = 0 then x else a" in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3631
  apply (auto intro: continuous_map_eq [where f = "\<lambda>z. a"])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3632
  done
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3633
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3634
lemma contractible_space_subset_singleton:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3635
   "topspace X \<subseteq> {a} \<Longrightarrow> contractible_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3636
  by (meson contractible_space_empty contractible_space_singleton subset_singletonD)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3637
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3638
lemma contractible_space_subtopology_singleton:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3639
   "contractible_space(subtopology X {a})"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3640
  by (meson contractible_space_subset_singleton insert_subset path_connectedin_singleton path_connectedin_subtopology subsetI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3641
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3642
lemma contractible_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3643
   "contractible_space X \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3644
        topspace X = {} \<or>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3645
        (\<exists>a \<in> topspace X. homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3646
proof (cases "topspace X = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3647
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3648
  then show ?thesis
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3649
    using homotopic_with_imp_continuous_maps  by (fastforce simp: contractible_space_def)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3650
qed (simp add: contractible_space_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3651
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3652
lemma contractible_imp_path_connected_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3653
  assumes "contractible_space X" shows "path_connected_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3654
proof (cases "topspace X = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3655
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3656
  have *: "path_connected_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3657
    if "a \<in> topspace X" and conth: "continuous_map (prod_topology (top_of_set {0..1}) X) X h"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3658
      and h: "\<forall>x. h (0, x) = x" "\<forall>x. h (1, x) = a"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3659
    for a and h :: "real \<times> 'a \<Rightarrow> 'a"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3660
  proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3661
    have "path_component_of X b a" if "b \<in> topspace X" for b
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3662
      unfolding path_component_of_def
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3663
    proof (intro exI conjI)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3664
      let ?g = "h \<circ> (\<lambda>x. (x,b))"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3665
      show "pathin X ?g"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3666
        unfolding pathin_def
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3667
      proof (rule continuous_map_compose [OF _ conth])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3668
        show "continuous_map (top_of_set {0..1}) (prod_topology (top_of_set {0..1}) X) (\<lambda>x. (x, b))"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3669
          using that by (auto intro!: continuous_intros)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3670
      qed
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3671
    qed (use h in auto)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3672
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3673
    by (metis path_component_of_equiv path_connected_space_iff_path_component)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3674
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3675
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3676
    using assms False by (auto simp: contractible_space homotopic_with_def *)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3677
qed (simp add: path_connected_space_topspace_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3678
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3679
lemma contractible_imp_connected_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3680
   "contractible_space X \<Longrightarrow> connected_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3681
  by (simp add: contractible_imp_path_connected_space path_connected_imp_connected_space)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3682
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3683
lemma contractible_space_alt:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3684
   "contractible_space X \<longleftrightarrow> (\<forall>a \<in> topspace X. homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a))" (is "?lhs = ?rhs")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3685
proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3686
  assume X: ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3687
  then obtain a where a: "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3688
    by (auto simp: contractible_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3689
  show ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3690
  proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3691
    show "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. b)" if "b \<in> topspace X" for b
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3692
    proof (rule homotopic_with_trans [OF a])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3693
      show "homotopic_with (\<lambda>x. True) X X (\<lambda>x. a) (\<lambda>x. b)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3694
        using homotopic_constant_maps path_connected_space_imp_path_component_of
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3695
        by (metis (full_types) X a continuous_map_const contractible_imp_path_connected_space homotopic_with_imp_continuous_maps that)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3696
    qed
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3697
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3698
next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3699
  assume R: ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3700
  then show ?lhs
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3701
    unfolding contractible_space_def by (metis equals0I homotopic_on_emptyI)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3702
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3703
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3704
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3705
lemma compose_const [simp]: "f \<circ> (\<lambda>x. a) = (\<lambda>x. f a)" "(\<lambda>x. a) \<circ> g = (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3706
  by (simp_all add: o_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3707
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3708
lemma nullhomotopic_through_contractible_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3709
  assumes f: "continuous_map X Y f" and g: "continuous_map Y Z g" and Y: "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3710
  obtains c where "homotopic_with (\<lambda>h. True) X Z (g \<circ> f) (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3711
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3712
  obtain b where b: "homotopic_with (\<lambda>x. True) Y Y id (\<lambda>x. b)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3713
    using Y by (auto simp: contractible_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3714
  show thesis
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3715
    using homotopic_with_compose_continuous_map_right
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3716
           [OF homotopic_with_compose_continuous_map_left [OF b g] f]
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3717
    by (force simp add: that)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3718
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3719
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3720
lemma nullhomotopic_into_contractible_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3721
  assumes f: "continuous_map X Y f" and Y: "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3722
  obtains c where "homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3723
  using nullhomotopic_through_contractible_space [OF f _ Y]
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3724
  by (metis continuous_map_id id_comp)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3725
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3726
lemma nullhomotopic_from_contractible_space:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3727
  assumes f: "continuous_map X Y f" and X: "contractible_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3728
  obtains c where "homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3729
  using nullhomotopic_through_contractible_space [OF _ f X]
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3730
  by (metis comp_id continuous_map_id)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3731
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3732
lemma homotopy_dominated_contractibility:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3733
  assumes f: "continuous_map X Y f" and g: "continuous_map Y X g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3734
    and hom: "homotopic_with (\<lambda>x. True) Y Y (f \<circ> g) id" and X: "contractible_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3735
  shows "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3736
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3737
  obtain c where c: "homotopic_with (\<lambda>h. True) X Y f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3738
    using nullhomotopic_from_contractible_space [OF f X] .
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3739
  have "homotopic_with (\<lambda>x. True) Y Y (f \<circ> g) (\<lambda>x. c)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3740
    using homotopic_with_compose_continuous_map_right [OF c g] by fastforce
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3741
  then have "homotopic_with (\<lambda>x. True) Y Y id (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3742
    using homotopic_with_trans [OF _ hom] homotopic_with_symD by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3743
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3744
    unfolding contractible_space_def ..
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3745
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3746
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3747
lemma homotopy_equivalent_space_contractibility:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3748
   "X homotopy_equivalent_space Y \<Longrightarrow> (contractible_space X \<longleftrightarrow> contractible_space Y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3749
  unfolding homotopy_equivalent_space_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3750
  by (blast intro: homotopy_dominated_contractibility)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3751
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3752
lemma homeomorphic_space_contractibility:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3753
   "X homeomorphic_space Y
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3754
        \<Longrightarrow> (contractible_space X \<longleftrightarrow> contractible_space Y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3755
  by (simp add: homeomorphic_imp_homotopy_equivalent_space homotopy_equivalent_space_contractibility)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3756
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3757
lemma contractible_eq_homotopy_equivalent_singleton_subtopology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3758
   "contractible_space X \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3759
        topspace X = {} \<or> (\<exists>a \<in> topspace X. X homotopy_equivalent_space (subtopology X {a}))"(is "?lhs = ?rhs")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3760
proof (cases "topspace X = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3761
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3762
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3763
  proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3764
    assume ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3765
    then obtain a where a: "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3766
      by (auto simp: contractible_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3767
    then have "a \<in> topspace X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3768
      by (metis False continuous_map_const homotopic_with_imp_continuous_maps)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3769
    then have "X homotopy_equivalent_space subtopology X {a}"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3770
      unfolding homotopy_equivalent_space_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3771
      apply (rule_tac x="\<lambda>x. a" in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3772
      apply (rule_tac x=id in exI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3773
      apply (auto simp: homotopic_with_sym topspace_subtopology_subset a)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3774
      using connectedin_absolute connectedin_sing contractible_space_alt contractible_space_subtopology_singleton by fastforce
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3775
    with \<open>a \<in> topspace X\<close> show ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3776
      by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3777
  next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3778
    assume ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3779
    then show ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3780
      by (meson False contractible_space_subtopology_singleton homotopy_equivalent_space_contractibility)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3781
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3782
qed (simp add: contractible_space_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3783
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3784
lemma contractible_space_retraction_map_image:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3785
  assumes "retraction_map X Y f" and X: "contractible_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3786
  shows "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3787
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3788
  obtain g where f: "continuous_map X Y f" and g: "continuous_map Y X g" and fg: "\<forall>y \<in> topspace Y. f(g y) = y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3789
    using assms by (auto simp: retraction_map_def retraction_maps_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3790
  obtain a where a: "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3791
    using X by (auto simp: contractible_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3792
  have "homotopic_with (\<lambda>x. True) Y Y id (\<lambda>x. f a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3793
  proof (rule homotopic_with_eq)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3794
    show "homotopic_with (\<lambda>x. True) Y Y (f \<circ> id \<circ> g) (f \<circ> (\<lambda>x. a) \<circ> g)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3795
      using f g a homotopic_with_compose_continuous_map_left homotopic_with_compose_continuous_map_right by metis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3796
  qed (use fg in auto)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3797
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3798
    unfolding contractible_space_def by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3799
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3800
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3801
lemma contractible_space_prod_topology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3802
   "contractible_space(prod_topology X Y) \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3803
    topspace X = {} \<or> topspace Y = {} \<or> contractible_space X \<and> contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3804
proof (cases "topspace X = {} \<or> topspace Y = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3805
  case True
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3806
  then have "topspace (prod_topology X Y) = {}"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3807
    by simp
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3808
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3809
    by (auto simp: contractible_space_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3810
next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3811
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3812
  have "contractible_space(prod_topology X Y) \<longleftrightarrow> contractible_space X \<and> contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3813
  proof safe
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3814
    assume XY: "contractible_space (prod_topology X Y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3815
    with False have "retraction_map (prod_topology X Y) X fst"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3816
      by (auto simp: contractible_space False retraction_map_fst)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3817
    then show "contractible_space X"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3818
      by (rule contractible_space_retraction_map_image [OF _ XY])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3819
    have "retraction_map (prod_topology X Y) Y snd"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3820
      using False XY  by (auto simp: contractible_space False retraction_map_snd)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3821
    then show "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3822
      by (rule contractible_space_retraction_map_image [OF _ XY])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3823
  next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3824
    assume "contractible_space X" and "contractible_space Y"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3825
    with False obtain a b
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3826
      where "a \<in> topspace X" and a: "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3827
        and "b \<in> topspace Y" and b: "homotopic_with (\<lambda>x. True) Y Y id (\<lambda>x. b)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3828
      by (auto simp: contractible_space)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3829
    with False show "contractible_space (prod_topology X Y)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3830
      apply (simp add: contractible_space)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3831
      apply (rule_tac x=a in bexI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3832
       apply (rule_tac x=b in bexI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3833
      using homotopic_with_prod_topology [OF a b]
70033
6cbc7634135c eliminated hard TABs;
wenzelm
parents: 69986
diff changeset
  3834
        apply (metis (no_types, lifting) case_prod_Pair case_prod_beta' eq_id_iff)
6cbc7634135c eliminated hard TABs;
wenzelm
parents: 69986
diff changeset
  3835
       apply auto
6cbc7634135c eliminated hard TABs;
wenzelm
parents: 69986
diff changeset
  3836
      done
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3837
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3838
  with False show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3839
    by auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3840
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3841
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3842
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3843
lemma contractible_space_product_topology:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3844
  "contractible_space(product_topology X I) \<longleftrightarrow>
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3845
    topspace (product_topology X I) = {} \<or> (\<forall>i \<in> I. contractible_space(X i))"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3846
proof (cases "topspace (product_topology X I) = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3847
  case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3848
  have 1: "contractible_space (X i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3849
    if XI: "contractible_space (product_topology X I)" and "i \<in> I"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3850
    for i
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3851
  proof (rule contractible_space_retraction_map_image [OF _ XI])
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3852
    show "retraction_map (product_topology X I) (X i) (\<lambda>x. x i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3853
      using False by (simp add: retraction_map_product_projection \<open>i \<in> I\<close>)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3854
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3855
  have 2: "contractible_space (product_topology X I)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3856
    if "x \<in> topspace (product_topology X I)" and cs: "\<forall>i\<in>I. contractible_space (X i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3857
    for x :: "'a \<Rightarrow> 'b"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3858
  proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3859
    obtain f where f: "\<And>i. i\<in>I \<Longrightarrow> homotopic_with (\<lambda>x. True) (X i) (X i) id (\<lambda>x. f i)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3860
      using cs unfolding contractible_space_def by metis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3861
    have "homotopic_with (\<lambda>x. True)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3862
                         (product_topology X I) (product_topology X I) id (\<lambda>x. restrict f I)"
71172
nipkow
parents: 70817
diff changeset
  3863
      by (rule homotopic_with_eq [OF homotopic_with_product_topology [OF f]]) (auto)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3864
    then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3865
      by (auto simp: contractible_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3866
  qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3867
  show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3868
    using False 1 2 by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3869
qed (simp add: contractible_space_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3870
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3871
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3872
lemma contractible_space_subtopology_euclideanreal [simp]:
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3873
  "contractible_space(subtopology euclideanreal S) \<longleftrightarrow> is_interval S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3874
  (is "?lhs = ?rhs")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3875
proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3876
  assume ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3877
  then have "path_connectedin (subtopology euclideanreal S) S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3878
    using contractible_imp_path_connected_space path_connectedin_topspace path_connectedin_absolute
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3879
    by (simp add: contractible_imp_path_connected) 
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3880
  then show ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3881
    by (simp add: is_interval_path_connected_1)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3882
next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3883
  assume ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3884
  then have "convex S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3885
    by (simp add: is_interval_convex_1)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3886
  show ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3887
  proof (cases "S = {}")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3888
    case False
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3889
    then obtain z where "z \<in> S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3890
      by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3891
    show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3892
      unfolding contractible_space_def homotopic_with_def
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3893
    proof (intro exI conjI allI)
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3894
      note \<section> = convexD [OF \<open>convex S\<close>, simplified]
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3895
      show "continuous_map (prod_topology (top_of_set {0..1}) (top_of_set S)) (top_of_set S)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3896
                           (\<lambda>(t,x). (1 - t) * x + t * z)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3897
        using  \<open>z \<in> S\<close> 
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3898
        by (auto simp add: case_prod_unfold intro!: continuous_intros \<section>)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3899
    qed auto
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3900
  qed (simp add: contractible_space_empty)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3901
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3902
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3903
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3904
corollary contractible_space_euclideanreal: "contractible_space euclideanreal"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3905
proof -
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3906
  have "contractible_space (subtopology euclideanreal UNIV)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3907
    using contractible_space_subtopology_euclideanreal by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3908
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3909
    by simp
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3910
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3911
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3912
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  3913
abbreviation\<^marker>\<open>tag important\<close> homotopy_eqv :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3914
             (infix "homotopy'_eqv" 50)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3915
  where "S homotopy_eqv T \<equiv> top_of_set S homotopy_equivalent_space top_of_set T"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3916
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3917
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3918
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3919
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3920
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3921
lemma homeomorphic_imp_homotopy_eqv: "S homeomorphic T \<Longrightarrow> S homotopy_eqv T"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3922
  unfolding homeomorphic_def homeomorphism_def homotopy_equivalent_space_def
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  3923
  by (metis continuous_map_subtopology_eu homotopic_with_id2 openin_imp_subset openin_subtopology_self topspace_euclidean_subtopology)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3924
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3925
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3926
lemma homotopy_eqv_inj_linear_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3927
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3928
  assumes "linear f" "inj f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3929
    shows "(f ` S) homotopy_eqv S"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3930
  by (metis assms homeomorphic_sym homeomorphic_imp_homotopy_eqv linear_homeomorphic_image)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3931
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3932
lemma homotopy_eqv_translation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3933
    fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3934
    shows "(+) a ` S homotopy_eqv S"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3935
  using homeomorphic_imp_homotopy_eqv homeomorphic_translation homeomorphic_sym by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3936
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3937
lemma homotopy_eqv_homotopic_triviality_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3938
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3939
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3940
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3941
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3942
      and f: "continuous_on U f" "f ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3943
      and g: "continuous_on U g" "g ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3944
      and homUS: "\<And>f g. \<lbrakk>continuous_on U f; f ` U \<subseteq> S;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3945
                         continuous_on U g; g ` U \<subseteq> S\<rbrakk>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3946
                         \<Longrightarrow> homotopic_with_canon (\<lambda>x. True) U S f g"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3947
    shows "homotopic_with_canon (\<lambda>x. True) U T f g"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3948
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3949
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3950
               and k: "continuous_on T k" "k ` T \<subseteq> S"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3951
               and hom: "homotopic_with_canon (\<lambda>x. True) S S (k \<circ> h) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3952
                        "homotopic_with_canon (\<lambda>x. True) T T (h \<circ> k) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3953
    using assms by (auto simp: homotopy_equivalent_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3954
  have "homotopic_with_canon (\<lambda>f. True) U S (k \<circ> f) (k \<circ> g)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3955
  proof (rule homUS)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3956
    show "continuous_on U (k \<circ> f)" "continuous_on U (k \<circ> g)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3957
      using continuous_on_compose continuous_on_subset f g k by blast+
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3958
  qed (use f g k in \<open>(force simp: o_def)+\<close> )
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3959
  then have "homotopic_with_canon (\<lambda>x. True) U T (h \<circ> (k \<circ> f)) (h \<circ> (k \<circ> g))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3960
    by (rule homotopic_with_compose_continuous_left; simp add: h)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3961
  moreover have "homotopic_with_canon (\<lambda>x. True) U T (h \<circ> k \<circ> f) (id \<circ> f)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3962
    by (rule homotopic_with_compose_continuous_right [where X=T and Y=T]; simp add: hom f)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3963
  moreover have "homotopic_with_canon (\<lambda>x. True) U T (h \<circ> k \<circ> g) (id \<circ> g)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3964
    by (rule homotopic_with_compose_continuous_right [where X=T and Y=T]; simp add: hom g)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3965
  ultimately show "homotopic_with_canon (\<lambda>x. True) U T f g"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3966
    unfolding o_assoc
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  3967
    by (metis homotopic_with_trans homotopic_with_sym id_comp) 
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3968
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3969
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3970
lemma homotopy_eqv_homotopic_triviality:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3971
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3972
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3973
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3974
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3975
    shows "(\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3976
                   continuous_on U g \<and> g ` U \<subseteq> S
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3977
                   \<longrightarrow> homotopic_with_canon (\<lambda>x. True) U S f g) \<longleftrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3978
           (\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3979
                  continuous_on U g \<and> g ` U \<subseteq> T
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3980
                  \<longrightarrow> homotopic_with_canon (\<lambda>x. True) U T f g)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3981
      (is "?lhs = ?rhs")
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3982
proof
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3983
  assume ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3984
  then show ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3985
    by (metis assms homotopy_eqv_homotopic_triviality_imp)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3986
next
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3987
  assume ?rhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3988
  moreover
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3989
  have "T homotopy_eqv S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3990
    using assms homotopy_equivalent_space_sym by blast
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3991
  ultimately show ?lhs
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3992
    by (blast intro: homotopy_eqv_homotopic_triviality_imp)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3993
qed
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  3994
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3995
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3996
lemma homotopy_eqv_cohomotopic_triviality_null_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3997
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3998
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3999
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4000
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4001
      and f: "continuous_on T f" "f ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4002
      and homSU: "\<And>f. \<lbrakk>continuous_on S f; f ` S \<subseteq> U\<rbrakk>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4003
                      \<Longrightarrow> \<exists>c. homotopic_with_canon (\<lambda>x. True) S U f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4004
  obtains c where "homotopic_with_canon (\<lambda>x. True) T U f (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4005
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4006
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4007
               and k: "continuous_on T k" "k ` T \<subseteq> S"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4008
               and hom: "homotopic_with_canon (\<lambda>x. True) S S (k \<circ> h) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4009
                        "homotopic_with_canon (\<lambda>x. True) T T (h \<circ> k) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4010
    using assms by (auto simp: homotopy_equivalent_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4011
  obtain c where "homotopic_with_canon (\<lambda>x. True) S U (f \<circ> h) (\<lambda>x. c)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4012
  proof (rule exE [OF homSU])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4013
    show "continuous_on S (f \<circ> h)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4014
      using continuous_on_compose continuous_on_subset f h by blast
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4015
  qed (use f h in force)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4016
  then have "homotopic_with_canon (\<lambda>x. True) T U ((f \<circ> h) \<circ> k) ((\<lambda>x. c) \<circ> k)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4017
    by (rule homotopic_with_compose_continuous_right [where X=S]) (use k in auto)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4018
  moreover have "homotopic_with_canon (\<lambda>x. True) T U (f \<circ> id) (f \<circ> (h \<circ> k))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4019
    by (rule homotopic_with_compose_continuous_left [where Y=T])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4020
       (use f in \<open>auto simp add: hom homotopic_with_symD\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4021
  ultimately show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4022
    using that homotopic_with_trans by (fastforce simp add: o_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4023
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4024
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4025
lemma homotopy_eqv_cohomotopic_triviality_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4026
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4027
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4028
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4029
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4030
    shows "(\<forall>f. continuous_on S f \<and> f ` S \<subseteq> U
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4031
                \<longrightarrow> (\<exists>c. homotopic_with_canon (\<lambda>x. True) S U f (\<lambda>x. c))) \<longleftrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4032
           (\<forall>f. continuous_on T f \<and> f ` T \<subseteq> U
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4033
                \<longrightarrow> (\<exists>c. homotopic_with_canon (\<lambda>x. True) T U f (\<lambda>x. c)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4034
by (rule iffI; metis assms homotopy_eqv_cohomotopic_triviality_null_imp homotopy_equivalent_space_sym)
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4035
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4036
text \<open>Similar to the proof above\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4037
lemma homotopy_eqv_homotopic_triviality_null_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4038
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4039
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4040
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4041
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4042
      and f: "continuous_on U f" "f ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4043
      and homSU: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> S\<rbrakk>
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4044
                      \<Longrightarrow> \<exists>c. homotopic_with_canon (\<lambda>x. True) U S f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4045
    shows "\<exists>c. homotopic_with_canon (\<lambda>x. True) U T f (\<lambda>x. c)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4046
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4047
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4048
               and k: "continuous_on T k" "k ` T \<subseteq> S"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4049
               and hom: "homotopic_with_canon (\<lambda>x. True) S S (k \<circ> h) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4050
                        "homotopic_with_canon (\<lambda>x. True) T T (h \<circ> k) id"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4051
    using assms by (auto simp: homotopy_equivalent_space_def)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4052
  obtain c::'a where "homotopic_with_canon (\<lambda>x. True) U S (k \<circ> f) (\<lambda>x. c)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4053
  proof (rule exE [OF homSU [of "k \<circ> f"]])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4054
    show "continuous_on U (k \<circ> f)"
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4055
      using continuous_on_compose continuous_on_subset f k by blast
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4056
  qed (use f k in force)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4057
  then have "homotopic_with_canon (\<lambda>x. True) U T (h \<circ> (k \<circ> f)) (h \<circ> (\<lambda>x. c))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4058
    by (rule homotopic_with_compose_continuous_left [where Y=S]) (use h in auto)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4059
  moreover have "homotopic_with_canon (\<lambda>x. True) U T (id \<circ> f) ((h \<circ> k) \<circ> f)"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4060
    by (rule homotopic_with_compose_continuous_right [where X=T])
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4061
       (use f in \<open>auto simp add: hom homotopic_with_symD\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4062
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4063
    using homotopic_with_trans by (fastforce simp add: o_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4064
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4065
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4066
lemma homotopy_eqv_homotopic_triviality_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4067
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4068
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4069
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4070
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4071
    shows "(\<forall>f. continuous_on U f \<and> f ` U \<subseteq> S
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4072
                  \<longrightarrow> (\<exists>c. homotopic_with_canon (\<lambda>x. True) U S f (\<lambda>x. c))) \<longleftrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4073
           (\<forall>f. continuous_on U f \<and> f ` U \<subseteq> T
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4074
                  \<longrightarrow> (\<exists>c. homotopic_with_canon (\<lambda>x. True) U T f (\<lambda>x. c)))"
71745
ad84f8a712b4 cleaning up Homotopy
paulson <lp15@cam.ac.uk>
parents: 71633
diff changeset
  4075
by (rule iffI; metis assms homotopy_eqv_homotopic_triviality_null_imp homotopy_equivalent_space_sym)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4076
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4077
lemma homotopy_eqv_contractible_sets:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4078
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4079
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4080
  assumes "contractible S" "contractible T" "S = {} \<longleftrightarrow> T = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4081
    shows "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4082
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4083
  case True with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4084
    by (simp add: homeomorphic_imp_homotopy_eqv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4085
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4086
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4087
  with assms obtain a b where "a \<in> S" "b \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4088
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4089
  then show ?thesis
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4090
    unfolding homotopy_equivalent_space_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4091
    apply (rule_tac x="\<lambda>x. b" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4092
    apply (rule_tac x="\<lambda>x. a" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4093
    apply (intro assms conjI continuous_on_id' homotopic_into_contractible)
71172
nipkow
parents: 70817
diff changeset
  4094
    apply (auto simp: o_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4095
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4096
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4097
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4098
lemma homotopy_eqv_empty1 [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4099
  fixes S :: "'a::real_normed_vector set"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4100
  shows "S homotopy_eqv ({}::'b::real_normed_vector set) \<longleftrightarrow> S = {}" (is "?lhs = ?rhs")
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4101
proof
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4102
  assume ?lhs then show ?rhs
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4103
    by (metis continuous_map_subtopology_eu empty_iff equalityI homotopy_equivalent_space_def image_subset_iff subsetI)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4104
qed (simp add: homotopy_eqv_contractible_sets)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4105
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4106
lemma homotopy_eqv_empty2 [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4107
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4108
  shows "({}::'b::real_normed_vector set) homotopy_eqv S \<longleftrightarrow> S = {}"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4109
  using homotopy_equivalent_space_sym homotopy_eqv_empty1 by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4110
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4111
lemma homotopy_eqv_contractibility:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4112
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4113
  shows "S homotopy_eqv T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  4114
  by (meson contractible_space_top_of_set homotopy_equivalent_space_contractibility)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4115
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4116
lemma homotopy_eqv_sing:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4117
  fixes S :: "'a::real_normed_vector set" and a :: "'b::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4118
  shows "S homotopy_eqv {a} \<longleftrightarrow> S \<noteq> {} \<and> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4119
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4120
  case True then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4121
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4122
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4123
  case False then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4124
    by (metis contractible_sing empty_not_insert homotopy_eqv_contractibility homotopy_eqv_contractible_sets)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4125
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4126
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4127
lemma homeomorphic_contractible_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4128
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4129
  shows "S homeomorphic T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4130
by (simp add: homeomorphic_imp_homotopy_eqv homotopy_eqv_contractibility)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4131
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4132
lemma homeomorphic_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4133
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4134
  shows "\<lbrakk>contractible S; S homeomorphic T\<rbrakk> \<Longrightarrow> contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4135
  by (metis homeomorphic_contractible_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4136
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4137
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4138
subsection\<^marker>\<open>tag unimportant\<close>\<open>Misc other results\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4139
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4140
lemma bounded_connected_Compl_real:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4141
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4142
  assumes "bounded S" and conn: "connected(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4143
    shows "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4144
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4145
  obtain a b where "S \<subseteq> box a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4146
    by (meson assms bounded_subset_box_symmetric)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4147
  then have "a \<notin> S" "b \<notin> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4148
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4149
  then have "\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> - S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4150
    by (meson Compl_iff conn connected_iff_interval)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4151
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4152
    using \<open>S \<subseteq> box a b\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4153
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4154
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69768
diff changeset
  4155
corollary bounded_path_connected_Compl_real:
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69768
diff changeset
  4156
  fixes S :: "real set"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69768
diff changeset
  4157
  assumes "bounded S" "path_connected(- S)" shows "S = {}"
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69768
diff changeset
  4158
  by (simp add: assms bounded_connected_Compl_real path_connected_imp_connected)
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69768
diff changeset
  4159
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4160
lemma bounded_connected_Compl_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4161
  fixes S :: "'a::{euclidean_space} set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4162
  assumes "bounded S" and conn: "connected(- S)" and 1: "DIM('a) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4163
    shows "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4164
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4165
  have "DIM('a) = DIM(real)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4166
    by (simp add: "1")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4167
  then obtain f::"'a \<Rightarrow> real" and g
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4168
  where "linear f" "\<And>x. norm(f x) = norm x" and fg: "\<And>x. g(f x) = x" "\<And>y. f(g y) = y"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4169
    by (rule isomorphisms_UNIV_UNIV) blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4170
  with \<open>bounded S\<close> have "bounded (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4171
    using bounded_linear_image linear_linear by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4172
  have "bij f" by (metis fg bijI')
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4173
  have "connected (f ` (-S))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4174
    using connected_linear_image assms \<open>linear f\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4175
  moreover have "f ` (-S) = - (f ` S)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4176
    by (simp add: \<open>bij f\<close> bij_image_Compl_eq)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4177
  finally have "connected (- (f ` S))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4178
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4179
  then have "f ` S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4180
    using \<open>bounded (f ` S)\<close> bounded_connected_Compl_real by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4181
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4182
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4183
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4184
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4185
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4186
subsection\<^marker>\<open>tag unimportant\<close>\<open>Some Uncountable Sets\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4187
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4188
lemma uncountable_closed_segment:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4189
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4190
  assumes "a \<noteq> b" shows "uncountable (closed_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4191
unfolding path_image_linepath [symmetric] path_image_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4192
  using inj_on_linepath [OF assms] uncountable_closed_interval [of 0 1]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4193
        countable_image_inj_on by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4194
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4195
lemma uncountable_open_segment:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4196
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4197
  assumes "a \<noteq> b" shows "uncountable (open_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4198
  by (simp add: assms open_segment_def uncountable_closed_segment uncountable_minus_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4199
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4200
lemma uncountable_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4201
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4202
  assumes "convex S" "a \<in> S" "b \<in> S" "a \<noteq> b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4203
    shows "uncountable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4204
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4205
  have "uncountable (closed_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4206
    by (simp add: uncountable_closed_segment assms)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4207
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4208
    by (meson assms convex_contains_segment countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4209
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4210
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4211
lemma uncountable_ball:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4212
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4213
  assumes "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4214
    shows "uncountable (ball a r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4215
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4216
  have "uncountable (open_segment a (a + r *\<^sub>R (SOME i. i \<in> Basis)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4217
    by (metis Basis_zero SOME_Basis add_cancel_right_right assms less_le scale_eq_0_iff uncountable_open_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4218
  moreover have "open_segment a (a + r *\<^sub>R (SOME i. i \<in> Basis)) \<subseteq> ball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4219
    using assms by (auto simp: in_segment algebra_simps dist_norm SOME_Basis)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4220
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4221
    by (metis countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4222
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4223
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4224
lemma ball_minus_countable_nonempty:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4225
  assumes "countable (A :: 'a :: euclidean_space set)" "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4226
  shows   "ball z r - A \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4227
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4228
  assume *: "ball z r - A = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4229
  have "uncountable (ball z r - A)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4230
    by (intro uncountable_minus_countable assms uncountable_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4231
  thus False by (subst (asm) *) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4232
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4233
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4234
lemma uncountable_cball:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4235
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4236
  assumes "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4237
  shows "uncountable (cball a r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4238
  using assms countable_subset uncountable_ball by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4239
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4240
lemma pairwise_disjnt_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4241
  fixes \<N> :: "nat set set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4242
  assumes "pairwise disjnt \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4243
    shows "countable \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4244
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4245
  have "inj_on (\<lambda>X. SOME n. n \<in> X) (\<N> - {{}})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4246
    apply (clarsimp simp add: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4247
    by (metis assms disjnt_insert2 insert_absorb pairwise_def subsetI subset_empty tfl_some)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4248
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4249
    by (metis countable_Diff_eq countable_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4250
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4251
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4252
lemma pairwise_disjnt_countable_Union:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4253
    assumes "countable (\<Union>\<N>)" and pwd: "pairwise disjnt \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4254
    shows "countable \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4255
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4256
  obtain f :: "_ \<Rightarrow> nat" where f: "inj_on f (\<Union>\<N>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4257
    using assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4258
  then have "pairwise disjnt (\<Union> X \<in> \<N>. {f ` X})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4259
    using assms by (force simp: pairwise_def disjnt_inj_on_iff [OF f])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4260
  then have "countable (\<Union> X \<in> \<N>. {f ` X})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4261
    using pairwise_disjnt_countable by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4262
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4263
    by (meson pwd countable_image_inj_on disjoint_image f inj_on_image pairwise_disjnt_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4264
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4265
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4266
lemma connected_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4267
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4268
  assumes "connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4269
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4270
  have "continuous_on S (dist a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4271
    by (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4272
  then have "connected (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4273
    by (metis connected_continuous_image \<open>connected S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4274
  then have "closed_segment 0 (dist a b) \<subseteq> (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4275
    by (simp add: assms closed_segment_subset is_interval_connected_1 is_interval_convex)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4276
  then have "uncountable (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4277
    by (metis \<open>a \<noteq> b\<close> countable_subset dist_eq_0_iff uncountable_closed_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4278
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4279
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4280
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4281
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4282
lemma path_connected_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4283
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4284
  assumes "path_connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4285
  using path_connected_imp_connected assms connected_uncountable by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4286
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4287
lemma connected_finite_iff_sing:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4288
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4289
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4290
  shows "finite S \<longleftrightarrow> S = {} \<or> (\<exists>a. S = {a})"  (is "_ = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4291
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4292
  have "uncountable S" if "\<not> ?rhs"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4293
    using connected_uncountable assms that by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4294
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4295
    using uncountable_infinite by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4296
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4297
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4298
lemma connected_card_eq_iff_nontrivial:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4299
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4300
  shows "connected S \<Longrightarrow> uncountable S \<longleftrightarrow> \<not>(\<exists>a. S \<subseteq> {a})"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4301
  by (metis connected_uncountable finite.emptyI finite.insertI rev_finite_subset singleton_iff subsetI uncountable_infinite)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4302
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4303
lemma simple_path_image_uncountable: 
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4304
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4305
  assumes "simple_path g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4306
  shows "uncountable (path_image g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4307
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4308
  have "g 0 \<in> path_image g" "g (1/2) \<in> path_image g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4309
    by (simp_all add: path_defs)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4310
  moreover have "g 0 \<noteq> g (1/2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4311
    using assms by (fastforce simp add: simple_path_def)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4312
  ultimately have "\<forall>a. \<not> path_image g \<subseteq> {a}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4313
    by blast
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4314
  then show ?thesis
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4315
    using assms connected_simple_path_image connected_uncountable by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4316
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4317
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4318
lemma arc_image_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4319
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4320
  assumes "arc g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4321
  shows "uncountable (path_image g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4322
  by (simp add: arc_imp_simple_path assms simple_path_image_uncountable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4323
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4324
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4325
subsection\<^marker>\<open>tag unimportant\<close>\<open> Some simple positive connection theorems\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4326
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4327
proposition path_connected_convex_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4328
  fixes U :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4329
  assumes "convex U" "\<not> collinear U" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4330
    shows "path_connected(U - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4331
proof (clarsimp simp add: path_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4332
  fix a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4333
  assume "a \<in> U" "a \<notin> S" "b \<in> U" "b \<notin> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4334
  let ?m = "midpoint a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4335
  show "\<exists>g. path g \<and> path_image g \<subseteq> U - S \<and> pathstart g = a \<and> pathfinish g = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4336
  proof (cases "a = b")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4337
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4338
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4339
      by (metis DiffI \<open>a \<in> U\<close> \<open>a \<notin> S\<close> path_component_def path_component_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4340
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4341
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4342
    then have "a \<noteq> ?m" "b \<noteq> ?m"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4343
      using midpoint_eq_endpoint by fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4344
    have "?m \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4345
      using \<open>a \<in> U\<close> \<open>b \<in> U\<close> \<open>convex U\<close> convex_contains_segment by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4346
    obtain c where "c \<in> U" and nc_abc: "\<not> collinear {a,b,c}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4347
      by (metis False \<open>a \<in> U\<close> \<open>b \<in> U\<close> \<open>\<not> collinear U\<close> collinear_triples insert_absorb)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4348
    have ncoll_mca: "\<not> collinear {?m,c,a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4349
      by (metis (full_types) \<open>a \<noteq> ?m\<close> collinear_3_trans collinear_midpoint insert_commute nc_abc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4350
    have ncoll_mcb: "\<not> collinear {?m,c,b}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4351
      by (metis (full_types) \<open>b \<noteq> ?m\<close> collinear_3_trans collinear_midpoint insert_commute nc_abc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4352
    have "c \<noteq> ?m"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4353
      by (metis collinear_midpoint insert_commute nc_abc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4354
    then have "closed_segment ?m c \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4355
      by (simp add: \<open>c \<in> U\<close> \<open>?m \<in> U\<close> \<open>convex U\<close> closed_segment_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4356
    then obtain z where z: "z \<in> closed_segment ?m c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4357
                    and disjS: "(closed_segment a z \<union> closed_segment z b) \<inter> S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4358
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4359
      have False if "closed_segment ?m c \<subseteq> {z. (closed_segment a z \<union> closed_segment z b) \<inter> S \<noteq> {}}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4360
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4361
        have closb: "closed_segment ?m c \<subseteq>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4362
                 {z \<in> closed_segment ?m c. closed_segment a z \<inter> S \<noteq> {}} \<union> {z \<in> closed_segment ?m c. closed_segment z b \<inter> S \<noteq> {}}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4363
          using that by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4364
        have *: "countable {z \<in> closed_segment ?m c. closed_segment z u \<inter> S \<noteq> {}}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4365
          if "u \<in> U" "u \<notin> S" and ncoll: "\<not> collinear {?m, c, u}" for u
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4366
        proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4367
          have **: False if x1: "x1 \<in> closed_segment ?m c" and x2: "x2 \<in> closed_segment ?m c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4368
                            and "x1 \<noteq> x2" "x1 \<noteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4369
                            and w: "w \<in> closed_segment x1 u" "w \<in> closed_segment x2 u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4370
                            and "w \<in> S" for x1 x2 w
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4371
          proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4372
            have "x1 \<in> affine hull {?m,c}" "x2 \<in> affine hull {?m,c}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4373
              using segment_as_ball x1 x2 by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4374
            then have coll_x1: "collinear {x1, ?m, c}" and coll_x2: "collinear {?m, c, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4375
              by (simp_all add: affine_hull_3_imp_collinear) (metis affine_hull_3_imp_collinear insert_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4376
            have "\<not> collinear {x1, u, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4377
            proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4378
              assume "collinear {x1, u, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4379
              then have "collinear {?m, c, u}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4380
                by (metis (full_types) \<open>c \<noteq> ?m\<close> coll_x1 coll_x2 collinear_3_trans insert_commute ncoll \<open>x1 \<noteq> x2\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4381
              with ncoll show False ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4382
            qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4383
            then have "closed_segment x1 u \<inter> closed_segment u x2 = {u}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4384
              by (blast intro!: Int_closed_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4385
            then have "w = u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4386
              using closed_segment_commute w by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4387
            show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4388
              using \<open>u \<notin> S\<close> \<open>w = u\<close> that(7) by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4389
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4390
          then have disj: "disjoint ((\<Union>z\<in>closed_segment ?m c. {closed_segment z u \<inter> S}))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4391
            by (fastforce simp: pairwise_def disjnt_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4392
          have cou: "countable ((\<Union>z \<in> closed_segment ?m c. {closed_segment z u \<inter> S}) - {{}})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4393
            apply (rule pairwise_disjnt_countable_Union [OF _ pairwise_subset [OF disj]])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4394
             apply (rule countable_subset [OF _ \<open>countable S\<close>], auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4395
            done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4396
          define f where "f \<equiv> \<lambda>X. (THE z. z \<in> closed_segment ?m c \<and> X = closed_segment z u \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4397
          show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4398
          proof (rule countable_subset [OF _ countable_image [OF cou, where f=f]], clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4399
            fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4400
            assume x: "x \<in> closed_segment ?m c" "closed_segment x u \<inter> S \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4401
            show "x \<in> f ` ((\<Union>z\<in>closed_segment ?m c. {closed_segment z u \<inter> S}) - {{}})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4402
            proof (rule_tac x="closed_segment x u \<inter> S" in image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4403
              show "x = f (closed_segment x u \<inter> S)"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4404
                unfolding f_def 
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4405
                by (rule the_equality [symmetric]) (use x in \<open>auto dest: **\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4406
            qed (use x in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4407
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4408
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4409
        have "uncountable (closed_segment ?m c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4410
          by (metis \<open>c \<noteq> ?m\<close> uncountable_closed_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4411
        then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4412
          using closb * [OF \<open>a \<in> U\<close> \<open>a \<notin> S\<close> ncoll_mca] * [OF \<open>b \<in> U\<close> \<open>b \<notin> S\<close> ncoll_mcb]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4413
          apply (simp add: closed_segment_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4414
          by (simp add: countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4415
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4416
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4417
        by (force intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4418
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4419
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4420
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4421
      have "path_image (linepath a z +++ linepath z b) \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4422
        by (metis \<open>a \<in> U\<close> \<open>b \<in> U\<close> \<open>closed_segment ?m c \<subseteq> U\<close> z \<open>convex U\<close> closed_segment_subset contra_subsetD path_image_linepath subset_path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4423
      with disjS show "path_image (linepath a z +++ linepath z b) \<subseteq> U - S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4424
        by (force simp: path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4425
    qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4426
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4427
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4428
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4429
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4430
corollary connected_convex_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4431
  fixes U :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4432
  assumes "convex U" "\<not> collinear U" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4433
  shows "connected(U - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4434
  by (simp add: assms path_connected_convex_diff_countable path_connected_imp_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4435
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4436
lemma path_connected_punctured_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4437
  assumes "convex S" and aff: "aff_dim S \<noteq> 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4438
    shows "path_connected(S - {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4439
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4440
  consider "aff_dim S = -1" | "aff_dim S = 0" | "aff_dim S \<ge> 2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4441
    using assms aff_dim_geq [of S] by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4442
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4443
  proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4444
    assume "aff_dim S = -1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4445
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4446
      by (metis aff_dim_empty empty_Diff path_connected_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4447
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4448
    assume "aff_dim S = 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4449
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4450
      by (metis aff_dim_eq_0 Diff_cancel Diff_empty Diff_insert0 convex_empty convex_imp_path_connected path_connected_singleton singletonD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4451
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4452
    assume ge2: "aff_dim S \<ge> 2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4453
    then have "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4454
    proof (clarsimp simp add: collinear_affine_hull)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4455
      fix u v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4456
      assume "S \<subseteq> affine hull {u, v}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4457
      then have "aff_dim S \<le> aff_dim {u, v}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4458
        by (metis (no_types) aff_dim_affine_hull aff_dim_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4459
      with ge2 show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4460
        by (metis (no_types) aff_dim_2 antisym aff not_numeral_le_zero one_le_numeral order_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4461
    qed
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4462
    moreover have "countable {a}"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4463
      by simp
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4464
    ultimately show ?thesis
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4465
      by (metis path_connected_convex_diff_countable [OF \<open>convex S\<close>])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4466
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4467
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4468
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4469
lemma connected_punctured_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4470
  shows "\<lbrakk>convex S; aff_dim S \<noteq> 1\<rbrakk> \<Longrightarrow> connected(S - {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4471
  using path_connected_imp_connected path_connected_punctured_convex by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4472
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4473
lemma path_connected_complement_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4474
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4475
  assumes "2 \<le> DIM('a)" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4476
  shows "path_connected(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4477
proof -
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4478
  have "\<not> collinear (UNIV::'a set)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4479
    using assms by (auto simp: collinear_aff_dim [of "UNIV :: 'a set"])
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4480
  then have "path_connected(UNIV - S)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4481
    by (simp add: \<open>countable S\<close> path_connected_convex_diff_countable)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4482
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4483
    by (simp add: Compl_eq_Diff_UNIV)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4484
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4485
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4486
proposition path_connected_openin_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4487
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4488
  assumes "connected S" and ope: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4489
      and "\<not> collinear S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4490
    shows "path_connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4491
proof (clarsimp simp add: path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4492
  fix x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4493
  assume xy: "x \<in> S" "x \<notin> T" "y \<in> S" "y \<notin> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4494
  show "path_component (S - T) x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4495
  proof (rule connected_equivalence_relation_gen [OF \<open>connected S\<close>, where P = "\<lambda>x. x \<notin> T"])
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4496
    show "\<exists>z. z \<in> U \<and> z \<notin> T" if opeU: "openin (top_of_set S) U" and "x \<in> U" for U x
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4497
    proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4498
      have "openin (top_of_set (affine hull S)) U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4499
        using opeU ope openin_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4500
      with \<open>x \<in> U\<close> obtain r where Usub: "U \<subseteq> affine hull S" and "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4501
                              and subU: "ball x r \<inter> affine hull S \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4502
        by (auto simp: openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4503
      with \<open>x \<in> U\<close> have x: "x \<in> ball x r \<inter> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4504
        by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4505
      have "\<not> S \<subseteq> {x}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4506
        using \<open>\<not> collinear S\<close>  collinear_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4507
      then obtain x' where "x' \<noteq> x" "x' \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4508
        by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4509
      obtain y where y: "y \<noteq> x" "y \<in> ball x r \<inter> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4510
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4511
        show "x + (r / 2 / norm(x' - x)) *\<^sub>R (x' - x) \<noteq> x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4512
          using \<open>x' \<noteq> x\<close> \<open>r > 0\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4513
        show "x + (r / 2 / norm (x' - x)) *\<^sub>R (x' - x) \<in> ball x r \<inter> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4514
          using \<open>x' \<noteq> x\<close> \<open>r > 0\<close> \<open>x' \<in> S\<close> x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4515
          by (simp add: dist_norm mem_affine_3_minus hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4516
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4517
      have "convex (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4518
        by (simp add: affine_imp_convex convex_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4519
      with x y subU have "uncountable U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4520
        by (meson countable_subset uncountable_convex)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4521
      then have "\<not> U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4522
        using \<open>countable T\<close> countable_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4523
      then show ?thesis by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4524
    qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4525
    show "\<exists>U. openin (top_of_set S) U \<and> x \<in> U \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4526
              (\<forall>x\<in>U. \<forall>y\<in>U. x \<notin> T \<and> y \<notin> T \<longrightarrow> path_component (S - T) x y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4527
          if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4528
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4529
      obtain r where Ssub: "S \<subseteq> affine hull S" and "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4530
                 and subS: "ball x r \<inter> affine hull S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4531
        using ope \<open>x \<in> S\<close> by (auto simp: openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4532
      then have conv: "convex (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4533
        by (simp add: affine_imp_convex convex_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4534
      have "\<not> aff_dim (affine hull S) \<le> 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4535
        using \<open>\<not> collinear S\<close> collinear_aff_dim by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4536
      then have "\<not> collinear (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4537
        apply (simp add: collinear_aff_dim)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4538
        by (metis (no_types, hide_lams) aff_dim_convex_Int_open IntI open_ball \<open>0 < r\<close> aff_dim_affine_hull affine_affine_hull affine_imp_convex centre_in_ball empty_iff hull_subset inf_commute subsetCE that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4539
      then have *: "path_connected ((ball x r \<inter> affine hull S) - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4540
        by (rule path_connected_convex_diff_countable [OF conv _ \<open>countable T\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4541
      have ST: "ball x r \<inter> affine hull S - T \<subseteq> S - T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4542
        using subS by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4543
      show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4544
      proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4545
        show "x \<in> ball x r \<inter> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4546
          using \<open>x \<in> S\<close> \<open>r > 0\<close> by (simp add: hull_inc)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4547
        have "openin (top_of_set (affine hull S)) (ball x r \<inter> affine hull S)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4548
          by (subst inf.commute) (simp add: openin_Int_open)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4549
        then show "openin (top_of_set S) (ball x r \<inter> affine hull S)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4550
          by (rule openin_subset_trans [OF _ subS Ssub])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4551
      qed (use * path_component_trans in \<open>auto simp: path_connected_component path_component_of_subset [OF ST]\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4552
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4553
  qed (use xy path_component_trans in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4554
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4555
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4556
corollary connected_openin_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4557
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4558
  assumes "connected S" and ope: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4559
      and "\<not> collinear S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4560
    shows "connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4561
  by (metis path_connected_imp_connected path_connected_openin_diff_countable [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4562
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4563
corollary path_connected_open_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4564
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4565
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4566
  shows "path_connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4567
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4568
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4569
  then show ?thesis
71172
nipkow
parents: 70817
diff changeset
  4570
    by (simp)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4571
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4572
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4573
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4574
  proof (rule path_connected_openin_diff_countable)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4575
    show "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4576
      by (simp add: assms hull_subset open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4577
    show "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4578
      using assms False by (simp add: collinear_aff_dim aff_dim_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4579
  qed (simp_all add: assms)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4580
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4581
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4582
corollary connected_open_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4583
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4584
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4585
  shows "connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4586
by (simp add: assms path_connected_imp_connected path_connected_open_diff_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4587
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4588
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4589
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4590
subsection\<^marker>\<open>tag unimportant\<close> \<open>Self-homeomorphisms shuffling points about\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4591
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4592
subsubsection\<^marker>\<open>tag unimportant\<close>\<open>The theorem \<open>homeomorphism_moving_points_exists\<close>\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4593
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4594
lemma homeomorphism_moving_point_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4595
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4596
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4597
  obtains f g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4598
                    "f a = u" "\<And>x. x \<in> sphere a r \<Longrightarrow> f x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4599
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4600
  have nou: "norm (u - a) < r" and "u \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4601
    using u by (auto simp: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4602
  then have "0 < r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4603
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4604
  define f where "f \<equiv> \<lambda>x. (1 - norm(x - a) / r) *\<^sub>R (u - a) + x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4605
  have *: "False" if eq: "x + (norm y / r) *\<^sub>R u = y + (norm x / r) *\<^sub>R u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4606
                  and nou: "norm u < r" and yx: "norm y < norm x" for x y and u::'a
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4607
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4608
    have "x = y + (norm x / r - (norm y / r)) *\<^sub>R u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4609
      using eq by (simp add: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4610
    then have "norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4611
      by (metis diff_divide_distrib)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4612
    also have "\<dots> \<le> norm y + norm(((norm x - norm y) / r) *\<^sub>R u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4613
      using norm_triangle_ineq by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4614
    also have "\<dots> = norm y + (norm x - norm y) * (norm u / r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4615
      using yx \<open>r > 0\<close>
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  4616
      by (simp add: field_split_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4617
    also have "\<dots> < norm y + (norm x - norm y) * 1"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4618
    proof (subst add_less_cancel_left)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4619
      show "(norm x - norm y) * (norm u / r) < (norm x - norm y) * 1"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4620
      proof (rule mult_strict_left_mono)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4621
        show "norm u / r < 1"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4622
          using \<open>0 < r\<close> divide_less_eq_1_pos nou by blast
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4623
      qed (simp add: yx)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4624
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4625
    also have "\<dots> = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4626
      by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4627
    finally show False by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4628
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4629
  have "inj f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4630
    unfolding f_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4631
  proof (clarsimp simp: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4632
    fix x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4633
    assume "(1 - norm (x - a) / r) *\<^sub>R (u - a) + x =
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4634
            (1 - norm (y - a) / r) *\<^sub>R (u - a) + y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4635
    then have eq: "(x - a) + (norm (y - a) / r) *\<^sub>R (u - a) = (y - a) + (norm (x - a) / r) *\<^sub>R (u - a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4636
      by (auto simp: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4637
    show "x=y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4638
    proof (cases "norm (x - a) = norm (y - a)")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4639
      case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4640
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4641
        using eq by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4642
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4643
      case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4644
      then consider "norm (x - a) < norm (y - a)" | "norm (x - a) > norm (y - a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4645
        by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4646
      then have "False"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4647
      proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4648
        case 1 show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4649
          using * [OF _ nou 1] eq by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4650
      next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4651
        case 2 with * [OF eq nou] show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4652
          by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4653
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4654
      then show "x=y" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4655
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4656
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4657
  then have inj_onf: "inj_on f (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4658
    using inj_on_Int by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4659
  have contf: "continuous_on (cball a r \<inter> T) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4660
    unfolding f_def using \<open>0 < r\<close>  by (intro continuous_intros) blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4661
  have fim: "f ` (cball a r \<inter> T) = cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4662
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4663
    have *: "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r" if "norm y \<le> r" "norm u < r" for y u::'a
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4664
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4665
      have "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm((1 - norm y / r) *\<^sub>R u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4666
        using norm_triangle_ineq by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4667
      also have "\<dots> = norm y + abs(1 - norm y / r) * norm u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4668
        by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4669
      also have "\<dots> \<le> r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4670
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4671
        have "(r - norm u) * (r - norm y) \<ge> 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4672
          using that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4673
        then have "r * norm u + r * norm y \<le> r * r + norm u * norm y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4674
          by (simp add: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4675
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4676
        using that \<open>0 < r\<close> by (simp add: abs_if field_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4677
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4678
      finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4679
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4680
    have "f ` (cball a r) \<subseteq> cball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4681
      apply (clarsimp simp add: dist_norm norm_minus_commute f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4682
      using * by (metis diff_add_eq diff_diff_add diff_diff_eq2 norm_minus_commute nou)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4683
    moreover have "f ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4684
      unfolding f_def using \<open>affine T\<close> \<open>a \<in> T\<close> \<open>u \<in> T\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4685
      by (force simp: add.commute mem_affine_3_minus)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4686
    ultimately show "f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4687
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4688
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4689
    show "cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4690
    proof (clarsimp simp add: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4691
      fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4692
      assume x: "norm (x - a) \<le> r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4693
      have "\<exists>v \<in> {0..1}. ((1 - v) * r - norm ((x - a) - v *\<^sub>R (u - a))) \<bullet> 1 = 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4694
        by (rule ivt_decreasing_component_on_1) (auto simp: x continuous_intros)
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4695
      then obtain v where "0 \<le> v" "v \<le> 1"
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4696
        and v: "(1 - v) * r = norm ((x - a) - v *\<^sub>R (u - a))"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4697
        by auto
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4698
      then have n: "norm (a - (x - v *\<^sub>R (u - a))) = r - r * v"
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4699
        by (simp add: field_simps norm_minus_commute)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4700
      show "x \<in> f ` (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4701
      proof (rule image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4702
        show "x = f (x - v *\<^sub>R (u - a))"
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4703
          using \<open>r > 0\<close> v by (simp add: f_def) (simp add: field_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4704
        have "x - v *\<^sub>R (u - a) \<in> cball a r"
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4705
          using \<open>r > 0\<close>\<open>0 \<le> v\<close>
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70196
diff changeset
  4706
          by (simp add: dist_norm n)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4707
        moreover have "x - v *\<^sub>R (u - a) \<in> T"
71172
nipkow
parents: 70817
diff changeset
  4708
          by (simp add: f_def \<open>u \<in> T\<close> \<open>x \<in> T\<close> assms mem_affine_3_minus2)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4709
        ultimately show "x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4710
          by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4711
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4712
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4713
  qed
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4714
  have "compact (cball a r \<inter> T)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4715
    by (simp add: affine_closed compact_Int_closed \<open>affine T\<close>)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4716
  then obtain g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4717
    by (metis homeomorphism_compact [OF _ contf fim inj_onf])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4718
  then show thesis
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4719
    apply (rule_tac f=f in that)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4720
    using \<open>r > 0\<close> by (simp_all add: f_def dist_norm norm_minus_commute)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4721
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4722
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4723
corollary\<^marker>\<open>tag unimportant\<close> homeomorphism_moving_point_2:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4724
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4725
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T" and v: "v \<in> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4726
  obtains f g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4727
                    "f u = v" "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> f x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4728
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4729
  have "0 < r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4730
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4731
  obtain f1 g1 where hom1: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f1 g1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4732
                 and "f1 a = u" and f1: "\<And>x. x \<in> sphere a r \<Longrightarrow> f1 x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4733
    using homeomorphism_moving_point_1 [OF \<open>affine T\<close> \<open>a \<in> T\<close> u] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4734
  obtain f2 g2 where hom2: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4735
                 and "f2 a = v" and f2: "\<And>x. x \<in> sphere a r \<Longrightarrow> f2 x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4736
    using homeomorphism_moving_point_1 [OF \<open>affine T\<close> \<open>a \<in> T\<close> v] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4737
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4738
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4739
    show "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) (f2 \<circ> g1) (f1 \<circ> g2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4740
      by (metis homeomorphism_compose homeomorphism_symD hom1 hom2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4741
    have "g1 u = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4742
      using \<open>0 < r\<close> \<open>f1 a = u\<close> assms hom1 homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4743
    then show "(f2 \<circ> g1) u = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4744
      by (simp add: \<open>f2 a = v\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4745
    show "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> (f2 \<circ> g1) x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4746
      using f1 f2 hom1 homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4747
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4748
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4749
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4750
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4751
corollary\<^marker>\<open>tag unimportant\<close> homeomorphism_moving_point_3:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4752
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4753
  assumes "affine T" "a \<in> T" and ST: "ball a r \<inter> T \<subseteq> S" "S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4754
      and u: "u \<in> ball a r \<inter> T" and v: "v \<in> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4755
  obtains f g where "homeomorphism S S f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4756
                    "f u = v" "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4757
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4758
  obtain f g where hom: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4759
               and "f u = v" and fid: "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> f x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4760
    using homeomorphism_moving_point_2 [OF \<open>affine T\<close> \<open>a \<in> T\<close> u v] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4761
  have gid: "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> g x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4762
    using fid hom homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4763
  define ff where "ff \<equiv> \<lambda>x. if x \<in> ball a r \<inter> T then f x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4764
  define gg where "gg \<equiv> \<lambda>x. if x \<in> ball a r \<inter> T then g x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4765
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4766
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4767
    show "homeomorphism S S ff gg"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4768
    proof (rule homeomorphismI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4769
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) ff"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4770
        unfolding ff_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4771
        apply (rule continuous_on_cases)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4772
        using homeomorphism_cont1 [OF hom] by (auto simp: affine_closed \<open>affine T\<close> fid)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4773
      then show "continuous_on S ff"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4774
        by (rule continuous_on_subset) (use ST in auto)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4775
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) gg"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4776
        unfolding gg_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4777
        apply (rule continuous_on_cases)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4778
        using homeomorphism_cont2 [OF hom] by (auto simp: affine_closed \<open>affine T\<close> gid)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4779
      then show "continuous_on S gg"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4780
        by (rule continuous_on_subset) (use ST in auto)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4781
      show "ff ` S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4782
      proof (clarsimp simp add: ff_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4783
        fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4784
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4785
        then have "f x \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4786
          using homeomorphism_image1 [OF hom] by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4787
        then show "f x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4788
          using ST(1) \<open>x \<in> T\<close> gid hom homeomorphism_def x by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4789
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4790
      show "gg ` S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4791
      proof (clarsimp simp add: gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4792
        fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4793
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4794
        then have "g x \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4795
          using homeomorphism_image2 [OF hom] by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4796
        then have "g x \<in> ball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4797
          using homeomorphism_apply2 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4798
            by (metis Diff_Diff_Int Diff_iff  \<open>x \<in> T\<close> cball_def fid le_less mem_Collect_eq mem_ball mem_sphere x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4799
        then show "g x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4800
          using ST(1) \<open>g x \<in> cball a r \<inter> T\<close> by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4801
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4802
      show "\<And>x. x \<in> S \<Longrightarrow> gg (ff x) = x"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4803
        unfolding ff_def gg_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4804
        using homeomorphism_apply1 [OF hom] homeomorphism_image1 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4805
        apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4806
        apply (metis Int_iff homeomorphism_apply1 [OF hom] fid image_eqI less_eq_real_def mem_cball mem_sphere)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4807
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4808
      show "\<And>x. x \<in> S \<Longrightarrow> ff (gg x) = x"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4809
        unfolding ff_def gg_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4810
        using homeomorphism_apply2 [OF hom] homeomorphism_image2 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4811
        apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4812
        apply (metis Int_iff fid image_eqI less_eq_real_def mem_cball mem_sphere)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4813
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4814
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4815
    show "ff u = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4816
      using u by (auto simp: ff_def \<open>f u = v\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4817
    show "{x. \<not> (ff x = x \<and> gg x = x)} \<subseteq> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4818
      by (auto simp: ff_def gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4819
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4820
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4821
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4822
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4823
proposition\<^marker>\<open>tag unimportant\<close> homeomorphism_moving_point:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4824
  fixes a :: "'a::euclidean_space"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4825
  assumes ope: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4826
      and "S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4827
      and TS: "T \<subseteq> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4828
      and S: "connected S" "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4829
  obtains f g where "homeomorphism T T f g" "f a = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4830
                    "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4831
                    "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4832
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4833
  have 1: "\<exists>h k. homeomorphism T T h k \<and> h (f d) = d \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4834
              {x. \<not> (h x = x \<and> k x = x)} \<subseteq> S \<and> bounded {x. \<not> (h x = x \<and> k x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4835
        if "d \<in> S" "f d \<in> S" and homfg: "homeomorphism T T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4836
        and S: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4837
        and bo: "bounded {x. \<not> (f x = x \<and> g x = x)}" for d f g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4838
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4839
    show homgf: "homeomorphism T T g f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4840
      by (metis homeomorphism_symD homfg)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4841
    then show "g (f d) = d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4842
      by (meson \<open>S \<subseteq> T\<close> homeomorphism_def subsetD \<open>d \<in> S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4843
    show "{x. \<not> (g x = x \<and> f x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4844
      using S by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4845
    show "bounded {x. \<not> (g x = x \<and> f x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4846
      using bo by (simp add: conj_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4847
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4848
  have 2: "\<exists>f g. homeomorphism T T f g \<and> f x = f2 (f1 x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4849
                 {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4850
             if "x \<in> S" "f1 x \<in> S" "f2 (f1 x) \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4851
                and hom: "homeomorphism T T f1 g1" "homeomorphism T T f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4852
                and sub: "{x. \<not> (f1 x = x \<and> g1 x = x)} \<subseteq> S"   "{x. \<not> (f2 x = x \<and> g2 x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4853
                and bo: "bounded {x. \<not> (f1 x = x \<and> g1 x = x)}"  "bounded {x. \<not> (f2 x = x \<and> g2 x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4854
             for x f1 f2 g1 g2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4855
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4856
    show homgf: "homeomorphism T T (f2 \<circ> f1) (g1 \<circ> g2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4857
      by (metis homeomorphism_compose hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4858
    then show "(f2 \<circ> f1) x = f2 (f1 x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4859
      by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4860
    show "{x. \<not> ((f2 \<circ> f1) x = x \<and> (g1 \<circ> g2) x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4861
      using sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4862
    have "bounded ({x. \<not>(f1 x = x \<and> g1 x = x)} \<union> {x. \<not>(f2 x = x \<and> g2 x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4863
      using bo by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4864
    then show "bounded {x. \<not> ((f2 \<circ> f1) x = x \<and> (g1 \<circ> g2) x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4865
      by (rule bounded_subset) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4866
  qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4867
  have 3: "\<exists>U. openin (top_of_set S) U \<and>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4868
              d \<in> U \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4869
              (\<forall>x\<in>U.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4870
                  \<exists>f g. homeomorphism T T f g \<and> f d = x \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4871
                        {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4872
                        bounded {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4873
           if "d \<in> S" for d
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4874
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4875
    obtain r where "r > 0" and r: "ball d r \<inter> affine hull S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4876
      by (metis \<open>d \<in> S\<close> ope openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4877
    have *: "\<exists>f g. homeomorphism T T f g \<and> f d = e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4878
                   {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4879
                   bounded {x. \<not> (f x = x \<and> g x = x)}" if "e \<in> S" "e \<in> ball d r" for e
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4880
      apply (rule homeomorphism_moving_point_3 [of "affine hull S" d r T d e])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4881
      using r \<open>S \<subseteq> T\<close> TS that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4882
            apply (auto simp: \<open>d \<in> S\<close> \<open>0 < r\<close> hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4883
      using bounded_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4884
    show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4885
      by (rule_tac x="S \<inter> ball d r" in exI) (fastforce simp: openin_open_Int \<open>0 < r\<close> that intro: *)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4886
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4887
  have "\<exists>f g. homeomorphism T T f g \<and> f a = b \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4888
              {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4889
    by (rule connected_equivalence_relation [OF S]; blast intro: 1 2 3)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4890
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4891
    using that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4892
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4893
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4894
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4895
lemma homeomorphism_moving_points_exists_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4896
  assumes K: "finite K" "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4897
             "pairwise (\<lambda>i j. (x i \<noteq> x j) \<and> (y i \<noteq> y j)) K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4898
      and "2 \<le> aff_dim S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4899
      and ope: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4900
      and "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4901
  shows "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(x i) = y i) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4902
               {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4903
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4904
proof (induction K)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4905
  case empty
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4906
  then show ?case
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4907
    by (force simp: homeomorphism_ident)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4908
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4909
  case (insert i K)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4910
  then have xney: "\<And>j. \<lbrakk>j \<in> K; j \<noteq> i\<rbrakk> \<Longrightarrow> x i \<noteq> x j \<and> y i \<noteq> y j"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4911
       and pw: "pairwise (\<lambda>i j. x i \<noteq> x j \<and> y i \<noteq> y j) K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4912
       and "x i \<in> S" "y i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4913
       and xyS: "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4914
    by (simp_all add: pairwise_insert)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4915
  obtain f g where homfg: "homeomorphism T T f g" and feq: "\<And>i. i \<in> K \<Longrightarrow> f(x i) = y i"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4916
               and fg_sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4917
               and bo_fg: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4918
    using insert.IH [OF xyS pw] insert.prems by (blast intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4919
  then have "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(x i) = y i) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4920
                   {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4921
    using insert by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4922
  have aff_eq: "affine hull (S - y ` K) = affine hull S"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4923
  proof (rule affine_hull_Diff [OF ope])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4924
    show "finite (y ` K)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4925
      by (simp add: insert.hyps(1))
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4926
    show "y ` K \<subset> S"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4927
      using \<open>y i \<in> S\<close> insert.hyps(2) xney xyS by fastforce
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4928
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4929
  have f_in_S: "f x \<in> S" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4930
    using homfg fg_sub homeomorphism_apply1 \<open>S \<subseteq> T\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4931
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4932
    have "(f (f x) \<noteq> f x \<or> g (f x) \<noteq> f x) \<or> f x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4933
      by (metis \<open>S \<subseteq> T\<close> homfg subsetD homeomorphism_apply1 that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4934
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4935
      using fg_sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4936
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4937
  obtain h k where homhk: "homeomorphism T T h k" and heq: "h (f (x i)) = y i"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4938
               and hk_sub: "{x. \<not> (h x = x \<and> k x = x)} \<subseteq> S - y ` K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4939
               and bo_hk:  "bounded {x. \<not> (h x = x \<and> k x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4940
  proof (rule homeomorphism_moving_point [of "S - y`K" T "f(x i)" "y i"])
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4941
    show "openin (top_of_set (affine hull (S - y ` K))) (S - y ` K)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4942
      by (simp add: aff_eq openin_diff finite_imp_closedin image_subset_iff hull_inc insert xyS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4943
    show "S - y ` K \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4944
      using \<open>S \<subseteq> T\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4945
    show "T \<subseteq> affine hull (S - y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4946
      using insert by (simp add: aff_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4947
    show "connected (S - y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4948
    proof (rule connected_openin_diff_countable [OF \<open>connected S\<close> ope])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4949
      show "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4950
        using collinear_aff_dim \<open>2 \<le> aff_dim S\<close> by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4951
      show "countable (y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4952
        using countable_finite insert.hyps(1) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4953
    qed
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4954
    have "\<And>k. \<lbrakk>f (x i) = y k; k \<in> K\<rbrakk> \<Longrightarrow> False"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4955
        by (metis feq homfg \<open>x i \<in> S\<close> homeomorphism_def \<open>S \<subseteq> T\<close> \<open>i \<notin> K\<close> subsetCE xney xyS)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4956
    then show "f (x i) \<in> S - y ` K"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  4957
      by (auto simp: f_in_S \<open>x i \<in> S\<close>)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4958
    show "y i \<in> S - y ` K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4959
      using insert.hyps xney by (auto simp: \<open>y i \<in> S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4960
  qed blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4961
  show ?case
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4962
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4963
    show "homeomorphism T T (h \<circ> f) (g \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4964
      using homfg homhk homeomorphism_compose by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4965
    show "\<forall>i \<in> insert i K. (h \<circ> f) (x i) = y i"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4966
      using feq hk_sub by (auto simp: heq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4967
    show "{x. \<not> ((h \<circ> f) x = x \<and> (g \<circ> k) x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4968
      using fg_sub hk_sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4969
    have "bounded ({x. \<not>(f x = x \<and> g x = x)} \<union> {x. \<not>(h x = x \<and> k x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4970
      using bo_fg bo_hk bounded_Un by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4971
    then show "bounded {x. \<not> ((h \<circ> f) x = x \<and> (g \<circ> k) x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4972
      by (rule bounded_subset) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4973
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4974
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4975
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  4976
proposition\<^marker>\<open>tag unimportant\<close> homeomorphism_moving_points_exists:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4977
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4978
  assumes 2: "2 \<le> DIM('a)" "open S" "connected S" "S \<subseteq> T" "finite K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4979
      and KS: "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4980
      and pw: "pairwise (\<lambda>i j. (x i \<noteq> x j) \<and> (y i \<noteq> y j)) K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4981
      and S: "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4982
  obtains f g where "homeomorphism T T f g" "\<And>i. i \<in> K \<Longrightarrow> f(x i) = y i"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4983
                    "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S" "bounded {x. (\<not> (f x = x \<and> g x = x))}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4984
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4985
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4986
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4987
    using KS homeomorphism_ident that by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4988
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4989
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4990
  then have affS: "affine hull S = UNIV"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4991
    by (simp add: affine_hull_open \<open>open S\<close>)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  4992
  then have ope: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4993
    using \<open>open S\<close> open_openin by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4994
  have "2 \<le> DIM('a)" by (rule 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4995
  also have "\<dots> = aff_dim (UNIV :: 'a set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4996
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4997
  also have "\<dots> \<le> aff_dim S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4998
    by (metis aff_dim_UNIV aff_dim_affine_hull aff_dim_le_DIM affS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4999
  finally have "2 \<le> aff_dim S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5000
    by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5001
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5002
    using homeomorphism_moving_points_exists_gen [OF \<open>finite K\<close> KS pw _ ope S] that by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5003
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5004
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  5005
subsubsection\<^marker>\<open>tag unimportant\<close>\<open>The theorem \<open>homeomorphism_grouping_points_exists\<close>\<close>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5006
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5007
lemma homeomorphism_grouping_point_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5008
  fixes a::real and c::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5009
  assumes "a < b" "c < d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5010
  obtains f g where "homeomorphism (cbox a b) (cbox c d) f g" "f a = c" "f b = d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5011
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5012
  define f where "f \<equiv> \<lambda>x. ((d - c) / (b - a)) * x + (c - a * ((d - c) / (b - a)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5013
  have "\<exists>g. homeomorphism (cbox a b) (cbox c d) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5014
  proof (rule homeomorphism_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5015
    show "continuous_on (cbox a b) f"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5016
      unfolding f_def by (intro continuous_intros)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5017
    have "f ` {a..b} = {c..d}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5018
      unfolding f_def image_affinity_atLeastAtMost
71172
nipkow
parents: 70817
diff changeset
  5019
      using assms sum_sqs_eq by (auto simp: field_split_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5020
    then show "f ` cbox a b = cbox c d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5021
      by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5022
    show "inj_on f (cbox a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5023
      unfolding f_def inj_on_def using assms by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5024
  qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5025
  then obtain g where "homeomorphism (cbox a b) (cbox c d) f g" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5026
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5027
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5028
    show "f a = c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5029
      by (simp add: f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5030
    show "f b = d"
71172
nipkow
parents: 70817
diff changeset
  5031
      using assms sum_sqs_eq [of a b] by (auto simp: f_def field_split_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5032
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5033
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5034
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5035
lemma homeomorphism_grouping_point_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5036
  fixes a::real and w::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5037
  assumes hom_ab: "homeomorphism (cbox a b) (cbox u v) f1 g1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5038
      and hom_bc: "homeomorphism (cbox b c) (cbox v w) f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5039
      and "b \<in> cbox a c" "v \<in> cbox u w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5040
      and eq: "f1 a = u" "f1 b = v" "f2 b = v" "f2 c = w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5041
 obtains f g where "homeomorphism (cbox a c) (cbox u w) f g" "f a = u" "f c = w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5042
                   "\<And>x. x \<in> cbox a b \<Longrightarrow> f x = f1 x" "\<And>x. x \<in> cbox b c \<Longrightarrow> f x = f2 x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5043
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5044
  have le: "a \<le> b" "b \<le> c" "u \<le> v" "v \<le> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5045
    using assms by simp_all
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5046
  then have ac: "cbox a c = cbox a b \<union> cbox b c" and uw: "cbox u w = cbox u v \<union> cbox v w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5047
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5048
  define f where "f \<equiv> \<lambda>x. if x \<le> b then f1 x else f2 x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5049
  have "\<exists>g. homeomorphism (cbox a c) (cbox u w) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5050
  proof (rule homeomorphism_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5051
    have cf1: "continuous_on (cbox a b) f1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5052
      using hom_ab homeomorphism_cont1 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5053
    have cf2: "continuous_on (cbox b c) f2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5054
      using hom_bc homeomorphism_cont1 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5055
    show "continuous_on (cbox a c) f"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5056
      unfolding f_def
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5057
      apply (rule continuous_on_cases_le [OF continuous_on_subset [OF cf1] continuous_on_subset [OF cf2]])
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5058
      using le eq by (force)+
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5059
    have "f ` cbox a b = f1 ` cbox a b" "f ` cbox b c = f2 ` cbox b c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5060
      unfolding f_def using eq by force+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5061
    then show "f ` cbox a c = cbox u w"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5062
      unfolding ac uw image_Un by (metis hom_ab hom_bc homeomorphism_def)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5063
    have neq12: "f1 x \<noteq> f2 y" if x: "a \<le> x" "x \<le> b" and y: "b < y" "y \<le> c" for x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5064
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5065
      have "f1 x \<in> cbox u v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5066
        by (metis hom_ab homeomorphism_def image_eqI mem_box_real(2) x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5067
      moreover have "f2 y \<in> cbox v w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5068
        by (metis (full_types) hom_bc homeomorphism_def image_subset_iff mem_box_real(2) not_le not_less_iff_gr_or_eq order_refl y)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5069
      moreover have "f2 y \<noteq> f2 b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5070
        by (metis cancel_comm_monoid_add_class.diff_cancel diff_gt_0_iff_gt hom_bc homeomorphism_def le(2) less_imp_le less_numeral_extra(3) mem_box_real(2) order_refl y)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5071
      ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5072
        using le eq by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5073
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5074
    have "inj_on f1 (cbox a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5075
      by (metis (full_types) hom_ab homeomorphism_def inj_onI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5076
    moreover have "inj_on f2 (cbox b c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5077
      by (metis (full_types) hom_bc homeomorphism_def inj_onI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5078
    ultimately show "inj_on f (cbox a c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5079
      apply (simp (no_asm) add: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5080
      apply (simp add: f_def inj_on_eq_iff)
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5081
      using neq12 by force
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5082
  qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5083
  then obtain g where "homeomorphism (cbox a c) (cbox u w) f g" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5084
  then show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5085
    using eq f_def le that by force
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5086
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5087
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5088
lemma homeomorphism_grouping_point_3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5089
  fixes a::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5090
  assumes cbox_sub: "cbox c d \<subseteq> box a b" "cbox u v \<subseteq> box a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5091
      and box_ne: "box c d \<noteq> {}" "box u v \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5092
  obtains f g where "homeomorphism (cbox a b) (cbox a b) f g" "f a = a" "f b = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5093
                    "\<And>x. x \<in> cbox c d \<Longrightarrow> f x \<in> cbox u v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5094
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5095
  have less: "a < c" "a < u" "d < b" "v < b" "c < d" "u < v" "cbox c d \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5096
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5097
    by (simp_all add: cbox_sub subset_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5098
  obtain f1 g1 where 1: "homeomorphism (cbox a c) (cbox a u) f1 g1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5099
                   and f1_eq: "f1 a = a" "f1 c = u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5100
    using homeomorphism_grouping_point_1 [OF \<open>a < c\<close> \<open>a < u\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5101
  obtain f2 g2 where 2: "homeomorphism (cbox c d) (cbox u v) f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5102
                   and f2_eq: "f2 c = u" "f2 d = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5103
    using homeomorphism_grouping_point_1 [OF \<open>c < d\<close> \<open>u < v\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5104
  obtain f3 g3 where 3: "homeomorphism (cbox d b) (cbox v b) f3 g3"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5105
                   and f3_eq: "f3 d = v" "f3 b = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5106
    using homeomorphism_grouping_point_1 [OF \<open>d < b\<close> \<open>v < b\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5107
  obtain f4 g4 where 4: "homeomorphism (cbox a d) (cbox a v) f4 g4" and "f4 a = a" "f4 d = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5108
                 and f4_eq: "\<And>x. x \<in> cbox a c \<Longrightarrow> f4 x = f1 x" "\<And>x. x \<in> cbox c d \<Longrightarrow> f4 x = f2 x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5109
    using homeomorphism_grouping_point_2 [OF 1 2] less  by (auto simp: f1_eq f2_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5110
  obtain f g where fg: "homeomorphism (cbox a b) (cbox a b) f g" "f a = a" "f b = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5111
               and f_eq: "\<And>x. x \<in> cbox a d \<Longrightarrow> f x = f4 x" "\<And>x. x \<in> cbox d b \<Longrightarrow> f x = f3 x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5112
    using homeomorphism_grouping_point_2 [OF 4 3] less by (auto simp: f4_eq f3_eq f2_eq f1_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5113
  show ?thesis
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5114
  proof (rule that [OF fg])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5115
    show "f x \<in> cbox u v" if "x \<in> cbox c d" for x 
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5116
      using that f4_eq f_eq homeomorphism_image1 [OF 2]
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5117
      by (metis atLeastAtMost_iff box_real(2) image_eqI less(1) less_eq_real_def order_trans)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5118
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5119
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5120
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5121
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5122
lemma homeomorphism_grouping_point_4:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5123
  fixes T :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5124
  assumes "open U" "open S" "connected S" "U \<noteq> {}" "finite K" "K \<subseteq> S" "U \<subseteq> S" "S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5125
  obtains f g where "homeomorphism T T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5126
                    "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U" "{x. (\<not> (f x = x \<and> g x = x))} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5127
                    "bounded {x. (\<not> (f x = x \<and> g x = x))}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5128
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5129
  obtain c d where "box c d \<noteq> {}" "cbox c d \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5130
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5131
    obtain u where "u \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5132
      using \<open>U \<noteq> {}\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5133
    then obtain e where "e > 0" "cball u e \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5134
      using \<open>open U\<close> open_contains_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5135
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5136
      by (rule_tac c=u and d="u+e" in that) (auto simp: dist_norm subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5137
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5138
  have "compact K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5139
    by (simp add: \<open>finite K\<close> finite_imp_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5140
  obtain a b where "box a b \<noteq> {}" "K \<subseteq> cbox a b" "cbox a b \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5141
  proof (cases "K = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5142
    case True then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5143
      using \<open>box c d \<noteq> {}\<close> \<open>cbox c d \<subseteq> U\<close> \<open>U \<subseteq> S\<close> that by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5144
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5145
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5146
    then obtain a b where "a \<in> K" "b \<in> K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5147
            and a: "\<And>x. x \<in> K \<Longrightarrow> a \<le> x" and b: "\<And>x. x \<in> K \<Longrightarrow> x \<le> b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5148
      using compact_attains_inf compact_attains_sup by (metis \<open>compact K\<close>)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5149
    obtain e where "e > 0" "cball b e \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5150
      using \<open>open S\<close> open_contains_cball
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5151
      by (metis \<open>b \<in> K\<close> \<open>K \<subseteq> S\<close> subsetD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5152
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5153
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5154
      show "box a (b + e) \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5155
        using \<open>0 < e\<close> \<open>b \<in> K\<close> a by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5156
      show "K \<subseteq> cbox a (b + e)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5157
        using \<open>0 < e\<close> a b by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5158
      have "a \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5159
        using \<open>a \<in> K\<close> assms(6) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5160
      have "b + e \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5161
        using \<open>0 < e\<close> \<open>cball b e \<subseteq> S\<close>  by (force simp: dist_norm)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5162
      show "cbox a (b + e) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5163
        using \<open>a \<in> S\<close> \<open>b + e \<in> S\<close> \<open>connected S\<close> connected_contains_Icc by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5164
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5165
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5166
  obtain w z where "cbox w z \<subseteq> S" and sub_wz: "cbox a b \<union> cbox c d \<subseteq> box w z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5167
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5168
    have "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5169
      using \<open>box a b \<noteq> {}\<close> \<open>cbox a b \<subseteq> S\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5170
    moreover have "c \<in> S" "d \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5171
      using \<open>box c d \<noteq> {}\<close> \<open>cbox c d \<subseteq> U\<close> \<open>U \<subseteq> S\<close> by force+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5172
    ultimately have "min a c \<in> S" "max b d \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5173
      by linarith+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5174
    then obtain e1 e2 where "e1 > 0" "cball (min a c) e1 \<subseteq> S" "e2 > 0" "cball (max b d) e2 \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5175
      using \<open>open S\<close> open_contains_cball by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5176
    then have *: "min a c - e1 \<in> S" "max b d + e2 \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5177
      by (auto simp: dist_norm)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5178
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5179
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5180
      show "cbox (min a c - e1) (max b d+ e2) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5181
        using * \<open>connected S\<close> connected_contains_Icc by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5182
      show "cbox a b \<union> cbox c d \<subseteq> box (min a c - e1) (max b d + e2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5183
        using \<open>0 < e1\<close> \<open>0 < e2\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5184
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5185
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5186
  then
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5187
  obtain f g where hom: "homeomorphism (cbox w z) (cbox w z) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5188
               and "f w = w" "f z = z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5189
               and fin: "\<And>x. x \<in> cbox a b \<Longrightarrow> f x \<in> cbox c d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5190
    using homeomorphism_grouping_point_3 [of a b w z c d]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5191
    using \<open>box a b \<noteq> {}\<close> \<open>box c d \<noteq> {}\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5192
  have contfg: "continuous_on (cbox w z) f" "continuous_on (cbox w z) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5193
    using hom homeomorphism_def by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5194
  define f' where "f' \<equiv> \<lambda>x. if x \<in> cbox w z then f x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5195
  define g' where "g' \<equiv> \<lambda>x. if x \<in> cbox w z then g x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5196
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5197
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5198
    have T: "cbox w z \<union> (T - box w z) = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5199
      using \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5200
    show "homeomorphism T T f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5201
    proof
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5202
      have clo: "closedin (top_of_set (cbox w z \<union> (T - box w z))) (T - box w z)"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5203
        by (metis Diff_Diff_Int Diff_subset T closedin_def open_box openin_open_Int topspace_euclidean_subtopology)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5204
      have "continuous_on (cbox w z \<union> (T - box w z)) f'" "continuous_on (cbox w z \<union> (T - box w z)) g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5205
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5206
         apply (safe intro!: continuous_on_cases_local contfg continuous_on_id clo)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5207
         apply (simp_all add: closed_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5208
        using \<open>f w = w\<close> \<open>f z = z\<close> apply force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5209
        by (metis \<open>f w = w\<close> \<open>f z = z\<close> hom homeomorphism_def less_eq_real_def mem_box_real(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5210
      then show "continuous_on T f'" "continuous_on T g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5211
        by (simp_all only: T)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5212
      show "f' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5213
        unfolding f'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5214
        by clarsimp (metis \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> subsetD hom homeomorphism_def imageI mem_box_real(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5215
      show "g' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5216
        unfolding g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5217
        by clarsimp (metis \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> subsetD hom homeomorphism_def imageI mem_box_real(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5218
      show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5219
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5220
        using homeomorphism_apply1 [OF hom]  homeomorphism_image1 [OF hom] by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5221
      show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5222
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5223
        using homeomorphism_apply2 [OF hom]  homeomorphism_image2 [OF hom] by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5224
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5225
    show "\<And>x. x \<in> K \<Longrightarrow> f' x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5226
      using fin sub_wz \<open>K \<subseteq> cbox a b\<close> \<open>cbox c d \<subseteq> U\<close> by (force simp: f'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5227
    show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5228
      using \<open>cbox w z \<subseteq> S\<close> by (auto simp: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5229
    show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
71769
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5230
    proof (rule bounded_subset [of "cbox w z"])
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5231
      show "bounded (cbox w z)"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5232
        using bounded_cbox by blast
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5233
      show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> cbox w z"
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5234
        by (auto simp: f'_def g'_def)
4892ceb5b29a the rest of the applys
paulson <lp15@cam.ac.uk>
parents: 71768
diff changeset
  5235
    qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5236
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5237
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5238
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  5239
proposition\<^marker>\<open>tag unimportant\<close> homeomorphism_grouping_points_exists:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5240
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5241
  assumes "open U" "open S" "connected S" "U \<noteq> {}" "finite K" "K \<subseteq> S" "U \<subseteq> S" "S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5242
  obtains f g where "homeomorphism T T f g" "{x. (\<not> (f x = x \<and> g x = x))} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5243
                    "bounded {x. (\<not> (f x = x \<and> g x = x))}" "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5244
proof (cases "2 \<le> DIM('a)")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5245
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5246
  have TS: "T \<subseteq> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5247
    using affine_hull_open assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5248
  have "infinite U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5249
    using \<open>open U\<close> \<open>U \<noteq> {}\<close> finite_imp_not_open by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5250
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5251
    using infinite_arbitrarily_large by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5252
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5253
    using \<open>finite K\<close> finite_same_card_bij by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5254
  obtain f g where "homeomorphism T T f g" "\<And>i. i \<in> K \<Longrightarrow> f (id i) = \<gamma> i" "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S" "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5255
  proof (rule homeomorphism_moving_points_exists [OF True \<open>open S\<close> \<open>connected S\<close> \<open>S \<subseteq> T\<close> \<open>finite K\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5256
    show "\<And>i. i \<in> K \<Longrightarrow> id i \<in> S \<and> \<gamma> i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5257
      using \<open>P \<subseteq> U\<close> \<open>bij_betw \<gamma> K P\<close> \<open>K \<subseteq> S\<close> \<open>U \<subseteq> S\<close> bij_betwE by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5258
    show "pairwise (\<lambda>i j. id i \<noteq> id j \<and> \<gamma> i \<noteq> \<gamma> j) K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5259
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5260
  qed (use affine_hull_open assms that in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5261
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5262
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5263
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5264
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5265
  with DIM_positive have "DIM('a) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5266
    by (simp add: dual_order.antisym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5267
  then obtain h::"'a \<Rightarrow>real" and j
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5268
  where "linear h" "linear j"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5269
    and noh: "\<And>x. norm(h x) = norm x" and noj: "\<And>y. norm(j y) = norm y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5270
    and hj:  "\<And>x. j(h x) = x" "\<And>y. h(j y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5271
    and ranh: "surj h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5272
    using isomorphisms_UNIV_UNIV
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5273
    by (metis (mono_tags, hide_lams) DIM_real UNIV_eq_I range_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5274
  obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5275
               and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5276
               and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5277
               and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5278
    apply (rule homeomorphism_grouping_point_4 [of "h ` U" "h ` S" "h ` K" "h ` T"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5279
    by (simp_all add: assms image_mono  \<open>linear h\<close> open_surjective_linear_image connected_linear_image ranh)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5280
  have jf: "j (f (h x)) = x \<longleftrightarrow> f (h x) = h x" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5281
    by (metis hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5282
  have jg: "j (g (h x)) = x \<longleftrightarrow> g (h x) = h x" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5283
    by (metis hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5284
  have cont_hj: "continuous_on X h"  "continuous_on Y j" for X Y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5285
    by (simp_all add: \<open>linear h\<close> \<open>linear j\<close> linear_linear linear_continuous_on)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5286
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5287
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5288
    show "homeomorphism T T (j \<circ> f \<circ> h) (j \<circ> g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5289
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5290
      show "continuous_on T (j \<circ> f \<circ> h)" "continuous_on T (j \<circ> g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5291
        using hom homeomorphism_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5292
        by (blast intro: continuous_on_compose cont_hj)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5293
      show "(j \<circ> f \<circ> h) ` T \<subseteq> T" "(j \<circ> g \<circ> h) ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5294
        by auto (metis (mono_tags, hide_lams) hj(1) hom homeomorphism_def imageE imageI)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5295
      show "\<And>x. x \<in> T \<Longrightarrow> (j \<circ> g \<circ> h) ((j \<circ> f \<circ> h) x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5296
        using hj hom homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5297
      show "\<And>y. y \<in> T \<Longrightarrow> (j \<circ> f \<circ> h) ((j \<circ> g \<circ> h) y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5298
        using hj hom homeomorphism_apply2 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5299
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5300
    show "{x. \<not> ((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5301
      apply (clarsimp simp: jf jg hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5302
      using sub hj
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5303
      apply (drule_tac c="h x" in subsetD, force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5304
      by (metis imageE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5305
    have "bounded (j ` {x. (\<not> (f x = x \<and> g x = x))})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5306
      by (rule bounded_linear_image [OF bou]) (use \<open>linear j\<close> linear_conv_bounded_linear in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5307
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5308
    have *: "{x. \<not>((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)} = j ` {x. (\<not> (f x = x \<and> g x = x))}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5309
      using hj by (auto simp: jf jg image_iff, metis+)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5310
    ultimately show "bounded {x. \<not> ((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5311
      by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5312
    show "\<And>x. x \<in> K \<Longrightarrow> (j \<circ> f \<circ> h) x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5313
      using f hj by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5314
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5315
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5316
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5317
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 70033
diff changeset
  5318
proposition\<^marker>\<open>tag unimportant\<close> homeomorphism_grouping_points_exists_gen:
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5319
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5320
  assumes opeU: "openin (top_of_set S) U"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5321
      and opeS: "openin (top_of_set (affine hull S)) S"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5322
      and "U \<noteq> {}" "finite K" "K \<subseteq> S" and S: "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5323
  obtains f g where "homeomorphism T T f g" "{x. (\<not> (f x = x \<and> g x = x))} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5324
                    "bounded {x. (\<not> (f x = x \<and> g x = x))}" "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5325
proof (cases "2 \<le> aff_dim S")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5326
  case True
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5327
  have opeU': "openin (top_of_set (affine hull S)) U"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5328
    using opeS opeU openin_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5329
  obtain u where "u \<in> U" "u \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5330
    using \<open>U \<noteq> {}\<close> opeU openin_imp_subset by fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5331
  have "infinite U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5332
    apply (rule infinite_openin [OF opeU \<open>u \<in> U\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5333
    apply (rule connected_imp_perfect_aff_dim [OF \<open>connected S\<close> _ \<open>u \<in> S\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5334
    using True apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5335
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5336
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5337
    using infinite_arbitrarily_large by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5338
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5339
    using \<open>finite K\<close> finite_same_card_bij by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5340
  have "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(id i) = \<gamma> i) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5341
               {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5342
  proof (rule homeomorphism_moving_points_exists_gen [OF \<open>finite K\<close> _ _ True opeS S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5343
    show "\<And>i. i \<in> K \<Longrightarrow> id i \<in> S \<and> \<gamma> i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5344
      by (metis id_apply opeU openin_contains_cball subsetCE \<open>P \<subseteq> U\<close> \<open>bij_betw \<gamma> K P\<close> \<open>K \<subseteq> S\<close> bij_betwE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5345
    show "pairwise (\<lambda>i j. id i \<noteq> id j \<and> \<gamma> i \<noteq> \<gamma> j) K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5346
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5347
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5348
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5349
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5350
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5351
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5352
  with aff_dim_geq [of S] consider "aff_dim S = -1" | "aff_dim S = 0" | "aff_dim S = 1" by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5353
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5354
  proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5355
    assume "aff_dim S = -1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5356
    then have "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5357
      using aff_dim_empty by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5358
    then have "False"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5359
      using \<open>U \<noteq> {}\<close> \<open>K \<subseteq> S\<close> openin_imp_subset [OF opeU] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5360
    then show ?thesis ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5361
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5362
    assume "aff_dim S = 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5363
    then obtain a where "S = {a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5364
      using aff_dim_eq_0 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5365
    then have "K \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5366
      using \<open>U \<noteq> {}\<close> \<open>K \<subseteq> S\<close> openin_imp_subset [OF opeU] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5367
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5368
      apply (rule that [of id id])
71172
nipkow
parents: 70817
diff changeset
  5369
      using \<open>K \<subseteq> U\<close> by (auto intro: homeomorphismI)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5370
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5371
    assume "aff_dim S = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5372
    then have "affine hull S homeomorphic (UNIV :: real set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5373
      by (auto simp: homeomorphic_affine_sets)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5374
    then obtain h::"'a\<Rightarrow>real" and j where homhj: "homeomorphism (affine hull S) UNIV h j"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5375
      using homeomorphic_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5376
    then have h: "\<And>x. x \<in> affine hull S \<Longrightarrow> j(h(x)) = x" and j: "\<And>y. j y \<in> affine hull S \<and> h(j y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5377
      by (auto simp: homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5378
    have connh: "connected (h ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5379
      by (meson Topological_Spaces.connected_continuous_image \<open>connected S\<close> homeomorphism_cont1 homeomorphism_of_subsets homhj hull_subset top_greatest)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5380
    have hUS: "h ` U \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5381
      by (meson homeomorphism_imp_open_map homeomorphism_of_subsets homhj hull_subset opeS opeU open_UNIV openin_open_eq)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5382
    have opn: "openin (top_of_set (affine hull S)) U \<Longrightarrow> open (h ` U)" for U
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5383
      using homeomorphism_imp_open_map [OF homhj]  by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5384
    have "open (h ` U)" "open (h ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5385
      by (auto intro: opeS opeU openin_trans opn)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5386
    then obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5387
                 and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5388
                 and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5389
                 and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5390
      apply (rule homeomorphism_grouping_points_exists [of "h ` U" "h ` S" "h ` K" "h ` T"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5391
      using assms by (auto simp: connh hUS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5392
    have jf: "\<And>x. x \<in> affine hull S \<Longrightarrow> j (f (h x)) = x \<longleftrightarrow> f (h x) = h x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5393
      by (metis h j)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5394
    have jg: "\<And>x. x \<in> affine hull S \<Longrightarrow> j (g (h x)) = x \<longleftrightarrow> g (h x) = h x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5395
      by (metis h j)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5396
    have cont_hj: "continuous_on T h"  "continuous_on Y j" for Y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5397
      apply (rule continuous_on_subset [OF _ \<open>T \<subseteq> affine hull S\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5398
      using homeomorphism_def homhj apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5399
      by (meson continuous_on_subset homeomorphism_def homhj top_greatest)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5400
    define f' where "f' \<equiv> \<lambda>x. if x \<in> affine hull S then (j \<circ> f \<circ> h) x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5401
    define g' where "g' \<equiv> \<lambda>x. if x \<in> affine hull S then (j \<circ> g \<circ> h) x else x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5402
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5403
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5404
      show "homeomorphism T T f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5405
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5406
        have "continuous_on T (j \<circ> f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5407
          apply (intro continuous_on_compose cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5408
          using hom homeomorphism_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5409
        then show "continuous_on T f'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5410
          apply (rule continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5411
          using \<open>T \<subseteq> affine hull S\<close> f'_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5412
        have "continuous_on T (j \<circ> g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5413
          apply (intro continuous_on_compose cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5414
          using hom homeomorphism_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5415
        then show "continuous_on T g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5416
          apply (rule continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5417
          using \<open>T \<subseteq> affine hull S\<close> g'_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5418
        show "f' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5419
        proof (clarsimp simp: f'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5420
          fix x assume "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5421
          then have "f (h x) \<in> h ` T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5422
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5423
          then show "j (f (h x)) \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5424
            using \<open>T \<subseteq> affine hull S\<close> h by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5425
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5426
        show "g' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5427
        proof (clarsimp simp: g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5428
          fix x assume "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5429
          then have "g (h x) \<in> h ` T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5430
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5431
          then show "j (g (h x)) \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5432
            using \<open>T \<subseteq> affine hull S\<close> h by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5433
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5434
        show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5435
          using h j hom homeomorphism_apply1 by (fastforce simp add: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5436
        show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5437
          using h j hom homeomorphism_apply2 by (fastforce simp add: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5438
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5439
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5440
      show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5441
        apply (clarsimp simp: f'_def g'_def jf jg)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5442
        apply (rule imageE [OF subsetD [OF sub]], force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5443
        by (metis h hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5444
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5445
      have "compact (j ` closure {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5446
        using bou by (auto simp: compact_continuous_image cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5447
      then have "bounded (j ` {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5448
        by (rule bounded_closure_image [OF compact_imp_bounded])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5449
      moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5450
      have *: "{x \<in> affine hull S. j (f (h x)) \<noteq> x \<or> j (g (h x)) \<noteq> x} = j ` {x. (\<not> (f x = x \<and> g x = x))}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5451
        using h j by (auto simp: image_iff; metis)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5452
      ultimately have "bounded {x \<in> affine hull S. j (f (h x)) \<noteq> x \<or> j (g (h x)) \<noteq> x}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5453
        by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5454
      then show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5455
        by (simp add: f'_def g'_def Collect_mono bounded_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5456
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5457
      show "f' x \<in> U" if "x \<in> K" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5458
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5459
        have "U \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5460
          using opeU openin_imp_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5461
        then have "j (f (h x)) \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5462
          using f h hull_subset that by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5463
        then show "f' x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5464
          using \<open>K \<subseteq> S\<close> S f'_def that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5465
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5466
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5467
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5468
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5469
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5470
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5471
subsection\<open>Nullhomotopic mappings\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5472
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5473
text\<open> A mapping out of a sphere is nullhomotopic iff it extends to the ball.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5474
This even works out in the degenerate cases when the radius is \<open>\<le>\<close> 0, and
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5475
we also don't need to explicitly assume continuity since it's already implicit
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5476
in both sides of the equivalence.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5477
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5478
lemma nullhomotopic_from_lemma:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5479
  assumes contg: "continuous_on (cball a r - {a}) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5480
      and fa: "\<And>e. 0 < e
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5481
               \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>x. x \<noteq> a \<and> norm(x - a) < d \<longrightarrow> norm(g x - f a) < e)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5482
      and r: "\<And>x. x \<in> cball a r \<and> x \<noteq> a \<Longrightarrow> f x = g x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5483
    shows "continuous_on (cball a r) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5484
proof (clarsimp simp: continuous_on_eq_continuous_within Ball_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5485
  fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5486
  assume x: "dist a x \<le> r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5487
  show "continuous (at x within cball a r) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5488
  proof (cases "x=a")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5489
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5490
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5491
      by (metis continuous_within_eps_delta fa dist_norm dist_self r)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5492
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5493
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5494
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5495
    proof (rule continuous_transform_within [where f=g and d = "norm(x-a)"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5496
      have "\<exists>d>0. \<forall>x'\<in>cball a r.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5497
                      dist x' x < d \<longrightarrow> dist (g x') (g x) < e" if "e>0" for e
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5498
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5499
        obtain d where "d > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5500
           and d: "\<And>x'. \<lbrakk>dist x' a \<le> r; x' \<noteq> a; dist x' x < d\<rbrakk> \<Longrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5501
                                 dist (g x') (g x) < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5502
          using contg False x \<open>e>0\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5503
          unfolding continuous_on_iff by (fastforce simp add: dist_commute intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5504
        show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5505
          using \<open>d > 0\<close> \<open>x \<noteq> a\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5506
          by (rule_tac x="min d (norm(x - a))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5507
             (auto simp: dist_commute dist_norm [symmetric]  intro!: d)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5508
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5509
      then show "continuous (at x within cball a r) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5510
        using contg False by (auto simp: continuous_within_eps_delta)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5511
      show "0 < norm (x - a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5512
        using False by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5513
      show "x \<in> cball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5514
        by (simp add: x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5515
      show "\<And>x'. \<lbrakk>x' \<in> cball a r; dist x' x < norm (x - a)\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5516
        \<Longrightarrow> g x' = f x'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5517
        by (metis dist_commute dist_norm less_le r)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5518
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5519
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5520
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5521
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5522
proposition nullhomotopic_from_sphere_extension:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5523
  fixes f :: "'M::euclidean_space \<Rightarrow> 'a::real_normed_vector"
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5524
  shows  "(\<exists>c. homotopic_with_canon (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)) \<longleftrightarrow>
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5525
          (\<exists>g. continuous_on (cball a r) g \<and> g ` (cball a r) \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5526
               (\<forall>x \<in> sphere a r. g x = f x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5527
         (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5528
proof (cases r "0::real" rule: linorder_cases)
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5529
  case less
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5530
  then show ?thesis
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5531
    by (simp add: homotopic_on_emptyI)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5532
next
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5533
  case equal
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5534
  show ?thesis
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5535
  proof
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5536
    assume L: ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5537
    with equal have [simp]: "f a \<in> S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5538
      using homotopic_with_imp_subset1 by fastforce
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5539
    obtain h:: "real \<times> 'M \<Rightarrow> 'a" 
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5540
      where h: "continuous_on ({0..1} \<times> {a}) h" "h ` ({0..1} \<times> {a}) \<subseteq> S" "h (0, a) = f a"    
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5541
      using L equal by (auto simp: homotopic_with)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5542
    then have "continuous_on (cball a r) (\<lambda>x. h (0, a))" "(\<lambda>x. h (0, a)) ` cball a r \<subseteq> S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5543
      by (auto simp: equal)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5544
    then show ?rhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5545
      using h(3) local.equal by force
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5546
  next
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5547
    assume ?rhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5548
    then show ?lhs
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5549
      using equal continuous_on_const by (force simp add: homotopic_with)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5550
  qed
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5551
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5552
  case greater
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5553
  let ?P = "continuous_on {x. norm(x - a) = r} f \<and> f ` {x. norm(x - a) = r} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5554
  have ?P if ?lhs using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5555
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5556
    fix c
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5557
    assume c: "homotopic_with_canon (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5558
    then have contf: "continuous_on (sphere a r) f" 
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5559
      by (metis homotopic_with_imp_continuous)
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5560
    moreover have fim: "f ` sphere a r \<subseteq> S"
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5561
      by (meson continuous_map_subtopology_eu c homotopic_with_imp_continuous_maps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5562
    show ?P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5563
      using contf fim by (auto simp: sphere_def dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5564
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5565
  moreover have ?P if ?rhs using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5566
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5567
    fix g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5568
    assume g: "continuous_on (cball a r) g \<and> g ` cball a r \<subseteq> S \<and> (\<forall>xa\<in>sphere a r. g xa = f xa)"
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5569
    then have "f ` {x. norm (x - a) = r} \<subseteq> S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5570
      using sphere_cball [of a r] unfolding image_subset_iff sphere_def
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5571
      by (metis dist_commute dist_norm mem_Collect_eq subset_eq)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5572
    with g show ?P
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5573
      by (auto simp: dist_norm norm_minus_commute elim!: continuous_on_eq [OF continuous_on_subset])
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5574
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5575
  moreover have ?thesis if ?P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5576
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5577
    assume ?lhs
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5578
    then obtain c where "homotopic_with_canon (\<lambda>x. True) (sphere a r) S (\<lambda>x. c) f"
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5579
      using homotopic_with_sym by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5580
    then obtain h where conth: "continuous_on ({0..1::real} \<times> sphere a r) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5581
                    and him: "h ` ({0..1} \<times> sphere a r) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5582
                    and h: "\<And>x. h(0, x) = c" "\<And>x. h(1, x) = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5583
      by (auto simp: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5584
    obtain b1::'M where "b1 \<in> Basis"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5585
      using SOME_Basis by auto
71768
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5586
    have "c \<in> h ` ({0..1} \<times> sphere a r)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5587
    proof
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5588
      show "c = h (0, a + r *\<^sub>R b1)"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5589
        by (simp add: h)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5590
      show "(0, a + r *\<^sub>R b1) \<in> {0..1::real} \<times> sphere a r"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5591
        using greater \<open>b1 \<in> Basis\<close> by (auto simp: dist_norm)
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5592
    qed
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5593
    then have "c \<in> S"
fbd77ee16f25 more applys
paulson <lp15@cam.ac.uk>
parents: 71746
diff changeset
  5594
      using him by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5595
    have uconth: "uniformly_continuous_on ({0..1::real} \<times> (sphere a r)) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5596
      by (force intro: compact_Times conth compact_uniformly_continuous)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5597
    let ?g = "\<lambda>x. h (norm (x - a)/r,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5598
                     a + (if x = a then r *\<^sub>R b1 else (r / norm(x - a)) *\<^sub>R (x - a)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5599
    let ?g' = "\<lambda>x. h (norm (x - a)/r, a + (r / norm(x - a)) *\<^sub>R (x - a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5600
    show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5601
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5602
      have "continuous_on (cball a r - {a}) ?g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5603
        apply (rule continuous_on_compose2 [OF conth])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5604
         apply (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5605
        using greater apply (auto simp: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5606
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5607
      then show "continuous_on (cball a r) ?g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5608
      proof (rule nullhomotopic_from_lemma)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5609
        show "\<exists>d>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < d \<longrightarrow> norm (?g' x - ?g a) < e" if "0 < e" for e
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5610
        proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5611
          obtain d where "0 < d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5612
             and d: "\<And>x x'. \<lbrakk>x \<in> {0..1} \<times> sphere a r; x' \<in> {0..1} \<times> sphere a r; dist x' x < d\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5613
                        \<Longrightarrow> dist (h x') (h x) < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5614
            using uniformly_continuous_onE [OF uconth \<open>0 < e\<close>] by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5615
          have *: "norm (h (norm (x - a) / r,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5616
                         a + (r / norm (x - a)) *\<^sub>R (x - a)) - h (0, a + r *\<^sub>R b1)) < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5617
                   if "x \<noteq> a" "norm (x - a) < r" "norm (x - a) < d * r" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5618
          proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5619
            have "norm (h (norm (x - a) / r, a + (r / norm (x - a)) *\<^sub>R (x - a)) - h (0, a + r *\<^sub>R b1)) =
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5620
                  norm (h (norm (x - a) / r, a + (r / norm (x - a)) *\<^sub>R (x - a)) - h (0, a + (r / norm (x - a)) *\<^sub>R (x - a)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5621
              by (simp add: h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5622
            also have "\<dots> < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5623
              apply (rule d [unfolded dist_norm])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5624
              using greater \<open>0 < d\<close> \<open>b1 \<in> Basis\<close> that
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  5625
                by (simp_all add: dist_norm) (simp add: field_simps)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5626
            finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5627
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5628
          show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5629
            apply (rule_tac x = "min r (d * r)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5630
            using greater \<open>0 < d\<close> by (auto simp: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5631
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5632
        show "\<And>x. x \<in> cball a r \<and> x \<noteq> a \<Longrightarrow> ?g x = ?g' x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5633
          by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5634
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5635
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5636
      show "?g ` cball a r \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5637
        using greater him \<open>c \<in> S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5638
        by (force simp: h dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5639
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5640
      show "\<forall>x\<in>sphere a r. ?g x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5641
        using greater by (auto simp: h dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5642
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5643
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5644
    assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5645
    then obtain g where contg: "continuous_on (cball a r) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5646
                    and gim: "g ` cball a r \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5647
                    and gf: "\<forall>x \<in> sphere a r. g x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5648
      by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5649
    let ?h = "\<lambda>y. g (a + (fst y) *\<^sub>R (snd y - a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5650
    have "continuous_on ({0..1} \<times> sphere a r) ?h"
70196
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5651
    proof (rule continuous_on_compose2 [OF contg])
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5652
      show "continuous_on ({0..1} \<times> sphere a r) (\<lambda>x. a + fst x *\<^sub>R (snd x - a))"
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5653
        by (intro continuous_intros)
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5654
      qed (auto simp: dist_norm norm_minus_commute mult_left_le_one_le)
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5655
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5656
    have "?h ` ({0..1} \<times> sphere a r) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5657
      by (auto simp: dist_norm norm_minus_commute mult_left_le_one_le gim [THEN subsetD])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5658
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5659
    have "\<forall>x\<in>sphere a r. ?h (0, x) = g a" "\<forall>x\<in>sphere a r. ?h (1, x) = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5660
      by (auto simp: dist_norm norm_minus_commute mult_left_le_one_le gf)
70196
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5661
    ultimately have "homotopic_with_canon (\<lambda>x. True) (sphere a r) S (\<lambda>x. g a) f"
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5662
      by (auto simp: homotopic_with)
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5663
    then show ?lhs
b7ef9090feed Added embedding_map_into_euclideanreal; reduced dependence on Equivalence_Lebesgue_Henstock_Integration in Analysis theories by moving a few lemmas
paulson <lp15@cam.ac.uk>
parents: 70136
diff changeset
  5664
      using homotopic_with_symD by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5665
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5666
  ultimately
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5667
  show ?thesis by meson
69986
f2d327275065 generalised homotopic_with to topologies; homotopic_with_canon is the old version
paulson <lp15@cam.ac.uk>
parents: 69922
diff changeset
  5668
qed 
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5669
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5670
end