src/HOL/Analysis/Path_Connected.thy
author paulson <lp15@cam.ac.uk>
Fri, 30 Sep 2016 14:05:51 +0100
changeset 63967 2aa42596edc3
parent 63955 51a3d38d2281
child 63970 3b6a3632e754
permissions -rw-r--r--
new material on paths, etc. Also rationalisation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63594
diff changeset
     1
(*  Title:      HOL/Analysis/Path_Connected.thy
61806
d2e62ae01cd8 Cauchy's integral formula for circles. Starting to fix eventually_mono.
paulson <lp15@cam.ac.uk>
parents: 61762
diff changeset
     2
    Authors:    LC Paulson and Robert Himmelmann (TU Muenchen), based on material from HOL Light
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
     3
*)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
     4
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
     5
section \<open>Continuous paths and path-connected sets\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
     6
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
     7
theory Path_Connected
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
     8
imports Continuous_Extension "~~/src/HOL/Library/Continuum_Not_Denumerable"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
     9
begin
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    10
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
    11
subsection \<open>Paths and Arcs\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    12
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    13
definition path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    14
  where "path g \<longleftrightarrow> continuous_on {0..1} g"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    15
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    16
definition pathstart :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    17
  where "pathstart g = g 0"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    18
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    19
definition pathfinish :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    20
  where "pathfinish g = g 1"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    21
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    22
definition path_image :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a set"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    23
  where "path_image g = g ` {0 .. 1}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    24
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    25
definition reversepath :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> real \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    26
  where "reversepath g = (\<lambda>x. g(1 - x))"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    27
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    28
definition joinpaths :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> real \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    29
    (infixr "+++" 75)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    30
  where "g1 +++ g2 = (\<lambda>x. if x \<le> 1/2 then g1 (2 * x) else g2 (2 * x - 1))"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    31
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    32
definition simple_path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    33
  where "simple_path g \<longleftrightarrow>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    34
     path g \<and> (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. g x = g y \<longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    35
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    36
definition arc :: "(real \<Rightarrow> 'a :: topological_space) \<Rightarrow> bool"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    37
  where "arc g \<longleftrightarrow> path g \<and> inj_on g {0..1}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    38
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    39
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
    40
subsection\<open>Invariance theorems\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    41
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    42
lemma path_eq: "path p \<Longrightarrow> (\<And>t. t \<in> {0..1} \<Longrightarrow> p t = q t) \<Longrightarrow> path q"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    43
  using continuous_on_eq path_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    44
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    45
lemma path_continuous_image: "path g \<Longrightarrow> continuous_on (path_image g) f \<Longrightarrow> path(f o g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    46
  unfolding path_def path_image_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    47
  using continuous_on_compose by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    48
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    49
lemma path_translation_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    50
  fixes g :: "real \<Rightarrow> 'a :: real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    51
  shows "path((\<lambda>x. a + x) o g) = path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    52
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    53
  have g: "g = (\<lambda>x. -a + x) o ((\<lambda>x. a + x) o g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    54
    by (rule ext) simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    55
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    56
    unfolding path_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    57
    apply safe
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    58
    apply (subst g)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    59
    apply (rule continuous_on_compose)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    60
    apply (auto intro: continuous_intros)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    61
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    62
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    63
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    64
lemma path_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    65
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    66
   assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    67
     shows "path(f o g) = path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    68
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    69
  from linear_injective_left_inverse [OF assms]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    70
  obtain h where h: "linear h" "h \<circ> f = id"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    71
    by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    72
  then have g: "g = h o (f o g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    73
    by (metis comp_assoc id_comp)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    74
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    75
    unfolding path_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    76
    using h assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    77
    by (metis g continuous_on_compose linear_continuous_on linear_conv_bounded_linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    78
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    79
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    80
lemma pathstart_translation: "pathstart((\<lambda>x. a + x) o g) = a + pathstart g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    81
  by (simp add: pathstart_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    82
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    83
lemma pathstart_linear_image_eq: "linear f \<Longrightarrow> pathstart(f o g) = f(pathstart g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    84
  by (simp add: pathstart_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    85
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    86
lemma pathfinish_translation: "pathfinish((\<lambda>x. a + x) o g) = a + pathfinish g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    87
  by (simp add: pathfinish_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    88
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    89
lemma pathfinish_linear_image: "linear f \<Longrightarrow> pathfinish(f o g) = f(pathfinish g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    90
  by (simp add: pathfinish_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    91
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    92
lemma path_image_translation: "path_image((\<lambda>x. a + x) o g) = (\<lambda>x. a + x) ` (path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    93
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    94
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    95
lemma path_image_linear_image: "linear f \<Longrightarrow> path_image(f o g) = f ` (path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    96
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    97
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    98
lemma reversepath_translation: "reversepath((\<lambda>x. a + x) o g) = (\<lambda>x. a + x) o reversepath g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    99
  by (rule ext) (simp add: reversepath_def)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   100
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   101
lemma reversepath_linear_image: "linear f \<Longrightarrow> reversepath(f o g) = f o reversepath g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   102
  by (rule ext) (simp add: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   103
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   104
lemma joinpaths_translation:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   105
    "((\<lambda>x. a + x) o g1) +++ ((\<lambda>x. a + x) o g2) = (\<lambda>x. a + x) o (g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   106
  by (rule ext) (simp add: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   107
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   108
lemma joinpaths_linear_image: "linear f \<Longrightarrow> (f o g1) +++ (f o g2) = f o (g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   109
  by (rule ext) (simp add: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   110
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   111
lemma simple_path_translation_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   112
  fixes g :: "real \<Rightarrow> 'a::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   113
  shows "simple_path((\<lambda>x. a + x) o g) = simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   114
  by (simp add: simple_path_def path_translation_eq)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   115
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   116
lemma simple_path_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   117
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   118
  assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   119
    shows "simple_path(f o g) = simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   120
  using assms inj_on_eq_iff [of f]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   121
  by (auto simp: path_linear_image_eq simple_path_def path_translation_eq)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   122
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   123
lemma arc_translation_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   124
  fixes g :: "real \<Rightarrow> 'a::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   125
  shows "arc((\<lambda>x. a + x) o g) = arc g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   126
  by (auto simp: arc_def inj_on_def path_translation_eq)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   127
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   128
lemma arc_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   129
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   130
   assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   131
     shows  "arc(f o g) = arc g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   132
  using assms inj_on_eq_iff [of f]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   133
  by (auto simp: arc_def inj_on_def path_linear_image_eq)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   134
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   135
subsection\<open>Basic lemmas about paths\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   136
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   137
lemma arc_imp_simple_path: "arc g \<Longrightarrow> simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   138
  by (simp add: arc_def inj_on_def simple_path_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   139
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   140
lemma arc_imp_path: "arc g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   141
  using arc_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   142
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   143
lemma simple_path_imp_path: "simple_path g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   144
  using simple_path_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   145
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   146
lemma simple_path_cases: "simple_path g \<Longrightarrow> arc g \<or> pathfinish g = pathstart g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   147
  unfolding simple_path_def arc_def inj_on_def pathfinish_def pathstart_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   148
  by (force)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   149
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   150
lemma simple_path_imp_arc: "simple_path g \<Longrightarrow> pathfinish g \<noteq> pathstart g \<Longrightarrow> arc g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   151
  using simple_path_cases by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   152
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   153
lemma arc_distinct_ends: "arc g \<Longrightarrow> pathfinish g \<noteq> pathstart g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   154
  unfolding arc_def inj_on_def pathfinish_def pathstart_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   155
  by fastforce
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   156
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   157
lemma arc_simple_path: "arc g \<longleftrightarrow> simple_path g \<and> pathfinish g \<noteq> pathstart g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   158
  using arc_distinct_ends arc_imp_simple_path simple_path_cases by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   159
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   160
lemma simple_path_eq_arc: "pathfinish g \<noteq> pathstart g \<Longrightarrow> (simple_path g = arc g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   161
  by (simp add: arc_simple_path)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   162
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60809
diff changeset
   163
lemma path_image_nonempty [simp]: "path_image g \<noteq> {}"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 53640
diff changeset
   164
  unfolding path_image_def image_is_empty box_eq_empty
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   165
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   166
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   167
lemma pathstart_in_path_image[intro]: "pathstart g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   168
  unfolding pathstart_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   169
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   170
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   171
lemma pathfinish_in_path_image[intro]: "pathfinish g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   172
  unfolding pathfinish_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   173
  by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   174
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   175
lemma connected_path_image[intro]: "path g \<Longrightarrow> connected (path_image g)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   176
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   177
  using connected_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   178
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   179
lemma compact_path_image[intro]: "path g \<Longrightarrow> compact (path_image g)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   180
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   181
  using compact_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   182
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   183
lemma reversepath_reversepath[simp]: "reversepath (reversepath g) = g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   184
  unfolding reversepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   185
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   186
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   187
lemma pathstart_reversepath[simp]: "pathstart (reversepath g) = pathfinish g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   188
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   189
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   190
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   191
lemma pathfinish_reversepath[simp]: "pathfinish (reversepath g) = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   192
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   193
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   194
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   195
lemma pathstart_join[simp]: "pathstart (g1 +++ g2) = pathstart g1"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   196
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   197
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   198
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   199
lemma pathfinish_join[simp]: "pathfinish (g1 +++ g2) = pathfinish g2"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   200
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   201
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   202
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   203
lemma path_image_reversepath[simp]: "path_image (reversepath g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   204
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   205
  have *: "\<And>g. path_image (reversepath g) \<subseteq> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   206
    unfolding path_image_def subset_eq reversepath_def Ball_def image_iff
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   207
    by force
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   208
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   209
    using *[of g] *[of "reversepath g"]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   210
    unfolding reversepath_reversepath
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   211
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   212
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   213
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   214
lemma path_reversepath [simp]: "path (reversepath g) \<longleftrightarrow> path g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   215
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   216
  have *: "\<And>g. path g \<Longrightarrow> path (reversepath g)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   217
    unfolding path_def reversepath_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   218
    apply (rule continuous_on_compose[unfolded o_def, of _ "\<lambda>x. 1 - x"])
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   219
    apply (intro continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   220
    apply (rule continuous_on_subset[of "{0..1}"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   221
    apply assumption
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   222
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   223
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   224
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   225
    using *[of "reversepath g"] *[of g]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   226
    unfolding reversepath_reversepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   227
    by (rule iffI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   228
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   229
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   230
lemma arc_reversepath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   231
  assumes "arc g" shows "arc(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   232
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   233
  have injg: "inj_on g {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   234
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   235
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   236
  have **: "\<And>x y::real. 1-x = 1-y \<Longrightarrow> x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   237
    by simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   238
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   239
    apply (auto simp: arc_def inj_on_def path_reversepath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   240
    apply (simp add: arc_imp_path assms)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   241
    apply (rule **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   242
    apply (rule inj_onD [OF injg])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   243
    apply (auto simp: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   244
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   245
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   246
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   247
lemma simple_path_reversepath: "simple_path g \<Longrightarrow> simple_path (reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   248
  apply (simp add: simple_path_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   249
  apply (force simp: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   250
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   251
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   252
lemmas reversepath_simps =
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   253
  path_reversepath path_image_reversepath pathstart_reversepath pathfinish_reversepath
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   254
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   255
lemma path_join[simp]:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   256
  assumes "pathfinish g1 = pathstart g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   257
  shows "path (g1 +++ g2) \<longleftrightarrow> path g1 \<and> path g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   258
  unfolding path_def pathfinish_def pathstart_def
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   259
proof safe
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   260
  assume cont: "continuous_on {0..1} (g1 +++ g2)"
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   261
  have g1: "continuous_on {0..1} g1 \<longleftrightarrow> continuous_on {0..1} ((g1 +++ g2) \<circ> (\<lambda>x. x / 2))"
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   262
    by (intro continuous_on_cong refl) (auto simp: joinpaths_def)
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   263
  have g2: "continuous_on {0..1} g2 \<longleftrightarrow> continuous_on {0..1} ((g1 +++ g2) \<circ> (\<lambda>x. x / 2 + 1/2))"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   264
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   265
    by (intro continuous_on_cong refl) (auto simp: joinpaths_def pathfinish_def pathstart_def)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   266
  show "continuous_on {0..1} g1" and "continuous_on {0..1} g2"
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51478
diff changeset
   267
    unfolding g1 g2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   268
    by (auto intro!: continuous_intros continuous_on_subset[OF cont] simp del: o_apply)
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   269
next
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   270
  assume g1g2: "continuous_on {0..1} g1" "continuous_on {0..1} g2"
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   271
  have 01: "{0 .. 1} = {0..1/2} \<union> {1/2 .. 1::real}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   272
    by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   273
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   274
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   275
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   276
    then have "x \<in> (\<lambda>x. x * 2) ` {0..1 / 2}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   277
      by (intro image_eqI[where x="x/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   278
  }
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   279
  note 1 = this
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   280
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   281
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   282
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   283
    then have "x \<in> (\<lambda>x. x * 2 - 1) ` {1 / 2..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   284
      by (intro image_eqI[where x="x/2 + 1/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   285
  }
51478
270b21f3ae0a move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents: 50935
diff changeset
   286
  note 2 = this
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   287
  show "continuous_on {0..1} (g1 +++ g2)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   288
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   289
    unfolding joinpaths_def 01
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   290
    apply (intro continuous_on_cases closed_atLeastAtMost g1g2[THEN continuous_on_compose2] continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   291
    apply (auto simp: field_simps pathfinish_def pathstart_def intro!: 1 2)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   292
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   293
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   294
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   295
section \<open>Path Images\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   296
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   297
lemma bounded_path_image: "path g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   298
  by (simp add: compact_imp_bounded compact_path_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   299
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   300
lemma closed_path_image:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   301
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   302
  shows "path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   303
  by (metis compact_path_image compact_imp_closed)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   304
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   305
lemma connected_simple_path_image: "simple_path g \<Longrightarrow> connected(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   306
  by (metis connected_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   307
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   308
lemma compact_simple_path_image: "simple_path g \<Longrightarrow> compact(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   309
  by (metis compact_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   310
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   311
lemma bounded_simple_path_image: "simple_path g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   312
  by (metis bounded_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   313
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   314
lemma closed_simple_path_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   315
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   316
  shows "simple_path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   317
  by (metis closed_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   318
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   319
lemma connected_arc_image: "arc g \<Longrightarrow> connected(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   320
  by (metis connected_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   321
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   322
lemma compact_arc_image: "arc g \<Longrightarrow> compact(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   323
  by (metis compact_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   324
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   325
lemma bounded_arc_image: "arc g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   326
  by (metis bounded_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   327
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   328
lemma closed_arc_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   329
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   330
  shows "arc g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   331
  by (metis closed_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   332
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   333
lemma path_image_join_subset: "path_image (g1 +++ g2) \<subseteq> path_image g1 \<union> path_image g2"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   334
  unfolding path_image_def joinpaths_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   335
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   336
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   337
lemma subset_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   338
  assumes "path_image g1 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   339
    and "path_image g2 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   340
  shows "path_image (g1 +++ g2) \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   341
  using path_image_join_subset[of g1 g2] and assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   342
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   343
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   344
lemma path_image_join:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   345
    "pathfinish g1 = pathstart g2 \<Longrightarrow> path_image(g1 +++ g2) = path_image g1 \<union> path_image g2"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   346
  apply (rule subset_antisym [OF path_image_join_subset])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   347
  apply (auto simp: pathfinish_def pathstart_def path_image_def joinpaths_def image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   348
  apply (drule sym)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   349
  apply (rule_tac x="xa/2" in bexI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   350
  apply (rule ccontr)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   351
  apply (drule_tac x="(xa+1)/2" in bspec)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   352
  apply (auto simp: field_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   353
  apply (drule_tac x="1/2" in bspec, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   354
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   355
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   356
lemma not_in_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   357
  assumes "x \<notin> path_image g1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   358
    and "x \<notin> path_image g2"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   359
  shows "x \<notin> path_image (g1 +++ g2)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   360
  using assms and path_image_join_subset[of g1 g2]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   361
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   362
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   363
lemma pathstart_compose: "pathstart(f o p) = f(pathstart p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   364
  by (simp add: pathstart_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   365
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   366
lemma pathfinish_compose: "pathfinish(f o p) = f(pathfinish p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   367
  by (simp add: pathfinish_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   368
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   369
lemma path_image_compose: "path_image (f o p) = f ` (path_image p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   370
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   371
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   372
lemma path_compose_join: "f o (p +++ q) = (f o p) +++ (f o q)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   373
  by (rule ext) (simp add: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   374
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   375
lemma path_compose_reversepath: "f o reversepath p = reversepath(f o p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   376
  by (rule ext) (simp add: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   377
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   378
lemma joinpaths_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   379
  "(\<And>t. t \<in> {0..1} \<Longrightarrow> p t = p' t) \<Longrightarrow>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   380
   (\<And>t. t \<in> {0..1} \<Longrightarrow> q t = q' t)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   381
   \<Longrightarrow>  t \<in> {0..1} \<Longrightarrow> (p +++ q) t = (p' +++ q') t"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   382
  by (auto simp: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   383
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   384
lemma simple_path_inj_on: "simple_path g \<Longrightarrow> inj_on g {0<..<1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   385
  by (auto simp: simple_path_def path_image_def inj_on_def less_eq_real_def Ball_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   386
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   387
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   388
subsection\<open>Simple paths with the endpoints removed\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   389
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   390
lemma simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   391
    "simple_path c \<Longrightarrow> path_image c - {pathstart c,pathfinish c} = c ` {0<..<1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   392
  apply (auto simp: simple_path_def path_image_def pathstart_def pathfinish_def Ball_def Bex_def image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   393
  apply (metis eq_iff le_less_linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   394
  apply (metis leD linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   395
  using less_eq_real_def zero_le_one apply blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   396
  using less_eq_real_def zero_le_one apply blast
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   397
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   398
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   399
lemma connected_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   400
    "simple_path c \<Longrightarrow> connected(path_image c - {pathstart c,pathfinish c})"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   401
apply (simp add: simple_path_endless)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   402
apply (rule connected_continuous_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   403
apply (meson continuous_on_subset greaterThanLessThan_subseteq_atLeastAtMost_iff le_numeral_extra(3) le_numeral_extra(4) path_def simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   404
by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   405
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   406
lemma nonempty_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   407
    "simple_path c \<Longrightarrow> path_image c - {pathstart c,pathfinish c} \<noteq> {}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   408
  by (simp add: simple_path_endless)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   409
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   410
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   411
subsection\<open>The operations on paths\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   412
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   413
lemma path_image_subset_reversepath: "path_image(reversepath g) \<le> path_image g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   414
  by (auto simp: path_image_def reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   415
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   416
lemma path_imp_reversepath: "path g \<Longrightarrow> path(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   417
  apply (auto simp: path_def reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   418
  using continuous_on_compose [of "{0..1}" "\<lambda>x. 1 - x" g]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   419
  apply (auto simp: continuous_on_op_minus)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   420
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   421
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   422
lemma half_bounded_equal: "1 \<le> x * 2 \<Longrightarrow> x * 2 \<le> 1 \<longleftrightarrow> x = (1/2::real)"
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   423
  by simp
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   424
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   425
lemma continuous_on_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   426
  assumes "continuous_on {0..1} g1" "continuous_on {0..1} g2" "pathfinish g1 = pathstart g2"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   427
    shows "continuous_on {0..1} (g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   428
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   429
  have *: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   430
    by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   431
  have gg: "g2 0 = g1 1"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   432
    by (metis assms(3) pathfinish_def pathstart_def)
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   433
  have 1: "continuous_on {0..1/2} (g1 +++ g2)"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   434
    apply (rule continuous_on_eq [of _ "g1 o (\<lambda>x. 2*x)"])
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   435
    apply (rule continuous_intros | simp add: joinpaths_def assms)+
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   436
    done
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   437
  have "continuous_on {1/2..1} (g2 o (\<lambda>x. 2*x-1))"
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   438
    apply (rule continuous_on_subset [of "{1/2..1}"])
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   439
    apply (rule continuous_intros | simp add: image_affinity_atLeastAtMost_diff assms)+
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   440
    done
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   441
  then have 2: "continuous_on {1/2..1} (g1 +++ g2)"
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   442
    apply (rule continuous_on_eq [of "{1/2..1}" "g2 o (\<lambda>x. 2*x-1)"])
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   443
    apply (rule assms continuous_intros | simp add: joinpaths_def mult.commute half_bounded_equal gg)+
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   444
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   445
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   446
    apply (subst *)
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
   447
    apply (rule continuous_on_closed_Un)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   448
    using 1 2
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   449
    apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   450
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   451
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   452
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   453
lemma path_join_imp: "\<lbrakk>path g1; path g2; pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> path(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   454
  by (simp add: path_join)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   455
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   456
lemma simple_path_join_loop:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   457
  assumes "arc g1" "arc g2"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   458
          "pathfinish g1 = pathstart g2"  "pathfinish g2 = pathstart g1"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   459
          "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g1, pathstart g2}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   460
  shows "simple_path(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   461
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   462
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   463
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   464
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   465
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   466
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   467
    by (simp add: arc_def)
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   468
  have g12: "g1 1 = g2 0"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   469
   and g21: "g2 1 = g1 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   470
   and sb:  "g1 ` {0..1} \<inter> g2 ` {0..1} \<subseteq> {g1 0, g2 0}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   471
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   472
    by (simp_all add: arc_def pathfinish_def pathstart_def path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   473
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   474
    assume xyI: "x = 1 \<longrightarrow> y \<noteq> 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   475
       and xy: "x \<le> 1" "0 \<le> y" " y * 2 \<le> 1" "\<not> x * 2 \<le> 1" "g2 (2 * x - 1) = g1 (2 * y)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   476
    have g1im: "g1 (2 * y) \<in> g1 ` {0..1} \<inter> g2 ` {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   477
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   478
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   479
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   480
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   481
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   482
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   483
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   484
      apply (drule inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   485
      using g21 [symmetric] xyI
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   486
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   487
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   488
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   489
  { fix x and y::real
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   490
    assume xy: "y \<le> 1" "0 \<le> x" "\<not> y * 2 \<le> 1" "x * 2 \<le> 1" "g1 (2 * x) = g2 (2 * y - 1)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   491
    have g1im: "g1 (2 * x) \<in> g1 ` {0..1} \<inter> g2 ` {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   492
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   493
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   494
      apply (rule_tac x="2 * x" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   495
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   496
    have "x = 0 \<and> y = 1"
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   497
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   498
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   499
      apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   500
      using  g21 [symmetric]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   501
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   502
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   503
   } note ** = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   504
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   505
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   506
    apply (simp add: arc_def simple_path_def path_join, clarify)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   507
    apply (simp add: joinpaths_def split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   508
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   509
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   510
    apply (metis **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   511
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   512
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   513
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   514
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   515
lemma arc_join:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   516
  assumes "arc g1" "arc g2"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   517
          "pathfinish g1 = pathstart g2"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   518
          "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g2}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   519
    shows "arc(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   520
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   521
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   522
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   523
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   524
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   525
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   526
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   527
  have g11: "g1 1 = g2 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   528
   and sb:  "g1 ` {0..1} \<inter> g2 ` {0..1} \<subseteq> {g2 0}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   529
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   530
    by (simp_all add: arc_def pathfinish_def pathstart_def path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   531
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   532
    assume xy: "x \<le> 1" "0 \<le> y" " y * 2 \<le> 1" "\<not> x * 2 \<le> 1" "g2 (2 * x - 1) = g1 (2 * y)"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   533
    have g1im: "g1 (2 * y) \<in> g1 ` {0..1} \<inter> g2 ` {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   534
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   535
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   536
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   537
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   538
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   539
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   540
      by (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   541
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   542
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   543
    apply (simp add: arc_def inj_on_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   544
    apply (clarsimp simp add: arc_imp_path assms path_join)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   545
    apply (simp add: joinpaths_def split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   546
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   547
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   548
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   549
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   550
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   551
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   552
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   553
lemma reversepath_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   554
    "pathfinish g1 = pathstart g2 \<Longrightarrow> reversepath(g1 +++ g2) = reversepath g2 +++ reversepath g1"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   555
  unfolding reversepath_def pathfinish_def pathstart_def joinpaths_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   556
  by (rule ext) (auto simp: mult.commute)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   557
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   558
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   559
subsection\<open>Some reversed and "if and only if" versions of joining theorems\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   560
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   561
lemma path_join_path_ends:
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   562
  fixes g1 :: "real \<Rightarrow> 'a::metric_space"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   563
  assumes "path(g1 +++ g2)" "path g2"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   564
    shows "pathfinish g1 = pathstart g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   565
proof (rule ccontr)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
   566
  define e where "e = dist (g1 1) (g2 0)"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   567
  assume Neg: "pathfinish g1 \<noteq> pathstart g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   568
  then have "0 < dist (pathfinish g1) (pathstart g2)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   569
    by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   570
  then have "e > 0"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   571
    by (metis e_def pathfinish_def pathstart_def)
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   572
  then obtain d1 where "d1 > 0"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   573
       and d1: "\<And>x'. \<lbrakk>x'\<in>{0..1}; norm x' < d1\<rbrakk> \<Longrightarrow> dist (g2 x') (g2 0) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   574
    using assms(2) unfolding path_def continuous_on_iff
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   575
    apply (drule_tac x=0 in bspec, simp)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   576
    by (metis half_gt_zero_iff norm_conv_dist)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   577
  obtain d2 where "d2 > 0"
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   578
       and d2: "\<And>x'. \<lbrakk>x'\<in>{0..1}; dist x' (1/2) < d2\<rbrakk>
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   579
                      \<Longrightarrow> dist ((g1 +++ g2) x') (g1 1) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   580
    using assms(1) \<open>e > 0\<close> unfolding path_def continuous_on_iff
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   581
    apply (drule_tac x="1/2" in bspec, simp)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   582
    apply (drule_tac x="e/2" in spec)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   583
    apply (force simp: joinpaths_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   584
    done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   585
  have int01_1: "min (1/2) (min d1 d2) / 2 \<in> {0..1}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   586
    using \<open>d1 > 0\<close> \<open>d2 > 0\<close> by (simp add: min_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   587
  have dist1: "norm (min (1 / 2) (min d1 d2) / 2) < d1"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   588
    using \<open>d1 > 0\<close> \<open>d2 > 0\<close> by (simp add: min_def dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   589
  have int01_2: "1/2 + min (1/2) (min d1 d2) / 4 \<in> {0..1}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   590
    using \<open>d1 > 0\<close> \<open>d2 > 0\<close> by (simp add: min_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   591
  have dist2: "dist (1 / 2 + min (1 / 2) (min d1 d2) / 4) (1 / 2) < d2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   592
    using \<open>d1 > 0\<close> \<open>d2 > 0\<close> by (simp add: min_def dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   593
  have [simp]: "~ min (1 / 2) (min d1 d2) \<le> 0"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   594
    using \<open>d1 > 0\<close> \<open>d2 > 0\<close> by (simp add: min_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   595
  have "dist (g2 (min (1 / 2) (min d1 d2) / 2)) (g1 1) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   596
       "dist (g2 (min (1 / 2) (min d1 d2) / 2)) (g2 0) < e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   597
    using d1 [OF int01_1 dist1] d2 [OF int01_2 dist2] by (simp_all add: joinpaths_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   598
  then have "dist (g1 1) (g2 0) < e/2 + e/2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   599
    using dist_triangle_half_r e_def by blast
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   600
  then show False
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   601
    by (simp add: e_def [symmetric])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   602
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   603
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   604
lemma path_join_eq [simp]:
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   605
  fixes g1 :: "real \<Rightarrow> 'a::metric_space"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   606
  assumes "path g1" "path g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   607
    shows "path(g1 +++ g2) \<longleftrightarrow> pathfinish g1 = pathstart g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   608
  using assms by (metis path_join_path_ends path_join_imp)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   609
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   610
lemma simple_path_joinE:
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   611
  assumes "simple_path(g1 +++ g2)" and "pathfinish g1 = pathstart g2"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   612
  obtains "arc g1" "arc g2"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   613
          "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g1, pathstart g2}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   614
proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   615
  have *: "\<And>x y. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1; (g1 +++ g2) x = (g1 +++ g2) y\<rbrakk>
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   616
               \<Longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   617
    using assms by (simp add: simple_path_def)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   618
  have "path g1"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   619
    using assms path_join simple_path_imp_path by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   620
  moreover have "inj_on g1 {0..1}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   621
  proof (clarsimp simp: inj_on_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   622
    fix x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   623
    assume "g1 x = g1 y" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   624
    then show "x = y"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   625
      using * [of "x/2" "y/2"] by (simp add: joinpaths_def split_ifs)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   626
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   627
  ultimately have "arc g1"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   628
    using assms  by (simp add: arc_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   629
  have [simp]: "g2 0 = g1 1"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   630
    using assms by (metis pathfinish_def pathstart_def)
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   631
  have "path g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   632
    using assms path_join simple_path_imp_path by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   633
  moreover have "inj_on g2 {0..1}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   634
  proof (clarsimp simp: inj_on_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   635
    fix x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   636
    assume "g2 x = g2 y" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   637
    then show "x = y"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   638
      using * [of "(x + 1) / 2" "(y + 1) / 2"]
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   639
      by (force simp: joinpaths_def split_ifs divide_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   640
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   641
  ultimately have "arc g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   642
    using assms  by (simp add: arc_def)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   643
  have "g2 y = g1 0 \<or> g2 y = g1 1"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   644
       if "g1 x = g2 y" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1" for x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   645
      using * [of "x / 2" "(y + 1) / 2"] that
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   646
      by (auto simp: joinpaths_def split_ifs divide_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   647
  then have "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g1, pathstart g2}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   648
    by (fastforce simp: pathstart_def pathfinish_def path_image_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   649
  with \<open>arc g1\<close> \<open>arc g2\<close> show ?thesis using that by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   650
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   651
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   652
lemma simple_path_join_loop_eq:
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   653
  assumes "pathfinish g2 = pathstart g1" "pathfinish g1 = pathstart g2"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   654
    shows "simple_path(g1 +++ g2) \<longleftrightarrow>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   655
             arc g1 \<and> arc g2 \<and> path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g1, pathstart g2}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   656
by (metis assms simple_path_joinE simple_path_join_loop)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   657
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   658
lemma arc_join_eq:
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   659
  assumes "pathfinish g1 = pathstart g2"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   660
    shows "arc(g1 +++ g2) \<longleftrightarrow>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   661
           arc g1 \<and> arc g2 \<and> path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g2}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   662
           (is "?lhs = ?rhs")
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   663
proof
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   664
  assume ?lhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   665
  then have "simple_path(g1 +++ g2)" by (rule arc_imp_simple_path)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   666
  then have *: "\<And>x y. \<lbrakk>0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1; (g1 +++ g2) x = (g1 +++ g2) y\<rbrakk>
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   667
               \<Longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   668
    using assms by (simp add: simple_path_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   669
  have False if "g1 0 = g2 u" "0 \<le> u" "u \<le> 1" for u
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   670
    using * [of 0 "(u + 1) / 2"] that assms arc_distinct_ends [OF \<open>?lhs\<close>]
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   671
    by (auto simp: joinpaths_def pathstart_def pathfinish_def split_ifs divide_simps)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   672
  then have n1: "~ (pathstart g1 \<in> path_image g2)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   673
    unfolding pathstart_def path_image_def
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   674
    using atLeastAtMost_iff by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   675
  show ?rhs using \<open>?lhs\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   676
    apply (rule simple_path_joinE [OF arc_imp_simple_path assms])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   677
    using n1 by force
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   678
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   679
  assume ?rhs then show ?lhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   680
    using assms
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   681
    by (fastforce simp: pathfinish_def pathstart_def intro!: arc_join)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   682
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   683
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   684
lemma arc_join_eq_alt:
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   685
        "pathfinish g1 = pathstart g2
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   686
        \<Longrightarrow> (arc(g1 +++ g2) \<longleftrightarrow>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   687
             arc g1 \<and> arc g2 \<and>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   688
             path_image g1 \<inter> path_image g2 = {pathstart g2})"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   689
using pathfinish_in_path_image by (fastforce simp: arc_join_eq)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   690
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   691
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   692
subsection\<open>The joining of paths is associative\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   693
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   694
lemma path_assoc:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   695
    "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart r\<rbrakk>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   696
     \<Longrightarrow> path(p +++ (q +++ r)) \<longleftrightarrow> path((p +++ q) +++ r)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   697
by simp
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   698
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   699
lemma simple_path_assoc:
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   700
  assumes "pathfinish p = pathstart q" "pathfinish q = pathstart r"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   701
    shows "simple_path (p +++ (q +++ r)) \<longleftrightarrow> simple_path ((p +++ q) +++ r)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   702
proof (cases "pathstart p = pathfinish r")
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   703
  case True show ?thesis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   704
  proof
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   705
    assume "simple_path (p +++ q +++ r)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   706
    with assms True show "simple_path ((p +++ q) +++ r)"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   707
      by (fastforce simp add: simple_path_join_loop_eq arc_join_eq path_image_join
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   708
                    dest: arc_distinct_ends [of r])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   709
  next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   710
    assume 0: "simple_path ((p +++ q) +++ r)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   711
    with assms True have q: "pathfinish r \<notin> path_image q"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   712
      using arc_distinct_ends
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   713
      by (fastforce simp add: simple_path_join_loop_eq arc_join_eq path_image_join)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   714
    have "pathstart r \<notin> path_image p"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   715
      using assms
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   716
      by (metis 0 IntI arc_distinct_ends arc_join_eq_alt empty_iff insert_iff
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   717
              pathfinish_in_path_image pathfinish_join simple_path_joinE)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   718
    with assms 0 q True show "simple_path (p +++ q +++ r)"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   719
      by (auto simp: simple_path_join_loop_eq arc_join_eq path_image_join
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   720
               dest!: subsetD [OF _ IntI])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   721
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   722
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   723
  case False
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   724
  { fix x :: 'a
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   725
    assume a: "path_image p \<inter> path_image q \<subseteq> {pathstart q}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   726
              "(path_image p \<union> path_image q) \<inter> path_image r \<subseteq> {pathstart r}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   727
              "x \<in> path_image p" "x \<in> path_image r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   728
    have "pathstart r \<in> path_image q"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   729
      by (metis assms(2) pathfinish_in_path_image)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   730
    with a have "x = pathstart q"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   731
      by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   732
  }
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   733
  with False assms show ?thesis
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   734
    by (auto simp: simple_path_eq_arc simple_path_join_loop_eq arc_join_eq path_image_join)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   735
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   736
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   737
lemma arc_assoc:
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   738
     "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart r\<rbrakk>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   739
      \<Longrightarrow> arc(p +++ (q +++ r)) \<longleftrightarrow> arc((p +++ q) +++ r)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   740
by (simp add: arc_simple_path simple_path_assoc)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   741
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   742
subsubsection\<open>Symmetry and loops\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   743
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   744
lemma path_sym:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   745
    "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart p\<rbrakk> \<Longrightarrow> path(p +++ q) \<longleftrightarrow> path(q +++ p)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   746
  by auto
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   747
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   748
lemma simple_path_sym:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   749
    "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart p\<rbrakk>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   750
     \<Longrightarrow> simple_path(p +++ q) \<longleftrightarrow> simple_path(q +++ p)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   751
by (metis (full_types) inf_commute insert_commute simple_path_joinE simple_path_join_loop)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   752
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   753
lemma path_image_sym:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   754
    "\<lbrakk>pathfinish p = pathstart q; pathfinish q = pathstart p\<rbrakk>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   755
     \<Longrightarrow> path_image(p +++ q) = path_image(q +++ p)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   756
by (simp add: path_image_join sup_commute)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   757
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   758
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   759
section\<open>Choosing a subpath of an existing path\<close>
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   760
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   761
definition subpath :: "real \<Rightarrow> real \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   762
  where "subpath a b g \<equiv> \<lambda>x. g((b - a) * x + a)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   763
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   764
lemma path_image_subpath_gen:
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   765
  fixes g :: "_ \<Rightarrow> 'a::real_normed_vector"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   766
  shows "path_image(subpath u v g) = g ` (closed_segment u v)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   767
  apply (simp add: closed_segment_real_eq path_image_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   768
  apply (subst o_def [of g, symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   769
  apply (simp add: image_comp [symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   770
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   771
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   772
lemma path_image_subpath:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   773
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   774
  shows "path_image(subpath u v g) = (if u \<le> v then g ` {u..v} else g ` {v..u})"
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   775
  by (simp add: path_image_subpath_gen closed_segment_eq_real_ivl)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   776
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   777
lemma path_subpath [simp]:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   778
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   779
  assumes "path g" "u \<in> {0..1}" "v \<in> {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   780
    shows "path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   781
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   782
  have "continuous_on {0..1} (g o (\<lambda>x. ((v-u) * x+ u)))"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   783
    apply (rule continuous_intros | simp)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   784
    apply (simp add: image_affinity_atLeastAtMost [where c=u])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   785
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   786
    apply (auto simp: path_def continuous_on_subset)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   787
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   788
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   789
    by (simp add: path_def subpath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   790
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   791
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   792
lemma pathstart_subpath [simp]: "pathstart(subpath u v g) = g(u)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   793
  by (simp add: pathstart_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   794
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   795
lemma pathfinish_subpath [simp]: "pathfinish(subpath u v g) = g(v)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   796
  by (simp add: pathfinish_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   797
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   798
lemma subpath_trivial [simp]: "subpath 0 1 g = g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   799
  by (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   800
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   801
lemma subpath_reversepath: "subpath 1 0 g = reversepath g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   802
  by (simp add: reversepath_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   803
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   804
lemma reversepath_subpath: "reversepath(subpath u v g) = subpath v u g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   805
  by (simp add: reversepath_def subpath_def algebra_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   806
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   807
lemma subpath_translation: "subpath u v ((\<lambda>x. a + x) o g) = (\<lambda>x. a + x) o subpath u v g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   808
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   809
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   810
lemma subpath_linear_image: "linear f \<Longrightarrow> subpath u v (f o g) = f o subpath u v g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   811
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   812
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   813
lemma affine_ineq:
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   814
  fixes x :: "'a::linordered_idom"
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   815
  assumes "x \<le> 1" "v \<le> u"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   816
    shows "v + x * u \<le> u + x * v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   817
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   818
  have "(1-x)*(u-v) \<ge> 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   819
    using assms by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   820
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   821
    by (simp add: algebra_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   822
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   823
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
   824
lemma sum_le_prod1:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
   825
  fixes a::real shows "\<lbrakk>a \<le> 1; b \<le> 1\<rbrakk> \<Longrightarrow> a + b \<le> 1 + a * b"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
   826
by (metis add.commute affine_ineq less_eq_real_def mult.right_neutral)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
   827
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   828
lemma simple_path_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   829
  "simple_path(subpath u v g) \<longleftrightarrow>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   830
     path(subpath u v g) \<and> u\<noteq>v \<and>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   831
     (\<forall>x y. x \<in> closed_segment u v \<and> y \<in> closed_segment u v \<and> g x = g y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   832
                \<longrightarrow> x = y \<or> x = u \<and> y = v \<or> x = v \<and> y = u)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   833
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   834
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   835
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   836
  then have p: "path (\<lambda>x. g ((v - u) * x + u))"
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   837
        and sim: "(\<And>x y. \<lbrakk>x\<in>{0..1}; y\<in>{0..1}; g ((v - u) * x + u) = g ((v - u) * y + u)\<rbrakk>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   838
                  \<Longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   839
    by (auto simp: simple_path_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   840
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   841
    assume "x \<in> closed_segment u v" "y \<in> closed_segment u v" "g x = g y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   842
    then have "x = y \<or> x = u \<and> y = v \<or> x = v \<and> y = u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   843
    using sim [of "(x-u)/(v-u)" "(y-u)/(v-u)"] p
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   844
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost divide_simps
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   845
       split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   846
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   847
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   848
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   849
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   850
  ultimately show ?rhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   851
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   852
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   853
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   854
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   855
  have d1: "\<And>x y. \<lbrakk>g x = g y; u \<le> x; x \<le> v; u \<le> y; y \<le> v\<rbrakk> \<Longrightarrow> x = y \<or> x = u \<and> y = v \<or> x = v \<and> y = u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   856
   and d2: "\<And>x y. \<lbrakk>g x = g y; v \<le> x; x \<le> u; v \<le> y; y \<le> u\<rbrakk> \<Longrightarrow> x = y \<or> x = u \<and> y = v \<or> x = v \<and> y = u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   857
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   858
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   859
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   860
  have [simp]: "\<And>x. u + x * v = v + x * u \<longleftrightarrow> u=v \<or> x=1"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   861
    by algebra
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   862
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   863
    unfolding simple_path_def subpath_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   864
    by (fastforce simp add: algebra_simps affine_ineq mult_left_mono crossproduct_eq dest: d1 d2)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   865
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   866
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   867
lemma arc_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   868
  "arc(subpath u v g) \<longleftrightarrow> path(subpath u v g) \<and> u\<noteq>v \<and> inj_on g (closed_segment u v)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   869
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   870
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   871
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   872
  then have p: "path (\<lambda>x. g ((v - u) * x + u))"
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   873
        and sim: "(\<And>x y. \<lbrakk>x\<in>{0..1}; y\<in>{0..1}; g ((v - u) * x + u) = g ((v - u) * y + u)\<rbrakk>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   874
                  \<Longrightarrow> x = y)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   875
    by (auto simp: arc_def inj_on_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   876
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   877
    assume "x \<in> closed_segment u v" "y \<in> closed_segment u v" "g x = g y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   878
    then have "x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   879
    using sim [of "(x-u)/(v-u)" "(y-u)/(v-u)"] p
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   880
    by (force simp add: inj_on_def closed_segment_real_eq image_affinity_atLeastAtMost divide_simps
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   881
       split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   882
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   883
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   884
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   885
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   886
  ultimately show ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   887
    unfolding inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   888
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   889
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   890
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   891
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   892
  have d1: "\<And>x y. \<lbrakk>g x = g y; u \<le> x; x \<le> v; u \<le> y; y \<le> v\<rbrakk> \<Longrightarrow> x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   893
   and d2: "\<And>x y. \<lbrakk>g x = g y; v \<le> x; x \<le> u; v \<le> y; y \<le> u\<rbrakk> \<Longrightarrow> x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   894
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   895
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   896
    by (auto simp: inj_on_def closed_segment_real_eq image_affinity_atLeastAtMost)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   897
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   898
    unfolding arc_def subpath_def inj_on_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   899
    by (auto simp: algebra_simps affine_ineq mult_left_mono crossproduct_eq dest: d1 d2)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   900
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   901
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   902
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   903
lemma simple_path_subpath:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   904
  assumes "simple_path g" "u \<in> {0..1}" "v \<in> {0..1}" "u \<noteq> v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   905
  shows "simple_path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   906
  using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   907
  apply (simp add: simple_path_subpath_eq simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   908
  apply (simp add: simple_path_def closed_segment_real_eq image_affinity_atLeastAtMost, fastforce)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   909
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   910
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   911
lemma arc_simple_path_subpath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   912
    "\<lbrakk>simple_path g; u \<in> {0..1}; v \<in> {0..1}; g u \<noteq> g v\<rbrakk> \<Longrightarrow> arc(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   913
  by (force intro: simple_path_subpath simple_path_imp_arc)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   914
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   915
lemma arc_subpath_arc:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   916
    "\<lbrakk>arc g; u \<in> {0..1}; v \<in> {0..1}; u \<noteq> v\<rbrakk> \<Longrightarrow> arc(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   917
  by (meson arc_def arc_imp_simple_path arc_simple_path_subpath inj_onD)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   918
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   919
lemma arc_simple_path_subpath_interior:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   920
    "\<lbrakk>simple_path g; u \<in> {0..1}; v \<in> {0..1}; u \<noteq> v; \<bar>u-v\<bar> < 1\<rbrakk> \<Longrightarrow> arc(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   921
    apply (rule arc_simple_path_subpath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   922
    apply (force simp: simple_path_def)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   923
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   924
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   925
lemma path_image_subpath_subset:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   926
    "\<lbrakk>path g; u \<in> {0..1}; v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image(subpath u v g) \<subseteq> path_image g"
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
   927
  apply (simp add: closed_segment_real_eq image_affinity_atLeastAtMost path_image_subpath)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   928
  apply (auto simp: path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   929
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   930
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   931
lemma join_subpaths_middle: "subpath (0) ((1 / 2)) p +++ subpath ((1 / 2)) 1 p = p"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   932
  by (rule ext) (simp add: joinpaths_def subpath_def divide_simps)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   933
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   934
subsection\<open>There is a subpath to the frontier\<close>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   935
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   936
lemma subpath_to_frontier_explicit:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   937
    fixes S :: "'a::metric_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   938
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   939
    obtains u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   940
                "\<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   941
                "(g u \<notin> interior S)" "(u = 0 \<or> g u \<in> closure S)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   942
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   943
  have gcon: "continuous_on {0..1} g"     using g by (simp add: path_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   944
  then have com: "compact ({0..1} \<inter> {u. g u \<in> closure (- S)})"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   945
    apply (simp add: Int_commute [of "{0..1}"] compact_eq_bounded_closed closed_vimage_Int [unfolded vimage_def])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   946
    using compact_eq_bounded_closed apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   947
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   948
  have "1 \<in> {u. g u \<in> closure (- S)}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   949
    using assms by (simp add: pathfinish_def closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   950
  then have dis: "{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   951
    using atLeastAtMost_iff zero_le_one by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   952
  then obtain u where "0 \<le> u" "u \<le> 1" and gu: "g u \<in> closure (- S)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   953
                  and umin: "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; g t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   954
    using compact_attains_inf [OF com dis] by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   955
  then have umin': "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; t < u\<rbrakk> \<Longrightarrow>  g t \<in> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   956
    using closure_def by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   957
  { assume "u \<noteq> 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   958
    then have "u > 0" using \<open>0 \<le> u\<close> by auto
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   959
    { fix e::real assume "e > 0"
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
   960
      obtain d where "d>0" and d: "\<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u \<le> d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e"
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
   961
        using continuous_onE [OF gcon _ \<open>e > 0\<close>] \<open>0 \<le> _\<close> \<open>_ \<le> 1\<close> atLeastAtMost_iff by auto
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
   962
      have *: "dist (max 0 (u - d / 2)) u \<le> d"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   963
        using \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close> by (simp add: dist_real_def)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   964
      have "\<exists>y\<in>S. dist y (g u) < e"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   965
        using \<open>0 < u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close>
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   966
        by (force intro: d [OF _ *] umin')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   967
    }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   968
    then have "g u \<in> closure S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   969
      by (simp add: frontier_def closure_approachable)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   970
  }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   971
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   972
    apply (rule_tac u=u in that)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   973
    apply (auto simp: \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> gu interior_closure umin)
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   974
    using \<open>_ \<le> 1\<close> interior_closure umin apply fastforce
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   975
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   976
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   977
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   978
lemma subpath_to_frontier_strong:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   979
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   980
    obtains u where "0 \<le> u" "u \<le> 1" "g u \<notin> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   981
                    "u = 0 \<or> (\<forall>x. 0 \<le> x \<and> x < 1 \<longrightarrow> subpath 0 u g x \<in> interior S)  \<and>  g u \<in> closure S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   982
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   983
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   984
             and gxin: "\<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   985
             and gunot: "(g u \<notin> interior S)" and u0: "(u = 0 \<or> g u \<in> closure S)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   986
    using subpath_to_frontier_explicit [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   987
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   988
    apply (rule that [OF \<open>0 \<le> u\<close> \<open>u \<le> 1\<close>])
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   989
    apply (simp add: gunot)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   990
    using \<open>0 \<le> u\<close> u0 by (force simp: subpath_def gxin)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   991
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   992
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   993
lemma subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   994
    assumes g: "path g" and g0: "pathstart g \<in> closure S" and g1: "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   995
    obtains u where "0 \<le> u" "u \<le> 1" "g u \<in> frontier S" "(path_image(subpath 0 u g) - {g u}) \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   996
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   997
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   998
             and notin: "g u \<notin> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   999
             and disj: "u = 0 \<or>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1000
                        (\<forall>x. 0 \<le> x \<and> x < 1 \<longrightarrow> subpath 0 u g x \<in> interior S) \<and> g u \<in> closure S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1001
    using subpath_to_frontier_strong [OF g g1] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1002
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1003
    apply (rule that [OF \<open>0 \<le> u\<close> \<open>u \<le> 1\<close>])
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1004
    apply (metis DiffI disj frontier_def g0 notin pathstart_def)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1005
    using \<open>0 \<le> u\<close> g0 disj
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1006
    apply (simp add: path_image_subpath_gen)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1007
    apply (auto simp: closed_segment_eq_real_ivl pathstart_def pathfinish_def subpath_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1008
    apply (rename_tac y)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1009
    apply (drule_tac x="y/u" in spec)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
  1010
    apply (auto split: if_split_asm)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1011
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1012
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1013
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1014
lemma exists_path_subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1015
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1016
    assumes "path g" "pathstart g \<in> closure S" "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1017
    obtains h where "path h" "pathstart h = pathstart g" "path_image h \<subseteq> path_image g"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1018
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1019
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1020
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1021
  obtain u where u: "0 \<le> u" "u \<le> 1" "g u \<in> frontier S" "(path_image(subpath 0 u g) - {g u}) \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1022
    using subpath_to_frontier [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1023
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1024
    apply (rule that [of "subpath 0 u g"])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1025
    using assms u
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1026
    apply (simp_all add: path_image_subpath)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1027
    apply (simp add: pathstart_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1028
    apply (force simp: closed_segment_eq_real_ivl path_image_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1029
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1030
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1031
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1032
lemma exists_path_subpath_to_frontier_closed:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1033
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1034
    assumes S: "closed S" and g: "path g" and g0: "pathstart g \<in> S" and g1: "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1035
    obtains h where "path h" "pathstart h = pathstart g" "path_image h \<subseteq> path_image g \<inter> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1036
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1037
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1038
  obtain h where h: "path h" "pathstart h = pathstart g" "path_image h \<subseteq> path_image g"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1039
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1040
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1041
    using exists_path_subpath_to_frontier [OF g _ g1] closure_closed [OF S] g0 by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1042
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1043
    apply (rule that [OF \<open>path h\<close>])
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1044
    using assms h
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1045
    apply auto
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 61808
diff changeset
  1046
    apply (metis Diff_single_insert frontier_subset_eq insert_iff interior_subset subset_iff)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1047
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1048
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1049
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1050
subsection \<open>Reparametrizing a closed curve to start at some chosen point\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1051
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1052
definition shiftpath :: "real \<Rightarrow> (real \<Rightarrow> 'a::topological_space) \<Rightarrow> real \<Rightarrow> 'a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1053
  where "shiftpath a f = (\<lambda>x. if (a + x) \<le> 1 then f (a + x) else f (a + x - 1))"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1054
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1055
lemma pathstart_shiftpath: "a \<le> 1 \<Longrightarrow> pathstart (shiftpath a g) = g a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1056
  unfolding pathstart_def shiftpath_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1057
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1058
lemma pathfinish_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1059
  assumes "0 \<le> a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1060
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1061
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1062
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1063
  unfolding pathstart_def pathfinish_def shiftpath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1064
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1065
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1066
lemma endpoints_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1067
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1068
    and "a \<in> {0 .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1069
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1070
    and "pathstart (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1071
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1072
  by (auto intro!: pathfinish_shiftpath pathstart_shiftpath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1073
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1074
lemma closed_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1075
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1076
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1077
  shows "pathfinish (shiftpath a g) = pathstart (shiftpath a g)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1078
  using endpoints_shiftpath[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1079
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1080
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1081
lemma path_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1082
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1083
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1084
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1085
  shows "path (shiftpath a g)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1086
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1087
  have *: "{0 .. 1} = {0 .. 1-a} \<union> {1-a .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1088
    using assms(3) by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1089
  have **: "\<And>x. x + a = 1 \<Longrightarrow> g (x + a - 1) = g (x + a)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1090
    using assms(2)[unfolded pathfinish_def pathstart_def]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1091
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1092
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1093
    unfolding path_def shiftpath_def *
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
  1094
    apply (rule continuous_on_closed_Un)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1095
    apply (rule closed_real_atLeastAtMost)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1096
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1097
    prefer 3
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1098
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a - 1 + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1099
    prefer 3
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1100
    apply (rule continuous_intros)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1101
    prefer 2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1102
    apply (rule continuous_intros)+
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1103
    apply (rule_tac[1-2] continuous_on_subset[OF assms(1)[unfolded path_def]])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1104
    using assms(3) and **
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1105
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1106
    apply (auto simp add: field_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1107
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1108
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1109
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1110
lemma shiftpath_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1111
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1112
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1113
    and "x \<in> {0..1}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1114
  shows "shiftpath (1 - a) (shiftpath a g) x = g x"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1115
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1116
  unfolding pathfinish_def pathstart_def shiftpath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1117
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1118
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1119
lemma path_image_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1120
  assumes "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1121
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1122
  shows "path_image (shiftpath a g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1123
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1124
  { fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1125
    assume as: "g 1 = g 0" "x \<in> {0..1::real}" " \<forall>y\<in>{0..1} \<inter> {x. \<not> a + x \<le> 1}. g x \<noteq> g (a + y - 1)"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1126
    then have "\<exists>y\<in>{0..1} \<inter> {x. a + x \<le> 1}. g x = g (a + y)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1127
    proof (cases "a \<le> x")
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1128
      case False
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1129
      then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1130
        apply (rule_tac x="1 + x - a" in bexI)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1131
        using as(1,2) and as(3)[THEN bspec[where x="1 + x - a"]] and assms(1)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1132
        apply (auto simp add: field_simps atomize_not)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1133
        done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1134
    next
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1135
      case True
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1136
      then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1137
        using as(1-2) and assms(1)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1138
        apply (rule_tac x="x - a" in bexI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1139
        apply (auto simp add: field_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1140
        done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1141
    qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1142
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1143
  then show ?thesis
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1144
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1145
    unfolding shiftpath_def path_image_def pathfinish_def pathstart_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1146
    by (auto simp add: image_iff)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1147
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1148
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1149
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1150
subsection \<open>Special case of straight-line paths\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1151
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1152
definition linepath :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> real \<Rightarrow> 'a"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1153
  where "linepath a b = (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1154
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1155
lemma pathstart_linepath[simp]: "pathstart (linepath a b) = a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1156
  unfolding pathstart_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1157
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1158
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1159
lemma pathfinish_linepath[simp]: "pathfinish (linepath a b) = b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1160
  unfolding pathfinish_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1161
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1162
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1163
lemma continuous_linepath_at[intro]: "continuous (at x) (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1164
  unfolding linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1165
  by (intro continuous_intros)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1166
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1167
lemma continuous_on_linepath [intro,continuous_intros]: "continuous_on s (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1168
  using continuous_linepath_at
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1169
  by (auto intro!: continuous_at_imp_continuous_on)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1170
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1171
lemma path_linepath[iff]: "path (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1172
  unfolding path_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1173
  by (rule continuous_on_linepath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1174
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1175
lemma path_image_linepath[simp]: "path_image (linepath a b) = closed_segment a b"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1176
  unfolding path_image_def segment linepath_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1177
  by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1178
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1179
lemma reversepath_linepath[simp]: "reversepath (linepath a b) = linepath b a"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1180
  unfolding reversepath_def linepath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1181
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1182
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1183
lemma linepath_0 [simp]: "linepath 0 b x = x *\<^sub>R b"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1184
  by (simp add: linepath_def)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1185
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1186
lemma arc_linepath:
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1187
  assumes "a \<noteq> b" shows [simp]: "arc (linepath a b)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1188
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1189
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1190
    fix x y :: "real"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1191
    assume "x *\<^sub>R b + y *\<^sub>R a = x *\<^sub>R a + y *\<^sub>R b"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1192
    then have "(x - y) *\<^sub>R a = (x - y) *\<^sub>R b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1193
      by (simp add: algebra_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1194
    with assms have "x = y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1195
      by simp
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1196
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1197
  then show ?thesis
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
  1198
    unfolding arc_def inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1199
    by (simp add:  path_linepath) (force simp: algebra_simps linepath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1200
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1201
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1202
lemma simple_path_linepath[intro]: "a \<noteq> b \<Longrightarrow> simple_path (linepath a b)"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1203
  by (simp add: arc_imp_simple_path arc_linepath)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1204
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1205
lemma linepath_trivial [simp]: "linepath a a x = a"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1206
  by (simp add: linepath_def real_vector.scale_left_diff_distrib)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  1207
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1208
lemma subpath_refl: "subpath a a g = linepath (g a) (g a)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1209
  by (simp add: subpath_def linepath_def algebra_simps)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1210
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1211
lemma linepath_of_real: "(linepath (of_real a) (of_real b) x) = of_real ((1 - x)*a + x*b)"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1212
  by (simp add: scaleR_conv_of_real linepath_def)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1213
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1214
lemma of_real_linepath: "of_real (linepath a b x) = linepath (of_real a) (of_real b) x"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1215
  by (metis linepath_of_real mult.right_neutral of_real_def real_scaleR_def)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1216
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1217
lemma inj_on_linepath:
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1218
  assumes "a \<noteq> b" shows "inj_on (linepath a b) {0..1}"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1219
proof (clarsimp simp: inj_on_def linepath_def)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1220
  fix x y
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1221
  assume "(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1222
  then have "x *\<^sub>R (a - b) = y *\<^sub>R (a - b)"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1223
    by (auto simp: algebra_simps)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1224
  then show "x=y"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1225
    using assms by auto
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1226
qed
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1227
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1228
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1229
subsection\<open>Segments via convex hulls\<close>
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1230
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1231
lemma segments_subset_convex_hull:
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1232
    "closed_segment a b \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1233
    "closed_segment a c \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1234
    "closed_segment b c \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1235
    "closed_segment b a \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1236
    "closed_segment c a \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1237
    "closed_segment c b \<subseteq> (convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1238
by (auto simp: segment_convex_hull linepath_of_real  elim!: rev_subsetD [OF _ hull_mono])
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1239
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1240
lemma midpoints_in_convex_hull:
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1241
  assumes "x \<in> convex hull s" "y \<in> convex hull s"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1242
    shows "midpoint x y \<in> convex hull s"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1243
proof -
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1244
  have "(1 - inverse(2)) *\<^sub>R x + inverse(2) *\<^sub>R y \<in> convex hull s"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1245
    apply (rule convexD_alt)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1246
    using assms
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1247
    apply (auto simp: convex_convex_hull)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1248
    done
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1249
  then show ?thesis
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1250
    by (simp add: midpoint_def algebra_simps)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1251
qed
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1252
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1253
lemma not_in_interior_convex_hull_3:
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1254
  fixes a :: "complex"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1255
  shows "a \<notin> interior(convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1256
        "b \<notin> interior(convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1257
        "c \<notin> interior(convex hull {a,b,c})"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1258
  by (auto simp: card_insert_le_m1 not_in_interior_convex_hull)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1259
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1260
lemma midpoint_in_closed_segment [simp]: "midpoint a b \<in> closed_segment a b"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1261
  using midpoints_in_convex_hull segment_convex_hull by blast
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1262
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1263
lemma midpoint_in_open_segment [simp]: "midpoint a b \<in> open_segment a b \<longleftrightarrow> a \<noteq> b"
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1264
  by (simp add: midpoint_eq_endpoint(1) midpoint_eq_endpoint(2) open_segment_def)
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1265
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1266
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1267
subsection \<open>Bounding a point away from a path\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1268
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1269
lemma not_on_path_ball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1270
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1271
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1272
    and "z \<notin> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1273
  shows "\<exists>e > 0. ball z e \<inter> path_image g = {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1274
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1275
  obtain a where "a \<in> path_image g" "\<forall>y \<in> path_image g. dist z a \<le> dist z y"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  1276
    apply (rule distance_attains_inf[OF _ path_image_nonempty, of g z])
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1277
    using compact_path_image[THEN compact_imp_closed, OF assms(1)] by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1278
  then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1279
    apply (rule_tac x="dist z a" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1280
    using assms(2)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1281
    apply (auto intro!: dist_pos_lt)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1282
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1283
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1284
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1285
lemma not_on_path_cball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1286
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1287
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1288
    and "z \<notin> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1289
  shows "\<exists>e>0. cball z e \<inter> (path_image g) = {}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1290
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1291
  obtain e where "ball z e \<inter> path_image g = {}" "e > 0"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1292
    using not_on_path_ball[OF assms] by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1293
  moreover have "cball z (e/2) \<subseteq> ball z e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1294
    using \<open>e > 0\<close> by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1295
  ultimately show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1296
    apply (rule_tac x="e/2" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1297
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1298
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1299
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1300
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1301
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1302
section \<open>Path component, considered as a "joinability" relation (from Tom Hales)\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1303
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1304
definition "path_component s x y \<longleftrightarrow>
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1305
  (\<exists>g. path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1306
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1307
abbreviation
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1308
   "path_component_set s x \<equiv> Collect (path_component s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1309
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1310
lemmas path_defs = path_def pathstart_def pathfinish_def path_image_def path_component_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1311
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1312
lemma path_component_mem:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1313
  assumes "path_component s x y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1314
  shows "x \<in> s" and "y \<in> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1315
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1316
  unfolding path_defs
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1317
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1318
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1319
lemma path_component_refl:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1320
  assumes "x \<in> s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1321
  shows "path_component s x x"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1322
  unfolding path_defs
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1323
  apply (rule_tac x="\<lambda>u. x" in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1324
  using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1325
  apply (auto intro!: continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1326
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1327
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1328
lemma path_component_refl_eq: "path_component s x x \<longleftrightarrow> x \<in> s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1329
  by (auto intro!: path_component_mem path_component_refl)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1330
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1331
lemma path_component_sym: "path_component s x y \<Longrightarrow> path_component s y x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1332
  unfolding path_component_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1333
  apply (erule exE)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1334
  apply (rule_tac x="reversepath g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1335
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1336
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1337
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1338
lemma path_component_trans:
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1339
  assumes "path_component s x y" and "path_component s y z"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1340
  shows "path_component s x z"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1341
  using assms
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1342
  unfolding path_component_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1343
  apply (elim exE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1344
  apply (rule_tac x="g +++ ga" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1345
  apply (auto simp add: path_image_join)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1346
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1347
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1348
lemma path_component_of_subset: "s \<subseteq> t \<Longrightarrow> path_component s x y \<Longrightarrow> path_component t x y"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1349
  unfolding path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1350
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1351
lemma path_connected_linepath:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1352
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1353
    shows "closed_segment a b \<subseteq> s \<Longrightarrow> path_component s a b"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1354
  apply (simp add: path_component_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1355
  apply (rule_tac x="linepath a b" in exI, auto)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1356
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1357
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1358
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1359
subsubsection \<open>Path components as sets\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1360
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1361
lemma path_component_set:
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1362
  "path_component_set s x =
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1363
    {y. (\<exists>g. path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)}"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1364
  by (auto simp: path_component_def)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1365
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1366
lemma path_component_subset: "path_component_set s x \<subseteq> s"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1367
  by (auto simp add: path_component_mem(2))
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1368
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1369
lemma path_component_eq_empty: "path_component_set s x = {} \<longleftrightarrow> x \<notin> s"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1370
  using path_component_mem path_component_refl_eq
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1371
    by fastforce
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1372
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1373
lemma path_component_mono:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1374
     "s \<subseteq> t \<Longrightarrow> (path_component_set s x) \<subseteq> (path_component_set t x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1375
  by (simp add: Collect_mono path_component_of_subset)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1376
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1377
lemma path_component_eq:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1378
   "y \<in> path_component_set s x \<Longrightarrow> path_component_set s y = path_component_set s x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1379
by (metis (no_types, lifting) Collect_cong mem_Collect_eq path_component_sym path_component_trans)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1380
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1381
subsection \<open>Path connectedness of a space\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1382
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1383
definition "path_connected s \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1384
  (\<forall>x\<in>s. \<forall>y\<in>s. \<exists>g. path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1385
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1386
lemma path_connected_component: "path_connected s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. path_component s x y)"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1387
  unfolding path_connected_def path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1388
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1389
lemma path_connected_component_set: "path_connected s \<longleftrightarrow> (\<forall>x\<in>s. path_component_set s x = s)"
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  1390
  unfolding path_connected_component path_component_subset
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1391
  using path_component_mem by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1392
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1393
lemma path_component_maximal:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1394
     "\<lbrakk>x \<in> t; path_connected t; t \<subseteq> s\<rbrakk> \<Longrightarrow> t \<subseteq> (path_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1395
  by (metis path_component_mono path_connected_component_set)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1396
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1397
lemma convex_imp_path_connected:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1398
  fixes s :: "'a::real_normed_vector set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1399
  assumes "convex s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1400
  shows "path_connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1401
  unfolding path_connected_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1402
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1403
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1404
  apply (rule_tac x = "linepath x y" in exI)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1405
  unfolding path_image_linepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1406
  using assms [unfolded convex_contains_segment]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1407
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1408
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1409
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1410
lemma path_connected_UNIV [iff]: "path_connected (UNIV :: 'a::real_normed_vector set)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1411
  by (simp add: convex_imp_path_connected)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1412
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1413
lemma path_component_UNIV: "path_component_set UNIV x = (UNIV :: 'a::real_normed_vector set)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1414
  using path_connected_component_set by auto
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1415
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1416
lemma path_connected_imp_connected:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1417
  assumes "path_connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1418
  shows "connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1419
  unfolding connected_def not_ex
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1420
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1421
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1422
  apply (rule ccontr)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1423
  unfolding not_not
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1424
  apply (elim conjE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1425
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1426
  fix e1 e2
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1427
  assume as: "open e1" "open e2" "s \<subseteq> e1 \<union> e2" "e1 \<inter> e2 \<inter> s = {}" "e1 \<inter> s \<noteq> {}" "e2 \<inter> s \<noteq> {}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1428
  then obtain x1 x2 where obt:"x1 \<in> e1 \<inter> s" "x2 \<in> e2 \<inter> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1429
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1430
  then obtain g where g: "path g" "path_image g \<subseteq> s" "pathstart g = x1" "pathfinish g = x2"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1431
    using assms[unfolded path_connected_def,rule_format,of x1 x2] by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1432
  have *: "connected {0..1::real}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1433
    by (auto intro!: convex_connected convex_real_interval)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1434
  have "{0..1} \<subseteq> {x \<in> {0..1}. g x \<in> e1} \<union> {x \<in> {0..1}. g x \<in> e2}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1435
    using as(3) g(2)[unfolded path_defs] by blast
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1436
  moreover have "{x \<in> {0..1}. g x \<in> e1} \<inter> {x \<in> {0..1}. g x \<in> e2} = {}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1437
    using as(4) g(2)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1438
    unfolding subset_eq
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1439
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1440
  moreover have "{x \<in> {0..1}. g x \<in> e1} \<noteq> {} \<and> {x \<in> {0..1}. g x \<in> e2} \<noteq> {}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1441
    using g(3,4)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1442
    using obt
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1443
    by (simp add: ex_in_conv [symmetric], metis zero_le_one order_refl)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1444
  ultimately show False
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1445
    using *[unfolded connected_local not_ex, rule_format,
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1446
      of "{x\<in>{0..1}. g x \<in> e1}" "{x\<in>{0..1}. g x \<in> e2}"]
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  1447
    using continuous_openin_preimage_gen[OF g(1)[unfolded path_def] as(1)]
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  1448
    using continuous_openin_preimage_gen[OF g(1)[unfolded path_def] as(2)]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1449
    by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1450
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1451
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1452
lemma open_path_component:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1453
  fixes s :: "'a::real_normed_vector set"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1454
  assumes "open s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1455
  shows "open (path_component_set s x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1456
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1457
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1458
  fix y
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1459
  assume as: "y \<in> path_component_set s x"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1460
  then have "y \<in> s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1461
    apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1462
    apply (rule path_component_mem(2))
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1463
    unfolding mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1464
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1465
    done
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1466
  then obtain e where e: "e > 0" "ball y e \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1467
    using assms[unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1468
    by auto
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1469
  show "\<exists>e > 0. ball y e \<subseteq> path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1470
    apply (rule_tac x=e in exI)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1471
    apply (rule,rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1472
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1473
    unfolding mem_ball mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1474
  proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1475
    fix z
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1476
    assume "dist y z < e"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1477
    then show "path_component s x z"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1478
      apply (rule_tac path_component_trans[of _ _ y])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1479
      defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1480
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1481
      apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format])
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1482
      using \<open>e > 0\<close> as
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1483
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1484
      done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1485
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1486
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1487
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1488
lemma open_non_path_component:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1489
  fixes s :: "'a::real_normed_vector set"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1490
  assumes "open s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1491
  shows "open (s - path_component_set s x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1492
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1493
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1494
  fix y
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1495
  assume as: "y \<in> s - path_component_set s x"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1496
  then obtain e where e: "e > 0" "ball y e \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1497
    using assms [unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1498
    by auto
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1499
  show "\<exists>e>0. ball y e \<subseteq> s - path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1500
    apply (rule_tac x=e in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1501
    apply rule
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1502
    apply (rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1503
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1504
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1505
    defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1506
  proof (rule ccontr)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1507
    fix z
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1508
    assume "z \<in> ball y e" "\<not> z \<notin> path_component_set s x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1509
    then have "y \<in> path_component_set s x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1510
      unfolding not_not mem_Collect_eq using \<open>e>0\<close>
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1511
      apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1512
      apply (rule path_component_trans, assumption)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1513
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1514
      apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1515
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1516
      done
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1517
    then show False
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1518
      using as by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1519
  qed (insert e(2), auto)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1520
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1521
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1522
lemma connected_open_path_connected:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1523
  fixes s :: "'a::real_normed_vector set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1524
  assumes "open s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1525
    and "connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1526
  shows "path_connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1527
  unfolding path_connected_component_set
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1528
proof (rule, rule, rule path_component_subset, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1529
  fix x y
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1530
  assume "x \<in> s" and "y \<in> s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1531
  show "y \<in> path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1532
  proof (rule ccontr)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1533
    assume "\<not> ?thesis"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1534
    moreover have "path_component_set s x \<inter> s \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1535
      using \<open>x \<in> s\<close> path_component_eq_empty path_component_subset[of s x]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1536
      by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1537
    ultimately
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1538
    show False
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1539
      using \<open>y \<in> s\<close> open_non_path_component[OF assms(1)] open_path_component[OF assms(1)]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1540
      using assms(2)[unfolded connected_def not_ex, rule_format,
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1541
        of "path_component_set s x" "s - path_component_set s x"]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1542
      by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1543
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1544
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1545
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1546
lemma path_connected_continuous_image:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1547
  assumes "continuous_on s f"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1548
    and "path_connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1549
  shows "path_connected (f ` s)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1550
  unfolding path_connected_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1551
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1552
  fix x' y'
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1553
  assume "x' \<in> f ` s" "y' \<in> f ` s"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1554
  then obtain x y where x: "x \<in> s" and y: "y \<in> s" and x': "x' = f x" and y': "y' = f y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1555
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1556
  from x y obtain g where "path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1557
    using assms(2)[unfolded path_connected_def] by fast
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1558
  then show "\<exists>g. path g \<and> path_image g \<subseteq> f ` s \<and> pathstart g = x' \<and> pathfinish g = y'"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1559
    unfolding x' y'
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1560
    apply (rule_tac x="f \<circ> g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1561
    unfolding path_defs
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51478
diff changeset
  1562
    apply (intro conjI continuous_on_compose continuous_on_subset[OF assms(1)])
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51478
diff changeset
  1563
    apply auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1564
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1565
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1566
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1567
lemma path_connected_segment:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1568
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1569
    shows "path_connected (closed_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1570
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1571
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1572
lemma path_connected_open_segment:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1573
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1574
    shows "path_connected (open_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1575
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1576
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1577
lemma homeomorphic_path_connectedness:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1578
  "s homeomorphic t \<Longrightarrow> path_connected s \<longleftrightarrow> path_connected t"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  1579
  unfolding homeomorphic_def homeomorphism_def by (metis path_connected_continuous_image)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1580
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1581
lemma path_connected_empty: "path_connected {}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1582
  unfolding path_connected_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1584
lemma path_connected_singleton: "path_connected {a}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1585
  unfolding path_connected_def pathstart_def pathfinish_def path_image_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1586
  apply clarify
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1587
  apply (rule_tac x="\<lambda>x. a" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1588
  apply (simp add: image_constant_conv)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1589
  apply (simp add: path_def continuous_on_const)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1590
  done
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1591
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1592
lemma path_connected_Un:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1593
  assumes "path_connected s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1594
    and "path_connected t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1595
    and "s \<inter> t \<noteq> {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1596
  shows "path_connected (s \<union> t)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1597
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1598
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1599
  fix x y
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1600
  assume as: "x \<in> s \<union> t" "y \<in> s \<union> t"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1601
  from assms(3) obtain z where "z \<in> s \<inter> t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1602
    by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1603
  then show "path_component (s \<union> t) x y"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1604
    using as and assms(1-2)[unfolded path_connected_component]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1605
    apply -
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1606
    apply (erule_tac[!] UnE)+
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1607
    apply (rule_tac[2-3] path_component_trans[of _ _ z])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1608
    apply (auto simp add:path_component_of_subset [OF Un_upper1] path_component_of_subset[OF Un_upper2])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1609
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1610
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1611
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1612
lemma path_connected_UNION:
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1613
  assumes "\<And>i. i \<in> A \<Longrightarrow> path_connected (S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1614
    and "\<And>i. i \<in> A \<Longrightarrow> z \<in> S i"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1615
  shows "path_connected (\<Union>i\<in>A. S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1616
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1617
proof clarify
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1618
  fix x i y j
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1619
  assume *: "i \<in> A" "x \<in> S i" "j \<in> A" "y \<in> S j"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1620
  then have "path_component (S i) x z" and "path_component (S j) z y"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1621
    using assms by (simp_all add: path_connected_component)
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1622
  then have "path_component (\<Union>i\<in>A. S i) x z" and "path_component (\<Union>i\<in>A. S i) z y"
48125
602dc0215954 tuned proofs -- prefer direct "rotated" instead of old-style COMP;
wenzelm
parents: 44647
diff changeset
  1623
    using *(1,3) by (auto elim!: path_component_of_subset [rotated])
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1624
  then show "path_component (\<Union>i\<in>A. S i) x y"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1625
    by (rule path_component_trans)
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1626
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1627
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1628
lemma path_component_path_image_pathstart:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1629
  assumes p: "path p" and x: "x \<in> path_image p"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1630
  shows "path_component (path_image p) (pathstart p) x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1631
using x
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1632
proof (clarsimp simp add: path_image_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1633
  fix y
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1634
  assume "x = p y" and y: "0 \<le> y" "y \<le> 1"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1635
  show "path_component (p ` {0..1}) (pathstart p) (p y)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1636
  proof (cases "y=0")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1637
    case True then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1638
      by (simp add: path_component_refl_eq pathstart_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1639
  next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1640
    case False have "continuous_on {0..1} (p o (op*y))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1641
      apply (rule continuous_intros)+
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1642
      using p [unfolded path_def] y
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1643
      apply (auto simp: mult_le_one intro: continuous_on_subset [of _ p])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1644
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1645
    then have "path (\<lambda>u. p (y * u))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1646
      by (simp add: path_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1647
    then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1648
      apply (simp add: path_component_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1649
      apply (rule_tac x = "\<lambda>u. p (y * u)" in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1650
      apply (intro conjI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1651
      using y False
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1652
      apply (auto simp: mult_le_one pathstart_def pathfinish_def path_image_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1653
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1654
  qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1655
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1656
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1657
lemma path_connected_path_image: "path p \<Longrightarrow> path_connected(path_image p)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1658
  unfolding path_connected_component
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1659
  by (meson path_component_path_image_pathstart path_component_sym path_component_trans)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1660
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1661
lemma path_connected_path_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1662
   "path_connected (path_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1663
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1664
  { fix y z
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1665
    assume pa: "path_component s x y" "path_component s x z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1666
    then have pae: "path_component_set s x = path_component_set s y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1667
      using path_component_eq by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1668
    have yz: "path_component s y z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1669
      using pa path_component_sym path_component_trans by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1670
    then have "\<exists>g. path g \<and> path_image g \<subseteq> path_component_set s x \<and> pathstart g = y \<and> pathfinish g = z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1671
      apply (simp add: path_component_def, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1672
      apply (rule_tac x=g in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1673
      by (simp add: pae path_component_maximal path_connected_path_image pathstart_in_path_image)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1674
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1675
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1676
    by (simp add: path_connected_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1677
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1678
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1679
lemma path_component: "path_component s x y \<longleftrightarrow> (\<exists>t. path_connected t \<and> t \<subseteq> s \<and> x \<in> t \<and> y \<in> t)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1680
  apply (intro iffI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1681
  apply (metis path_connected_path_image path_defs(5) pathfinish_in_path_image pathstart_in_path_image)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1682
  using path_component_of_subset path_connected_component by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1683
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1684
lemma path_component_path_component [simp]:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1685
   "path_component_set (path_component_set s x) x = path_component_set s x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1686
proof (cases "x \<in> s")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1687
  case True show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1688
    apply (rule subset_antisym)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1689
    apply (simp add: path_component_subset)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1690
    by (simp add: True path_component_maximal path_component_refl path_connected_path_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1691
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1692
  case False then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1693
    by (metis False empty_iff path_component_eq_empty)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1694
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1695
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1696
lemma path_component_subset_connected_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1697
   "(path_component_set s x) \<subseteq> (connected_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1698
proof (cases "x \<in> s")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1699
  case True show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1700
    apply (rule connected_component_maximal)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1701
    apply (auto simp: True path_component_subset path_component_refl path_connected_imp_connected path_connected_path_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1702
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1703
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1704
  case False then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1705
    using path_component_eq_empty by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1706
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1707
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1708
subsection\<open>Lemmas about path-connectedness\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1709
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1710
lemma path_connected_linear_image:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1711
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1712
  assumes "path_connected s" "bounded_linear f"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1713
    shows "path_connected(f ` s)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1714
by (auto simp: linear_continuous_on assms path_connected_continuous_image)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1715
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1716
lemma is_interval_path_connected: "is_interval s \<Longrightarrow> path_connected s"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1717
  by (simp add: convex_imp_path_connected is_interval_convex)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1718
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1719
lemma linear_homeomorphism_image:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1720
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1721
  assumes "linear f" "inj f"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1722
    obtains g where "homeomorphism (f ` S) S g f"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1723
using linear_injective_left_inverse [OF assms]
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1724
apply clarify
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1725
apply (rule_tac g=g in that)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1726
using assms
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1727
apply (auto simp: homeomorphism_def eq_id_iff [symmetric] image_comp comp_def linear_conv_bounded_linear linear_continuous_on)
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1728
done
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1729
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1730
lemma linear_homeomorphic_image:
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1731
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1732
  assumes "linear f" "inj f"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1733
    shows "S homeomorphic f ` S"
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1734
by (meson homeomorphic_def homeomorphic_sym linear_homeomorphism_image [OF assms])
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1735
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1736
lemma path_connected_Times:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1737
  assumes "path_connected s" "path_connected t"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1738
    shows "path_connected (s \<times> t)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1739
proof (simp add: path_connected_def Sigma_def, clarify)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1740
  fix x1 y1 x2 y2
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1741
  assume "x1 \<in> s" "y1 \<in> t" "x2 \<in> s" "y2 \<in> t"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1742
  obtain g where "path g" and g: "path_image g \<subseteq> s" and gs: "pathstart g = x1" and gf: "pathfinish g = x2"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1743
    using \<open>x1 \<in> s\<close> \<open>x2 \<in> s\<close> assms by (force simp: path_connected_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1744
  obtain h where "path h" and h: "path_image h \<subseteq> t" and hs: "pathstart h = y1" and hf: "pathfinish h = y2"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1745
    using \<open>y1 \<in> t\<close> \<open>y2 \<in> t\<close> assms by (force simp: path_connected_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1746
  have "path (\<lambda>z. (x1, h z))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1747
    using \<open>path h\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1748
    apply (simp add: path_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1749
    apply (rule continuous_on_compose2 [where f = h])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1750
    apply (rule continuous_intros | force)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1751
    done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1752
  moreover have "path (\<lambda>z. (g z, y2))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1753
    using \<open>path g\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1754
    apply (simp add: path_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1755
    apply (rule continuous_on_compose2 [where f = g])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1756
    apply (rule continuous_intros | force)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1757
    done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1758
  ultimately have 1: "path ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2)))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1759
    by (metis hf gs path_join_imp pathstart_def pathfinish_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1760
  have "path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> path_image (\<lambda>z. (x1, h z)) \<union> path_image (\<lambda>z. (g z, y2))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1761
    by (rule Path_Connected.path_image_join_subset)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1762
  also have "... \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1763
    using g h \<open>x1 \<in> s\<close> \<open>y2 \<in> t\<close> by (force simp: path_image_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1764
  finally have 2: "path_image ((\<lambda>z. (x1, h z)) +++ (\<lambda>z. (g z, y2))) \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)})" .
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1765
  show "\<exists>g. path g \<and> path_image g \<subseteq> (\<Union>x\<in>s. \<Union>x1\<in>t. {(x, x1)}) \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1766
            pathstart g = (x1, y1) \<and> pathfinish g = (x2, y2)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1767
    apply (intro exI conjI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1768
       apply (rule 1)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1769
      apply (rule 2)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1770
     apply (metis hs pathstart_def pathstart_join)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1771
    by (metis gf pathfinish_def pathfinish_join)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1772
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1773
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1774
lemma is_interval_path_connected_1:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1775
  fixes s :: "real set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1776
  shows "is_interval s \<longleftrightarrow> path_connected s"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1777
using is_interval_connected_1 is_interval_path_connected path_connected_imp_connected by blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1778
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1779
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1780
lemma Union_path_component [simp]:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1781
   "Union {path_component_set S x |x. x \<in> S} = S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1782
apply (rule subset_antisym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1783
using path_component_subset apply force
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1784
using path_component_refl by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1785
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1786
lemma path_component_disjoint:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1787
   "disjnt (path_component_set S a) (path_component_set S b) \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1788
    (a \<notin> path_component_set S b)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1789
apply (auto simp: disjnt_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1790
using path_component_eq apply fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1791
using path_component_sym path_component_trans by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1792
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1793
lemma path_component_eq_eq:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1794
   "path_component S x = path_component S y \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1795
        (x \<notin> S) \<and> (y \<notin> S) \<or> x \<in> S \<and> y \<in> S \<and> path_component S x y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1796
apply (rule iffI, metis (no_types) path_component_mem(1) path_component_refl)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1797
apply (erule disjE, metis Collect_empty_eq_bot path_component_eq_empty)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1798
apply (rule ext)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1799
apply (metis path_component_trans path_component_sym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1800
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1801
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1802
lemma path_component_unique:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1803
  assumes "x \<in> c" "c \<subseteq> S" "path_connected c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1804
          "\<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; path_connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1805
   shows "path_component_set S x = c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1806
apply (rule subset_antisym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1807
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1808
apply (metis mem_Collect_eq subsetCE path_component_eq_eq path_component_subset path_connected_path_component)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1809
by (simp add: assms path_component_maximal)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1810
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1811
lemma path_component_intermediate_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1812
   "path_component_set u a \<subseteq> t \<and> t \<subseteq> u
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1813
        \<Longrightarrow> path_component_set t a = path_component_set u a"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1814
by (metis (no_types) path_component_mono path_component_path_component subset_antisym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1815
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1816
lemma complement_path_component_Union:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1817
  fixes x :: "'a :: topological_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1818
  shows "S - path_component_set S x =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1819
         \<Union>({path_component_set S y| y. y \<in> S} - {path_component_set S x})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1820
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1821
  have *: "(\<And>x. x \<in> S - {a} \<Longrightarrow> disjnt a x) \<Longrightarrow> \<Union>S - a = \<Union>(S - {a})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1822
    for a::"'a set" and S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1823
    by (auto simp: disjnt_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1824
  have "\<And>y. y \<in> {path_component_set S x |x. x \<in> S} - {path_component_set S x}
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1825
            \<Longrightarrow> disjnt (path_component_set S x) y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1826
    using path_component_disjoint path_component_eq by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1827
  then have "\<Union>{path_component_set S x |x. x \<in> S} - path_component_set S x =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1828
             \<Union>({path_component_set S y |y. y \<in> S} - {path_component_set S x})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1829
    by (meson *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1830
  then show ?thesis by simp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1831
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1832
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1833
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1834
subsection \<open>Sphere is path-connected\<close>
37489
44e42d392c6e Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents: 36583
diff changeset
  1835
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1836
lemma path_connected_punctured_universe:
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1837
  assumes "2 \<le> DIM('a::euclidean_space)"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1838
  shows "path_connected (- {a::'a})"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1839
proof -
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1840
  let ?A = "{x::'a. \<exists>i\<in>Basis. x \<bullet> i < a \<bullet> i}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1841
  let ?B = "{x::'a. \<exists>i\<in>Basis. a \<bullet> i < x \<bullet> i}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1842
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1843
  have A: "path_connected ?A"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1844
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1845
  proof (rule path_connected_UNION)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1846
    fix i :: 'a
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1847
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1848
    then show "(\<Sum>i\<in>Basis. (a \<bullet> i - 1)*\<^sub>R i) \<in> {x::'a. x \<bullet> i < a \<bullet> i}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1849
      by simp
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1850
    show "path_connected {x. x \<bullet> i < a \<bullet> i}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1851
      using convex_imp_path_connected [OF convex_halfspace_lt, of i "a \<bullet> i"]
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1852
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1853
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1854
  have B: "path_connected ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1855
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1856
  proof (rule path_connected_UNION)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1857
    fix i :: 'a
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1858
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1859
    then show "(\<Sum>i\<in>Basis. (a \<bullet> i + 1) *\<^sub>R i) \<in> {x::'a. a \<bullet> i < x \<bullet> i}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1860
      by simp
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1861
    show "path_connected {x. a \<bullet> i < x \<bullet> i}"
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1862
      using convex_imp_path_connected [OF convex_halfspace_gt, of "a \<bullet> i" i]
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1863
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1864
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1865
  obtain S :: "'a set" where "S \<subseteq> Basis" and "card S = Suc (Suc 0)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1866
    using ex_card[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1867
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1868
  then obtain b0 b1 :: 'a where "b0 \<in> Basis" and "b1 \<in> Basis" and "b0 \<noteq> b1"
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1869
    unfolding card_Suc_eq by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1870
  then have "a + b0 - b1 \<in> ?A \<inter> ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1871
    by (auto simp: inner_simps inner_Basis)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1872
  then have "?A \<inter> ?B \<noteq> {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1873
    by fast
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1874
  with A B have "path_connected (?A \<union> ?B)"
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1875
    by (rule path_connected_Un)
50526
899c9c4e4a4c Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents: 49654
diff changeset
  1876
  also have "?A \<union> ?B = {x. \<exists>i\<in>Basis. x \<bullet> i \<noteq> a \<bullet> i}"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1877
    unfolding neq_iff bex_disj_distrib Collect_disj_eq ..
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1878
  also have "\<dots> = {x. x \<noteq> a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1879
    unfolding euclidean_eq_iff [where 'a='a]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1880
    by (simp add: Bex_def)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1881
  also have "\<dots> = - {a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1882
    by auto
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1883
  finally show ?thesis .
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1884
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1885
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1886
lemma path_connected_sphere:
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1887
  assumes "2 \<le> DIM('a::euclidean_space)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1888
  shows "path_connected {x::'a. norm (x - a) = r}"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1889
proof (rule linorder_cases [of r 0])
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1890
  assume "r < 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1891
  then have "{x::'a. norm(x - a) = r} = {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1892
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1893
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1894
    using path_connected_empty by simp
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1895
next
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1896
  assume "r = 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1897
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1898
    using path_connected_singleton by simp
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1899
next
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1900
  assume r: "0 < r"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1901
  have *: "{x::'a. norm(x - a) = r} = (\<lambda>x. a + r *\<^sub>R x) ` {x. norm x = 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1902
    apply (rule set_eqI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1903
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1904
    unfolding image_iff
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1905
    apply (rule_tac x="(1/r) *\<^sub>R (x - a)" in bexI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1906
    unfolding mem_Collect_eq norm_scaleR
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1907
    using r
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1908
    apply (auto simp add: scaleR_right_diff_distrib)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1909
    done
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1910
  have **: "{x::'a. norm x = 1} = (\<lambda>x. (1/norm x) *\<^sub>R x) ` (- {0})"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1911
    apply (rule set_eqI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1912
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1913
    unfolding image_iff
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1914
    apply (rule_tac x=x in bexI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1915
    unfolding mem_Collect_eq
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
  1916
    apply (auto split: if_split_asm)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1917
    done
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1918
  have "continuous_on (- {0}) (\<lambda>x::'a. 1 / norm x)"
59557
ebd8ecacfba6 establish unique preferred fact names
haftmann
parents: 58877
diff changeset
  1919
    by (auto intro!: continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1920
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1921
    unfolding * **
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1922
    using path_connected_punctured_universe[OF assms]
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1923
    by (auto intro!: path_connected_continuous_image continuous_intros)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1924
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1925
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1926
corollary connected_sphere: "2 \<le> DIM('a::euclidean_space) \<Longrightarrow> connected {x::'a. norm (x - a) = r}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1927
  using path_connected_sphere path_connected_imp_connected
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1928
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1929
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1930
corollary path_connected_complement_bounded_convex:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1931
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1932
    assumes "bounded s" "convex s" and 2: "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1933
    shows "path_connected (- s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1934
proof (cases "s={}")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1935
  case True then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1936
    using convex_imp_path_connected by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1937
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1938
  case False
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1939
  then obtain a where "a \<in> s" by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1940
  { fix x y assume "x \<notin> s" "y \<notin> s"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1941
    then have "x \<noteq> a" "y \<noteq> a" using \<open>a \<in> s\<close> by auto
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1942
    then have bxy: "bounded(insert x (insert y s))"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1943
      by (simp add: \<open>bounded s\<close>)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1944
    then obtain B::real where B: "0 < B" and Bx: "norm (a - x) < B" and By: "norm (a - y) < B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1945
                          and "s \<subseteq> ball a B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1946
      using bounded_subset_ballD [OF bxy, of a] by (auto simp: dist_norm)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  1947
    define C where "C = B / norm(x - a)"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1948
    { fix u
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1949
      assume u: "(1 - u) *\<^sub>R x + u *\<^sub>R (a + C *\<^sub>R (x - a)) \<in> s" and "0 \<le> u" "u \<le> 1"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1950
      have CC: "1 \<le> 1 + (C - 1) * u"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1951
        using \<open>x \<noteq> a\<close> \<open>0 \<le> u\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1952
        apply (simp add: C_def divide_simps norm_minus_commute)
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1953
        using Bx by auto
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1954
      have *: "\<And>v. (1 - u) *\<^sub>R x + u *\<^sub>R (a + v *\<^sub>R (x - a)) = a + (1 + (v - 1) * u) *\<^sub>R (x - a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1955
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1956
      have "a + ((1 / (1 + C * u - u)) *\<^sub>R x + ((u / (1 + C * u - u)) *\<^sub>R a + (C * u / (1 + C * u - u)) *\<^sub>R x)) =
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1957
            (1 + (u / (1 + C * u - u))) *\<^sub>R a + ((1 / (1 + C * u - u)) + (C * u / (1 + C * u - u))) *\<^sub>R x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1958
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1959
      also have "... = (1 + (u / (1 + C * u - u))) *\<^sub>R a + (1 + (u / (1 + C * u - u))) *\<^sub>R x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1960
        using CC by (simp add: field_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1961
      also have "... = x + (1 + (u / (1 + C * u - u))) *\<^sub>R a + (u / (1 + C * u - u)) *\<^sub>R x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1962
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1963
      also have "... = x + ((1 / (1 + C * u - u)) *\<^sub>R a +
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1964
              ((u / (1 + C * u - u)) *\<^sub>R x + (C * u / (1 + C * u - u)) *\<^sub>R a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1965
        using CC by (simp add: field_simps) (simp add: add_divide_distrib scaleR_add_left)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1966
      finally have xeq: "(1 - 1 / (1 + (C - 1) * u)) *\<^sub>R a + (1 / (1 + (C - 1) * u)) *\<^sub>R (a + (1 + (C - 1) * u) *\<^sub>R (x - a)) = x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1967
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1968
      have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1969
        using \<open>convex s\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1970
        apply (simp add: convex_alt)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1971
        apply (drule_tac x=a in bspec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1972
         apply (rule  \<open>a \<in> s\<close>)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1973
        apply (drule_tac x="a + (1 + (C - 1) * u) *\<^sub>R (x - a)" in bspec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1974
         using u apply (simp add: *)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1975
        apply (drule_tac x="1 / (1 + (C - 1) * u)" in spec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1976
        using \<open>x \<noteq> a\<close> \<open>x \<notin> s\<close> \<open>0 \<le> u\<close> CC
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1977
        apply (auto simp: xeq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1978
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1979
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1980
    then have pcx: "path_component (- s) x (a + C *\<^sub>R (x - a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1981
      by (force simp: closed_segment_def intro!: path_connected_linepath)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  1982
    define D where "D = B / norm(y - a)"  \<comment>\<open>massive duplication with the proof above\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1983
    { fix u
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1984
      assume u: "(1 - u) *\<^sub>R y + u *\<^sub>R (a + D *\<^sub>R (y - a)) \<in> s" and "0 \<le> u" "u \<le> 1"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1985
      have DD: "1 \<le> 1 + (D - 1) * u"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1986
        using \<open>y \<noteq> a\<close> \<open>0 \<le> u\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1987
        apply (simp add: D_def divide_simps norm_minus_commute)
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  1988
        using By by auto
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1989
      have *: "\<And>v. (1 - u) *\<^sub>R y + u *\<^sub>R (a + v *\<^sub>R (y - a)) = a + (1 + (v - 1) * u) *\<^sub>R (y - a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1990
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1991
      have "a + ((1 / (1 + D * u - u)) *\<^sub>R y + ((u / (1 + D * u - u)) *\<^sub>R a + (D * u / (1 + D * u - u)) *\<^sub>R y)) =
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1992
            (1 + (u / (1 + D * u - u))) *\<^sub>R a + ((1 / (1 + D * u - u)) + (D * u / (1 + D * u - u))) *\<^sub>R y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1993
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1994
      also have "... = (1 + (u / (1 + D * u - u))) *\<^sub>R a + (1 + (u / (1 + D * u - u))) *\<^sub>R y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1995
        using DD by (simp add: field_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1996
      also have "... = y + (1 + (u / (1 + D * u - u))) *\<^sub>R a + (u / (1 + D * u - u)) *\<^sub>R y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1997
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1998
      also have "... = y + ((1 / (1 + D * u - u)) *\<^sub>R a +
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1999
              ((u / (1 + D * u - u)) *\<^sub>R y + (D * u / (1 + D * u - u)) *\<^sub>R a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2000
        using DD by (simp add: field_simps) (simp add: add_divide_distrib scaleR_add_left)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2001
      finally have xeq: "(1 - 1 / (1 + (D - 1) * u)) *\<^sub>R a + (1 / (1 + (D - 1) * u)) *\<^sub>R (a + (1 + (D - 1) * u) *\<^sub>R (y - a)) = y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2002
        by (simp add: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2003
      have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2004
        using \<open>convex s\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2005
        apply (simp add: convex_alt)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2006
        apply (drule_tac x=a in bspec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2007
         apply (rule  \<open>a \<in> s\<close>)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2008
        apply (drule_tac x="a + (1 + (D - 1) * u) *\<^sub>R (y - a)" in bspec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2009
         using u apply (simp add: *)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2010
        apply (drule_tac x="1 / (1 + (D - 1) * u)" in spec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2011
        using \<open>y \<noteq> a\<close> \<open>y \<notin> s\<close> \<open>0 \<le> u\<close> DD
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2012
        apply (auto simp: xeq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2013
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2014
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2015
    then have pdy: "path_component (- s) y (a + D *\<^sub>R (y - a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2016
      by (force simp: closed_segment_def intro!: path_connected_linepath)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2017
    have pyx: "path_component (- s) (a + D *\<^sub>R (y - a)) (a + C *\<^sub>R (x - a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2018
      apply (rule path_component_of_subset [of "{x. norm(x - a) = B}"])
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2019
       using \<open>s \<subseteq> ball a B\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2020
       apply (force simp: ball_def dist_norm norm_minus_commute)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2021
      apply (rule path_connected_sphere [OF 2, of a B, simplified path_connected_component, rule_format])
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2022
      using \<open>x \<noteq> a\<close>  using \<open>y \<noteq> a\<close>  B apply (auto simp: C_def D_def)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2023
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2024
    have "path_component (- s) x y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2025
      by (metis path_component_trans path_component_sym pcx pdy pyx)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2026
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2027
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2028
    by (auto simp: path_connected_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2029
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2030
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2031
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2032
lemma connected_complement_bounded_convex:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2033
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2034
    assumes "bounded s" "convex s" "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2035
      shows  "connected (- s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2036
  using path_connected_complement_bounded_convex [OF assms] path_connected_imp_connected by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2037
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2038
lemma connected_diff_ball:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2039
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2040
    assumes "connected s" "cball a r \<subseteq> s" "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2041
      shows "connected (s - ball a r)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2042
  apply (rule connected_diff_open_from_closed [OF ball_subset_cball])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2043
  using assms connected_sphere
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2044
  apply (auto simp: cball_diff_eq_sphere dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2045
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2046
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2047
proposition connected_open_delete:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2048
  assumes "open S" "connected S" and 2: "2 \<le> DIM('N::euclidean_space)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2049
    shows "connected(S - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2050
proof (cases "a \<in> S")
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2051
  case True
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2052
  with \<open>open S\<close> obtain \<epsilon> where "\<epsilon> > 0" and \<epsilon>: "cball a \<epsilon> \<subseteq> S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2053
    using open_contains_cball_eq by blast
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2054
  have "dist a (a + \<epsilon> *\<^sub>R (SOME i. i \<in> Basis)) = \<epsilon>"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2055
    by (simp add: dist_norm SOME_Basis \<open>0 < \<epsilon>\<close> less_imp_le)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2056
  with \<epsilon> have "\<Inter>{S - ball a r |r. 0 < r \<and> r < \<epsilon>} \<subseteq> {} \<Longrightarrow> False"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2057
    apply (drule_tac c="a + scaleR (\<epsilon>) ((SOME i. i \<in> Basis))" in subsetD)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2058
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2059
  then have nonemp: "(\<Inter>{S - ball a r |r. 0 < r \<and> r < \<epsilon>}) = {} \<Longrightarrow> False"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2060
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2061
  have con: "\<And>r. r < \<epsilon> \<Longrightarrow> connected (S - ball a r)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2062
    using \<epsilon> by (force intro: connected_diff_ball [OF \<open>connected S\<close> _ 2])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2063
  have "x \<in> \<Union>{S - ball a r |r. 0 < r \<and> r < \<epsilon>}" if "x \<in> S - {a}" for x
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2064
    apply (rule UnionI [of "S - ball a (min \<epsilon> (dist a x) / 2)"])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2065
     using that \<open>0 < \<epsilon>\<close> apply (simp_all add:)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2066
    apply (rule_tac x="min \<epsilon> (dist a x) / 2" in exI)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2067
    apply auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2068
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2069
  then have "S - {a} = \<Union>{S - ball a r | r. 0 < r \<and> r < \<epsilon>}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2070
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2071
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2072
    by (auto intro: connected_Union con dest!: nonemp)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2073
next
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2074
  case False then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2075
    by (simp add: \<open>connected S\<close>)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2076
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2077
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2078
corollary path_connected_open_delete:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2079
  assumes "open S" "connected S" and 2: "2 \<le> DIM('N::euclidean_space)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2080
    shows "path_connected(S - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2081
by (simp add: assms connected_open_delete connected_open_path_connected open_delete)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2082
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2083
corollary path_connected_punctured_ball:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2084
   "2 \<le> DIM('N::euclidean_space) \<Longrightarrow> path_connected(ball a r - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2085
by (simp add: path_connected_open_delete)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2086
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2087
corollary connected_punctured_ball:
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2088
   "2 \<le> DIM('N::euclidean_space) \<Longrightarrow> connected(ball a r - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2089
by (simp add: connected_open_delete)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2090
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2091
corollary connected_open_delete_finite:
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2092
  fixes S T::"'a::euclidean_space set"
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2093
  assumes S: "open S" "connected S" and 2: "2 \<le> DIM('a)" and "finite T"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  2094
  shows "connected(S - T)"
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  2095
  using \<open>finite T\<close> S
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2096
proof (induct T)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2097
  case empty
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2098
  show ?case using \<open>connected S\<close> by simp
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2099
next
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2100
  case (insert x F)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2101
  then have "connected (S-F)" by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2102
  moreover have "open (S - F)" using finite_imp_closed[OF \<open>finite F\<close>] \<open>open S\<close> by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2103
  ultimately have "connected (S - F - {x})" using connected_open_delete[OF _ _ 2] by auto
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2104
  thus ?case by (metis Diff_insert)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2105
qed
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2106
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2107
subsection\<open>Relations between components and path components\<close>
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2108
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2109
lemma open_connected_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2110
  fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2111
  shows "open s \<Longrightarrow> open (connected_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2112
    apply (simp add: open_contains_ball, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2113
    apply (rename_tac y)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2114
    apply (drule_tac x=y in bspec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2115
     apply (simp add: connected_component_in, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2116
    apply (rule_tac x=e in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2117
    by (metis mem_Collect_eq connected_component_eq connected_component_maximal centre_in_ball connected_ball)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2118
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2119
corollary open_components:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2120
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2121
    shows "\<lbrakk>open u; s \<in> components u\<rbrakk> \<Longrightarrow> open s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2122
  by (simp add: components_iff) (metis open_connected_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2123
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2124
lemma in_closure_connected_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2125
  fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2126
  assumes x: "x \<in> s" and s: "open s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2127
  shows "x \<in> closure (connected_component_set s y) \<longleftrightarrow>  x \<in> connected_component_set s y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2128
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2129
  { assume "x \<in> closure (connected_component_set s y)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2130
    moreover have "x \<in> connected_component_set s x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2131
      using x by simp
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2132
    ultimately have "x \<in> connected_component_set s y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2133
      using s by (meson Compl_disjoint closure_iff_nhds_not_empty connected_component_disjoint disjoint_eq_subset_Compl open_connected_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2134
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2135
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2136
    by (auto simp: closure_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2137
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2138
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2139
lemma connected_disjoint_Union_open_pick:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2140
  assumes "pairwise disjnt B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2141
          "\<And>S. S \<in> A \<Longrightarrow> connected S \<and> S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2142
          "\<And>S. S \<in> B \<Longrightarrow> open S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2143
          "\<Union>A \<subseteq> \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2144
          "S \<in> A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2145
  obtains T where "T \<in> B" "S \<subseteq> T" "S \<inter> \<Union>(B - {T}) = {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2146
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2147
  have "S \<subseteq> \<Union>B" "connected S" "S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2148
    using assms \<open>S \<in> A\<close> by blast+
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2149
  then obtain T where "T \<in> B" "S \<inter> T \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2150
    by (metis Sup_inf_eq_bot_iff inf.absorb_iff2 inf_commute)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2151
  have 1: "open T" by (simp add: \<open>T \<in> B\<close> assms)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2152
  have 2: "open (\<Union>(B-{T}))" using assms by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2153
  have 3: "S \<subseteq> T \<union> \<Union>(B - {T})" using \<open>S \<subseteq> \<Union>B\<close> by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2154
  have "T \<inter> \<Union>(B - {T}) = {}" using \<open>T \<in> B\<close> \<open>pairwise disjnt B\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2155
    by (auto simp: pairwise_def disjnt_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2156
  then have 4: "T \<inter> \<Union>(B - {T}) \<inter> S = {}" by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2157
  from connectedD [OF \<open>connected S\<close> 1 2 3 4]
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2158
  have "S \<inter> \<Union>(B-{T}) = {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2159
    by (auto simp: Int_commute \<open>S \<inter> T \<noteq> {}\<close>)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2160
  with \<open>T \<in> B\<close> have "S \<subseteq> T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2161
    using "3" by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2162
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2163
    using \<open>S \<inter> \<Union>(B - {T}) = {}\<close> \<open>S \<subseteq> T\<close> \<open>T \<in> B\<close> that by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2164
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2165
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2166
lemma connected_disjoint_Union_open_subset:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2167
  assumes A: "pairwise disjnt A" and B: "pairwise disjnt B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2168
      and SA: "\<And>S. S \<in> A \<Longrightarrow> open S \<and> connected S \<and> S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2169
      and SB: "\<And>S. S \<in> B \<Longrightarrow> open S \<and> connected S \<and> S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2170
      and eq [simp]: "\<Union>A = \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2171
    shows "A \<subseteq> B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2172
proof
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2173
  fix S
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2174
  assume "S \<in> A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2175
  obtain T where "T \<in> B" "S \<subseteq> T" "S \<inter> \<Union>(B - {T}) = {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2176
      apply (rule connected_disjoint_Union_open_pick [OF B, of A])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2177
      using SA SB \<open>S \<in> A\<close> by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2178
  moreover obtain S' where "S' \<in> A" "T \<subseteq> S'" "T \<inter> \<Union>(A - {S'}) = {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2179
      apply (rule connected_disjoint_Union_open_pick [OF A, of B])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2180
      using SA SB \<open>T \<in> B\<close> by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2181
  ultimately have "S' = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2182
    by (metis A Int_subset_iff SA \<open>S \<in> A\<close> disjnt_def inf.orderE pairwise_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2183
  with \<open>T \<subseteq> S'\<close> have "T \<subseteq> S" by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2184
  with \<open>S \<subseteq> T\<close> have "S = T" by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2185
  with \<open>T \<in> B\<close> show "S \<in> B" by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2186
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2187
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2188
lemma connected_disjoint_Union_open_unique:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2189
  assumes A: "pairwise disjnt A" and B: "pairwise disjnt B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2190
      and SA: "\<And>S. S \<in> A \<Longrightarrow> open S \<and> connected S \<and> S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2191
      and SB: "\<And>S. S \<in> B \<Longrightarrow> open S \<and> connected S \<and> S \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2192
      and eq [simp]: "\<Union>A = \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2193
    shows "A = B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2194
by (rule subset_antisym; metis connected_disjoint_Union_open_subset assms)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2195
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2196
proposition components_open_unique:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2197
 fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2198
  assumes "pairwise disjnt A" "\<Union>A = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2199
          "\<And>X. X \<in> A \<Longrightarrow> open X \<and> connected X \<and> X \<noteq> {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2200
    shows "components S = A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2201
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2202
  have "open S" using assms by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2203
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2204
    apply (rule connected_disjoint_Union_open_unique)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2205
    apply (simp add: components_eq disjnt_def pairwise_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2206
    using \<open>open S\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2207
    apply (simp_all add: assms open_components in_components_connected in_components_nonempty)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2208
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2209
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2210
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2211
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2212
subsection\<open>Existence of unbounded components\<close>
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2213
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2214
lemma cobounded_unbounded_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2215
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2216
    assumes "bounded (-s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2217
      shows "\<exists>x. x \<in> s \<and> ~ bounded (connected_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2218
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2219
  obtain i::'a where i: "i \<in> Basis"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2220
    using nonempty_Basis by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2221
  obtain B where B: "B>0" "-s \<subseteq> ball 0 B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2222
    using bounded_subset_ballD [OF assms, of 0] by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2223
  then have *: "\<And>x. B \<le> norm x \<Longrightarrow> x \<in> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2224
    by (force simp add: ball_def dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2225
  have unbounded_inner: "~ bounded {x. inner i x \<ge> B}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2226
    apply (auto simp: bounded_def dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2227
    apply (rule_tac x="x + (max B e + 1 + \<bar>i \<bullet> x\<bar>) *\<^sub>R i" in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2228
    apply simp
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2229
    using i
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2230
    apply (auto simp: algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2231
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2232
  have **: "{x. B \<le> i \<bullet> x} \<subseteq> connected_component_set s (B *\<^sub>R i)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2233
    apply (rule connected_component_maximal)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2234
    apply (auto simp: i intro: convex_connected convex_halfspace_ge [of B])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2235
    apply (rule *)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2236
    apply (rule order_trans [OF _ Basis_le_norm [OF i]])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2237
    by (simp add: inner_commute)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2238
  have "B *\<^sub>R i \<in> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2239
    by (rule *) (simp add: norm_Basis [OF i])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2240
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2241
    apply (rule_tac x="B *\<^sub>R i" in exI, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2242
    apply (frule bounded_subset [of _ "{x. B \<le> i \<bullet> x}", OF _ **])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2243
    using unbounded_inner apply blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2244
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2245
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2246
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2247
lemma cobounded_unique_unbounded_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2248
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2249
    assumes bs: "bounded (-s)" and "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2250
        and bo: "~ bounded(connected_component_set s x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2251
                "~ bounded(connected_component_set s y)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2252
      shows "connected_component_set s x = connected_component_set s y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2253
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2254
  obtain i::'a where i: "i \<in> Basis"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2255
    using nonempty_Basis by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2256
  obtain B where B: "B>0" "-s \<subseteq> ball 0 B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2257
    using bounded_subset_ballD [OF bs, of 0] by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2258
  then have *: "\<And>x. B \<le> norm x \<Longrightarrow> x \<in> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2259
    by (force simp add: ball_def dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2260
  have ccb: "connected (- ball 0 B :: 'a set)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2261
    using assms by (auto intro: connected_complement_bounded_convex)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2262
  obtain x' where x': "connected_component s x x'" "norm x' > B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2263
    using bo [unfolded bounded_def dist_norm, simplified, rule_format]
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2264
    by (metis diff_zero norm_minus_commute not_less)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2265
  obtain y' where y': "connected_component s y y'" "norm y' > B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2266
    using bo [unfolded bounded_def dist_norm, simplified, rule_format]
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2267
    by (metis diff_zero norm_minus_commute not_less)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2268
  have x'y': "connected_component s x' y'"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2269
    apply (simp add: connected_component_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2270
    apply (rule_tac x="- ball 0 B" in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2271
    using x' y'
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2272
    apply (auto simp: ccb dist_norm *)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2273
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2274
  show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2275
    apply (rule connected_component_eq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2276
    using x' y' x'y'
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2277
    by (metis (no_types, lifting) connected_component_eq_empty connected_component_eq_eq connected_component_idemp connected_component_in)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2278
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2279
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2280
lemma cobounded_unbounded_components:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2281
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2282
    shows "bounded (-s) \<Longrightarrow> \<exists>c. c \<in> components s \<and> ~bounded c"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2283
  by (metis cobounded_unbounded_component components_def imageI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2284
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2285
lemma cobounded_unique_unbounded_components:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2286
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2287
    shows  "\<lbrakk>bounded (- s); c \<in> components s; \<not> bounded c; c' \<in> components s; \<not> bounded c'; 2 \<le> DIM('a)\<rbrakk> \<Longrightarrow> c' = c"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2288
  unfolding components_iff
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2289
  by (metis cobounded_unique_unbounded_component)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2290
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2291
lemma cobounded_has_bounded_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2292
    fixes s :: "'a :: euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2293
    shows "\<lbrakk>bounded (- s); ~connected s; 2 \<le> DIM('a)\<rbrakk> \<Longrightarrow> \<exists>c. c \<in> components s \<and> bounded c"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2294
  by (meson cobounded_unique_unbounded_components connected_eq_connected_components_eq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2295
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2296
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2297
section\<open>The "inside" and "outside" of a set\<close>
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2298
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2299
text\<open>The inside comprises the points in a bounded connected component of the set's complement.
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2300
  The outside comprises the points in unbounded connected component of the complement.\<close>
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2301
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2302
definition inside where
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2303
  "inside s \<equiv> {x. (x \<notin> s) \<and> bounded(connected_component_set ( - s) x)}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2304
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2305
definition outside where
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2306
  "outside s \<equiv> -s \<inter> {x. ~ bounded(connected_component_set (- s) x)}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2307
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2308
lemma outside: "outside s = {x. ~ bounded(connected_component_set (- s) x)}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2309
  by (auto simp: outside_def) (metis Compl_iff bounded_empty connected_component_eq_empty)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2310
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2311
lemma inside_no_overlap [simp]: "inside s \<inter> s = {}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2312
  by (auto simp: inside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2313
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2314
lemma outside_no_overlap [simp]:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2315
   "outside s \<inter> s = {}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2316
  by (auto simp: outside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2317
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2318
lemma inside_Int_outside [simp]: "inside s \<inter> outside s = {}"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2319
  by (auto simp: inside_def outside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2320
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2321
lemma inside_Un_outside [simp]: "inside s \<union> outside s = (- s)"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2322
  by (auto simp: inside_def outside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2323
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2324
lemma inside_eq_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2325
   "inside s = outside s \<longleftrightarrow> s = UNIV"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2326
  by (auto simp: inside_def outside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2327
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2328
lemma inside_outside: "inside s = (- (s \<union> outside s))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2329
  by (force simp add: inside_def outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2330
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2331
lemma outside_inside: "outside s = (- (s \<union> inside s))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2332
  by (auto simp: inside_outside) (metis IntI equals0D outside_no_overlap)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2333
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2334
lemma union_with_inside: "s \<union> inside s = - outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2335
  by (auto simp: inside_outside) (simp add: outside_inside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2336
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2337
lemma union_with_outside: "s \<union> outside s = - inside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2338
  by (simp add: inside_outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2339
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2340
lemma outside_mono: "s \<subseteq> t \<Longrightarrow> outside t \<subseteq> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2341
  by (auto simp: outside bounded_subset connected_component_mono)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2342
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2343
lemma inside_mono: "s \<subseteq> t \<Longrightarrow> inside s - t \<subseteq> inside t"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2344
  by (auto simp: inside_def bounded_subset connected_component_mono)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2345
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2346
lemma segment_bound_lemma:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2347
  fixes u::real
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2348
  assumes "x \<ge> B" "y \<ge> B" "0 \<le> u" "u \<le> 1"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2349
  shows "(1 - u) * x + u * y \<ge> B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2350
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2351
  obtain dx dy where "dx \<ge> 0" "dy \<ge> 0" "x = B + dx" "y = B + dy"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2352
    using assms by auto (metis add.commute diff_add_cancel)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2353
  with \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> show ?thesis
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2354
    by (simp add: add_increasing2 mult_left_le field_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2355
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2356
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2357
lemma cobounded_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2358
  fixes s :: "'a :: real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2359
  assumes "bounded s" shows "bounded (- outside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2360
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2361
  obtain B where B: "B>0" "s \<subseteq> ball 0 B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2362
    using bounded_subset_ballD [OF assms, of 0] by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2363
  { fix x::'a and C::real
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2364
    assume Bno: "B \<le> norm x" and C: "0 < C"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2365
    have "\<exists>y. connected_component (- s) x y \<and> norm y > C"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2366
    proof (cases "x = 0")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2367
      case True with B Bno show ?thesis by force
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2368
    next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2369
      case False with B C show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2370
        apply (rule_tac x="((B+C)/norm x) *\<^sub>R x" in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2371
        apply (simp add: connected_component_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2372
        apply (rule_tac x="closed_segment x (((B+C)/norm x) *\<^sub>R x)" in exI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2373
        apply simp
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2374
        apply (rule_tac y="- ball 0 B" in order_trans)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2375
         prefer 2 apply force
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2376
        apply (simp add: closed_segment_def ball_def dist_norm, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2377
        apply (simp add: real_vector_class.scaleR_add_left [symmetric] divide_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2378
        using segment_bound_lemma [of B "norm x" "B+C" ] Bno
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2379
        by (meson le_add_same_cancel1 less_eq_real_def not_le)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2380
    qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2381
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2382
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2383
    apply (simp add: outside_def assms)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2384
    apply (rule bounded_subset [OF bounded_ball [of 0 B]])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2385
    apply (force simp add: dist_norm not_less bounded_pos)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2386
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2387
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2388
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2389
lemma unbounded_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2390
    fixes s :: "'a::{real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2391
    shows "bounded s \<Longrightarrow> ~ bounded(outside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2392
  using cobounded_imp_unbounded cobounded_outside by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2393
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2394
lemma bounded_inside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2395
    fixes s :: "'a::{real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2396
    shows "bounded s \<Longrightarrow> bounded(inside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2397
  by (simp add: bounded_Int cobounded_outside inside_outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2398
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2399
lemma connected_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2400
    fixes s :: "'a::euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2401
    assumes "bounded s" "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2402
      shows "connected(outside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2403
  apply (simp add: connected_iff_connected_component, clarify)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2404
  apply (simp add: outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2405
  apply (rule_tac s="connected_component_set (- s) x" in connected_component_of_subset)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2406
  apply (metis (no_types) assms cobounded_unbounded_component cobounded_unique_unbounded_component connected_component_eq_eq connected_component_idemp double_complement mem_Collect_eq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2407
  apply clarify
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2408
  apply (metis connected_component_eq_eq connected_component_in)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2409
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2410
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2411
lemma outside_connected_component_lt:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2412
    "outside s = {x. \<forall>B. \<exists>y. B < norm(y) \<and> connected_component (- s) x y}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2413
apply (auto simp: outside bounded_def dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2414
apply (metis diff_0 norm_minus_cancel not_less)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2415
by (metis less_diff_eq norm_minus_commute norm_triangle_ineq2 order.trans pinf(6))
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2416
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2417
lemma outside_connected_component_le:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2418
   "outside s =
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2419
            {x. \<forall>B. \<exists>y. B \<le> norm(y) \<and>
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2420
                         connected_component (- s) x y}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2421
apply (simp add: outside_connected_component_lt)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2422
apply (simp add: Set.set_eq_iff)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2423
by (meson gt_ex leD le_less_linear less_imp_le order.trans)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2424
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2425
lemma not_outside_connected_component_lt:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2426
    fixes s :: "'a::euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2427
    assumes s: "bounded s" and "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2428
      shows "- (outside s) = {x. \<forall>B. \<exists>y. B < norm(y) \<and> ~ (connected_component (- s) x y)}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2429
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2430
  obtain B::real where B: "0 < B" and Bno: "\<And>x. x \<in> s \<Longrightarrow> norm x \<le> B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2431
    using s [simplified bounded_pos] by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2432
  { fix y::'a and z::'a
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2433
    assume yz: "B < norm z" "B < norm y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2434
    have "connected_component (- cball 0 B) y z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2435
      apply (rule connected_componentI [OF _ subset_refl])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2436
      apply (rule connected_complement_bounded_convex)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2437
      using assms yz
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2438
      by (auto simp: dist_norm)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2439
    then have "connected_component (- s) y z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2440
      apply (rule connected_component_of_subset)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2441
      apply (metis Bno Compl_anti_mono mem_cball_0 subset_iff)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2442
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2443
  } note cyz = this
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2444
  show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2445
    apply (auto simp: outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2446
    apply (metis Compl_iff bounded_iff cobounded_imp_unbounded mem_Collect_eq not_le)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2447
    apply (simp add: bounded_pos)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2448
    by (metis B connected_component_trans cyz not_le)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2449
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2450
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2451
lemma not_outside_connected_component_le:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2452
    fixes s :: "'a::euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2453
    assumes s: "bounded s"  "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2454
      shows "- (outside s) = {x. \<forall>B. \<exists>y. B \<le> norm(y) \<and> ~ (connected_component (- s) x y)}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2455
apply (auto intro: less_imp_le simp: not_outside_connected_component_lt [OF assms])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2456
by (meson gt_ex less_le_trans)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2457
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2458
lemma inside_connected_component_lt:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2459
    fixes s :: "'a::euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2460
    assumes s: "bounded s"  "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2461
      shows "inside s = {x. (x \<notin> s) \<and> (\<forall>B. \<exists>y. B < norm(y) \<and> ~(connected_component (- s) x y))}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2462
  by (auto simp: inside_outside not_outside_connected_component_lt [OF assms])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2463
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2464
lemma inside_connected_component_le:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2465
    fixes s :: "'a::euclidean_space set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2466
    assumes s: "bounded s"  "2 \<le> DIM('a)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2467
      shows "inside s = {x. (x \<notin> s) \<and> (\<forall>B. \<exists>y. B \<le> norm(y) \<and> ~(connected_component (- s) x y))}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2468
  by (auto simp: inside_outside not_outside_connected_component_le [OF assms])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2469
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2470
lemma inside_subset:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2471
  assumes "connected u" and "~bounded u" and "t \<union> u = - s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2472
  shows "inside s \<subseteq> t"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2473
apply (auto simp: inside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2474
by (metis bounded_subset [of "connected_component_set (- s) _"] connected_component_maximal
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2475
       Compl_iff Un_iff assms subsetI)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2476
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2477
lemma frontier_interiors: "frontier s = - interior(s) - interior(-s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2478
  by (simp add: Int_commute frontier_def interior_closure)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2479
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2480
lemma frontier_interior_subset: "frontier(interior S) \<subseteq> frontier S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2481
  by (simp add: Diff_mono frontier_interiors interior_mono interior_subset)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2482
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2483
lemma connected_Int_frontier:
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2484
     "\<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> (s \<inter> frontier t \<noteq> {})"
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  2485
  apply (simp add: frontier_interiors connected_openin, safe)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2486
  apply (drule_tac x="s \<inter> interior t" in spec, safe)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2487
   apply (drule_tac [2] x="s \<inter> interior (-t)" in spec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2488
   apply (auto simp: disjoint_eq_subset_Compl dest: interior_subset [THEN subsetD])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2489
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2490
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2491
lemma frontier_not_empty:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2492
  fixes S :: "'a :: real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2493
  shows "\<lbrakk>S \<noteq> {}; S \<noteq> UNIV\<rbrakk> \<Longrightarrow> frontier S \<noteq> {}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2494
    using connected_Int_frontier [of UNIV S] by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2495
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2496
lemma frontier_eq_empty:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2497
  fixes S :: "'a :: real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2498
  shows "frontier S = {} \<longleftrightarrow> S = {} \<or> S = UNIV"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2499
using frontier_UNIV frontier_empty frontier_not_empty by blast
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2500
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2501
lemma frontier_of_connected_component_subset:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2502
  fixes S :: "'a::real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2503
  shows "frontier(connected_component_set S x) \<subseteq> frontier S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2504
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2505
  { fix y
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2506
    assume y1: "y \<in> closure (connected_component_set S x)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2507
       and y2: "y \<notin> interior (connected_component_set S x)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2508
    have 1: "y \<in> closure S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2509
      using y1 closure_mono connected_component_subset by blast
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2510
    have "z \<in> interior (connected_component_set S x)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2511
          if "0 < e" "ball y e \<subseteq> interior S" "dist y z < e" for e z
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2512
    proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2513
      have "ball y e \<subseteq> connected_component_set S y"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2514
        apply (rule connected_component_maximal)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2515
        using that interior_subset mem_ball apply auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2516
        done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2517
      then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2518
        using y1 apply (simp add: closure_approachable open_contains_ball_eq [OF open_interior])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2519
        by (metis (no_types, hide_lams) connected_component_eq_eq connected_component_in subsetD
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2520
                       dist_commute mem_Collect_eq mem_ball mem_interior \<open>0 < e\<close> y2)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2521
    qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2522
    then have 2: "y \<notin> interior S"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2523
      using y2 by (force simp: open_contains_ball_eq [OF open_interior])
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2524
    note 1 2
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2525
  }
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2526
  then show ?thesis by (auto simp: frontier_def)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2527
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2528
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2529
lemma frontier_Union_subset_closure:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2530
  fixes F :: "'a::real_normed_vector set set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2531
  shows "frontier(\<Union>F) \<subseteq> closure(\<Union>t \<in> F. frontier t)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2532
proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2533
  have "\<exists>y\<in>F. \<exists>y\<in>frontier y. dist y x < e"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2534
       if "T \<in> F" "y \<in> T" "dist y x < e"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2535
          "x \<notin> interior (\<Union>F)" "0 < e" for x y e T
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2536
  proof (cases "x \<in> T")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2537
    case True with that show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2538
      by (metis Diff_iff Sup_upper closure_subset contra_subsetD dist_self frontier_def interior_mono)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2539
  next
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2540
    case False
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2541
    have 1: "closed_segment x y \<inter> T \<noteq> {}" using \<open>y \<in> T\<close> by blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2542
    have 2: "closed_segment x y - T \<noteq> {}"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2543
      using False by blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2544
    obtain c where "c \<in> closed_segment x y" "c \<in> frontier T"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2545
       using False connected_Int_frontier [OF connected_segment 1 2] by auto
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2546
    then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2547
    proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2548
      have "norm (y - x) < e"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2549
        by (metis dist_norm \<open>dist y x < e\<close>)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2550
      moreover have "norm (c - x) \<le> norm (y - x)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2551
        by (simp add: \<open>c \<in> closed_segment x y\<close> segment_bound(1))
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2552
      ultimately have "norm (c - x) < e"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2553
        by linarith
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2554
      then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2555
        by (metis (no_types) \<open>c \<in> frontier T\<close> dist_norm that(1))
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2556
    qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2557
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2558
  then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2559
    by (fastforce simp add: frontier_def closure_approachable)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2560
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2561
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2562
lemma frontier_Union_subset:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2563
  fixes F :: "'a::real_normed_vector set set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2564
  shows "finite F \<Longrightarrow> frontier(\<Union>F) \<subseteq> (\<Union>t \<in> F. frontier t)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2565
by (rule order_trans [OF frontier_Union_subset_closure])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2566
   (auto simp: closure_subset_eq)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2567
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  2568
lemma connected_component_UNIV [simp]:
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2569
    fixes x :: "'a::real_normed_vector"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2570
    shows "connected_component_set UNIV x = UNIV"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2571
using connected_iff_eq_connected_component_set [of "UNIV::'a set"] connected_UNIV
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2572
by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2573
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2574
lemma connected_component_eq_UNIV:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2575
    fixes x :: "'a::real_normed_vector"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2576
    shows "connected_component_set s x = UNIV \<longleftrightarrow> s = UNIV"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2577
  using connected_component_in connected_component_UNIV by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2578
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2579
lemma components_univ [simp]: "components UNIV = {UNIV :: 'a::real_normed_vector set}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2580
  by (auto simp: components_eq_sing_iff)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2581
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2582
lemma interior_inside_frontier:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2583
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2584
    assumes "bounded s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2585
      shows "interior s \<subseteq> inside (frontier s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2586
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2587
  { fix x y
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2588
    assume x: "x \<in> interior s" and y: "y \<notin> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2589
       and cc: "connected_component (- frontier s) x y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2590
    have "connected_component_set (- frontier s) x \<inter> frontier s \<noteq> {}"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2591
      apply (rule connected_Int_frontier, simp)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2592
      apply (metis IntI cc connected_component_in connected_component_refl empty_iff interiorE mem_Collect_eq set_rev_mp x)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2593
      using  y cc
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2594
      by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2595
    then have "bounded (connected_component_set (- frontier s) x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2596
      using connected_component_in by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2597
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2598
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2599
    apply (auto simp: inside_def frontier_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2600
    apply (rule classical)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2601
    apply (rule bounded_subset [OF assms], blast)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2602
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2603
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2604
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2605
lemma inside_empty [simp]: "inside {} = ({} :: 'a :: {real_normed_vector, perfect_space} set)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2606
  by (simp add: inside_def connected_component_UNIV)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2607
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2608
lemma outside_empty [simp]: "outside {} = (UNIV :: 'a :: {real_normed_vector, perfect_space} set)"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2609
using inside_empty inside_Un_outside by blast
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2610
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2611
lemma inside_same_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2612
   "\<lbrakk>connected_component (- s) x y; x \<in> inside s\<rbrakk> \<Longrightarrow> y \<in> inside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2613
  using connected_component_eq connected_component_in
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2614
  by (fastforce simp add: inside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2615
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2616
lemma outside_same_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2617
   "\<lbrakk>connected_component (- s) x y; x \<in> outside s\<rbrakk> \<Longrightarrow> y \<in> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2618
  using connected_component_eq connected_component_in
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2619
  by (fastforce simp add: outside_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2620
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2621
lemma convex_in_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2622
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2623
  assumes s: "convex s" and z: "z \<notin> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2624
    shows "z \<in> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2625
proof (cases "s={}")
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2626
  case True then show ?thesis by simp
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2627
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2628
  case False then obtain a where "a \<in> s" by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2629
  with z have zna: "z \<noteq> a" by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2630
  { assume "bounded (connected_component_set (- s) z)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2631
    with bounded_pos_less obtain B where "B>0" and B: "\<And>x. connected_component (- s) z x \<Longrightarrow> norm x < B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2632
      by (metis mem_Collect_eq)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  2633
    define C where "C = (B + 1 + norm z) / norm (z-a)"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2634
    have "C > 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2635
      using \<open>0 < B\<close> zna by (simp add: C_def divide_simps add_strict_increasing)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2636
    have "\<bar>norm (z + C *\<^sub>R (z-a)) - norm (C *\<^sub>R (z-a))\<bar> \<le> norm z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2637
      by (metis add_diff_cancel norm_triangle_ineq3)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2638
    moreover have "norm (C *\<^sub>R (z-a)) > norm z + B"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2639
      using zna \<open>B>0\<close> by (simp add: C_def le_max_iff_disj field_simps)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2640
    ultimately have C: "norm (z + C *\<^sub>R (z-a)) > B" by linarith
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2641
    { fix u::real
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2642
      assume u: "0\<le>u" "u\<le>1" and ins: "(1 - u) *\<^sub>R z + u *\<^sub>R (z + C *\<^sub>R (z - a)) \<in> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2643
      then have Cpos: "1 + u * C > 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2644
        by (meson \<open>0 < C\<close> add_pos_nonneg less_eq_real_def zero_le_mult_iff zero_less_one)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2645
      then have *: "(1 / (1 + u * C)) *\<^sub>R z + (u * C / (1 + u * C)) *\<^sub>R z = z"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2646
        by (simp add: scaleR_add_left [symmetric] divide_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2647
      then have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2648
        using convexD_alt [OF s \<open>a \<in> s\<close> ins, of "1/(u*C + 1)"] \<open>C>0\<close> \<open>z \<notin> s\<close> Cpos u
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2649
        by (simp add: * divide_simps algebra_simps)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2650
    } note contra = this
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2651
    have "connected_component (- s) z (z + C *\<^sub>R (z-a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2652
      apply (rule connected_componentI [OF connected_segment [of z "z + C *\<^sub>R (z-a)"]])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2653
      apply (simp add: closed_segment_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2654
      using contra
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2655
      apply auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2656
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2657
    then have False
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2658
      using zna B [of "z + C *\<^sub>R (z-a)"] C
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2659
      by (auto simp: divide_simps max_mult_distrib_right)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2660
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2661
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2662
    by (auto simp: outside_def z)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2663
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2664
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2665
lemma outside_convex:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2666
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2667
  assumes "convex s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2668
    shows "outside s = - s"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2669
  by (metis ComplD assms convex_in_outside equalityI inside_Un_outside subsetI sup.cobounded2)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2670
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2671
lemma inside_convex:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2672
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2673
  shows "convex s \<Longrightarrow> inside s = {}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2674
  by (simp add: inside_outside outside_convex)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2675
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2676
lemma outside_subset_convex:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2677
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2678
  shows "\<lbrakk>convex t; s \<subseteq> t\<rbrakk> \<Longrightarrow> - t \<subseteq> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2679
  using outside_convex outside_mono by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2680
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2681
lemma outside_frontier_misses_closure:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2682
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2683
    assumes "bounded s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2684
    shows  "outside(frontier s) \<subseteq> - closure s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2685
  unfolding outside_inside Lattices.boolean_algebra_class.compl_le_compl_iff
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2686
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2687
  { assume "interior s \<subseteq> inside (frontier s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2688
    hence "interior s \<union> inside (frontier s) = inside (frontier s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2689
      by (simp add: subset_Un_eq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2690
    then have "closure s \<subseteq> frontier s \<union> inside (frontier s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2691
      using frontier_def by auto
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2692
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2693
  then show "closure s \<subseteq> frontier s \<union> inside (frontier s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2694
    using interior_inside_frontier [OF assms] by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2695
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2696
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2697
lemma outside_frontier_eq_complement_closure:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2698
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2699
    assumes "bounded s" "convex s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2700
      shows "outside(frontier s) = - closure s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2701
by (metis Diff_subset assms convex_closure frontier_def outside_frontier_misses_closure
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2702
          outside_subset_convex subset_antisym)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2703
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2704
lemma inside_frontier_eq_interior:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2705
     fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2706
     shows "\<lbrakk>bounded s; convex s\<rbrakk> \<Longrightarrow> inside(frontier s) = interior s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2707
  apply (simp add: inside_outside outside_frontier_eq_complement_closure)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2708
  using closure_subset interior_subset
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2709
  apply (auto simp add: frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2710
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2711
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2712
lemma open_inside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2713
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2714
    assumes "closed s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2715
      shows "open (inside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2716
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2717
  { fix x assume x: "x \<in> inside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2718
    have "open (connected_component_set (- s) x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2719
      using assms open_connected_component by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2720
    then obtain e where e: "e>0" and e: "\<And>y. dist y x < e \<longrightarrow> connected_component (- s) x y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2721
      using dist_not_less_zero
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2722
      apply (simp add: open_dist)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2723
      by (metis (no_types, lifting) Compl_iff connected_component_refl_eq inside_def mem_Collect_eq x)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2724
    then have "\<exists>e>0. ball x e \<subseteq> inside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2725
      by (metis e dist_commute inside_same_component mem_ball subsetI x)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2726
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2727
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2728
    by (simp add: open_contains_ball)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2729
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2730
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2731
lemma open_outside:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2732
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2733
    assumes "closed s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2734
      shows "open (outside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2735
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2736
  { fix x assume x: "x \<in> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2737
    have "open (connected_component_set (- s) x)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2738
      using assms open_connected_component by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2739
    then obtain e where e: "e>0" and e: "\<And>y. dist y x < e \<longrightarrow> connected_component (- s) x y"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2740
      using dist_not_less_zero
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2741
      apply (simp add: open_dist)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2742
      by (metis Int_iff outside_def connected_component_refl_eq  x)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2743
    then have "\<exists>e>0. ball x e \<subseteq> outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2744
      by (metis e dist_commute outside_same_component mem_ball subsetI x)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2745
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2746
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2747
    by (simp add: open_contains_ball)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2748
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2749
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2750
lemma closure_inside_subset:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2751
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2752
    assumes "closed s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2753
      shows "closure(inside s) \<subseteq> s \<union> inside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2754
by (metis assms closure_minimal open_closed open_outside sup.cobounded2 union_with_inside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2755
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2756
lemma frontier_inside_subset:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2757
    fixes s :: "'a::real_normed_vector set"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2758
    assumes "closed s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2759
      shows "frontier(inside s) \<subseteq> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2760
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2761
  have "closure (inside s) \<inter> - inside s = closure (inside s) - interior (inside s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2762
    by (metis (no_types) Diff_Compl assms closure_closed interior_closure open_closed open_inside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2763
  moreover have "- inside s \<inter> - outside s = s"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2764
    by (metis (no_types) compl_sup double_compl inside_Un_outside)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2765
  moreover have "closure (inside s) \<subseteq> - outside s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2766
    by (metis (no_types) assms closure_inside_subset union_with_inside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2767
  ultimately have "closure (inside s) - interior (inside s) \<subseteq> s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2768
    by blast
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2769
  then show ?thesis
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2770
    by (simp add: frontier_def open_inside interior_open)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2771
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2772
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2773
lemma closure_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2774
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2775
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2776
      shows "closure(outside s) \<subseteq> s \<union> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2777
  apply (rule closure_minimal, simp)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2778
  by (metis assms closed_open inside_outside open_inside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2779
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2780
lemma frontier_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2781
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2782
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2783
      shows "frontier(outside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2784
  apply (simp add: frontier_def open_outside interior_open)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2785
  by (metis Diff_subset_conv assms closure_outside_subset interior_eq open_outside sup.commute)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2786
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2787
lemma inside_complement_unbounded_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2788
     "\<lbrakk>connected (- s); \<not> bounded (- s)\<rbrakk> \<Longrightarrow> inside s = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2789
  apply (simp add: inside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2790
  by (meson Compl_iff bounded_subset connected_component_maximal order_refl)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2791
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2792
lemma inside_bounded_complement_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2793
    fixes s :: "'a::{real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2794
    shows "\<lbrakk>connected (- s); bounded s\<rbrakk> \<Longrightarrow> inside s = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2795
  by (metis inside_complement_unbounded_connected_empty cobounded_imp_unbounded)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2796
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2797
lemma inside_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2798
    assumes "s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2799
    shows "inside s - t \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2800
unfolding inside_def
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2801
proof clarify
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2802
  fix x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2803
  assume x: "x \<notin> t" "x \<notin> s" and bo: "bounded (connected_component_set (- s) x)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2804
  show "bounded (connected_component_set (- t) x)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2805
  proof (cases "s \<inter> connected_component_set (- t) x = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2806
    case True show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2807
      apply (rule bounded_subset [OF bo])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2808
      apply (rule connected_component_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2809
      using x True apply auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2810
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2811
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2812
    case False then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2813
      using assms [unfolded inside_def] x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2814
      apply (simp add: disjoint_iff_not_equal, clarify)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2815
      apply (drule subsetD, assumption, auto)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2816
      by (metis (no_types, hide_lams) ComplI connected_component_eq_eq)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2817
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2818
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2819
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2820
lemma inside_inside_subset: "inside(inside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2821
  using inside_inside union_with_outside by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2822
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2823
lemma inside_outside_intersect_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2824
      "\<lbrakk>connected t; inside s \<inter> t \<noteq> {}; outside s \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> s \<inter> t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2825
  apply (simp add: inside_def outside_def ex_in_conv [symmetric] disjoint_eq_subset_Compl, clarify)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2826
  by (metis (no_types, hide_lams) Compl_anti_mono connected_component_eq connected_component_maximal contra_subsetD double_compl)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2827
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2828
lemma outside_bounded_nonempty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2829
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2830
    assumes "bounded s" shows "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2831
  by (metis (no_types, lifting) Collect_empty_eq Collect_mem_eq Compl_eq_Diff_UNIV Diff_cancel
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2832
                   Diff_disjoint UNIV_I assms ball_eq_empty bounded_diff cobounded_outside convex_ball
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2833
                   double_complement order_refl outside_convex outside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2834
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2835
lemma outside_compact_in_open:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2836
    fixes s :: "'a :: {real_normed_vector,perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2837
    assumes s: "compact s" and t: "open t" and "s \<subseteq> t" "t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2838
      shows "outside s \<inter> t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2839
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2840
  have "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2841
    by (simp add: compact_imp_bounded outside_bounded_nonempty s)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2842
  with assms obtain a b where a: "a \<in> outside s" and b: "b \<in> t" by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2843
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2844
  proof (cases "a \<in> t")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2845
    case True with a show ?thesis by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2846
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2847
    case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2848
      have front: "frontier t \<subseteq> - s"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2849
        using \<open>s \<subseteq> t\<close> frontier_disjoint_eq t by auto
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2850
      { fix \<gamma>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2851
        assume "path \<gamma>" and pimg_sbs: "path_image \<gamma> - {pathfinish \<gamma>} \<subseteq> interior (- t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2852
           and pf: "pathfinish \<gamma> \<in> frontier t" and ps: "pathstart \<gamma> = a"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  2853
        define c where "c = pathfinish \<gamma>"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2854
        have "c \<in> -s" unfolding c_def using front pf by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2855
        moreover have "open (-s)" using s compact_imp_closed by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2856
        ultimately obtain \<epsilon>::real where "\<epsilon> > 0" and \<epsilon>: "cball c \<epsilon> \<subseteq> -s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2857
          using open_contains_cball[of "-s"] s by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2858
        then obtain d where "d \<in> t" and d: "dist d c < \<epsilon>"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2859
          using closure_approachable [of c t] pf unfolding c_def
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2860
          by (metis Diff_iff frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2861
        then have "d \<in> -s" using \<epsilon>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2862
          using dist_commute by (metis contra_subsetD mem_cball not_le not_less_iff_gr_or_eq)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2863
        have pimg_sbs_cos: "path_image \<gamma> \<subseteq> -s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2864
          using pimg_sbs apply (auto simp: path_image_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2865
          apply (drule subsetD)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2866
          using \<open>c \<in> - s\<close> \<open>s \<subseteq> t\<close> interior_subset apply (auto simp: c_def)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2867
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2868
        have "closed_segment c d \<le> cball c \<epsilon>"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2869
          apply (simp add: segment_convex_hull)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2870
          apply (rule hull_minimal)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2871
          using  \<open>\<epsilon> > 0\<close> d apply (auto simp: dist_commute)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2872
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2873
        with \<epsilon> have "closed_segment c d \<subseteq> -s" by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2874
        moreover have con_gcd: "connected (path_image \<gamma> \<union> closed_segment c d)"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2875
          by (rule connected_Un) (auto simp: c_def \<open>path \<gamma>\<close> connected_path_image)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2876
        ultimately have "connected_component (- s) a d"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2877
          unfolding connected_component_def using pimg_sbs_cos ps by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2878
        then have "outside s \<inter> t \<noteq> {}"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2879
          using outside_same_component [OF _ a]  by (metis IntI \<open>d \<in> t\<close> empty_iff)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2880
      } note * = this
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2881
      have pal: "pathstart (linepath a b) \<in> closure (- t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2882
        by (auto simp: False closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2883
      show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2884
        by (rule exists_path_subpath_to_frontier [OF path_linepath pal _ *]) (auto simp: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2885
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2886
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2887
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2888
lemma inside_inside_compact_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2889
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2890
    assumes s: "closed s" and t: "compact t" and "connected t" "s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2891
      shows "inside s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2892
proof (cases "inside t = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2893
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2894
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2895
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2896
  consider "DIM('a) = 1" | "DIM('a) \<ge> 2"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2897
    using antisym not_less_eq_eq by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2898
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2899
  proof cases
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2900
    case 1 then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2901
             using connected_convex_1_gen assms False inside_convex by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2902
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2903
    case 2
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2904
    have coms: "compact s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2905
      using assms apply (simp add: s compact_eq_bounded_closed)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2906
       by (meson bounded_inside bounded_subset compact_imp_bounded)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2907
    then have bst: "bounded (s \<union> t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2908
      by (simp add: compact_imp_bounded t)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2909
    then obtain r where "0 < r" and r: "s \<union> t \<subseteq> ball 0 r"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2910
      using bounded_subset_ballD by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2911
    have outst: "outside s \<inter> outside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2912
    proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2913
      have "- ball 0 r \<subseteq> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2914
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2915
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2916
      moreover have "- ball 0 r \<subseteq> outside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2917
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2918
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2919
      ultimately show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2920
        by (metis Compl_subset_Compl_iff Int_subset_iff bounded_ball inf.orderE outside_bounded_nonempty outside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2921
    qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2922
    have "s \<inter> t = {}" using assms
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2923
      by (metis disjoint_iff_not_equal inside_no_overlap subsetCE)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2924
    moreover have "outside s \<inter> inside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2925
      by (meson False assms(4) compact_eq_bounded_closed coms open_inside outside_compact_in_open t)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2926
    ultimately have "inside s \<inter> t = {}"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2927
      using inside_outside_intersect_connected [OF \<open>connected t\<close>, of s]
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2928
      by (metis "2" compact_eq_bounded_closed coms connected_outside inf.commute inside_outside_intersect_connected outst)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2929
    then show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2930
      using inside_inside [OF \<open>s \<subseteq> inside t\<close>] by blast
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2931
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2932
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2933
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2934
lemma connected_with_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2935
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2936
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2937
      shows "connected(s \<union> inside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2938
proof (cases "s \<union> inside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2939
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2940
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2941
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2942
  then obtain b where b: "b \<notin> s" "b \<notin> inside s" by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2943
  have *: "\<exists>y t. y \<in> s \<and> connected t \<and> a \<in> t \<and> y \<in> t \<and> t \<subseteq> (s \<union> inside s)" if "a \<in> (s \<union> inside s)" for a
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2944
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2945
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2946
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2947
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2948
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2949
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2950
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2951
    assume a: "a \<in> inside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2952
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2953
      apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "inside s"])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2954
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2955
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2956
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2957
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2958
      apply (simp add: pathfinish_in_path_image connected_path_image, auto)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2959
      using frontier_inside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2960
      by (metis (no_types, lifting) frontier_inside_subset insertE insert_Diff interior_eq open_inside pathfinish_in_path_image s subsetCE)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2961
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2962
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2963
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2964
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2965
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2966
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2967
    apply (rule_tac x="(s \<union> t \<union> t')" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2968
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2969
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2970
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2971
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2972
text\<open>The proof is virtually the same as that above.\<close>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2973
lemma connected_with_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2974
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2975
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2976
      shows "connected(s \<union> outside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2977
proof (cases "s \<union> outside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2978
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2979
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2980
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2981
  then obtain b where b: "b \<notin> s" "b \<notin> outside s" by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2982
  have *: "\<exists>y t. y \<in> s \<and> connected t \<and> a \<in> t \<and> y \<in> t \<and> t \<subseteq> (s \<union> outside s)" if "a \<in> (s \<union> outside s)" for a
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2983
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2984
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2985
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2986
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2987
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2988
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2989
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2990
    assume a: "a \<in> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2991
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2992
      apply (rule exists_path_subpath_to_frontier [OF path_linepath [of a b], of "outside s"])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2993
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2994
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2995
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2996
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2997
      apply (simp add: pathfinish_in_path_image connected_path_image, auto)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2998
      using frontier_outside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2999
      by (metis (no_types, lifting) frontier_outside_subset insertE insert_Diff interior_eq open_outside pathfinish_in_path_image s subsetCE)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3000
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3001
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3002
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3003
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3004
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3005
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3006
    apply (rule_tac x="(s \<union> t \<union> t')" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3007
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3008
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3009
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3010
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3011
lemma inside_inside_eq_empty [simp]:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3012
    fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3013
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3014
      shows "inside (inside s) = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3015
  by (metis (no_types) unbounded_outside connected_with_outside [OF assms] bounded_Un
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3016
           inside_complement_unbounded_connected_empty unbounded_outside union_with_outside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3017
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3018
lemma inside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3019
     "inside s \<in> components (- s) \<longleftrightarrow> connected(inside s) \<and> inside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3020
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3021
  apply (auto intro: inside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3022
  apply (metis IntI empty_iff inside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3023
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3024
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3025
text\<open>The proof is virtually the same as that above.\<close>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3026
lemma outside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3027
     "outside s \<in> components (- s) \<longleftrightarrow> connected(outside s) \<and> outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3028
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3029
  apply (auto intro: outside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3030
  apply (metis IntI empty_iff outside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3031
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3032
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3033
lemma bounded_unique_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3034
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3035
    shows "\<lbrakk>bounded s; DIM('a) \<ge> 2\<rbrakk> \<Longrightarrow> (c \<in> components (- s) \<and> ~bounded c \<longleftrightarrow> c = outside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3036
  apply (rule iffI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3037
  apply (metis cobounded_unique_unbounded_components connected_outside double_compl outside_bounded_nonempty outside_in_components unbounded_outside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3038
  by (simp add: connected_outside outside_bounded_nonempty outside_in_components unbounded_outside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3039
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3040
subsection\<open>Condition for an open map's image to contain a ball\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3041
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3042
lemma ball_subset_open_map_image:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3043
  fixes f :: "'a::heine_borel \<Rightarrow> 'b :: {real_normed_vector,heine_borel}"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3044
  assumes contf: "continuous_on (closure S) f"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3045
      and oint: "open (f ` interior S)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3046
      and le_no: "\<And>z. z \<in> frontier S \<Longrightarrow> r \<le> norm(f z - f a)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3047
      and "bounded S" "a \<in> S" "0 < r"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3048
    shows "ball (f a) r \<subseteq> f ` S"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3049
proof (cases "f ` S = UNIV")
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3050
  case True then show ?thesis by simp
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3051
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3052
  case False
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3053
    obtain w where w: "w \<in> frontier (f ` S)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3054
               and dw_le: "\<And>y. y \<in> frontier (f ` S) \<Longrightarrow> norm (f a - w) \<le> norm (f a - y)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3055
      apply (rule distance_attains_inf [of "frontier(f ` S)" "f a"])
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3056
      using \<open>a \<in> S\<close> by (auto simp: frontier_eq_empty dist_norm False)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3057
    then obtain \<xi> where \<xi>: "\<And>n. \<xi> n \<in> f ` S" and tendsw: "\<xi> \<longlonglongrightarrow> w"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3058
      by (metis Diff_iff frontier_def closure_sequential)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3059
    then have "\<And>n. \<exists>x \<in> S. \<xi> n = f x" by force
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3060
    then obtain z where zs: "\<And>n. z n \<in> S" and fz: "\<And>n. \<xi> n = f (z n)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3061
      by metis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3062
    then obtain y K where y: "y \<in> closure S" and "subseq K" and Klim: "(z \<circ> K) \<longlonglongrightarrow> y"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3063
      using \<open>bounded S\<close>
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3064
      apply (simp add: compact_closure [symmetric] compact_def)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3065
      apply (drule_tac x=z in spec)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3066
      using closure_subset apply force
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3067
      done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3068
    then have ftendsw: "((\<lambda>n. f (z n)) \<circ> K) \<longlonglongrightarrow> w"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3069
      by (metis LIMSEQ_subseq_LIMSEQ fun.map_cong0 fz tendsw)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3070
    have zKs: "\<And>n. (z o K) n \<in> S" by (simp add: zs)
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63469
diff changeset
  3071
    have fz: "f \<circ> z = \<xi>"  "(\<lambda>n. f (z n)) = \<xi>"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3072
      using fz by auto
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63469
diff changeset
  3073
    then have "(\<xi> \<circ> K) \<longlonglongrightarrow> f y"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3074
      by (metis (no_types) Klim zKs y contf comp_assoc continuous_on_closure_sequentially)
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63469
diff changeset
  3075
    with fz have wy: "w = f y" using fz LIMSEQ_unique ftendsw by auto
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3076
    have rle: "r \<le> norm (f y - f a)"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3077
      apply (rule le_no)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3078
      using w wy oint
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3079
      by (force simp: imageI image_mono interiorI interior_subset frontier_def y)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3080
    have **: "(~(b \<inter> (- S) = {}) \<and> ~(b - (- S) = {}) \<Longrightarrow> (b \<inter> f \<noteq> {}))
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3081
              \<Longrightarrow> (b \<inter> S \<noteq> {}) \<Longrightarrow> b \<inter> f = {} \<Longrightarrow>
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  3082
              b \<subseteq> S" for b f and S :: "'b set"
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3083
      by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3084
    show ?thesis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3085
      apply (rule **)   (*such a horrible mess*)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3086
      apply (rule connected_Int_frontier [where t = "f`S", OF connected_ball])
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  3087
      using \<open>a \<in> S\<close> \<open>0 < r\<close>
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3088
      apply (auto simp: disjoint_iff_not_equal  dist_norm)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3089
      by (metis dw_le norm_minus_commute not_less order_trans rle wy)
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3090
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3091
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3092
section\<open> Homotopy of maps p,q : X=>Y with property P of all intermediate maps.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3093
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3094
text\<open> We often just want to require that it fixes some subset, but to take in
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3095
  the case of a loop homotopy, it's convenient to have a general property P.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3096
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3097
definition homotopic_with ::
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3098
  "[('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool, 'a set, 'b set, 'a \<Rightarrow> 'b, 'a \<Rightarrow> 'b] \<Rightarrow> bool"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3099
where
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3100
 "homotopic_with P X Y p q \<equiv>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3101
   (\<exists>h:: real \<times> 'a \<Rightarrow> 'b.
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3102
       continuous_on ({0..1} \<times> X) h \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3103
       h ` ({0..1} \<times> X) \<subseteq> Y \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3104
       (\<forall>x. h(0, x) = p x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3105
       (\<forall>x. h(1, x) = q x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3106
       (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t, x))))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3107
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3108
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3109
text\<open> We often want to just localize the ending function equality or whatever.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3110
proposition homotopic_with:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3111
  fixes X :: "'a::topological_space set" and Y :: "'b::topological_space set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3112
  assumes "\<And>h k. (\<And>x. x \<in> X \<Longrightarrow> h x = k x) \<Longrightarrow> (P h \<longleftrightarrow> P k)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3113
  shows "homotopic_with P X Y p q \<longleftrightarrow>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3114
           (\<exists>h :: real \<times> 'a \<Rightarrow> 'b.
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3115
              continuous_on ({0..1} \<times> X) h \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3116
              h ` ({0..1} \<times> X) \<subseteq> Y \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3117
              (\<forall>x \<in> X. h(0,x) = p x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3118
              (\<forall>x \<in> X. h(1,x) = q x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3119
              (\<forall>t \<in> {0..1}. P(\<lambda>x. h(t, x))))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3120
  unfolding homotopic_with_def
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3121
  apply (rule iffI, blast, clarify)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3122
  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)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3123
  apply (auto simp:)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3124
  apply (force elim: continuous_on_eq)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3125
  apply (drule_tac x=t in bspec, force)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3126
  apply (subst assms; simp)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3127
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3128
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3129
proposition homotopic_with_eq:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3130
   assumes h: "homotopic_with P X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3131
       and f': "\<And>x. x \<in> X \<Longrightarrow> f' x = f x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3132
       and g': "\<And>x. x \<in> X \<Longrightarrow> g' x = g x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3133
       and P:  "(\<And>h k. (\<And>x. x \<in> X \<Longrightarrow> h x = k x) \<Longrightarrow> (P h \<longleftrightarrow> P k))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3134
   shows "homotopic_with P X Y f' g'"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3135
  using h unfolding homotopic_with_def
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3136
  apply safe
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3137
  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)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3138
  apply (simp add: f' g', safe)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3139
  apply (fastforce intro: continuous_on_eq)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3140
  apply fastforce
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3141
  apply (subst P; fastforce)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3142
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3143
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3144
proposition homotopic_with_equal:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3145
   assumes contf: "continuous_on X f" and fXY: "f ` X \<subseteq> Y"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3146
       and gf: "\<And>x. x \<in> X \<Longrightarrow> g x = f x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3147
       and P:  "P f" "P g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3148
   shows "homotopic_with P X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3149
  unfolding homotopic_with_def
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3150
  apply (rule_tac x="\<lambda>(u,v). if u = 1 then g v else f v" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3151
  using assms
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3152
  apply (intro conjI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3153
  apply (rule continuous_on_eq [where f = "f o snd"])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3154
  apply (rule continuous_intros | force)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3155
  apply clarify
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3156
  apply (case_tac "t=1"; force)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3157
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3158
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3159
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3160
lemma image_Pair_const: "(\<lambda>x. (x, c)) ` A = A \<times> {c}"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3161
  by (auto simp:)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3162
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3163
lemma homotopic_constant_maps:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3164
   "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b) \<longleftrightarrow> s = {} \<or> path_component t a b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3165
proof (cases "s = {} \<or> t = {}")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3166
  case True with continuous_on_const show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3167
    by (auto simp: homotopic_with path_component_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3168
next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3169
  case False
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3170
  then obtain c where "c \<in> s" by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3171
  show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3172
  proof
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3173
    assume "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3174
    then obtain h :: "real \<times> 'a \<Rightarrow> 'b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3175
        where conth: "continuous_on ({0..1} \<times> s) h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3176
          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)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3177
      by (auto simp: homotopic_with)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3178
    have "continuous_on {0..1} (h \<circ> (\<lambda>t. (t, c)))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3179
      apply (rule continuous_intros conth | simp add: image_Pair_const)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3180
      apply (blast intro:  \<open>c \<in> s\<close> continuous_on_subset [OF conth] )
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3181
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3182
    with \<open>c \<in> s\<close> h show "s = {} \<or> path_component t a b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3183
      apply (simp_all add: homotopic_with path_component_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3184
      apply (auto simp:)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3185
      apply (drule_tac x="h o (\<lambda>t. (t, c))" in spec)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3186
      apply (auto simp: pathstart_def pathfinish_def path_image_def path_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3187
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3188
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3189
    assume "s = {} \<or> path_component t a b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3190
    with False show "homotopic_with (\<lambda>x. True) s t (\<lambda>x. a) (\<lambda>x. b)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3191
      apply (clarsimp simp: homotopic_with path_component_def pathstart_def pathfinish_def path_image_def path_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3192
      apply (rule_tac x="g o fst" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3193
      apply (rule conjI continuous_intros | force)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3194
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3195
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3196
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3197
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3198
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3199
subsection\<open> Trivial properties.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3200
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3201
lemma homotopic_with_imp_property: "homotopic_with P X Y f g \<Longrightarrow> P f \<and> P g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3202
  unfolding homotopic_with_def Ball_def
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3203
  apply clarify
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3204
  apply (frule_tac x=0 in spec)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3205
  apply (drule_tac x=1 in spec)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3206
  apply (auto simp:)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3207
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3208
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3209
lemma continuous_on_o_Pair: "\<lbrakk>continuous_on (T \<times> X) h; t \<in> T\<rbrakk> \<Longrightarrow> continuous_on X (h o Pair t)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3210
  by (fast intro: continuous_intros elim!: continuous_on_subset)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3211
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3212
lemma homotopic_with_imp_continuous:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3213
    assumes "homotopic_with P X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3214
    shows "continuous_on X f \<and> continuous_on X g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3215
proof -
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3216
  obtain h :: "real \<times> 'a \<Rightarrow> 'b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3217
    where conth: "continuous_on ({0..1} \<times> X) h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3218
      and h: "\<forall>x. h (0, x) = f x" "\<forall>x. h (1, x) = g x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3219
    using assms by (auto simp: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3220
  have *: "t \<in> {0..1} \<Longrightarrow> continuous_on X (h o (\<lambda>x. (t,x)))" for t
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3221
    by (rule continuous_intros continuous_on_subset [OF conth] | force)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3222
  show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3223
    using h *[of 0] *[of 1] by auto
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3224
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3225
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3226
proposition homotopic_with_imp_subset1:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3227
     "homotopic_with P X Y f g \<Longrightarrow> f ` X \<subseteq> Y"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3228
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3229
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3230
proposition homotopic_with_imp_subset2:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3231
     "homotopic_with P X Y f g \<Longrightarrow> g ` X \<subseteq> Y"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3232
  by (simp add: homotopic_with_def image_subset_iff) (metis atLeastAtMost_iff order_refl zero_le_one)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3233
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3234
proposition homotopic_with_mono:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3235
    assumes hom: "homotopic_with P X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3236
        and Q: "\<And>h. \<lbrakk>continuous_on X h; image h X \<subseteq> Y \<and> P h\<rbrakk> \<Longrightarrow> Q h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3237
      shows "homotopic_with Q X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3238
  using hom
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3239
  apply (simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3240
  apply (erule ex_forward)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3241
  apply (force simp: intro!: Q dest: continuous_on_o_Pair)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3242
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3243
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3244
proposition homotopic_with_subset_left:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3245
     "\<lbrakk>homotopic_with P X Y f g; Z \<subseteq> X\<rbrakk> \<Longrightarrow> homotopic_with P Z Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3246
  apply (simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3247
  apply (fast elim!: continuous_on_subset ex_forward)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3248
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3249
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3250
proposition homotopic_with_subset_right:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3251
     "\<lbrakk>homotopic_with P X Y f g; Y \<subseteq> Z\<rbrakk> \<Longrightarrow> homotopic_with P X Z f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3252
  apply (simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3253
  apply (fast elim!: continuous_on_subset ex_forward)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3254
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3255
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3256
proposition homotopic_with_compose_continuous_right:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3257
    "\<lbrakk>homotopic_with (\<lambda>f. p (f \<circ> h)) X Y f g; continuous_on W h; h ` W \<subseteq> X\<rbrakk>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3258
     \<Longrightarrow> homotopic_with p W Y (f o h) (g o h)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3259
  apply (clarsimp simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3260
  apply (rename_tac k)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3261
  apply (rule_tac x="k o (\<lambda>y. (fst y, h (snd y)))" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3262
  apply (rule conjI continuous_intros continuous_on_compose [where f=snd and g=h, unfolded o_def] | simp)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3263
  apply (erule continuous_on_subset)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3264
  apply (fastforce simp: o_def)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3265
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3266
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3267
proposition homotopic_compose_continuous_right:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3268
     "\<lbrakk>homotopic_with (\<lambda>f. True) X Y f g; continuous_on W h; h ` W \<subseteq> X\<rbrakk>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3269
      \<Longrightarrow> homotopic_with (\<lambda>f. True) W Y (f o h) (g o h)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3270
  using homotopic_with_compose_continuous_right by fastforce
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3271
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3272
proposition homotopic_with_compose_continuous_left:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3273
     "\<lbrakk>homotopic_with (\<lambda>f. p (h \<circ> f)) X Y f g; continuous_on Y h; h ` Y \<subseteq> Z\<rbrakk>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3274
      \<Longrightarrow> homotopic_with p X Z (h o f) (h o g)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3275
  apply (clarsimp simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3276
  apply (rename_tac k)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3277
  apply (rule_tac x="h o k" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3278
  apply (rule conjI continuous_intros continuous_on_compose [where f=snd and g=h, unfolded o_def] | simp)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3279
  apply (erule continuous_on_subset)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3280
  apply (fastforce simp: o_def)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3281
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3282
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3283
proposition homotopic_compose_continuous_left:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  3284
   "\<lbrakk>homotopic_with (\<lambda>_. True) X Y f g;
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  3285
     continuous_on Y h; h ` Y \<subseteq> Z\<rbrakk>
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  3286
    \<Longrightarrow> homotopic_with (\<lambda>f. True) X Z (h o f) (h o g)"
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3287
  using homotopic_with_compose_continuous_left by fastforce
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3288
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3289
proposition homotopic_with_Pair:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3290
   assumes hom: "homotopic_with p s t f g" "homotopic_with p' s' t' f' g'"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3291
       and q: "\<And>f g. \<lbrakk>p f; p' g\<rbrakk> \<Longrightarrow> q(\<lambda>(x,y). (f x, g y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3292
     shows "homotopic_with q (s \<times> s') (t \<times> t')
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3293
                  (\<lambda>(x,y). (f x, f' y)) (\<lambda>(x,y). (g x, g' y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3294
  using hom
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3295
  apply (clarsimp simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3296
  apply (rename_tac k k')
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3297
  apply (rule_tac x="\<lambda>z. ((k o (\<lambda>x. (fst x, fst (snd x)))) z, (k' o (\<lambda>x. (fst x, snd (snd x)))) z)" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3298
  apply (rule conjI continuous_intros | erule continuous_on_subset | clarsimp)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3299
  apply (auto intro!: q [unfolded case_prod_unfold])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3300
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3301
62843
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  3302
lemma homotopic_on_empty [simp]: "homotopic_with (\<lambda>x. True) {} t f g"
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3303
  by (metis continuous_on_def empty_iff homotopic_with_equal image_subset_iff)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3304
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3305
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3306
text\<open>Homotopy with P is an equivalence relation (on continuous functions mapping X into Y that satisfy P,
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3307
     though this only affects reflexivity.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3308
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3309
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3310
proposition homotopic_with_refl:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3311
   "homotopic_with P X Y f f \<longleftrightarrow> continuous_on X f \<and> image f X \<subseteq> Y \<and> P f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3312
  apply (rule iffI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3313
  using homotopic_with_imp_continuous homotopic_with_imp_property homotopic_with_imp_subset2 apply blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3314
  apply (simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3315
  apply (rule_tac x="f o snd" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3316
  apply (rule conjI continuous_intros | force)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3317
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3318
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3319
lemma homotopic_with_symD:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3320
  fixes X :: "'a::real_normed_vector set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3321
    assumes "homotopic_with P X Y f g"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3322
      shows "homotopic_with P X Y g f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3323
  using assms
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3324
  apply (clarsimp simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3325
  apply (rename_tac h)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3326
  apply (rule_tac x="h o (\<lambda>y. (1 - fst y, snd y))" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3327
  apply (rule conjI continuous_intros | erule continuous_on_subset | force simp add: image_subset_iff)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3328
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3329
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3330
proposition homotopic_with_sym:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3331
    fixes X :: "'a::real_normed_vector set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3332
    shows "homotopic_with P X Y f g \<longleftrightarrow> homotopic_with P X Y g f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3333
  using homotopic_with_symD by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3334
61699
a81dc5c4d6a9 New theorems mostly from Peter Gammie
paulson <lp15@cam.ac.uk>
parents: 61694
diff changeset
  3335
lemma split_01: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
a81dc5c4d6a9 New theorems mostly from Peter Gammie
paulson <lp15@cam.ac.uk>
parents: 61694
diff changeset
  3336
  by force
a81dc5c4d6a9 New theorems mostly from Peter Gammie
paulson <lp15@cam.ac.uk>
parents: 61694
diff changeset
  3337
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3338
lemma split_01_prod: "{0..1::real} \<times> X = ({0..1/2} \<times> X) \<union> ({1/2..1} \<times> X)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3339
  by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3340
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3341
proposition homotopic_with_trans:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3342
    fixes X :: "'a::real_normed_vector set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3343
    assumes "homotopic_with P X Y f g" and "homotopic_with P X Y g h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3344
      shows "homotopic_with P X Y f h"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3345
proof -
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3346
  have clo1: "closedin (subtopology euclidean ({0..1/2} \<times> X \<union> {1/2..1} \<times> X)) ({0..1/2::real} \<times> X)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3347
    apply (simp add: closedin_closed split_01_prod [symmetric])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3348
    apply (rule_tac x="{0..1/2} \<times> UNIV" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3349
    apply (force simp add: closed_Times)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3350
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3351
  have clo2: "closedin (subtopology euclidean ({0..1/2} \<times> X \<union> {1/2..1} \<times> X)) ({1/2..1::real} \<times> X)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3352
    apply (simp add: closedin_closed split_01_prod [symmetric])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3353
    apply (rule_tac x="{1/2..1} \<times> UNIV" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3354
    apply (force simp add: closed_Times)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3355
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3356
  { fix k1 k2:: "real \<times> 'a \<Rightarrow> 'b"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3357
    assume cont: "continuous_on ({0..1} \<times> X) k1" "continuous_on ({0..1} \<times> X) k2"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3358
       and Y: "k1 ` ({0..1} \<times> X) \<subseteq> Y" "k2 ` ({0..1} \<times> X) \<subseteq> Y"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3359
       and geq: "\<forall>x. k1 (1, x) = g x" "\<forall>x. k2 (0, x) = g x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3360
       and k12: "\<forall>x. k1 (0, x) = f x" "\<forall>x. k2 (1, x) = h x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3361
       and P:   "\<forall>t\<in>{0..1}. P (\<lambda>x. k1 (t, x))" "\<forall>t\<in>{0..1}. P (\<lambda>x. k2 (t, x))"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3362
    define k where "k y =
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3363
      (if fst y \<le> 1 / 2
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3364
       then (k1 o (\<lambda>x. (2 *\<^sub>R fst x, snd x))) y
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3365
       else (k2 o (\<lambda>x. (2 *\<^sub>R fst x -1, snd x))) y)" for y
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3366
    have keq: "k1 (2 * u, v) = k2 (2 * u - 1, v)" if "u = 1/2"  for u v
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3367
      by (simp add: geq that)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3368
    have "continuous_on ({0..1} \<times> X) k"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3369
      using cont
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3370
      apply (simp add: split_01_prod k_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3371
      apply (rule clo1 clo2 continuous_on_cases_local continuous_intros | erule continuous_on_subset | simp add: linear image_subset_iff)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3372
      apply (force simp add: keq)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3373
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3374
    moreover have "k ` ({0..1} \<times> X) \<subseteq> Y"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3375
      using Y by (force simp add: k_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3376
    moreover have "\<forall>x. k (0, x) = f x"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3377
      by (simp add: k_def k12)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3378
    moreover have "(\<forall>x. k (1, x) = h x)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3379
      by (simp add: k_def k12)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3380
    moreover have "\<forall>t\<in>{0..1}. P (\<lambda>x. k (t, x))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3381
      using P
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3382
      apply (clarsimp simp add: k_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3383
      apply (case_tac "t \<le> 1/2")
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3384
      apply (auto simp:)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3385
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3386
    ultimately have *: "\<exists>k :: real \<times> 'a \<Rightarrow> 'b.
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3387
                       continuous_on ({0..1} \<times> X) k \<and> k ` ({0..1} \<times> X) \<subseteq> Y \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3388
                       (\<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)))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3389
      by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3390
  } note * = this
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3391
  show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3392
    using assms by (auto intro: * simp add: homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3393
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3394
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3395
proposition homotopic_compose:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3396
      fixes s :: "'a::real_normed_vector set"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3397
      shows "\<lbrakk>homotopic_with (\<lambda>x. True) s t f f'; homotopic_with (\<lambda>x. True) t u g g'\<rbrakk>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3398
             \<Longrightarrow> homotopic_with (\<lambda>x. True) s u (g o f) (g' o f')"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3399
  apply (rule homotopic_with_trans [where g = "g o f'"])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3400
  apply (metis homotopic_compose_continuous_left homotopic_with_imp_continuous homotopic_with_imp_subset1)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3401
  by (metis homotopic_compose_continuous_right homotopic_with_imp_continuous homotopic_with_imp_subset2)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3402
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3403
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3404
subsection\<open>Homotopy of paths, maintaining the same endpoints.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3405
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3406
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3407
definition homotopic_paths :: "['a set, real \<Rightarrow> 'a, real \<Rightarrow> 'a::topological_space] \<Rightarrow> bool"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3408
  where
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3409
     "homotopic_paths s p q \<equiv>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3410
       homotopic_with (\<lambda>r. pathstart r = pathstart p \<and> pathfinish r = pathfinish p) {0..1} s p q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3411
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3412
lemma homotopic_paths:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3413
   "homotopic_paths s p q \<longleftrightarrow>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3414
      (\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3415
          h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3416
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3417
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3418
          (\<forall>t \<in> {0..1::real}. pathstart(h o Pair t) = pathstart p \<and>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3419
                        pathfinish(h o Pair t) = pathfinish p))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3420
  by (auto simp: homotopic_paths_def homotopic_with pathstart_def pathfinish_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3421
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3422
proposition homotopic_paths_imp_pathstart:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3423
     "homotopic_paths s p q \<Longrightarrow> pathstart p = pathstart q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3424
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3425
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3426
proposition homotopic_paths_imp_pathfinish:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3427
     "homotopic_paths s p q \<Longrightarrow> pathfinish p = pathfinish q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3428
  by (metis (mono_tags, lifting) homotopic_paths_def homotopic_with_imp_property)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3429
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3430
lemma homotopic_paths_imp_path:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3431
     "homotopic_paths s p q \<Longrightarrow> path p \<and> path q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3432
  using homotopic_paths_def homotopic_with_imp_continuous path_def by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3433
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3434
lemma homotopic_paths_imp_subset:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3435
     "homotopic_paths s p q \<Longrightarrow> path_image p \<subseteq> s \<and> path_image q \<subseteq> s"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3436
  by (simp add: homotopic_paths_def homotopic_with_imp_subset1 homotopic_with_imp_subset2 path_image_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3437
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3438
proposition homotopic_paths_refl [simp]: "homotopic_paths s p p \<longleftrightarrow> path p \<and> path_image p \<subseteq> s"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3439
by (simp add: homotopic_paths_def homotopic_with_refl path_def path_image_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3440
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3441
proposition homotopic_paths_sym: "homotopic_paths s p q \<Longrightarrow> homotopic_paths s q p"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3442
  by (metis (mono_tags) homotopic_paths_def homotopic_paths_imp_pathfinish homotopic_paths_imp_pathstart homotopic_with_symD)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3443
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3444
proposition homotopic_paths_sym_eq: "homotopic_paths s p q \<longleftrightarrow> homotopic_paths s q p"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3445
  by (metis homotopic_paths_sym)
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3446
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3447
proposition homotopic_paths_trans [trans]:
61694
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3448
     "\<lbrakk>homotopic_paths s p q; homotopic_paths s q r\<rbrakk> \<Longrightarrow> homotopic_paths s p r"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3449
  apply (simp add: homotopic_paths_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3450
  apply (rule homotopic_with_trans, assumption)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3451
  by (metis (mono_tags, lifting) homotopic_with_imp_property homotopic_with_mono)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3452
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3453
proposition homotopic_paths_eq:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3454
     "\<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"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3455
  apply (simp add: homotopic_paths_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3456
  apply (rule homotopic_with_eq)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3457
  apply (auto simp: path_def homotopic_with_refl pathstart_def pathfinish_def path_image_def elim: continuous_on_eq)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3458
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3459
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3460
proposition homotopic_paths_reparametrize:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3461
  assumes "path p"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3462
      and pips: "path_image p \<subseteq> s"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3463
      and contf: "continuous_on {0..1} f"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3464
      and f01:"f ` {0..1} \<subseteq> {0..1}"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3465
      and [simp]: "f(0) = 0" "f(1) = 1"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3466
      and q: "\<And>t. t \<in> {0..1} \<Longrightarrow> q(t) = p(f t)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3467
    shows "homotopic_paths s p q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3468
proof -
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3469
  have contp: "continuous_on {0..1} p"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3470
    by (metis \<open>path p\<close> path_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3471
  then have "continuous_on {0..1} (p o f)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3472
    using contf continuous_on_compose continuous_on_subset f01 by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3473
  then have "path q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3474
    by (simp add: path_def) (metis q continuous_on_cong)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3475
  have piqs: "path_image q \<subseteq> s"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3476
    by (metis (no_types, hide_lams) pips f01 image_subset_iff path_image_def q)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3477
  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"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3478
    using f01 by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3479
  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
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3480
    using f01 [THEN subsetD, of "f b"] by (simp add: convex_bound_le)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3481
  have "homotopic_paths s q p"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3482
  proof (rule homotopic_paths_trans)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3483
    show "homotopic_paths s q (p \<circ> f)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3484
      using q by (force intro: homotopic_paths_eq [OF  \<open>path q\<close> piqs])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3485
  next
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3486
    show "homotopic_paths s (p \<circ> f) p"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3487
      apply (simp add: homotopic_paths_def homotopic_with_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3488
      apply (rule_tac x="p o (\<lambda>y. (1 - (fst y)) *\<^sub>R ((f o snd) y) + (fst y) *\<^sub>R snd y)"  in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3489
      apply (rule conjI contf continuous_intros continuous_on_subset [OF contp] | simp)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3490
      using pips [unfolded path_image_def]
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3491
      apply (auto simp: fb0 fb1 pathstart_def pathfinish_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3492
      done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3493
  qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3494
  then show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3495
    by (simp add: homotopic_paths_sym)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3496
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3497
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3498
lemma homotopic_paths_subset: "\<lbrakk>homotopic_paths s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t p q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3499
  using homotopic_paths_def homotopic_with_subset_right by blast
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3500
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3501
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3502
text\<open> A slightly ad-hoc but useful lemma in constructing homotopies.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3503
lemma homotopic_join_lemma:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3504
  fixes q :: "[real,real] \<Rightarrow> 'a::topological_space"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3505
  assumes p: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. p (fst y) (snd y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3506
      and q: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. q (fst y) (snd y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3507
      and pf: "\<And>t. t \<in> {0..1} \<Longrightarrow> pathfinish(p t) = pathstart(q t)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3508
    shows "continuous_on ({0..1} \<times> {0..1}) (\<lambda>y. (p(fst y) +++ q(fst y)) (snd y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3509
proof -
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3510
  have 1: "(\<lambda>y. p (fst y) (2 * snd y)) = (\<lambda>y. p (fst y) (snd y)) o (\<lambda>y. (fst y, 2 * snd y))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3511
    by (rule ext) (simp )
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3512
  have 2: "(\<lambda>y. q (fst y) (2 * snd y - 1)) = (\<lambda>y. q (fst y) (snd y)) o (\<lambda>y. (fst y, 2 * snd y - 1))"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3513
    by (rule ext) (simp )
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3514
  show ?thesis
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3515
    apply (simp add: joinpaths_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3516
    apply (rule continuous_on_cases_le)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3517
    apply (simp_all only: 1 2)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3518
    apply (rule continuous_intros continuous_on_subset [OF p] continuous_on_subset [OF q] | force)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3519
    using pf
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3520
    apply (auto simp: mult.commute pathstart_def pathfinish_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3521
    done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3522
qed
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3523
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3524
text\<open> Congruence properties of homotopy w.r.t. path-combining operations.\<close>
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3525
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3526
lemma homotopic_paths_reversepath_D:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3527
      assumes "homotopic_paths s p q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3528
      shows   "homotopic_paths s (reversepath p) (reversepath q)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3529
  using assms
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3530
  apply (simp add: homotopic_paths_def homotopic_with_def, clarify)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3531
  apply (rule_tac x="h o (\<lambda>x. (fst x, 1 - snd x))" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3532
  apply (rule conjI continuous_intros)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3533
  apply (auto simp: reversepath_def pathstart_def pathfinish_def elim!: continuous_on_subset)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3534
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3535
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3536
proposition homotopic_paths_reversepath:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3537
     "homotopic_paths s (reversepath p) (reversepath q) \<longleftrightarrow> homotopic_paths s p q"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3538
  using homotopic_paths_reversepath_D by force
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3539
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3540
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3541
proposition homotopic_paths_join:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3542
    "\<lbrakk>homotopic_paths s p p'; homotopic_paths s q q'; pathfinish p = pathstart q\<rbrakk> \<Longrightarrow> homotopic_paths s (p +++ q) (p' +++ q')"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3543
  apply (simp add: homotopic_paths_def homotopic_with_def, clarify)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3544
  apply (rename_tac k1 k2)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3545
  apply (rule_tac x="(\<lambda>y. ((k1 o Pair (fst y)) +++ (k2 o Pair (fst y))) (snd y))" in exI)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3546
  apply (rule conjI continuous_intros homotopic_join_lemma)+
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3547
  apply (auto simp: joinpaths_def pathstart_def pathfinish_def path_image_def)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3548
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3549
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3550
proposition homotopic_paths_continuous_image:
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3551
    "\<lbrakk>homotopic_paths s f g; continuous_on s h; h ` s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_paths t (h o f) (h o g)"
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3552
  unfolding homotopic_paths_def
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3553
  apply (rule homotopic_with_compose_continuous_left [of _ _ _ s])
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3554
  apply (auto simp: pathstart_def pathfinish_def elim!: homotopic_with_mono)
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3555
  done
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3556
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3557
subsection\<open>Group properties for homotopy of paths\<close>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3558
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3559
text\<open>So taking equivalence classes under homotopy would give the fundamental group\<close>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3560
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3561
proposition homotopic_paths_rid:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3562
    "\<lbrakk>path p; path_image p \<subseteq> s\<rbrakk> \<Longrightarrow> homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p)) p"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3563
  apply (subst homotopic_paths_sym)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3564
  apply (rule homotopic_paths_reparametrize [where f = "\<lambda>t. if  t \<le> 1 / 2 then 2 *\<^sub>R t else 1"])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3565
  apply (simp_all del: le_divide_eq_numeral1)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3566
  apply (subst split_01)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3567
  apply (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3568
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3569
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3570
proposition homotopic_paths_lid:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3571
   "\<lbrakk>path p; path_image p \<subseteq> s\<rbrakk> \<Longrightarrow> homotopic_paths s (linepath (pathstart p) (pathstart p) +++ p) p"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3572
using homotopic_paths_rid [of "reversepath p" s]
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3573
  by (metis homotopic_paths_reversepath path_image_reversepath path_reversepath pathfinish_linepath
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3574
        pathfinish_reversepath reversepath_joinpaths reversepath_linepath)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3575
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3576
proposition homotopic_paths_assoc:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3577
   "\<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;
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3578
     pathfinish q = pathstart r\<rbrakk>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3579
    \<Longrightarrow> homotopic_paths s (p +++ (q +++ r)) ((p +++ q) +++ r)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3580
  apply (subst homotopic_paths_sym)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3581
  apply (rule homotopic_paths_reparametrize
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3582
           [where f = "\<lambda>t. if  t \<le> 1 / 2 then inverse 2 *\<^sub>R t
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3583
                           else if  t \<le> 3 / 4 then t - (1 / 4)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3584
                           else 2 *\<^sub>R t - 1"])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3585
  apply (simp_all del: le_divide_eq_numeral1)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3586
  apply (simp add: subset_path_image_join)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3587
  apply (rule continuous_on_cases_1 continuous_intros)+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3588
  apply (auto simp: joinpaths_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3589
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3590
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3591
proposition homotopic_paths_rinv:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3592
  assumes "path p" "path_image p \<subseteq> s"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3593
    shows "homotopic_paths s (p +++ reversepath p) (linepath (pathstart p) (pathstart p))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3594
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3595
  have "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. (subpath 0 (fst x) p +++ reversepath (subpath 0 (fst x) p)) (snd x))"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3596
    using assms
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3597
    apply (simp add: joinpaths_def subpath_def reversepath_def path_def del: le_divide_eq_numeral1)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3598
    apply (rule continuous_on_cases_le)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3599
    apply (rule_tac [2] continuous_on_compose [of _ _ p, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3600
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3601
    apply (auto intro!: continuous_intros simp del: eq_divide_eq_numeral1)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3602
    apply (force elim!: continuous_on_subset simp add: mult_le_one)+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3603
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3604
  then show ?thesis
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3605
    using assms
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3606
    apply (subst homotopic_paths_sym_eq)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3607
    unfolding homotopic_paths_def homotopic_with_def
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3608
    apply (rule_tac x="(\<lambda>y. (subpath 0 (fst y) p +++ reversepath(subpath 0 (fst y) p)) (snd y))" in exI)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3609
    apply (simp add: path_defs joinpaths_def subpath_def reversepath_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3610
    apply (force simp: mult_le_one)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3611
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3612
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3613
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3614
proposition homotopic_paths_linv:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3615
  assumes "path p" "path_image p \<subseteq> s"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3616
    shows "homotopic_paths s (reversepath p +++ p) (linepath (pathfinish p) (pathfinish p))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3617
using homotopic_paths_rinv [of "reversepath p" s] assms by simp
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3618
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3619
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3620
subsection\<open> Homotopy of loops without requiring preservation of endpoints.\<close>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3621
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3622
definition homotopic_loops :: "'a::topological_space set \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> bool"  where
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3623
 "homotopic_loops s p q \<equiv>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3624
     homotopic_with (\<lambda>r. pathfinish r = pathstart r) {0..1} s p q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3625
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3626
lemma homotopic_loops:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3627
   "homotopic_loops s p q \<longleftrightarrow>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3628
      (\<exists>h. continuous_on ({0..1::real} \<times> {0..1}) h \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3629
          image h ({0..1} \<times> {0..1}) \<subseteq> s \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3630
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3631
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3632
          (\<forall>t \<in> {0..1}. pathfinish(h o Pair t) = pathstart(h o Pair t)))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3633
  by (simp add: homotopic_loops_def pathstart_def pathfinish_def homotopic_with)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3634
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3635
proposition homotopic_loops_imp_loop:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3636
     "homotopic_loops s p q \<Longrightarrow> pathfinish p = pathstart p \<and> pathfinish q = pathstart q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3637
using homotopic_with_imp_property homotopic_loops_def by blast
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3638
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3639
proposition homotopic_loops_imp_path:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3640
     "homotopic_loops s p q \<Longrightarrow> path p \<and> path q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3641
  unfolding homotopic_loops_def path_def
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3642
  using homotopic_with_imp_continuous by blast
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3643
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3644
proposition homotopic_loops_imp_subset:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3645
     "homotopic_loops s p q \<Longrightarrow> path_image p \<subseteq> s \<and> path_image q \<subseteq> s"
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3646
  unfolding homotopic_loops_def path_image_def
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3647
  by (metis homotopic_with_imp_subset1 homotopic_with_imp_subset2)
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3648
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3649
proposition homotopic_loops_refl:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3650
     "homotopic_loops s p p \<longleftrightarrow>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3651
      path p \<and> path_image p \<subseteq> s \<and> pathfinish p = pathstart p"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3652
  by (simp add: homotopic_loops_def homotopic_with_refl path_image_def path_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3653
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3654
proposition homotopic_loops_sym: "homotopic_loops s p q \<Longrightarrow> homotopic_loops s q p"
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3655
  by (simp add: homotopic_loops_def homotopic_with_sym)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3656
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3657
proposition homotopic_loops_sym_eq: "homotopic_loops s p q \<longleftrightarrow> homotopic_loops s q p"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3658
  by (metis homotopic_loops_sym)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3659
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3660
proposition homotopic_loops_trans:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3661
   "\<lbrakk>homotopic_loops s p q; homotopic_loops s q r\<rbrakk> \<Longrightarrow> homotopic_loops s p r"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3662
  unfolding homotopic_loops_def by (blast intro: homotopic_with_trans)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3663
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3664
proposition homotopic_loops_subset:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3665
   "\<lbrakk>homotopic_loops s p q; s \<subseteq> t\<rbrakk> \<Longrightarrow> homotopic_loops t p q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3666
  by (simp add: homotopic_loops_def homotopic_with_subset_right)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3667
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3668
proposition homotopic_loops_eq:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3669
   "\<lbrakk>path p; path_image p \<subseteq> s; pathfinish p = pathstart p; \<And>t. t \<in> {0..1} \<Longrightarrow> p(t) = q(t)\<rbrakk>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3670
          \<Longrightarrow> homotopic_loops s p q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3671
  unfolding homotopic_loops_def
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3672
  apply (rule homotopic_with_eq)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3673
  apply (rule homotopic_with_refl [where f = p, THEN iffD2])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3674
  apply (simp_all add: path_image_def path_def pathstart_def pathfinish_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3675
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3676
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3677
proposition homotopic_loops_continuous_image:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3678
   "\<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)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3679
  unfolding homotopic_loops_def
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3680
  apply (rule homotopic_with_compose_continuous_left)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3681
  apply (erule homotopic_with_mono)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3682
  by (simp add: pathfinish_def pathstart_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3683
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3684
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3685
subsection\<open>Relations between the two variants of homotopy\<close>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3686
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3687
proposition homotopic_paths_imp_homotopic_loops:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3688
    "\<lbrakk>homotopic_paths s p q; pathfinish p = pathstart p; pathfinish q = pathstart p\<rbrakk> \<Longrightarrow> homotopic_loops s p q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3689
  by (auto simp: homotopic_paths_def homotopic_loops_def intro: homotopic_with_mono)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3690
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3691
proposition homotopic_loops_imp_homotopic_paths_null:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3692
  assumes "homotopic_loops s p (linepath a a)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3693
    shows "homotopic_paths s p (linepath (pathstart p) (pathstart p))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3694
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3695
  have "path p" by (metis assms homotopic_loops_imp_path)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3696
  have ploop: "pathfinish p = pathstart p" by (metis assms homotopic_loops_imp_loop)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3697
  have pip: "path_image p \<subseteq> s" by (metis assms homotopic_loops_imp_subset)
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3698
  obtain h where conth: "continuous_on ({0..1::real} \<times> {0..1}) h"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3699
             and hs: "h ` ({0..1} \<times> {0..1}) \<subseteq> s"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3700
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(0,x) = p x"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3701
             and [simp]: "\<And>x. x \<in> {0..1} \<Longrightarrow> h(1,x) = a"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3702
             and ends: "\<And>t. t \<in> {0..1} \<Longrightarrow> pathfinish (h \<circ> Pair t) = pathstart (h \<circ> Pair t)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3703
    using assms by (auto simp: homotopic_loops homotopic_with)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3704
  have conth0: "path (\<lambda>u. h (u, 0))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3705
    unfolding path_def
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3706
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3707
    apply (force intro: continuous_intros continuous_on_subset [OF conth])+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3708
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3709
  have pih0: "path_image (\<lambda>u. h (u, 0)) \<subseteq> s"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3710
    using hs by (force simp: path_image_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3711
  have c1: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. h (fst x * snd x, 0))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3712
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3713
    apply (force simp: mult_le_one intro: continuous_intros continuous_on_subset [OF conth])+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3714
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3715
  have c2: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. h (fst x - fst x * snd x, 0))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3716
    apply (rule continuous_on_compose [of _ _ h, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3717
    apply (force simp: mult_left_le mult_le_one intro: continuous_intros continuous_on_subset [OF conth])+
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3718
    apply (rule continuous_on_subset [OF conth])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3719
    apply (auto simp: algebra_simps add_increasing2 mult_left_le)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3720
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3721
  have [simp]: "\<And>t. \<lbrakk>0 \<le> t \<and> t \<le> 1\<rbrakk> \<Longrightarrow> h (t, 1) = h (t, 0)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3722
    using ends by (simp add: pathfinish_def pathstart_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3723
  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
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3724
  proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3725
    have "c * 3 \<le> c * (d * 4)" using that less_eq_real_def by auto
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3726
    with \<open>c \<le> 1\<close> show ?thesis by fastforce
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3727
  qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3728
  have *: "\<And>p x. (path p \<and> path(reversepath p)) \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3729
                  (path_image p \<subseteq> s \<and> path_image(reversepath p) \<subseteq> s) \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3730
                  (pathfinish p = pathstart(linepath a a +++ reversepath p) \<and>
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3731
                   pathstart(reversepath p) = a) \<and> pathstart p = x
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3732
                  \<Longrightarrow> homotopic_paths s (p +++ linepath a a +++ reversepath p) (linepath x x)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3733
    by (metis homotopic_paths_lid homotopic_paths_join
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3734
              homotopic_paths_trans homotopic_paths_sym homotopic_paths_rinv)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3735
  have 1: "homotopic_paths s p (p +++ linepath (pathfinish p) (pathfinish p))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3736
    using \<open>path p\<close> homotopic_paths_rid homotopic_paths_sym pip by blast
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3737
  moreover have "homotopic_paths s (p +++ linepath (pathfinish p) (pathfinish p))
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3738
                                   (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3739
    apply (rule homotopic_paths_sym)
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3740
    using homotopic_paths_lid [of "p +++ linepath (pathfinish p) (pathfinish p)" s]
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3741
    by (metis 1 homotopic_paths_imp_path homotopic_paths_imp_pathstart homotopic_paths_imp_subset)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3742
  moreover have "homotopic_paths s (linepath (pathstart p) (pathstart p) +++ p +++ linepath (pathfinish p) (pathfinish p))
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3743
                                   ((\<lambda>u. h (u, 0)) +++ linepath a a +++ reversepath (\<lambda>u. h (u, 0)))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3744
    apply (simp add: homotopic_paths_def homotopic_with_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3745
    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)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3746
    apply (simp add: subpath_reversepath)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3747
    apply (intro conjI homotopic_join_lemma)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3748
    using ploop
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3749
    apply (simp_all add: path_defs joinpaths_def o_def subpath_def conth c1 c2)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3750
    apply (force simp: algebra_simps mult_le_one mult_left_le intro: hs [THEN subsetD] adhoc_le)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3751
    done
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3752
  moreover have "homotopic_paths s ((\<lambda>u. h (u, 0)) +++ linepath a a +++ reversepath (\<lambda>u. h (u, 0)))
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3753
                                   (linepath (pathstart p) (pathstart p))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3754
    apply (rule *)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3755
    apply (simp add: pih0 pathstart_def pathfinish_def conth0)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3756
    apply (simp add: reversepath_def joinpaths_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3757
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3758
  ultimately show ?thesis
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3759
    by (blast intro: homotopic_paths_trans)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3760
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3761
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3762
proposition homotopic_loops_conjugate:
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3763
  fixes s :: "'a::real_normed_vector set"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3764
  assumes "path p" "path q" and pip: "path_image p \<subseteq> s" and piq: "path_image q \<subseteq> s"
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3765
      and papp: "pathfinish p = pathstart q" and qloop: "pathfinish q = pathstart q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3766
    shows "homotopic_loops s (p +++ q +++ reversepath p) q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3767
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3768
  have contp: "continuous_on {0..1} p"  using \<open>path p\<close> [unfolded path_def] by blast
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3769
  have contq: "continuous_on {0..1} q"  using \<open>path q\<close> [unfolded path_def] by blast
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3770
  have c1: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. p ((1 - fst x) * snd x + fst x))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3771
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3772
    apply (force simp: mult_le_one intro!: continuous_intros)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3773
    apply (rule continuous_on_subset [OF contp])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3774
    apply (auto simp: algebra_simps add_increasing2 mult_right_le_one_le sum_le_prod1)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3775
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3776
  have c2: "continuous_on ({0..1} \<times> {0..1}) (\<lambda>x. p ((fst x - 1) * snd x + 1))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3777
    apply (rule continuous_on_compose [of _ _ p, unfolded o_def])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3778
    apply (force simp: mult_le_one intro!: continuous_intros)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3779
    apply (rule continuous_on_subset [OF contp])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3780
    apply (auto simp: algebra_simps add_increasing2 mult_left_le_one_le)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3781
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3782
  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"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3783
    using sum_le_prod1
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3784
    by (force simp: algebra_simps add_increasing2 mult_left_le intro: pip [unfolded path_image_def, THEN subsetD])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3785
  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"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3786
    apply (rule pip [unfolded path_image_def, THEN subsetD])
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3787
    apply (rule image_eqI, blast)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3788
    apply (simp add: algebra_simps)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3789
    by (metis add_mono_thms_linordered_semiring(1) affine_ineq linear mult.commute mult.left_neutral mult_right_mono not_le
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3790
              add.commute zero_le_numeral)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3791
  have qs: "\<And>a b. \<lbrakk>4 * b \<le> 3; \<not> b * 2 \<le> 1\<rbrakk> \<Longrightarrow> q (4 * b - 2) \<in> s"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3792
    using path_image_def piq by fastforce
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3793
  have "homotopic_loops s (p +++ q +++ reversepath p)
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3794
                          (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q))"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3795
    apply (simp add: homotopic_loops_def homotopic_with_def)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3796
    apply (rule_tac x="(\<lambda>y. (subpath (fst y) 1 p +++ q +++ subpath 1 (fst y) p) (snd y))" in exI)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3797
    apply (simp add: subpath_refl subpath_reversepath)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3798
    apply (intro conjI homotopic_join_lemma)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3799
    using papp qloop
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3800
    apply (simp_all add: path_defs joinpaths_def o_def subpath_def c1 c2)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3801
    apply (force simp: contq intro: continuous_on_compose [of _ _ q, unfolded o_def] continuous_on_id continuous_on_snd)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3802
    apply (auto simp: ps1 ps2 qs)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3803
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3804
  moreover have "homotopic_loops s (linepath (pathstart q) (pathstart q) +++ q +++ linepath (pathstart q) (pathstart q)) q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3805
  proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3806
    have "homotopic_paths s (linepath (pathfinish q) (pathfinish q) +++ q) q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3807
      using \<open>path q\<close> homotopic_paths_lid qloop piq by auto
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3808
    hence 1: "\<And>f. homotopic_paths s f q \<or> \<not> homotopic_paths s f (linepath (pathfinish q) (pathfinish q) +++ q)"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3809
      using homotopic_paths_trans by blast
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3810
    hence "homotopic_paths s (linepath (pathfinish q) (pathfinish q) +++ q +++ linepath (pathfinish q) (pathfinish q)) q"
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3811
    proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3812
      have "homotopic_paths s (q +++ linepath (pathfinish q) (pathfinish q)) q"
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3813
        by (simp add: \<open>path q\<close> homotopic_paths_rid piq)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3814
      thus ?thesis
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3815
        by (metis (no_types) 1 \<open>path q\<close> homotopic_paths_join homotopic_paths_rinv homotopic_paths_sym
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3816
                  homotopic_paths_trans qloop pathfinish_linepath piq)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3817
    qed
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3818
    thus ?thesis
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3819
      by (metis (no_types) qloop homotopic_loops_sym homotopic_paths_imp_homotopic_loops homotopic_paths_imp_pathfinish homotopic_paths_sym)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3820
  qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3821
  ultimately show ?thesis
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3822
    by (blast intro: homotopic_loops_trans)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3823
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3824
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3825
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3826
subsection\<open> Homotopy of "nearby" function, paths and loops.\<close>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3827
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3828
lemma homotopic_with_linear:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3829
  fixes f g :: "_ \<Rightarrow> 'b::real_normed_vector"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3830
  assumes contf: "continuous_on s f"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3831
      and contg:"continuous_on s g"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3832
      and sub: "\<And>x. x \<in> s \<Longrightarrow> closed_segment (f x) (g x) \<subseteq> t"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3833
    shows "homotopic_with (\<lambda>z. True) s t f g"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3834
  apply (simp add: homotopic_with_def)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3835
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R f(snd y) + (fst y) *\<^sub>R g(snd y))" in exI)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3836
  apply (intro conjI)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3837
  apply (rule subset_refl continuous_intros continuous_on_subset [OF contf] continuous_on_compose2 [where g=f]
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3838
                                            continuous_on_subset [OF contg] continuous_on_compose2 [where g=g]| simp)+
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3839
  using sub closed_segment_def apply fastforce+
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3840
  done
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3841
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3842
lemma homotopic_paths_linear:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3843
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3844
  assumes "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  3845
          "\<And>t. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> s"
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3846
    shows "homotopic_paths s g h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3847
  using assms
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3848
  unfolding path_def
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  3849
  apply (simp add: closed_segment_def pathstart_def pathfinish_def homotopic_paths_def homotopic_with_def)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  3850
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R (g o snd) y + (fst y) *\<^sub>R (h o snd) y)" in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  3851
  apply (intro conjI subsetI continuous_intros; force)
61738
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3852
  done
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3853
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3854
lemma homotopic_loops_linear:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3855
  fixes g h :: "real \<Rightarrow> 'a::real_normed_vector"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3856
  assumes "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3857
          "\<And>t x. t \<in> {0..1} \<Longrightarrow> closed_segment (g t) (h t) \<subseteq> s"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3858
    shows "homotopic_loops s g h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3859
  using assms
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3860
  unfolding path_def
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3861
  apply (simp add: pathstart_def pathfinish_def homotopic_loops_def homotopic_with_def)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3862
  apply (rule_tac x="\<lambda>y. ((1 - (fst y)) *\<^sub>R g(snd y) + (fst y) *\<^sub>R h(snd y))" in exI)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3863
  apply (auto intro!: continuous_intros intro: continuous_on_compose2 [where g=g] continuous_on_compose2 [where g=h])
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3864
  apply (force simp: closed_segment_def)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3865
  done
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3866
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3867
lemma homotopic_paths_nearby_explicit:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3868
  assumes "path g" "path h" "pathstart h = pathstart g" "pathfinish h = pathfinish g"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3869
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> s\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3870
    shows "homotopic_paths s g h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3871
  apply (rule homotopic_paths_linear [OF assms(1-4)])
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3872
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3873
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3874
lemma homotopic_loops_nearby_explicit:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3875
  assumes "path g" "path h" "pathfinish g = pathstart g" "pathfinish h = pathstart h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3876
      and no: "\<And>t x. \<lbrakk>t \<in> {0..1}; x \<notin> s\<rbrakk> \<Longrightarrow> norm(h t - g t) < norm(g t - x)"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3877
    shows "homotopic_loops s g h"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3878
  apply (rule homotopic_loops_linear [OF assms(1-4)])
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3879
  by (metis no segment_bound(1) subsetI norm_minus_commute not_le)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3880
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3881
lemma homotopic_nearby_paths:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3882
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3883
  assumes "path g" "open s" "path_image g \<subseteq> s"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3884
    shows "\<exists>e. 0 < e \<and>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3885
               (\<forall>h. path h \<and>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3886
                    pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3887
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_paths s g h)"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3888
proof -
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3889
  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"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3890
    using separate_compact_closed [of "path_image g" "-s"] assms by force
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3891
  show ?thesis
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3892
    apply (intro exI conjI)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3893
    using e [unfolded dist_norm]
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3894
    apply (auto simp: intro!: homotopic_paths_nearby_explicit assms  \<open>e > 0\<close>)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3895
    by (metis atLeastAtMost_iff imageI le_less_trans not_le path_image_def)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3896
qed
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3897
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3898
lemma homotopic_nearby_loops:
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3899
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3900
  assumes "path g" "open s" "path_image g \<subseteq> s" "pathfinish g = pathstart g"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3901
    shows "\<exists>e. 0 < e \<and>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3902
               (\<forall>h. path h \<and> pathfinish h = pathstart h \<and>
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3903
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_loops s g h)"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3904
proof -
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3905
  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"
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3906
    using separate_compact_closed [of "path_image g" "-s"] assms by force
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3907
  show ?thesis
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3908
    apply (intro exI conjI)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3909
    using e [unfolded dist_norm]
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3910
    apply (auto simp: intro!: homotopic_loops_nearby_explicit assms  \<open>e > 0\<close>)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3911
    by (metis atLeastAtMost_iff imageI le_less_trans not_le path_image_def)
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3912
qed
c4f6031f1310 New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents: 61711
diff changeset
  3913
61762
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3914
subsection\<open> Homotopy and subpaths\<close>
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3915
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3916
lemma homotopic_join_subpaths1:
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3917
  assumes "path g" and pag: "path_image g \<subseteq> s"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3918
      and u: "u \<in> {0..1}" and v: "v \<in> {0..1}" and w: "w \<in> {0..1}" "u \<le> v" "v \<le> w"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3919
    shows "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3920
proof -
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3921
  have 1: "t * 2 \<le> 1 \<Longrightarrow> u + t * (v * 2) \<le> v + t * (u * 2)" for t
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3922
    using affine_ineq \<open>u \<le> v\<close> by fastforce
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3923
  have 2: "t * 2 > 1 \<Longrightarrow> u + (2*t - 1) * v \<le> v + (2*t - 1) * w" for t
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3924
    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>)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3925
  have t2: "\<And>t::real. t*2 = 1 \<Longrightarrow> t = 1/2" by auto
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3926
  show ?thesis
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3927
    apply (rule homotopic_paths_subset [OF _ pag])
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3928
    using assms
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3929
    apply (cases "w = u")
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3930
    using homotopic_paths_rinv [of "subpath u v g" "path_image g"]
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3931
    apply (force simp: closed_segment_eq_real_ivl image_mono path_image_def subpath_refl)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3932
      apply (rule homotopic_paths_sym)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3933
      apply (rule homotopic_paths_reparametrize
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3934
             [where f = "\<lambda>t. if  t \<le> 1 / 2
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3935
                             then inverse((w - u)) *\<^sub>R (2 * (v - u)) *\<^sub>R t
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3936
                             else inverse((w - u)) *\<^sub>R ((v - u) + (w - v) *\<^sub>R (2 *\<^sub>R t - 1))"])
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3937
      using \<open>path g\<close> path_subpath u w apply blast
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3938
      using \<open>path g\<close> path_image_subpath_subset u w(1) apply blast
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3939
      apply simp_all
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3940
      apply (subst split_01)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3941
      apply (rule continuous_on_cases continuous_intros | force simp: pathfinish_def joinpaths_def)+
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3942
      apply (simp_all add: field_simps not_le)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3943
      apply (force dest!: t2)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3944
      apply (force simp: algebra_simps mult_left_mono affine_ineq dest!: 1 2)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3945
      apply (simp add: joinpaths_def subpath_def)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3946
      apply (force simp: algebra_simps)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3947
      done
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3948
qed
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3949
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3950
lemma homotopic_join_subpaths2:
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3951
  assumes "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3952
    shows "homotopic_paths s (subpath w v g +++ subpath v u g) (subpath w u g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3953
by (metis assms homotopic_paths_reversepath_D pathfinish_subpath pathstart_subpath reversepath_joinpaths reversepath_subpath)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3954
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3955
lemma homotopic_join_subpaths3:
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3956
  assumes hom: "homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3957
      and "path g" and pag: "path_image g \<subseteq> s"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3958
      and u: "u \<in> {0..1}" and v: "v \<in> {0..1}" and w: "w \<in> {0..1}"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3959
    shows "homotopic_paths s (subpath v w g +++ subpath w u g) (subpath v u g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3960
proof -
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3961
  have "homotopic_paths s (subpath u w g +++ subpath w v g) ((subpath u v g +++ subpath v w g) +++ subpath w v g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3962
    apply (rule homotopic_paths_join)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3963
    using hom homotopic_paths_sym_eq apply blast
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3964
    apply (metis \<open>path g\<close> homotopic_paths_eq pag path_image_subpath_subset path_subpath subset_trans v w)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3965
    apply (simp add:)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3966
    done
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3967
  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)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3968
    apply (rule homotopic_paths_sym [OF homotopic_paths_assoc])
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3969
    using assms by (simp_all add: path_image_subpath_subset [THEN order_trans])
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3970
  also have "homotopic_paths s (subpath u v g +++ subpath v w g +++ subpath w v g)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3971
                               (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g)))"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3972
    apply (rule homotopic_paths_join)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3973
    apply (metis \<open>path g\<close> homotopic_paths_eq order.trans pag path_image_subpath_subset path_subpath u v)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3974
    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)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3975
    apply (simp add:)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3976
    done
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3977
  also have "homotopic_paths s (subpath u v g +++ linepath (pathfinish (subpath u v g)) (pathfinish (subpath u v g))) (subpath u v g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3978
    apply (rule homotopic_paths_rid)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3979
    using \<open>path g\<close> path_subpath u v apply blast
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3980
    apply (meson \<open>path g\<close> order.trans pag path_image_subpath_subset u v)
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3981
    done
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3982
  finally have "homotopic_paths s (subpath u w g +++ subpath w v g) (subpath u v g)" .
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3983
  then show ?thesis
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3984
    using homotopic_join_subpaths2 by blast
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3985
qed
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3986
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3987
proposition homotopic_join_subpaths:
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3988
   "\<lbrakk>path g; path_image g \<subseteq> s; u \<in> {0..1}; v \<in> {0..1}; w \<in> {0..1}\<rbrakk>
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3989
    \<Longrightarrow> homotopic_paths s (subpath u v g +++ subpath v w g) (subpath u w g)"
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3990
apply (rule le_cases3 [of u v w])
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3991
using homotopic_join_subpaths1 homotopic_join_subpaths2 homotopic_join_subpaths3 by metis+
d50b993b4fb9 Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents: 61738
diff changeset
  3992
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3993
text\<open>Relating homotopy of trivial loops to path-connectedness.\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3994
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3995
lemma path_component_imp_homotopic_points:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3996
    "path_component S a b \<Longrightarrow> homotopic_loops S (linepath a a) (linepath b b)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3997
apply (simp add: path_component_def homotopic_loops_def homotopic_with_def
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3998
                 pathstart_def pathfinish_def path_image_def path_def, clarify)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  3999
apply (rule_tac x="g o fst" in exI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4000
apply (intro conjI continuous_intros continuous_on_compose)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4001
apply (auto elim!: continuous_on_subset)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4002
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4003
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4004
lemma homotopic_loops_imp_path_component_value:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4005
   "\<lbrakk>homotopic_loops S p q; 0 \<le> t; t \<le> 1\<rbrakk>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4006
        \<Longrightarrow> path_component S (p t) (q t)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4007
apply (simp add: path_component_def homotopic_loops_def homotopic_with_def
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4008
                 pathstart_def pathfinish_def path_image_def path_def, clarify)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4009
apply (rule_tac x="h o (\<lambda>u. (u, t))" in exI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4010
apply (intro conjI continuous_intros continuous_on_compose)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4011
apply (auto elim!: continuous_on_subset)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4012
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4013
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4014
lemma homotopic_points_eq_path_component:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4015
   "homotopic_loops S (linepath a a) (linepath b b) \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4016
        path_component S a b"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4017
by (auto simp: path_component_imp_homotopic_points
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4018
         dest: homotopic_loops_imp_path_component_value [where t=1])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4019
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4020
lemma path_connected_eq_homotopic_points:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4021
    "path_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4022
      (\<forall>a b. a \<in> S \<and> b \<in> S \<longrightarrow> homotopic_loops S (linepath a a) (linepath b b))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4023
by (auto simp: path_connected_def path_component_def homotopic_points_eq_path_component)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4024
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4025
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4026
subsection\<open>Simply connected sets\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4027
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4028
text\<open>defined as "all loops are homotopic (as loops)\<close>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4029
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4030
definition simply_connected where
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4031
  "simply_connected S \<equiv>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4032
        \<forall>p q. path p \<and> pathfinish p = pathstart p \<and> path_image p \<subseteq> S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4033
              path q \<and> pathfinish q = pathstart q \<and> path_image q \<subseteq> S
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4034
              \<longrightarrow> homotopic_loops S p q"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4035
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4036
lemma simply_connected_empty [iff]: "simply_connected {}"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4037
  by (simp add: simply_connected_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4038
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4039
lemma simply_connected_imp_path_connected:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4040
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4041
  shows "simply_connected S \<Longrightarrow> path_connected S"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4042
by (simp add: simply_connected_def path_connected_eq_homotopic_points)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4043
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4044
lemma simply_connected_imp_connected:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4045
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4046
  shows "simply_connected S \<Longrightarrow> connected S"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4047
by (simp add: path_connected_imp_connected simply_connected_imp_path_connected)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4048
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4049
lemma simply_connected_eq_contractible_loop_any:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4050
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4051
  shows "simply_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4052
            (\<forall>p a. path p \<and> path_image p \<subseteq> S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4053
                  pathfinish p = pathstart p \<and> a \<in> S
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4054
                  \<longrightarrow> homotopic_loops S p (linepath a a))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4055
apply (simp add: simply_connected_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4056
apply (rule iffI, force, clarify)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4057
apply (rule_tac q = "linepath (pathstart p) (pathstart p)" in homotopic_loops_trans)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4058
apply (fastforce simp add:)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4059
using homotopic_loops_sym apply blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4060
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4061
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4062
lemma simply_connected_eq_contractible_loop_some:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4063
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4064
  shows "simply_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4065
                path_connected S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4066
                (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4067
                    \<longrightarrow> (\<exists>a. a \<in> S \<and> homotopic_loops S p (linepath a a)))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4068
apply (rule iffI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4069
 apply (fastforce simp: simply_connected_imp_path_connected simply_connected_eq_contractible_loop_any)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4070
apply (clarsimp simp add: simply_connected_eq_contractible_loop_any)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4071
apply (drule_tac x=p in spec)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4072
using homotopic_loops_trans path_connected_eq_homotopic_points
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4073
  apply blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4074
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4075
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4076
lemma simply_connected_eq_contractible_loop_all:
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4077
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4078
  shows "simply_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4079
         S = {} \<or>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4080
         (\<exists>a \<in> S. \<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4081
                \<longrightarrow> homotopic_loops S p (linepath a a))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4082
        (is "?lhs = ?rhs")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4083
proof (cases "S = {}")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4084
  case True then show ?thesis by force
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4085
next
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4086
  case False
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4087
  then obtain a where "a \<in> S" by blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4088
  show ?thesis
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4089
  proof
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4090
    assume "simply_connected S"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4091
    then show ?rhs
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4092
      using \<open>a \<in> S\<close> \<open>simply_connected S\<close> simply_connected_eq_contractible_loop_any
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4093
      by blast
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4094
  next
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4095
    assume ?rhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4096
    then show "simply_connected S"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4097
      apply (simp add: simply_connected_eq_contractible_loop_any False)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4098
      by (meson homotopic_loops_refl homotopic_loops_sym homotopic_loops_trans
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4099
             path_component_imp_homotopic_points path_component_refl)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4100
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4101
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4102
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4103
lemma simply_connected_eq_contractible_path:
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4104
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4105
  shows "simply_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4106
           path_connected S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4107
           (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4108
            \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4109
apply (rule iffI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4110
 apply (simp add: simply_connected_imp_path_connected)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4111
 apply (metis simply_connected_eq_contractible_loop_some homotopic_loops_imp_homotopic_paths_null)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4112
by (meson homotopic_paths_imp_homotopic_loops pathfinish_linepath pathstart_in_path_image
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4113
         simply_connected_eq_contractible_loop_some subset_iff)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4114
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4115
lemma simply_connected_eq_homotopic_paths:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4116
  fixes S :: "_::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4117
  shows "simply_connected S \<longleftrightarrow>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4118
          path_connected S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4119
          (\<forall>p q. path p \<and> path_image p \<subseteq> S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4120
                path q \<and> path_image q \<subseteq> S \<and>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4121
                pathstart q = pathstart p \<and> pathfinish q = pathfinish p
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4122
                \<longrightarrow> homotopic_paths S p q)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4123
         (is "?lhs = ?rhs")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4124
proof
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4125
  assume ?lhs
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4126
  then have pc: "path_connected S"
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4127
        and *:  "\<And>p. \<lbrakk>path p; path_image p \<subseteq> S;
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4128
                       pathfinish p = pathstart p\<rbrakk>
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4129
                      \<Longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4130
    by (auto simp: simply_connected_eq_contractible_path)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4131
  have "homotopic_paths S p q"
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4132
        if "path p" "path_image p \<subseteq> S" "path q"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4133
           "path_image q \<subseteq> S" "pathstart q = pathstart p"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4134
           "pathfinish q = pathfinish p" for p q
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4135
  proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4136
    have "homotopic_paths S p (p +++ linepath (pathfinish p) (pathfinish p))"
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4137
      by (simp add: homotopic_paths_rid homotopic_paths_sym that)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4138
    also have "homotopic_paths S (p +++ linepath (pathfinish p) (pathfinish p))
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4139
                                 (p +++ reversepath q +++ q)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4140
      using that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4141
      by (metis homotopic_paths_join homotopic_paths_linv homotopic_paths_refl homotopic_paths_sym_eq pathstart_linepath)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4142
    also have "homotopic_paths S (p +++ reversepath q +++ q)
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4143
                                 ((p +++ reversepath q) +++ q)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4144
      by (simp add: that homotopic_paths_assoc)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4145
    also have "homotopic_paths S ((p +++ reversepath q) +++ q)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4146
                                 (linepath (pathstart q) (pathstart q) +++ q)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4147
      using * [of "p +++ reversepath q"] that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4148
      by (simp add: homotopic_paths_join path_image_join)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4149
    also have "homotopic_paths S (linepath (pathstart q) (pathstart q) +++ q) q"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4150
      using that homotopic_paths_lid by blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4151
    finally show ?thesis .
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4152
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4153
  then show ?rhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4154
    by (blast intro: pc *)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4155
next
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4156
  assume ?rhs
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4157
  then show ?lhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4158
    by (force simp: simply_connected_eq_contractible_path)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4159
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4160
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4161
proposition simply_connected_Times:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4162
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4163
  assumes S: "simply_connected S" and T: "simply_connected T"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4164
    shows "simply_connected(S \<times> T)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4165
proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4166
  have "homotopic_loops (S \<times> T) p (linepath (a, b) (a, b))"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4167
       if "path p" "path_image p \<subseteq> S \<times> T" "p 1 = p 0" "a \<in> S" "b \<in> T"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4168
       for p a b
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4169
  proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4170
    have "path (fst \<circ> p)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4171
      apply (rule Path_Connected.path_continuous_image [OF \<open>path p\<close>])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4172
      apply (rule continuous_intros)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4173
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4174
    moreover have "path_image (fst \<circ> p) \<subseteq> S"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4175
      using that apply (simp add: path_image_def) by force
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4176
    ultimately have p1: "homotopic_loops S (fst o p) (linepath a a)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4177
      using S that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4178
      apply (simp add: simply_connected_eq_contractible_loop_any)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4179
      apply (drule_tac x="fst o p" in spec)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4180
      apply (drule_tac x=a in spec)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4181
      apply (auto simp: pathstart_def pathfinish_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4182
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4183
    have "path (snd \<circ> p)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4184
      apply (rule Path_Connected.path_continuous_image [OF \<open>path p\<close>])
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4185
      apply (rule continuous_intros)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4186
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4187
    moreover have "path_image (snd \<circ> p) \<subseteq> T"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4188
      using that apply (simp add: path_image_def) by force
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4189
    ultimately have p2: "homotopic_loops T (snd o p) (linepath b b)"
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4190
      using T that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4191
      apply (simp add: simply_connected_eq_contractible_loop_any)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4192
      apply (drule_tac x="snd o p" in spec)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4193
      apply (drule_tac x=b in spec)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4194
      apply (auto simp: pathstart_def pathfinish_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4195
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4196
    show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4197
      using p1 p2
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4198
      apply (simp add: homotopic_loops, clarify)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4199
      apply (rename_tac h k)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4200
      apply (rule_tac x="\<lambda>z. Pair (h z) (k z)" in exI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4201
      apply (intro conjI continuous_intros | assumption)+
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4202
      apply (auto simp: pathstart_def pathfinish_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4203
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4204
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4205
  with assms show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4206
    by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4207
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4208
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4209
subsection\<open>Contractible sets\<close>
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4210
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4211
definition contractible where
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4212
 "contractible S \<equiv> \<exists>a. homotopic_with (\<lambda>x. True) S S id (\<lambda>x. a)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4213
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4214
proposition contractible_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4215
  fixes S :: "_::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4216
  assumes "contractible S" shows "simply_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4217
proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4218
  case True then show ?thesis by force
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4219
next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4220
  case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4221
  obtain a where a: "homotopic_with (\<lambda>x. True) S S id (\<lambda>x. a)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4222
    using assms by (force simp add: contractible_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4223
  then have "a \<in> S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4224
    by (metis False homotopic_constant_maps homotopic_with_symD homotopic_with_trans path_component_mem(2))
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4225
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4226
    apply (simp add: simply_connected_eq_contractible_loop_all False)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4227
    apply (rule bexI [OF _ \<open>a \<in> S\<close>])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4228
    using a apply (simp add: homotopic_loops_def homotopic_with_def path_def path_image_def pathfinish_def pathstart_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4229
    apply clarify
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4230
    apply (rule_tac x="(h o (\<lambda>y. (fst y, (p \<circ> snd) y)))" in exI)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4231
    apply (intro conjI continuous_on_compose continuous_intros)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4232
    apply (erule continuous_on_subset | force)+
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4233
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4234
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4235
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4236
corollary contractible_imp_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4237
  fixes S :: "_::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4238
  shows "contractible S \<Longrightarrow> connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4239
by (simp add: contractible_imp_simply_connected simply_connected_imp_connected)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4240
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4241
lemma contractible_imp_path_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4242
  fixes S :: "_::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4243
  shows "contractible S \<Longrightarrow> path_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4244
by (simp add: contractible_imp_simply_connected simply_connected_imp_path_connected)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4245
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4246
lemma nullhomotopic_through_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4247
  fixes S :: "_::topological_space set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4248
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4249
      and g: "continuous_on T g" "g ` T \<subseteq> U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4250
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4251
    obtains c where "homotopic_with (\<lambda>h. True) S U (g o f) (\<lambda>x. c)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4252
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4253
  obtain b where b: "homotopic_with (\<lambda>x. True) T T id (\<lambda>x. b)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4254
    using assms by (force simp add: contractible_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4255
  have "homotopic_with (\<lambda>f. True) T U (g \<circ> id) (g \<circ> (\<lambda>x. b))"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4256
    by (rule homotopic_compose_continuous_left [OF b g])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4257
  then have "homotopic_with (\<lambda>f. True) S U (g \<circ> id \<circ> f) (g \<circ> (\<lambda>x. b) \<circ> f)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4258
    by (rule homotopic_compose_continuous_right [OF _ f])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4259
  then show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4260
    by (simp add: comp_def that)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4261
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4262
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4263
lemma nullhomotopic_into_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4264
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4265
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4266
    obtains c where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. c)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4267
apply (rule nullhomotopic_through_contractible [OF f, of id T])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4268
using assms
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4269
apply (auto simp: continuous_on_id)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4270
done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4271
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4272
lemma nullhomotopic_from_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4273
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4274
      and S: "contractible S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4275
    obtains c where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. c)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4276
apply (rule nullhomotopic_through_contractible [OF continuous_on_id _ f S, of S])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4277
using assms
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4278
apply (auto simp: comp_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4279
done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4280
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4281
lemma homotopic_through_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4282
  fixes S :: "_::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4283
  assumes "continuous_on S f1" "f1 ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4284
          "continuous_on T g1" "g1 ` T \<subseteq> U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4285
          "continuous_on S f2" "f2 ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4286
          "continuous_on T g2" "g2 ` T \<subseteq> U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4287
          "contractible T" "path_connected U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4288
   shows "homotopic_with (\<lambda>h. True) S U (g1 o f1) (g2 o f2)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4289
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4290
  obtain c1 where c1: "homotopic_with (\<lambda>h. True) S U (g1 o f1) (\<lambda>x. c1)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4291
    apply (rule nullhomotopic_through_contractible [of S f1 T g1 U])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4292
    using assms apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4293
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4294
  obtain c2 where c2: "homotopic_with (\<lambda>h. True) S U (g2 o f2) (\<lambda>x. c2)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4295
    apply (rule nullhomotopic_through_contractible [of S f2 T g2 U])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4296
    using assms apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4297
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4298
  have *: "S = {} \<or> (\<exists>t. path_connected t \<and> t \<subseteq> U \<and> c2 \<in> t \<and> c1 \<in> t)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4299
  proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4300
    case True then show ?thesis by force
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4301
  next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4302
    case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4303
    with c1 c2 have "c1 \<in> U" "c2 \<in> U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4304
      using homotopic_with_imp_subset2 all_not_in_conv image_subset_iff by blast+
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4305
    with \<open>path_connected U\<close> show ?thesis by blast
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4306
  qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4307
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4308
    apply (rule homotopic_with_trans [OF c1])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4309
    apply (rule homotopic_with_symD)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4310
    apply (rule homotopic_with_trans [OF c2])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4311
    apply (simp add: path_component homotopic_constant_maps *)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4312
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4313
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4314
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4315
lemma homotopic_into_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4316
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4317
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4318
      and g: "continuous_on S g" "g ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4319
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4320
    shows "homotopic_with (\<lambda>h. True) S T f g"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4321
using homotopic_through_contractible [of S f T id T g id]
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4322
by (simp add: assms contractible_imp_path_connected continuous_on_id)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4323
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4324
lemma homotopic_from_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4325
  fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4326
  assumes f: "continuous_on S f" "f ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4327
      and g: "continuous_on S g" "g ` S \<subseteq> T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4328
      and "contractible S" "path_connected T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4329
    shows "homotopic_with (\<lambda>h. True) S T f g"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4330
using homotopic_through_contractible [of S id S f T id g]
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4331
by (simp add: assms contractible_imp_path_connected continuous_on_id)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4332
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4333
lemma starlike_imp_contractible_gen:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4334
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4335
  assumes S: "starlike S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4336
      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)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4337
    obtains a where "homotopic_with P S S (\<lambda>x. x) (\<lambda>x. a)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4338
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4339
  obtain a where "a \<in> S" and a: "\<And>x. x \<in> S \<Longrightarrow> closed_segment a x \<subseteq> S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4340
    using S by (auto simp add: starlike_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4341
  have "(\<lambda>y. (1 - fst y) *\<^sub>R snd y + fst y *\<^sub>R a) ` ({0..1} \<times> S) \<subseteq> S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4342
    apply clarify
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4343
    apply (erule a [unfolded closed_segment_def, THEN subsetD])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4344
    apply (simp add: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4345
    apply (metis add_diff_cancel_right' diff_ge_0_iff_ge le_add_diff_inverse pth_c(1))
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4346
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4347
  then show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4348
    apply (rule_tac a="a" in that)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4349
    using \<open>a \<in> S\<close>
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4350
    apply (simp add: homotopic_with_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4351
    apply (rule_tac x="\<lambda>y. (1 - (fst y)) *\<^sub>R snd y + (fst y) *\<^sub>R a" in exI)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4352
    apply (intro conjI ballI continuous_on_compose continuous_intros)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4353
    apply (simp_all add: P)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4354
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4355
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4356
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4357
lemma starlike_imp_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4358
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4359
  shows "starlike S \<Longrightarrow> contractible S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4360
using starlike_imp_contractible_gen contractible_def by (fastforce simp: id_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4361
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4362
lemma contractible_UNIV: "contractible (UNIV :: 'a::real_normed_vector set)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4363
  by (simp add: starlike_imp_contractible)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4364
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4365
lemma starlike_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4366
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4367
  shows "starlike S \<Longrightarrow> simply_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4368
by (simp add: contractible_imp_simply_connected starlike_imp_contractible)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4369
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4370
lemma convex_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4371
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4372
  shows "convex S \<Longrightarrow> simply_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4373
using convex_imp_starlike starlike_imp_simply_connected by blast
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4374
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4375
lemma starlike_imp_path_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4376
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4377
  shows "starlike S \<Longrightarrow> path_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4378
by (simp add: simply_connected_imp_path_connected starlike_imp_simply_connected)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4379
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4380
lemma starlike_imp_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4381
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4382
  shows "starlike S \<Longrightarrow> connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4383
by (simp add: path_connected_imp_connected starlike_imp_path_connected)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4384
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4385
lemma is_interval_simply_connected_1:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4386
  fixes S :: "real set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4387
  shows "is_interval S \<longleftrightarrow> simply_connected S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4388
using convex_imp_simply_connected is_interval_convex_1 is_interval_path_connected_1 simply_connected_imp_path_connected by auto
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4389
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4390
lemma contractible_empty: "contractible {}"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4391
  by (simp add: continuous_on_empty contractible_def homotopic_with)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4392
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4393
lemma contractible_convex_tweak_boundary_points:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4394
  fixes S :: "'a::euclidean_space set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4395
  assumes "convex S" and TS: "rel_interior S \<subseteq> T" "T \<subseteq> closure S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4396
  shows "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4397
proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4398
  case True
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4399
  with assms show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4400
    by (simp add: contractible_empty subsetCE)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4401
next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4402
  case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4403
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4404
    apply (rule starlike_imp_contractible)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4405
    apply (rule starlike_convex_tweak_boundary_points [OF \<open>convex S\<close> False TS])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4406
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4407
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4408
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4409
lemma convex_imp_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4410
  fixes S :: "'a::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4411
  shows "convex S \<Longrightarrow> contractible S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4412
using contractible_empty convex_imp_starlike starlike_imp_contractible by auto
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4413
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4414
lemma contractible_sing:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4415
  fixes a :: "'a::real_normed_vector"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4416
  shows "contractible {a}"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4417
by (rule convex_imp_contractible [OF convex_singleton])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4418
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4419
lemma is_interval_contractible_1:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4420
  fixes S :: "real set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4421
  shows  "is_interval S \<longleftrightarrow> contractible S"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4422
using contractible_imp_simply_connected convex_imp_contractible is_interval_convex_1
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4423
      is_interval_simply_connected_1 by auto
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4424
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  4425
lemma contractible_Times:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4426
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4427
  assumes S: "contractible S" and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4428
  shows "contractible (S \<times> T)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4429
proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4430
  obtain a h where conth: "continuous_on ({0..1} \<times> S) h"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4431
             and hsub: "h ` ({0..1} \<times> S) \<subseteq> S"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4432
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow> h (0, x) = x"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4433
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow>  h (1::real, x) = a"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4434
    using S by (auto simp add: contractible_def homotopic_with)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4435
  obtain b k where contk: "continuous_on ({0..1} \<times> T) k"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4436
             and ksub: "k ` ({0..1} \<times> T) \<subseteq> T"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4437
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow> k (0, x) = x"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4438
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow>  k (1::real, x) = b"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4439
    using T by (auto simp add: contractible_def homotopic_with)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4440
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4441
    apply (simp add: contractible_def homotopic_with)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4442
    apply (rule exI [where x=a])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4443
    apply (rule exI [where x=b])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4444
    apply (rule exI [where x = "\<lambda>z. (h (fst z, fst(snd z)), k (fst z, snd(snd z)))"])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4445
    apply (intro conjI ballI continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF contk])
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4446
    using hsub ksub
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4447
    apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4448
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4449
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4450
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4451
lemma homotopy_dominated_contractibility:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4452
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4453
  assumes S: "contractible S"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4454
      and f: "continuous_on S f" "image f S \<subseteq> T"
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4455
      and g: "continuous_on T g" "image g T \<subseteq> S"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4456
      and hom: "homotopic_with (\<lambda>x. True) T T (f o g) id"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4457
    shows "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4458
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4459
  obtain b where "homotopic_with (\<lambda>h. True) S T f (\<lambda>x. b)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4460
    using nullhomotopic_from_contractible [OF f S] .
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4461
  then have homg: "homotopic_with (\<lambda>x. True) T T ((\<lambda>x. b) \<circ> g) (f \<circ> g)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4462
    by (rule homotopic_with_compose_continuous_right [OF homotopic_with_symD g])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4463
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4464
    apply (simp add: contractible_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4465
    apply (rule exI [where x = b])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4466
    apply (rule homotopic_with_symD)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4467
    apply (rule homotopic_with_trans [OF _ hom])
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4468
    using homg apply (simp add: o_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4469
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4470
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4471
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4472
subsection\<open>Local versions of topological properties in general\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4473
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4474
definition locally :: "('a::topological_space set \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> bool"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4475
where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4476
 "locally P S \<equiv>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4477
        \<forall>w x. openin (subtopology euclidean S) w \<and> x \<in> w
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4478
              \<longrightarrow> (\<exists>u v. openin (subtopology euclidean S) u \<and> P v \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4479
                        x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4480
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4481
lemma locallyI:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4482
  assumes "\<And>w x. \<lbrakk>openin (subtopology euclidean S) w; x \<in> w\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4483
                  \<Longrightarrow> \<exists>u v. openin (subtopology euclidean S) u \<and> P v \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4484
                        x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4485
    shows "locally P S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4486
using assms by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4487
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4488
lemma locallyE:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4489
  assumes "locally P S" "openin (subtopology euclidean S) w" "x \<in> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4490
  obtains u v where "openin (subtopology euclidean S) u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4491
                    "P v" "x \<in> u" "u \<subseteq> v" "v \<subseteq> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4492
using assms by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4493
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4494
lemma locally_mono:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4495
  assumes "locally P S" "\<And>t. P t \<Longrightarrow> Q t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4496
    shows "locally Q S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4497
by (metis assms locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4498
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4499
lemma locally_open_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4500
  assumes "locally P S" "openin (subtopology euclidean S) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4501
    shows "locally P t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4502
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4503
apply (simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4504
apply (erule all_forward)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4505
apply (rule impI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4506
apply (erule impCE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4507
 using openin_trans apply blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4508
apply (erule ex_forward)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4509
by (metis (no_types, hide_lams) Int_absorb1 Int_lower1 Int_subset_iff openin_open openin_subtopology_Int_subset)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4510
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4511
lemma locally_diff_closed:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4512
    "\<lbrakk>locally P S; closedin (subtopology euclidean S) t\<rbrakk> \<Longrightarrow> locally P (S - t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4513
  using locally_open_subset closedin_def by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4514
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4515
lemma locally_empty [iff]: "locally P {}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4516
  by (simp add: locally_def openin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4517
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4518
lemma locally_singleton [iff]:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4519
  fixes a :: "'a::metric_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4520
  shows "locally P {a} \<longleftrightarrow> P {a}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4521
apply (simp add: locally_def openin_euclidean_subtopology_iff subset_singleton_iff conj_disj_distribR cong: conj_cong)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4522
using zero_less_one by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4523
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4524
lemma locally_iff:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4525
    "locally P S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4526
     (\<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)))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4527
apply (simp add: le_inf_iff locally_def openin_open, safe)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4528
apply (metis IntE IntI le_inf_iff)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4529
apply (metis IntI Int_subset_iff)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4530
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4531
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4532
lemma locally_Int:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4533
  assumes S: "locally P S" and t: "locally P t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4534
      and P: "\<And>S t. P S \<and> P t \<Longrightarrow> P(S \<inter> t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4535
    shows "locally P (S \<inter> t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4536
using S t unfolding locally_iff
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4537
apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4538
apply (drule_tac x=T in spec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4539
apply (drule_tac x=x in spec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4540
apply clarsimp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4541
apply (rename_tac U1 U2 V1 V2)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4542
apply (rule_tac x="U1 \<inter> U2" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4543
apply (simp add: open_Int)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4544
apply (rule_tac x="V1 \<inter> V2" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4545
apply (auto intro: P)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4546
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4547
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4548
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4549
proposition homeomorphism_locally_imp:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4550
  fixes S :: "'a::metric_space set" and t :: "'b::t2_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4551
  assumes S: "locally P S" and hom: "homeomorphism S t f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4552
      and Q: "\<And>S t. \<lbrakk>P S; homeomorphism S t f g\<rbrakk> \<Longrightarrow> Q t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4553
    shows "locally Q t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4554
proof (clarsimp simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4555
  fix w y
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4556
  assume "y \<in> w" and "openin (subtopology euclidean t) w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4557
  then obtain T where T: "open T" "w = t \<inter> T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4558
    by (force simp: openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4559
  then have "w \<subseteq> t" by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4560
  have f: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "f ` S = t" "continuous_on S f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4561
   and g: "\<And>y. y \<in> t \<Longrightarrow> f(g y) = y" "g ` t = S" "continuous_on t g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4562
    using hom by (auto simp: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4563
  have gw: "g ` w = S \<inter> {x. f x \<in> w}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4564
    using \<open>w \<subseteq> t\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4565
    apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4566
    using \<open>g ` t = S\<close> \<open>w \<subseteq> t\<close> apply blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4567
    using g \<open>w \<subseteq> t\<close> apply auto[1]
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4568
    by (simp add: f rev_image_eqI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4569
  have o: "openin (subtopology euclidean S) (g ` w)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4570
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4571
    have "continuous_on S f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4572
      using f(3) by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4573
    then show "openin (subtopology euclidean S) (g ` w)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4574
      by (simp add: gw Collect_conj_eq \<open>openin (subtopology euclidean t) w\<close> continuous_on_open f(2))
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4575
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4576
  then obtain u v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4577
    where osu: "openin (subtopology euclidean S) u" and uv: "P v" "g y \<in> u" "u \<subseteq> v" "v \<subseteq> g ` w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4578
    using S [unfolded locally_def, rule_format, of "g ` w" "g y"] \<open>y \<in> w\<close> by force
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4579
  have "v \<subseteq> S" using uv by (simp add: gw)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4580
  have fv: "f ` v = t \<inter> {x. g x \<in> v}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4581
    using \<open>f ` S = t\<close> f \<open>v \<subseteq> S\<close> by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4582
  have "f ` v \<subseteq> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4583
    using uv using Int_lower2 gw image_subsetI mem_Collect_eq subset_iff by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4584
  have contvf: "continuous_on v f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4585
    using \<open>v \<subseteq> S\<close> continuous_on_subset f(3) by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4586
  have contvg: "continuous_on (f ` v) g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4587
    using \<open>f ` v \<subseteq> w\<close> \<open>w \<subseteq> t\<close> continuous_on_subset g(3) by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4588
  have homv: "homeomorphism v (f ` v) f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4589
    using \<open>v \<subseteq> S\<close> \<open>w \<subseteq> t\<close> f
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4590
    apply (simp add: homeomorphism_def contvf contvg, auto)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4591
    by (metis f(1) rev_image_eqI rev_subsetD)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4592
  have 1: "openin (subtopology euclidean t) {x \<in> t. g x \<in> u}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4593
    apply (rule continuous_on_open [THEN iffD1, rule_format])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4594
    apply (rule \<open>continuous_on t g\<close>)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4595
    using \<open>g ` t = S\<close> apply (simp add: osu)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4596
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4597
  have 2: "\<exists>v. Q v \<and> y \<in> {x \<in> t. g x \<in> u} \<and> {x \<in> t. g x \<in> u} \<subseteq> v \<and> v \<subseteq> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4598
    apply (rule_tac x="f ` v" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4599
    apply (intro conjI Q [OF \<open>P v\<close> homv])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4600
    using \<open>w \<subseteq> t\<close> \<open>y \<in> w\<close>  \<open>f ` v \<subseteq> w\<close>  uv  apply (auto simp: fv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4601
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4602
  show "\<exists>u. openin (subtopology euclidean t) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4603
            (\<exists>v. Q v \<and> y \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4604
    by (meson 1 2)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4605
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4606
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4607
lemma homeomorphism_locally:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4608
  fixes f:: "'a::metric_space \<Rightarrow> 'b::metric_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4609
  assumes hom: "homeomorphism S t f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4610
      and eq: "\<And>S t. homeomorphism S t f g \<Longrightarrow> (P S \<longleftrightarrow> Q t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4611
    shows "locally P S \<longleftrightarrow> locally Q t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4612
apply (rule iffI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4613
apply (erule homeomorphism_locally_imp [OF _ hom])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4614
apply (simp add: eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4615
apply (erule homeomorphism_locally_imp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4616
using eq homeomorphism_sym homeomorphism_symD [OF hom] apply blast+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4617
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4618
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4619
lemma homeomorphic_locally:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4620
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4621
  assumes hom: "S homeomorphic T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4622
          and iff: "\<And>X Y. X homeomorphic Y \<Longrightarrow> (P X \<longleftrightarrow> Q Y)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4623
    shows "locally P S \<longleftrightarrow> locally Q T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4624
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4625
  obtain f g where hom: "homeomorphism S T f g"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4626
    using assms by (force simp: homeomorphic_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4627
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4628
    using homeomorphic_def local.iff
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4629
    by (blast intro!: homeomorphism_locally)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4630
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4631
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4632
lemma homeomorphic_local_compactness:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4633
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4634
  shows "S homeomorphic T \<Longrightarrow> locally compact S \<longleftrightarrow> locally compact T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4635
by (simp add: homeomorphic_compactness homeomorphic_locally)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4636
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4637
lemma locally_translation:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4638
  fixes P :: "'a :: real_normed_vector set \<Rightarrow> bool"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4639
  shows
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4640
   "(\<And>S. P (image (\<lambda>x. a + x) S) \<longleftrightarrow> P S)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4641
        \<Longrightarrow> locally P (image (\<lambda>x. a + x) S) \<longleftrightarrow> locally P S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4642
apply (rule homeomorphism_locally [OF homeomorphism_translation])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4643
apply (simp add: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4644
by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4645
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4646
lemma locally_injective_linear_image:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4647
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4648
  assumes f: "linear f" "inj f" and iff: "\<And>S. P (f ` S) \<longleftrightarrow> Q S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4649
    shows "locally P (f ` S) \<longleftrightarrow> locally Q S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4650
apply (rule linear_homeomorphism_image [OF f])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4651
apply (rule_tac f=g and g = f in homeomorphism_locally, assumption)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4652
by (metis iff homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4653
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4654
lemma locally_open_map_image:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4655
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4656
  assumes P: "locally P S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4657
      and f: "continuous_on S f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4658
      and oo: "\<And>t. openin (subtopology euclidean S) t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4659
                   \<Longrightarrow> openin (subtopology euclidean (f ` S)) (f ` t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4660
      and Q: "\<And>t. \<lbrakk>t \<subseteq> S; P t\<rbrakk> \<Longrightarrow> Q(f ` t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4661
    shows "locally Q (f ` S)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4662
proof (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4663
  fix w y
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4664
  assume oiw: "openin (subtopology euclidean (f ` S)) w" and "y \<in> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4665
  then have "w \<subseteq> f ` S" by (simp add: openin_euclidean_subtopology_iff)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4666
  have oivf: "openin (subtopology euclidean S) {x \<in> S. f x \<in> w}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4667
    by (rule continuous_on_open [THEN iffD1, rule_format, OF f oiw])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4668
  then obtain x where "x \<in> S" "f x = y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4669
    using \<open>w \<subseteq> f ` S\<close> \<open>y \<in> w\<close> by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4670
  then obtain u v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4671
    where "openin (subtopology euclidean S) u" "P v" "x \<in> u" "u \<subseteq> v" "v \<subseteq> {x \<in> S. f x \<in> w}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4672
    using P [unfolded locally_def, rule_format, of "{x. x \<in> S \<and> f x \<in> w}" x] oivf \<open>y \<in> w\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4673
    by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4674
  then show "\<exists>u. openin (subtopology euclidean (f ` S)) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4675
            (\<exists>v. Q v \<and> y \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> w)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4676
    apply (rule_tac x="f ` u" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4677
    apply (rule conjI, blast intro!: oo)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4678
    apply (rule_tac x="f ` v" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4679
    apply (force simp: \<open>f x = y\<close> rev_image_eqI intro: Q)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4680
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4681
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4682
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4683
subsection\<open>Sort of induction principle for connected sets\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4684
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4685
lemma connected_induction:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4686
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4687
      and opD: "\<And>T a. \<lbrakk>openin (subtopology euclidean S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4688
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4689
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4690
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<and> P y \<and> Q x \<longrightarrow> Q y)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4691
      and etc: "a \<in> S" "b \<in> S" "P a" "P b" "Q a"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4692
    shows "Q b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4693
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4694
  have 1: "openin (subtopology euclidean S)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4695
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4696
                     b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> Q x)}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4697
    apply (subst openin_subopen, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4698
    apply (rule_tac x=T in exI, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4699
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4700
  have 2: "openin (subtopology euclidean S)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4701
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4702
                     b \<in> T \<and> (\<forall>x\<in>T. P x \<longrightarrow> ~ Q x)}"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4703
    apply (subst openin_subopen, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4704
    apply (rule_tac x=T in exI, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4705
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4706
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4707
    using \<open>connected S\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4708
    apply (simp only: connected_openin HOL.not_ex HOL.de_Morgan_conj)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4709
    apply (elim disjE allE)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4710
         apply (blast intro: 1)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4711
        apply (blast intro: 2, simp_all)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4712
       apply clarify apply (metis opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4713
      using opD apply (blast intro: etc elim: dest:)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4714
     using opI etc apply meson+
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4715
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4716
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4717
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4718
lemma connected_equivalence_relation_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4719
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4720
      and etc: "a \<in> S" "b \<in> S" "P a" "P b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4721
      and trans: "\<And>x y z. \<lbrakk>R x y; R y z\<rbrakk> \<Longrightarrow> R x z"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4722
      and opD: "\<And>T a. \<lbrakk>openin (subtopology euclidean S) T; a \<in> T\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> T \<and> P z"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4723
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4724
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4725
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<and> P y \<longrightarrow> R x y)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4726
    shows "R a b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4727
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4728
  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"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4729
    apply (rule connected_induction [OF \<open>connected S\<close> opD], simp_all)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4730
    by (meson trans opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4731
  then show ?thesis by (metis etc opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4732
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4733
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4734
lemma connected_induction_simple:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4735
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4736
      and etc: "a \<in> S" "b \<in> S" "P a"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4737
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4738
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4739
                     (\<forall>x \<in> T. \<forall>y \<in> T. P x \<longrightarrow> P y)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4740
    shows "P b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4741
apply (rule connected_induction [OF \<open>connected S\<close> _, where P = "\<lambda>x. True"], blast)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4742
apply (frule opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4743
using etc apply simp_all
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4744
done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4745
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4746
lemma connected_equivalence_relation:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4747
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4748
      and etc: "a \<in> S" "b \<in> S"
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4749
      and sym: "\<And>x y. \<lbrakk>R x y; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> R y x"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4750
      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"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4751
      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)"
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4752
    shows "R a b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4753
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4754
  have "\<And>a b c. \<lbrakk>a \<in> S; b \<in> S; c \<in> S; R a b\<rbrakk> \<Longrightarrow> R a c"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4755
    apply (rule connected_induction_simple [OF \<open>connected S\<close>], simp_all)
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  4756
    by (meson local.sym local.trans opI openin_imp_subset subsetCE)
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4757
  then show ?thesis by (metis etc opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4758
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4759
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4760
lemma locally_constant_imp_constant:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4761
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4762
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4763
             \<Longrightarrow> \<exists>T. openin (subtopology euclidean S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. f x = f a)"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4764
    shows "f constant_on S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4765
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4766
  have "\<And>x y. x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> f x = f y"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4767
    apply (rule connected_equivalence_relation [OF \<open>connected S\<close>], simp_all)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4768
    by (metis opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4769
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4770
    by (metis constant_on_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4771
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4772
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4773
lemma locally_constant:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4774
     "connected S \<Longrightarrow> locally (\<lambda>U. f constant_on U) S \<longleftrightarrow> f constant_on S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4775
apply (simp add: locally_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4776
apply (rule iffI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4777
 apply (rule locally_constant_imp_constant, assumption)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4778
 apply (metis (mono_tags, hide_lams) constant_on_def constant_on_subset openin_subtopology_self)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4779
by (meson constant_on_subset openin_imp_subset order_refl)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4780
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4781
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4782
subsection\<open>Basic properties of local compactness\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4783
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4784
lemma locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4785
  fixes s :: "'a :: metric_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4786
  shows
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4787
    "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4788
     (\<forall>x \<in> s. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4789
                    openin (subtopology euclidean s) u \<and> compact v)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4790
     (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4791
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4792
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4793
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4794
    apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4795
    apply (erule_tac w = "s \<inter> ball x 1" in locallyE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4796
    by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4797
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4798
  assume r [rule_format]: ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4799
  have *: "\<exists>u v.
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4800
              openin (subtopology euclidean s) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4801
              compact v \<and> x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<inter> T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4802
          if "open T" "x \<in> s" "x \<in> T" for x T
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4803
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4804
    obtain u v where uv: "x \<in> u" "u \<subseteq> v" "v \<subseteq> s" "compact v" "openin (subtopology euclidean s) u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4805
      using r [OF \<open>x \<in> s\<close>] by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4806
    obtain e where "e>0" and e: "cball x e \<subseteq> T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4807
      using open_contains_cball \<open>open T\<close> \<open>x \<in> T\<close> by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4808
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4809
      apply (rule_tac x="(s \<inter> ball x e) \<inter> u" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4810
      apply (rule_tac x="cball x e \<inter> v" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4811
      using that \<open>e > 0\<close> e uv
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4812
      apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4813
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4814
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4815
  show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4816
    apply (rule locallyI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4817
    apply (subst (asm) openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4818
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4819
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4820
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4821
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4822
lemma locally_compactE:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4823
  fixes s :: "'a :: metric_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4824
  assumes "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4825
  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>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4826
                             openin (subtopology euclidean s) (u x) \<and> compact (v x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4827
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4828
unfolding locally_compact by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4829
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4830
lemma locally_compact_alt:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4831
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4832
  shows "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4833
         (\<forall>x \<in> s. \<exists>u. x \<in> u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4834
                    openin (subtopology euclidean s) u \<and> compact(closure u) \<and> closure u \<subseteq> s)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4835
apply (simp add: locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4836
apply (intro ball_cong ex_cong refl iffI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4837
apply (metis bounded_subset closure_eq closure_mono compact_eq_bounded_closed dual_order.trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4838
by (meson closure_subset compact_closure)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4839
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4840
lemma locally_compact_Int_cball:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4841
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4842
  shows "locally compact s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>e. 0 < e \<and> closed(cball x e \<inter> s))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4843
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4844
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4845
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4846
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4847
    apply (simp add: locally_compact openin_contains_cball)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4848
    apply (clarify | assumption | drule bspec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4849
    by (metis (no_types, lifting)  compact_cball compact_imp_closed compact_Int inf.absorb_iff2 inf.orderE inf_sup_aci(2))
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4850
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4851
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4852
  then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4853
    apply (simp add: locally_compact openin_contains_cball)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4854
    apply (clarify | assumption | drule bspec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4855
    apply (rule_tac x="ball x e \<inter> s" in exI, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4856
    apply (rule_tac x="cball x e \<inter> s" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4857
    using compact_eq_bounded_closed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4858
    apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4859
    apply (metis open_ball le_infI1 mem_ball open_contains_cball_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4860
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4861
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4862
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4863
lemma locally_compact_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4864
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4865
  shows "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4866
         (\<forall>k. k \<subseteq> s \<and> compact k
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4867
              \<longrightarrow> (\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4868
                         openin (subtopology euclidean s) u \<and> compact v))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4869
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4870
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4871
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4872
  then obtain u v where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4873
    uv: "\<And>x. x \<in> s \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> s \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4874
                             openin (subtopology euclidean s) (u x) \<and> compact (v x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4875
    by (metis locally_compactE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4876
  have *: "\<exists>u v. k \<subseteq> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and> openin (subtopology euclidean s) u \<and> compact v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4877
          if "k \<subseteq> s" "compact k" for k
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4878
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4879
    have "\<And>C. (\<forall>c\<in>C. openin (subtopology euclidean k) c) \<and> k \<subseteq> \<Union>C \<Longrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4880
                    \<exists>D\<subseteq>C. finite D \<and> k \<subseteq> \<Union>D"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4881
      using that by (simp add: compact_eq_openin_cover)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4882
    moreover have "\<forall>c \<in> (\<lambda>x. k \<inter> u x) ` k. openin (subtopology euclidean k) c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4883
      using that by clarify (metis subsetD inf.absorb_iff2 openin_subset openin_subtopology_Int_subset topspace_euclidean_subtopology uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4884
    moreover have "k \<subseteq> \<Union>((\<lambda>x. k \<inter> u x) ` k)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4885
      using that by clarsimp (meson subsetCE uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4886
    ultimately obtain D where "D \<subseteq> (\<lambda>x. k \<inter> u x) ` k" "finite D" "k \<subseteq> \<Union>D"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4887
      by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4888
    then obtain T where T: "T \<subseteq> k" "finite T" "k \<subseteq> \<Union>((\<lambda>x. k \<inter> u x) ` T)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4889
      by (metis finite_subset_image)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4890
    have Tuv: "UNION T u \<subseteq> UNION T v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4891
      using T that by (force simp: dest!: uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4892
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4893
      apply (rule_tac x="\<Union>(u ` T)" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4894
      apply (rule_tac x="\<Union>(v ` T)" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4895
      apply (simp add: Tuv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4896
      using T that
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4897
      apply (auto simp: dest!: uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4898
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4899
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4900
  show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4901
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4902
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4903
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4904
  then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4905
    apply (clarsimp simp add: locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4906
    apply (drule_tac x="{x}" in spec, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4907
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4908
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4909
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4910
lemma open_imp_locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4911
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4912
  assumes "open s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4913
    shows "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4914
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4915
  have *: "\<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and> openin (subtopology euclidean s) u \<and> compact v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4916
          if "x \<in> s" for x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4917
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4918
    obtain e where "e>0" and e: "cball x e \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4919
      using open_contains_cball assms \<open>x \<in> s\<close> by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4920
    have ope: "openin (subtopology euclidean s) (ball x e)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4921
      by (meson e open_ball ball_subset_cball dual_order.trans open_subset)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4922
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4923
      apply (rule_tac x="ball x e" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4924
      apply (rule_tac x="cball x e" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4925
      using \<open>e > 0\<close> e apply (auto simp: ope)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4926
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4927
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4928
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4929
    unfolding locally_compact
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4930
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4931
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4932
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4933
lemma closed_imp_locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4934
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4935
  assumes "closed s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4936
    shows "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4937
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4938
  have *: "\<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> s \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4939
                 openin (subtopology euclidean s) u \<and> compact v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4940
          if "x \<in> s" for x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4941
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4942
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4943
      apply (rule_tac x = "s \<inter> ball x 1" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4944
      apply (rule_tac x = "s \<inter> cball x 1" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4945
      using \<open>x \<in> s\<close> assms apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4946
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4947
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4948
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4949
    unfolding locally_compact
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4950
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4951
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4952
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4953
lemma locally_compact_UNIV: "locally compact (UNIV :: 'a :: heine_borel set)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4954
  by (simp add: closed_imp_locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4955
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4956
lemma locally_compact_Int:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4957
  fixes s :: "'a :: t2_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4958
  shows "\<lbrakk>locally compact s; locally compact t\<rbrakk> \<Longrightarrow> locally compact (s \<inter> t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4959
by (simp add: compact_Int locally_Int)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4960
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4961
lemma locally_compact_closedin:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4962
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4963
  shows "\<lbrakk>closedin (subtopology euclidean s) t; locally compact s\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4964
        \<Longrightarrow> locally compact t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4965
unfolding closedin_closed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4966
using closed_imp_locally_compact locally_compact_Int by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4967
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4968
lemma locally_compact_delete:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4969
     fixes s :: "'a :: t1_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4970
     shows "locally compact s \<Longrightarrow> locally compact (s - {a})"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4971
  by (auto simp: openin_delete locally_open_subset)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4972
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4973
lemma locally_closed:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4974
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4975
  shows "locally closed s \<longleftrightarrow> locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4976
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4977
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4978
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4979
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4980
    apply (simp only: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4981
    apply (erule all_forward imp_forward asm_rl exE)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4982
    apply (rule_tac x = "u \<inter> ball x 1" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4983
    apply (rule_tac x = "v \<inter> cball x 1" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4984
    apply (force intro: openin_trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4985
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4986
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4987
  assume ?rhs then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4988
    using compact_eq_bounded_closed locally_mono by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4989
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4990
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4991
subsection\<open>Important special cases of local connectedness and path connectedness\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4992
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4993
lemma locally_connected_1:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4994
  assumes
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4995
    "\<And>v x. \<lbrakk>openin (subtopology euclidean S) v; x \<in> v\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4996
              \<Longrightarrow> \<exists>u. openin (subtopology euclidean S) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4997
                      connected u \<and> x \<in> u \<and> u \<subseteq> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4998
   shows "locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4999
apply (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5000
apply (drule assms; blast)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5001
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5002
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5003
lemma locally_connected_2:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5004
  assumes "locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5005
          "openin (subtopology euclidean S) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5006
          "x \<in> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5007
   shows "openin (subtopology euclidean S) (connected_component_set t x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5008
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5009
  { fix y :: 'a
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5010
    let ?SS = "subtopology euclidean S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5011
    assume 1: "openin ?SS t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5012
              "\<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))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5013
    and "connected_component t x y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5014
    then have "y \<in> t" and y: "y \<in> connected_component_set t x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5015
      using connected_component_subset by blast+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5016
    obtain F where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5017
      "\<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))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5018
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5019
    then obtain G where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5020
       "\<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)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5021
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5022
    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"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5023
      using 1 \<open>y \<in> t\<close> by presburger
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5024
    have "G y t \<subseteq> connected_component_set t y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5025
      by (metis (no_types) * connected_component_eq_self connected_component_mono contra_subsetD)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5026
    then have "\<exists>A. openin ?SS A \<and> y \<in> A \<and> A \<subseteq> connected_component_set t x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5027
      by (metis (no_types) * connected_component_eq dual_order.trans y)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5028
  }
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5029
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5030
    using assms openin_subopen by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5031
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5032
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5033
lemma locally_connected_3:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5034
  assumes "\<And>t x. \<lbrakk>openin (subtopology euclidean S) t; x \<in> t\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5035
              \<Longrightarrow> openin (subtopology euclidean S)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5036
                          (connected_component_set t x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5037
          "openin (subtopology euclidean S) v" "x \<in> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5038
   shows  "\<exists>u. openin (subtopology euclidean S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5039
using assms connected_component_subset by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5040
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5041
lemma locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5042
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5043
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5044
          \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and> connected u \<and> x \<in> u \<and> u \<subseteq> v))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5045
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5046
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5047
lemma locally_connected_open_connected_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5048
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5049
   (\<forall>t x. openin (subtopology euclidean S) t \<and> x \<in> t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5050
          \<longrightarrow> openin (subtopology euclidean S) (connected_component_set t x))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5051
by (metis locally_connected_1 locally_connected_2 locally_connected_3)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5052
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5053
lemma locally_path_connected_1:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5054
  assumes
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5055
    "\<And>v x. \<lbrakk>openin (subtopology euclidean S) v; x \<in> v\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5056
              \<Longrightarrow> \<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5057
   shows "locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5058
apply (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5059
apply (drule assms; blast)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5060
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5061
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5062
lemma locally_path_connected_2:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5063
  assumes "locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5064
          "openin (subtopology euclidean S) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5065
          "x \<in> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5066
   shows "openin (subtopology euclidean S) (path_component_set t x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5067
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5068
  { fix y :: 'a
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5069
    let ?SS = "subtopology euclidean S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5070
    assume 1: "openin ?SS t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5071
              "\<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))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5072
    and "path_component t x y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5073
    then have "y \<in> t" and y: "y \<in> path_component_set t x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5074
      using path_component_mem(2) by blast+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5075
    obtain F where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5076
      "\<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))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5077
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5078
    then obtain G where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5079
       "\<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)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5080
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5081
    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"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5082
      using 1 \<open>y \<in> t\<close> by presburger
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5083
    have "G y t \<subseteq> path_component_set t y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5084
      using * path_component_maximal set_rev_mp by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5085
    then have "\<exists>A. openin ?SS A \<and> y \<in> A \<and> A \<subseteq> path_component_set t x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5086
      by (metis "*" \<open>G y t \<subseteq> path_component_set t y\<close> dual_order.trans path_component_eq y)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5087
  }
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5088
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5089
    using assms openin_subopen by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5090
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5091
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5092
lemma locally_path_connected_3:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5093
  assumes "\<And>t x. \<lbrakk>openin (subtopology euclidean S) t; x \<in> t\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5094
              \<Longrightarrow> openin (subtopology euclidean S) (path_component_set t x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5095
          "openin (subtopology euclidean S) v" "x \<in> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5096
   shows  "\<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5097
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5098
  have "path_component v x x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5099
    by (meson assms(3) path_component_refl)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5100
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5101
    by (metis assms(1) assms(2) assms(3) mem_Collect_eq path_component_subset path_connected_path_component)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5102
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5103
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5104
proposition locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5105
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5106
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5107
          \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and> path_connected u \<and> x \<in> u \<and> u \<subseteq> v))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5108
by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5109
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5110
proposition locally_path_connected_open_path_component:
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5111
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5112
   (\<forall>t x. openin (subtopology euclidean S) t \<and> x \<in> t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5113
          \<longrightarrow> openin (subtopology euclidean S) (path_component_set t x))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5114
by (metis locally_path_connected_1 locally_path_connected_2 locally_path_connected_3)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5115
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5116
lemma locally_connected_open_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5117
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5118
   (\<forall>t c. openin (subtopology euclidean S) t \<and> c \<in> components t
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5119
          \<longrightarrow> openin (subtopology euclidean S) c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5120
by (metis components_iff locally_connected_open_connected_component)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5121
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5122
proposition locally_connected_im_kleinen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5123
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5124
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5125
       \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5126
                x \<in> u \<and> u \<subseteq> v \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5127
                (\<forall>y. y \<in> u \<longrightarrow> (\<exists>c. connected c \<and> c \<subseteq> v \<and> x \<in> c \<and> y \<in> c))))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5128
   (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5129
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5130
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5131
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5132
    by (fastforce simp add: locally_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5133
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5134
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5135
  have *: "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5136
       if "openin (subtopology euclidean S) t" and c: "c \<in> components t" and "x \<in> c" for t c x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5137
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5138
    from that \<open>?rhs\<close> [rule_format, of t x]
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5139
    obtain u where u:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5140
      "openin (subtopology euclidean S) u \<and> x \<in> u \<and> u \<subseteq> t \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5141
       (\<forall>y. y \<in> u \<longrightarrow> (\<exists>c. connected c \<and> c \<subseteq> t \<and> x \<in> c \<and> y \<in> c))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5142
      by auto (meson subsetD in_components_subset)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5143
    obtain F :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5144
      "\<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))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5145
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5146
    then have F: "F t c \<in> t \<and> c = connected_component_set t (F t c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5147
      by (meson components_iff c)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5148
    obtain G :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a" where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5149
        G: "\<forall>x y. (\<exists>z. z \<in> y \<and> z \<notin> x) = (G x y \<in> y \<and> G x y \<notin> x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5150
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5151
     have "G c u \<notin> u \<or> G c u \<in> c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5152
      using F by (metis (full_types) u connected_componentI connected_component_eq mem_Collect_eq that(3))
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5153
    then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5154
      using G u by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5155
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5156
  show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5157
    apply (clarsimp simp add: locally_connected_open_component)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5158
    apply (subst openin_subopen)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5159
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5160
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5161
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5162
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5163
proposition locally_path_connected_im_kleinen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5164
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5165
   (\<forall>v x. openin (subtopology euclidean S) v \<and> x \<in> v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5166
       \<longrightarrow> (\<exists>u. openin (subtopology euclidean S) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5167
                x \<in> u \<and> u \<subseteq> v \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5168
                (\<forall>y. y \<in> u \<longrightarrow> (\<exists>p. path p \<and> path_image p \<subseteq> v \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5169
                                pathstart p = x \<and> pathfinish p = y))))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5170
   (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5171
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5172
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5173
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5174
    apply (simp add: locally_path_connected path_connected_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5175
    apply (erule all_forward ex_forward imp_forward conjE | simp)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5176
    by (meson dual_order.trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5177
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5178
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5179
  have *: "\<exists>T. openin (subtopology euclidean S) T \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5180
               x \<in> T \<and> T \<subseteq> path_component_set u z"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5181
       if "openin (subtopology euclidean S) u" and "z \<in> u" and c: "path_component u z x" for u z x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5182
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5183
    have "x \<in> u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5184
      by (meson c path_component_mem(2))
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5185
    with that \<open>?rhs\<close> [rule_format, of u x]
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5186
    obtain U where U:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5187
      "openin (subtopology euclidean S) U \<and> x \<in> U \<and> U \<subseteq> u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5188
       (\<forall>y. y \<in> U \<longrightarrow> (\<exists>p. path p \<and> path_image p \<subseteq> u \<and> pathstart p = x \<and> pathfinish p = y))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5189
       by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5190
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5191
      apply (rule_tac x=U in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5192
      apply (auto simp: U)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5193
      apply (metis U c path_component_trans path_component_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5194
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5195
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5196
  show ?lhs
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5197
    apply (clarsimp simp add: locally_path_connected_open_path_component)
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5198
    apply (subst openin_subopen)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5199
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5200
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5201
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5202
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5203
lemma locally_path_connected_imp_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5204
  "locally path_connected S \<Longrightarrow> locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5205
using locally_mono path_connected_imp_connected by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5206
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5207
lemma locally_connected_components:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5208
  "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally connected c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5209
by (meson locally_connected_open_component locally_open_subset openin_subtopology_self)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5210
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5211
lemma locally_path_connected_components:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5212
  "\<lbrakk>locally path_connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally path_connected c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5213
by (meson locally_connected_open_component locally_open_subset locally_path_connected_imp_locally_connected openin_subtopology_self)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5214
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5215
lemma locally_path_connected_connected_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5216
  "locally path_connected S \<Longrightarrow> locally path_connected (connected_component_set S x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5217
by (metis components_iff connected_component_eq_empty locally_empty locally_path_connected_components)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5218
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5219
lemma open_imp_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5220
  fixes S :: "'a :: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5221
  shows "open S \<Longrightarrow> locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5222
apply (rule locally_mono [of convex])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5223
apply (simp_all add: locally_def openin_open_eq convex_imp_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5224
apply (meson Topology_Euclidean_Space.open_ball centre_in_ball convex_ball openE order_trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5225
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5226
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5227
lemma open_imp_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5228
  fixes S :: "'a :: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5229
  shows "open S \<Longrightarrow> locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5230
by (simp add: locally_path_connected_imp_locally_connected open_imp_locally_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5231
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5232
lemma locally_path_connected_UNIV: "locally path_connected (UNIV::'a :: real_normed_vector set)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5233
  by (simp add: open_imp_locally_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5234
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5235
lemma locally_connected_UNIV: "locally connected (UNIV::'a :: real_normed_vector set)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5236
  by (simp add: open_imp_locally_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5237
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5238
lemma openin_connected_component_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5239
    "locally connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5240
     \<Longrightarrow> openin (subtopology euclidean S) (connected_component_set S x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5241
apply (simp add: locally_connected_open_connected_component)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5242
by (metis connected_component_eq_empty connected_component_subset open_empty open_subset openin_subtopology_self)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5243
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5244
lemma openin_components_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5245
    "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> openin (subtopology euclidean S) c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5246
  using locally_connected_open_component openin_subtopology_self by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5247
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5248
lemma openin_path_component_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5249
  "locally path_connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5250
        \<Longrightarrow> openin (subtopology euclidean S) (path_component_set S x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5251
by (metis (no_types) empty_iff locally_path_connected_2 openin_subopen openin_subtopology_self path_component_eq_empty)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5252
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5253
lemma closedin_path_component_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5254
    "locally path_connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5255
        \<Longrightarrow> closedin (subtopology euclidean S) (path_component_set S x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5256
apply  (simp add: closedin_def path_component_subset complement_path_component_Union)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5257
apply (rule openin_Union)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5258
using openin_path_component_locally_path_connected by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5259
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5260
lemma convex_imp_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5261
  fixes S :: "'a:: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5262
  shows "convex S \<Longrightarrow> locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5263
apply (clarsimp simp add: locally_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5264
apply (subst (asm) openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5265
apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5266
apply (erule (1) Topology_Euclidean_Space.openE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5267
apply (rule_tac x = "S \<inter> ball x e" in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5268
apply (force simp: convex_Int convex_imp_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5269
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5270
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5271
lemma convex_imp_locally_connected:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5272
  fixes S :: "'a:: real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5273
  shows "convex S \<Longrightarrow> locally connected S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5274
  by (simp add: locally_path_connected_imp_locally_connected convex_imp_locally_path_connected)
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5275
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5276
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5277
subsection\<open>Relations between components and path components\<close>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5278
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5279
lemma path_component_eq_connected_component:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5280
  assumes "locally path_connected S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5281
    shows "(path_component S x = connected_component S x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5282
proof (cases "x \<in> S")
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5283
  case True
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5284
  have "openin (subtopology euclidean (connected_component_set S x)) (path_component_set S x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5285
    apply (rule openin_subset_trans [of S])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5286
    apply (intro conjI openin_path_component_locally_path_connected [OF assms])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5287
    using path_component_subset_connected_component   apply (auto simp: connected_component_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5288
    done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5289
  moreover have "closedin (subtopology euclidean (connected_component_set S x)) (path_component_set S x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5290
    apply (rule closedin_subset_trans [of S])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5291
    apply (intro conjI closedin_path_component_locally_path_connected [OF assms])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5292
    using path_component_subset_connected_component   apply (auto simp: connected_component_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5293
    done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5294
  ultimately have *: "path_component_set S x = connected_component_set S x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5295
    by (metis connected_connected_component connected_clopen True path_component_eq_empty)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5296
  then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5297
    by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5298
next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5299
  case False then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5300
    by (metis Collect_empty_eq_bot connected_component_eq_empty path_component_eq_empty)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5301
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5302
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5303
lemma path_component_eq_connected_component_set:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5304
     "locally path_connected S \<Longrightarrow> (path_component_set S x = connected_component_set S x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5305
by (simp add: path_component_eq_connected_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5306
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5307
lemma locally_path_connected_path_component:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5308
     "locally path_connected S \<Longrightarrow> locally path_connected (path_component_set S x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5309
using locally_path_connected_connected_component path_component_eq_connected_component by fastforce
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5310
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5311
lemma open_path_connected_component:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5312
  fixes S :: "'a :: real_normed_vector set"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5313
  shows "open S \<Longrightarrow> path_component S x = connected_component S x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5314
by (simp add: path_component_eq_connected_component open_imp_locally_path_connected)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5315
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5316
lemma open_path_connected_component_set:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5317
  fixes S :: "'a :: real_normed_vector set"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5318
  shows "open S \<Longrightarrow> path_component_set S x = connected_component_set S x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5319
by (simp add: open_path_connected_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5320
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5321
proposition locally_connected_quotient_image:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5322
  assumes lcS: "locally connected S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5323
      and oo: "\<And>T. T \<subseteq> f ` S
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5324
                \<Longrightarrow> openin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> T} \<longleftrightarrow>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5325
                    openin (subtopology euclidean (f ` S)) T"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5326
    shows "locally connected (f ` S)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5327
proof (clarsimp simp: locally_connected_open_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5328
  fix U C
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5329
  assume opefSU: "openin (subtopology euclidean (f ` S)) U" and "C \<in> components U"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5330
  then have "C \<subseteq> U" "U \<subseteq> f ` S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5331
    by (meson in_components_subset openin_imp_subset)+
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5332
  then have "openin (subtopology euclidean (f ` S)) C \<longleftrightarrow>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5333
             openin (subtopology euclidean S) {x \<in> S. f x \<in> C}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5334
    by (auto simp: oo)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5335
  moreover have "openin (subtopology euclidean S) {x \<in> S. f x \<in> C}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5336
  proof (subst openin_subopen, clarify)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5337
    fix x
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5338
    assume "x \<in> S" "f x \<in> C"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5339
    show "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> {x \<in> S. f x \<in> C}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5340
    proof (intro conjI exI)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5341
      show "openin (subtopology euclidean S) (connected_component_set {w \<in> S. f w \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5342
      proof (rule ccontr)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5343
        assume **: "\<not> openin (subtopology euclidean S) (connected_component_set {a \<in> S. f a \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5344
        then have "x \<notin> {a \<in> S. f a \<in> U}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5345
          using \<open>U \<subseteq> f ` S\<close> opefSU lcS locally_connected_2 oo by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5346
        with ** show False
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5347
          by (metis (no_types) connected_component_eq_empty empty_iff openin_subopen)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5348
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5349
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5350
      show "x \<in> connected_component_set {w \<in> S. f w \<in> U} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5351
        using \<open>C \<subseteq> U\<close> \<open>f x \<in> C\<close> \<open>x \<in> S\<close> by auto
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5352
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5353
      have contf: "continuous_on S f"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5354
        by (simp add: continuous_on_open oo openin_imp_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5355
      then have "continuous_on (connected_component_set {w \<in> S. f w \<in> U} x) f"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5356
        apply (rule continuous_on_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5357
        using connected_component_subset apply blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5358
        done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5359
      then have "connected (f ` connected_component_set {w \<in> S. f w \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5360
        by (rule connected_continuous_image [OF _ connected_connected_component])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5361
      moreover have "f ` connected_component_set {w \<in> S. f w \<in> U} x \<subseteq> U"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5362
        using connected_component_in by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5363
      moreover have "C \<inter> f ` connected_component_set {w \<in> S. f w \<in> U} x \<noteq> {}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5364
        using \<open>C \<subseteq> U\<close> \<open>f x \<in> C\<close> \<open>x \<in> S\<close> by fastforce
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5365
      ultimately have fC: "f ` (connected_component_set {w \<in> S. f w \<in> U} x) \<subseteq> C"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5366
        by (rule components_maximal [OF \<open>C \<in> components U\<close>])
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5367
      have cUC: "connected_component_set {a \<in> S. f a \<in> U} x \<subseteq> {a \<in> S. f a \<in> C}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5368
        using connected_component_subset fC by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5369
      have "connected_component_set {w \<in> S. f w \<in> U} x \<subseteq> connected_component_set {w \<in> S. f w \<in> C} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5370
      proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5371
        { assume "x \<in> connected_component_set {a \<in> S. f a \<in> U} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5372
          then have ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5373
            by (simp add: cUC connected_component_maximal) }
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5374
        then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5375
          using connected_component_eq_empty by auto
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5376
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5377
      also have "... \<subseteq> {w \<in> S. f w \<in> C}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5378
        by (rule connected_component_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5379
      finally show "connected_component_set {w \<in> S. f w \<in> U} x \<subseteq> {x \<in> S. f x \<in> C}" .
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5380
    qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5381
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5382
  ultimately show "openin (subtopology euclidean (f ` S)) C"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5383
    by metis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5384
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5385
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5386
text\<open>The proof resembles that above but is not identical!\<close>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5387
proposition locally_path_connected_quotient_image:
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5388
  assumes lcS: "locally path_connected S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5389
      and oo: "\<And>T. T \<subseteq> f ` S
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5390
                \<Longrightarrow> openin (subtopology euclidean S) {x. x \<in> S \<and> f x \<in> T} \<longleftrightarrow>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5391
                    openin (subtopology euclidean (f ` S)) T"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5392
    shows "locally path_connected (f ` S)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5393
proof (clarsimp simp: locally_path_connected_open_path_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5394
  fix U y
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5395
  assume opefSU: "openin (subtopology euclidean (f ` S)) U" and "y \<in> U"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5396
  then have "path_component_set U y \<subseteq> U" "U \<subseteq> f ` S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5397
    by (meson path_component_subset openin_imp_subset)+
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5398
  then have "openin (subtopology euclidean (f ` S)) (path_component_set U y) \<longleftrightarrow>
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5399
             openin (subtopology euclidean S) {x \<in> S. f x \<in> path_component_set U y}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5400
  proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5401
    have "path_component_set U y \<subseteq> f ` S"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5402
      using \<open>U \<subseteq> f ` S\<close> \<open>path_component_set U y \<subseteq> U\<close> by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5403
    then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5404
      using oo by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5405
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5406
  moreover have "openin (subtopology euclidean S) {x \<in> S. f x \<in> path_component_set U y}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5407
  proof (subst openin_subopen, clarify)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5408
    fix x
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5409
    assume "x \<in> S" and Uyfx: "path_component U y (f x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5410
    then have "f x \<in> U"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5411
      using path_component_mem by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5412
    show "\<exists>T. openin (subtopology euclidean S) T \<and> x \<in> T \<and> T \<subseteq> {x \<in> S. f x \<in> path_component_set U y}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5413
    proof (intro conjI exI)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5414
      show "openin (subtopology euclidean S) (path_component_set {w \<in> S. f w \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5415
      proof (rule ccontr)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5416
        assume **: "\<not> openin (subtopology euclidean S) (path_component_set {a \<in> S. f a \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5417
        then have "x \<notin> {a \<in> S. f a \<in> U}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5418
          by (metis (no_types, lifting) \<open>U \<subseteq> f ` S\<close> opefSU lcS oo locally_path_connected_open_path_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5419
        then show False
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5420
          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
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5421
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5422
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5423
      show "x \<in> path_component_set {w \<in> S. f w \<in> U} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5424
        by (metis (no_types, lifting) \<open>x \<in> S\<close> IntD2 Int_Collect \<open>path_component U y (f x)\<close> path_component_mem(2) path_component_refl)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5425
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5426
      have contf: "continuous_on S f"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5427
        by (simp add: continuous_on_open oo openin_imp_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5428
      then have "continuous_on (path_component_set {w \<in> S. f w \<in> U} x) f"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5429
        apply (rule continuous_on_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5430
        using path_component_subset apply blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5431
        done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5432
      then have "path_connected (f ` path_component_set {w \<in> S. f w \<in> U} x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5433
        by (simp add: path_connected_continuous_image path_connected_path_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5434
      moreover have "f ` path_component_set {w \<in> S. f w \<in> U} x \<subseteq> U"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5435
        using path_component_mem by fastforce
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5436
      moreover have "f x \<in> f ` path_component_set {w \<in> S. f w \<in> U} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5437
        by (force simp: \<open>x \<in> S\<close> \<open>f x \<in> U\<close> path_component_refl_eq)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5438
      ultimately have "f ` (path_component_set {w \<in> S. f w \<in> U} x) \<subseteq> path_component_set U (f x)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5439
        by (meson path_component_maximal)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5440
       also have  "... \<subseteq> path_component_set U y"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5441
        by (simp add: Uyfx path_component_maximal path_component_subset path_component_sym path_connected_path_component)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5442
      finally have fC: "f ` (path_component_set {w \<in> S. f w \<in> U} x) \<subseteq> path_component_set U y" .
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5443
      have cUC: "path_component_set {a \<in> S. f a \<in> U} x \<subseteq> {a \<in> S. f a \<in> path_component_set U y}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5444
        using path_component_subset fC by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5445
      have "path_component_set {w \<in> S. f w \<in> U} x \<subseteq> path_component_set {w \<in> S. f w \<in> path_component_set U y} x"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5446
      proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5447
        have "\<And>a. path_component_set (path_component_set {a \<in> S. f a \<in> U} x) a \<subseteq> path_component_set {a \<in> S. f a \<in> path_component_set U y} a"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5448
          using cUC path_component_mono by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5449
        then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5450
          using path_component_path_component by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5451
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5452
      also have "... \<subseteq> {w \<in> S. f w \<in> path_component_set U y}"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5453
        by (rule path_component_subset)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5454
      finally show "path_component_set {w \<in> S. f w \<in> U} x \<subseteq> {x \<in> S. f x \<in> path_component_set U y}" .
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5455
    qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5456
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5457
  ultimately show "openin (subtopology euclidean (f ` S)) (path_component_set U y)"
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5458
    by metis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5459
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5460
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5461
subsection\<open>Components, continuity, openin, closedin\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5462
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5463
lemma continuous_on_components_gen:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5464
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5465
  assumes "\<And>c. c \<in> components S \<Longrightarrow>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5466
              openin (subtopology euclidean S) c \<and> continuous_on c f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5467
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5468
proof (clarsimp simp: continuous_openin_preimage_eq)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5469
  fix t :: "'b set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5470
  assume "open t"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5471
  have "{x. x \<in> S \<and> f x \<in> t} = \<Union>{{x. x \<in> c \<and> f x \<in> t} |c. c \<in> components S}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5472
    apply auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5473
    apply (metis (lifting) components_iff connected_component_refl_eq mem_Collect_eq)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5474
    using Union_components by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5475
  then show "openin (subtopology euclidean S) {x \<in> S. f x \<in> t}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5476
    using \<open>open t\<close> assms
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5477
    by (fastforce intro: openin_trans continuous_openin_preimage_gen)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5478
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5479
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5480
lemma continuous_on_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5481
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5482
  assumes "locally connected S "
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5483
          "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5484
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5485
apply (rule continuous_on_components_gen)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5486
apply (auto simp: assms intro: openin_components_locally_connected)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5487
done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5488
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5489
lemma continuous_on_components_eq:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5490
    "locally connected S
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5491
     \<Longrightarrow> (continuous_on S f \<longleftrightarrow> (\<forall>c \<in> components S. continuous_on c f))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5492
by (meson continuous_on_components continuous_on_subset in_components_subset)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5493
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5494
lemma continuous_on_components_open:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5495
 fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5496
  assumes "open S "
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5497
          "\<And>c. c \<in> components S \<Longrightarrow> continuous_on c f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5498
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5499
using continuous_on_components open_imp_locally_connected assms by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5500
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5501
lemma continuous_on_components_open_eq:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5502
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5503
  shows "open S \<Longrightarrow> (continuous_on S f \<longleftrightarrow> (\<forall>c \<in> components S. continuous_on c f))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5504
using continuous_on_subset in_components_subset
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5505
by (blast intro: continuous_on_components_open)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5506
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5507
lemma closedin_union_complement_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5508
  assumes u: "locally connected u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5509
      and S: "closedin (subtopology euclidean u) S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5510
      and cuS: "c \<subseteq> components(u - S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5511
    shows "closedin (subtopology euclidean u) (S \<union> \<Union>c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5512
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5513
  have di: "(\<And>S t. S \<in> c \<and> t \<in> c' \<Longrightarrow> disjnt S t) \<Longrightarrow> disjnt (\<Union> c) (\<Union> c')" for c'
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5514
    by (simp add: disjnt_def) blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5515
  have "S \<subseteq> u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5516
    using S closedin_imp_subset by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5517
  moreover have "u - S = \<Union>c \<union> \<Union>(components (u - S) - c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5518
    by (metis Diff_partition Topology_Euclidean_Space.Union_components Union_Un_distrib assms(3))
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5519
  moreover have "disjnt (\<Union>c) (\<Union>(components (u - S) - c))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5520
    apply (rule di)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5521
    by (metis DiffD1 DiffD2 assms(3) components_nonoverlap disjnt_def subsetCE)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5522
  ultimately have eq: "S \<union> \<Union>c = u - (\<Union>(components(u - S) - c))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5523
    by (auto simp: disjnt_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5524
  have *: "openin (subtopology euclidean u) (\<Union>(components (u - S) - c))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5525
    apply (rule openin_Union)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5526
    apply (rule openin_trans [of "u - S"])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5527
    apply (simp add: u S locally_diff_closed openin_components_locally_connected)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5528
    apply (simp add: openin_diff S)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5529
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5530
  have "openin (subtopology euclidean u) (u - (u - \<Union>(components (u - S) - c)))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5531
    apply (rule openin_diff, simp)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5532
    apply (metis closedin_diff closedin_topspace topspace_euclidean_subtopology *)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5533
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5534
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5535
    by (force simp: eq closedin_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5536
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5537
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5538
lemma closed_union_complement_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5539
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5540
  assumes S: "closed S" and c: "c \<subseteq> components(- S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5541
    shows "closed(S \<union> \<Union> c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5542
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5543
  have "closedin (subtopology euclidean UNIV) (S \<union> \<Union>c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5544
    apply (rule closedin_union_complement_components [OF locally_connected_UNIV])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5545
    using S apply (simp add: closed_closedin)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5546
    using c apply (simp add: Compl_eq_Diff_UNIV)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5547
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5548
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5549
    by (simp add: closed_closedin)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5550
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5551
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5552
lemma closedin_Un_complement_component:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5553
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5554
  assumes u: "locally connected u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5555
      and S: "closedin (subtopology euclidean u) S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5556
      and c: " c \<in> components(u - S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5557
    shows "closedin (subtopology euclidean u) (S \<union> c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5558
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5559
  have "closedin (subtopology euclidean u) (S \<union> \<Union>{c})"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5560
    using c by (blast intro: closedin_union_complement_components [OF u S])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5561
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5562
    by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5563
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5564
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5565
lemma closed_Un_complement_component:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5566
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5567
  assumes S: "closed S" and c: " c \<in> components(-S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5568
    shows "closed (S \<union> c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5569
by (metis Compl_eq_Diff_UNIV S c closed_closedin closedin_Un_complement_component locally_connected_UNIV subtopology_UNIV)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5570
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5571
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5572
subsection\<open>Existence of isometry between subspaces of same dimension\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5573
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5574
lemma isometry_subset_subspace:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5575
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5576
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5577
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5578
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5579
      and d: "dim S \<le> dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5580
  obtains f where "linear f" "f ` S \<subseteq> T" "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5581
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5582
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5583
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5584
             and "independent B" "finite B" "card B = dim S" "span B = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5585
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5586
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5587
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5588
             and "independent C" "finite C" "card C = dim T" "span C = T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5589
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5590
  obtain fb where "fb ` B \<subseteq> C" "inj_on fb B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5591
    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)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5592
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5593
    using Corth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5594
    apply (auto simp: pairwise_def orthogonal_clauses)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5595
    by (meson subsetD image_eqI inj_on_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5596
  obtain f where "linear f" and ffb: "\<And>x. x \<in> B \<Longrightarrow> f x = fb x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5597
    using linear_independent_extend \<open>independent B\<close> by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5598
  have "f ` S \<subseteq> T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5599
    by (metis ffb \<open>fb ` B \<subseteq> C\<close> \<open>linear f\<close> \<open>span B = S\<close> \<open>span C = T\<close> image_cong span_linear_image span_mono)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5600
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5601
    using B1 C1 \<open>fb ` B \<subseteq> C\<close> by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5602
  have "norm (f x) = norm x" if "x \<in> S" for x
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5603
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5604
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5605
      using \<open>finite B\<close> \<open>span B = S\<close> \<open>x \<in> S\<close> span_finite by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5606
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5607
      using linear_setsum [OF \<open>linear f\<close>] x by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5608
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5609
      using \<open>linear f\<close> by (simp add: linear_setsum linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5610
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5611
      by (simp add: ffb cong: setsum.cong)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5612
    finally have "norm (f x)^2 = norm (\<Sum>v\<in>B. a v *\<^sub>R fb v)^2" by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5613
    also have "... = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5614
      apply (rule norm_setsum_Pythagorean [OF \<open>finite B\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5615
      apply (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5616
      done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5617
    also have "... = norm x ^2"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5618
      by (simp add: x pairwise_ortho_scaleR Borth norm_setsum_Pythagorean [OF \<open>finite B\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5619
    finally show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5620
      by (simp add: norm_eq_sqrt_inner)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5621
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5622
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5623
    by (rule that [OF \<open>linear f\<close> \<open>f ` S \<subseteq> T\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5624
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5625
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5626
proposition isometries_subspaces:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5627
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5628
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5629
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5630
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5631
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5632
  obtains f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5633
                    "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5634
                    "\<And>x. x \<in> T \<Longrightarrow> norm(g x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5635
                    "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5636
                    "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5637
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5638
  obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5639
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5640
             and "independent B" "finite B" "card B = dim S" "span B = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5641
    by (metis orthonormal_basis_subspace [OF S] independent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5642
  obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5643
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5644
             and "independent C" "finite C" "card C = dim T" "span C = T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5645
    by (metis orthonormal_basis_subspace [OF T] independent_finite)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5646
  obtain fb where "bij_betw fb B C"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5647
    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)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5648
  then have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5649
    using Corth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5650
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5651
    by (meson subsetD image_eqI inj_on_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5652
  obtain f where "linear f" and ffb: "\<And>x. x \<in> B \<Longrightarrow> f x = fb x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5653
    using linear_independent_extend \<open>independent B\<close> by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5654
  define gb where "gb \<equiv> inv_into B fb"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5655
  then have pairwise_orth_gb: "pairwise (\<lambda>v j. orthogonal (gb v) (gb j)) C"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5656
    using Borth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5657
    apply (auto simp: pairwise_def orthogonal_clauses bij_betw_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5658
    by (metis \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on bij_betw_inv_into_right inv_into_into)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5659
  obtain g where "linear g" and ggb: "\<And>x. x \<in> C \<Longrightarrow> g x = gb x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5660
    using linear_independent_extend \<open>independent C\<close> by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5661
  have "f ` S \<subseteq> T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5662
    by (metis \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on eq_iff ffb  \<open>linear f\<close> \<open>span B = S\<close> \<open>span C = T\<close> image_cong span_linear_image)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5663
  have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5664
    using B1 C1 \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5665
  have f [simp]: "norm (f x) = norm x" "g (f x) = x" if "x \<in> S" for x
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5666
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5667
    obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5668
      using \<open>finite B\<close> \<open>span B = S\<close> \<open>x \<in> S\<close> span_finite by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5669
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5670
      using linear_setsum [OF \<open>linear f\<close>] x by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5671
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5672
      using \<open>linear f\<close> by (simp add: linear_setsum linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5673
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5674
      by (simp add: ffb cong: setsum.cong)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5675
    finally have *: "f x = (\<Sum>v\<in>B. a v *\<^sub>R fb v)" .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5676
    then have "(norm (f x))\<^sup>2 = (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2" by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5677
    also have "... = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5678
      apply (rule norm_setsum_Pythagorean [OF \<open>finite B\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5679
      apply (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5680
      done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5681
    also have "... = (norm x)\<^sup>2"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5682
      by (simp add: x pairwise_ortho_scaleR Borth norm_setsum_Pythagorean [OF \<open>finite B\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5683
    finally show "norm (f x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5684
      by (simp add: norm_eq_sqrt_inner)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5685
    have "g (f x) = g (\<Sum>v\<in>B. a v *\<^sub>R fb v)" by (simp add: *)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5686
    also have "... = (\<Sum>v\<in>B. g (a v *\<^sub>R fb v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5687
      using \<open>linear g\<close> by (simp add: linear_setsum linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5688
    also have "... = (\<Sum>v\<in>B. a v *\<^sub>R g (fb v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5689
      by (simp add: \<open>linear g\<close> linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5690
    also have "... = (\<Sum>v\<in>B. a v *\<^sub>R v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5691
      apply (rule setsum.cong [OF refl])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5692
      using \<open>bij_betw fb B C\<close> gb_def bij_betwE bij_betw_inv_into_left gb_def ggb by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5693
    also have "... = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5694
      using x by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5695
    finally show "g (f x) = x" .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5696
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5697
  have [simp]: "\<And>x. x \<in> C \<Longrightarrow> norm (gb x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5698
    by (metis B1 C1 \<open>bij_betw fb B C\<close> bij_betw_imp_surj_on gb_def inv_into_into)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5699
  have g [simp]: "f (g x) = x" if "x \<in> T" for x
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5700
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5701
    obtain a where x: "x = (\<Sum>v \<in> C. a v *\<^sub>R v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5702
      using \<open>finite C\<close> \<open>span C = T\<close> \<open>x \<in> T\<close> span_finite by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5703
    have "g x = (\<Sum>v \<in> C. g (a v *\<^sub>R v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5704
      using linear_setsum [OF \<open>linear g\<close>] x by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5705
    also have "... = (\<Sum>v \<in> C. a v *\<^sub>R g v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5706
      using \<open>linear g\<close> by (simp add: linear_setsum linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5707
    also have "... = (\<Sum>v \<in> C. a v *\<^sub>R gb v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5708
      by (simp add: ggb cong: setsum.cong)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5709
    finally have "f (g x) = f (\<Sum>v\<in>C. a v *\<^sub>R gb v)" by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5710
    also have "... = (\<Sum>v\<in>C. f (a v *\<^sub>R gb v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5711
      using \<open>linear f\<close> by (simp add: linear_setsum linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5712
    also have "... = (\<Sum>v\<in>C. a v *\<^sub>R f (gb v))"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5713
      by (simp add: \<open>linear f\<close> linear.scaleR)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5714
    also have "... = (\<Sum>v\<in>C. a v *\<^sub>R v)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5715
      using \<open>bij_betw fb B C\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5716
      by (simp add: bij_betw_def gb_def bij_betw_inv_into_right ffb inv_into_into)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5717
    also have "... = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5718
      using x by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5719
    finally show "f (g x) = x" .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5720
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5721
  have gim: "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5722
    by (metis (no_types, lifting) \<open>f ` S \<subseteq> T\<close> \<open>linear g\<close> \<open>span B = S\<close> \<open>span C = T\<close> d dim_eq_span dim_image_le f(2) image_subset_iff span_linear_image span_span subsetI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5723
  have fim: "f ` S = T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5724
    using \<open>g ` T = S\<close> image_iff by fastforce
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5725
  have [simp]: "norm (g x) = norm x" if "x \<in> T" for x
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5726
    using fim that by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5727
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5728
    apply (rule that [OF \<open>linear f\<close> \<open>linear g\<close>])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5729
    apply (simp_all add: fim gim)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5730
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5731
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5732
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5733
corollary isometry_subspaces:
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5734
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5735
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5736
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5737
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5738
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5739
  obtains f where "linear f" "f ` S = T" "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5740
using isometries_subspaces [OF assms]
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5741
by metis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5742
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5743
corollary isomorphisms_UNIV_UNIV:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5744
  assumes "DIM('M) = DIM('N)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5745
  obtains f::"'M::euclidean_space \<Rightarrow>'N::euclidean_space" and g
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5746
  where "linear f" "linear g"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5747
                    "\<And>x. norm(f x) = norm x" "\<And>y. norm(g y) = norm y"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5748
                    "\<And>x. g(f x) = x" "\<And>y. f(g y) = y"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5749
  using assms by (auto simp: dim_UNIV intro: isometries_subspaces [of "UNIV::'M set" "UNIV::'N set"])
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5750
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5751
lemma homeomorphic_subspaces:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5752
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5753
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5754
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5755
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5756
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5757
    shows "S homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5758
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5759
  obtain f g where "linear f" "linear g" "f ` S = T" "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5760
                   "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>x. x \<in> T \<Longrightarrow> f(g x) = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5761
    by (blast intro: isometries_subspaces [OF assms])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5762
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5763
    apply (simp add: homeomorphic_def homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5764
    apply (rule_tac x=f in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5765
    apply (rule_tac x=g in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5766
    apply (auto simp: linear_continuous_on linear_conv_bounded_linear)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5767
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5768
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5769
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5770
lemma homeomorphic_affine_sets:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5771
  assumes "affine S" "affine T" "aff_dim S = aff_dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5772
    shows "S homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5773
proof (cases "S = {} \<or> T = {}")
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5774
  case True  with assms aff_dim_empty homeomorphic_empty show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5775
    by metis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5776
next
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5777
  case False
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5778
  then obtain a b where ab: "a \<in> S" "b \<in> T" by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5779
  then have ss: "subspace (op + (- a) ` S)" "subspace (op + (- b) ` T)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5780
    using affine_diffs_subspace assms by blast+
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5781
  have dd: "dim (op + (- a) ` S) = dim (op + (- b) ` T)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5782
    using assms ab  by (simp add: aff_dim_eq_dim  [OF hull_inc] image_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5783
  have "S homeomorphic (op + (- a) ` S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5784
    by (simp add: homeomorphic_translation)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5785
  also have "... homeomorphic (op + (- b) ` T)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5786
    by (rule homeomorphic_subspaces [OF ss dd])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5787
  also have "... homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5788
    using homeomorphic_sym homeomorphic_translation by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5789
  finally show ?thesis .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5790
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5791
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5792
subsection\<open>Retracts, in a general sense, preserve (co)homotopic triviality)\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5793
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5794
locale Retracts =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5795
  fixes s h t k
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5796
  assumes conth: "continuous_on s h"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5797
      and imh: "h ` s = t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5798
      and contk: "continuous_on t k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5799
      and imk: "k ` t \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5800
      and idhk: "\<And>y. y \<in> t \<Longrightarrow> h(k y) = y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5801
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5802
begin
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5803
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5804
lemma homotopically_trivial_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5805
  assumes P: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k o f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5806
      and Q: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h o f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5807
      and Qeq: "\<And>h k. (\<And>x. x \<in> u \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5808
      and hom: "\<And>f g. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f;
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5809
                       continuous_on u g; g ` u \<subseteq> s; P g\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5810
                       \<Longrightarrow> homotopic_with P u s f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5811
      and contf: "continuous_on u f" and imf: "f ` u \<subseteq> t" and Qf: "Q f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5812
      and contg: "continuous_on u g" and img: "g ` u \<subseteq> t" and Qg: "Q g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5813
    shows "homotopic_with Q u t f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5814
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5815
  have feq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5816
  have geq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> g)) x = g x" using idhk img by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5817
  have "continuous_on u (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5818
    using contf continuous_on_compose continuous_on_subset contk imf by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5819
  moreover have "(k \<circ> f) ` u \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5820
    using imf imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5821
  moreover have "P (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5822
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5823
  moreover have "continuous_on u (k \<circ> g)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5824
    using contg continuous_on_compose continuous_on_subset contk img by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5825
  moreover have "(k \<circ> g) ` u \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5826
    using img imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5827
  moreover have "P (k \<circ> g)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5828
    by (simp add: P Qg contg img)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5829
  ultimately have "homotopic_with P u s (k \<circ> f) (k \<circ> g)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5830
    by (rule hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5831
  then have "homotopic_with Q u t (h \<circ> (k \<circ> f)) (h \<circ> (k \<circ> g))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5832
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5833
    using Q by (auto simp: conth imh)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5834
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5835
    apply (rule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5836
    apply (metis feq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5837
    apply (metis geq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5838
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5839
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5840
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5841
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5842
lemma homotopically_trivial_retraction_null_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5843
  assumes P: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> t; Q f\<rbrakk> \<Longrightarrow> P(k o f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5844
      and Q: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk> \<Longrightarrow> Q(h o f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5845
      and Qeq: "\<And>h k. (\<And>x. x \<in> u \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5846
      and hom: "\<And>f. \<lbrakk>continuous_on u f; f ` u \<subseteq> s; P f\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5847
                     \<Longrightarrow> \<exists>c. homotopic_with P u s f (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5848
      and contf: "continuous_on u f" and imf:"f ` u \<subseteq> t" and Qf: "Q f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5849
  obtains c where "homotopic_with Q u t f (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5850
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5851
  have feq: "\<And>x. x \<in> u \<Longrightarrow> (h \<circ> (k \<circ> f)) x = f x" using idhk imf by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5852
  have "continuous_on u (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5853
    using contf continuous_on_compose continuous_on_subset contk imf by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5854
  moreover have "(k \<circ> f) ` u \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5855
    using imf imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5856
  moreover have "P (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5857
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5858
  ultimately obtain c where "homotopic_with P u s (k \<circ> f) (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5859
    by (metis hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5860
  then have "homotopic_with Q u t (h \<circ> (k \<circ> f)) (h o (\<lambda>x. c))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5861
    apply (rule homotopic_with_compose_continuous_left [OF homotopic_with_mono])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5862
    using Q by (auto simp: conth imh)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5863
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5864
    apply (rule_tac c = "h c" in that)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5865
    apply (erule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5866
    apply (metis feq, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5867
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5868
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5869
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5870
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5871
lemma cohomotopically_trivial_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5872
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> u; Q f\<rbrakk> \<Longrightarrow> P(f o h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5873
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk> \<Longrightarrow> Q(f o k)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5874
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5875
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f;
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5876
                       continuous_on s g; g ` s \<subseteq> u; P g\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5877
                       \<Longrightarrow> homotopic_with P s u f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5878
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> u" and Qf: "Q f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5879
      and contg: "continuous_on t g" and img: "g ` t \<subseteq> u" and Qg: "Q g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5880
    shows "homotopic_with Q t u f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5881
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5882
  have feq: "\<And>x. x \<in> t \<Longrightarrow> (f \<circ> h \<circ> k) x = f x" using idhk imf by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5883
  have geq: "\<And>x. x \<in> t \<Longrightarrow> (g \<circ> h \<circ> k) x = g x" using idhk img by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5884
  have "continuous_on s (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5885
    using contf conth continuous_on_compose imh by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5886
  moreover have "(f \<circ> h) ` s \<subseteq> u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5887
    using imf imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5888
  moreover have "P (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5889
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5890
  moreover have "continuous_on s (g o h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5891
    using contg continuous_on_compose continuous_on_subset conth imh by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5892
  moreover have "(g \<circ> h) ` s \<subseteq> u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5893
    using img imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5894
  moreover have "P (g \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5895
    by (simp add: P Qg contg img)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5896
  ultimately have "homotopic_with P s u (f o h) (g \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5897
    by (rule hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5898
  then have "homotopic_with Q t u (f o h o k) (g \<circ> h o k)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5899
    apply (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5900
    using Q by (auto simp: contk imk)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5901
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5902
    apply (rule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5903
    apply (metis feq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5904
    apply (metis geq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5905
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5906
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5907
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5908
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5909
lemma cohomotopically_trivial_retraction_null_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5910
  assumes P: "\<And>f. \<lbrakk>continuous_on t f; f ` t \<subseteq> u; Q f\<rbrakk> \<Longrightarrow> P(f o h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5911
      and Q: "\<And>f. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk> \<Longrightarrow> Q(f o k)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5912
      and Qeq: "\<And>h k. (\<And>x. x \<in> t \<Longrightarrow> h x = k x) \<Longrightarrow> Q h = Q k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5913
      and hom: "\<And>f g. \<lbrakk>continuous_on s f; f ` s \<subseteq> u; P f\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5914
                       \<Longrightarrow> \<exists>c. homotopic_with P s u f (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5915
      and contf: "continuous_on t f" and imf: "f ` t \<subseteq> u" and Qf: "Q f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5916
  obtains c where "homotopic_with Q t u f (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5917
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5918
  have feq: "\<And>x. x \<in> t \<Longrightarrow> (f \<circ> h \<circ> k) x = f x" using idhk imf by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5919
  have "continuous_on s (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5920
    using contf conth continuous_on_compose imh by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5921
  moreover have "(f \<circ> h) ` s \<subseteq> u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5922
    using imf imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5923
  moreover have "P (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5924
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5925
  ultimately obtain c where "homotopic_with P s u (f o h) (\<lambda>x. c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5926
    by (metis hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5927
  then have "homotopic_with Q t u (f o h o k) ((\<lambda>x. c) o k)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5928
    apply (rule homotopic_with_compose_continuous_right [OF homotopic_with_mono])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5929
    using Q by (auto simp: contk imk)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5930
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5931
    apply (rule_tac c = c in that)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5932
    apply (erule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5933
    apply (metis feq, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5934
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5935
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5936
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5937
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  5938
end
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5939
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5940
lemma simply_connected_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5941
  shows "\<lbrakk>simply_connected S; continuous_on S h; h ` S = T;
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5942
          continuous_on T k; k ` T \<subseteq> S; \<And>y. y \<in> T \<Longrightarrow> h(k y) = y\<rbrakk>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5943
        \<Longrightarrow> simply_connected T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5944
apply (simp add: simply_connected_def path_def path_image_def homotopic_loops_def, clarify)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5945
apply (rule Retracts.homotopically_trivial_retraction_gen
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5946
        [of S h _ k _ "\<lambda>p. pathfinish p = pathstart p"  "\<lambda>p. pathfinish p = pathstart p"])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5947
apply (simp_all add: Retracts_def pathfinish_def pathstart_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5948
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5949
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5950
lemma homeomorphic_simply_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5951
    "\<lbrakk>S homeomorphic T; simply_connected S\<rbrakk> \<Longrightarrow> simply_connected T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5952
  by (auto simp: homeomorphic_def homeomorphism_def intro: simply_connected_retraction_gen)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5953
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5954
lemma homeomorphic_simply_connected_eq:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5955
    "S homeomorphic T \<Longrightarrow> (simply_connected S \<longleftrightarrow> simply_connected T)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5956
  by (metis homeomorphic_simply_connected homeomorphic_sym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5957
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5958
subsection\<open>Homotopy equivalence\<close>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5959
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5960
definition homotopy_eqv :: "'a::topological_space set \<Rightarrow> 'b::topological_space set \<Rightarrow> bool"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5961
             (infix "homotopy'_eqv" 50)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5962
  where "S homotopy_eqv T \<equiv>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5963
        \<exists>f g. continuous_on S f \<and> f ` S \<subseteq> T \<and>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5964
              continuous_on T g \<and> g ` T \<subseteq> S \<and>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5965
              homotopic_with (\<lambda>x. True) S S (g o f) id \<and>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5966
              homotopic_with (\<lambda>x. True) T T (f o g) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5967
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5968
lemma homeomorphic_imp_homotopy_eqv: "S homeomorphic T \<Longrightarrow> S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5969
  unfolding homeomorphic_def homotopy_eqv_def homeomorphism_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5970
  by (fastforce intro!: homotopic_with_equal continuous_on_compose)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5971
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5972
lemma homotopy_eqv_refl: "S homotopy_eqv S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5973
  by (rule homeomorphic_imp_homotopy_eqv homeomorphic_refl)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5974
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5975
lemma homotopy_eqv_sym: "S homotopy_eqv T \<longleftrightarrow> T homotopy_eqv S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5976
  by (auto simp: homotopy_eqv_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5977
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5978
lemma homotopy_eqv_trans [trans]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5979
    fixes S :: "'a::real_normed_vector set" and U :: "'c::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5980
  assumes ST: "S homotopy_eqv T" and TU: "T homotopy_eqv U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5981
    shows "S homotopy_eqv U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5982
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5983
  obtain f1 g1 where f1: "continuous_on S f1" "f1 ` S \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5984
                 and g1: "continuous_on T g1" "g1 ` T \<subseteq> S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5985
                 and hom1: "homotopic_with (\<lambda>x. True) S S (g1 o f1) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5986
                           "homotopic_with (\<lambda>x. True) T T (f1 o g1) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5987
    using ST by (auto simp: homotopy_eqv_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5988
  obtain f2 g2 where f2: "continuous_on T f2" "f2 ` T \<subseteq> U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5989
                 and g2: "continuous_on U g2" "g2 ` U \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5990
                 and hom2: "homotopic_with (\<lambda>x. True) T T (g2 o f2) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5991
                           "homotopic_with (\<lambda>x. True) U U (f2 o g2) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5992
    using TU by (auto simp: homotopy_eqv_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5993
  have "homotopic_with (\<lambda>f. True) S T (g2 \<circ> f2 \<circ> f1) (id \<circ> f1)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5994
    by (rule homotopic_with_compose_continuous_right hom2 f1)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5995
  then have "homotopic_with (\<lambda>f. True) S T (g2 \<circ> (f2 \<circ> f1)) (id \<circ> f1)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5996
    by (simp add: o_assoc)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5997
  then have "homotopic_with (\<lambda>x. True) S S
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5998
         (g1 \<circ> (g2 \<circ> (f2 \<circ> f1))) (g1 o (id o f1))"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  5999
    by (simp add: g1 homotopic_with_compose_continuous_left)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6000
  moreover have "homotopic_with (\<lambda>x. True) S S (g1 o id o f1) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6001
    using hom1 by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6002
  ultimately have SS: "homotopic_with (\<lambda>x. True) S S (g1 \<circ> g2 \<circ> (f2 \<circ> f1)) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6003
    apply (simp add: o_assoc)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6004
    apply (blast intro: homotopic_with_trans)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6005
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6006
  have "homotopic_with (\<lambda>f. True) U T (f1 \<circ> g1 \<circ> g2) (id \<circ> g2)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6007
    by (rule homotopic_with_compose_continuous_right hom1 g2)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6008
  then have "homotopic_with (\<lambda>f. True) U T (f1 \<circ> (g1 \<circ> g2)) (id \<circ> g2)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6009
    by (simp add: o_assoc)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6010
  then have "homotopic_with (\<lambda>x. True) U U
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6011
         (f2 \<circ> (f1 \<circ> (g1 \<circ> g2))) (f2 o (id o g2))"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6012
    by (simp add: f2 homotopic_with_compose_continuous_left)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6013
  moreover have "homotopic_with (\<lambda>x. True) U U (f2 o id o g2) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6014
    using hom2 by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6015
  ultimately have UU: "homotopic_with (\<lambda>x. True) U U (f2 \<circ> f1 \<circ> (g1 \<circ> g2)) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6016
    apply (simp add: o_assoc)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6017
    apply (blast intro: homotopic_with_trans)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6018
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6019
  show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6020
    unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6021
    apply (rule_tac x = "f2 \<circ> f1" in exI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6022
    apply (rule_tac x = "g1 \<circ> g2" in exI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6023
    apply (intro conjI continuous_on_compose SS UU)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6024
    using f1 f2 g1 g2  apply (force simp: elim!: continuous_on_subset)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6025
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6026
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6027
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6028
lemma homotopy_eqv_inj_linear_image:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6029
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6030
  assumes "linear f" "inj f"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6031
    shows "(f ` S) homotopy_eqv S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6032
apply (rule homeomorphic_imp_homotopy_eqv)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6033
using assms homeomorphic_sym linear_homeomorphic_image by auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6034
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6035
lemma homotopy_eqv_translation:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6036
    fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6037
    shows "op + a ` S homotopy_eqv S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6038
  apply (rule homeomorphic_imp_homotopy_eqv)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6039
  using homeomorphic_translation homeomorphic_sym by blast
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6040
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6041
lemma homotopy_eqv_homotopic_triviality_imp:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6042
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6043
    and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6044
    and U :: "'c::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6045
  assumes "S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6046
      and f: "continuous_on U f" "f ` U \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6047
      and g: "continuous_on U g" "g ` U \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6048
      and homUS: "\<And>f g. \<lbrakk>continuous_on U f; f ` U \<subseteq> S;
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6049
                         continuous_on U g; g ` U \<subseteq> S\<rbrakk>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6050
                         \<Longrightarrow> homotopic_with (\<lambda>x. True) U S f g"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6051
    shows "homotopic_with (\<lambda>x. True) U T f g"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6052
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6053
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6054
               and k: "continuous_on T k" "k ` T \<subseteq> S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6055
               and hom: "homotopic_with (\<lambda>x. True) S S (k o h) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6056
                        "homotopic_with (\<lambda>x. True) T T (h o k) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6057
    using assms by (auto simp: homotopy_eqv_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6058
  have "homotopic_with (\<lambda>f. True) U S (k \<circ> f) (k \<circ> g)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6059
    apply (rule homUS)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6060
    using f g k
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6061
    apply (safe intro!: continuous_on_compose h k f elim!: continuous_on_subset)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6062
    apply (force simp: o_def)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6063
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6064
  then have "homotopic_with (\<lambda>x. True) U T (h o (k o f)) (h o (k o g))"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6065
    apply (rule homotopic_with_compose_continuous_left)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6066
    apply (simp_all add: h)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6067
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6068
  moreover have "homotopic_with (\<lambda>x. True) U T (h o k o f) (id o f)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6069
    apply (rule homotopic_with_compose_continuous_right [where X=T and Y=T])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6070
    apply (auto simp: hom f)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6071
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6072
  moreover have "homotopic_with (\<lambda>x. True) U T (h o k o g) (id o g)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6073
    apply (rule homotopic_with_compose_continuous_right [where X=T and Y=T])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6074
    apply (auto simp: hom g)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6075
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6076
  ultimately show "homotopic_with (\<lambda>x. True) U T f g"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6077
    apply (simp add: o_assoc)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6078
    using homotopic_with_trans homotopic_with_sym by blast
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6079
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6080
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6081
lemma homotopy_eqv_homotopic_triviality:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6082
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6083
    and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6084
    and U :: "'c::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6085
  assumes "S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6086
    shows "(\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> S \<and>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6087
                   continuous_on U g \<and> g ` U \<subseteq> S
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6088
                   \<longrightarrow> homotopic_with (\<lambda>x. True) U S f g) \<longleftrightarrow>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6089
           (\<forall>f g. continuous_on U f \<and> f ` U \<subseteq> T \<and>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6090
                  continuous_on U g \<and> g ` U \<subseteq> T
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6091
                  \<longrightarrow> homotopic_with (\<lambda>x. True) U T f g)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6092
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6093
apply (metis assms homotopy_eqv_homotopic_triviality_imp)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6094
by (metis (no_types) assms homotopy_eqv_homotopic_triviality_imp homotopy_eqv_sym)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6095
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6096
lemma homotopy_eqv_cohomotopic_triviality_null_imp:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6097
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6098
    and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6099
    and U :: "'c::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6100
  assumes "S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6101
      and f: "continuous_on T f" "f ` T \<subseteq> U"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6102
      and homSU: "\<And>f. \<lbrakk>continuous_on S f; f ` S \<subseteq> U\<rbrakk>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6103
                      \<Longrightarrow> \<exists>c. homotopic_with (\<lambda>x. True) S U f (\<lambda>x. c)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6104
  obtains c where "homotopic_with (\<lambda>x. True) T U f (\<lambda>x. c)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6105
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6106
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6107
               and k: "continuous_on T k" "k ` T \<subseteq> S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6108
               and hom: "homotopic_with (\<lambda>x. True) S S (k o h) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6109
                        "homotopic_with (\<lambda>x. True) T T (h o k) id"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6110
    using assms by (auto simp: homotopy_eqv_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6111
  obtain c where "homotopic_with (\<lambda>x. True) S U (f \<circ> h) (\<lambda>x. c)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6112
    apply (rule exE [OF homSU [of "f \<circ> h"]])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6113
    apply (intro continuous_on_compose h)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6114
    using h f  apply (force elim!: continuous_on_subset)+
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6115
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6116
  then have "homotopic_with (\<lambda>x. True) T U ((f o h) o k) ((\<lambda>x. c) o k)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6117
    apply (rule homotopic_with_compose_continuous_right [where X=S])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6118
    using k by auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6119
  moreover have "homotopic_with (\<lambda>x. True) T U (f \<circ> id) (f \<circ> (h \<circ> k))"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6120
    apply (rule homotopic_with_compose_continuous_left [where Y=T])
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6121
      apply (simp add: hom homotopic_with_symD)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6122
     using f apply auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6123
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6124
  ultimately show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6125
    apply (rule_tac c=c in that)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6126
    apply (simp add: o_def)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6127
    using homotopic_with_trans by blast
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6128
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6129
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6130
lemma homotopy_eqv_cohomotopic_triviality_null:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6131
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6132
    and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6133
    and U :: "'c::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6134
  assumes "S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6135
    shows "(\<forall>f. continuous_on S f \<and> f ` S \<subseteq> U
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6136
                \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) S U f (\<lambda>x. c))) \<longleftrightarrow>
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6137
           (\<forall>f. continuous_on T f \<and> f ` T \<subseteq> U
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6138
                \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) T U f (\<lambda>x. c)))"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6139
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6140
apply (metis assms homotopy_eqv_cohomotopic_triviality_null_imp)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6141
by (metis assms homotopy_eqv_cohomotopic_triviality_null_imp homotopy_eqv_sym)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6142
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6143
lemma homotopy_eqv_contractible_sets:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6144
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6145
    and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6146
  assumes "contractible S" "contractible T" "S = {} \<longleftrightarrow> T = {}"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6147
    shows "S homotopy_eqv T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6148
proof (cases "S = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6149
  case True with assms show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6150
    by (simp add: homeomorphic_imp_homotopy_eqv)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6151
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6152
  case False
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6153
  with assms obtain a b where "a \<in> S" "b \<in> T"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6154
    by auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6155
  then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6156
    unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6157
    apply (rule_tac x="\<lambda>x. b" in exI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6158
    apply (rule_tac x="\<lambda>x. a" in exI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6159
    apply (intro assms conjI continuous_on_id' homotopic_into_contractible)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6160
    apply (auto simp: o_def continuous_on_const)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6161
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6162
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6163
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6164
lemma homotopy_eqv_empty1 [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6165
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6166
  shows "S homotopy_eqv ({}::'b::real_normed_vector set) \<longleftrightarrow> S = {}"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6167
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6168
using homotopy_eqv_def apply fastforce
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6169
by (simp add: homotopy_eqv_contractible_sets contractible_empty)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6170
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6171
lemma homotopy_eqv_empty2 [simp]:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6172
  fixes S :: "'a::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6173
  shows "({}::'b::real_normed_vector set) homotopy_eqv S \<longleftrightarrow> S = {}"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6174
by (metis homotopy_eqv_empty1 homotopy_eqv_sym)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6175
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6176
lemma homotopy_eqv_contractibility:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6177
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6178
  shows "S homotopy_eqv T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6179
unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6180
by (blast intro: homotopy_dominated_contractibility)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6181
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6182
lemma homotopy_eqv_sing:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6183
  fixes S :: "'a::real_normed_vector set" and a :: "'b::real_normed_vector"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6184
  shows "S homotopy_eqv {a} \<longleftrightarrow> S \<noteq> {} \<and> contractible S"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6185
proof (cases "S = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6186
  case True then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6187
    by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6188
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6189
  case False then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6190
    by (metis contractible_sing empty_not_insert homotopy_eqv_contractibility homotopy_eqv_contractible_sets)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6191
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6192
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6193
lemma homeomorphic_contractible_eq:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6194
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6195
  shows "S homeomorphic T \<Longrightarrow> (contractible S \<longleftrightarrow> contractible T)"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6196
by (simp add: homeomorphic_imp_homotopy_eqv homotopy_eqv_contractibility)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6197
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6198
lemma homeomorphic_contractible:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6199
  fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set"
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6200
  shows "\<lbrakk>contractible S; S homeomorphic T\<rbrakk> \<Longrightarrow> contractible T"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6201
  by (metis homeomorphic_contractible_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6202
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6203
subsection\<open>Misc other results\<close>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6204
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6205
lemma bounded_connected_Compl_real:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6206
  fixes S :: "real set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6207
  assumes "bounded S" and conn: "connected(- S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6208
    shows "S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6209
proof -
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6210
  obtain a b where "S \<subseteq> box a b"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6211
    by (meson assms bounded_subset_open_interval)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6212
  then have "a \<notin> S" "b \<notin> S"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6213
    by auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6214
  then have "\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> - S"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6215
    by (meson Compl_iff conn connected_iff_interval)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6216
  then show ?thesis
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6217
    using \<open>S \<subseteq> box a b\<close> by auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6218
qed
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6219
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6220
lemma bounded_connected_Compl_1:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6221
  fixes S :: "'a::{euclidean_space} set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6222
  assumes "bounded S" and conn: "connected(- S)" and 1: "DIM('a) = 1"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6223
    shows "S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6224
proof -
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6225
  have "DIM('a) = DIM(real)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6226
    by (simp add: "1")
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6227
  then obtain f::"'a \<Rightarrow> real" and g
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6228
  where "linear f" "\<And>x. norm(f x) = norm x" "\<And>x. g(f x) = x" "\<And>y. f(g y) = y"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6229
    by (rule isomorphisms_UNIV_UNIV) blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6230
  with \<open>bounded S\<close> have "bounded (f ` S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6231
    using bounded_linear_image linear_linear by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6232
  have "connected (f ` (-S))"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6233
    using connected_linear_image assms \<open>linear f\<close> by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6234
  moreover have "f ` (-S) = - (f ` S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6235
    apply (rule bij_image_Compl_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6236
    apply (auto simp: bij_def)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6237
     apply (metis \<open>\<And>x. g (f x) = x\<close> injI)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6238
    by (metis UNIV_I \<open>\<And>y. f (g y) = y\<close> image_iff)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6239
  finally have "connected (- (f ` S))"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6240
    by simp
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6241
  then have "f ` S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6242
    using \<open>bounded (f ` S)\<close> bounded_connected_Compl_real by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6243
  then show ?thesis
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6244
    by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6245
qed
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6246
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6247
subsection\<open>Some Uncountable Sets\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6248
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6249
lemma uncountable_closed_segment:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6250
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6251
  assumes "a \<noteq> b" shows "uncountable (closed_segment a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6252
unfolding path_image_linepath [symmetric] path_image_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6253
  using inj_on_linepath [OF assms] uncountable_closed_interval [of 0 1]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6254
        countable_image_inj_on by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6255
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6256
lemma uncountable_open_segment:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6257
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6258
  assumes "a \<noteq> b" shows "uncountable (open_segment a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6259
  by (simp add: assms open_segment_def uncountable_closed_segment uncountable_minus_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6260
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6261
lemma uncountable_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6262
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6263
  assumes "convex S" "a \<in> S" "b \<in> S" "a \<noteq> b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6264
    shows "uncountable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6265
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6266
  have "uncountable (closed_segment a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6267
    by (simp add: uncountable_closed_segment assms)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6268
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6269
    by (meson assms convex_contains_segment countable_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6270
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6271
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6272
lemma uncountable_ball:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6273
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6274
  assumes "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6275
    shows "uncountable (ball a r)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6276
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6277
  have "uncountable (open_segment a (a + r *\<^sub>R (SOME i. i \<in> Basis)))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6278
    by (metis Basis_zero SOME_Basis add_cancel_right_right assms less_le real_vector.scale_eq_0_iff uncountable_open_segment)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6279
  moreover have "open_segment a (a + r *\<^sub>R (SOME i. i \<in> Basis)) \<subseteq> ball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6280
    using assms by (auto simp: in_segment algebra_simps dist_norm SOME_Basis)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6281
  ultimately show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6282
    by (metis countable_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6283
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6284
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6285
lemma uncountable_cball:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6286
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6287
  assumes "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6288
  shows "uncountable (cball a r)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6289
  using assms countable_subset uncountable_ball by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6290
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6291
lemma pairwise_disjnt_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6292
  fixes \<N> :: "nat set set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6293
  assumes "pairwise disjnt \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6294
    shows "countable \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6295
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6296
  have "inj_on (\<lambda>X. SOME n. n \<in> X) (\<N> - {{}})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6297
    apply (clarsimp simp add: inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6298
    by (metis assms disjnt_insert2 insert_absorb pairwise_def subsetI subset_empty tfl_some)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6299
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6300
    by (metis countable_Diff_eq countable_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6301
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6302
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6303
lemma pairwise_disjnt_countable_Union:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6304
    assumes "countable (\<Union>\<N>)" and pwd: "pairwise disjnt \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6305
    shows "countable \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6306
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6307
  obtain f :: "_ \<Rightarrow> nat" where f: "inj_on f (\<Union>\<N>)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6308
    using assms by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6309
  then have "pairwise disjnt (\<Union> X \<in> \<N>. {f ` X})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6310
    using assms by (force simp: pairwise_def disjnt_inj_on_iff [OF f])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6311
  then have "countable (\<Union> X \<in> \<N>. {f ` X})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6312
    using pairwise_disjnt_countable by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6313
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6314
    by (meson pwd countable_image_inj_on disjoint_image f inj_on_image pairwise_disjnt_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6315
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6316
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6317
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6318
subsection\<open> Some simple positive connection theorems\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6319
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6320
proposition path_connected_convex_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6321
  fixes U :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6322
  assumes "convex U" "~ collinear U" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6323
    shows "path_connected(U - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6324
proof (clarsimp simp add: path_connected_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6325
  fix a b
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6326
  assume "a \<in> U" "a \<notin> S" "b \<in> U" "b \<notin> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6327
  let ?m = "midpoint a b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6328
  show "\<exists>g. path g \<and> path_image g \<subseteq> U - S \<and> pathstart g = a \<and> pathfinish g = b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6329
  proof (cases "a = b")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6330
    case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6331
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6332
      by (metis DiffI \<open>a \<in> U\<close> \<open>a \<notin> S\<close> path_component_def path_component_refl)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6333
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6334
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6335
    then have "a \<noteq> ?m" "b \<noteq> ?m"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6336
      using midpoint_eq_endpoint by fastforce+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6337
    have "?m \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6338
      using \<open>a \<in> U\<close> \<open>b \<in> U\<close> \<open>convex U\<close> convex_contains_segment by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6339
    obtain c where "c \<in> U" and nc_abc: "\<not> collinear {a,b,c}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6340
      by (metis False \<open>a \<in> U\<close> \<open>b \<in> U\<close> \<open>~ collinear U\<close> collinear_triples insert_absorb)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6341
    have ncoll_mca: "\<not> collinear {?m,c,a}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6342
      by (metis (full_types) \<open>a \<noteq> ?m\<close> collinear_3_trans collinear_midpoint insert_commute nc_abc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6343
    have ncoll_mcb: "\<not> collinear {?m,c,b}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6344
      by (metis (full_types) \<open>b \<noteq> ?m\<close> collinear_3_trans collinear_midpoint insert_commute nc_abc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6345
    have "c \<noteq> ?m"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6346
      by (metis collinear_midpoint insert_commute nc_abc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6347
    then have "closed_segment ?m c \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6348
      by (simp add: \<open>c \<in> U\<close> \<open>?m \<in> U\<close> \<open>convex U\<close> closed_segment_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6349
    then obtain z where z: "z \<in> closed_segment ?m c"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6350
                    and disjS: "(closed_segment a z \<union> closed_segment z b) \<inter> S = {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6351
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6352
      have False if "closed_segment ?m c \<subseteq> {z. (closed_segment a z \<union> closed_segment z b) \<inter> S \<noteq> {}}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6353
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6354
        have closb: "closed_segment ?m c \<subseteq>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6355
                 {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> {}}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6356
          using that by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6357
        have *: "countable {z \<in> closed_segment ?m c. closed_segment z u \<inter> S \<noteq> {}}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6358
          if "u \<in> U" "u \<notin> S" and ncoll: "\<not> collinear {?m, c, u}" for u
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6359
        proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6360
          have **: False if x1: "x1 \<in> closed_segment ?m c" and x2: "x2 \<in> closed_segment ?m c"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6361
                            and "x1 \<noteq> x2" "x1 \<noteq> u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6362
                            and w: "w \<in> closed_segment x1 u" "w \<in> closed_segment x2 u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6363
                            and "w \<in> S" for x1 x2 w
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6364
          proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6365
            have "x1 \<in> affine hull {?m,c}" "x2 \<in> affine hull {?m,c}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6366
              using segment_as_ball x1 x2 by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6367
            then have coll_x1: "collinear {x1, ?m, c}" and coll_x2: "collinear {?m, c, x2}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6368
              by (simp_all add: affine_hull_3_imp_collinear) (metis affine_hull_3_imp_collinear insert_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6369
            have "\<not> collinear {x1, u, x2}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6370
            proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6371
              assume "collinear {x1, u, x2}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6372
              then have "collinear {?m, c, u}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6373
                by (metis (full_types) \<open>c \<noteq> ?m\<close> coll_x1 coll_x2 collinear_3_trans insert_commute ncoll \<open>x1 \<noteq> x2\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6374
              with ncoll show False ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6375
            qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6376
            then have "closed_segment x1 u \<inter> closed_segment u x2 = {u}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6377
              by (blast intro!: Int_closed_segment)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6378
            then have "w = u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6379
              using closed_segment_commute w by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6380
            show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6381
              using \<open>u \<notin> S\<close> \<open>w = u\<close> that(7) by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6382
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6383
          then have disj: "disjoint ((\<Union>z\<in>closed_segment ?m c. {closed_segment z u \<inter> S}))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6384
            by (fastforce simp: pairwise_def disjnt_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6385
          have cou: "countable ((\<Union>z \<in> closed_segment ?m c. {closed_segment z u \<inter> S}) - {{}})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6386
            apply (rule pairwise_disjnt_countable_Union [OF _ pairwise_subset [OF disj]])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6387
             apply (rule countable_subset [OF _ \<open>countable S\<close>], auto)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6388
            done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6389
          define f where "f \<equiv> \<lambda>X. (THE z. z \<in> closed_segment ?m c \<and> X = closed_segment z u \<inter> S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6390
          show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6391
          proof (rule countable_subset [OF _ countable_image [OF cou, where f=f]], clarify)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6392
            fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6393
            assume x: "x \<in> closed_segment ?m c" "closed_segment x u \<inter> S \<noteq> {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6394
            show "x \<in> f ` ((\<Union>z\<in>closed_segment ?m c. {closed_segment z u \<inter> S}) - {{}})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6395
            proof (rule_tac x="closed_segment x u \<inter> S" in image_eqI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6396
              show "x = f (closed_segment x u \<inter> S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6397
                unfolding f_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6398
                apply (rule the_equality [symmetric])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6399
                using x  apply (auto simp: dest: **)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6400
                done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6401
            qed (use x in auto)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6402
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6403
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6404
        have "uncountable (closed_segment ?m c)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6405
          by (metis \<open>c \<noteq> ?m\<close> uncountable_closed_segment)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6406
        then show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6407
          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]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6408
          apply (simp add: closed_segment_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6409
          by (simp add: countable_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6410
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6411
      then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6412
        by (force intro: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6413
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6414
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6415
    proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6416
      have "path_image (linepath a z +++ linepath z b) \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6417
        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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6418
      with disjS show "path_image (linepath a z +++ linepath z b) \<subseteq> U - S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6419
        by (force simp: path_image_join)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6420
    qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6421
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6422
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6423
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6424
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6425
corollary connected_convex_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6426
  fixes U :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6427
  assumes "convex U" "~ collinear U" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6428
  shows "connected(U - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6429
  by (simp add: assms path_connected_convex_diff_countable path_connected_imp_connected)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6430
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6431
lemma path_connected_punctured_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6432
  assumes "convex S" and aff: "aff_dim S \<noteq> 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6433
    shows "path_connected(S - {a})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6434
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6435
  consider "aff_dim S = -1" | "aff_dim S = 0" | "aff_dim S \<ge> 2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6436
    using assms aff_dim_geq [of S] by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6437
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6438
  proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6439
    assume "aff_dim S = -1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6440
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6441
      by (metis aff_dim_empty empty_Diff path_connected_empty)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6442
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6443
    assume "aff_dim S = 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6444
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6445
      by (metis aff_dim_eq_0 Diff_cancel Diff_empty Diff_insert0 convex_empty convex_imp_path_connected path_connected_singleton singletonD)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6446
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6447
    assume ge2: "aff_dim S \<ge> 2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6448
    then have "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6449
    proof (clarsimp simp add: collinear_affine_hull)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6450
      fix u v
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6451
      assume "S \<subseteq> affine hull {u, v}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6452
      then have "aff_dim S \<le> aff_dim {u, v}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6453
        by (metis (no_types) aff_dim_affine_hull aff_dim_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6454
      with ge2 show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6455
        by (metis (no_types) aff_dim_2 antisym aff not_numeral_le_zero one_le_numeral order_trans)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6456
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6457
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6458
      apply (rule path_connected_convex_diff_countable [OF \<open>convex S\<close>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6459
      by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6460
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6461
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6462
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6463
lemma connected_punctured_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6464
  shows "\<lbrakk>convex S; aff_dim S \<noteq> 1\<rbrakk> \<Longrightarrow> connected(S - {a})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6465
  using path_connected_imp_connected path_connected_punctured_convex by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6466
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6467
lemma path_connected_complement_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6468
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6469
  assumes "2 \<le> DIM('a)" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6470
  shows "path_connected(- S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6471
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6472
  have "path_connected(UNIV - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6473
    apply (rule path_connected_convex_diff_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6474
    using assms by (auto simp: collinear_aff_dim [of "UNIV :: 'a set"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6475
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6476
    by (simp add: Compl_eq_Diff_UNIV)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6477
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6478
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6479
proposition path_connected_openin_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6480
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6481
  assumes "connected S" and ope: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6482
      and "~ collinear S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6483
    shows "path_connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6484
proof (clarsimp simp add: path_connected_component)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6485
  fix x y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6486
  assume xy: "x \<in> S" "x \<notin> T" "y \<in> S" "y \<notin> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6487
  show "path_component (S - T) x y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6488
  proof (rule connected_equivalence_relation_gen [OF \<open>connected S\<close>, where P = "\<lambda>x. x \<notin> T"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6489
    show "\<exists>z. z \<in> U \<and> z \<notin> T" if opeU: "openin (subtopology euclidean S) U" and "x \<in> U" for U x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6490
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6491
      have "openin (subtopology euclidean (affine hull S)) U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6492
        using opeU ope openin_trans by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6493
      with \<open>x \<in> U\<close> obtain r where Usub: "U \<subseteq> affine hull S" and "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6494
                              and subU: "ball x r \<inter> affine hull S \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6495
        by (auto simp: openin_contains_ball)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6496
      with \<open>x \<in> U\<close> have x: "x \<in> ball x r \<inter> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6497
        by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6498
      have "~ S \<subseteq> {x}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6499
        using \<open>~ collinear S\<close>  collinear_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6500
      then obtain x' where "x' \<noteq> x" "x' \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6501
        by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6502
      obtain y where y: "y \<noteq> x" "y \<in> ball x r \<inter> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6503
      proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6504
        show "x + (r / 2 / norm(x' - x)) *\<^sub>R (x' - x) \<noteq> x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6505
          using \<open>x' \<noteq> x\<close> \<open>r > 0\<close> by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6506
        show "x + (r / 2 / norm (x' - x)) *\<^sub>R (x' - x) \<in> ball x r \<inter> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6507
          using \<open>x' \<noteq> x\<close> \<open>r > 0\<close> \<open>x' \<in> S\<close> x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6508
          by (simp add: dist_norm mem_affine_3_minus hull_inc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6509
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6510
      have "convex (ball x r \<inter> affine hull S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6511
        by (simp add: affine_imp_convex convex_Int)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6512
      with x y subU have "uncountable U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6513
        by (meson countable_subset uncountable_convex)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6514
      then have "\<not> U \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6515
        using \<open>countable T\<close> countable_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6516
      then show ?thesis by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6517
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6518
    show "\<exists>U. openin (subtopology euclidean S) U \<and> x \<in> U \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6519
              (\<forall>x\<in>U. \<forall>y\<in>U. x \<notin> T \<and> y \<notin> T \<longrightarrow> path_component (S - T) x y)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6520
          if "x \<in> S" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6521
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6522
      obtain r where Ssub: "S \<subseteq> affine hull S" and "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6523
                 and subS: "ball x r \<inter> affine hull S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6524
        using ope \<open>x \<in> S\<close> by (auto simp: openin_contains_ball)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6525
      then have conv: "convex (ball x r \<inter> affine hull S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6526
        by (simp add: affine_imp_convex convex_Int)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6527
      have "\<not> aff_dim (affine hull S) \<le> 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6528
        using \<open>\<not> collinear S\<close> collinear_aff_dim by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6529
      then have "\<not> collinear (ball x r \<inter> affine hull S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6530
        apply (simp add: collinear_aff_dim)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6531
        by (metis (no_types, hide_lams) aff_dim_convex_Int_open IntI Topology_Euclidean_Space.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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6532
      then have *: "path_connected ((ball x r \<inter> affine hull S) - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6533
        by (rule path_connected_convex_diff_countable [OF conv _ \<open>countable T\<close>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6534
      have ST: "ball x r \<inter> affine hull S - T \<subseteq> S - T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6535
        using subS by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6536
      show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6537
      proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6538
        show "x \<in> ball x r \<inter> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6539
          using \<open>x \<in> S\<close> \<open>r > 0\<close> by (simp add: hull_inc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6540
        have "openin (subtopology euclidean (affine hull S)) (ball x r \<inter> affine hull S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6541
          by (simp add: inf.commute openin_Int_open)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6542
        then show "openin (subtopology euclidean S) (ball x r \<inter> affine hull S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6543
          by (rule openin_subset_trans [OF _ subS Ssub])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6544
      qed (use * path_component_trans in \<open>auto simp: path_connected_component path_component_of_subset [OF ST]\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6545
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6546
  qed (use xy path_component_trans in auto)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6547
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6548
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6549
corollary connected_openin_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6550
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6551
  assumes "connected S" and ope: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6552
      and "~ collinear S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6553
    shows "connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6554
  by (metis path_connected_imp_connected path_connected_openin_diff_countable [OF assms])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6555
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6556
corollary path_connected_open_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6557
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6558
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6559
  shows "path_connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6560
proof (cases "S = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6561
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6562
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6563
    by (simp add: path_connected_empty)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6564
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6565
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6566
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6567
  proof (rule path_connected_openin_diff_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6568
    show "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6569
      by (simp add: assms hull_subset open_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6570
    show "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6571
      using assms False by (simp add: collinear_aff_dim aff_dim_open)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6572
  qed (simp_all add: assms)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6573
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6574
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6575
corollary connected_open_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6576
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6577
  assumes "2 \<le> DIM('a)" "open S" "connected S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6578
  shows "connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6579
by (simp add: assms path_connected_imp_connected path_connected_open_diff_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6580
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6581
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6582
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6583
subsection\<open> Self-homeomorphisms shuffling points about in various ways.\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6584
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6585
subsubsection\<open>The theorem @{text homeomorphism_moving_points_exists}}\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6586
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6587
lemma homeomorphism_moving_point_1:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6588
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6589
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6590
  obtains f g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6591
                    "f a = u" "\<And>x. x \<in> sphere a r \<Longrightarrow> f x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6592
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6593
  have nou: "norm (u - a) < r" and "u \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6594
    using u by (auto simp: dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6595
  then have "0 < r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6596
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6597
  define f where "f \<equiv> \<lambda>x. (1 - norm(x - a) / r) *\<^sub>R (u - a) + x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6598
  have *: "False" if eq: "x + (norm y / r) *\<^sub>R u = y + (norm x / r) *\<^sub>R u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6599
                  and nou: "norm u < r" and yx: "norm y < norm x" for x y and u::'a
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6600
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6601
    have "x = y + (norm x / r - (norm y / r)) *\<^sub>R u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6602
      using eq by (simp add: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6603
    then have "norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6604
      by (metis diff_divide_distrib)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6605
    also have "... \<le> norm y + norm(((norm x - norm y) / r) *\<^sub>R u)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6606
      using norm_triangle_ineq by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6607
    also have "... = norm y + (norm x - norm y) * (norm u / r)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6608
      using yx \<open>r > 0\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6609
      by (simp add: divide_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6610
    also have "... < norm y + (norm x - norm y) * 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6611
      apply (subst add_less_cancel_left)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6612
      apply (rule mult_strict_left_mono)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6613
      using nou \<open>0 < r\<close> yx
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6614
       apply (simp_all add: field_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6615
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6616
    also have "... = norm x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6617
      by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6618
    finally show False by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6619
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6620
  have "inj f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6621
    unfolding f_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6622
  proof (clarsimp simp: inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6623
    fix x y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6624
    assume "(1 - norm (x - a) / r) *\<^sub>R (u - a) + x =
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6625
            (1 - norm (y - a) / r) *\<^sub>R (u - a) + y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6626
    then have eq: "(x - a) + (norm (y - a) / r) *\<^sub>R (u - a) = (y - a) + (norm (x - a) / r) *\<^sub>R (u - a)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6627
      by (auto simp: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6628
    show "x=y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6629
    proof (cases "norm (x - a) = norm (y - a)")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6630
      case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6631
      then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6632
        using eq by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6633
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6634
      case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6635
      then consider "norm (x - a) < norm (y - a)" | "norm (x - a) > norm (y - a)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6636
        by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6637
      then have "False"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6638
      proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6639
        case 1 show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6640
          using * [OF _ nou 1] eq by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6641
      next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6642
        case 2 with * [OF eq nou] show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6643
          by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6644
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6645
      then show "x=y" ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6646
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6647
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6648
  then have inj_onf: "inj_on f (cball a r \<inter> T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6649
    using inj_on_Int by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6650
  have contf: "continuous_on (cball a r \<inter> T) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6651
    unfolding f_def using \<open>0 < r\<close>  by (intro continuous_intros) blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6652
  have fim: "f ` (cball a r \<inter> T) = cball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6653
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6654
    have *: "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r" if "norm y \<le> r" "norm u < r" for y u::'a
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6655
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6656
      have "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm((1 - norm y / r) *\<^sub>R u)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6657
        using norm_triangle_ineq by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6658
      also have "... = norm y + abs(1 - norm y / r) * norm u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6659
        by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6660
      also have "... \<le> r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6661
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6662
        have "(r - norm u) * (r - norm y) \<ge> 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6663
          using that by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6664
        then have "r * norm u + r * norm y \<le> r * r + norm u * norm y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6665
          by (simp add: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6666
        then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6667
        using that \<open>0 < r\<close> by (simp add: abs_if field_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6668
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6669
      finally show ?thesis .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6670
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6671
    have "f ` (cball a r) \<subseteq> cball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6672
      apply (clarsimp simp add: dist_norm norm_minus_commute f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6673
      using * by (metis diff_add_eq diff_diff_add diff_diff_eq2 norm_minus_commute nou)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6674
    moreover have "f ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6675
      unfolding f_def using \<open>affine T\<close> \<open>a \<in> T\<close> \<open>u \<in> T\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6676
      by (force simp: add.commute mem_affine_3_minus)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6677
    ultimately show "f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6678
      by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6679
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6680
    show "cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6681
    proof (clarsimp simp add: dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6682
      fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6683
      assume x: "norm (x - a) \<le> r" and "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6684
      have "\<exists>v \<in> {0..1}. ((1 - v) * r - norm ((x - a) - v *\<^sub>R (u - a))) \<bullet> 1 = 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6685
        by (rule ivt_decreasing_component_on_1) (auto simp: x continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6686
      then obtain v where "0\<le>v" "v\<le>1" and v: "(1 - v) * r = norm ((x - a) - v *\<^sub>R (u - a))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6687
        by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6688
      show "x \<in> f ` (cball a r \<inter> T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6689
      proof (rule image_eqI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6690
        show "x = f (x - v *\<^sub>R (u - a))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6691
          using \<open>r > 0\<close> v by (simp add: f_def field_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6692
        have "x - v *\<^sub>R (u - a) \<in> cball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6693
          using \<open>r > 0\<close> v \<open>0 \<le> v\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6694
          apply (simp add: field_simps dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6695
          by (metis le_add_same_cancel2 order.order_iff_strict zero_le_mult_iff)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6696
        moreover have "x - v *\<^sub>R (u - a) \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6697
          by (simp add: f_def \<open>affine T\<close> \<open>u \<in> T\<close> \<open>x \<in> T\<close> assms mem_affine_3_minus2)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6698
        ultimately show "x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6699
          by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6700
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6701
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6702
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6703
  have "\<exists>g. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6704
    apply (rule homeomorphism_compact [OF _ contf fim inj_onf])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6705
    apply (simp add: affine_closed compact_Int_closed \<open>affine T\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6706
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6707
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6708
    apply (rule exE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6709
    apply (erule_tac f=f in that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6710
    using \<open>r > 0\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6711
     apply (simp_all add: f_def dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6712
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6713
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6714
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6715
corollary homeomorphism_moving_point_2:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6716
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6717
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T" and v: "v \<in> ball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6718
  obtains f g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6719
                    "f u = v" "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> f x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6720
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6721
  have "0 < r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6722
    by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6723
  obtain f1 g1 where hom1: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f1 g1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6724
                 and "f1 a = u" and f1: "\<And>x. x \<in> sphere a r \<Longrightarrow> f1 x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6725
    using homeomorphism_moving_point_1 [OF \<open>affine T\<close> \<open>a \<in> T\<close> u] by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6726
  obtain f2 g2 where hom2: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f2 g2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6727
                 and "f2 a = v" and f2: "\<And>x. x \<in> sphere a r \<Longrightarrow> f2 x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6728
    using homeomorphism_moving_point_1 [OF \<open>affine T\<close> \<open>a \<in> T\<close> v] by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6729
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6730
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6731
    show "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) (f2 \<circ> g1) (f1 \<circ> g2)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6732
      by (metis homeomorphism_compose homeomorphism_symD hom1 hom2)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6733
    have "g1 u = a"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6734
      using \<open>0 < r\<close> \<open>f1 a = u\<close> assms hom1 homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6735
    then show "(f2 \<circ> g1) u = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6736
      by (simp add: \<open>f2 a = v\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6737
    show "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> (f2 \<circ> g1) x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6738
      using f1 f2 hom1 homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6739
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6740
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6741
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6742
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6743
corollary homeomorphism_moving_point_3:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6744
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6745
  assumes "affine T" "a \<in> T" and ST: "ball a r \<inter> T \<subseteq> S" "S \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6746
      and u: "u \<in> ball a r \<inter> T" and v: "v \<in> ball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6747
  obtains f g where "homeomorphism S S f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6748
                    "f u = v" "{x. ~ (f x = x \<and> g x = x)} \<subseteq> ball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6749
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6750
  obtain f g where hom: "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6751
               and "f u = v" and fid: "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> f x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6752
    using homeomorphism_moving_point_2 [OF \<open>affine T\<close> \<open>a \<in> T\<close> u v] by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6753
  have gid: "\<And>x. \<lbrakk>x \<in> sphere a r; x \<in> T\<rbrakk> \<Longrightarrow> g x = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6754
    using fid hom homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6755
  define ff where "ff \<equiv> \<lambda>x. if x \<in> ball a r \<inter> T then f x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6756
  define gg where "gg \<equiv> \<lambda>x. if x \<in> ball a r \<inter> T then g x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6757
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6758
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6759
    show "homeomorphism S S ff gg"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6760
    proof (rule homeomorphismI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6761
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) ff"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6762
        apply (simp add: ff_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6763
        apply (rule continuous_on_cases)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6764
        using homeomorphism_cont1 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6765
            apply (auto simp: affine_closed \<open>affine T\<close> continuous_on_id fid)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6766
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6767
      then show "continuous_on S ff"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6768
        apply (rule continuous_on_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6769
        using ST by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6770
      have "continuous_on ((cball a r \<inter> T) \<union> (T - ball a r)) gg"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6771
        apply (simp add: gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6772
        apply (rule continuous_on_cases)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6773
        using homeomorphism_cont2 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6774
            apply (auto simp: affine_closed \<open>affine T\<close> continuous_on_id gid)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6775
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6776
      then show "continuous_on S gg"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6777
        apply (rule continuous_on_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6778
        using ST by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6779
      show "ff ` S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6780
      proof (clarsimp simp add: ff_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6781
        fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6782
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6783
        then have "f x \<in> cball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6784
          using homeomorphism_image1 [OF hom] by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6785
        then show "f x \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6786
          using ST(1) \<open>x \<in> T\<close> gid hom homeomorphism_def x by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6787
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6788
      show "gg ` S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6789
      proof (clarsimp simp add: gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6790
        fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6791
        assume "x \<in> S" and x: "dist a x < r" and "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6792
        then have "g x \<in> cball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6793
          using homeomorphism_image2 [OF hom] by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6794
        then have "g x \<in> ball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6795
          using homeomorphism_apply2 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6796
            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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6797
        then show "g x \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6798
          using ST(1) \<open>g x \<in> cball a r \<inter> T\<close> by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6799
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6800
      show "\<And>x. x \<in> S \<Longrightarrow> gg (ff x) = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6801
        apply (simp add: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6802
        using homeomorphism_apply1 [OF hom] homeomorphism_image1 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6803
        apply auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6804
        apply (metis Int_iff homeomorphism_apply1 [OF hom] fid image_eqI less_eq_real_def mem_cball mem_sphere)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6805
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6806
      show "\<And>x. x \<in> S \<Longrightarrow> ff (gg x) = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6807
        apply (simp add: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6808
        using homeomorphism_apply2 [OF hom] homeomorphism_image2 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6809
        apply auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6810
        apply (metis Int_iff fid image_eqI less_eq_real_def mem_cball mem_sphere)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6811
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6812
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6813
    show "ff u = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6814
      using u by (auto simp: ff_def \<open>f u = v\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6815
    show "{x. \<not> (ff x = x \<and> gg x = x)} \<subseteq> ball a r \<inter> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6816
      by (auto simp: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6817
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6818
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6819
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6820
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6821
proposition homeomorphism_moving_point:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6822
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6823
  assumes ope: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6824
      and "S \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6825
      and TS: "T \<subseteq> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6826
      and S: "connected S" "a \<in> S" "b \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6827
  obtains f g where "homeomorphism T T f g" "f a = b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6828
                    "{x. ~ (f x = x \<and> g x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6829
                    "bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6830
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6831
  have 1: "\<exists>h k. homeomorphism T T h k \<and> h (f d) = d \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6832
              {x. ~ (h x = x \<and> k x = x)} \<subseteq> S \<and> bounded {x. ~ (h x = x \<and> k x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6833
        if "d \<in> S" "f d \<in> S" and homfg: "homeomorphism T T f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6834
        and S: "{x. ~ (f x = x \<and> g x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6835
        and bo: "bounded {x. ~ (f x = x \<and> g x = x)}" for d f g
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6836
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6837
    show homgf: "homeomorphism T T g f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6838
      by (metis homeomorphism_symD homfg)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6839
    then show "g (f d) = d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6840
      by (meson \<open>S \<subseteq> T\<close> homeomorphism_def subsetD \<open>d \<in> S\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6841
    show "{x. \<not> (g x = x \<and> f x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6842
      using S by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6843
    show "bounded {x. \<not> (g x = x \<and> f x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6844
      using bo by (simp add: conj_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6845
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6846
  have 2: "\<exists>f g. homeomorphism T T f g \<and> f x = f2 (f1 x) \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6847
                 {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. \<not> (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6848
             if "x \<in> S" "f1 x \<in> S" "f2 (f1 x) \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6849
                and hom: "homeomorphism T T f1 g1" "homeomorphism T T f2 g2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6850
                and sub: "{x. \<not> (f1 x = x \<and> g1 x = x)} \<subseteq> S"   "{x. \<not> (f2 x = x \<and> g2 x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6851
                and bo: "bounded {x. \<not> (f1 x = x \<and> g1 x = x)}"  "bounded {x. \<not> (f2 x = x \<and> g2 x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6852
             for x f1 f2 g1 g2
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6853
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6854
    show homgf: "homeomorphism T T (f2 \<circ> f1) (g1 \<circ> g2)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6855
      by (metis homeomorphism_compose hom)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6856
    then show "(f2 \<circ> f1) x = f2 (f1 x)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6857
      by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6858
    show "{x. \<not> ((f2 \<circ> f1) x = x \<and> (g1 \<circ> g2) x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6859
      using sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6860
    have "bounded ({x. ~(f1 x = x \<and> g1 x = x)} \<union> {x. ~(f2 x = x \<and> g2 x = x)})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6861
      using bo by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6862
    then show "bounded {x. \<not> ((f2 \<circ> f1) x = x \<and> (g1 \<circ> g2) x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6863
      by (rule bounded_subset) auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6864
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6865
  have 3: "\<exists>U. openin (subtopology euclidean S) U \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6866
              d \<in> U \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6867
              (\<forall>x\<in>U.
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6868
                  \<exists>f g. homeomorphism T T f g \<and> f d = x \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6869
                        {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6870
                        bounded {x. \<not> (f x = x \<and> g x = x)})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6871
           if "d \<in> S" for d
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6872
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6873
    obtain r where "r > 0" and r: "ball d r \<inter> affine hull S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6874
      by (metis \<open>d \<in> S\<close> ope openin_contains_ball)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6875
    have *: "\<exists>f g. homeomorphism T T f g \<and> f d = e \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6876
                   {x. \<not> (f x = x \<and> g x = x)} \<subseteq> S \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6877
                   bounded {x. \<not> (f x = x \<and> g x = x)}" if "e \<in> S" "e \<in> ball d r" for e
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6878
      apply (rule homeomorphism_moving_point_3 [of "affine hull S" d r T d e])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6879
      using r \<open>S \<subseteq> T\<close> TS that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6880
            apply (auto simp: \<open>d \<in> S\<close> \<open>0 < r\<close> hull_inc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6881
      using bounded_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6882
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6883
      apply (rule_tac x="S \<inter> ball d r" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6884
      apply (intro conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6885
        apply (simp add: openin_open_Int)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6886
       apply (simp add: \<open>0 < r\<close> that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6887
      apply (blast intro: *)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6888
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6889
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6890
  have "\<exists>f g. homeomorphism T T f g \<and> f a = b \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6891
              {x. ~ (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6892
    apply (rule connected_equivalence_relation [OF S], safe)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6893
      apply (blast intro: 1 2 3)+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6894
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6895
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6896
    using that by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6897
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6898
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6899
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6900
lemma homeomorphism_moving_points_exists_gen:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6901
  assumes K: "finite K" "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6902
             "pairwise (\<lambda>i j. (x i \<noteq> x j) \<and> (y i \<noteq> y j)) K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6903
      and "2 \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6904
      and ope: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6905
      and "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6906
  shows "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(x i) = y i) \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6907
               {x. ~ (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6908
  using assms
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6909
proof (induction K)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6910
  case empty
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6911
  then show ?case
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6912
    by (force simp: homeomorphism_ident)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6913
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6914
  case (insert i K)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6915
  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"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6916
       and pw: "pairwise (\<lambda>i j. x i \<noteq> x j \<and> y i \<noteq> y j) K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6917
       and "x i \<in> S" "y i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6918
       and xyS: "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6919
    by (simp_all add: pairwise_insert)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6920
  obtain f g where homfg: "homeomorphism T T f g" and feq: "\<And>i. i \<in> K \<Longrightarrow> f(x i) = y i"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6921
               and fg_sub: "{x. ~ (f x = x \<and> g x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6922
               and bo_fg: "bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6923
    using insert.IH [OF xyS pw] insert.prems by (blast intro: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6924
  then have "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(x i) = y i) \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6925
                   {x. ~ (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6926
    using insert by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6927
  have aff_eq: "affine hull (S - y ` K) = affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6928
    apply (rule affine_hull_Diff)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6929
    apply (auto simp: insert)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6930
    using \<open>y i \<in> S\<close> insert.hyps(2) xney xyS by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6931
  have f_in_S: "f x \<in> S" if "x \<in> S" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6932
    using homfg fg_sub homeomorphism_apply1 \<open>S \<subseteq> T\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6933
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6934
    have "(f (f x) \<noteq> f x \<or> g (f x) \<noteq> f x) \<or> f x \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6935
      by (metis \<open>S \<subseteq> T\<close> homfg subsetD homeomorphism_apply1 that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6936
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6937
      using fg_sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6938
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6939
  obtain h k where homhk: "homeomorphism T T h k" and heq: "h (f (x i)) = y i"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6940
               and hk_sub: "{x. \<not> (h x = x \<and> k x = x)} \<subseteq> S - y ` K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6941
               and bo_hk:  "bounded {x. \<not> (h x = x \<and> k x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6942
  proof (rule homeomorphism_moving_point [of "S - y`K" T "f(x i)" "y i"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6943
    show "openin (subtopology euclidean (affine hull (S - y ` K))) (S - y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6944
      by (simp add: aff_eq openin_diff finite_imp_closedin image_subset_iff hull_inc insert xyS)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6945
    show "S - y ` K \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6946
      using \<open>S \<subseteq> T\<close> by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6947
    show "T \<subseteq> affine hull (S - y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6948
      using insert by (simp add: aff_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6949
    show "connected (S - y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6950
    proof (rule connected_openin_diff_countable [OF \<open>connected S\<close> ope])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6951
      show "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6952
        using collinear_aff_dim \<open>2 \<le> aff_dim S\<close> by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6953
      show "countable (y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6954
        using countable_finite insert.hyps(1) by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6955
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6956
    show "f (x i) \<in> S - y ` K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6957
      apply (auto simp: f_in_S \<open>x i \<in> S\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6958
        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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6959
    show "y i \<in> S - y ` K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6960
      using insert.hyps xney by (auto simp: \<open>y i \<in> S\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6961
  qed blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6962
  show ?case
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6963
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6964
    show "homeomorphism T T (h \<circ> f) (g \<circ> k)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6965
      using homfg homhk homeomorphism_compose by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6966
    show "\<forall>i \<in> insert i K. (h \<circ> f) (x i) = y i"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6967
      using feq hk_sub by (auto simp: heq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6968
    show "{x. \<not> ((h \<circ> f) x = x \<and> (g \<circ> k) x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6969
      using fg_sub hk_sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6970
    have "bounded ({x. ~(f x = x \<and> g x = x)} \<union> {x. ~(h x = x \<and> k x = x)})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6971
      using bo_fg bo_hk bounded_Un by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6972
    then show "bounded {x. \<not> ((h \<circ> f) x = x \<and> (g \<circ> k) x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6973
      by (rule bounded_subset) auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6974
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6975
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6976
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6977
proposition homeomorphism_moving_points_exists:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6978
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6979
  assumes 2: "2 \<le> DIM('a)" "open S" "connected S" "S \<subseteq> T" "finite K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6980
      and KS: "\<And>i. i \<in> K \<Longrightarrow> x i \<in> S \<and> y i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6981
      and pw: "pairwise (\<lambda>i j. (x i \<noteq> x j) \<and> (y i \<noteq> y j)) K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6982
      and S: "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6983
  obtains f g where "homeomorphism T T f g" "\<And>i. i \<in> K \<Longrightarrow> f(x i) = y i"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6984
                    "{x. ~ (f x = x \<and> g x = x)} \<subseteq> S" "bounded {x. (~ (f x = x \<and> g x = x))}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6985
proof (cases "S = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6986
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6987
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6988
    using KS homeomorphism_ident that by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6989
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6990
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6991
  then have affS: "affine hull S = UNIV"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6992
    by (simp add: affine_hull_open \<open>open S\<close>)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6993
  then have ope: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6994
    using \<open>open S\<close> open_openin by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6995
  have "2 \<le> DIM('a)" by (rule 2)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6996
  also have "... = aff_dim (UNIV :: 'a set)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6997
    by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6998
  also have "... \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6999
    by (metis aff_dim_UNIV aff_dim_affine_hull aff_dim_le_DIM affS)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7000
  finally have "2 \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7001
    by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7002
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7003
    using homeomorphism_moving_points_exists_gen [OF \<open>finite K\<close> KS pw _ ope S] that by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7004
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7005
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7006
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7007
subsubsection\<open>The theorem @{text homeomorphism_grouping_points_exists}}\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7008
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7009
lemma homeomorphism_grouping_point_1:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7010
  fixes a::real and c::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7011
  assumes "a < b" "c < d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7012
  obtains f g where "homeomorphism (cbox a b) (cbox c d) f g" "f a = c" "f b = d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7013
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7014
  define f where "f \<equiv> \<lambda>x. ((d - c) / (b - a)) * x + (c - a * ((d - c) / (b - a)))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7015
  have "\<exists>g. homeomorphism (cbox a b) (cbox c d) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7016
  proof (rule homeomorphism_compact)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7017
    show "continuous_on (cbox a b) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7018
      apply (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7019
      apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7020
      using assms by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7021
    have "f ` {a..b} = {c..d}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7022
      unfolding f_def image_affinity_atLeastAtMost
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7023
      using assms sum_sqs_eq by (auto simp: divide_simps algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7024
    then show "f ` cbox a b = cbox c d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7025
      by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7026
    show "inj_on f (cbox a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7027
      unfolding f_def inj_on_def using assms by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7028
  qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7029
  then obtain g where "homeomorphism (cbox a b) (cbox c d) f g" ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7030
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7031
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7032
    show "f a = c"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7033
      by (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7034
    show "f b = d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7035
      using assms sum_sqs_eq [of a b] by (auto simp: f_def divide_simps algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7036
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7037
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7038
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7039
lemma homeomorphism_grouping_point_2:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7040
  fixes a::real and w::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7041
  assumes hom_ab: "homeomorphism (cbox a b) (cbox u v) f1 g1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7042
      and hom_bc: "homeomorphism (cbox b c) (cbox v w) f2 g2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7043
      and "b \<in> cbox a c" "v \<in> cbox u w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7044
      and eq: "f1 a = u" "f1 b = v" "f2 b = v" "f2 c = w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7045
 obtains f g where "homeomorphism (cbox a c) (cbox u w) f g" "f a = u" "f c = w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7046
                   "\<And>x. x \<in> cbox a b \<Longrightarrow> f x = f1 x" "\<And>x. x \<in> cbox b c \<Longrightarrow> f x = f2 x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7047
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7048
  have le: "a \<le> b" "b \<le> c" "u \<le> v" "v \<le> w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7049
    using assms by simp_all
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7050
  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"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7051
    by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7052
  define f where "f \<equiv> \<lambda>x. if x \<le> b then f1 x else f2 x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7053
  have "\<exists>g. homeomorphism (cbox a c) (cbox u w) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7054
  proof (rule homeomorphism_compact)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7055
    have cf1: "continuous_on (cbox a b) f1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7056
      using hom_ab homeomorphism_cont1 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7057
    have cf2: "continuous_on (cbox b c) f2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7058
      using hom_bc homeomorphism_cont1 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7059
    show "continuous_on (cbox a c) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7060
      apply (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7061
      apply (rule continuous_on_cases_le [OF continuous_on_subset [OF cf1] continuous_on_subset [OF cf2]])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7062
      using le eq apply (force simp: continuous_on_id)+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7063
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7064
    have "f ` cbox a b = f1 ` cbox a b" "f ` cbox b c = f2 ` cbox b c"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7065
      unfolding f_def using eq by force+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7066
    then show "f ` cbox a c = cbox u w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7067
      apply (simp only: ac uw image_Un)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7068
      by (metis hom_ab hom_bc homeomorphism_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7069
    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
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7070
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7071
      have "f1 x \<in> cbox u v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7072
        by (metis hom_ab homeomorphism_def image_eqI mem_box_real(2) x)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7073
      moreover have "f2 y \<in> cbox v w"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7074
        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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7075
      moreover have "f2 y \<noteq> f2 b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7076
        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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7077
      ultimately show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7078
        using le eq by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7079
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7080
    have "inj_on f1 (cbox a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7081
      by (metis (full_types) hom_ab homeomorphism_def inj_onI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7082
    moreover have "inj_on f2 (cbox b c)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7083
      by (metis (full_types) hom_bc homeomorphism_def inj_onI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7084
    ultimately show "inj_on f (cbox a c)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7085
      apply (simp (no_asm) add: inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7086
      apply (simp add: f_def inj_on_eq_iff)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7087
      using neq12  apply force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7088
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7089
  qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7090
  then obtain g where "homeomorphism (cbox a c) (cbox u w) f g" ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7091
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7092
    apply (rule that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7093
    using eq le by (auto simp: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7094
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7095
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7096
lemma homeomorphism_grouping_point_3:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7097
  fixes a::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7098
  assumes cbox_sub: "cbox c d \<subseteq> box a b" "cbox u v \<subseteq> box a b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7099
      and box_ne: "box c d \<noteq> {}" "box u v \<noteq> {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7100
  obtains f g where "homeomorphism (cbox a b) (cbox a b) f g" "f a = a" "f b = b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7101
                    "\<And>x. x \<in> cbox c d \<Longrightarrow> f x \<in> cbox u v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7102
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7103
  have less: "a < c" "a < u" "d < b" "v < b" "c < d" "u < v" "cbox c d \<noteq> {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7104
    using assms
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7105
    by (simp_all add: cbox_sub subset_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7106
  obtain f1 g1 where 1: "homeomorphism (cbox a c) (cbox a u) f1 g1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7107
                   and f1_eq: "f1 a = a" "f1 c = u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7108
    using homeomorphism_grouping_point_1 [OF \<open>a < c\<close> \<open>a < u\<close>] .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7109
  obtain f2 g2 where 2: "homeomorphism (cbox c d) (cbox u v) f2 g2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7110
                   and f2_eq: "f2 c = u" "f2 d = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7111
    using homeomorphism_grouping_point_1 [OF \<open>c < d\<close> \<open>u < v\<close>] .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7112
  obtain f3 g3 where 3: "homeomorphism (cbox d b) (cbox v b) f3 g3"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7113
                   and f3_eq: "f3 d = v" "f3 b = b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7114
    using homeomorphism_grouping_point_1 [OF \<open>d < b\<close> \<open>v < b\<close>] .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7115
  obtain f4 g4 where 4: "homeomorphism (cbox a d) (cbox a v) f4 g4" and "f4 a = a" "f4 d = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7116
                 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"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7117
    using homeomorphism_grouping_point_2 [OF 1 2] less  by (auto simp: f1_eq f2_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7118
  obtain f g where fg: "homeomorphism (cbox a b) (cbox a b) f g" "f a = a" "f b = b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7119
               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"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7120
    using homeomorphism_grouping_point_2 [OF 4 3] less by (auto simp: f4_eq f3_eq f2_eq f1_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7121
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7122
    apply (rule that [OF fg])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7123
    using f4_eq f_eq homeomorphism_image1 [OF 2]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7124
    apply simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7125
    by (metis atLeastAtMost_iff box_real(1) box_real(2) cbox_sub(1) greaterThanLessThan_iff imageI less_eq_real_def subset_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7126
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7127
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7128
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7129
lemma homeomorphism_grouping_point_4:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7130
  fixes T :: "real set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7131
  assumes "open U" "open S" "connected S" "U \<noteq> {}" "finite K" "K \<subseteq> S" "U \<subseteq> S" "S \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7132
  obtains f g where "homeomorphism T T f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7133
                    "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U" "{x. (~ (f x = x \<and> g x = x))} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7134
                    "bounded {x. (~ (f x = x \<and> g x = x))}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7135
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7136
  obtain c d where "box c d \<noteq> {}" "cbox c d \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7137
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7138
    obtain u where "u \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7139
      using \<open>U \<noteq> {}\<close> by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7140
    then obtain e where "e > 0" "cball u e \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7141
      using \<open>open U\<close> open_contains_cball by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7142
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7143
      by (rule_tac c=u and d="u+e" in that) (auto simp: dist_norm subset_iff)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7144
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7145
  have "compact K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7146
    by (simp add: \<open>finite K\<close> finite_imp_compact)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7147
  obtain a b where "box a b \<noteq> {}" "K \<subseteq> cbox a b" "cbox a b \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7148
  proof (cases "K = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7149
    case True then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7150
      using \<open>box c d \<noteq> {}\<close> \<open>cbox c d \<subseteq> U\<close> \<open>U \<subseteq> S\<close> that by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7151
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7152
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7153
    then obtain a b where "a \<in> K" "b \<in> K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7154
            and a: "\<And>x. x \<in> K \<Longrightarrow> a \<le> x" and b: "\<And>x. x \<in> K \<Longrightarrow> x \<le> b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7155
      using compact_attains_inf compact_attains_sup by (metis \<open>compact K\<close>)+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7156
    obtain e where "e > 0" "cball b e \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7157
      using \<open>open S\<close> open_contains_cball
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7158
      by (metis \<open>b \<in> K\<close> \<open>K \<subseteq> S\<close> subsetD)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7159
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7160
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7161
      show "box a (b + e) \<noteq> {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7162
        using \<open>0 < e\<close> \<open>b \<in> K\<close> a by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7163
      show "K \<subseteq> cbox a (b + e)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7164
        using \<open>0 < e\<close> a b by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7165
      have "a \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7166
        using \<open>a \<in> K\<close> assms(6) by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7167
      have "b + e \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7168
        using \<open>0 < e\<close> \<open>cball b e \<subseteq> S\<close>  by (force simp: dist_norm)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7169
      show "cbox a (b + e) \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7170
        using \<open>a \<in> S\<close> \<open>b + e \<in> S\<close> \<open>connected S\<close> connected_contains_Icc by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7171
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7172
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7173
  obtain w z where "cbox w z \<subseteq> S" and sub_wz: "cbox a b \<union> cbox c d \<subseteq> box w z"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7174
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7175
    have "a \<in> S" "b \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7176
      using \<open>box a b \<noteq> {}\<close> \<open>cbox a b \<subseteq> S\<close> by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7177
    moreover have "c \<in> S" "d \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7178
      using \<open>box c d \<noteq> {}\<close> \<open>cbox c d \<subseteq> U\<close> \<open>U \<subseteq> S\<close> by force+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7179
    ultimately have "min a c \<in> S" "max b d \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7180
      by linarith+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7181
    then obtain e1 e2 where "e1 > 0" "cball (min a c) e1 \<subseteq> S" "e2 > 0" "cball (max b d) e2 \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7182
      using \<open>open S\<close> open_contains_cball by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7183
    then have *: "min a c - e1 \<in> S" "max b d + e2 \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7184
      by (auto simp: dist_norm)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7185
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7186
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7187
      show "cbox (min a c - e1) (max b d+ e2) \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7188
        using * \<open>connected S\<close> connected_contains_Icc by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7189
      show "cbox a b \<union> cbox c d \<subseteq> box (min a c - e1) (max b d + e2)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7190
        using \<open>0 < e1\<close> \<open>0 < e2\<close> by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7191
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7192
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7193
  then
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7194
  obtain f g where hom: "homeomorphism (cbox w z) (cbox w z) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7195
               and "f w = w" "f z = z"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7196
               and fin: "\<And>x. x \<in> cbox a b \<Longrightarrow> f x \<in> cbox c d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7197
    using homeomorphism_grouping_point_3 [of a b w z c d]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7198
    using \<open>box a b \<noteq> {}\<close> \<open>box c d \<noteq> {}\<close> by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7199
  have contfg: "continuous_on (cbox w z) f" "continuous_on (cbox w z) g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7200
    using hom homeomorphism_def by blast+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7201
  define f' where "f' \<equiv> \<lambda>x. if x \<in> cbox w z then f x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7202
  define g' where "g' \<equiv> \<lambda>x. if x \<in> cbox w z then g x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7203
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7204
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7205
    have T: "cbox w z \<union> (T - box w z) = T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7206
      using \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7207
    show "homeomorphism T T f' g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7208
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7209
      have clo: "closedin (subtopology euclidean (cbox w z \<union> (T - box w z))) (T - box w z)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7210
        by (metis Diff_Diff_Int Diff_subset T closedin_def open_box openin_open_Int topspace_euclidean_subtopology)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7211
      have "continuous_on (cbox w z \<union> (T - box w z)) f'" "continuous_on (cbox w z \<union> (T - box w z)) g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7212
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7213
         apply (safe intro!: continuous_on_cases_local contfg continuous_on_id clo)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7214
         apply (simp_all add: closed_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7215
        using \<open>f w = w\<close> \<open>f z = z\<close> apply force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7216
        by (metis \<open>f w = w\<close> \<open>f z = z\<close> hom homeomorphism_def less_eq_real_def mem_box_real(2))
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7217
      then show "continuous_on T f'" "continuous_on T g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7218
        by (simp_all only: T)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7219
      show "f' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7220
        unfolding f'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7221
        by clarsimp (metis \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> subsetD hom homeomorphism_def imageI mem_box_real(2))
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7222
      show "g' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7223
        unfolding g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7224
        by clarsimp (metis \<open>cbox w z \<subseteq> S\<close> \<open>S \<subseteq> T\<close> subsetD hom homeomorphism_def imageI mem_box_real(2))
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7225
      show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7226
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7227
        using homeomorphism_apply1 [OF hom]  homeomorphism_image1 [OF hom] by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7228
      show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7229
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7230
        using homeomorphism_apply2 [OF hom]  homeomorphism_image2 [OF hom] by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7231
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7232
    show "\<And>x. x \<in> K \<Longrightarrow> f' x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7233
      using fin sub_wz \<open>K \<subseteq> cbox a b\<close> \<open>cbox c d \<subseteq> U\<close> by (force simp: f'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7234
    show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7235
      using \<open>cbox w z \<subseteq> S\<close> by (auto simp: f'_def g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7236
    show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7237
      apply (rule bounded_subset [of "cbox w z"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7238
      using bounded_cbox apply blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7239
      apply (auto simp: f'_def g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7240
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7241
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7242
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7243
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7244
proposition homeomorphism_grouping_points_exists:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7245
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7246
  assumes "open U" "open S" "connected S" "U \<noteq> {}" "finite K" "K \<subseteq> S" "U \<subseteq> S" "S \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7247
  obtains f g where "homeomorphism T T f g" "{x. (~ (f x = x \<and> g x = x))} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7248
                    "bounded {x. (~ (f x = x \<and> g x = x))}" "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7249
proof (cases "2 \<le> DIM('a)")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7250
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7251
  have TS: "T \<subseteq> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7252
    using affine_hull_open assms by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7253
  have "infinite U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7254
    using \<open>open U\<close> \<open>U \<noteq> {}\<close> finite_imp_not_open by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7255
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7256
    using infinite_arbitrarily_large by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7257
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7258
    using \<open>finite K\<close> finite_same_card_bij by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7259
  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)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7260
  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>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7261
    show "\<And>i. i \<in> K \<Longrightarrow> id i \<in> S \<and> \<gamma> i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7262
      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
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7263
    show "pairwise (\<lambda>i j. id i \<noteq> id j \<and> \<gamma> i \<noteq> \<gamma> j) K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7264
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7265
  qed (use affine_hull_open assms that in auto)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7266
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7267
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7268
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7269
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7270
  with DIM_positive have "DIM('a) = 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7271
    by (simp add: dual_order.antisym)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7272
  then obtain h::"'a \<Rightarrow>real" and j
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7273
  where "linear h" "linear j"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7274
    and noh: "\<And>x. norm(h x) = norm x" and noj: "\<And>y. norm(j y) = norm y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7275
    and hj:  "\<And>x. j(h x) = x" "\<And>y. h(j y) = y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7276
    and ranh: "surj h"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7277
    using isomorphisms_UNIV_UNIV
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7278
    by (metis (mono_tags, hide_lams) DIM_real UNIV_eq_I range_eqI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7279
  obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7280
               and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7281
               and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7282
               and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7283
    apply (rule homeomorphism_grouping_point_4 [of "h ` U" "h ` S" "h ` K" "h ` T"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7284
    by (simp_all add: assms image_mono  \<open>linear h\<close> open_surjective_linear_image connected_linear_image ranh)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7285
  have jf: "j (f (h x)) = x \<longleftrightarrow> f (h x) = h x" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7286
    by (metis hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7287
  have jg: "j (g (h x)) = x \<longleftrightarrow> g (h x) = h x" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7288
    by (metis hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7289
  have cont_hj: "continuous_on X h"  "continuous_on Y j" for X Y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7290
    by (simp_all add: \<open>linear h\<close> \<open>linear j\<close> linear_linear linear_continuous_on)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7291
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7292
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7293
    show "homeomorphism T T (j \<circ> f \<circ> h) (j \<circ> g \<circ> h)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7294
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7295
      show "continuous_on T (j \<circ> f \<circ> h)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7296
        apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7297
        using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7298
      show "continuous_on T (j \<circ> g \<circ> h)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7299
        apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7300
        using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7301
      show "(j \<circ> f \<circ> h) ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7302
        by clarsimp (metis (mono_tags, hide_lams) hj(1) hom homeomorphism_def imageE imageI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7303
      show "(j \<circ> g \<circ> h) ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7304
        by clarsimp (metis (mono_tags, hide_lams) hj(1) hom homeomorphism_def imageE imageI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7305
      show "\<And>x. x \<in> T \<Longrightarrow> (j \<circ> g \<circ> h) ((j \<circ> f \<circ> h) x) = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7306
        using hj hom homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7307
      show "\<And>y. y \<in> T \<Longrightarrow> (j \<circ> f \<circ> h) ((j \<circ> g \<circ> h) y) = y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7308
        using hj hom homeomorphism_apply2 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7309
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7310
    show "{x. \<not> ((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7311
      apply (clarsimp simp: jf jg hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7312
      using sub hj
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7313
      apply (drule_tac c="h x" in subsetD, force)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7314
      by (metis imageE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7315
    have "bounded (j ` {x. (~ (f x = x \<and> g x = x))})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7316
      apply (rule bounded_linear_image [OF bou])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7317
      using \<open>linear j\<close> linear_conv_bounded_linear by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7318
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7319
    have *: "{x. ~((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)} = j ` {x. (~ (f x = x \<and> g x = x))}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7320
      using hj apply (auto simp: jf jg image_iff, metis+)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7321
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7322
    ultimately show "bounded {x. \<not> ((j \<circ> f \<circ> h) x = x \<and> (j \<circ> g \<circ> h) x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7323
      by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7324
    show "\<And>x. x \<in> K \<Longrightarrow> (j \<circ> f \<circ> h) x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7325
      using f hj by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7326
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7327
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7328
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7329
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7330
proposition homeomorphism_grouping_points_exists_gen:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7331
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7332
  assumes opeU: "openin (subtopology euclidean S) U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7333
      and opeS: "openin (subtopology euclidean (affine hull S)) S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7334
      and "U \<noteq> {}" "finite K" "K \<subseteq> S" and S: "S \<subseteq> T" "T \<subseteq> affine hull S" "connected S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7335
  obtains f g where "homeomorphism T T f g" "{x. (~ (f x = x \<and> g x = x))} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7336
                    "bounded {x. (~ (f x = x \<and> g x = x))}" "\<And>x. x \<in> K \<Longrightarrow> f x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7337
proof (cases "2 \<le> aff_dim S")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7338
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7339
  have opeU': "openin (subtopology euclidean (affine hull S)) U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7340
    using opeS opeU openin_trans by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7341
  obtain u where "u \<in> U" "u \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7342
    using \<open>U \<noteq> {}\<close> opeU openin_imp_subset by fastforce+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7343
  have "infinite U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7344
    apply (rule infinite_openin [OF opeU \<open>u \<in> U\<close>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7345
    apply (rule connected_imp_perfect_aff_dim [OF \<open>connected S\<close> _ \<open>u \<in> S\<close>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7346
    using True apply simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7347
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7348
  then obtain P where "P \<subseteq> U" "finite P" "card K = card P"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7349
    using infinite_arbitrarily_large by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7350
  then obtain \<gamma> where \<gamma>: "bij_betw \<gamma> K P"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7351
    using \<open>finite K\<close> finite_same_card_bij by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7352
  have "\<exists>f g. homeomorphism T T f g \<and> (\<forall>i \<in> K. f(id i) = \<gamma> i) \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7353
               {x. ~ (f x = x \<and> g x = x)} \<subseteq> S \<and> bounded {x. ~ (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7354
  proof (rule homeomorphism_moving_points_exists_gen [OF \<open>finite K\<close> _ _ True opeS S])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7355
    show "\<And>i. i \<in> K \<Longrightarrow> id i \<in> S \<and> \<gamma> i \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7356
      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)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7357
    show "pairwise (\<lambda>i j. id i \<noteq> id j \<and> \<gamma> i \<noteq> \<gamma> j) K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7358
      using \<gamma> by (auto simp: pairwise_def bij_betw_def inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7359
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7360
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7361
    using \<gamma> \<open>P \<subseteq> U\<close> bij_betwE by (fastforce simp add: intro!: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7362
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7363
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7364
  with aff_dim_geq [of S] consider "aff_dim S = -1" | "aff_dim S = 0" | "aff_dim S = 1" by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7365
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7366
  proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7367
    assume "aff_dim S = -1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7368
    then have "S = {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7369
      using aff_dim_empty by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7370
    then have "False"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7371
      using \<open>U \<noteq> {}\<close> \<open>K \<subseteq> S\<close> openin_imp_subset [OF opeU] by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7372
    then show ?thesis ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7373
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7374
    assume "aff_dim S = 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7375
    then obtain a where "S = {a}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7376
      using aff_dim_eq_0 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7377
    then have "K \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7378
      using \<open>U \<noteq> {}\<close> \<open>K \<subseteq> S\<close> openin_imp_subset [OF opeU] by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7379
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7380
      apply (rule that [of id id])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7381
      using \<open>K \<subseteq> U\<close> by (auto simp: continuous_on_id intro: homeomorphismI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7382
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7383
    assume "aff_dim S = 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7384
    then have "affine hull S homeomorphic (UNIV :: real set)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7385
      by (auto simp: homeomorphic_affine_sets)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7386
    then obtain h::"'a\<Rightarrow>real" and j where homhj: "homeomorphism (affine hull S) UNIV h j"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7387
      using homeomorphic_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7388
    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"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7389
      by (auto simp: homeomorphism_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7390
    have connh: "connected (h ` S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7391
      by (meson Topological_Spaces.connected_continuous_image \<open>connected S\<close> homeomorphism_cont1 homeomorphism_of_subsets homhj hull_subset top_greatest)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7392
    have hUS: "h ` U \<subseteq> h ` S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7393
      by (meson homeomorphism_imp_open_map homeomorphism_of_subsets homhj hull_subset opeS opeU open_UNIV openin_open_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7394
    have op: "openin (subtopology euclidean (affine hull S)) U \<Longrightarrow> open (h ` U)" for U
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7395
      using homeomorphism_imp_open_map [OF homhj]  by (simp add: open_openin)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7396
    have "open (h ` U)" "open (h ` S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7397
      by (auto intro: opeS opeU openin_trans op)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7398
    then obtain f g where hom: "homeomorphism (h ` T) (h ` T) f g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7399
                 and f: "\<And>x. x \<in> h ` K \<Longrightarrow> f x \<in> h ` U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7400
                 and sub: "{x. \<not> (f x = x \<and> g x = x)} \<subseteq> h ` S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7401
                 and bou: "bounded {x. \<not> (f x = x \<and> g x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7402
      apply (rule homeomorphism_grouping_points_exists [of "h ` U" "h ` S" "h ` K" "h ` T"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7403
      using assms by (auto simp: connh hUS)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7404
    have jf: "\<And>x. x \<in> affine hull S \<Longrightarrow> j (f (h x)) = x \<longleftrightarrow> f (h x) = h x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7405
      by (metis h j)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7406
    have jg: "\<And>x. x \<in> affine hull S \<Longrightarrow> j (g (h x)) = x \<longleftrightarrow> g (h x) = h x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7407
      by (metis h j)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7408
    have cont_hj: "continuous_on T h"  "continuous_on Y j" for Y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7409
      apply (rule continuous_on_subset [OF _ \<open>T \<subseteq> affine hull S\<close>])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7410
      using homeomorphism_def homhj apply blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7411
      by (meson continuous_on_subset homeomorphism_def homhj top_greatest)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7412
    define f' where "f' \<equiv> \<lambda>x. if x \<in> affine hull S then (j \<circ> f \<circ> h) x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7413
    define g' where "g' \<equiv> \<lambda>x. if x \<in> affine hull S then (j \<circ> g \<circ> h) x else x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7414
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7415
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7416
      show "homeomorphism T T f' g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7417
      proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7418
        have "continuous_on T (j \<circ> f \<circ> h)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7419
          apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7420
          using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7421
        then show "continuous_on T f'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7422
          apply (rule continuous_on_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7423
          using \<open>T \<subseteq> affine hull S\<close> f'_def by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7424
        have "continuous_on T (j \<circ> g \<circ> h)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7425
          apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7426
          using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7427
        then show "continuous_on T g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7428
          apply (rule continuous_on_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7429
          using \<open>T \<subseteq> affine hull S\<close> g'_def by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7430
        show "f' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7431
        proof (clarsimp simp: f'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7432
          fix x assume "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7433
          then have "f (h x) \<in> h ` T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7434
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7435
          then show "j (f (h x)) \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7436
            using \<open>T \<subseteq> affine hull S\<close> h by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7437
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7438
        show "g' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7439
        proof (clarsimp simp: g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7440
          fix x assume "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7441
          then have "g (h x) \<in> h ` T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7442
            by (metis (no_types) hom homeomorphism_def image_subset_iff subset_refl)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7443
          then show "j (g (h x)) \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7444
            using \<open>T \<subseteq> affine hull S\<close> h by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7445
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7446
        show "\<And>x. x \<in> T \<Longrightarrow> g' (f' x) = x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7447
          using h j hom homeomorphism_apply1 by (fastforce simp add: f'_def g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7448
        show "\<And>y. y \<in> T \<Longrightarrow> f' (g' y) = y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7449
          using h j hom homeomorphism_apply2 by (fastforce simp add: f'_def g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7450
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7451
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7452
      show "{x. \<not> (f' x = x \<and> g' x = x)} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7453
        apply (clarsimp simp: f'_def g'_def jf jg)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7454
        apply (rule imageE [OF subsetD [OF sub]], force)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7455
        by (metis h hull_inc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7456
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7457
      have "bounded (j ` {x. (~ (f x = x \<and> g x = x))})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7458
        apply (rule bounded_closure_image)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7459
        apply (rule compact_imp_bounded)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7460
        using bou by (auto simp: compact_continuous_image cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7461
      moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7462
      have *: "{x \<in> affine hull S. j (f (h x)) \<noteq> x \<or> j (g (h x)) \<noteq> x} = j ` {x. (~ (f x = x \<and> g x = x))}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7463
        using h j by (auto simp: image_iff; metis)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7464
      ultimately have "bounded {x \<in> affine hull S. j (f (h x)) \<noteq> x \<or> j (g (h x)) \<noteq> x}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7465
        by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7466
      then show "bounded {x. \<not> (f' x = x \<and> g' x = x)}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7467
        by (simp add: f'_def g'_def Collect_mono bounded_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7468
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7469
      show "f' x \<in> U" if "x \<in> K" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7470
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7471
        have "U \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7472
          using opeU openin_imp_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7473
        then have "j (f (h x)) \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7474
          using f h hull_subset that by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7475
        then show "f' x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7476
          using \<open>K \<subseteq> S\<close> S f'_def that by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7477
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7478
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7479
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7480
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7481
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7482
subsection\<open>nullhomotopic mappings\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7483
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7484
text\<open> A mapping out of a sphere is nullhomotopic iff it extends to the ball.
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7485
This even works out in the degenerate cases when the radius is \<le> 0, and
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7486
we also don't need to explicitly assume continuity since it's already implicit
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7487
in both sides of the equivalence.\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7488
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7489
lemma nullhomotopic_from_lemma:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7490
  assumes contg: "continuous_on (cball a r - {a}) g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7491
      and fa: "\<And>e. 0 < e
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7492
               \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>x. x \<noteq> a \<and> norm(x - a) < d \<longrightarrow> norm(g x - f a) < e)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7493
      and r: "\<And>x. x \<in> cball a r \<and> x \<noteq> a \<Longrightarrow> f x = g x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7494
    shows "continuous_on (cball a r) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7495
proof (clarsimp simp: continuous_on_eq_continuous_within Ball_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7496
  fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7497
  assume x: "dist a x \<le> r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7498
  show "continuous (at x within cball a r) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7499
  proof (cases "x=a")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7500
    case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7501
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7502
      by (metis continuous_within_eps_delta fa dist_norm dist_self r)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7503
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7504
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7505
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7506
    proof (rule continuous_transform_within [where f=g and d = "norm(x-a)"])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7507
      have "\<exists>d>0. \<forall>x'\<in>cball a r.
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7508
                      dist x' x < d \<longrightarrow> dist (g x') (g x) < e" if "e>0" for e
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7509
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7510
        obtain d where "d > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7511
           and d: "\<And>x'. \<lbrakk>dist x' a \<le> r; x' \<noteq> a; dist x' x < d\<rbrakk> \<Longrightarrow>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7512
                                 dist (g x') (g x) < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7513
          using contg False x \<open>e>0\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7514
          unfolding continuous_on_iff by (fastforce simp add: dist_commute intro: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7515
        show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7516
          using \<open>d > 0\<close> \<open>x \<noteq> a\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7517
          by (rule_tac x="min d (norm(x - a))" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7518
             (auto simp: dist_commute dist_norm [symmetric]  intro!: d)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7519
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7520
      then show "continuous (at x within cball a r) g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7521
        using contg False by (auto simp: continuous_within_eps_delta)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7522
      show "0 < norm (x - a)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7523
        using False by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7524
      show "x \<in> cball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7525
        by (simp add: x)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7526
      show "\<And>x'. \<lbrakk>x' \<in> cball a r; dist x' x < norm (x - a)\<rbrakk>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7527
        \<Longrightarrow> g x' = f x'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7528
        by (metis dist_commute dist_norm less_le r)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7529
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7530
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7531
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7532
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7533
proposition nullhomotopic_from_sphere_extension:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7534
  fixes f :: "'M::euclidean_space \<Rightarrow> 'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7535
  shows  "(\<exists>c. homotopic_with (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)) \<longleftrightarrow>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7536
          (\<exists>g. continuous_on (cball a r) g \<and> g ` (cball a r) \<subseteq> S \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7537
               (\<forall>x \<in> sphere a r. g x = f x))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7538
         (is "?lhs = ?rhs")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7539
proof (cases r "0::real" rule: linorder_cases)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7540
  case less
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7541
  then show ?thesis by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7542
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7543
  case equal
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7544
  with continuous_on_const show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7545
    apply (auto simp: homotopic_with)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7546
    apply (rule_tac x="\<lambda>x. h (0, a)" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7547
    apply (fastforce simp add:)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7548
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7549
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7550
  case greater
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7551
  let ?P = "continuous_on {x. norm(x - a) = r} f \<and> f ` {x. norm(x - a) = r} \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7552
  have ?P if ?lhs using that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7553
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7554
    fix c
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7555
    assume c: "homotopic_with (\<lambda>x. True) (sphere a r) S f (\<lambda>x. c)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7556
    then have contf: "continuous_on (sphere a r) f" and fim: "f ` sphere a r \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7557
      by (auto simp: homotopic_with_imp_subset1 homotopic_with_imp_continuous)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7558
    show ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7559
      using contf fim by (auto simp: sphere_def dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7560
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7561
  moreover have ?P if ?rhs using that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7562
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7563
    fix g
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7564
    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)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7565
    then
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7566
    show ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7567
      apply (safe elim!: continuous_on_eq [OF continuous_on_subset])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7568
      apply (auto simp: dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7569
      by (metis dist_norm image_subset_iff mem_sphere norm_minus_commute sphere_cball subsetCE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7570
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7571
  moreover have ?thesis if ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7572
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7573
    assume ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7574
    then obtain c where "homotopic_with (\<lambda>x. True) (sphere a r) S (\<lambda>x. c) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7575
      using homotopic_with_sym by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7576
    then obtain h where conth: "continuous_on ({0..1::real} \<times> sphere a r) h"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7577
                    and him: "h ` ({0..1} \<times> sphere a r) \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7578
                    and h: "\<And>x. h(0, x) = c" "\<And>x. h(1, x) = f x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7579
      by (auto simp: homotopic_with_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7580
    obtain b1::'M where "b1 \<in> Basis"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7581
      using SOME_Basis by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7582
    have "c \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7583
      apply (rule him [THEN subsetD])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7584
      apply (rule_tac x = "(0, a + r *\<^sub>R b1)" in image_eqI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7585
      using h greater \<open>b1 \<in> Basis\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7586
       apply (auto simp: dist_norm)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7587
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7588
    have uconth: "uniformly_continuous_on ({0..1::real} \<times> (sphere a r)) h"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7589
      by (force intro: compact_Times conth compact_uniformly_continuous)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7590
    let ?g = "\<lambda>x. h (norm (x - a)/r,
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7591
                     a + (if x = a then r *\<^sub>R b1 else (r / norm(x - a)) *\<^sub>R (x - a)))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7592
    let ?g' = "\<lambda>x. h (norm (x - a)/r, a + (r / norm(x - a)) *\<^sub>R (x - a))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7593
    show ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7594
    proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7595
      have "continuous_on (cball a r - {a}) ?g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7596
        apply (rule continuous_on_compose2 [OF conth])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7597
         apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7598
        using greater apply (auto simp: dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7599
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7600
      then show "continuous_on (cball a r) ?g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7601
      proof (rule nullhomotopic_from_lemma)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7602
        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
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7603
        proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7604
          obtain d where "0 < d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7605
             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>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7606
                        \<Longrightarrow> dist (h x') (h x) < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7607
            using uniformly_continuous_onE [OF uconth \<open>0 < e\<close>] by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7608
          have *: "norm (h (norm (x - a) / r,
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7609
                         a + (r / norm (x - a)) *\<^sub>R (x - a)) - h (0, a + r *\<^sub>R b1)) < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7610
                   if "x \<noteq> a" "norm (x - a) < r" "norm (x - a) < d * r" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7611
          proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7612
            have "norm (h (norm (x - a) / r, a + (r / norm (x - a)) *\<^sub>R (x - a)) - h (0, a + r *\<^sub>R b1)) =
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7613
                  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)))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7614
              by (simp add: h)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7615
            also have "... < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7616
              apply (rule d [unfolded dist_norm])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7617
              using greater \<open>0 < d\<close> \<open>b1 \<in> Basis\<close> that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7618
                by (auto simp: dist_norm divide_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7619
            finally show ?thesis .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7620
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7621
          show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7622
            apply (rule_tac x = "min r (d * r)" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7623
            using greater \<open>0 < d\<close> by (auto simp: *)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7624
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7625
        show "\<And>x. x \<in> cball a r \<and> x \<noteq> a \<Longrightarrow> ?g x = ?g' x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7626
          by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7627
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7628
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7629
      show "?g ` cball a r \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7630
        using greater him \<open>c \<in> S\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7631
        by (force simp: h dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7632
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7633
      show "\<forall>x\<in>sphere a r. ?g x = f x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7634
        using greater by (auto simp: h dist_norm norm_minus_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7635
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7636
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7637
    assume ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7638
    then obtain g where contg: "continuous_on (cball a r) g"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7639
                    and gim: "g ` cball a r \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7640
                    and gf: "\<forall>x \<in> sphere a r. g x = f x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7641
      by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7642
    let ?h = "\<lambda>y. g (a + (fst y) *\<^sub>R (snd y - a))"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7643
    have "continuous_on ({0..1} \<times> sphere a r) ?h"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7644
      apply (rule continuous_on_compose2 [OF contg])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7645
       apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7646
      apply (auto simp: dist_norm norm_minus_commute mult_left_le_one_le)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7647
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7648
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7649
    have "?h ` ({0..1} \<times> sphere a r) \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7650
      by (auto simp: dist_norm norm_minus_commute mult_left_le_one_le gim [THEN subsetD])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7651
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7652
    have "\<forall>x\<in>sphere a r. ?h (0, x) = g a" "\<forall>x\<in>sphere a r. ?h (1, x) = f x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7653
      by (auto simp: dist_norm norm_minus_commute mult_left_le_one_le gf)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7654
    ultimately
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7655
    show ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7656
      apply (subst homotopic_with_sym)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7657
      apply (rule_tac x="g a" in exI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7658
      apply (auto simp: homotopic_with)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7659
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7660
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7661
  ultimately
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7662
  show ?thesis by meson
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7663
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7664
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  7665
end