src/HOL/Analysis/Homotopy.thy
author wenzelm
Wed, 23 Jan 2019 23:12:40 +0100
changeset 69729 4591221824f6
parent 69712 dc85b5b3a532
child 69768 7e4966eaf781
permissions -rw-r--r--
obsolete -- updated in Poly/ML;
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
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     8
  imports Path_Connected Continuum_Not_Denumerable
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
     9
begin
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    10
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    11
definition%important homotopic_with ::
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    12
  "[('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool, 'a set, 'b set, 'a \<Rightarrow> 'b, 'a \<Rightarrow> 'b] \<Rightarrow> bool"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    13
where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    14
 "homotopic_with P X Y p q \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    15
   (\<exists>h:: real \<times> 'a \<Rightarrow> 'b.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    16
       continuous_on ({0..1} \<times> X) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    17
       h ` ({0..1} \<times> X) \<subseteq> Y \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    18
       (\<forall>x. h(0, x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    19
       (\<forall>x. h(1, x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    20
       (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t, x))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    21
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    22
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
    23
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
    24
it is convenient to have a general property \<open>P\<close>.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    25
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    26
text \<open>We often want to just localize the ending function equality or whatever.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    27
text%important \<open>%whitespace\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    28
proposition homotopic_with:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    29
  fixes X :: "'a::topological_space set" and Y :: "'b::topological_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    30
  assumes "\<And>h k. (\<And>x. x \<in> X \<Longrightarrow> h x = k x) \<Longrightarrow> (P h \<longleftrightarrow> P k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    31
  shows "homotopic_with P X Y p q \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    32
           (\<exists>h :: real \<times> 'a \<Rightarrow> 'b.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    33
              continuous_on ({0..1} \<times> X) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    34
              h ` ({0..1} \<times> X) \<subseteq> Y \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    35
              (\<forall>x \<in> X. h(0,x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    36
              (\<forall>x \<in> X. h(1,x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    37
              (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t, x))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    38
  unfolding homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    39
  apply (rule iffI, blast, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    40
  apply (rule_tac x="\<lambda>(u,v). if v \<in> X then h(u,v) else if u = 0 then p v else q v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    41
  apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    42
  apply (force elim: continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    43
  apply (drule_tac x=t in bspec, force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    44
  apply (subst assms; simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    45
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    46
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    47
proposition homotopic_with_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    48
   assumes h: "homotopic_with P X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    49
       and f': "\<And>x. x \<in> X \<Longrightarrow> f' x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    50
       and g': "\<And>x. x \<in> X \<Longrightarrow> g' x = g x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    51
       and P:  "(\<And>h k. (\<And>x. x \<in> X \<Longrightarrow> h x = k x) \<Longrightarrow> (P h \<longleftrightarrow> P k))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    52
   shows "homotopic_with P X Y f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    53
  using h unfolding homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    54
  apply safe
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    55
  apply (rule_tac x="\<lambda>(u,v). if v \<in> X then h(u,v) else if u = 0 then f' v else g' v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    56
  apply (simp add: f' g', safe)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    57
  apply (fastforce intro: continuous_on_eq, fastforce)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    58
  apply (subst P; fastforce)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    59
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    60
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    61
proposition homotopic_with_equal:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    62
   assumes contf: "continuous_on X f" and fXY: "f ` X \<subseteq> Y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    63
       and gf: "\<And>x. x \<in> X \<Longrightarrow> g x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    64
       and P:  "P f" "P g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    65
   shows "homotopic_with P X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    66
  unfolding homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    67
  apply (rule_tac x="\<lambda>(u,v). if u = 1 then g v else f v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    68
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    69
  apply (intro conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    70
  apply (rule continuous_on_eq [where f = "f \<circ> snd"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    71
  apply (rule continuous_intros | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    72
  apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    73
  apply (case_tac "t=1"; force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    74
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    75
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    76
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    77
lemma image_Pair_const: "(\<lambda>x. (x, c)) ` A = A \<times> {c}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    78
  by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    79
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    80
lemma homotopic_constant_maps:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    81
   "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b) \<longleftrightarrow> s = {} \<or> path_component t a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    82
proof (cases "s = {} \<or> t = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    83
  case True with continuous_on_const show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    84
    by (auto simp: homotopic_with path_component_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    85
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    86
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    87
  then obtain c where "c \<in> s" by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    88
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    89
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    90
    assume "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    91
    then obtain h :: "real \<times> 'a \<Rightarrow> 'b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    92
        where conth: "continuous_on ({0..1} \<times> s) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    93
          and h: "h ` ({0..1} \<times> s) \<subseteq> t" "(\<forall>x\<in>s. h (0, x) = a)" "(\<forall>x\<in>s. h (1, x) = b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    94
      by (auto simp: homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    95
    have "continuous_on {0..1} (h \<circ> (\<lambda>t. (t, c)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    96
      apply (rule continuous_intros conth | simp add: image_Pair_const)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    97
      apply (blast intro:  \<open>c \<in> s\<close> continuous_on_subset [OF conth])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    98
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
    99
    with \<open>c \<in> s\<close> h show "s = {} \<or> path_component t a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   100
      apply (simp_all add: homotopic_with path_component_def, auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   101
      apply (drule_tac x="h \<circ> (\<lambda>t. (t, c))" in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   102
      apply (auto simp: pathstart_def pathfinish_def path_image_def path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   103
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   104
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   105
    assume "s = {} \<or> path_component t a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   106
    with False show "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   107
      apply (clarsimp simp: homotopic_with path_component_def pathstart_def pathfinish_def path_image_def path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   108
      apply (rule_tac x="g \<circ> fst" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   109
      apply (rule conjI continuous_intros | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   110
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   111
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   112
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   113
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   114
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   115
subsection%unimportant\<open>Trivial properties\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   116
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   117
lemma homotopic_with_imp_property: "homotopic_with P X Y f g \<Longrightarrow> P f \<and> P g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   118
  unfolding homotopic_with_def Ball_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   119
  apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   120
  apply (frule_tac x=0 in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   121
  apply (drule_tac x=1 in spec, auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   122
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   123
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   124
lemma continuous_on_o_Pair: "\<lbrakk>continuous_on (T \<times> X) h; t \<in> T\<rbrakk> \<Longrightarrow> continuous_on X (h \<circ> Pair t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   125
  by (fast intro: continuous_intros elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   126
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   127
lemma homotopic_with_imp_continuous:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   128
    assumes "homotopic_with P X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   129
    shows "continuous_on X f \<and> continuous_on X g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   130
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   131
  obtain h :: "real \<times> 'a \<Rightarrow> 'b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   132
    where conth: "continuous_on ({0..1} \<times> X) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   133
      and h: "\<forall>x. h (0, x) = f x" "\<forall>x. h (1, x) = g x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   134
    using assms by (auto simp: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   135
  have *: "t \<in> {0..1} \<Longrightarrow> continuous_on X (h \<circ> (\<lambda>x. (t,x)))" for t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   136
    by (rule continuous_intros continuous_on_subset [OF conth] | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   137
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   138
    using h *[of 0] *[of 1] by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   139
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   140
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   141
proposition homotopic_with_imp_subset1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   142
     "homotopic_with P X Y f g \<Longrightarrow> f ` X \<subseteq> Y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   143
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   144
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   145
proposition homotopic_with_imp_subset2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   146
     "homotopic_with P X Y f g \<Longrightarrow> g ` X \<subseteq> Y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   147
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   148
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   149
proposition homotopic_with_mono:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   150
    assumes hom: "homotopic_with P X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   151
        and Q: "\<And>h. \<lbrakk>continuous_on X h; image h X \<subseteq> Y \<and> P h\<rbrakk> \<Longrightarrow> Q h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   152
      shows "homotopic_with Q X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   153
  using hom
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   154
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   155
  apply (erule ex_forward)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   156
  apply (force simp: intro!: Q dest: continuous_on_o_Pair)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   157
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   158
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   159
proposition homotopic_with_subset_left:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   160
     "\<lbrakk>homotopic_with P X Y f g; Z \<subseteq> X\<rbrakk> \<Longrightarrow> homotopic_with P Z Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   161
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   162
  apply (fast elim!: continuous_on_subset ex_forward)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   163
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   164
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   165
proposition homotopic_with_subset_right:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   166
     "\<lbrakk>homotopic_with P X Y f g; Y \<subseteq> Z\<rbrakk> \<Longrightarrow> homotopic_with P X Z f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   167
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   168
  apply (fast elim!: continuous_on_subset ex_forward)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   169
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   170
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   171
proposition homotopic_with_compose_continuous_right:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   172
    "\<lbrakk>homotopic_with (\<lambda>f. p (f \<circ> h)) X Y f g; continuous_on W h; h ` W \<subseteq> X\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   173
     \<Longrightarrow> homotopic_with p W Y (f \<circ> h) (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   174
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   175
  apply (rename_tac k)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   176
  apply (rule_tac x="k \<circ> (\<lambda>y. (fst y, h (snd y)))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   177
  apply (rule conjI continuous_intros continuous_on_compose [where f=snd and g=h, unfolded o_def] | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   178
  apply (erule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   179
  apply (fastforce simp: o_def)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   180
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   181
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   182
proposition homotopic_compose_continuous_right:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   183
     "\<lbrakk>homotopic_with (\<lambda>f. True) X Y f g; continuous_on W h; h ` W \<subseteq> X\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   184
      \<Longrightarrow> homotopic_with (\<lambda>f. True) W Y (f \<circ> h) (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   185
  using homotopic_with_compose_continuous_right by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   186
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   187
proposition homotopic_with_compose_continuous_left:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   188
     "\<lbrakk>homotopic_with (\<lambda>f. p (h \<circ> f)) X Y f g; continuous_on Y h; h ` Y \<subseteq> Z\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   189
      \<Longrightarrow> homotopic_with p X Z (h \<circ> f) (h \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   190
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   191
  apply (rename_tac k)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   192
  apply (rule_tac x="h \<circ> k" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   193
  apply (rule conjI continuous_intros continuous_on_compose [where f=snd and g=h, unfolded o_def] | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   194
  apply (erule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   195
  apply (fastforce simp: o_def)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   196
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   197
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   198
proposition homotopic_compose_continuous_left:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   199
   "\<lbrakk>homotopic_with (\<lambda>_. True) X Y f g;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   200
     continuous_on Y h; h ` Y \<subseteq> Z\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   201
    \<Longrightarrow> homotopic_with (\<lambda>f. True) X Z (h \<circ> f) (h \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   202
  using homotopic_with_compose_continuous_left by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   203
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   204
proposition homotopic_with_Pair:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   205
   assumes hom: "homotopic_with p s t f g" "homotopic_with p' s' t' f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   206
       and q: "\<And>f g. \<lbrakk>p f; p' g\<rbrakk> \<Longrightarrow> q(\<lambda>(x,y). (f x, g y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   207
     shows "homotopic_with q (s \<times> s') (t \<times> t')
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   208
                  (\<lambda>(x,y). (f x, f' y)) (\<lambda>(x,y). (g x, g' y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   209
  using hom
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   210
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   211
  apply (rename_tac k k')
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   212
  apply (rule_tac x="\<lambda>z. ((k \<circ> (\<lambda>x. (fst x, fst (snd x)))) z, (k' \<circ> (\<lambda>x. (fst x, snd (snd x)))) z)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   213
  apply (rule conjI continuous_intros | erule continuous_on_subset | clarsimp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   214
  apply (auto intro!: q [unfolded case_prod_unfold])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   215
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   216
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   217
lemma homotopic_on_empty [simp]: "homotopic_with (\<lambda>x. True) {} t f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   218
  by (metis continuous_on_def empty_iff homotopic_with_equal image_subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   219
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   220
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   221
text\<open>Homotopy with P is an equivalence relation (on continuous functions mapping X into Y that satisfy P,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   222
     though this only affects reflexivity.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   223
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   224
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   225
proposition homotopic_with_refl:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   226
   "homotopic_with P X Y f f \<longleftrightarrow> continuous_on X f \<and> image f X \<subseteq> Y \<and> P f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   227
  apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   228
  using homotopic_with_imp_continuous homotopic_with_imp_property homotopic_with_imp_subset2 apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   229
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   230
  apply (rule_tac x="f \<circ> snd" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   231
  apply (rule conjI continuous_intros | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   232
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   233
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   234
lemma homotopic_with_symD:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   235
  fixes X :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   236
    assumes "homotopic_with P X Y f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   237
      shows "homotopic_with P X Y g f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   238
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   239
  apply (clarsimp simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   240
  apply (rename_tac h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   241
  apply (rule_tac x="h \<circ> (\<lambda>y. (1 - fst y, snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   242
  apply (rule conjI continuous_intros | erule continuous_on_subset | force simp: image_subset_iff)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   243
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   244
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   245
proposition homotopic_with_sym:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   246
    fixes X :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   247
    shows "homotopic_with P X Y f g \<longleftrightarrow> homotopic_with P X Y g f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   248
  using homotopic_with_symD by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   249
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   250
lemma split_01: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   251
  by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   252
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   253
lemma split_01_prod: "{0..1::real} \<times> X = ({0..1/2} \<times> X) \<union> ({1/2..1} \<times> X)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   254
  by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   255
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   256
proposition homotopic_with_trans:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   257
    fixes X :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   258
    assumes "homotopic_with P X Y f g" and "homotopic_with P X Y g h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   259
      shows "homotopic_with P X Y f h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   260
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   261
  have clo1: "closedin (subtopology euclidean ({0..1/2} \<times> X \<union> {1/2..1} \<times> X)) ({0..1/2::real} \<times> X)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   262
    apply (simp add: closedin_closed split_01_prod [symmetric])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   263
    apply (rule_tac x="{0..1/2} \<times> UNIV" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   264
    apply (force simp: closed_Times)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   265
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   266
  have clo2: "closedin (subtopology euclidean ({0..1/2} \<times> X \<union> {1/2..1} \<times> X)) ({1/2..1::real} \<times> X)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   267
    apply (simp add: closedin_closed split_01_prod [symmetric])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   268
    apply (rule_tac x="{1/2..1} \<times> UNIV" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   269
    apply (force simp: closed_Times)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   270
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   271
  { fix k1 k2:: "real \<times> 'a \<Rightarrow> 'b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   272
    assume cont: "continuous_on ({0..1} \<times> X) k1" "continuous_on ({0..1} \<times> X) k2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   273
       and Y: "k1 ` ({0..1} \<times> X) \<subseteq> Y" "k2 ` ({0..1} \<times> X) \<subseteq> Y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   274
       and geq: "\<forall>x. k1 (1, x) = g x" "\<forall>x. k2 (0, x) = g x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   275
       and k12: "\<forall>x. k1 (0, x) = f x" "\<forall>x. k2 (1, x) = h x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   276
       and P:   "\<forall>t\<in>{0..1}. P (\<lambda>x. k1 (t, x))" "\<forall>t\<in>{0..1}. P (\<lambda>x. k2 (t, x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   277
    define k where "k y =
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   278
      (if fst y \<le> 1 / 2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   279
       then (k1 \<circ> (\<lambda>x. (2 *\<^sub>R fst x, snd x))) y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   280
       else (k2 \<circ> (\<lambda>x. (2 *\<^sub>R fst x -1, snd x))) y)" for y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   281
    have keq: "k1 (2 * u, v) = k2 (2 * u - 1, v)" if "u = 1/2"  for u v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   282
      by (simp add: geq that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   283
    have "continuous_on ({0..1} \<times> X) k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   284
      using cont
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   285
      apply (simp add: split_01_prod k_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   286
      apply (rule clo1 clo2 continuous_on_cases_local continuous_intros | erule continuous_on_subset | simp add: linear image_subset_iff)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   287
      apply (force simp: keq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   288
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   289
    moreover have "k ` ({0..1} \<times> X) \<subseteq> Y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   290
      using Y by (force simp: k_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   291
    moreover have "\<forall>x. k (0, x) = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   292
      by (simp add: k_def k12)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   293
    moreover have "(\<forall>x. k (1, x) = h x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   294
      by (simp add: k_def k12)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   295
    moreover have "\<forall>t\<in>{0..1}. P (\<lambda>x. k (t, x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   296
      using P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   297
      apply (clarsimp simp add: k_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   298
      apply (case_tac "t \<le> 1/2", auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   299
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   300
    ultimately have *: "\<exists>k :: real \<times> 'a \<Rightarrow> 'b.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   301
                       continuous_on ({0..1} \<times> X) k \<and> k ` ({0..1} \<times> X) \<subseteq> Y \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   302
                       (\<forall>x. k (0, x) = f x) \<and> (\<forall>x. k (1, x) = h x) \<and> (\<forall>t\<in>{0..1}. P (\<lambda>x. k (t, x)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   303
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   304
  } note * = this
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   305
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   306
    using assms by (auto intro: * simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   307
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   308
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   309
proposition homotopic_compose:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   310
      fixes s :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   311
      shows "\<lbrakk>homotopic_with (\<lambda>x. True) s t f f'; homotopic_with (\<lambda>x. True) t u g g'\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   312
             \<Longrightarrow> homotopic_with (\<lambda>x. True) s u (g \<circ> f) (g' \<circ> f')"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   313
  apply (rule homotopic_with_trans [where g = "g \<circ> f'"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   314
  apply (metis homotopic_compose_continuous_left homotopic_with_imp_continuous homotopic_with_imp_subset1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   315
  by (metis homotopic_compose_continuous_right homotopic_with_imp_continuous homotopic_with_imp_subset2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   316
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   317
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   318
text\<open>Homotopic triviality implicitly incorporates path-connectedness.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   319
lemma homotopic_triviality:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   320
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   321
  shows  "(\<forall>f g. continuous_on S f \<and> f ` S \<subseteq> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   322
                 continuous_on S g \<and> g ` S \<subseteq> T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   323
                 \<longrightarrow> homotopic_with (\<lambda>x. True) S T f g) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   324
          (S = {} \<or> path_connected T) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   325
          (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> T \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   326
          (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   327
proof (cases "S = {} \<or> T = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   328
  case True then show ?thesis by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   329
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   330
  case False show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   331
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   332
    assume LHS [rule_format]: ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   333
    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
   334
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   335
      have "homotopic_with (\<lambda>x. True) S T (\<lambda>x. a) (\<lambda>x. b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   336
        by (simp add: LHS continuous_on_const image_subset_iff that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   337
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   338
        using False homotopic_constant_maps by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   339
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   340
      moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   341
    have "\<exists>c. homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)" if "continuous_on S f" "f ` S \<subseteq> T" for f
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   342
      by (metis (full_types) False LHS equals0I homotopic_constant_maps homotopic_with_imp_continuous homotopic_with_imp_subset2 pab that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   343
    ultimately show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   344
      by (simp add: path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   345
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   346
    assume RHS: ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   347
    with False have T: "path_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   348
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   349
    show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   350
    proof clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   351
      fix f g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   352
      assume "continuous_on S f" "f ` S \<subseteq> T" "continuous_on S g" "g ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   353
      obtain c d where c: "homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)" and d: "homotopic_with (\<lambda>x. True) S T g (\<lambda>x. d)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   354
        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
   355
      then have "c \<in> T" "d \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   356
        using False homotopic_with_imp_subset2 by fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   357
      with T have "path_component T c d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   358
        using path_connected_component by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   359
      then have "homotopic_with (\<lambda>x. True) S T (\<lambda>x. c) (\<lambda>x. d)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   360
        by (simp add: homotopic_constant_maps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   361
      with c d show "homotopic_with (\<lambda>x. True) S T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   362
        by (meson homotopic_with_symD homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   363
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   364
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   365
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   366
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   367
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   368
subsection\<open>Homotopy of paths, maintaining the same endpoints\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   369
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   370
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   371
definition%important homotopic_paths :: "['a set, real \<Rightarrow> 'a, real \<Rightarrow> 'a::topological_space] \<Rightarrow> bool"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   372
  where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   373
     "homotopic_paths s p q \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   374
       homotopic_with (\<lambda>r. pathstart r = pathstart p \<and> pathfinish r = pathfinish p) {0..1} s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   375
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   376
lemma homotopic_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   377
   "homotopic_paths s p q \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   378
      (\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   379
          h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   380
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   381
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   382
          (\<forall>t \<in> {0..1::real}. pathstart(h \<circ> Pair t) = pathstart p \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   383
                        pathfinish(h \<circ> Pair t) = pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   384
  by (auto simp: homotopic_paths_def homotopic_with pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   385
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   386
proposition homotopic_paths_imp_pathstart:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   387
     "homotopic_paths s p q \<Longrightarrow> pathstart p = pathstart q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   388
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   389
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   390
proposition homotopic_paths_imp_pathfinish:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   391
     "homotopic_paths s p q \<Longrightarrow> pathfinish p = pathfinish q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   392
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   393
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   394
lemma homotopic_paths_imp_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   395
     "homotopic_paths s p q \<Longrightarrow> path p \<and> path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   396
  using homotopic_paths_def homotopic_with_imp_continuous path_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   397
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   398
lemma homotopic_paths_imp_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   399
     "homotopic_paths s p q \<Longrightarrow> path_image p \<subseteq> s \<and> path_image q \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   400
  by (simp add: homotopic_paths_def homotopic_with_imp_subset1 homotopic_with_imp_subset2 path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   401
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   402
proposition homotopic_paths_refl [simp]: "homotopic_paths s p p \<longleftrightarrow> path p \<and> path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   403
by (simp add: homotopic_paths_def homotopic_with_refl path_def path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   404
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   405
proposition homotopic_paths_sym: "homotopic_paths s p q \<Longrightarrow> homotopic_paths s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   406
  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
   407
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   408
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
   409
  by (metis homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   410
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   411
proposition homotopic_paths_trans [trans]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   412
     "\<lbrakk>homotopic_paths s p q; homotopic_paths s q r\<rbrakk> \<Longrightarrow> homotopic_paths s p r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   413
  apply (simp add: homotopic_paths_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   414
  apply (rule homotopic_with_trans, assumption)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   415
  by (metis (mono_tags, lifting) homotopic_with_imp_property homotopic_with_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   416
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   417
proposition homotopic_paths_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   418
     "\<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"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   419
  apply (simp add: homotopic_paths_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   420
  apply (rule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   421
  apply (auto simp: path_def homotopic_with_refl pathstart_def pathfinish_def path_image_def elim: continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   422
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   423
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   424
proposition homotopic_paths_reparametrize:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   425
  assumes "path p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   426
      and pips: "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   427
      and contf: "continuous_on {0..1} f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   428
      and f01:"f ` {0..1} \<subseteq> {0..1}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   429
      and [simp]: "f(0) = 0" "f(1) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   430
      and q: "\<And>t. t \<in> {0..1} \<Longrightarrow> q(t) = p(f t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   431
    shows "homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   432
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   433
  have contp: "continuous_on {0..1} p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   434
    by (metis \<open>path p\<close> path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   435
  then have "continuous_on {0..1} (p \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   436
    using contf continuous_on_compose continuous_on_subset f01 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   437
  then have "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   438
    by (simp add: path_def) (metis q continuous_on_cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   439
  have piqs: "path_image q \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   440
    by (metis (no_types, hide_lams) pips f01 image_subset_iff path_image_def q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   441
  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
   442
    using f01 by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   443
  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
   444
    using f01 [THEN subsetD, of "f b"] by (simp add: convex_bound_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   445
  have "homotopic_paths s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   446
  proof (rule homotopic_paths_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   447
    show "homotopic_paths s q (p \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   448
      using q by (force intro: homotopic_paths_eq [OF  \<open>path q\<close> piqs])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   449
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   450
    show "homotopic_paths s (p \<circ> f) p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   451
      apply (simp add: homotopic_paths_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   452
      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
   453
      apply (rule conjI contf continuous_intros continuous_on_subset [OF contp] | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   454
      using pips [unfolded path_image_def]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   455
      apply (auto simp: fb0 fb1 pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   456
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   457
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   458
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   459
    by (simp add: homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   460
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   461
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   462
lemma homotopic_paths_subset: "\<lbrakk>homotopic_paths s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   463
  using homotopic_paths_def homotopic_with_subset_right by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   464
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   465
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   466
text\<open> A slightly ad-hoc but useful lemma in constructing homotopies.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   467
lemma homotopic_join_lemma:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   468
  fixes q :: "[real,real] \<Rightarrow> 'a::topological_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   469
  assumes p: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. p (fst y) (snd y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   470
      and q: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. q (fst y) (snd y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   471
      and pf: "\<And>t. t \<in> {0..1} \<Longrightarrow> pathfinish(p t) = pathstart(q t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   472
    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
   473
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   474
  have 1: "(\<lambda>y. p (fst y) (2 * snd y)) = (\<lambda>y. p (fst y) (snd y)) \<circ> (\<lambda>y. (fst y, 2 * snd y))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   475
    by (rule ext) (simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   476
  have 2: "(\<lambda>y. q (fst y) (2 * snd y - 1)) = (\<lambda>y. q (fst y) (snd y)) \<circ> (\<lambda>y. (fst y, 2 * snd y - 1))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   477
    by (rule ext) (simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   478
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   479
    apply (simp add: joinpaths_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   480
    apply (rule continuous_on_cases_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   481
    apply (simp_all only: 1 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   482
    apply (rule continuous_intros continuous_on_subset [OF p] continuous_on_subset [OF q] | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   483
    using pf
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   484
    apply (auto simp: mult.commute pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   485
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   486
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   487
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   488
text\<open> Congruence properties of homotopy w.r.t. path-combining operations.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   489
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   490
lemma homotopic_paths_reversepath_D:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   491
      assumes "homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   492
      shows   "homotopic_paths s (reversepath p) (reversepath q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   493
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   494
  apply (simp add: homotopic_paths_def homotopic_with_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   495
  apply (rule_tac x="h \<circ> (\<lambda>x. (fst x, 1 - snd x))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   496
  apply (rule conjI continuous_intros)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   497
  apply (auto simp: reversepath_def pathstart_def pathfinish_def elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   498
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   499
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   500
proposition homotopic_paths_reversepath:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   501
     "homotopic_paths s (reversepath p) (reversepath q) \<longleftrightarrow> homotopic_paths s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   502
  using homotopic_paths_reversepath_D by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   503
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   504
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   505
proposition homotopic_paths_join:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   506
    "\<lbrakk>homotopic_paths s p p'; homotopic_paths s q q'; pathfinish p = pathstart q\<rbrakk> \<Longrightarrow> homotopic_paths s (p +++ q) (p' +++ q')"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   507
  apply (simp add: homotopic_paths_def homotopic_with_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   508
  apply (rename_tac k1 k2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   509
  apply (rule_tac x="(\<lambda>y. ((k1 \<circ> Pair (fst y)) +++ (k2 \<circ> Pair (fst y))) (snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   510
  apply (rule conjI continuous_intros homotopic_join_lemma)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   511
  apply (auto simp: joinpaths_def pathstart_def pathfinish_def path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   512
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   513
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   514
proposition homotopic_paths_continuous_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   515
    "\<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
   516
  unfolding homotopic_paths_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   517
  apply (rule homotopic_with_compose_continuous_left [of _ _ _ s])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   518
  apply (auto simp: pathstart_def pathfinish_def elim!: homotopic_with_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   519
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   520
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   521
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   522
subsection\<open>Group properties for homotopy of paths\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   523
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   524
text%important\<open>So taking equivalence classes under homotopy would give the fundamental group\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   525
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   526
proposition homotopic_paths_rid:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   527
    "\<lbrakk>path p; path_image p \<subseteq> s\<rbrakk> \<Longrightarrow> homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p)) p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   528
  apply (subst homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   529
  apply (rule homotopic_paths_reparametrize [where f = "\<lambda>t. if  t \<le> 1 / 2 then 2 *\<^sub>R t else 1"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   530
  apply (simp_all del: le_divide_eq_numeral1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   531
  apply (subst split_01)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   532
  apply (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   533
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   534
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   535
proposition homotopic_paths_lid:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   536
   "\<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
   537
  using homotopic_paths_rid [of "reversepath p" s]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   538
  by (metis homotopic_paths_reversepath path_image_reversepath path_reversepath pathfinish_linepath
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   539
        pathfinish_reversepath reversepath_joinpaths reversepath_linepath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   540
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   541
proposition homotopic_paths_assoc:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   542
   "\<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
   543
     pathfinish q = pathstart r\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   544
    \<Longrightarrow> homotopic_paths s (p +++ (q +++ r)) ((p +++ q) +++ r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   545
  apply (subst homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   546
  apply (rule homotopic_paths_reparametrize
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   547
           [where f = "\<lambda>t. if  t \<le> 1 / 2 then inverse 2 *\<^sub>R t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   548
                           else if  t \<le> 3 / 4 then t - (1 / 4)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   549
                           else 2 *\<^sub>R t - 1"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   550
  apply (simp_all del: le_divide_eq_numeral1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   551
  apply (simp add: subset_path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   552
  apply (rule continuous_on_cases_1 continuous_intros)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   553
  apply (auto simp: joinpaths_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   554
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   555
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   556
proposition homotopic_paths_rinv:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   557
  assumes "path p" "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   558
    shows "homotopic_paths s (p +++ reversepath p) (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   559
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   560
  have "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. (subpath 0 (fst x) p +++ reversepath (subpath 0 (fst x) p)) (snd x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   561
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   562
    apply (simp add: joinpaths_def subpath_def reversepath_def path_def del: le_divide_eq_numeral1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   563
    apply (rule continuous_on_cases_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   564
    apply (rule_tac [2] continuous_on_compose [of _ _ p, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   565
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   566
    apply (auto intro!: continuous_intros simp del: eq_divide_eq_numeral1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   567
    apply (force elim!: continuous_on_subset simp add: mult_le_one)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   568
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   569
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   570
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   571
    apply (subst homotopic_paths_sym_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   572
    unfolding homotopic_paths_def homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   573
    apply (rule_tac x="(\<lambda>y. (subpath 0 (fst y) p +++ reversepath(subpath 0 (fst y) p)) (snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   574
    apply (simp add: path_defs joinpaths_def subpath_def reversepath_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   575
    apply (force simp: mult_le_one)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   576
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   577
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   578
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   579
proposition homotopic_paths_linv:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   580
  assumes "path p" "path_image p \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   581
    shows "homotopic_paths s (reversepath p +++ p) (linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   582
  using homotopic_paths_rinv [of "reversepath p" s] assms by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   583
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   584
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   585
subsection\<open>Homotopy of loops without requiring preservation of endpoints\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   586
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   587
definition%important homotopic_loops :: "'a::topological_space set \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> bool"  where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   588
 "homotopic_loops s p q \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   589
     homotopic_with (\<lambda>r. pathfinish r = pathstart r) {0..1} s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   590
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   591
lemma homotopic_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   592
   "homotopic_loops s p q \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   593
      (\<exists>h. continuous_on ({0..1::real} \<times> {0..1}) h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   594
          image h ({0..1} \<times> {0..1}) \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   595
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   596
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   597
          (\<forall>t \<in> {0..1}. pathfinish(h \<circ> Pair t) = pathstart(h \<circ> Pair t)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   598
  by (simp add: homotopic_loops_def pathstart_def pathfinish_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   599
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   600
proposition homotopic_loops_imp_loop:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   601
     "homotopic_loops s p q \<Longrightarrow> pathfinish p = pathstart p \<and> pathfinish q = pathstart q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   602
using homotopic_with_imp_property homotopic_loops_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   603
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   604
proposition homotopic_loops_imp_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   605
     "homotopic_loops s p q \<Longrightarrow> path p \<and> path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   606
  unfolding homotopic_loops_def path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   607
  using homotopic_with_imp_continuous by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   608
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   609
proposition homotopic_loops_imp_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   610
     "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
   611
  unfolding homotopic_loops_def path_image_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   612
  by (metis homotopic_with_imp_subset1 homotopic_with_imp_subset2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   613
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   614
proposition homotopic_loops_refl:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   615
     "homotopic_loops s p p \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   616
      path p \<and> path_image p \<subseteq> s \<and> pathfinish p = pathstart p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   617
  by (simp add: homotopic_loops_def homotopic_with_refl path_image_def path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   618
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   619
proposition homotopic_loops_sym: "homotopic_loops s p q \<Longrightarrow> homotopic_loops s q p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   620
  by (simp add: homotopic_loops_def homotopic_with_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   621
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   622
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
   623
  by (metis homotopic_loops_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   624
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   625
proposition homotopic_loops_trans:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   626
   "\<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
   627
  unfolding homotopic_loops_def by (blast intro: homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   628
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   629
proposition homotopic_loops_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   630
   "\<lbrakk>homotopic_loops s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_loops t p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   631
  by (simp add: homotopic_loops_def homotopic_with_subset_right)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   632
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   633
proposition homotopic_loops_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   634
   "\<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
   635
          \<Longrightarrow> homotopic_loops s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   636
  unfolding homotopic_loops_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   637
  apply (rule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   638
  apply (rule homotopic_with_refl [where f = p, THEN iffD2])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   639
  apply (simp_all add: path_image_def path_def pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   640
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   641
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   642
proposition homotopic_loops_continuous_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   643
   "\<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
   644
  unfolding homotopic_loops_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   645
  apply (rule homotopic_with_compose_continuous_left)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   646
  apply (erule homotopic_with_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   647
  by (simp add: pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   648
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   649
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   650
subsection\<open>Relations between the two variants of homotopy\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   651
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   652
proposition homotopic_paths_imp_homotopic_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   653
    "\<lbrakk>homotopic_paths s p q; pathfinish p = pathstart p; pathfinish q = pathstart p\<rbrakk> \<Longrightarrow> homotopic_loops s p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   654
  by (auto simp: homotopic_paths_def homotopic_loops_def intro: homotopic_with_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   655
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   656
proposition homotopic_loops_imp_homotopic_paths_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   657
  assumes "homotopic_loops s p (linepath a a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   658
    shows "homotopic_paths s p (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   659
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   660
  have "path p" by (metis assms homotopic_loops_imp_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   661
  have ploop: "pathfinish p = pathstart p" by (metis assms homotopic_loops_imp_loop)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   662
  have pip: "path_image p \<subseteq> s" by (metis assms homotopic_loops_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   663
  obtain h where conth: "continuous_on ({0..1::real} \<times> {0..1}) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   664
             and hs: "h ` ({0..1} \<times> {0..1}) \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   665
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(0,x) = p x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   666
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(1,x) = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   667
             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
   668
    using assms by (auto simp: homotopic_loops homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   669
  have conth0: "path (\<lambda>u. h (u, 0))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   670
    unfolding path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   671
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   672
    apply (force intro: continuous_intros continuous_on_subset [OF conth])+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   673
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   674
  have pih0: "path_image (\<lambda>u. h (u, 0)) \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   675
    using hs by (force simp: path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   676
  have c1: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. h (fst x * snd x, 0))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   677
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   678
    apply (force simp: mult_le_one intro: continuous_intros continuous_on_subset [OF conth])+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   679
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   680
  have c2: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. h (fst x - fst x * snd x, 0))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   681
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   682
    apply (force simp: mult_left_le mult_le_one intro: continuous_intros continuous_on_subset [OF conth])+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   683
    apply (rule continuous_on_subset [OF conth])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   684
    apply (auto simp: algebra_simps add_increasing2 mult_left_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   685
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   686
  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
   687
    using ends by (simp add: pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   688
  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
   689
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   690
    have "c * 3 \<le> c * (d * 4)" using that less_eq_real_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   691
    with \<open>c \<le> 1\<close> show ?thesis by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   692
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   693
  have *: "\<And>p x. (path p \<and> path(reversepath p)) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   694
                  (path_image p \<subseteq> s \<and> path_image(reversepath p) \<subseteq> s) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   695
                  (pathfinish p = pathstart(linepath a a +++ reversepath p) \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   696
                   pathstart(reversepath p) = a) \<and> pathstart p = x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   697
                  \<Longrightarrow> homotopic_paths s (p +++ linepath a a +++ reversepath p) (linepath x x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   698
    by (metis homotopic_paths_lid homotopic_paths_join
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   699
              homotopic_paths_trans homotopic_paths_sym homotopic_paths_rinv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   700
  have 1: "homotopic_paths s p (p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   701
    using \<open>path p\<close> homotopic_paths_rid homotopic_paths_sym pip by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   702
  moreover have "homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   703
                                   (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   704
    apply (rule homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   705
    using homotopic_paths_lid [of "p +++ linepath (pathfinish p) (pathfinish p)" s]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   706
    by (metis 1 homotopic_paths_imp_path homotopic_paths_imp_pathstart homotopic_paths_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   707
  moreover have "homotopic_paths s (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   708
                                   ((\<lambda>u. h (u, 0)) +++ linepath a a +++ reversepath (\<lambda>u. h (u, 0)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   709
    apply (simp add: homotopic_paths_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   710
    apply (rule_tac x="\<lambda>y. (subpath 0 (fst y) (\<lambda>u. h (u, 0)) +++ (\<lambda>u. h (Pair (fst y) u)) +++ subpath (fst y) 0 (\<lambda>u. h (u, 0))) (snd y)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   711
    apply (simp add: subpath_reversepath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   712
    apply (intro conjI homotopic_join_lemma)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   713
    using ploop
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   714
    apply (simp_all add: path_defs joinpaths_def o_def subpath_def conth c1 c2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   715
    apply (force simp: algebra_simps mult_le_one mult_left_le intro: hs [THEN subsetD] adhoc_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   716
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   717
  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
   718
                                   (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   719
    apply (rule *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   720
    apply (simp add: pih0 pathstart_def pathfinish_def conth0)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   721
    apply (simp add: reversepath_def joinpaths_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   722
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   723
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   724
    by (blast intro: homotopic_paths_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   725
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   726
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   727
proposition homotopic_loops_conjugate:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   728
  fixes s :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   729
  assumes "path p" "path q" and pip: "path_image p \<subseteq> s" and piq: "path_image q \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   730
      and papp: "pathfinish p = pathstart q" and qloop: "pathfinish q = pathstart q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   731
    shows "homotopic_loops s (p +++ q +++ reversepath p) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   732
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   733
  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
   734
  have contq: "continuous_on {0..1} q"  using \<open>path q\<close> [unfolded path_def] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   735
  have c1: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. p ((1 - fst x) * snd x + fst x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   736
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   737
    apply (force simp: mult_le_one intro!: continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   738
    apply (rule continuous_on_subset [OF contp])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   739
    apply (auto simp: algebra_simps add_increasing2 mult_right_le_one_le sum_le_prod1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   740
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   741
  have c2: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. p ((fst x - 1) * snd x + 1))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   742
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   743
    apply (force simp: mult_le_one intro!: continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   744
    apply (rule continuous_on_subset [OF contp])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   745
    apply (auto simp: algebra_simps add_increasing2 mult_left_le_one_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   746
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   747
  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
   748
    using sum_le_prod1
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   749
    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
   750
  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
   751
    apply (rule pip [unfolded path_image_def, THEN subsetD])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   752
    apply (rule image_eqI, blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   753
    apply (simp add: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   754
    by (metis add_mono_thms_linordered_semiring(1) affine_ineq linear mult.commute mult.left_neutral mult_right_mono not_le
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   755
              add.commute zero_le_numeral)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   756
  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
   757
    using path_image_def piq by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   758
  have "homotopic_loops s (p +++ q +++ reversepath p)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   759
                          (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   760
    apply (simp add: homotopic_loops_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   761
    apply (rule_tac x="(\<lambda>y. (subpath (fst y) 1 p +++ q +++ subpath 1 (fst y) p) (snd y))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   762
    apply (simp add: subpath_refl subpath_reversepath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   763
    apply (intro conjI homotopic_join_lemma)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   764
    using papp qloop
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   765
    apply (simp_all add: path_defs joinpaths_def o_def subpath_def c1 c2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   766
    apply (force simp: contq intro: continuous_on_compose [of _ _ q, unfolded o_def] continuous_on_id continuous_on_snd)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   767
    apply (auto simp: ps1 ps2 qs)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   768
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   769
  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
   770
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   771
    have "homotopic_paths s (linepath (pathfinish q) (pathfinish q) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   772
      using \<open>path q\<close> homotopic_paths_lid qloop piq by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   773
    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
   774
      using homotopic_paths_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   775
    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
   776
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   777
      have "homotopic_paths s (q +++ linepath (pathfinish q) (pathfinish q)) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   778
        by (simp add: \<open>path q\<close> homotopic_paths_rid piq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   779
      thus ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   780
        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
   781
                  homotopic_paths_trans qloop pathfinish_linepath piq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   782
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   783
    thus ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   784
      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
   785
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   786
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   787
    by (blast intro: homotopic_loops_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   788
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   789
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   790
lemma homotopic_paths_loop_parts:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   791
  assumes loops: "homotopic_loops S (p +++ reversepath q) (linepath a a)" and "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   792
  shows "homotopic_paths S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   793
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   794
  have paths: "homotopic_paths S (p +++ reversepath q) (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   795
    using homotopic_loops_imp_homotopic_paths_null [OF loops] by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   796
  then have "path p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   797
    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
   798
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   799
  proof (cases "pathfinish p = pathfinish q")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   800
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   801
    have pipq: "path_image p \<subseteq> S" "path_image q \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   802
      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
   803
           path_image_join path_image_reversepath path_imp_reversepath path_join_eq)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   804
    have "homotopic_paths S p (p +++ (linepath (pathfinish p) (pathfinish p)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   805
      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
   806
    moreover have "homotopic_paths S (p +++ (linepath (pathfinish p) (pathfinish p))) (p +++ (reversepath q +++ q))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   807
      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
   808
    moreover have "homotopic_paths S (p +++ (reversepath q +++ q)) ((p +++ reversepath q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   809
      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
   810
    moreover have "homotopic_paths S ((p +++ reversepath q) +++ q) (linepath (pathstart p) (pathstart p) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   811
      by (simp add: \<open>path q\<close> homotopic_paths_join paths pipq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   812
    moreover then have "homotopic_paths S (linepath (pathstart p) (pathstart p) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   813
      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
   814
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   815
      using homotopic_paths_trans by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   816
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   817
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   818
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   819
      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
   820
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   821
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   822
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   823
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   824
subsection%unimportant\<open>Homotopy of "nearby" function, paths and loops\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   825
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   826
lemma homotopic_with_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   827
  fixes f g :: "_ \<Rightarrow> 'b::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   828
  assumes contf: "continuous_on s f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   829
      and contg:"continuous_on s g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   830
      and sub: "\<And>x. x \<in> s \<Longrightarrow> closed_segment (f x) (g x) \<subseteq> t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   831
    shows "homotopic_with (\<lambda>z. True) s t f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   832
  apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   833
  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
   834
  apply (intro conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   835
  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
   836
                                            continuous_on_subset [OF contg] continuous_on_compose2 [where g=g]| simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   837
  using sub closed_segment_def apply fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   838
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   839
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   840
lemma homotopic_paths_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   841
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   842
  assumes "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   843
          "\<And>t. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   844
    shows "homotopic_paths s g h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   845
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   846
  unfolding path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   847
  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
   848
  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
   849
  apply (intro conjI subsetI continuous_intros; force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   850
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   851
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   852
lemma homotopic_loops_linear:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   853
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   854
  assumes "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   855
          "\<And>t x. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   856
    shows "homotopic_loops s g h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   857
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   858
  unfolding path_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   859
  apply (simp add: pathstart_def pathfinish_def homotopic_loops_def homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   860
  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
   861
  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
   862
  apply (force simp: closed_segment_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   863
  done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   864
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   865
lemma homotopic_paths_nearby_explicit:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   866
  assumes "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   867
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> s\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   868
    shows "homotopic_paths s g h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   869
  apply (rule homotopic_paths_linear [OF assms(1-4)])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   870
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   871
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   872
lemma homotopic_loops_nearby_explicit:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   873
  assumes "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   874
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> s\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   875
    shows "homotopic_loops s g h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   876
  apply (rule homotopic_loops_linear [OF assms(1-4)])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   877
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   878
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   879
lemma homotopic_nearby_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   880
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   881
  assumes "path g" "open s" "path_image g \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   882
    shows "\<exists>e. 0 < e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   883
               (\<forall>h. path h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   884
                    pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   885
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_paths s g h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   886
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   887
  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"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   888
    using separate_compact_closed [of "path_image g" "-s"] assms by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   889
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   890
    apply (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   891
    using e [unfolded dist_norm]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   892
    apply (auto simp: intro!: homotopic_paths_nearby_explicit assms  \<open>e > 0\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   893
    by (metis atLeastAtMost_iff imageI le_less_trans not_le path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   894
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   895
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   896
lemma homotopic_nearby_loops:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   897
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   898
  assumes "path g" "open s" "path_image g \<subseteq> s" "pathfinish g = pathstart g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   899
    shows "\<exists>e. 0 < e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   900
               (\<forall>h. path h \<and> pathfinish h = pathstart h \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   901
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_loops s g h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   902
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   903
  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"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   904
    using separate_compact_closed [of "path_image g" "-s"] assms by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   905
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   906
    apply (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   907
    using e [unfolded dist_norm]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   908
    apply (auto simp: intro!: homotopic_loops_nearby_explicit assms  \<open>e > 0\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   909
    by (metis atLeastAtMost_iff imageI le_less_trans not_le path_image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   910
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   911
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   912
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   913
subsection\<open> Homotopy and subpaths\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   914
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   915
lemma homotopic_join_subpaths1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   916
  assumes "path g" and pag: "path_image g \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   917
      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
   918
    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
   919
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   920
  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
   921
    using affine_ineq \<open>u \<le> v\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   922
  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
   923
    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
   924
  have t2: "\<And>t::real. t*2 = 1 \<Longrightarrow> t = 1/2" by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   925
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   926
    apply (rule homotopic_paths_subset [OF _ pag])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   927
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   928
    apply (cases "w = u")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   929
    using homotopic_paths_rinv [of "subpath u v g" "path_image g"]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   930
    apply (force simp: closed_segment_eq_real_ivl image_mono path_image_def subpath_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   931
      apply (rule homotopic_paths_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   932
      apply (rule homotopic_paths_reparametrize
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   933
             [where f = "\<lambda>t. if  t \<le> 1 / 2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   934
                             then inverse((w - u)) *\<^sub>R (2 * (v - u)) *\<^sub>R t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   935
                             else inverse((w - u)) *\<^sub>R ((v - u) + (w - v) *\<^sub>R (2 *\<^sub>R t - 1))"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   936
      using \<open>path g\<close> path_subpath u w apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   937
      using \<open>path g\<close> path_image_subpath_subset u w(1) apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   938
      apply simp_all
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   939
      apply (subst split_01)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   940
      apply (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   941
      apply (simp_all add: field_simps not_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   942
      apply (force dest!: t2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   943
      apply (force simp: algebra_simps mult_left_mono affine_ineq dest!: 1 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   944
      apply (simp add: joinpaths_def subpath_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   945
      apply (force simp: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   946
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   947
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   948
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   949
lemma homotopic_join_subpaths2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   950
  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
   951
    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
   952
by (metis assms homotopic_paths_reversepath_D pathfinish_subpath pathstart_subpath reversepath_joinpaths reversepath_subpath)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   953
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   954
lemma homotopic_join_subpaths3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   955
  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
   956
      and "path g" and pag: "path_image g \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   957
      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
   958
    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
   959
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   960
  have "homotopic_paths s (subpath u w g +++ subpath w v g) ((subpath u v g +++ subpath v w g) +++ subpath w v g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   961
    apply (rule homotopic_paths_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   962
    using hom homotopic_paths_sym_eq apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   963
    apply (metis \<open>path g\<close> homotopic_paths_eq pag path_image_subpath_subset path_subpath subset_trans v w, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   964
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   965
  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)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   966
    apply (rule homotopic_paths_sym [OF homotopic_paths_assoc])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   967
    using assms by (simp_all add: path_image_subpath_subset [THEN order_trans])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   968
  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
   969
                               (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   970
    apply (rule homotopic_paths_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   971
    apply (metis \<open>path g\<close> homotopic_paths_eq order.trans pag path_image_subpath_subset path_subpath u v)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   972
    apply (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)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   973
    apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   974
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   975
  also have "homotopic_paths s (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g))) (subpath u v g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   976
    apply (rule homotopic_paths_rid)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   977
    using \<open>path g\<close> path_subpath u v apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   978
    apply (meson \<open>path g\<close> order.trans pag path_image_subpath_subset u v)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   979
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   980
  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
   981
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   982
    using homotopic_join_subpaths2 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   983
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   984
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   985
proposition homotopic_join_subpaths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   986
   "\<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
   987
    \<Longrightarrow> homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   988
  apply (rule le_cases3 [of u v w])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   989
using homotopic_join_subpaths1 homotopic_join_subpaths2 homotopic_join_subpaths3 by metis+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   990
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   991
text\<open>Relating homotopy of trivial loops to path-connectedness.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   992
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   993
lemma path_component_imp_homotopic_points:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   994
    "path_component S a b \<Longrightarrow> homotopic_loops S (linepath a a) (linepath b b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   995
apply (simp add: path_component_def homotopic_loops_def homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   996
                 pathstart_def pathfinish_def path_image_def path_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   997
apply (rule_tac x="g \<circ> fst" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   998
apply (intro conjI continuous_intros continuous_on_compose)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
   999
apply (auto elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1000
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1001
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1002
lemma homotopic_loops_imp_path_component_value:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1003
   "\<lbrakk>homotopic_loops S p q; 0 \<le> t; t \<le> 1\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1004
        \<Longrightarrow> path_component S (p t) (q t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1005
apply (simp add: path_component_def homotopic_loops_def homotopic_with_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1006
                 pathstart_def pathfinish_def path_image_def path_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1007
apply (rule_tac x="h \<circ> (\<lambda>u. (u, t))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1008
apply (intro conjI continuous_intros continuous_on_compose)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1009
apply (auto elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1010
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1011
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1012
lemma homotopic_points_eq_path_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1013
   "homotopic_loops S (linepath a a) (linepath b b) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1014
        path_component S a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1015
by (auto simp: path_component_imp_homotopic_points
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1016
         dest: homotopic_loops_imp_path_component_value [where t=1])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1017
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1018
lemma path_connected_eq_homotopic_points:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1019
    "path_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1020
      (\<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
  1021
by (auto simp: path_connected_def path_component_def homotopic_points_eq_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1022
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1023
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1024
subsection\<open>Simply connected sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1025
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1026
text%important\<open>defined as "all loops are homotopic (as loops)\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1027
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1028
definition%important simply_connected where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1029
  "simply_connected S \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1030
        \<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
  1031
              path q \<and> pathfinish q = pathstart q \<and> path_image q \<subseteq> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1032
              \<longrightarrow> homotopic_loops S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1033
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1034
lemma simply_connected_empty [iff]: "simply_connected {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1035
  by (simp add: simply_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1036
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1037
lemma simply_connected_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1038
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1039
  shows "simply_connected S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1040
by (simp add: simply_connected_def path_connected_eq_homotopic_points)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1041
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1042
lemma simply_connected_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1043
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1044
  shows "simply_connected S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1045
by (simp add: path_connected_imp_connected simply_connected_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1046
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1047
lemma simply_connected_eq_contractible_loop_any:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1048
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1049
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1050
            (\<forall>p a. path p \<and> path_image p \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1051
                  pathfinish p = pathstart p \<and> a \<in> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1052
                  \<longrightarrow> homotopic_loops S p (linepath a a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1053
apply (simp add: simply_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1054
apply (rule iffI, force, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1055
apply (rule_tac q = "linepath (pathstart p) (pathstart p)" in homotopic_loops_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1056
apply (fastforce simp add:)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1057
using homotopic_loops_sym apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1058
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1059
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1060
lemma simply_connected_eq_contractible_loop_some:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1061
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1062
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1063
                path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1064
                (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1065
                    \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1066
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1067
 apply (fastforce simp: simply_connected_imp_path_connected simply_connected_eq_contractible_loop_any)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1068
apply (clarsimp simp add: simply_connected_eq_contractible_loop_any)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1069
apply (drule_tac x=p in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1070
using homotopic_loops_trans path_connected_eq_homotopic_points
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1071
  apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1072
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1073
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1074
lemma simply_connected_eq_contractible_loop_all:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1075
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1076
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1077
         S = {} \<or>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1078
         (\<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
  1079
                \<longrightarrow> homotopic_loops S p (linepath a a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1080
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1081
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1082
  case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1083
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1084
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1085
  then obtain a where "a \<in> S" by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1086
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1087
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1088
    assume "simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1089
    then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1090
      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
  1091
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1092
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1093
    assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1094
    then show "simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1095
      apply (simp add: simply_connected_eq_contractible_loop_any False)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1096
      by (meson homotopic_loops_refl homotopic_loops_sym homotopic_loops_trans
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1097
             path_component_imp_homotopic_points path_component_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1098
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1099
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1100
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1101
lemma simply_connected_eq_contractible_path:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1102
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1103
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1104
           path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1105
           (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1106
            \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1107
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1108
 apply (simp add: simply_connected_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1109
 apply (metis simply_connected_eq_contractible_loop_some homotopic_loops_imp_homotopic_paths_null)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1110
by (meson homotopic_paths_imp_homotopic_loops pathfinish_linepath pathstart_in_path_image
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1111
         simply_connected_eq_contractible_loop_some subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1112
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1113
lemma simply_connected_eq_homotopic_paths:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1114
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1115
  shows "simply_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1116
          path_connected S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1117
          (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1118
                path q \<and> path_image q \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1119
                pathstart q = pathstart p \<and> pathfinish q = pathfinish p
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1120
                \<longrightarrow> homotopic_paths S p q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1121
         (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1122
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1123
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1124
  then have pc: "path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1125
        and *:  "\<And>p. \<lbrakk>path p; path_image p \<subseteq> S;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1126
                       pathfinish p = pathstart p\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1127
                      \<Longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1128
    by (auto simp: simply_connected_eq_contractible_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1129
  have "homotopic_paths S p q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1130
        if "path p" "path_image p \<subseteq> S" "path q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1131
           "path_image q \<subseteq> S" "pathstart q = pathstart p"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1132
           "pathfinish q = pathfinish p" for p q
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1133
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1134
    have "homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1135
      by (simp add: homotopic_paths_rid homotopic_paths_sym that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1136
    also have "homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1137
                                 (p +++ reversepath q +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1138
      using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1139
      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
  1140
    also have "homotopic_paths S (p +++ reversepath q +++ q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1141
                                 ((p +++ reversepath q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1142
      by (simp add: that homotopic_paths_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1143
    also have "homotopic_paths S ((p +++ reversepath q) +++ q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1144
                                 (linepath (pathstart q) (pathstart q) +++ q)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1145
      using * [of "p +++ reversepath q"] that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1146
      by (simp add: homotopic_paths_join path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1147
    also have "homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1148
      using that homotopic_paths_lid by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1149
    finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1150
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1151
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1152
    by (blast intro: pc *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1153
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1154
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1155
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1156
    by (force simp: simply_connected_eq_contractible_path)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1157
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1158
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1159
proposition simply_connected_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1160
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1161
  assumes S: "simply_connected S" and T: "simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1162
    shows "simply_connected(S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1163
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1164
  have "homotopic_loops (S \<times> T) p (linepath (a, b) (a, b))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1165
       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
  1166
       for p a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1167
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1168
    have "path (fst \<circ> p)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1169
      apply (rule Path_Connected.path_continuous_image [OF \<open>path p\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1170
      apply (rule continuous_intros)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1171
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1172
    moreover have "path_image (fst \<circ> p) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1173
      using that apply (simp add: path_image_def) by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1174
    ultimately have p1: "homotopic_loops S (fst \<circ> p) (linepath a a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1175
      using S that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1176
      apply (simp add: simply_connected_eq_contractible_loop_any)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1177
      apply (drule_tac x="fst \<circ> p" in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1178
      apply (drule_tac x=a in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1179
      apply (auto simp: pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1180
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1181
    have "path (snd \<circ> p)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1182
      apply (rule Path_Connected.path_continuous_image [OF \<open>path p\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1183
      apply (rule continuous_intros)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1184
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1185
    moreover have "path_image (snd \<circ> p) \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1186
      using that apply (simp add: path_image_def) by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1187
    ultimately have p2: "homotopic_loops T (snd \<circ> p) (linepath b b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1188
      using T that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1189
      apply (simp add: simply_connected_eq_contractible_loop_any)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1190
      apply (drule_tac x="snd \<circ> p" in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1191
      apply (drule_tac x=b in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1192
      apply (auto simp: pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1193
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1194
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1195
      using p1 p2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1196
      apply (simp add: homotopic_loops, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1197
      apply (rename_tac h k)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1198
      apply (rule_tac x="\<lambda>z. Pair (h z) (k z)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1199
      apply (intro conjI continuous_intros | assumption)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1200
      apply (auto simp: pathstart_def pathfinish_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1201
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1202
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1203
  with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1204
    by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1205
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1206
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1207
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1208
subsection\<open>Contractible sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1209
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1210
definition%important contractible where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1211
 "contractible S \<equiv> \<exists>a. homotopic_with (\<lambda>x. True) S S id (\<lambda>x. a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1212
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1213
proposition contractible_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1214
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1215
  assumes "contractible S" shows "simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1216
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1217
  case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1218
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1219
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1220
  obtain a where a: "homotopic_with (\<lambda>x. True) S S id (\<lambda>x. a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1221
    using assms by (force simp: contractible_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1222
  then have "a \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1223
    by (metis False homotopic_constant_maps homotopic_with_symD homotopic_with_trans path_component_mem(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1224
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1225
    apply (simp add: simply_connected_eq_contractible_loop_all False)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1226
    apply (rule bexI [OF _ \<open>a \<in> S\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1227
    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
  1228
    apply (rule_tac x="(h \<circ> (\<lambda>y. (fst y, (p \<circ> snd) y)))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1229
    apply (intro conjI continuous_on_compose continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1230
    apply (erule continuous_on_subset | force)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1231
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1232
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1233
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1234
corollary contractible_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1235
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1236
  shows "contractible S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1237
by (simp add: contractible_imp_simply_connected simply_connected_imp_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1238
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1239
lemma contractible_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1240
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1241
  shows "contractible S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1242
by (simp add: contractible_imp_simply_connected simply_connected_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1243
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1244
lemma nullhomotopic_through_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1245
  fixes S :: "_::topological_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1246
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1247
      and g: "continuous_on T g" "g ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1248
      and T: "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1249
    obtains c where "homotopic_with (\<lambda>h. True) S U (g \<circ> f) (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1250
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1251
  obtain b where b: "homotopic_with (\<lambda>x. True) T T id (\<lambda>x. b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1252
    using assms by (force simp: contractible_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1253
  have "homotopic_with (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1254
    by (rule homotopic_compose_continuous_left [OF b g])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1255
  then have "homotopic_with (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1256
    by (rule homotopic_compose_continuous_right [OF _ f])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1257
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1258
    by (simp add: comp_def that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1259
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1260
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1261
lemma nullhomotopic_into_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1262
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1263
      and T: "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1264
    obtains c where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1265
apply (rule nullhomotopic_through_contractible [OF f, of id T])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1266
using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1267
apply (auto simp: continuous_on_id)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1268
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1269
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1270
lemma nullhomotopic_from_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1271
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1272
      and S: "contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1273
    obtains c where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1274
apply (rule nullhomotopic_through_contractible [OF continuous_on_id _ f S, of S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1275
using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1276
apply (auto simp: comp_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1277
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1278
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1279
lemma homotopic_through_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1280
  fixes S :: "_::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1281
  assumes "continuous_on S f1" "f1 ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1282
          "continuous_on T g1" "g1 ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1283
          "continuous_on S f2" "f2 ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1284
          "continuous_on T g2" "g2 ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1285
          "contractible T" "path_connected U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1286
   shows "homotopic_with (\<lambda>h. True) S U (g1 \<circ> f1) (g2 \<circ> f2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1287
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1288
  obtain c1 where c1: "homotopic_with (\<lambda>h. True) S U (g1 \<circ> f1) (\<lambda>x. c1)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1289
    apply (rule nullhomotopic_through_contractible [of S f1 T g1 U])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1290
    using assms apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1291
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1292
  obtain c2 where c2: "homotopic_with (\<lambda>h. True) S U (g2 \<circ> f2) (\<lambda>x. c2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1293
    apply (rule nullhomotopic_through_contractible [of S f2 T g2 U])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1294
    using assms apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1295
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1296
  have *: "S = {} \<or> (\<exists>t. path_connected t \<and> t \<subseteq> U \<and> c2 \<in> t \<and> c1 \<in> t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1297
  proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1298
    case True then show ?thesis by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1299
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1300
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1301
    with c1 c2 have "c1 \<in> U" "c2 \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1302
      using homotopic_with_imp_subset2 all_not_in_conv image_subset_iff by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1303
    with \<open>path_connected U\<close> show ?thesis by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1304
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1305
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1306
    apply (rule homotopic_with_trans [OF c1])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1307
    apply (rule homotopic_with_symD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1308
    apply (rule homotopic_with_trans [OF c2])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1309
    apply (simp add: path_component homotopic_constant_maps *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1310
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1311
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1312
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1313
lemma homotopic_into_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1314
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1315
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1316
      and g: "continuous_on S g" "g ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1317
      and T: "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1318
    shows "homotopic_with (\<lambda>h. True) S T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1319
using homotopic_through_contractible [of S f T id T g id]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1320
by (simp add: assms contractible_imp_path_connected continuous_on_id)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1321
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1322
lemma homotopic_from_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1323
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1324
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1325
      and g: "continuous_on S g" "g ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1326
      and "contractible S" "path_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1327
    shows "homotopic_with (\<lambda>h. True) S T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1328
using homotopic_through_contractible [of S id S f T id g]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1329
by (simp add: assms contractible_imp_path_connected continuous_on_id)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1330
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1331
lemma starlike_imp_contractible_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1332
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1333
  assumes S: "starlike S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1334
      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)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1335
    obtains a where "homotopic_with P S S (\<lambda>x. x) (\<lambda>x. a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1336
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1337
  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
  1338
    using S by (auto simp: starlike_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1339
  have "(\<lambda>y. (1 - fst y) *\<^sub>R snd y + fst y *\<^sub>R a) ` ({0..1} \<times> S) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1340
    apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1341
    apply (erule a [unfolded closed_segment_def, THEN subsetD], simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1342
    apply (metis add_diff_cancel_right' diff_ge_0_iff_ge le_add_diff_inverse pth_c(1))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1343
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1344
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1345
    apply (rule_tac a=a in that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1346
    using \<open>a \<in> S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1347
    apply (simp add: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1348
    apply (rule_tac x="\<lambda>y. (1 - (fst y)) *\<^sub>R snd y + (fst y) *\<^sub>R a" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1349
    apply (intro conjI ballI continuous_on_compose continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1350
    apply (simp_all add: P)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1351
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1352
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1353
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1354
lemma starlike_imp_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1355
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1356
  shows "starlike S \<Longrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1357
using starlike_imp_contractible_gen contractible_def by (fastforce simp: id_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1358
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1359
lemma contractible_UNIV [simp]: "contractible (UNIV :: 'a::real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1360
  by (simp add: starlike_imp_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1361
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1362
lemma starlike_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1363
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1364
  shows "starlike S \<Longrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1365
by (simp add: contractible_imp_simply_connected starlike_imp_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1366
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1367
lemma convex_imp_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1368
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1369
  shows "convex S \<Longrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1370
using convex_imp_starlike starlike_imp_simply_connected by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1371
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1372
lemma starlike_imp_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1373
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1374
  shows "starlike S \<Longrightarrow> path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1375
by (simp add: simply_connected_imp_path_connected starlike_imp_simply_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1376
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1377
lemma starlike_imp_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1378
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1379
  shows "starlike S \<Longrightarrow> connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1380
by (simp add: path_connected_imp_connected starlike_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1381
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1382
lemma is_interval_simply_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1383
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1384
  shows "is_interval S \<longleftrightarrow> simply_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1385
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
  1386
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1387
lemma contractible_empty [simp]: "contractible {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1388
  by (simp add: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1389
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1390
lemma contractible_convex_tweak_boundary_points:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1391
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1392
  assumes "convex S" and TS: "rel_interior S \<subseteq> T" "T \<subseteq> closure S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1393
  shows "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1394
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1395
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1396
  with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1397
    by (simp add: subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1398
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1399
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1400
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1401
    apply (rule starlike_imp_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1402
    apply (rule starlike_convex_tweak_boundary_points [OF \<open>convex S\<close> False TS])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1403
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1404
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1405
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1406
lemma convex_imp_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1407
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1408
  shows "convex S \<Longrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1409
  using contractible_empty convex_imp_starlike starlike_imp_contractible by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1410
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1411
lemma contractible_sing [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1412
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1413
  shows "contractible {a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1414
by (rule convex_imp_contractible [OF convex_singleton])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1415
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1416
lemma is_interval_contractible_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1417
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1418
  shows  "is_interval S \<longleftrightarrow> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1419
using contractible_imp_simply_connected convex_imp_contractible is_interval_convex_1
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1420
      is_interval_simply_connected_1 by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1421
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1422
lemma contractible_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1423
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1424
  assumes S: "contractible S" and T: "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1425
  shows "contractible (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1426
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1427
  obtain a h where conth: "continuous_on ({0..1} \<times> S) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1428
             and hsub: "h ` ({0..1} \<times> S) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1429
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow> h (0, x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1430
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow>  h (1::real, x) = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1431
    using S by (auto simp: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1432
  obtain b k where contk: "continuous_on ({0..1} \<times> T) k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1433
             and ksub: "k ` ({0..1} \<times> T) \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1434
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow> k (0, x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1435
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow>  k (1::real, x) = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1436
    using T by (auto simp: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1437
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1438
    apply (simp add: contractible_def homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1439
    apply (rule exI [where x=a])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1440
    apply (rule exI [where x=b])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1441
    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
  1442
    apply (intro conjI ballI continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF contk])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1443
    using hsub ksub
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1444
    apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1445
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1446
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1447
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1448
lemma homotopy_dominated_contractibility:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1449
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1450
  assumes S: "contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1451
      and f: "continuous_on S f" "image f S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1452
      and g: "continuous_on T g" "image g T \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1453
      and hom: "homotopic_with (\<lambda>x. True) T T (f \<circ> g) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1454
    shows "contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1455
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1456
  obtain b where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1457
    using nullhomotopic_from_contractible [OF f S] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1458
  then have homg: "homotopic_with (\<lambda>x. True) T T ((\<lambda>x. b) \<circ> g) (f \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1459
    by (rule homotopic_with_compose_continuous_right [OF homotopic_with_symD g])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1460
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1461
    apply (simp add: contractible_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1462
    apply (rule exI [where x = b])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1463
    apply (rule homotopic_with_symD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1464
    apply (rule homotopic_with_trans [OF _ hom])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1465
    using homg apply (simp add: o_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1466
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1467
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1468
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1469
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1470
subsection\<open>Local versions of topological properties in general\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1471
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1472
definition%important locally :: "('a::topological_space set \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> bool"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1473
where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1474
 "locally P S \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1475
        \<forall>w x. openin (subtopology euclidean S) w \<and> x \<in> w
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1476
              \<longrightarrow> (\<exists>u v. openin (subtopology euclidean S) u \<and> P v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1477
                        x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1478
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1479
lemma locallyI:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1480
  assumes "\<And>w x. \<lbrakk>openin (subtopology euclidean S) w; x \<in> w\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1481
                  \<Longrightarrow> \<exists>u v. openin (subtopology euclidean S) u \<and> P v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1482
                        x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1483
    shows "locally P S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1484
using assms by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1485
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1486
lemma locallyE:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1487
  assumes "locally P S" "openin (subtopology euclidean S) w" "x \<in> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1488
  obtains u v where "openin (subtopology euclidean S) u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1489
                    "P v" "x \<in> u" "u \<subseteq> v" "v \<subseteq> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1490
  using assms unfolding locally_def by meson
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1491
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1492
lemma locally_mono:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1493
  assumes "locally P S" "\<And>t. P t \<Longrightarrow> Q t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1494
    shows "locally Q S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1495
by (metis assms locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1496
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1497
lemma locally_open_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1498
  assumes "locally P S" "openin (subtopology euclidean S) t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1499
    shows "locally P t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1500
using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1501
apply (simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1502
apply (erule all_forward)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1503
apply (rule impI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1504
apply (erule impCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1505
 using openin_trans apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1506
apply (erule ex_forward)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1507
by (metis (no_types, hide_lams) Int_absorb1 Int_lower1 Int_subset_iff openin_open openin_subtopology_Int_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1508
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1509
lemma locally_diff_closed:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1510
    "\<lbrakk>locally P S; closedin (subtopology euclidean S) t\<rbrakk> \<Longrightarrow> locally P (S - t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1511
  using locally_open_subset closedin_def by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1512
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1513
lemma locally_empty [iff]: "locally P {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1514
  by (simp add: locally_def openin_subtopology)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1515
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1516
lemma locally_singleton [iff]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1517
  fixes a :: "'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1518
  shows "locally P {a} \<longleftrightarrow> P {a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1519
apply (simp add: locally_def openin_euclidean_subtopology_iff subset_singleton_iff conj_disj_distribR cong: conj_cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1520
using zero_less_one by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1521
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1522
lemma locally_iff:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1523
    "locally P S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1524
     (\<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)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1525
apply (simp add: le_inf_iff locally_def openin_open, safe)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1526
apply (metis IntE IntI le_inf_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1527
apply (metis IntI Int_subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1528
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1529
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1530
lemma locally_Int:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1531
  assumes S: "locally P S" and t: "locally P t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1532
      and P: "\<And>S t. P S \<and> P t \<Longrightarrow> P(S \<inter> t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1533
    shows "locally P (S \<inter> t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1534
using S t unfolding locally_iff
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1535
apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1536
apply (drule_tac x=T in spec)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1537
apply (drule_tac x=x in spec)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1538
apply clarsimp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1539
apply (rename_tac U1 U2 V1 V2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1540
apply (rule_tac x="U1 \<inter> U2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1541
apply (simp add: open_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1542
apply (rule_tac x="V1 \<inter> V2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1543
apply (auto intro: P)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1544
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1545
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1546
lemma locally_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1547
  fixes S :: "('a::metric_space) set" and T :: "('b::metric_space) set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1548
  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
  1549
  shows "locally R (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1550
    unfolding locally_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1551
proof (clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1552
  fix W x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1553
  assume W: "openin (subtopology euclidean (S \<times> T)) W" and xy: "(x, y) \<in> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1554
  then obtain U V where "openin (subtopology euclidean S) U" "x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1555
                        "openin (subtopology euclidean T) V" "y \<in> V" "U \<times> V \<subseteq> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1556
    using Times_in_interior_subtopology by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1557
  then obtain U1 U2 V1 V2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1558
         where opeS: "openin (subtopology euclidean S) U1 \<and> P U2 \<and> x \<in> U1 \<and> U1 \<subseteq> U2 \<and> U2 \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1559
           and opeT: "openin (subtopology euclidean T) V1 \<and> Q V2 \<and> y \<in> V1 \<and> V1 \<subseteq> V2 \<and> V2 \<subseteq> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1560
    by (meson PS QT locallyE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1561
  with \<open>U \<times> V \<subseteq> W\<close> show "\<exists>u v. openin (subtopology euclidean (S \<times> T)) u \<and> R v \<and> (x,y) \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1562
    apply (rule_tac x="U1 \<times> V1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1563
    apply (rule_tac x="U2 \<times> V2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1564
    apply (auto simp: openin_Times R)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1565
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1566
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1567
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1568
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1569
proposition homeomorphism_locally_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1570
  fixes S :: "'a::metric_space set" and t :: "'b::t2_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1571
  assumes S: "locally P S" and hom: "homeomorphism S t f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1572
      and Q: "\<And>S S'. \<lbrakk>P S; homeomorphism S S' f g\<rbrakk> \<Longrightarrow> Q S'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1573
    shows "locally Q t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1574
proof (clarsimp simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1575
  fix W y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1576
  assume "y \<in> W" and "openin (subtopology euclidean t) W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1577
  then obtain T where T: "open T" "W = t \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1578
    by (force simp: openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1579
  then have "W \<subseteq> t" by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1580
  have f: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "f ` S = t" "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1581
   and g: "\<And>y. y \<in> t \<Longrightarrow> f(g y) = y" "g ` t = S" "continuous_on t g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1582
    using hom by (auto simp: homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1583
  have gw: "g ` W = S \<inter> f -` W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1584
    using \<open>W \<subseteq> t\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1585
    apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1586
    using \<open>g ` t = S\<close> \<open>W \<subseteq> t\<close> apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1587
    using g \<open>W \<subseteq> t\<close> apply auto[1]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1588
    by (simp add: f rev_image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1589
  have \<circ>: "openin (subtopology euclidean S) (g ` W)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1590
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1591
    have "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1592
      using f(3) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1593
    then show "openin (subtopology euclidean S) (g ` W)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1594
      by (simp add: gw Collect_conj_eq \<open>openin (subtopology euclidean t) W\<close> continuous_on_open f(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1595
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1596
  then obtain u v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1597
    where osu: "openin (subtopology euclidean S) u" and uv: "P v" "g y \<in> u" "u \<subseteq> v" "v \<subseteq> g ` W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1598
    using S [unfolded locally_def, rule_format, of "g ` W" "g y"] \<open>y \<in> W\<close> by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1599
  have "v \<subseteq> S" using uv by (simp add: gw)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1600
  have fv: "f ` v = t \<inter> {x. g x \<in> v}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1601
    using \<open>f ` S = t\<close> f \<open>v \<subseteq> S\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1602
  have "f ` v \<subseteq> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1603
    using uv using Int_lower2 gw image_subsetI mem_Collect_eq subset_iff by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1604
  have contvf: "continuous_on v f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1605
    using \<open>v \<subseteq> S\<close> continuous_on_subset f(3) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1606
  have contvg: "continuous_on (f ` v) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1607
    using \<open>f ` v \<subseteq> W\<close> \<open>W \<subseteq> t\<close> continuous_on_subset [OF g(3)] by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1608
  have homv: "homeomorphism v (f ` v) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1609
    using \<open>v \<subseteq> S\<close> \<open>W \<subseteq> t\<close> f
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1610
    apply (simp add: homeomorphism_def contvf contvg, auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1611
    by (metis f(1) rev_image_eqI rev_subsetD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1612
  have 1: "openin (subtopology euclidean t) (t \<inter> g -` u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1613
    apply (rule continuous_on_open [THEN iffD1, rule_format])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1614
    apply (rule \<open>continuous_on t g\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1615
    using \<open>g ` t = S\<close> apply (simp add: osu)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1616
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1617
  have 2: "\<exists>V. Q V \<and> y \<in> (t \<inter> g -` u) \<and> (t \<inter> g -` u) \<subseteq> V \<and> V \<subseteq> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1618
    apply (rule_tac x="f ` v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1619
    apply (intro conjI Q [OF \<open>P v\<close> homv])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1620
    using \<open>W \<subseteq> t\<close> \<open>y \<in> W\<close>  \<open>f ` v \<subseteq> W\<close>  uv  apply (auto simp: fv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1621
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1622
  show "\<exists>U. openin (subtopology euclidean t) U \<and> (\<exists>v. Q v \<and> y \<in> U \<and> U \<subseteq> v \<and> v \<subseteq> W)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1623
    by (meson 1 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1624
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1625
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1626
lemma homeomorphism_locally:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1627
  fixes f:: "'a::metric_space \<Rightarrow> 'b::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1628
  assumes hom: "homeomorphism S t f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1629
      and eq: "\<And>S t. homeomorphism S t f g \<Longrightarrow> (P S \<longleftrightarrow> Q t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1630
    shows "locally P S \<longleftrightarrow> locally Q t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1631
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1632
apply (erule homeomorphism_locally_imp [OF _ hom])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1633
apply (simp add: eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1634
apply (erule homeomorphism_locally_imp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1635
using eq homeomorphism_sym homeomorphism_symD [OF hom] apply blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1636
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1637
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1638
lemma homeomorphic_locally:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1639
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1640
  assumes hom: "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1641
          and iff: "\<And>X Y. X homeomorphic Y \<Longrightarrow> (P X \<longleftrightarrow> Q Y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1642
    shows "locally P S \<longleftrightarrow> locally Q T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1643
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1644
  obtain f g where hom: "homeomorphism S T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1645
    using assms by (force simp: homeomorphic_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1646
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1647
    using homeomorphic_def local.iff
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1648
    by (blast intro!: homeomorphism_locally)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1649
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1650
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1651
lemma homeomorphic_local_compactness:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1652
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1653
  shows "S homeomorphic T \<Longrightarrow> locally compact S \<longleftrightarrow> locally compact T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1654
by (simp add: homeomorphic_compactness homeomorphic_locally)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1655
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1656
lemma locally_translation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1657
  fixes P :: "'a :: real_normed_vector set \<Rightarrow> bool"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1658
  shows
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1659
   "(\<And>S. P (image (\<lambda>x. a + x) S) \<longleftrightarrow> P S)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1660
        \<Longrightarrow> locally P (image (\<lambda>x. a + x) S) \<longleftrightarrow> locally P S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1661
apply (rule homeomorphism_locally [OF homeomorphism_translation])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1662
apply (simp add: homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1663
by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1664
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1665
lemma locally_injective_linear_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1666
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1667
  assumes f: "linear f" "inj f" and iff: "\<And>S. P (f ` S) \<longleftrightarrow> Q S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1668
    shows "locally P (f ` S) \<longleftrightarrow> locally Q S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1669
apply (rule linear_homeomorphism_image [OF f])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1670
apply (rule_tac f=g and g = f in homeomorphism_locally, assumption)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1671
by (metis iff homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1672
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1673
lemma locally_open_map_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1674
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1675
  assumes P: "locally P S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1676
      and f: "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1677
      and oo: "\<And>t. openin (subtopology euclidean S) t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1678
                   \<Longrightarrow> openin (subtopology euclidean (f ` S)) (f ` t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1679
      and Q: "\<And>t. \<lbrakk>t \<subseteq> S; P t\<rbrakk> \<Longrightarrow> Q(f ` t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1680
    shows "locally Q (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1681
proof (clarsimp simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1682
  fix W y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1683
  assume oiw: "openin (subtopology euclidean (f ` S)) W" and "y \<in> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1684
  then have "W \<subseteq> f ` S" by (simp add: openin_euclidean_subtopology_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1685
  have oivf: "openin (subtopology euclidean S) (S \<inter> f -` W)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1686
    by (rule continuous_on_open [THEN iffD1, rule_format, OF f oiw])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1687
  then obtain x where "x \<in> S" "f x = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1688
    using \<open>W \<subseteq> f ` S\<close> \<open>y \<in> W\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1689
  then obtain U V
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1690
    where "openin (subtopology euclidean S) U" "P V" "x \<in> U" "U \<subseteq> V" "V \<subseteq> S \<inter> f -` W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1691
    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
  1692
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1693
  then show "\<exists>X. openin (subtopology euclidean (f ` S)) X \<and> (\<exists>Y. Q Y \<and> y \<in> X \<and> X \<subseteq> Y \<and> Y \<subseteq> W)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1694
    apply (rule_tac x="f ` U" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1695
    apply (rule conjI, blast intro!: oo)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1696
    apply (rule_tac x="f ` V" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1697
    apply (force simp: \<open>f x = y\<close> rev_image_eqI intro: Q)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1698
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1699
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1700
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1701
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1702
subsection\<open>An induction principle for connected sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1703
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1704
proposition connected_induction:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1705
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1706
      and opD: "\<And>T a. \<lbrakk>openin (subtopology euclidean S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1707
      and opI: "\<And>a. a \<in> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1708
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1709
                     (\<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
  1710
      and etc: "a \<in> S" "b \<in> S" "P a" "P b" "Q a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1711
    shows "Q b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1712
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1713
  have 1: "openin (subtopology euclidean S)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1714
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1715
                     b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> Q x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1716
    apply (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1717
    apply (rule_tac x=T in exI, auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1718
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1719
  have 2: "openin (subtopology euclidean S)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1720
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1721
                     b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> \<not> Q x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1722
    apply (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1723
    apply (rule_tac x=T in exI, auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1724
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1725
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1726
    using \<open>connected S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1727
    apply (simp only: connected_openin HOL.not_ex HOL.de_Morgan_conj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1728
    apply (elim disjE allE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1729
         apply (blast intro: 1)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1730
        apply (blast intro: 2, simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1731
       apply clarify apply (metis opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1732
      using opD apply (blast intro: etc elim: dest:)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1733
     using opI etc apply meson+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1734
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1735
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1736
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1737
lemma connected_equivalence_relation_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1738
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1739
      and etc: "a \<in> S" "b \<in> S" "P a" "P b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1740
      and trans: "\<And>x y z. \<lbrakk>R x y; R y z\<rbrakk> \<Longrightarrow> R x z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1741
      and opD: "\<And>T a. \<lbrakk>openin (subtopology euclidean S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1742
      and opI: "\<And>a. a \<in> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1743
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1744
                     (\<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
  1745
    shows "R a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1746
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1747
  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
  1748
    apply (rule connected_induction [OF \<open>connected S\<close> opD], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1749
    by (meson trans opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1750
  then show ?thesis by (metis etc opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1751
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1752
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1753
lemma connected_induction_simple:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1754
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1755
      and etc: "a \<in> S" "b \<in> S" "P a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1756
      and opI: "\<And>a. a \<in> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1757
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1758
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<longrightarrow> P y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1759
    shows "P b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1760
apply (rule connected_induction [OF \<open>connected S\<close> _, where P = "\<lambda>x. True"], blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1761
apply (frule opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1762
using etc apply simp_all
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1763
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1764
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1765
lemma connected_equivalence_relation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1766
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1767
      and etc: "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1768
      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
  1769
      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"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1770
      and opI: "\<And>a. a \<in> S \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. R a x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1771
    shows "R a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1772
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1773
  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
  1774
    apply (rule connected_induction_simple [OF \<open>connected S\<close>], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1775
    by (meson local.sym local.trans opI openin_imp_subset subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1776
  then show ?thesis by (metis etc opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1777
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1778
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1779
lemma locally_constant_imp_constant:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1780
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1781
      and opI: "\<And>a. a \<in> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1782
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. f x = f a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1783
    shows "f constant_on S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1784
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1785
  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
  1786
    apply (rule connected_equivalence_relation [OF \<open>connected S\<close>], simp_all)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1787
    by (metis opI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1788
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1789
    by (metis constant_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1790
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1791
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1792
lemma locally_constant:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1793
     "connected S \<Longrightarrow> locally (\<lambda>U. f constant_on U) S \<longleftrightarrow> f constant_on S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1794
apply (simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1795
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1796
 apply (rule locally_constant_imp_constant, assumption)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1797
 apply (metis (mono_tags, hide_lams) constant_on_def constant_on_subset openin_subtopology_self)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1798
by (meson constant_on_subset openin_imp_subset order_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1799
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1800
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1801
subsection\<open>Basic properties of local compactness\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1802
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1803
proposition locally_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1804
  fixes s :: "'a :: metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1805
  shows
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1806
    "locally compact s \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1807
     (\<forall>x \<in> s. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1808
                    openin (subtopology euclidean s) u \<and> compact v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1809
     (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1810
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1811
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1812
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1813
    apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1814
    apply (erule_tac w = "s \<inter> ball x 1" in locallyE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1815
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1816
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1817
  assume r [rule_format]: ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1818
  have *: "\<exists>u v.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1819
              openin (subtopology euclidean s) u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1820
              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
  1821
          if "open T" "x \<in> s" "x \<in> T" for x T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1822
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1823
    obtain u v where uv: "x \<in> u" "u \<subseteq> v" "v \<subseteq> s" "compact v" "openin (subtopology euclidean s) u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1824
      using r [OF \<open>x \<in> s\<close>] by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1825
    obtain e where "e>0" and e: "cball x e \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1826
      using open_contains_cball \<open>open T\<close> \<open>x \<in> T\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1827
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1828
      apply (rule_tac x="(s \<inter> ball x e) \<inter> u" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1829
      apply (rule_tac x="cball x e \<inter> v" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1830
      using that \<open>e > 0\<close> e uv
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1831
      apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1832
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1833
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1834
  show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1835
    apply (rule locallyI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1836
    apply (subst (asm) openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1837
    apply (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1838
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1839
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1840
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1841
lemma locally_compactE:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1842
  fixes s :: "'a :: metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1843
  assumes "locally compact s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1844
  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>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1845
                             openin (subtopology euclidean s) (u x) \<and> compact (v x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1846
using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1847
unfolding locally_compact by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1848
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1849
lemma locally_compact_alt:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1850
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1851
  shows "locally compact s \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1852
         (\<forall>x \<in> s. \<exists>u. x \<in> u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1853
                    openin (subtopology euclidean s) u \<and> compact(closure u) \<and> closure u \<subseteq> s)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1854
apply (simp add: locally_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1855
apply (intro ball_cong ex_cong refl iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1856
apply (metis bounded_subset closure_eq closure_mono compact_eq_bounded_closed dual_order.trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1857
by (meson closure_subset compact_closure)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1858
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1859
lemma locally_compact_Int_cball:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1860
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1861
  shows "locally compact s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e. 0 < e \<and> closed(cball x e \<inter> s))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1862
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1863
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1864
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1865
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1866
    apply (simp add: locally_compact openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1867
    apply (clarify | assumption | drule bspec)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1868
    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
  1869
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1870
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1871
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1872
    apply (simp add: locally_compact openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1873
    apply (clarify | assumption | drule bspec)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1874
    apply (rule_tac x="ball x e \<inter> s" in exI, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1875
    apply (rule_tac x="cball x e \<inter> s" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1876
    using compact_eq_bounded_closed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1877
    apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1878
    apply (metis open_ball le_infI1 mem_ball open_contains_cball_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1879
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1880
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1881
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1882
lemma locally_compact_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1883
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1884
  shows "locally compact s \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1885
         (\<forall>k. k \<subseteq> s \<and> compact k
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1886
              \<longrightarrow> (\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1887
                         openin (subtopology euclidean s) u \<and> compact v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1888
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1889
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1890
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1891
  then obtain u v where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1892
    uv: "\<And>x. x \<in> s \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1893
                             openin (subtopology euclidean s) (u x) \<and> compact (v x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1894
    by (metis locally_compactE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1895
  have *: "\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and> openin (subtopology euclidean s) u \<and> compact v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1896
          if "k \<subseteq> s" "compact k" for k
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1897
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1898
    have "\<And>C. (\<forall>c\<in>C. openin (subtopology euclidean k) c) \<and> k \<subseteq> \<Union>C \<Longrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1899
                    \<exists>D\<subseteq>C. finite D \<and> k \<subseteq> \<Union>D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1900
      using that by (simp add: compact_eq_openin_cover)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1901
    moreover have "\<forall>c \<in> (\<lambda>x. k \<inter> u x) ` k. openin (subtopology euclidean k) c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1902
      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
  1903
    moreover have "k \<subseteq> \<Union>((\<lambda>x. k \<inter> u x) ` k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1904
      using that by clarsimp (meson subsetCE uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1905
    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
  1906
      by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1907
    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
  1908
      by (metis finite_subset_image)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1909
    have Tuv: "\<Union>(u ` T) \<subseteq> \<Union>(v ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1910
      using T that by (force simp: dest!: uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1911
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1912
      apply (rule_tac x="\<Union>(u ` T)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1913
      apply (rule_tac x="\<Union>(v ` T)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1914
      apply (simp add: Tuv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1915
      using T that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1916
      apply (auto simp: dest!: uv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1917
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1918
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1919
  show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1920
    by (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1921
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1922
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1923
  then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1924
    apply (clarsimp simp add: locally_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1925
    apply (drule_tac x="{x}" in spec, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1926
    done
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 open_imp_locally_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1930
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1931
  assumes "open s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1932
    shows "locally compact s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1933
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1934
  have *: "\<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and> openin (subtopology euclidean s) u \<and> compact v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1935
          if "x \<in> s" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1936
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1937
    obtain e where "e>0" and e: "cball x e \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1938
      using open_contains_cball assms \<open>x \<in> s\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1939
    have ope: "openin (subtopology euclidean s) (ball x e)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1940
      by (meson e open_ball ball_subset_cball dual_order.trans open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1941
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1942
      apply (rule_tac x="ball x e" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1943
      apply (rule_tac x="cball x e" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1944
      using \<open>e > 0\<close> e apply (auto simp: ope)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1945
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1946
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1947
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1948
    unfolding locally_compact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1949
    by (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1950
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1951
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1952
lemma closed_imp_locally_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1953
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1954
  assumes "closed s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1955
    shows "locally compact s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1956
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1957
  have *: "\<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1958
                 openin (subtopology euclidean s) u \<and> compact v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1959
          if "x \<in> s" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1960
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1961
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1962
      apply (rule_tac x = "s \<inter> ball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1963
      apply (rule_tac x = "s \<inter> cball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1964
      using \<open>x \<in> s\<close> assms apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1965
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1966
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1967
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1968
    unfolding locally_compact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1969
    by (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1970
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1971
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1972
lemma locally_compact_UNIV: "locally compact (UNIV :: 'a :: heine_borel set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1973
  by (simp add: closed_imp_locally_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1974
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1975
lemma locally_compact_Int:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1976
  fixes s :: "'a :: t2_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1977
  shows "\<lbrakk>locally compact s; locally compact t\<rbrakk> \<Longrightarrow> locally compact (s \<inter> t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1978
by (simp add: compact_Int locally_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1979
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1980
lemma locally_compact_closedin:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1981
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1982
  shows "\<lbrakk>closedin (subtopology euclidean s) t; locally compact s\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1983
        \<Longrightarrow> locally compact t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1984
unfolding closedin_closed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1985
using closed_imp_locally_compact locally_compact_Int by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1986
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1987
lemma locally_compact_delete:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1988
     fixes s :: "'a :: t1_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1989
     shows "locally compact s \<Longrightarrow> locally compact (s - {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1990
  by (auto simp: openin_delete locally_open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1991
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1992
lemma locally_closed:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1993
  fixes s :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1994
  shows "locally closed s \<longleftrightarrow> locally compact s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1995
        (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1996
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1997
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1998
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  1999
    apply (simp only: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2000
    apply (erule all_forward imp_forward asm_rl exE)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2001
    apply (rule_tac x = "u \<inter> ball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2002
    apply (rule_tac x = "v \<inter> cball x 1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2003
    apply (force intro: openin_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2004
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2005
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2006
  assume ?rhs then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2007
    using compact_eq_bounded_closed locally_mono by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2008
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2009
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2010
lemma locally_compact_openin_Un:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2011
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2012
  assumes LCS: "locally compact S" and LCT:"locally compact T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2013
      and opS: "openin (subtopology euclidean (S \<union> T)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2014
      and opT: "openin (subtopology euclidean (S \<union> T)) T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2015
    shows "locally compact (S \<union> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2016
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2017
  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
  2018
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2019
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2020
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2021
    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
  2022
      by (meson \<open>x \<in> S\<close> opS openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2023
    then have "cball x e2 \<inter> (S \<union> T) = cball x e2 \<inter> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2024
      by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2025
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2026
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2027
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2028
      by (metis closed_Int closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2029
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2030
  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
  2031
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2032
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2033
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2034
    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
  2035
      by (meson \<open>x \<in> T\<close> opT openin_contains_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2036
    then have "cball x e2 \<inter> (S \<union> T) = cball x e2 \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2037
      by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2038
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2039
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2040
      apply (auto simp: cball_min_Int \<open>e2 > 0\<close> inf_assoc closed_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2041
      by (metis closed_Int closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2042
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2043
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2044
    by (force simp: locally_compact_Int_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2045
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2046
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2047
lemma locally_compact_closedin_Un:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2048
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2049
  assumes LCS: "locally compact S" and LCT:"locally compact T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2050
      and clS: "closedin (subtopology euclidean (S \<union> T)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2051
      and clT: "closedin (subtopology euclidean (S \<union> T)) T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2052
    shows "locally compact (S \<union> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2053
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2054
  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
  2055
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2056
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2057
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2058
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2059
    obtain e2 where "e2 > 0" and e2: "closed (cball x e2 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2060
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2061
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2062
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2063
      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
  2064
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2065
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2066
  moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2067
  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
  2068
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2069
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2070
      using LCS \<open>x \<in> S\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2071
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2072
    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
  2073
      using clT x by (fastforce simp: openin_contains_cball closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2074
    then have "closed (cball x e2 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2075
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2076
      have "{} = T - (T - cball x e2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2077
        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
  2078
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2079
        by (simp add: Diff_Diff_Int inf_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2080
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2081
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2082
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2083
      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
  2084
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2085
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2086
  moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2087
  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
  2088
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2089
    obtain e1 where "e1 > 0" and e1: "closed (cball x e1 \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2090
      using LCT \<open>x \<in> T\<close> unfolding locally_compact_Int_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2091
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2092
    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
  2093
      using clS x by (fastforce simp: openin_contains_cball closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2094
    then have "closed (cball x e2 \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2095
      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
  2096
    ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2097
      apply (rule_tac x="min e1 e2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2098
      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
  2099
      by (metis closed_Int closed_Un closed_cball inf_left_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2100
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2101
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2102
    by (auto simp: locally_compact_Int_cball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2103
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2104
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2105
lemma locally_compact_Times:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2106
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2107
  shows "\<lbrakk>locally compact S; locally compact T\<rbrakk> \<Longrightarrow> locally compact (S \<times> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2108
  by (auto simp: compact_Times locally_Times)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2109
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2110
lemma locally_compact_compact_subopen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2111
  fixes S :: "'a :: heine_borel set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2112
  shows
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2113
   "locally compact S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2114
    (\<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
  2115
          \<longrightarrow> (\<exists>U V. K \<subseteq> U \<and> U \<subseteq> V \<and> U \<subseteq> T \<and> V \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2116
                     openin (subtopology euclidean S) U \<and> compact V))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2117
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2118
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2119
  assume L: ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2120
  show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2121
  proof clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2122
    fix K :: "'a set" and T :: "'a set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2123
    assume "K \<subseteq> S" and "compact K" and "open T" and "K \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2124
    obtain U V where "K \<subseteq> U" "U \<subseteq> V" "V \<subseteq> S" "compact V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2125
                 and ope: "openin (subtopology euclidean S) U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2126
      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
  2127
    show "\<exists>U V. K \<subseteq> U \<and> U \<subseteq> V \<and> U \<subseteq> T \<and> V \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2128
                openin (subtopology euclidean S) U \<and> compact V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2129
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2130
      show "K \<subseteq> U \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2131
        by (simp add: \<open>K \<subseteq> T\<close> \<open>K \<subseteq> U\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2132
      show "U \<inter> T \<subseteq> closure(U \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2133
        by (rule closure_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2134
      show "closure (U \<inter> T) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2135
        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)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2136
      show "openin (subtopology euclidean S) (U \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2137
        by (simp add: \<open>open T\<close> ope openin_Int_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2138
      show "compact (closure (U \<inter> T))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2139
        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
  2140
    qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2141
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2142
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2143
  assume ?rhs then show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2144
    unfolding locally_compact_compact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2145
    by (metis open_openin openin_topspace subtopology_superset top.extremum topspace_euclidean_subtopology)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2146
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2147
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2148
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2149
subsection\<open>Sura-Bura's results about compact components of sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2150
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2151
proposition Sura_Bura_compact:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2152
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2153
  assumes "compact S" and C: "C \<in> components S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2154
  shows "C = \<Inter>{T. C \<subseteq> T \<and> openin (subtopology euclidean S) T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2155
                           closedin (subtopology euclidean S) T}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2156
         (is "C = \<Inter>?\<T>")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2157
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2158
  obtain x where x: "C = connected_component_set S x" and "x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2159
    using C by (auto simp: components_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2160
  have "C \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2161
    by (simp add: C in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2162
  have "\<Inter>?\<T> \<subseteq> connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2163
  proof (rule connected_component_maximal)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2164
    have "x \<in> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2165
      by (simp add: \<open>x \<in> S\<close> x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2166
    then show "x \<in> \<Inter>?\<T>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2167
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2168
    have clo: "closed (\<Inter>?\<T>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2169
      by (simp add: \<open>compact S\<close> closed_Inter closedin_compact_eq compact_imp_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2170
    have False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2171
      if K1: "closedin (subtopology euclidean (\<Inter>?\<T>)) K1" and
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2172
         K2: "closedin (subtopology euclidean (\<Inter>?\<T>)) K2" and
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2173
         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
  2174
       for K1 K2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2175
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2176
      have "closed K1" "closed K2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2177
        using closedin_closed_trans clo K1 K2 by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2178
      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
  2179
        using separation_normal \<open>K1 \<inter> K2 = {}\<close> by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2180
      have SV12_ne: "(S - (V1 \<union> V2)) \<inter> (\<Inter>?\<T>) \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2181
      proof (rule compact_imp_fip)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2182
        show "compact (S - (V1 \<union> V2))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2183
          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
  2184
        show clo\<T>: "closed T" if "T \<in> ?\<T>" for T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2185
          using that \<open>compact S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2186
          by (force intro: closedin_closed_trans simp add: compact_imp_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2187
        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
  2188
        proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2189
          assume djo: "(S - (V1 \<union> V2)) \<inter> \<Inter>\<F> = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2190
          obtain D where opeD: "openin (subtopology euclidean S) D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2191
                   and cloD: "closedin (subtopology euclidean S) D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2192
                   and "C \<subseteq> D" and DV12: "D \<subseteq> V1 \<union> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2193
          proof (cases "\<F> = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2194
            case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2195
            with \<open>C \<subseteq> S\<close> djo that show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2196
              by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2197
          next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2198
            case False show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2199
            proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2200
              show ope: "openin (subtopology euclidean S) (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2201
                using openin_Inter \<open>finite \<F>\<close> False \<F> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2202
              then show "closedin (subtopology euclidean S) (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2203
                by (meson clo\<T> \<F> closed_Inter closed_subset openin_imp_subset subset_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2204
              show "C \<subseteq> \<Inter>\<F>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2205
                using \<F> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2206
              show "\<Inter>\<F> \<subseteq> V1 \<union> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2207
                using ope djo openin_imp_subset by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2208
            qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2209
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2210
          have "connected C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2211
            by (simp add: x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2212
          have "closed D"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2213
            using \<open>compact S\<close> cloD closedin_closed_trans compact_imp_closed by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2214
          have cloV1: "closedin (subtopology euclidean D) (D \<inter> closure V1)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2215
            and cloV2: "closedin (subtopology euclidean D) (D \<inter> closure V2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2216
            by (simp_all add: closedin_closed_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2217
          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
  2218
            apply safe
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2219
            using \<open>D \<subseteq> V1 \<union> V2\<close> \<open>open V1\<close> \<open>open V2\<close> V12
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2220
               apply (simp_all add: closure_subset [THEN subsetD] closure_iff_nhds_not_empty, blast+)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2221
            done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2222
          ultimately have cloDV1: "closedin (subtopology euclidean D) (D \<inter> V1)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2223
                      and cloDV2:  "closedin (subtopology euclidean D) (D \<inter> V2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2224
            by metis+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2225
          then obtain U1 U2 where "closed U1" "closed U2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2226
               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
  2227
            by (auto simp: closedin_closed)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2228
          have "D \<inter> U1 \<inter> C \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2229
          proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2230
            assume "D \<inter> U1 \<inter> C = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2231
            then have *: "C \<subseteq> D \<inter> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2232
              using D1 DV12 \<open>C \<subseteq> D\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2233
            have "\<Inter>?\<T> \<subseteq> D \<inter> V2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2234
              apply (rule Inter_lower)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2235
              using * apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2236
              by (meson cloDV2 \<open>open V2\<close> cloD closedin_trans le_inf_iff opeD openin_Int_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2237
            then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2238
              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
  2239
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2240
          moreover have "D \<inter> U2 \<inter> C \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2241
          proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2242
            assume "D \<inter> U2 \<inter> C = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2243
            then have *: "C \<subseteq> D \<inter> V1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2244
              using D2 DV12 \<open>C \<subseteq> D\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2245
            have "\<Inter>?\<T> \<subseteq> D \<inter> V1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2246
              apply (rule Inter_lower)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2247
              using * apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2248
              by (meson cloDV1 \<open>open V1\<close> cloD closedin_trans le_inf_iff opeD openin_Int_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2249
            then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2250
              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
  2251
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2252
          ultimately show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2253
            using \<open>connected C\<close> unfolding connected_closed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2254
            apply (simp only: not_ex)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2255
            apply (drule_tac x="D \<inter> U1" in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2256
            apply (drule_tac x="D \<inter> U2" in spec)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2257
            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
  2258
            by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2259
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2260
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2261
      show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2262
        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
  2263
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2264
    then show "connected (\<Inter>?\<T>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2265
      by (auto simp: connected_closedin_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2266
    show "\<Inter>?\<T> \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2267
      by (fastforce simp: C in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2268
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2269
  with x show "\<Inter>?\<T> \<subseteq> C" by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2270
qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2271
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2272
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2273
corollary Sura_Bura_clopen_subset:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2274
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2275
  assumes S: "locally compact S" and C: "C \<in> components S" and "compact C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2276
      and U: "open U" "C \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2277
  obtains K where "openin (subtopology euclidean S) K" "compact K" "C \<subseteq> K" "K \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2278
proof (rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2279
  assume "\<not> thesis"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2280
  with that have neg: "\<nexists>K. openin (subtopology euclidean S) K \<and> compact K \<and> C \<subseteq> K \<and> K \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2281
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2282
  obtain V K where "C \<subseteq> V" "V \<subseteq> U" "V \<subseteq> K" "K \<subseteq> S" "compact K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2283
               and opeSV: "openin (subtopology euclidean S) V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2284
    using S U \<open>compact C\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2285
    apply (simp add: locally_compact_compact_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2286
    by (meson C in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2287
  let ?\<T> = "{T. C \<subseteq> T \<and> openin (subtopology euclidean K) T \<and> compact T \<and> T \<subseteq> K}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2288
  have CK: "C \<in> components K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2289
    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
  2290
  with \<open>compact K\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2291
  have "C = \<Inter>{T. C \<subseteq> T \<and> openin (subtopology euclidean K) T \<and> closedin (subtopology euclidean K) T}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2292
    by (simp add: Sura_Bura_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2293
  then have Ceq: "C = \<Inter>?\<T>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2294
    by (simp add: closedin_compact_eq \<open>compact K\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2295
  obtain W where "open W" and W: "V = S \<inter> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2296
    using opeSV by (auto simp: openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2297
  have "-(U \<inter> W) \<inter> \<Inter>?\<T> \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2298
  proof (rule closed_imp_fip_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2299
    show "- (U \<inter> W) \<inter> \<Inter>\<F> \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2300
      if "finite \<F>" and \<F>: "\<F> \<subseteq> ?\<T>" for \<F>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2301
    proof (cases "\<F> = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2302
      case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2303
      have False if "U = UNIV" "W = UNIV"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2304
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2305
        have "V = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2306
          by (simp add: W \<open>W = UNIV\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2307
        with neg show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2308
          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
  2309
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2310
      with True show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2311
        by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2312
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2313
      case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2314
      show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2315
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2316
        assume "- (U \<inter> W) \<inter> \<Inter>\<F> = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2317
        then have FUW: "\<Inter>\<F> \<subseteq> U \<inter> W"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2318
          by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2319
        have "C \<subseteq> \<Inter>\<F>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2320
          using \<F> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2321
        moreover have "compact (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2322
          by (metis (no_types, lifting) compact_Inter False mem_Collect_eq subsetCE \<F>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2323
        moreover have "\<Inter>\<F> \<subseteq> K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2324
          using False that(2) by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2325
        moreover have opeKF: "openin (subtopology euclidean K) (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2326
          using False \<F> \<open>finite \<F>\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2327
        then have opeVF: "openin (subtopology euclidean V) (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2328
          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
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2329
        then have "openin (subtopology euclidean S) (\<Inter>\<F>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2330
          by (metis opeSV openin_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2331
        moreover have "\<Inter>\<F> \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2332
          by (meson \<open>V \<subseteq> U\<close> opeVF dual_order.trans openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2333
        ultimately show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2334
          using neg by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2335
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2336
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2337
  qed (use \<open>open W\<close> \<open>open U\<close> in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2338
  with W Ceq \<open>C \<subseteq> V\<close> \<open>C \<subseteq> U\<close> show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2339
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2340
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2341
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2342
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2343
corollary Sura_Bura_clopen_subset_alt:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2344
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2345
  assumes S: "locally compact S" and C: "C \<in> components S" and "compact C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2346
      and opeSU: "openin (subtopology euclidean S) U" and "C \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2347
  obtains K where "openin (subtopology euclidean S) K" "compact K" "C \<subseteq> K" "K \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2348
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2349
  obtain V where "open V" "U = S \<inter> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2350
    using opeSU by (auto simp: openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2351
  with \<open>C \<subseteq> U\<close> have "C \<subseteq> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2352
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2353
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2354
    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
  2355
    by (metis \<open>U = S \<inter> V\<close> inf.bounded_iff openin_imp_subset that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2356
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2357
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2358
corollary Sura_Bura:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2359
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2360
  assumes "locally compact S" "C \<in> components S" "compact C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2361
  shows "C = \<Inter> {K. C \<subseteq> K \<and> compact K \<and> openin (subtopology euclidean S) K}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2362
         (is "C = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2363
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2364
  show "?rhs \<subseteq> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2365
  proof (clarsimp, rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2366
    fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2367
    assume *: "\<forall>X. C \<subseteq> X \<and> compact X \<and> openin (subtopology euclidean S) X \<longrightarrow> x \<in> X"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2368
      and "x \<notin> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2369
    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
  2370
      using separation_normal [of "{x}" C]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2371
      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
  2372
    have "x \<notin> V"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2373
      using \<open>U \<inter> V = {}\<close> \<open>{x} \<subseteq> U\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2374
    then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2375
      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
  2376
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2377
qed blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2378
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2379
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2380
subsection\<open>Special cases of local connectedness and path connectedness\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2381
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2382
lemma locally_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2383
  assumes
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2384
    "\<And>v x. \<lbrakk>openin (subtopology euclidean S) v; x \<in> v\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2385
              \<Longrightarrow> \<exists>u. openin (subtopology euclidean S) u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2386
                      connected u \<and> x \<in> u \<and> u \<subseteq> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2387
   shows "locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2388
apply (clarsimp simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2389
apply (drule assms; blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2390
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2391
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2392
lemma locally_connected_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2393
  assumes "locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2394
          "openin (subtopology euclidean S) t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2395
          "x \<in> t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2396
   shows "openin (subtopology euclidean S) (connected_component_set t x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2397
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2398
  { fix y :: 'a
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2399
    let ?SS = "subtopology euclidean S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2400
    assume 1: "openin ?SS t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2401
              "\<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
  2402
    and "connected_component t x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2403
    then have "y \<in> t" and y: "y \<in> connected_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2404
      using connected_component_subset by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2405
    obtain F where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2406
      "\<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
  2407
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2408
    then obtain G where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2409
       "\<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
  2410
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2411
    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
  2412
      using 1 \<open>y \<in> t\<close> by presburger
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2413
    have "G y t \<subseteq> connected_component_set t y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2414
      by (metis (no_types) * connected_component_eq_self connected_component_mono contra_subsetD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2415
    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
  2416
      by (metis (no_types) * connected_component_eq dual_order.trans y)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2417
  }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2418
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2419
    using assms openin_subopen by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2420
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2421
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2422
lemma locally_connected_3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2423
  assumes "\<And>t x. \<lbrakk>openin (subtopology euclidean S) t; x \<in> t\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2424
              \<Longrightarrow> openin (subtopology euclidean S)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2425
                          (connected_component_set t x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2426
          "openin (subtopology euclidean S) v" "x \<in> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2427
   shows  "\<exists>u. openin (subtopology euclidean S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2428
using assms connected_component_subset by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2429
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2430
lemma locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2431
  "locally connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2432
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2433
          \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2434
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2435
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2436
lemma locally_connected_open_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2437
  "locally connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2438
   (\<forall>t x. openin (subtopology euclidean S) t \<and> x \<in> t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2439
          \<longrightarrow> openin (subtopology euclidean S) (connected_component_set t x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2440
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2441
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2442
lemma locally_path_connected_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2443
  assumes
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2444
    "\<And>v x. \<lbrakk>openin (subtopology euclidean S) v; x \<in> v\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2445
              \<Longrightarrow> \<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2446
   shows "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2447
apply (clarsimp simp add: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2448
apply (drule assms; blast)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2449
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2450
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2451
lemma locally_path_connected_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2452
  assumes "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2453
          "openin (subtopology euclidean S) t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2454
          "x \<in> t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2455
   shows "openin (subtopology euclidean S) (path_component_set t x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2456
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2457
  { fix y :: 'a
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2458
    let ?SS = "subtopology euclidean S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2459
    assume 1: "openin ?SS t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2460
              "\<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
  2461
    and "path_component t x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2462
    then have "y \<in> t" and y: "y \<in> path_component_set t x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2463
      using path_component_mem(2) by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2464
    obtain F where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2465
      "\<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
  2466
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2467
    then obtain G where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2468
       "\<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
  2469
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2470
    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
  2471
      using 1 \<open>y \<in> t\<close> by presburger
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2472
    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
  2473
      using * path_component_maximal rev_subsetD by blast
69620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2474
    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
  2475
      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
  2476
  }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2477
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2478
    using assms openin_subopen by (force simp: locally_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2479
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2480
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2481
lemma locally_path_connected_3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2482
  assumes "\<And>t x. \<lbrakk>openin (subtopology euclidean S) t; x \<in> t\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2483
              \<Longrightarrow> openin (subtopology euclidean S) (path_component_set t x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2484
          "openin (subtopology euclidean S) v" "x \<in> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2485
   shows  "\<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2486
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2487
  have "path_component v x x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2488
    by (meson assms(3) path_component_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2489
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2490
    by (metis assms(1) assms(2) assms(3) mem_Collect_eq path_component_subset path_connected_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2491
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2492
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2493
proposition locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2494
  "locally path_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2495
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2496
          \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2497
  by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2498
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2499
proposition locally_path_connected_open_path_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2500
  "locally path_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2501
   (\<forall>t x. openin (subtopology euclidean S) t \<and> x \<in> t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2502
          \<longrightarrow> openin (subtopology euclidean S) (path_component_set t x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2503
  by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2504
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2505
lemma locally_connected_open_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2506
  "locally connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2507
   (\<forall>t c. openin (subtopology euclidean S) t \<and> c \<in> components t
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2508
          \<longrightarrow> openin (subtopology euclidean S) c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2509
by (metis components_iff locally_connected_open_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2510
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2511
proposition locally_connected_im_kleinen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2512
  "locally connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2513
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2514
       \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2515
                x \<in> u \<and> u \<subseteq> v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2516
                (\<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
  2517
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2518
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2519
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2520
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2521
    by (fastforce simp add: locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2522
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2523
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2524
  have *: "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2525
       if "openin (subtopology euclidean S) t" and c: "c \<in> components t" and "x \<in> c" for t c x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2526
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2527
    from that \<open>?rhs\<close> [rule_format, of t x]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2528
    obtain u where u:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2529
      "openin (subtopology euclidean S) u \<and> x \<in> u \<and> u \<subseteq> t \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2530
       (\<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
  2531
      using in_components_subset by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2532
    obtain F :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2533
      "\<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
  2534
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2535
    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
  2536
      by (meson components_iff c)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2537
    obtain G :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2538
        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
  2539
      by moura
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2540
     have "G c u \<notin> u \<or> G c u \<in> c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2541
      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
  2542
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2543
      using G u by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2544
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2545
  show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2546
    apply (clarsimp simp add: locally_connected_open_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2547
    apply (subst openin_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2548
    apply (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2549
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2550
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2551
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2552
proposition locally_path_connected_im_kleinen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2553
  "locally path_connected S \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2554
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2555
       \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2556
                x \<in> u \<and> u \<subseteq> v \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2557
                (\<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
  2558
                                pathstart p = x \<and> pathfinish p = y))))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2559
   (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2560
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2561
  assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2562
  then show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2563
    apply (simp add: locally_path_connected path_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2564
    apply (erule all_forward ex_forward imp_forward conjE | simp)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2565
    by (meson dual_order.trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2566
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2567
  assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2568
  have *: "\<exists>T. openin (subtopology euclidean S) T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2569
               x \<in> T \<and> T \<subseteq> path_component_set u z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2570
       if "openin (subtopology euclidean S) u" and "z \<in> u" and c: "path_component u z x" for u z x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2571
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2572
    have "x \<in> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2573
      by (meson c path_component_mem(2))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2574
    with that \<open>?rhs\<close> [rule_format, of u x]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2575
    obtain U where U:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2576
      "openin (subtopology euclidean S) U \<and> x \<in> U \<and> U \<subseteq> u \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2577
       (\<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
  2578
       by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2579
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2580
      apply (rule_tac x=U in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2581
      apply (auto simp: U)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2582
      apply (metis U c path_component_trans path_component_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2583
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2584
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2585
  show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2586
    apply (clarsimp simp add: locally_path_connected_open_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2587
    apply (subst openin_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2588
    apply (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2589
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2590
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2591
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2592
lemma locally_path_connected_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2593
  "locally path_connected S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2594
using locally_mono path_connected_imp_connected by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2595
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2596
lemma locally_connected_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2597
  "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally connected c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2598
by (meson locally_connected_open_component locally_open_subset openin_subtopology_self)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2599
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2600
lemma locally_path_connected_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2601
  "\<lbrakk>locally path_connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally path_connected c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2602
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
  2603
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2604
lemma locally_path_connected_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2605
  "locally path_connected S \<Longrightarrow> locally path_connected (connected_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2606
by (metis components_iff connected_component_eq_empty locally_empty locally_path_connected_components)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2607
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2608
lemma open_imp_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2609
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2610
  shows "open S \<Longrightarrow> locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2611
apply (rule locally_mono [of convex])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2612
apply (simp_all add: locally_def openin_open_eq convex_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2613
apply (meson open_ball centre_in_ball convex_ball openE order_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2614
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2615
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2616
lemma open_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2617
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2618
  shows "open S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2619
by (simp add: locally_path_connected_imp_locally_connected open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2620
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2621
lemma locally_path_connected_UNIV: "locally path_connected (UNIV::'a :: real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2622
  by (simp add: open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2623
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2624
lemma locally_connected_UNIV: "locally connected (UNIV::'a :: real_normed_vector set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2625
  by (simp add: open_imp_locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2626
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2627
lemma openin_connected_component_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2628
    "locally connected S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2629
     \<Longrightarrow> openin (subtopology euclidean S) (connected_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2630
apply (simp add: locally_connected_open_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2631
by (metis connected_component_eq_empty connected_component_subset open_empty open_subset openin_subtopology_self)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2632
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2633
lemma openin_components_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2634
    "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (subtopology euclidean S) c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2635
  using locally_connected_open_component openin_subtopology_self by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2636
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2637
lemma openin_path_component_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2638
  "locally path_connected S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2639
        \<Longrightarrow> openin (subtopology euclidean S) (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2640
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
  2641
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2642
lemma closedin_path_component_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2643
    "locally path_connected S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2644
        \<Longrightarrow> closedin (subtopology euclidean S) (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2645
apply  (simp add: closedin_def path_component_subset complement_path_component_Union)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2646
apply (rule openin_Union)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2647
using openin_path_component_locally_path_connected by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2648
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2649
lemma convex_imp_locally_path_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2650
  fixes S :: "'a:: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2651
  shows "convex S \<Longrightarrow> locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2652
apply (clarsimp simp add: locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2653
apply (subst (asm) openin_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2654
apply clarify
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2655
apply (erule (1) openE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2656
apply (rule_tac x = "S \<inter> ball x e" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2657
apply (force simp: convex_Int convex_imp_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2658
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2659
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2660
lemma convex_imp_locally_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2661
  fixes S :: "'a:: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2662
  shows "convex S \<Longrightarrow> locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2663
  by (simp add: locally_path_connected_imp_locally_connected convex_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2664
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2665
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2666
subsection\<open>Relations between components and path components\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2667
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2668
lemma path_component_eq_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2669
  assumes "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2670
    shows "(path_component S x = connected_component S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2671
proof (cases "x \<in> S")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2672
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2673
  have "openin (subtopology euclidean (connected_component_set S x)) (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2674
    apply (rule openin_subset_trans [of S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2675
    apply (intro conjI openin_path_component_locally_path_connected [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2676
    using path_component_subset_connected_component   apply (auto simp: connected_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2677
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2678
  moreover have "closedin (subtopology euclidean (connected_component_set S x)) (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2679
    apply (rule closedin_subset_trans [of S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2680
    apply (intro conjI closedin_path_component_locally_path_connected [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2681
    using path_component_subset_connected_component   apply (auto simp: connected_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2682
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2683
  ultimately have *: "path_component_set S x = connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2684
    by (metis connected_connected_component connected_clopen True path_component_eq_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2685
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2686
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2687
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2688
  case False then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2689
    by (metis Collect_empty_eq_bot connected_component_eq_empty path_component_eq_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2690
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2691
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2692
lemma path_component_eq_connected_component_set:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2693
     "locally path_connected S \<Longrightarrow> (path_component_set S x = connected_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2694
by (simp add: path_component_eq_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2695
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2696
lemma locally_path_connected_path_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2697
     "locally path_connected S \<Longrightarrow> locally path_connected (path_component_set S x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2698
using locally_path_connected_connected_component path_component_eq_connected_component by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2699
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2700
lemma open_path_connected_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2701
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2702
  shows "open S \<Longrightarrow> path_component S x = connected_component S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2703
by (simp add: path_component_eq_connected_component open_imp_locally_path_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2704
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2705
lemma open_path_connected_component_set:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2706
  fixes S :: "'a :: real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2707
  shows "open S \<Longrightarrow> path_component_set S x = connected_component_set S x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2708
by (simp add: open_path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2709
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2710
proposition locally_connected_quotient_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2711
  assumes lcS: "locally connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2712
      and oo: "\<And>T. T \<subseteq> f ` S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2713
                \<Longrightarrow> openin (subtopology euclidean S) (S \<inter> f -` T) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2714
                    openin (subtopology euclidean (f ` S)) T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2715
    shows "locally connected (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2716
proof (clarsimp simp: locally_connected_open_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2717
  fix U C
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2718
  assume opefSU: "openin (subtopology euclidean (f ` S)) U" and "C \<in> components U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2719
  then have "C \<subseteq> U" "U \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2720
    by (meson in_components_subset openin_imp_subset)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2721
  then have "openin (subtopology euclidean (f ` S)) C \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2722
             openin (subtopology euclidean S) (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2723
    by (auto simp: oo)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2724
  moreover have "openin (subtopology euclidean S) (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2725
  proof (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2726
    fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2727
    assume "x \<in> S" "f x \<in> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2728
    show "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2729
    proof (intro conjI exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2730
      show "openin (subtopology euclidean S) (connected_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2731
      proof (rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2732
        assume **: "\<not> openin (subtopology euclidean S) (connected_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2733
        then have "x \<notin> (S \<inter> f -` U)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2734
          using \<open>U \<subseteq> f ` S\<close> opefSU lcS locally_connected_2 oo by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2735
        with ** show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2736
          by (metis (no_types) connected_component_eq_empty empty_iff openin_subopen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2737
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2738
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2739
      show "x \<in> connected_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2740
        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
  2741
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2742
      have contf: "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2743
        by (simp add: continuous_on_open oo openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2744
      then have "continuous_on (connected_component_set (S \<inter> f -` U) x) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2745
        apply (rule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2746
        using connected_component_subset apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2747
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2748
      then have "connected (f ` connected_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2749
        by (rule connected_continuous_image [OF _ connected_connected_component])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2750
      moreover have "f ` connected_component_set (S \<inter> f -` U) x \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2751
        using connected_component_in by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2752
      moreover have "C \<inter> f ` connected_component_set (S \<inter> f -` U) x \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2753
        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
  2754
      ultimately have fC: "f ` (connected_component_set (S \<inter> f -` U) x) \<subseteq> C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2755
        by (rule components_maximal [OF \<open>C \<in> components U\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2756
      have cUC: "connected_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2757
        using connected_component_subset fC by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2758
      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
  2759
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2760
        { assume "x \<in> connected_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2761
          then have ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2762
            using cUC connected_component_idemp connected_component_mono by blast }
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2763
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2764
          using connected_component_eq_empty by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2765
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2766
      also have "\<dots> \<subseteq> (S \<inter> f -` C)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2767
        by (rule connected_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2768
      finally show "connected_component_set (S \<inter> f -` U) x \<subseteq> (S \<inter> f -` C)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2769
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2770
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2771
  ultimately show "openin (subtopology euclidean (f ` S)) C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2772
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2773
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2774
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2775
text\<open>The proof resembles that above but is not identical!\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2776
proposition locally_path_connected_quotient_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2777
  assumes lcS: "locally path_connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2778
      and oo: "\<And>T. T \<subseteq> f ` S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2779
                \<Longrightarrow> openin (subtopology euclidean S) (S \<inter> f -` T) \<longleftrightarrow> openin (subtopology euclidean (f ` S)) T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2780
    shows "locally path_connected (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2781
proof (clarsimp simp: locally_path_connected_open_path_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2782
  fix U y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2783
  assume opefSU: "openin (subtopology euclidean (f ` S)) U" and "y \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2784
  then have "path_component_set U y \<subseteq> U" "U \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2785
    by (meson path_component_subset openin_imp_subset)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2786
  then have "openin (subtopology euclidean (f ` S)) (path_component_set U y) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2787
             openin (subtopology euclidean S) (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2788
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2789
    have "path_component_set U y \<subseteq> f ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2790
      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
  2791
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2792
      using oo by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2793
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2794
  moreover have "openin (subtopology euclidean S) (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2795
  proof (subst openin_subopen, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2796
    fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2797
    assume "x \<in> S" and Uyfx: "path_component U y (f x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2798
    then have "f x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2799
      using path_component_mem by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2800
    show "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2801
    proof (intro conjI exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2802
      show "openin (subtopology euclidean S) (path_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2803
      proof (rule ccontr)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2804
        assume **: "\<not> openin (subtopology euclidean S) (path_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2805
        then have "x \<notin> (S \<inter> f -` U)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2806
          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
  2807
        then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2808
          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
  2809
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2810
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2811
      show "x \<in> path_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2812
        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
  2813
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2814
      have contf: "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2815
        by (simp add: continuous_on_open oo openin_imp_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2816
      then have "continuous_on (path_component_set (S \<inter> f -` U) x) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2817
        apply (rule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2818
        using path_component_subset apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2819
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2820
      then have "path_connected (f ` path_component_set (S \<inter> f -` U) x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2821
        by (simp add: path_connected_continuous_image)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2822
      moreover have "f ` path_component_set (S \<inter> f -` U) x \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2823
        using path_component_mem by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2824
      moreover have "f x \<in> f ` path_component_set (S \<inter> f -` U) x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2825
        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
  2826
      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
  2827
        by (meson path_component_maximal)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2828
       also have  "\<dots> \<subseteq> path_component_set U y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2829
        by (simp add: Uyfx path_component_maximal path_component_subset path_component_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2830
      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
  2831
      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
  2832
        using path_component_subset fC by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2833
      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
  2834
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2835
        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
  2836
          using cUC path_component_mono by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2837
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2838
          using path_component_path_component by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2839
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2840
      also have "\<dots> \<subseteq> (S \<inter> f -` path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2841
        by (rule path_component_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2842
      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
  2843
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2844
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2845
  ultimately show "openin (subtopology euclidean (f ` S)) (path_component_set U y)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2846
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2847
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2848
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2849
subsection%unimportant\<open>Components, continuity, openin, closedin\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2850
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2851
lemma continuous_on_components_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2852
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2853
  assumes "\<And>c. c \<in> components S \<Longrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2854
              openin (subtopology euclidean S) c \<and> continuous_on c f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2855
    shows "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2856
proof (clarsimp simp: continuous_openin_preimage_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2857
  fix t :: "'b set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2858
  assume "open t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2859
  have *: "S \<inter> f -` t = (\<Union>c \<in> components S. c \<inter> f -` t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2860
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2861
  show "openin (subtopology euclidean S) (S \<inter> f -` t)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2862
    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
  2863
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2864
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2865
lemma continuous_on_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2866
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2867
  assumes "locally connected S "
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2868
          "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2869
    shows "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2870
apply (rule continuous_on_components_gen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2871
apply (auto simp: assms intro: openin_components_locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2872
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2873
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2874
lemma continuous_on_components_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2875
    "locally connected S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2876
     \<Longrightarrow> (continuous_on S f \<longleftrightarrow> (\<forall>c \<in> components S. continuous_on c f))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2877
by (meson continuous_on_components continuous_on_subset in_components_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2878
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2879
lemma continuous_on_components_open:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2880
 fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2881
  assumes "open S "
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2882
          "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2883
    shows "continuous_on S f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2884
using continuous_on_components open_imp_locally_connected assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2885
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2886
lemma continuous_on_components_open_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2887
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2888
  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
  2889
using continuous_on_subset in_components_subset
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2890
by (blast intro: continuous_on_components_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2891
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2892
lemma closedin_union_complement_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2893
  assumes u: "locally connected u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2894
      and S: "closedin (subtopology euclidean u) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2895
      and cuS: "c \<subseteq> components(u - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2896
    shows "closedin (subtopology euclidean u) (S \<union> \<Union>c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2897
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2898
  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
  2899
    by (simp add: disjnt_def) blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2900
  have "S \<subseteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2901
    using S closedin_imp_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2902
  moreover have "u - S = \<Union>c \<union> \<Union>(components (u - S) - c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2903
    by (metis Diff_partition Union_components Union_Un_distrib assms(3))
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2904
  moreover have "disjnt (\<Union>c) (\<Union>(components (u - S) - c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2905
    apply (rule di)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2906
    by (metis DiffD1 DiffD2 assms(3) components_nonoverlap disjnt_def subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2907
  ultimately have eq: "S \<union> \<Union>c = u - (\<Union>(components(u - S) - c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2908
    by (auto simp: disjnt_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2909
  have *: "openin (subtopology euclidean u) (\<Union>(components (u - S) - c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2910
    apply (rule openin_Union)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2911
    apply (rule openin_trans [of "u - S"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2912
    apply (simp add: u S locally_diff_closed openin_components_locally_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2913
    apply (simp add: openin_diff S)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2914
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2915
  have "openin (subtopology euclidean u) (u - (u - \<Union>(components (u - S) - c)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2916
    apply (rule openin_diff, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2917
    apply (metis closedin_diff closedin_topspace topspace_euclidean_subtopology *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2918
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2919
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2920
    by (force simp: eq closedin_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2921
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2922
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2923
lemma closed_union_complement_components:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2924
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2925
  assumes S: "closed S" and c: "c \<subseteq> components(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2926
    shows "closed(S \<union> \<Union> c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2927
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2928
  have "closedin (subtopology euclidean UNIV) (S \<union> \<Union>c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2929
    apply (rule closedin_union_complement_components [OF locally_connected_UNIV])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2930
    using S c apply (simp_all add: Compl_eq_Diff_UNIV)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2931
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2932
  then show ?thesis by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2933
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2934
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2935
lemma closedin_Un_complement_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2936
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2937
  assumes u: "locally connected u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2938
      and S: "closedin (subtopology euclidean u) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2939
      and c: " c \<in> components(u - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2940
    shows "closedin (subtopology euclidean u) (S \<union> c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2941
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2942
  have "closedin (subtopology euclidean u) (S \<union> \<Union>{c})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2943
    using c by (blast intro: closedin_union_complement_components [OF u S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2944
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2945
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2946
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2947
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2948
lemma closed_Un_complement_component:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2949
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2950
  assumes S: "closed S" and c: " c \<in> components(-S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2951
    shows "closed (S \<union> c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2952
  by (metis Compl_eq_Diff_UNIV S c closed_closedin closedin_Un_complement_component
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2953
      locally_connected_UNIV subtopology_UNIV)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2954
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2955
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2956
subsection\<open>Existence of isometry between subspaces of same dimension\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2957
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2958
lemma isometry_subset_subspace:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2959
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2960
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2961
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2962
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2963
      and d: "dim S \<le> dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2964
  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
  2965
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2966
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2967
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2968
             and "independent B" "finite B" "card B = dim S" "span B = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2969
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2970
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2971
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2972
             and "independent C" "finite C" "card C = dim T" "span C = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2973
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2974
  obtain fb where "fb ` B \<subseteq> C" "inj_on fb B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2975
    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
  2976
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2977
    using Corth
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2978
    apply (auto simp: pairwise_def orthogonal_clauses)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2979
    by (meson subsetD image_eqI inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2980
  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
  2981
    using linear_independent_extend \<open>independent B\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2982
  have "span (f ` B) \<subseteq> span C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2983
    by (metis \<open>fb ` B \<subseteq> C\<close> ffb image_cong span_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2984
  then have "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2985
    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
  2986
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2987
    using B1 C1 \<open>fb ` B \<subseteq> C\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2988
  have "norm (f x) = norm x" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2989
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2990
    interpret linear f by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2991
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2992
      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
  2993
    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
  2994
    also have "\<dots> = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2995
      apply (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2996
      apply (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2997
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2998
    also have "\<dots> = norm x ^2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  2999
      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
  3000
    finally show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3001
      by (simp add: norm_eq_sqrt_inner)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3002
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3003
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3004
    by (rule that [OF \<open>linear f\<close> \<open>f ` S \<subseteq> T\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3005
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3006
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3007
proposition isometries_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3008
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3009
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3010
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3011
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3012
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3013
  obtains f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3014
                    "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3015
                    "\<And>x. x \<in> T \<Longrightarrow> norm(g x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3016
                    "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3017
                    "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3018
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3019
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3020
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3021
             and "independent B" "finite B" "card B = dim S" "span B = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3022
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3023
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3024
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3025
             and "independent C" "finite C" "card C = dim T" "span C = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3026
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3027
  obtain fb where "bij_betw fb B C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3028
    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
  3029
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3030
    using Corth
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3031
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3032
    by (meson subsetD image_eqI inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3033
  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
  3034
    using linear_independent_extend \<open>independent B\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3035
  interpret f: linear f by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3036
  define gb where "gb \<equiv> inv_into B fb"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3037
  then have pairwise_orth_gb: "pairwise (\<lambda>v j. orthogonal (gb v) (gb j)) C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3038
    using Borth
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3039
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3040
    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
  3041
  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
  3042
    using linear_independent_extend \<open>independent C\<close> by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3043
  interpret g: linear g by fact
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3044
  have "span (f ` B) \<subseteq> span C"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3045
    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
  3046
  then have "f ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3047
    unfolding \<open>span B = S\<close> \<open>span C = T\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3048
      span_linear_image[OF \<open>linear f\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3049
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3050
    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
  3051
  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
  3052
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3053
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3054
      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
  3055
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3056
      using linear_sum [OF \<open>linear f\<close>] x by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3057
    also have "\<dots> = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3058
      by (simp add: f.sum f.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3059
    also have "\<dots> = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3060
      by (simp add: ffb cong: sum.cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3061
    finally have *: "f x = (\<Sum>v\<in>B. a v *\<^sub>R fb v)" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3062
    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
  3063
    also have "\<dots> = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3064
      apply (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3065
      apply (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3066
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3067
    also have "\<dots> = (norm x)\<^sup>2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3068
      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
  3069
    finally show "norm (f x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3070
      by (simp add: norm_eq_sqrt_inner)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3071
    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
  3072
    also have "\<dots> = (\<Sum>v\<in>B. g (a v *\<^sub>R fb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3073
      by (simp add: g.sum g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3074
    also have "\<dots> = (\<Sum>v\<in>B. a v *\<^sub>R g (fb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3075
      by (simp add: g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3076
    also have "\<dots> = (\<Sum>v\<in>B. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3077
      apply (rule sum.cong [OF refl])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3078
      using \<open>bij_betw fb B C\<close> gb_def bij_betwE bij_betw_inv_into_left gb_def ggb by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3079
    also have "\<dots> = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3080
      using x by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3081
    finally show "g (f x) = x" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3082
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3083
  have [simp]: "\<And>x. x \<in> C \<Longrightarrow> norm (gb x) = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3084
    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
  3085
  have g [simp]: "f (g x) = x" if "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3086
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3087
    obtain a where x: "x = (\<Sum>v \<in> C. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3088
      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
  3089
    have "g x = (\<Sum>v \<in> C. g (a v *\<^sub>R v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3090
      by (simp add: x g.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3091
    also have "\<dots> = (\<Sum>v \<in> C. a v *\<^sub>R g v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3092
      by (simp add: g.scale)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3093
    also have "\<dots> = (\<Sum>v \<in> C. a v *\<^sub>R gb v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3094
      by (simp add: ggb cong: sum.cong)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3095
    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
  3096
    also have "\<dots> = (\<Sum>v\<in>C. f (a v *\<^sub>R gb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3097
      by (simp add: f.scale f.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3098
    also have "\<dots> = (\<Sum>v\<in>C. a v *\<^sub>R f (gb v))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3099
      by (simp add: f.scale f.sum)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3100
    also have "\<dots> = (\<Sum>v\<in>C. a v *\<^sub>R v)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3101
      using \<open>bij_betw fb B C\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3102
      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
  3103
    also have "\<dots> = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3104
      using x by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3105
    finally show "f (g x) = x" .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3106
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3107
  have gim: "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3108
    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
  3109
        image_iff linear_subspace_image span_eq_iff subset_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3110
  have fim: "f ` S = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3111
    using \<open>g ` T = S\<close> image_iff by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3112
  have [simp]: "norm (g x) = norm x" if "x \<in> T" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3113
    using fim that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3114
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3115
    apply (rule that [OF \<open>linear f\<close> \<open>linear g\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3116
    apply (simp_all add: fim gim)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3117
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3118
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3119
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3120
corollary isometry_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3121
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3122
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3123
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3124
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3125
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3126
  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
  3127
using isometries_subspaces [OF assms]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3128
by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3129
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3130
corollary isomorphisms_UNIV_UNIV:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3131
  assumes "DIM('M) = DIM('N)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3132
  obtains f::"'M::euclidean_space \<Rightarrow>'N::euclidean_space" and g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3133
  where "linear f" "linear g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3134
                    "\<And>x. norm(f x) = norm x" "\<And>y. norm(g y) = norm y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3135
                    "\<And>x. g (f x) = x" "\<And>y. f(g y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3136
  using assms by (auto intro: isometries_subspaces [of "UNIV::'M set" "UNIV::'N set"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3137
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3138
lemma homeomorphic_subspaces:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3139
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3140
    and T :: "'b::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3141
  assumes S: "subspace S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3142
      and T: "subspace T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3143
      and d: "dim S = dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3144
    shows "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3145
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3146
  obtain f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3147
                   "\<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
  3148
    by (blast intro: isometries_subspaces [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3149
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3150
    apply (simp add: homeomorphic_def homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3151
    apply (rule_tac x=f in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3152
    apply (rule_tac x=g in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3153
    apply (auto simp: linear_continuous_on linear_conv_bounded_linear)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3154
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3155
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3156
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3157
lemma homeomorphic_affine_sets:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3158
  assumes "affine S" "affine T" "aff_dim S = aff_dim T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3159
    shows "S homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3160
proof (cases "S = {} \<or> T = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3161
  case True  with assms aff_dim_empty homeomorphic_empty show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3162
    by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3163
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3164
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3165
  then obtain a b where ab: "a \<in> S" "b \<in> T" by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3166
  then have ss: "subspace ((+) (- a) ` S)" "subspace ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3167
    using affine_diffs_subspace assms by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3168
  have dd: "dim ((+) (- a) ` S) = dim ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3169
    using assms ab  by (simp add: aff_dim_eq_dim  [OF hull_inc] image_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3170
  have "S homeomorphic ((+) (- a) ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3171
    by (simp add: homeomorphic_translation)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3172
  also have "\<dots> homeomorphic ((+) (- b) ` T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3173
    by (rule homeomorphic_subspaces [OF ss dd])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3174
  also have "\<dots> homeomorphic T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3175
    using homeomorphic_sym homeomorphic_translation by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3176
  finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3177
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3178
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3179
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3180
subsection\<open>Retracts, in a general sense, preserve (co)homotopic triviality)\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3181
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3182
locale%important Retracts =
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3183
  fixes s h t k
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3184
  assumes conth: "continuous_on s h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3185
      and imh: "h ` s = t"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3186
      and contk: "continuous_on t k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3187
      and imk: "k ` t \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3188
      and idhk: "\<And>y. y \<in> t \<Longrightarrow> h(k y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3189
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3190
begin
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3191
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3192
lemma homotopically_trivial_retraction_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3193
  assumes P: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3194
      and Q: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3195
      and Qeq: "\<And>h k. (\<And>x. x \<in> u \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3196
      and hom: "\<And>f g. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3197
                       continuous_on u g; g ` u \<subseteq> s; P g\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3198
                       \<Longrightarrow> homotopic_with P u s f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3199
      and contf: "continuous_on u f" and imf: "f ` u \<subseteq> t" and Qf: "Q f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3200
      and contg: "continuous_on u g" and img: "g ` u \<subseteq> t" and Qg: "Q g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3201
    shows "homotopic_with Q u t f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3202
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3203
  have feq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3204
  have geq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> g)) x = g x" using idhk img by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3205
  have "continuous_on u (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3206
    using contf continuous_on_compose continuous_on_subset contk imf by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3207
  moreover have "(k \<circ> f) ` u \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3208
    using imf imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3209
  moreover have "P (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3210
    by (simp add: P Qf contf imf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3211
  moreover have "continuous_on u (k \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3212
    using contg continuous_on_compose continuous_on_subset contk img by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3213
  moreover have "(k \<circ> g) ` u \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3214
    using img imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3215
  moreover have "P (k \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3216
    by (simp add: P Qg contg img)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3217
  ultimately have "homotopic_with P u s (k \<circ> f) (k \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3218
    by (rule hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3219
  then have "homotopic_with Q u t (h \<circ> (k \<circ> f)) (h \<circ> (k \<circ> g))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3220
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3221
    using Q by (auto simp: conth imh)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3222
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3223
    apply (rule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3224
    apply (metis feq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3225
    apply (metis geq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3226
    apply (metis Qeq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3227
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3228
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3229
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3230
lemma homotopically_trivial_retraction_null_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3231
  assumes P: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3232
      and Q: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3233
      and Qeq: "\<And>h k. (\<And>x. x \<in> u \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3234
      and hom: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3235
                     \<Longrightarrow> \<exists>c. homotopic_with P u s f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3236
      and contf: "continuous_on u f" and imf:"f ` u \<subseteq> t" and Qf: "Q f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3237
  obtains c where "homotopic_with Q u t f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3238
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3239
  have feq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3240
  have "continuous_on u (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3241
    using contf continuous_on_compose continuous_on_subset contk imf by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3242
  moreover have "(k \<circ> f) ` u \<subseteq> s"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3243
    using imf imk by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3244
  moreover have "P (k \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3245
    by (simp add: P Qf contf imf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3246
  ultimately obtain c where "homotopic_with P u s (k \<circ> f) (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3247
    by (metis hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3248
  then have "homotopic_with Q u t (h \<circ> (k \<circ> f)) (h \<circ> (\<lambda>x. c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3249
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3250
    using Q by (auto simp: conth imh)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3251
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3252
    apply (rule_tac c = "h c" in that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3253
    apply (erule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3254
    apply (metis feq, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3255
    apply (metis Qeq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3256
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3257
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3258
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3259
lemma cohomotopically_trivial_retraction_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3260
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> u; Q f\<rbrakk> \<Longrightarrow> P(f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3261
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk> \<Longrightarrow> Q(f \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3262
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3263
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3264
                       continuous_on s g; g ` s \<subseteq> u; P g\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3265
                       \<Longrightarrow> homotopic_with P s u f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3266
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> u" and Qf: "Q f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3267
      and contg: "continuous_on t g" and img: "g ` t \<subseteq> u" and Qg: "Q g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3268
    shows "homotopic_with Q t u f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3269
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3270
  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
  3271
  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
  3272
  have "continuous_on s (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3273
    using contf conth continuous_on_compose imh by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3274
  moreover have "(f \<circ> h) ` s \<subseteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3275
    using imf imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3276
  moreover have "P (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3277
    by (simp add: P Qf contf imf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3278
  moreover have "continuous_on s (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3279
    using contg continuous_on_compose continuous_on_subset conth imh by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3280
  moreover have "(g \<circ> h) ` s \<subseteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3281
    using img imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3282
  moreover have "P (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3283
    by (simp add: P Qg contg img)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3284
  ultimately have "homotopic_with P s u (f \<circ> h) (g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3285
    by (rule hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3286
  then have "homotopic_with Q t u (f \<circ> h \<circ> k) (g \<circ> h \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3287
    apply (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3288
    using Q by (auto simp: contk imk)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3289
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3290
    apply (rule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3291
    apply (metis feq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3292
    apply (metis geq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3293
    apply (metis Qeq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3294
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3295
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3296
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3297
lemma cohomotopically_trivial_retraction_null_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3298
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> u; Q f\<rbrakk> \<Longrightarrow> P(f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3299
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk> \<Longrightarrow> Q(f \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3300
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3301
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3302
                       \<Longrightarrow> \<exists>c. homotopic_with P s u f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3303
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> u" and Qf: "Q f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3304
  obtains c where "homotopic_with Q t u f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3305
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3306
  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
  3307
  have "continuous_on s (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3308
    using contf conth continuous_on_compose imh by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3309
  moreover have "(f \<circ> h) ` s \<subseteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3310
    using imf imh by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3311
  moreover have "P (f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3312
    by (simp add: P Qf contf imf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3313
  ultimately obtain c where "homotopic_with P s u (f \<circ> h) (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3314
    by (metis hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3315
  then have "homotopic_with Q t u (f \<circ> h \<circ> k) ((\<lambda>x. c) \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3316
    apply (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3317
    using Q by (auto simp: contk imk)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3318
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3319
    apply (rule_tac c = c in that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3320
    apply (erule homotopic_with_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3321
    apply (metis feq, simp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3322
    apply (metis Qeq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3323
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3324
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3325
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3326
end
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3327
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3328
lemma simply_connected_retraction_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3329
  shows "\<lbrakk>simply_connected S; continuous_on S h; h ` S = T;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3330
          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
  3331
        \<Longrightarrow> simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3332
apply (simp add: simply_connected_def path_def path_image_def homotopic_loops_def, clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3333
apply (rule Retracts.homotopically_trivial_retraction_gen
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3334
        [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
  3335
apply (simp_all add: Retracts_def pathfinish_def pathstart_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3336
done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3337
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3338
lemma homeomorphic_simply_connected:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3339
    "\<lbrakk>S homeomorphic T; simply_connected S\<rbrakk> \<Longrightarrow> simply_connected T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3340
  by (auto simp: homeomorphic_def homeomorphism_def intro: simply_connected_retraction_gen)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3341
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3342
lemma homeomorphic_simply_connected_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3343
    "S homeomorphic T \<Longrightarrow> (simply_connected S \<longleftrightarrow> simply_connected T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3344
  by (metis homeomorphic_simply_connected homeomorphic_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3345
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3346
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3347
subsection\<open>Homotopy equivalence\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3348
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3349
definition%important homotopy_eqv :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3350
             (infix "homotopy'_eqv" 50)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3351
  where "S homotopy_eqv T \<equiv>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3352
        \<exists>f g. continuous_on S f \<and> f ` S \<subseteq> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3353
              continuous_on T g \<and> g ` T \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3354
              homotopic_with (\<lambda>x. True) S S (g \<circ> f) id \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3355
              homotopic_with (\<lambda>x. True) T T (f \<circ> g) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3356
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3357
lemma homeomorphic_imp_homotopy_eqv: "S homeomorphic T \<Longrightarrow> S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3358
  unfolding homeomorphic_def homotopy_eqv_def homeomorphism_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3359
  by (fastforce intro!: homotopic_with_equal continuous_on_compose)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3360
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3361
lemma homotopy_eqv_refl: "S homotopy_eqv S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3362
  by (rule homeomorphic_imp_homotopy_eqv homeomorphic_refl)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3363
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3364
lemma homotopy_eqv_sym: "S homotopy_eqv T \<longleftrightarrow> T homotopy_eqv S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3365
  by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3366
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3367
lemma homotopy_eqv_trans [trans]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3368
    fixes S :: "'a::real_normed_vector set" and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3369
  assumes ST: "S homotopy_eqv T" and TU: "T homotopy_eqv U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3370
    shows "S homotopy_eqv U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3371
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3372
  obtain f1 g1 where f1: "continuous_on S f1" "f1 ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3373
                 and g1: "continuous_on T g1" "g1 ` T \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3374
                 and hom1: "homotopic_with (\<lambda>x. True) S S (g1 \<circ> f1) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3375
                           "homotopic_with (\<lambda>x. True) T T (f1 \<circ> g1) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3376
    using ST by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3377
  obtain f2 g2 where f2: "continuous_on T f2" "f2 ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3378
                 and g2: "continuous_on U g2" "g2 ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3379
                 and hom2: "homotopic_with (\<lambda>x. True) T T (g2 \<circ> f2) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3380
                           "homotopic_with (\<lambda>x. True) U U (f2 \<circ> g2) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3381
    using TU by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3382
  have "homotopic_with (\<lambda>f. True) S T (g2 \<circ> f2 \<circ> f1) (id \<circ> f1)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3383
    by (rule homotopic_with_compose_continuous_right hom2 f1)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3384
  then have "homotopic_with (\<lambda>f. True) S T (g2 \<circ> (f2 \<circ> f1)) (id \<circ> f1)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3385
    by (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3386
  then have "homotopic_with (\<lambda>x. True) S S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3387
         (g1 \<circ> (g2 \<circ> (f2 \<circ> f1))) (g1 \<circ> (id \<circ> f1))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3388
    by (simp add: g1 homotopic_with_compose_continuous_left)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3389
  moreover have "homotopic_with (\<lambda>x. True) S S (g1 \<circ> id \<circ> f1) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3390
    using hom1 by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3391
  ultimately have SS: "homotopic_with (\<lambda>x. True) S S (g1 \<circ> g2 \<circ> (f2 \<circ> f1)) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3392
    apply (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3393
    apply (blast intro: homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3394
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3395
  have "homotopic_with (\<lambda>f. True) U T (f1 \<circ> g1 \<circ> g2) (id \<circ> g2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3396
    by (rule homotopic_with_compose_continuous_right hom1 g2)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3397
  then have "homotopic_with (\<lambda>f. True) U T (f1 \<circ> (g1 \<circ> g2)) (id \<circ> g2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3398
    by (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3399
  then have "homotopic_with (\<lambda>x. True) U U
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3400
         (f2 \<circ> (f1 \<circ> (g1 \<circ> g2))) (f2 \<circ> (id \<circ> g2))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3401
    by (simp add: f2 homotopic_with_compose_continuous_left)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3402
  moreover have "homotopic_with (\<lambda>x. True) U U (f2 \<circ> id \<circ> g2) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3403
    using hom2 by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3404
  ultimately have UU: "homotopic_with (\<lambda>x. True) U U (f2 \<circ> f1 \<circ> (g1 \<circ> g2)) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3405
    apply (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3406
    apply (blast intro: homotopic_with_trans)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3407
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3408
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3409
    unfolding homotopy_eqv_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3410
    apply (rule_tac x = "f2 \<circ> f1" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3411
    apply (rule_tac x = "g1 \<circ> g2" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3412
    apply (intro conjI continuous_on_compose SS UU)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3413
    using f1 f2 g1 g2  apply (force simp: elim!: continuous_on_subset)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3414
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3415
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3416
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3417
lemma homotopy_eqv_inj_linear_image:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3418
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3419
  assumes "linear f" "inj f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3420
    shows "(f ` S) homotopy_eqv S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3421
apply (rule homeomorphic_imp_homotopy_eqv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3422
using assms homeomorphic_sym linear_homeomorphic_image by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3423
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3424
lemma homotopy_eqv_translation:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3425
    fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3426
    shows "(+) a ` S homotopy_eqv S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3427
  apply (rule homeomorphic_imp_homotopy_eqv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3428
  using homeomorphic_translation homeomorphic_sym by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3429
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3430
lemma homotopy_eqv_homotopic_triviality_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3431
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3432
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3433
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3434
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3435
      and f: "continuous_on U f" "f ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3436
      and g: "continuous_on U g" "g ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3437
      and homUS: "\<And>f g. \<lbrakk>continuous_on U f; f ` U \<subseteq> S;
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3438
                         continuous_on U g; g ` U \<subseteq> S\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3439
                         \<Longrightarrow> homotopic_with (\<lambda>x. True) U S f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3440
    shows "homotopic_with (\<lambda>x. True) U T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3441
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3442
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3443
               and k: "continuous_on T k" "k ` T \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3444
               and hom: "homotopic_with (\<lambda>x. True) S S (k \<circ> h) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3445
                        "homotopic_with (\<lambda>x. True) T T (h \<circ> k) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3446
    using assms by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3447
  have "homotopic_with (\<lambda>f. True) U S (k \<circ> f) (k \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3448
    apply (rule homUS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3449
    using f g k
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3450
    apply (safe intro!: continuous_on_compose h k f elim!: continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3451
    apply (force simp: o_def)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3452
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3453
  then have "homotopic_with (\<lambda>x. True) U T (h \<circ> (k \<circ> f)) (h \<circ> (k \<circ> g))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3454
    apply (rule homotopic_with_compose_continuous_left)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3455
    apply (simp_all add: h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3456
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3457
  moreover have "homotopic_with (\<lambda>x. True) U T (h \<circ> k \<circ> f) (id \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3458
    apply (rule homotopic_with_compose_continuous_right [where X=T and Y=T])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3459
    apply (auto simp: hom f)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3460
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3461
  moreover have "homotopic_with (\<lambda>x. True) U T (h \<circ> k \<circ> g) (id \<circ> g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3462
    apply (rule homotopic_with_compose_continuous_right [where X=T and Y=T])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3463
    apply (auto simp: hom g)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3464
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3465
  ultimately show "homotopic_with (\<lambda>x. True) U T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3466
    apply (simp add: o_assoc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3467
    using homotopic_with_trans homotopic_with_sym by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3468
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3469
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3470
lemma homotopy_eqv_homotopic_triviality:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3471
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3472
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3473
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3474
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3475
    shows "(\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3476
                   continuous_on U g \<and> g ` U \<subseteq> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3477
                   \<longrightarrow> homotopic_with (\<lambda>x. True) U S f g) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3478
           (\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> T \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3479
                  continuous_on U g \<and> g ` U \<subseteq> T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3480
                  \<longrightarrow> homotopic_with (\<lambda>x. True) U T f g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3481
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3482
apply (metis assms homotopy_eqv_homotopic_triviality_imp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3483
by (metis (no_types) assms homotopy_eqv_homotopic_triviality_imp homotopy_eqv_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3484
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3485
lemma homotopy_eqv_cohomotopic_triviality_null_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3486
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3487
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3488
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3489
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3490
      and f: "continuous_on T f" "f ` T \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3491
      and homSU: "\<And>f. \<lbrakk>continuous_on S f; f ` S \<subseteq> U\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3492
                      \<Longrightarrow> \<exists>c. homotopic_with (\<lambda>x. True) S U f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3493
  obtains c where "homotopic_with (\<lambda>x. True) T U f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3494
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3495
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3496
               and k: "continuous_on T k" "k ` T \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3497
               and hom: "homotopic_with (\<lambda>x. True) S S (k \<circ> h) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3498
                        "homotopic_with (\<lambda>x. True) T T (h \<circ> k) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3499
    using assms by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3500
  obtain c where "homotopic_with (\<lambda>x. True) S U (f \<circ> h) (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3501
    apply (rule exE [OF homSU [of "f \<circ> h"]])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3502
    apply (intro continuous_on_compose h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3503
    using h f  apply (force elim!: continuous_on_subset)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3504
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3505
  then have "homotopic_with (\<lambda>x. True) T U ((f \<circ> h) \<circ> k) ((\<lambda>x. c) \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3506
    apply (rule homotopic_with_compose_continuous_right [where X=S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3507
    using k by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3508
  moreover have "homotopic_with (\<lambda>x. True) T U (f \<circ> id) (f \<circ> (h \<circ> k))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3509
    apply (rule homotopic_with_compose_continuous_left [where Y=T])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3510
      apply (simp add: hom homotopic_with_symD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3511
     using f apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3512
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3513
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3514
    apply (rule_tac c=c in that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3515
    apply (simp add: o_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3516
    using homotopic_with_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3517
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3518
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3519
lemma homotopy_eqv_cohomotopic_triviality_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3520
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3521
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3522
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3523
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3524
    shows "(\<forall>f. continuous_on S f \<and> f ` S \<subseteq> U
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3525
                \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) S U f (\<lambda>x. c))) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3526
           (\<forall>f. continuous_on T f \<and> f ` T \<subseteq> U
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3527
                \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) T U f (\<lambda>x. c)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3528
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3529
apply (metis assms homotopy_eqv_cohomotopic_triviality_null_imp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3530
by (metis assms homotopy_eqv_cohomotopic_triviality_null_imp homotopy_eqv_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3531
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3532
lemma homotopy_eqv_homotopic_triviality_null_imp:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3533
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3534
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3535
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3536
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3537
      and f: "continuous_on U f" "f ` U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3538
      and homSU: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> S\<rbrakk>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3539
                      \<Longrightarrow> \<exists>c. homotopic_with (\<lambda>x. True) U S f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3540
    shows "\<exists>c. homotopic_with (\<lambda>x. True) U T f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3541
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3542
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3543
               and k: "continuous_on T k" "k ` T \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3544
               and hom: "homotopic_with (\<lambda>x. True) S S (k \<circ> h) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3545
                        "homotopic_with (\<lambda>x. True) T T (h \<circ> k) id"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3546
    using assms by (auto simp: homotopy_eqv_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3547
  obtain c::'a where "homotopic_with (\<lambda>x. True) U S (k \<circ> f) (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3548
    apply (rule exE [OF homSU [of "k \<circ> f"]])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3549
    apply (intro continuous_on_compose h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3550
    using k f  apply (force elim!: continuous_on_subset)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3551
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3552
  then have "homotopic_with (\<lambda>x. True) U T (h \<circ> (k \<circ> f)) (h \<circ> (\<lambda>x. c))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3553
    apply (rule homotopic_with_compose_continuous_left [where Y=S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3554
    using h by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3555
  moreover have "homotopic_with (\<lambda>x. True) U T (id \<circ> f) ((h \<circ> k) \<circ> f)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3556
    apply (rule homotopic_with_compose_continuous_right [where X=T])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3557
      apply (simp add: hom homotopic_with_symD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3558
     using f apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3559
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3560
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3561
    using homotopic_with_trans by (fastforce simp add: o_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3562
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3563
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3564
lemma homotopy_eqv_homotopic_triviality_null:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3565
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3566
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3567
    and U :: "'c::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3568
  assumes "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3569
    shows "(\<forall>f. continuous_on U f \<and> f ` U \<subseteq> S
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3570
                  \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) U S f (\<lambda>x. c))) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3571
           (\<forall>f. continuous_on U f \<and> f ` U \<subseteq> T
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3572
                  \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) U T f (\<lambda>x. c)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3573
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3574
apply (metis assms homotopy_eqv_homotopic_triviality_null_imp)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3575
by (metis assms homotopy_eqv_homotopic_triviality_null_imp homotopy_eqv_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3576
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3577
lemma homotopy_eqv_contractible_sets:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3578
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3579
    and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3580
  assumes "contractible S" "contractible T" "S = {} \<longleftrightarrow> T = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3581
    shows "S homotopy_eqv T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3582
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3583
  case True with assms show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3584
    by (simp add: homeomorphic_imp_homotopy_eqv)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3585
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3586
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3587
  with assms obtain a b where "a \<in> S" "b \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3588
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3589
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3590
    unfolding homotopy_eqv_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3591
    apply (rule_tac x="\<lambda>x. b" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3592
    apply (rule_tac x="\<lambda>x. a" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3593
    apply (intro assms conjI continuous_on_id' homotopic_into_contractible)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3594
    apply (auto simp: o_def continuous_on_const)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3595
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3596
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3597
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3598
lemma homotopy_eqv_empty1 [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3599
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3600
  shows "S homotopy_eqv ({}::'b::real_normed_vector set) \<longleftrightarrow> S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3601
apply (rule iffI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3602
using homotopy_eqv_def apply fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3603
by (simp add: homotopy_eqv_contractible_sets)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3604
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3605
lemma homotopy_eqv_empty2 [simp]:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3606
  fixes S :: "'a::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3607
  shows "({}::'b::real_normed_vector set) homotopy_eqv S \<longleftrightarrow> S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3608
by (metis homotopy_eqv_empty1 homotopy_eqv_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3609
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3610
lemma homotopy_eqv_contractibility:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3611
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3612
  shows "S homotopy_eqv T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3613
unfolding homotopy_eqv_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3614
by (blast intro: homotopy_dominated_contractibility)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3615
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3616
lemma homotopy_eqv_sing:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3617
  fixes S :: "'a::real_normed_vector set" and a :: "'b::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3618
  shows "S homotopy_eqv {a} \<longleftrightarrow> S \<noteq> {} \<and> contractible S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3619
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3620
  case True then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3621
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3622
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3623
  case False then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3624
    by (metis contractible_sing empty_not_insert homotopy_eqv_contractibility homotopy_eqv_contractible_sets)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3625
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3626
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3627
lemma homeomorphic_contractible_eq:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3628
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3629
  shows "S homeomorphic T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3630
by (simp add: homeomorphic_imp_homotopy_eqv homotopy_eqv_contractibility)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3631
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3632
lemma homeomorphic_contractible:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3633
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3634
  shows "\<lbrakk>contractible S; S homeomorphic T\<rbrakk> \<Longrightarrow> contractible T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3635
  by (metis homeomorphic_contractible_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3636
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3637
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3638
subsection%unimportant\<open>Misc other results\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3639
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3640
lemma bounded_connected_Compl_real:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3641
  fixes S :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3642
  assumes "bounded S" and conn: "connected(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3643
    shows "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3644
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3645
  obtain a b where "S \<subseteq> box a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3646
    by (meson assms bounded_subset_box_symmetric)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3647
  then have "a \<notin> S" "b \<notin> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3648
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3649
  then have "\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> - S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3650
    by (meson Compl_iff conn connected_iff_interval)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3651
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3652
    using \<open>S \<subseteq> box a b\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3653
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3654
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3655
lemma bounded_connected_Compl_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3656
  fixes S :: "'a::{euclidean_space} set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3657
  assumes "bounded S" and conn: "connected(- S)" and 1: "DIM('a) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3658
    shows "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3659
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3660
  have "DIM('a) = DIM(real)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3661
    by (simp add: "1")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3662
  then obtain f::"'a \<Rightarrow> real" and g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3663
  where "linear f" "\<And>x. norm(f x) = norm x" "\<And>x. g(f x) = x" "\<And>y. f(g y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3664
    by (rule isomorphisms_UNIV_UNIV) blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3665
  with \<open>bounded S\<close> have "bounded (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3666
    using bounded_linear_image linear_linear by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3667
  have "connected (f ` (-S))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3668
    using connected_linear_image assms \<open>linear f\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3669
  moreover have "f ` (-S) = - (f ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3670
    apply (rule bij_image_Compl_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3671
    apply (auto simp: bij_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3672
     apply (metis \<open>\<And>x. g (f x) = x\<close> injI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3673
    by (metis UNIV_I \<open>\<And>y. f (g y) = y\<close> image_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3674
  finally have "connected (- (f ` S))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3675
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3676
  then have "f ` S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3677
    using \<open>bounded (f ` S)\<close> bounded_connected_Compl_real by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3678
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3679
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3680
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3681
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3682
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3683
subsection%unimportant\<open>Some Uncountable Sets\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3684
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3685
lemma uncountable_closed_segment:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3686
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3687
  assumes "a \<noteq> b" shows "uncountable (closed_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3688
unfolding path_image_linepath [symmetric] path_image_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3689
  using inj_on_linepath [OF assms] uncountable_closed_interval [of 0 1]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3690
        countable_image_inj_on by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3691
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3692
lemma uncountable_open_segment:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3693
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3694
  assumes "a \<noteq> b" shows "uncountable (open_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3695
  by (simp add: assms open_segment_def uncountable_closed_segment uncountable_minus_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3696
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3697
lemma uncountable_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3698
  fixes a :: "'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3699
  assumes "convex S" "a \<in> S" "b \<in> S" "a \<noteq> b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3700
    shows "uncountable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3701
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3702
  have "uncountable (closed_segment a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3703
    by (simp add: uncountable_closed_segment assms)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3704
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3705
    by (meson assms convex_contains_segment countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3706
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3707
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3708
lemma uncountable_ball:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3709
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3710
  assumes "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3711
    shows "uncountable (ball a r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3712
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3713
  have "uncountable (open_segment a (a + r *\<^sub>R (SOME i. i \<in> Basis)))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3714
    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
  3715
  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
  3716
    using assms by (auto simp: in_segment algebra_simps dist_norm SOME_Basis)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3717
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3718
    by (metis countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3719
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3720
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3721
lemma ball_minus_countable_nonempty:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3722
  assumes "countable (A :: 'a :: euclidean_space set)" "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3723
  shows   "ball z r - A \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3724
proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3725
  assume *: "ball z r - A = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3726
  have "uncountable (ball z r - A)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3727
    by (intro uncountable_minus_countable assms uncountable_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3728
  thus False by (subst (asm) *) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3729
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3730
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3731
lemma uncountable_cball:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3732
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3733
  assumes "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3734
  shows "uncountable (cball a r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3735
  using assms countable_subset uncountable_ball by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3736
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3737
lemma pairwise_disjnt_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3738
  fixes \<N> :: "nat set set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3739
  assumes "pairwise disjnt \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3740
    shows "countable \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3741
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3742
  have "inj_on (\<lambda>X. SOME n. n \<in> X) (\<N> - {{}})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3743
    apply (clarsimp simp add: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3744
    by (metis assms disjnt_insert2 insert_absorb pairwise_def subsetI subset_empty tfl_some)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3745
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3746
    by (metis countable_Diff_eq countable_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3747
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3748
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3749
lemma pairwise_disjnt_countable_Union:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3750
    assumes "countable (\<Union>\<N>)" and pwd: "pairwise disjnt \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3751
    shows "countable \<N>"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3752
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3753
  obtain f :: "_ \<Rightarrow> nat" where f: "inj_on f (\<Union>\<N>)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3754
    using assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3755
  then have "pairwise disjnt (\<Union> X \<in> \<N>. {f ` X})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3756
    using assms by (force simp: pairwise_def disjnt_inj_on_iff [OF f])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3757
  then have "countable (\<Union> X \<in> \<N>. {f ` X})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3758
    using pairwise_disjnt_countable by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3759
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3760
    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
  3761
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3762
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3763
lemma connected_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3764
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3765
  assumes "connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3766
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3767
  have "continuous_on S (dist a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3768
    by (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3769
  then have "connected (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3770
    by (metis connected_continuous_image \<open>connected S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3771
  then have "closed_segment 0 (dist a b) \<subseteq> (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3772
    by (simp add: assms closed_segment_subset is_interval_connected_1 is_interval_convex)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3773
  then have "uncountable (dist a ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3774
    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
  3775
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3776
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3777
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3778
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3779
lemma path_connected_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3780
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3781
  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
  3782
  using path_connected_imp_connected assms connected_uncountable by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3783
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3784
lemma connected_finite_iff_sing:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3785
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3786
  assumes "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3787
  shows "finite S \<longleftrightarrow> S = {} \<or> (\<exists>a. S = {a})"  (is "_ = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3788
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3789
  have "uncountable S" if "\<not> ?rhs"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3790
    using connected_uncountable assms that by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3791
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3792
    using uncountable_infinite by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3793
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3794
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3795
lemma connected_card_eq_iff_nontrivial:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3796
  fixes S :: "'a::metric_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3797
  shows "connected S \<Longrightarrow> uncountable S \<longleftrightarrow> \<not>(\<exists>a. S \<subseteq> {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3798
  apply (auto simp: countable_finite finite_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3799
  by (metis connected_uncountable is_singletonI' is_singleton_the_elem subset_singleton_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3800
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3801
lemma simple_path_image_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3802
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3803
  assumes "simple_path g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3804
  shows "uncountable (path_image g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3805
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3806
  have "g 0 \<in> path_image g" "g (1/2) \<in> path_image g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3807
    by (simp_all add: path_defs)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3808
  moreover have "g 0 \<noteq> g (1/2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3809
    using assms by (fastforce simp add: simple_path_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3810
  ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3811
    apply (simp add: assms connected_card_eq_iff_nontrivial connected_simple_path_image)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3812
    by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3813
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3814
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3815
lemma arc_image_uncountable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3816
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3817
  assumes "arc g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3818
  shows "uncountable (path_image g)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3819
  by (simp add: arc_imp_simple_path assms simple_path_image_uncountable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3820
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3821
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3822
subsection%unimportant\<open> Some simple positive connection theorems\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3823
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3824
proposition path_connected_convex_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3825
  fixes U :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3826
  assumes "convex U" "\<not> collinear U" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3827
    shows "path_connected(U - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3828
proof (clarsimp simp add: path_connected_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3829
  fix a b
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3830
  assume "a \<in> U" "a \<notin> S" "b \<in> U" "b \<notin> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3831
  let ?m = "midpoint a b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3832
  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
  3833
  proof (cases "a = b")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3834
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3835
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3836
      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
  3837
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3838
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3839
    then have "a \<noteq> ?m" "b \<noteq> ?m"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3840
      using midpoint_eq_endpoint by fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3841
    have "?m \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3842
      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
  3843
    obtain c where "c \<in> U" and nc_abc: "\<not> collinear {a,b,c}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3844
      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
  3845
    have ncoll_mca: "\<not> collinear {?m,c,a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3846
      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
  3847
    have ncoll_mcb: "\<not> collinear {?m,c,b}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3848
      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
  3849
    have "c \<noteq> ?m"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3850
      by (metis collinear_midpoint insert_commute nc_abc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3851
    then have "closed_segment ?m c \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3852
      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
  3853
    then obtain z where z: "z \<in> closed_segment ?m c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3854
                    and disjS: "(closed_segment a z \<union> closed_segment z b) \<inter> S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3855
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3856
      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
  3857
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3858
        have closb: "closed_segment ?m c \<subseteq>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3859
                 {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
  3860
          using that by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3861
        have *: "countable {z \<in> closed_segment ?m c. closed_segment z u \<inter> S \<noteq> {}}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3862
          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
  3863
        proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3864
          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
  3865
                            and "x1 \<noteq> x2" "x1 \<noteq> u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3866
                            and w: "w \<in> closed_segment x1 u" "w \<in> closed_segment x2 u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3867
                            and "w \<in> S" for x1 x2 w
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3868
          proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3869
            have "x1 \<in> affine hull {?m,c}" "x2 \<in> affine hull {?m,c}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3870
              using segment_as_ball x1 x2 by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3871
            then have coll_x1: "collinear {x1, ?m, c}" and coll_x2: "collinear {?m, c, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3872
              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
  3873
            have "\<not> collinear {x1, u, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3874
            proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3875
              assume "collinear {x1, u, x2}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3876
              then have "collinear {?m, c, u}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3877
                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
  3878
              with ncoll show False ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3879
            qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3880
            then have "closed_segment x1 u \<inter> closed_segment u x2 = {u}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3881
              by (blast intro!: Int_closed_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3882
            then have "w = u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3883
              using closed_segment_commute w by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3884
            show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3885
              using \<open>u \<notin> S\<close> \<open>w = u\<close> that(7) by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3886
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3887
          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
  3888
            by (fastforce simp: pairwise_def disjnt_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3889
          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
  3890
            apply (rule pairwise_disjnt_countable_Union [OF _ pairwise_subset [OF disj]])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3891
             apply (rule countable_subset [OF _ \<open>countable S\<close>], auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3892
            done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3893
          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
  3894
          show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3895
          proof (rule countable_subset [OF _ countable_image [OF cou, where f=f]], clarify)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3896
            fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3897
            assume x: "x \<in> closed_segment ?m c" "closed_segment x u \<inter> S \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3898
            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
  3899
            proof (rule_tac x="closed_segment x u \<inter> S" in image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3900
              show "x = f (closed_segment x u \<inter> S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3901
                unfolding f_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3902
                apply (rule the_equality [symmetric])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3903
                using x  apply (auto simp: dest: **)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3904
                done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3905
            qed (use x in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3906
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3907
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3908
        have "uncountable (closed_segment ?m c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3909
          by (metis \<open>c \<noteq> ?m\<close> uncountable_closed_segment)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3910
        then show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3911
          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
  3912
          apply (simp add: closed_segment_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3913
          by (simp add: countable_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3914
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3915
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3916
        by (force intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3917
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3918
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3919
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3920
      have "path_image (linepath a z +++ linepath z b) \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3921
        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
  3922
      with disjS show "path_image (linepath a z +++ linepath z b) \<subseteq> U - S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3923
        by (force simp: path_image_join)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3924
    qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3925
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3926
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3927
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3928
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3929
corollary connected_convex_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3930
  fixes U :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3931
  assumes "convex U" "\<not> collinear U" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3932
  shows "connected(U - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3933
  by (simp add: assms path_connected_convex_diff_countable path_connected_imp_connected)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3934
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3935
lemma path_connected_punctured_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3936
  assumes "convex S" and aff: "aff_dim S \<noteq> 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3937
    shows "path_connected(S - {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3938
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3939
  consider "aff_dim S = -1" | "aff_dim S = 0" | "aff_dim S \<ge> 2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3940
    using assms aff_dim_geq [of S] by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3941
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3942
  proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3943
    assume "aff_dim S = -1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3944
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3945
      by (metis aff_dim_empty empty_Diff path_connected_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3946
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3947
    assume "aff_dim S = 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3948
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3949
      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
  3950
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3951
    assume ge2: "aff_dim S \<ge> 2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3952
    then have "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3953
    proof (clarsimp simp add: collinear_affine_hull)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3954
      fix u v
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3955
      assume "S \<subseteq> affine hull {u, v}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3956
      then have "aff_dim S \<le> aff_dim {u, v}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3957
        by (metis (no_types) aff_dim_affine_hull aff_dim_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3958
      with ge2 show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3959
        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
  3960
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3961
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3962
      apply (rule path_connected_convex_diff_countable [OF \<open>convex S\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3963
      by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3964
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3965
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3966
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3967
lemma connected_punctured_convex:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3968
  shows "\<lbrakk>convex S; aff_dim S \<noteq> 1\<rbrakk> \<Longrightarrow> connected(S - {a})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3969
  using path_connected_imp_connected path_connected_punctured_convex by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3970
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3971
lemma path_connected_complement_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3972
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3973
  assumes "2 \<le> DIM('a)" "countable S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3974
  shows "path_connected(- S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3975
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3976
  have "path_connected(UNIV - S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3977
    apply (rule path_connected_convex_diff_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3978
    using assms by (auto simp: collinear_aff_dim [of "UNIV :: 'a set"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3979
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3980
    by (simp add: Compl_eq_Diff_UNIV)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3981
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3982
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3983
proposition path_connected_openin_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3984
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3985
  assumes "connected S" and ope: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3986
      and "\<not> collinear S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3987
    shows "path_connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3988
proof (clarsimp simp add: path_connected_component)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3989
  fix x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3990
  assume xy: "x \<in> S" "x \<notin> T" "y \<in> S" "y \<notin> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3991
  show "path_component (S - T) x y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3992
  proof (rule connected_equivalence_relation_gen [OF \<open>connected S\<close>, where P = "\<lambda>x. x \<notin> T"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3993
    show "\<exists>z. z \<in> U \<and> z \<notin> T" if opeU: "openin (subtopology euclidean S) U" and "x \<in> U" for U x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3994
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3995
      have "openin (subtopology euclidean (affine hull S)) U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3996
        using opeU ope openin_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3997
      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
  3998
                              and subU: "ball x r \<inter> affine hull S \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  3999
        by (auto simp: openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4000
      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
  4001
        by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4002
      have "\<not> S \<subseteq> {x}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4003
        using \<open>\<not> collinear S\<close>  collinear_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4004
      then obtain x' where "x' \<noteq> x" "x' \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4005
        by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4006
      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
  4007
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4008
        show "x + (r / 2 / norm(x' - x)) *\<^sub>R (x' - x) \<noteq> x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4009
          using \<open>x' \<noteq> x\<close> \<open>r > 0\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4010
        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
  4011
          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
  4012
          by (simp add: dist_norm mem_affine_3_minus hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4013
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4014
      have "convex (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4015
        by (simp add: affine_imp_convex convex_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4016
      with x y subU have "uncountable U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4017
        by (meson countable_subset uncountable_convex)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4018
      then have "\<not> U \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4019
        using \<open>countable T\<close> countable_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4020
      then show ?thesis by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4021
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4022
    show "\<exists>U. openin (subtopology euclidean S) U \<and> x \<in> U \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4023
              (\<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
  4024
          if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4025
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4026
      obtain r where Ssub: "S \<subseteq> affine hull S" and "r > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4027
                 and subS: "ball x r \<inter> affine hull S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4028
        using ope \<open>x \<in> S\<close> by (auto simp: openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4029
      then have conv: "convex (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4030
        by (simp add: affine_imp_convex convex_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4031
      have "\<not> aff_dim (affine hull S) \<le> 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4032
        using \<open>\<not> collinear S\<close> collinear_aff_dim by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4033
      then have "\<not> collinear (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4034
        apply (simp add: collinear_aff_dim)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4035
        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
  4036
      then have *: "path_connected ((ball x r \<inter> affine hull S) - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4037
        by (rule path_connected_convex_diff_countable [OF conv _ \<open>countable T\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4038
      have ST: "ball x r \<inter> affine hull S - T \<subseteq> S - T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4039
        using subS by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4040
      show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4041
      proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4042
        show "x \<in> ball x r \<inter> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4043
          using \<open>x \<in> S\<close> \<open>r > 0\<close> by (simp add: hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4044
        have "openin (subtopology euclidean (affine hull S)) (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4045
          by (subst inf.commute) (simp add: openin_Int_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4046
        then show "openin (subtopology euclidean S) (ball x r \<inter> affine hull S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4047
          by (rule openin_subset_trans [OF _ subS Ssub])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4048
      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
  4049
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4050
  qed (use xy path_component_trans in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4051
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4052
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4053
corollary connected_openin_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4054
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4055
  assumes "connected S" and ope: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4056
      and "\<not> collinear S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4057
    shows "connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4058
  by (metis path_connected_imp_connected path_connected_openin_diff_countable [OF assms])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4059
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4060
corollary path_connected_open_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4061
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4062
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4063
  shows "path_connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4064
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4065
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4066
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4067
    by (simp add: path_connected_empty)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4068
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4069
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4070
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4071
  proof (rule path_connected_openin_diff_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4072
    show "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4073
      by (simp add: assms hull_subset open_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4074
    show "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4075
      using assms False by (simp add: collinear_aff_dim aff_dim_open)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4076
  qed (simp_all add: assms)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4077
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4078
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4079
corollary connected_open_diff_countable:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4080
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4081
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4082
  shows "connected(S - T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4083
by (simp add: assms path_connected_imp_connected path_connected_open_diff_countable)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4084
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4085
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4086
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4087
subsection%unimportant \<open>Self-homeomorphisms shuffling points about\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4088
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4089
subsubsection%unimportant\<open>The theorem \<open>homeomorphism_moving_points_exists\<close>\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4090
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4091
lemma homeomorphism_moving_point_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4092
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4093
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4094
  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
  4095
                    "f a = u" "\<And>x. x \<in> sphere a r \<Longrightarrow> f x = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4096
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4097
  have nou: "norm (u - a) < r" and "u \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4098
    using u by (auto simp: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4099
  then have "0 < r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4100
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4101
  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
  4102
  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
  4103
                  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
  4104
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4105
    have "x = y + (norm x / r - (norm y / r)) *\<^sub>R u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4106
      using eq by (simp add: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4107
    then have "norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4108
      by (metis diff_divide_distrib)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4109
    also have "\<dots> \<le> norm y + norm(((norm x - norm y) / r) *\<^sub>R u)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4110
      using norm_triangle_ineq by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4111
    also have "\<dots> = norm y + (norm x - norm y) * (norm u / r)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4112
      using yx \<open>r > 0\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4113
      by (simp add: divide_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4114
    also have "\<dots> < norm y + (norm x - norm y) * 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4115
      apply (subst add_less_cancel_left)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4116
      apply (rule mult_strict_left_mono)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4117
      using nou \<open>0 < r\<close> yx
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4118
       apply (simp_all add: field_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4119
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4120
    also have "\<dots> = norm x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4121
      by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4122
    finally show False by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4123
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4124
  have "inj f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4125
    unfolding f_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4126
  proof (clarsimp simp: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4127
    fix x y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4128
    assume "(1 - norm (x - a) / r) *\<^sub>R (u - a) + x =
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4129
            (1 - norm (y - a) / r) *\<^sub>R (u - a) + y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4130
    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
  4131
      by (auto simp: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4132
    show "x=y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4133
    proof (cases "norm (x - a) = norm (y - a)")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4134
      case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4135
      then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4136
        using eq by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4137
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4138
      case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4139
      then consider "norm (x - a) < norm (y - a)" | "norm (x - a) > norm (y - a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4140
        by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4141
      then have "False"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4142
      proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4143
        case 1 show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4144
          using * [OF _ nou 1] eq by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4145
      next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4146
        case 2 with * [OF eq nou] show False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4147
          by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4148
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4149
      then show "x=y" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4150
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4151
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4152
  then have inj_onf: "inj_on f (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4153
    using inj_on_Int by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4154
  have contf: "continuous_on (cball a r \<inter> T) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4155
    unfolding f_def using \<open>0 < r\<close>  by (intro continuous_intros) blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4156
  have fim: "f ` (cball a r \<inter> T) = cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4157
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4158
    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
  4159
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4160
      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
  4161
        using norm_triangle_ineq by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4162
      also have "\<dots> = norm y + abs(1 - norm y / r) * norm u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4163
        by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4164
      also have "\<dots> \<le> r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4165
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4166
        have "(r - norm u) * (r - norm y) \<ge> 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4167
          using that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4168
        then have "r * norm u + r * norm y \<le> r * r + norm u * norm y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4169
          by (simp add: algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4170
        then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4171
        using that \<open>0 < r\<close> by (simp add: abs_if field_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4172
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4173
      finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4174
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4175
    have "f ` (cball a r) \<subseteq> cball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4176
      apply (clarsimp simp add: dist_norm norm_minus_commute f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4177
      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
  4178
    moreover have "f ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4179
      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
  4180
      by (force simp: add.commute mem_affine_3_minus)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4181
    ultimately show "f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4182
      by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4183
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4184
    show "cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4185
    proof (clarsimp simp add: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4186
      fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4187
      assume x: "norm (x - a) \<le> r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4188
      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
  4189
        by (rule ivt_decreasing_component_on_1) (auto simp: x continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4190
      then obtain v where "0\<le>v" "v\<le>1" and v: "(1 - v) * r = norm ((x - a) - v *\<^sub>R (u - a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4191
        by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4192
      show "x \<in> f ` (cball a r \<inter> T)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4193
      proof (rule image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4194
        show "x = f (x - v *\<^sub>R (u - a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4195
          using \<open>r > 0\<close> v by (simp add: f_def field_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4196
        have "x - v *\<^sub>R (u - a) \<in> cball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4197
          using \<open>r > 0\<close> v \<open>0 \<le> v\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4198
          apply (simp add: field_simps dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4199
          by (metis le_add_same_cancel2 order.order_iff_strict zero_le_mult_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4200
        moreover have "x - v *\<^sub>R (u - a) \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4201
          by (simp add: f_def \<open>affine T\<close> \<open>u \<in> T\<close> \<open>x \<in> T\<close> assms mem_affine_3_minus2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4202
        ultimately show "x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4203
          by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4204
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4205
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4206
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4207
  have "\<exists>g. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4208
    apply (rule homeomorphism_compact [OF _ contf fim inj_onf])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4209
    apply (simp add: affine_closed compact_Int_closed \<open>affine T\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4210
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4211
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4212
    apply (rule exE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4213
    apply (erule_tac f=f in that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4214
    using \<open>r > 0\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4215
     apply (simp_all add: f_def dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4216
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4217
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4218
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4219
corollary%unimportant homeomorphism_moving_point_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4220
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4221
  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
  4222
  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
  4223
                    "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
  4224
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4225
  have "0 < r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4226
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4227
  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
  4228
                 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
  4229
    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
  4230
  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
  4231
                 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
  4232
    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
  4233
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4234
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4235
    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
  4236
      by (metis homeomorphism_compose homeomorphism_symD hom1 hom2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4237
    have "g1 u = a"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4238
      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
  4239
    then show "(f2 \<circ> g1) u = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4240
      by (simp add: \<open>f2 a = v\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4241
    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
  4242
      using f1 f2 hom1 homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4243
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4244
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4245
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4246
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4247
corollary%unimportant homeomorphism_moving_point_3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4248
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4249
  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
  4250
      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
  4251
  obtains f g where "homeomorphism S S f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4252
                    "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
  4253
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4254
  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
  4255
               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
  4256
    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
  4257
  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
  4258
    using fid hom homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4259
  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
  4260
  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
  4261
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4262
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4263
    show "homeomorphism S S ff gg"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4264
    proof (rule homeomorphismI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4265
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) ff"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4266
        apply (simp add: ff_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4267
        apply (rule continuous_on_cases)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4268
        using homeomorphism_cont1 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4269
            apply (auto simp: affine_closed \<open>affine T\<close> continuous_on_id fid)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4270
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4271
      then show "continuous_on S ff"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4272
        apply (rule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4273
        using ST by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4274
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) gg"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4275
        apply (simp add: gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4276
        apply (rule continuous_on_cases)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4277
        using homeomorphism_cont2 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4278
            apply (auto simp: affine_closed \<open>affine T\<close> continuous_on_id gid)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4279
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4280
      then show "continuous_on S gg"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4281
        apply (rule continuous_on_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4282
        using ST by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4283
      show "ff ` S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4284
      proof (clarsimp simp add: ff_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4285
        fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4286
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4287
        then have "f x \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4288
          using homeomorphism_image1 [OF hom] by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4289
        then show "f x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4290
          using ST(1) \<open>x \<in> T\<close> gid hom homeomorphism_def x by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4291
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4292
      show "gg ` S \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4293
      proof (clarsimp simp add: gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4294
        fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4295
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4296
        then have "g x \<in> cball a r \<inter> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4297
          using homeomorphism_image2 [OF hom] by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4298
        then have "g x \<in> ball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4299
          using homeomorphism_apply2 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4300
            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
  4301
        then show "g x \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4302
          using ST(1) \<open>g x \<in> cball a r \<inter> T\<close> by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4303
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4304
      show "\<And>x. x \<in> S \<Longrightarrow> gg (ff x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4305
        apply (simp add: ff_def gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4306
        using homeomorphism_apply1 [OF hom] homeomorphism_image1 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4307
        apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4308
        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
  4309
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4310
      show "\<And>x. x \<in> S \<Longrightarrow> ff (gg x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4311
        apply (simp add: ff_def gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4312
        using homeomorphism_apply2 [OF hom] homeomorphism_image2 [OF hom]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4313
        apply auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4314
        apply (metis Int_iff fid image_eqI less_eq_real_def mem_cball mem_sphere)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4315
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4316
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4317
    show "ff u = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4318
      using u by (auto simp: ff_def \<open>f u = v\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4319
    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
  4320
      by (auto simp: ff_def gg_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4321
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4322
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4323
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4324
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4325
proposition%unimportant homeomorphism_moving_point:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4326
  fixes a :: "'a::euclidean_space"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4327
  assumes ope: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4328
      and "S \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4329
      and TS: "T \<subseteq> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4330
      and S: "connected S" "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4331
  obtains f g where "homeomorphism T T f g" "f a = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4332
                    "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4333
                    "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4334
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4335
  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
  4336
              {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
  4337
        if "d \<in> S" "f d \<in> S" and homfg: "homeomorphism T T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4338
        and S: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4339
        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
  4340
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4341
    show homgf: "homeomorphism T T g f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4342
      by (metis homeomorphism_symD homfg)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4343
    then show "g (f d) = d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4344
      by (meson \<open>S \<subseteq> T\<close> homeomorphism_def subsetD \<open>d \<in> S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4345
    show "{x. \<not> (g x = x \<and> f x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4346
      using S by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4347
    show "bounded {x. \<not> (g x = x \<and> f x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4348
      using bo by (simp add: conj_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4349
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4350
  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
  4351
                 {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
  4352
             if "x \<in> S" "f1 x \<in> S" "f2 (f1 x) \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4353
                and hom: "homeomorphism T T f1 g1" "homeomorphism T T f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4354
                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
  4355
                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
  4356
             for x f1 f2 g1 g2
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4357
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4358
    show homgf: "homeomorphism T T (f2 \<circ> f1) (g1 \<circ> g2)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4359
      by (metis homeomorphism_compose hom)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4360
    then show "(f2 \<circ> f1) x = f2 (f1 x)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4361
      by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4362
    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
  4363
      using sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4364
    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
  4365
      using bo by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4366
    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
  4367
      by (rule bounded_subset) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4368
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4369
  have 3: "\<exists>U. openin (subtopology euclidean S) U \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4370
              d \<in> U \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4371
              (\<forall>x\<in>U.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4372
                  \<exists>f g. homeomorphism T T f g \<and> f d = x \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4373
                        {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4374
                        bounded {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4375
           if "d \<in> S" for d
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4376
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4377
    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
  4378
      by (metis \<open>d \<in> S\<close> ope openin_contains_ball)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4379
    have *: "\<exists>f g. homeomorphism T T f g \<and> f d = e \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4380
                   {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4381
                   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
  4382
      apply (rule homeomorphism_moving_point_3 [of "affine hull S" d r T d e])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4383
      using r \<open>S \<subseteq> T\<close> TS that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4384
            apply (auto simp: \<open>d \<in> S\<close> \<open>0 < r\<close> hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4385
      using bounded_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4386
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4387
      apply (rule_tac x="S \<inter> ball d r" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4388
      apply (intro conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4389
        apply (simp add: openin_open_Int)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4390
       apply (simp add: \<open>0 < r\<close> that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4391
      apply (blast intro: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4392
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4393
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4394
  have "\<exists>f g. homeomorphism T T f g \<and> f a = b \<and>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4395
              {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
  4396
    apply (rule connected_equivalence_relation [OF S], safe)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4397
      apply (blast intro: 1 2 3)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4398
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4399
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4400
    using that by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4401
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4402
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4403
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4404
lemma homeomorphism_moving_points_exists_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4405
  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
  4406
             "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
  4407
      and "2 \<le> aff_dim S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4408
      and ope: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4409
      and "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4410
  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
  4411
               {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
  4412
  using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4413
proof (induction K)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4414
  case empty
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4415
  then show ?case
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4416
    by (force simp: homeomorphism_ident)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4417
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4418
  case (insert i K)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4419
  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
  4420
       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
  4421
       and "x i \<in> S" "y i \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4422
       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
  4423
    by (simp_all add: pairwise_insert)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4424
  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
  4425
               and fg_sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4426
               and bo_fg: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4427
    using insert.IH [OF xyS pw] insert.prems by (blast intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4428
  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
  4429
                   {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
  4430
    using insert by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4431
  have aff_eq: "affine hull (S - y ` K) = affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4432
    apply (rule affine_hull_Diff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4433
    apply (auto simp: insert)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4434
    using \<open>y i \<in> S\<close> insert.hyps(2) xney xyS by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4435
  have f_in_S: "f x \<in> S" if "x \<in> S" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4436
    using homfg fg_sub homeomorphism_apply1 \<open>S \<subseteq> T\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4437
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4438
    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
  4439
      by (metis \<open>S \<subseteq> T\<close> homfg subsetD homeomorphism_apply1 that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4440
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4441
      using fg_sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4442
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4443
  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
  4444
               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
  4445
               and bo_hk:  "bounded {x. \<not> (h x = x \<and> k x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4446
  proof (rule homeomorphism_moving_point [of "S - y`K" T "f(x i)" "y i"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4447
    show "openin (subtopology euclidean (affine hull (S - y ` K))) (S - y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4448
      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
  4449
    show "S - y ` K \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4450
      using \<open>S \<subseteq> T\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4451
    show "T \<subseteq> affine hull (S - y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4452
      using insert by (simp add: aff_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4453
    show "connected (S - y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4454
    proof (rule connected_openin_diff_countable [OF \<open>connected S\<close> ope])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4455
      show "\<not> collinear S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4456
        using collinear_aff_dim \<open>2 \<le> aff_dim S\<close> by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4457
      show "countable (y ` K)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4458
        using countable_finite insert.hyps(1) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4459
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4460
    show "f (x i) \<in> S - y ` K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4461
      apply (auto simp: f_in_S \<open>x i \<in> S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4462
        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)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4463
    show "y i \<in> S - y ` K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4464
      using insert.hyps xney by (auto simp: \<open>y i \<in> S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4465
  qed blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4466
  show ?case
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4467
  proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4468
    show "homeomorphism T T (h \<circ> f) (g \<circ> k)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4469
      using homfg homhk homeomorphism_compose by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4470
    show "\<forall>i \<in> insert i K. (h \<circ> f) (x i) = y i"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4471
      using feq hk_sub by (auto simp: heq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4472
    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
  4473
      using fg_sub hk_sub by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4474
    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
  4475
      using bo_fg bo_hk bounded_Un by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4476
    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
  4477
      by (rule bounded_subset) auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4478
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4479
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4480
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4481
proposition%unimportant homeomorphism_moving_points_exists:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4482
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4483
  assumes 2: "2 \<le> DIM('a)" "open S" "connected S" "S \<subseteq> T" "finite K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4484
      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
  4485
      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
  4486
      and S: "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4487
  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
  4488
                    "{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
  4489
proof (cases "S = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4490
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4491
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4492
    using KS homeomorphism_ident that by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4493
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4494
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4495
  then have affS: "affine hull S = UNIV"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4496
    by (simp add: affine_hull_open \<open>open S\<close>)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4497
  then have ope: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4498
    using \<open>open S\<close> open_openin by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4499
  have "2 \<le> DIM('a)" by (rule 2)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4500
  also have "\<dots> = aff_dim (UNIV :: 'a set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4501
    by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4502
  also have "\<dots> \<le> aff_dim S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4503
    by (metis aff_dim_UNIV aff_dim_affine_hull aff_dim_le_DIM affS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4504
  finally have "2 \<le> aff_dim S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4505
    by linarith
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4506
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4507
    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
  4508
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4509
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4510
subsubsection%unimportant\<open>The theorem \<open>homeomorphism_grouping_points_exists\<close>\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4511
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4512
lemma homeomorphism_grouping_point_1:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4513
  fixes a::real and c::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4514
  assumes "a < b" "c < d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4515
  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
  4516
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4517
  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
  4518
  have "\<exists>g. homeomorphism (cbox a b) (cbox c d) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4519
  proof (rule homeomorphism_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4520
    show "continuous_on (cbox a b) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4521
      apply (simp add: f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4522
      apply (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4523
      using assms by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4524
    have "f ` {a..b} = {c..d}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4525
      unfolding f_def image_affinity_atLeastAtMost
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4526
      using assms sum_sqs_eq by (auto simp: divide_simps algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4527
    then show "f ` cbox a b = cbox c d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4528
      by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4529
    show "inj_on f (cbox a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4530
      unfolding f_def inj_on_def using assms by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4531
  qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4532
  then obtain g where "homeomorphism (cbox a b) (cbox c d) f g" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4533
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4534
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4535
    show "f a = c"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4536
      by (simp add: f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4537
    show "f b = d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4538
      using assms sum_sqs_eq [of a b] by (auto simp: f_def divide_simps algebra_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4539
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4540
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4541
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4542
lemma homeomorphism_grouping_point_2:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4543
  fixes a::real and w::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4544
  assumes hom_ab: "homeomorphism (cbox a b) (cbox u v) f1 g1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4545
      and hom_bc: "homeomorphism (cbox b c) (cbox v w) f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4546
      and "b \<in> cbox a c" "v \<in> cbox u w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4547
      and eq: "f1 a = u" "f1 b = v" "f2 b = v" "f2 c = w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4548
 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
  4549
                   "\<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
  4550
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4551
  have le: "a \<le> b" "b \<le> c" "u \<le> v" "v \<le> w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4552
    using assms by simp_all
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4553
  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
  4554
    by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4555
  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
  4556
  have "\<exists>g. homeomorphism (cbox a c) (cbox u w) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4557
  proof (rule homeomorphism_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4558
    have cf1: "continuous_on (cbox a b) f1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4559
      using hom_ab homeomorphism_cont1 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4560
    have cf2: "continuous_on (cbox b c) f2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4561
      using hom_bc homeomorphism_cont1 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4562
    show "continuous_on (cbox a c) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4563
      apply (simp add: f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4564
      apply (rule continuous_on_cases_le [OF continuous_on_subset [OF cf1] continuous_on_subset [OF cf2]])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4565
      using le eq apply (force simp: continuous_on_id)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4566
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4567
    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
  4568
      unfolding f_def using eq by force+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4569
    then show "f ` cbox a c = cbox u w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4570
      apply (simp only: ac uw image_Un)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4571
      by (metis hom_ab hom_bc homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4572
    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
  4573
    proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4574
      have "f1 x \<in> cbox u v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4575
        by (metis hom_ab homeomorphism_def image_eqI mem_box_real(2) x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4576
      moreover have "f2 y \<in> cbox v w"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4577
        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
  4578
      moreover have "f2 y \<noteq> f2 b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4579
        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
  4580
      ultimately show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4581
        using le eq by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4582
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4583
    have "inj_on f1 (cbox a b)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4584
      by (metis (full_types) hom_ab homeomorphism_def inj_onI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4585
    moreover have "inj_on f2 (cbox b c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4586
      by (metis (full_types) hom_bc homeomorphism_def inj_onI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4587
    ultimately show "inj_on f (cbox a c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4588
      apply (simp (no_asm) add: inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4589
      apply (simp add: f_def inj_on_eq_iff)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4590
      using neq12  apply force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4591
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4592
  qed auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4593
  then obtain g where "homeomorphism (cbox a c) (cbox u w) f g" ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4594
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4595
    apply (rule that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4596
    using eq le by (auto simp: f_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4597
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4598
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4599
lemma homeomorphism_grouping_point_3:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4600
  fixes a::real
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4601
  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
  4602
      and box_ne: "box c d \<noteq> {}" "box u v \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4603
  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
  4604
                    "\<And>x. x \<in> cbox c d \<Longrightarrow> f x \<in> cbox u v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4605
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4606
  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
  4607
    using assms
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4608
    by (simp_all add: cbox_sub subset_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4609
  obtain f1 g1 where 1: "homeomorphism (cbox a c) (cbox a u) f1 g1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4610
                   and f1_eq: "f1 a = a" "f1 c = u"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4611
    using homeomorphism_grouping_point_1 [OF \<open>a < c\<close> \<open>a < u\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4612
  obtain f2 g2 where 2: "homeomorphism (cbox c d) (cbox u v) f2 g2"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4613
                   and f2_eq: "f2 c = u" "f2 d = v"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4614
    using homeomorphism_grouping_point_1 [OF \<open>c < d\<close> \<open>u < v\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4615
  obtain f3 g3 where 3: "homeomorphism (cbox d b) (cbox v b) f3 g3"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4616
                   and f3_eq: "f3 d = v" "f3 b = b"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4617
    using homeomorphism_grouping_point_1 [OF \<open>d < b\<close> \<open>v < b\<close>] .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4618
  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
  4619
                 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
  4620
    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
  4621
  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
  4622
               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
  4623
    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
  4624
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4625
    apply (rule that [OF fg])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4626
    using f4_eq f_eq homeomorphism_image1 [OF 2]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4627
    apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4628
    by (metis atLeastAtMost_iff box_real(1) box_real(2) cbox_sub(1) greaterThanLessThan_iff imageI less_eq_real_def subset_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4629
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4630
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4631
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4632
lemma homeomorphism_grouping_point_4:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4633
  fixes T :: "real set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4634
  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
  4635
  obtains f g where "homeomorphism T T f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4636
                    "\<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
  4637
                    "bounded {x. (\<not> (f x = x \<and> g x = x))}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4638
proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4639
  obtain c d where "box c d \<noteq> {}" "cbox c d \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4640
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4641
    obtain u where "u \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4642
      using \<open>U \<noteq> {}\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4643
    then obtain e where "e > 0" "cball u e \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4644
      using \<open>open U\<close> open_contains_cball by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4645
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4646
      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
  4647
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4648
  have "compact K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4649
    by (simp add: \<open>finite K\<close> finite_imp_compact)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4650
  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
  4651
  proof (cases "K = {}")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4652
    case True then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4653
      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
  4654
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4655
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4656
    then obtain a b where "a \<in> K" "b \<in> K"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4657
            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
  4658
      using compact_attains_inf compact_attains_sup by (metis \<open>compact K\<close>)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4659
    obtain e where "e > 0" "cball b e \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4660
      using \<open>open S\<close> open_contains_cball
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4661
      by (metis \<open>b \<in> K\<close> \<open>K \<subseteq> S\<close> subsetD)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4662
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4663
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4664
      show "box a (b + e) \<noteq> {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4665
        using \<open>0 < e\<close> \<open>b \<in> K\<close> a by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4666
      show "K \<subseteq> cbox a (b + e)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4667
        using \<open>0 < e\<close> a b by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4668
      have "a \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4669
        using \<open>a \<in> K\<close> assms(6) by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4670
      have "b + e \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4671
        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
  4672
      show "cbox a (b + e) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4673
        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
  4674
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4675
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4676
  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
  4677
  proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4678
    have "a \<in> S" "b \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4679
      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
  4680
    moreover have "c \<in> S" "d \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4681
      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
  4682
    ultimately have "min a c \<in> S" "max b d \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4683
      by linarith+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4684
    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
  4685
      using \<open>open S\<close> open_contains_cball by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4686
    then have *: "min a c - e1 \<in> S" "max b d + e2 \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4687
      by (auto simp: dist_norm)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4688
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4689
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4690
      show "cbox (min a c - e1) (max b d+ e2) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4691
        using * \<open>connected S\<close> connected_contains_Icc by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4692
      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
  4693
        using \<open>0 < e1\<close> \<open>0 < e2\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4694
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4695
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4696
  then
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4697
  obtain f g where hom: "homeomorphism (cbox w z) (cbox w z) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4698
               and "f w = w" "f z = z"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4699
               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
  4700
    using homeomorphism_grouping_point_3 [of a b w z c d]
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4701
    using \<open>box a b \<noteq> {}\<close> \<open>box c d \<noteq> {}\<close> by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4702
  have contfg: "continuous_on (cbox w z) f" "continuous_on (cbox w z) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4703
    using hom homeomorphism_def by blast+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4704
  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
  4705
  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
  4706
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4707
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4708
    have T: "cbox w z \<union> (T - box w z) = T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4709
      using \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4710
    show "homeomorphism T T f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4711
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4712
      have clo: "closedin (subtopology euclidean (cbox w z \<union> (T - box w z))) (T - box w z)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4713
        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
  4714
      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
  4715
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4716
         apply (safe intro!: continuous_on_cases_local contfg continuous_on_id clo)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4717
         apply (simp_all add: closed_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4718
        using \<open>f w = w\<close> \<open>f z = z\<close> apply force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4719
        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
  4720
      then show "continuous_on T f'" "continuous_on T g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4721
        by (simp_all only: T)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4722
      show "f' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4723
        unfolding f'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4724
        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
  4725
      show "g' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4726
        unfolding g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4727
        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
  4728
      show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4729
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4730
        using homeomorphism_apply1 [OF hom]  homeomorphism_image1 [OF hom] by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4731
      show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4732
        unfolding f'_def g'_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4733
        using homeomorphism_apply2 [OF hom]  homeomorphism_image2 [OF hom] by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4734
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4735
    show "\<And>x. x \<in> K \<Longrightarrow> f' x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4736
      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
  4737
    show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4738
      using \<open>cbox w z \<subseteq> S\<close> by (auto simp: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4739
    show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4740
      apply (rule bounded_subset [of "cbox w z"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4741
      using bounded_cbox apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4742
      apply (auto simp: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4743
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4744
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4745
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4746
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4747
proposition%unimportant homeomorphism_grouping_points_exists:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4748
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4749
  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
  4750
  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
  4751
                    "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
  4752
proof (cases "2 \<le> DIM('a)")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4753
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4754
  have TS: "T \<subseteq> affine hull S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4755
    using affine_hull_open assms by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4756
  have "infinite U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4757
    using \<open>open U\<close> \<open>U \<noteq> {}\<close> finite_imp_not_open by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4758
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4759
    using infinite_arbitrarily_large by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4760
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4761
    using \<open>finite K\<close> finite_same_card_bij by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4762
  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
  4763
  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
  4764
    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
  4765
      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
  4766
    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
  4767
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4768
  qed (use affine_hull_open assms that in auto)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4769
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4770
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4771
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4772
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4773
  with DIM_positive have "DIM('a) = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4774
    by (simp add: dual_order.antisym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4775
  then obtain h::"'a \<Rightarrow>real" and j
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4776
  where "linear h" "linear j"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4777
    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
  4778
    and hj:  "\<And>x. j(h x) = x" "\<And>y. h(j y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4779
    and ranh: "surj h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4780
    using isomorphisms_UNIV_UNIV
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4781
    by (metis (mono_tags, hide_lams) DIM_real UNIV_eq_I range_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4782
  obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4783
               and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4784
               and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4785
               and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4786
    apply (rule homeomorphism_grouping_point_4 [of "h ` U" "h ` S" "h ` K" "h ` T"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4787
    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
  4788
  have jf: "j (f (h x)) = x \<longleftrightarrow> f (h x) = h x" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4789
    by (metis hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4790
  have jg: "j (g (h x)) = x \<longleftrightarrow> g (h x) = h x" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4791
    by (metis hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4792
  have cont_hj: "continuous_on X h"  "continuous_on Y j" for X Y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4793
    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
  4794
  show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4795
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4796
    show "homeomorphism T T (j \<circ> f \<circ> h) (j \<circ> g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4797
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4798
      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
  4799
        using hom homeomorphism_def
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4800
        by (blast intro: continuous_on_compose cont_hj)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4801
      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
  4802
        by auto (metis (mono_tags, hide_lams) hj(1) hom homeomorphism_def imageE imageI)+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4803
      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
  4804
        using hj hom homeomorphism_apply1 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4805
      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
  4806
        using hj hom homeomorphism_apply2 by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4807
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4808
    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
  4809
      apply (clarsimp simp: jf jg hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4810
      using sub hj
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4811
      apply (drule_tac c="h x" in subsetD, force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4812
      by (metis imageE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4813
    have "bounded (j ` {x. (\<not> (f x = x \<and> g x = x))})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4814
      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
  4815
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4816
    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
  4817
      using hj by (auto simp: jf jg image_iff, metis+)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4818
    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
  4819
      by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4820
    show "\<And>x. x \<in> K \<Longrightarrow> (j \<circ> f \<circ> h) x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4821
      using f hj by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4822
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4823
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4824
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4825
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4826
proposition%unimportant homeomorphism_grouping_points_exists_gen:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4827
  fixes S :: "'a::euclidean_space set"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4828
  assumes opeU: "openin (subtopology euclidean S) U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4829
      and opeS: "openin (subtopology euclidean (affine hull S)) S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4830
      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
  4831
  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
  4832
                    "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
  4833
proof (cases "2 \<le> aff_dim S")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4834
  case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4835
  have opeU': "openin (subtopology euclidean (affine hull S)) U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4836
    using opeS opeU openin_trans by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4837
  obtain u where "u \<in> U" "u \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4838
    using \<open>U \<noteq> {}\<close> opeU openin_imp_subset by fastforce+
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4839
  have "infinite U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4840
    apply (rule infinite_openin [OF opeU \<open>u \<in> U\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4841
    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
  4842
    using True apply simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4843
    done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4844
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4845
    using infinite_arbitrarily_large by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4846
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4847
    using \<open>finite K\<close> finite_same_card_bij by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4848
  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
  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
  proof (rule homeomorphism_moving_points_exists_gen [OF \<open>finite K\<close> _ _ True opeS S])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4851
    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
  4852
      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
  4853
    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
  4854
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4855
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4856
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4857
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4858
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4859
  case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4860
  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
  4861
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4862
  proof cases
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4863
    assume "aff_dim S = -1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4864
    then have "S = {}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4865
      using aff_dim_empty by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4866
    then have "False"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4867
      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
  4868
    then show ?thesis ..
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4869
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4870
    assume "aff_dim S = 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4871
    then obtain a where "S = {a}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4872
      using aff_dim_eq_0 by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4873
    then have "K \<subseteq> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4874
      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
  4875
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4876
      apply (rule that [of id id])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4877
      using \<open>K \<subseteq> U\<close> by (auto simp: continuous_on_id intro: homeomorphismI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4878
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4879
    assume "aff_dim S = 1"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4880
    then have "affine hull S homeomorphic (UNIV :: real set)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4881
      by (auto simp: homeomorphic_affine_sets)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4882
    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
  4883
      using homeomorphic_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4884
    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
  4885
      by (auto simp: homeomorphism_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4886
    have connh: "connected (h ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4887
      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
  4888
    have hUS: "h ` U \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4889
      by (meson homeomorphism_imp_open_map homeomorphism_of_subsets homhj hull_subset opeS opeU open_UNIV openin_open_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4890
    have opn: "openin (subtopology euclidean (affine hull S)) U \<Longrightarrow> open (h ` U)" for U
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4891
      using homeomorphism_imp_open_map [OF homhj]  by simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4892
    have "open (h ` U)" "open (h ` S)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4893
      by (auto intro: opeS opeU openin_trans opn)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4894
    then obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4895
                 and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4896
                 and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4897
                 and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4898
      apply (rule homeomorphism_grouping_points_exists [of "h ` U" "h ` S" "h ` K" "h ` T"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4899
      using assms by (auto simp: connh hUS)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4900
    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
  4901
      by (metis h j)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4902
    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
  4903
      by (metis h j)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4904
    have cont_hj: "continuous_on T h"  "continuous_on Y j" for Y
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4905
      apply (rule continuous_on_subset [OF _ \<open>T \<subseteq> affine hull S\<close>])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4906
      using homeomorphism_def homhj apply blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4907
      by (meson continuous_on_subset homeomorphism_def homhj top_greatest)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4908
    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
  4909
    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
  4910
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4911
    proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4912
      show "homeomorphism T T f' g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4913
      proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4914
        have "continuous_on T (j \<circ> f \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4915
          apply (intro continuous_on_compose cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4916
          using hom homeomorphism_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4917
        then show "continuous_on T f'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4918
          apply (rule continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4919
          using \<open>T \<subseteq> affine hull S\<close> f'_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4920
        have "continuous_on T (j \<circ> g \<circ> h)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4921
          apply (intro continuous_on_compose cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4922
          using hom homeomorphism_def by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4923
        then show "continuous_on T g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4924
          apply (rule continuous_on_eq)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4925
          using \<open>T \<subseteq> affine hull S\<close> g'_def by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4926
        show "f' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4927
        proof (clarsimp simp: f'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4928
          fix x assume "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4929
          then have "f (h x) \<in> h ` T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4930
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4931
          then show "j (f (h x)) \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4932
            using \<open>T \<subseteq> affine hull S\<close> h by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4933
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4934
        show "g' ` T \<subseteq> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4935
        proof (clarsimp simp: g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4936
          fix x assume "x \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4937
          then have "g (h x) \<in> h ` T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4938
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4939
          then show "j (g (h x)) \<in> T"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4940
            using \<open>T \<subseteq> affine hull S\<close> h by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4941
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4942
        show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4943
          using h j hom homeomorphism_apply1 by (fastforce simp add: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4944
        show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4945
          using h j hom homeomorphism_apply2 by (fastforce simp add: f'_def g'_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4946
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4947
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4948
      show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4949
        apply (clarsimp simp: f'_def g'_def jf jg)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4950
        apply (rule imageE [OF subsetD [OF sub]], force)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4951
        by (metis h hull_inc)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4952
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4953
      have "compact (j ` closure {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4954
        using bou by (auto simp: compact_continuous_image cont_hj)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4955
      then have "bounded (j ` {x. \<not> (f x = x \<and> g x = x)})"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4956
        by (rule bounded_closure_image [OF compact_imp_bounded])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4957
      moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4958
      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
  4959
        using h j by (auto simp: image_iff; metis)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4960
      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
  4961
        by metis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4962
      then show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4963
        by (simp add: f'_def g'_def Collect_mono bounded_subset)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4964
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4965
      show "f' x \<in> U" if "x \<in> K" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4966
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4967
        have "U \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4968
          using opeU openin_imp_subset by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4969
        then have "j (f (h x)) \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4970
          using f h hull_subset that by fastforce
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4971
        then show "f' x \<in> U"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4972
          using \<open>K \<subseteq> S\<close> S f'_def that by 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
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4976
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4977
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4978
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4979
subsection\<open>Nullhomotopic mappings\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4980
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4981
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
  4982
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
  4983
we also don't need to explicitly assume continuity since it's already implicit
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4984
in both sides of the equivalence.\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4985
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4986
lemma nullhomotopic_from_lemma:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4987
  assumes contg: "continuous_on (cball a r - {a}) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4988
      and fa: "\<And>e. 0 < e
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4989
               \<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
  4990
      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
  4991
    shows "continuous_on (cball a r) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4992
proof (clarsimp simp: continuous_on_eq_continuous_within Ball_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4993
  fix x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4994
  assume x: "dist a x \<le> r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4995
  show "continuous (at x within cball a r) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4996
  proof (cases "x=a")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4997
    case True
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4998
    then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  4999
      by (metis continuous_within_eps_delta fa dist_norm dist_self r)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5000
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5001
    case False
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5002
    show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5003
    proof (rule continuous_transform_within [where f=g and d = "norm(x-a)"])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5004
      have "\<exists>d>0. \<forall>x'\<in>cball a r.
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5005
                      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
  5006
      proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5007
        obtain d where "d > 0"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5008
           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
  5009
                                 dist (g x') (g x) < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5010
          using contg False x \<open>e>0\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5011
          unfolding continuous_on_iff by (fastforce simp add: dist_commute intro: that)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5012
        show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5013
          using \<open>d > 0\<close> \<open>x \<noteq> a\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5014
          by (rule_tac x="min d (norm(x - a))" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5015
             (auto simp: dist_commute dist_norm [symmetric]  intro!: d)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5016
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5017
      then show "continuous (at x within cball a r) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5018
        using contg False by (auto simp: continuous_within_eps_delta)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5019
      show "0 < norm (x - a)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5020
        using False by force
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5021
      show "x \<in> cball a r"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5022
        by (simp add: x)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5023
      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
  5024
        \<Longrightarrow> g x' = f x'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5025
        by (metis dist_commute dist_norm less_le r)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5026
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5027
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5028
qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5029
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5030
proposition nullhomotopic_from_sphere_extension:
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5031
  fixes f :: "'M::euclidean_space \<Rightarrow> 'a::real_normed_vector"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5032
  shows  "(\<exists>c. homotopic_with (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)) \<longleftrightarrow>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5033
          (\<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
  5034
               (\<forall>x \<in> sphere a r. g x = f x))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5035
         (is "?lhs = ?rhs")
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5036
proof (cases r "0::real" rule: linorder_cases)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5037
  case equal
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5038
  then show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5039
    apply (auto simp: homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5040
    apply (rule_tac x="\<lambda>x. h (0, a)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5041
     apply (fastforce simp add:)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5042
    using continuous_on_const by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5043
next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5044
  case greater
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5045
  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
  5046
  have ?P if ?lhs using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5047
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5048
    fix c
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5049
    assume c: "homotopic_with (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5050
    then have contf: "continuous_on (sphere a r) f" and fim: "f ` sphere a r \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5051
      by (auto simp: homotopic_with_imp_subset1 homotopic_with_imp_continuous)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5052
    show ?P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5053
      using contf fim by (auto simp: sphere_def dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5054
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5055
  moreover have ?P if ?rhs using that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5056
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5057
    fix g
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5058
    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)"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5059
    then
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5060
    show ?P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5061
      apply (safe elim!: continuous_on_eq [OF continuous_on_subset])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5062
      apply (auto simp: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5063
      by (metis dist_norm image_subset_iff mem_sphere norm_minus_commute sphere_cball subsetCE)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5064
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5065
  moreover have ?thesis if ?P
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5066
  proof
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5067
    assume ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5068
    then obtain c where "homotopic_with (\<lambda>x. True) (sphere a r) S (\<lambda>x. c) f"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5069
      using homotopic_with_sym by blast
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5070
    then obtain h where conth: "continuous_on ({0..1::real} \<times> sphere a r) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5071
                    and him: "h ` ({0..1} \<times> sphere a r) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5072
                    and h: "\<And>x. h(0, x) = c" "\<And>x. h(1, x) = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5073
      by (auto simp: homotopic_with_def)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5074
    obtain b1::'M where "b1 \<in> Basis"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5075
      using SOME_Basis by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5076
    have "c \<in> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5077
      apply (rule him [THEN subsetD])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5078
      apply (rule_tac x = "(0, a + r *\<^sub>R b1)" in image_eqI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5079
      using h greater \<open>b1 \<in> Basis\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5080
       apply (auto simp: dist_norm)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5081
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5082
    have uconth: "uniformly_continuous_on ({0..1::real} \<times> (sphere a r)) h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5083
      by (force intro: compact_Times conth compact_uniformly_continuous)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5084
    let ?g = "\<lambda>x. h (norm (x - a)/r,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5085
                     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
  5086
    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
  5087
    show ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5088
    proof (intro exI conjI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5089
      have "continuous_on (cball a r - {a}) ?g'"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5090
        apply (rule continuous_on_compose2 [OF conth])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5091
         apply (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5092
        using greater apply (auto simp: dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5093
        done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5094
      then show "continuous_on (cball a r) ?g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5095
      proof (rule nullhomotopic_from_lemma)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5096
        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
  5097
        proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5098
          obtain d where "0 < d"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5099
             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
  5100
                        \<Longrightarrow> dist (h x') (h x) < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5101
            using uniformly_continuous_onE [OF uconth \<open>0 < e\<close>] by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5102
          have *: "norm (h (norm (x - a) / r,
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5103
                         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
  5104
                   if "x \<noteq> a" "norm (x - a) < r" "norm (x - a) < d * r" for x
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5105
          proof -
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5106
            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
  5107
                  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
  5108
              by (simp add: h)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5109
            also have "\<dots> < e"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5110
              apply (rule d [unfolded dist_norm])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5111
              using greater \<open>0 < d\<close> \<open>b1 \<in> Basis\<close> that
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5112
                by (auto simp: dist_norm divide_simps)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5113
            finally show ?thesis .
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5114
          qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5115
          show ?thesis
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5116
            apply (rule_tac x = "min r (d * r)" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5117
            using greater \<open>0 < d\<close> by (auto simp: *)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5118
        qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5119
        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
  5120
          by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5121
      qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5122
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5123
      show "?g ` cball a r \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5124
        using greater him \<open>c \<in> S\<close>
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5125
        by (force simp: h dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5126
    next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5127
      show "\<forall>x\<in>sphere a r. ?g x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5128
        using greater by (auto simp: h dist_norm norm_minus_commute)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5129
    qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5130
  next
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5131
    assume ?rhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5132
    then obtain g where contg: "continuous_on (cball a r) g"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5133
                    and gim: "g ` cball a r \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5134
                    and gf: "\<forall>x \<in> sphere a r. g x = f x"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5135
      by auto
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5136
    let ?h = "\<lambda>y. g (a + (fst y) *\<^sub>R (snd y - a))"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5137
    have "continuous_on ({0..1} \<times> sphere a r) ?h"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5138
      apply (rule continuous_on_compose2 [OF contg])
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5139
       apply (intro continuous_intros)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5140
      apply (auto simp: dist_norm norm_minus_commute mult_left_le_one_le)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5141
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5142
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5143
    have "?h ` ({0..1} \<times> sphere a r) \<subseteq> S"
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5144
      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
  5145
    moreover
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5146
    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
  5147
      by (auto simp: dist_norm norm_minus_commute mult_left_le_one_le gf)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5148
    ultimately
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5149
    show ?lhs
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5150
      apply (subst homotopic_with_sym)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5151
      apply (rule_tac x="g a" in exI)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5152
      apply (auto simp: homotopic_with)
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5153
      done
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5154
  qed
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5155
  ultimately
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5156
  show ?thesis by meson
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5157
qed simp
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5158
19d8a59481db split off Homotopy.thy
immler
parents:
diff changeset
  5159
end