src/HOL/Analysis/Path_Connected.thy
author paulson <lp15@cam.ac.uk>
Thu, 05 Jan 2017 14:18:24 +0000
changeset 64788 19f3d4af7a7d
parent 64394 141e1ed8d5a0
child 64790 ed38f9a834d8
permissions -rw-r--r--
New material about path connectedness, etc.
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
63970
3b6a3632e754 HOL-Analysis: move Continuum_Not_Denumerable from Library
hoelzl
parents: 63967
diff changeset
     8
imports Continuous_Extension 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
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   137
lemma continuous_on_path: "path f \<Longrightarrow> t \<subseteq> {0..1} \<Longrightarrow> continuous_on t f"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   138
  using continuous_on_subset path_def by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   139
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   140
lemma arc_imp_simple_path: "arc g \<Longrightarrow> simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   141
  by (simp add: arc_def inj_on_def simple_path_def)
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 arc_imp_path: "arc g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   144
  using arc_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   145
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   146
lemma arc_imp_inj_on: "arc g \<Longrightarrow> inj_on g {0..1}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   147
  by (auto simp: arc_def)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
   148
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   149
lemma simple_path_imp_path: "simple_path g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   150
  using simple_path_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   151
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   152
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
   153
  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
   154
  by (force)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   155
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   156
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
   157
  using simple_path_cases by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   158
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   159
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
   160
  unfolding arc_def inj_on_def pathfinish_def pathstart_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   161
  by fastforce
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   162
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   163
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
   164
  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
   165
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   166
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
   167
  by (simp add: arc_simple_path)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   168
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60809
diff changeset
   169
lemma path_image_nonempty [simp]: "path_image g \<noteq> {}"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 53640
diff changeset
   170
  unfolding path_image_def image_is_empty box_eq_empty
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   171
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   172
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   173
lemma pathstart_in_path_image[intro]: "pathstart g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   174
  unfolding pathstart_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   175
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   176
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   177
lemma pathfinish_in_path_image[intro]: "pathfinish g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   178
  unfolding pathfinish_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   179
  by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   180
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   181
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
   182
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   183
  using connected_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   184
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   185
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
   186
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   187
  using compact_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   188
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   189
lemma reversepath_reversepath[simp]: "reversepath (reversepath g) = g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   190
  unfolding reversepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   191
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   192
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   193
lemma pathstart_reversepath[simp]: "pathstart (reversepath g) = pathfinish g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   194
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   195
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   196
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   197
lemma pathfinish_reversepath[simp]: "pathfinish (reversepath g) = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   198
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   199
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   200
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   201
lemma pathstart_join[simp]: "pathstart (g1 +++ g2) = pathstart g1"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   202
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   203
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   204
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   205
lemma pathfinish_join[simp]: "pathfinish (g1 +++ g2) = pathfinish g2"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   206
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   207
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   208
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   209
lemma path_image_reversepath[simp]: "path_image (reversepath g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   210
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   211
  have *: "\<And>g. path_image (reversepath g) \<subseteq> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   212
    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
   213
    by force
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   214
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   215
    using *[of g] *[of "reversepath g"]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   216
    unfolding reversepath_reversepath
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   217
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   218
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   219
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   220
lemma path_reversepath [simp]: "path (reversepath g) \<longleftrightarrow> path g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   221
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   222
  have *: "\<And>g. path g \<Longrightarrow> path (reversepath g)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   223
    unfolding path_def reversepath_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   224
    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
   225
    apply (intro continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   226
    apply (rule continuous_on_subset[of "{0..1}"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   227
    apply assumption
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   228
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   229
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   230
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   231
    using *[of "reversepath g"] *[of g]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   232
    unfolding reversepath_reversepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   233
    by (rule iffI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   234
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   235
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   236
lemma arc_reversepath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   237
  assumes "arc g" shows "arc(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   238
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   239
  have injg: "inj_on g {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   240
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   241
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   242
  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
   243
    by simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   244
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   245
    apply (auto simp: arc_def inj_on_def path_reversepath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   246
    apply (simp add: arc_imp_path assms)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   247
    apply (rule **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   248
    apply (rule inj_onD [OF injg])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   249
    apply (auto 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
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   252
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   253
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
   254
  apply (simp add: simple_path_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   255
  apply (force simp: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   256
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   257
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   258
lemmas reversepath_simps =
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   259
  path_reversepath path_image_reversepath pathstart_reversepath pathfinish_reversepath
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   260
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   261
lemma path_join[simp]:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   262
  assumes "pathfinish g1 = pathstart g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   263
  shows "path (g1 +++ g2) \<longleftrightarrow> path g1 \<and> path g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   264
  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
   265
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
   266
  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
   267
  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
   268
    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
   269
  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
   270
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   271
    by (intro continuous_on_cong refl) (auto simp: joinpaths_def pathfinish_def pathstart_def)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   272
  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
   273
    unfolding g1 g2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   274
    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
   275
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
   276
  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
   277
  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
   278
    by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   279
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   280
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   281
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   282
    then have "x \<in> (\<lambda>x. x * 2) ` {0..1 / 2}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   283
      by (intro image_eqI[where x="x/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   284
  }
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
   285
  note 1 = this
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   286
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   287
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   288
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   289
    then have "x \<in> (\<lambda>x. x * 2 - 1) ` {1 / 2..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   290
      by (intro image_eqI[where x="x/2 + 1/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   291
  }
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
   292
  note 2 = this
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   293
  show "continuous_on {0..1} (g1 +++ g2)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   294
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   295
    unfolding joinpaths_def 01
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   296
    apply (intro continuous_on_cases closed_atLeastAtMost g1g2[THEN continuous_on_compose2] continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   297
    apply (auto simp: field_simps pathfinish_def pathstart_def intro!: 1 2)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   298
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   299
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   300
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   301
section \<open>Path Images\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   302
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   303
lemma bounded_path_image: "path g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   304
  by (simp add: compact_imp_bounded compact_path_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   305
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   306
lemma closed_path_image:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   307
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   308
  shows "path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   309
  by (metis compact_path_image compact_imp_closed)
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 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
   312
  by (metis connected_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 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
   315
  by (metis compact_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   316
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   317
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
   318
  by (metis bounded_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   319
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   320
lemma closed_simple_path_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   321
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   322
  shows "simple_path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   323
  by (metis closed_path_image simple_path_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 connected_arc_image: "arc g \<Longrightarrow> connected(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   326
  by (metis connected_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 compact_arc_image: "arc g \<Longrightarrow> compact(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   329
  by (metis compact_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   330
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   331
lemma bounded_arc_image: "arc g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   332
  by (metis bounded_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   333
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   334
lemma closed_arc_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   335
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   336
  shows "arc g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   337
  by (metis closed_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   338
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   339
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
   340
  unfolding path_image_def joinpaths_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   341
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   342
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   343
lemma subset_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   344
  assumes "path_image g1 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   345
    and "path_image g2 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   346
  shows "path_image (g1 +++ g2) \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   347
  using path_image_join_subset[of g1 g2] and assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   348
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   349
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   350
lemma path_image_join:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   351
    "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
   352
  apply (rule subset_antisym [OF path_image_join_subset])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   353
  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
   354
  apply (drule sym)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   355
  apply (rule_tac x="xa/2" in bexI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   356
  apply (rule ccontr)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   357
  apply (drule_tac x="(xa+1)/2" in bspec)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   358
  apply (auto simp: field_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   359
  apply (drule_tac x="1/2" in bspec, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   360
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   361
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   362
lemma not_in_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   363
  assumes "x \<notin> path_image g1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   364
    and "x \<notin> path_image g2"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   365
  shows "x \<notin> path_image (g1 +++ g2)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   366
  using assms and path_image_join_subset[of g1 g2]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   367
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   368
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   369
lemma pathstart_compose: "pathstart(f o p) = f(pathstart p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   370
  by (simp add: pathstart_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 pathfinish_compose: "pathfinish(f o p) = f(pathfinish p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   373
  by (simp add: pathfinish_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_image_compose: "path_image (f o p) = f ` (path_image p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   376
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   377
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   378
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
   379
  by (rule ext) (simp add: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   380
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   381
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
   382
  by (rule ext) (simp add: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   383
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
   384
lemma joinpaths_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   385
  "(\<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
   386
   (\<And>t. t \<in> {0..1} \<Longrightarrow> q t = q' t)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   387
   \<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
   388
  by (auto simp: joinpaths_def)
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_inj_on: "simple_path g \<Longrightarrow> inj_on g {0<..<1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   391
  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
   392
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   393
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   394
subsection\<open>Simple paths with the endpoints removed\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   395
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   396
lemma simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   397
    "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
   398
  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
   399
  apply (metis eq_iff le_less_linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   400
  apply (metis leD linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   401
  using less_eq_real_def zero_le_one apply blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   402
  using less_eq_real_def zero_le_one apply blast
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   403
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   404
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   405
lemma connected_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   406
    "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
   407
apply (simp add: simple_path_endless)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   408
apply (rule connected_continuous_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   409
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
   410
by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   411
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   412
lemma nonempty_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   413
    "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
   414
  by (simp add: simple_path_endless)
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
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   417
subsection\<open>The operations on paths\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   418
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   419
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
   420
  by (auto simp: path_image_def reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   421
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   422
lemma path_imp_reversepath: "path g \<Longrightarrow> path(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   423
  apply (auto simp: path_def reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   424
  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
   425
  apply (auto simp: continuous_on_op_minus)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   426
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   427
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   428
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
   429
  by simp
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   430
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   431
lemma continuous_on_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   432
  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
   433
    shows "continuous_on {0..1} (g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   434
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   435
  have *: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   436
    by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   437
  have gg: "g2 0 = g1 1"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   438
    by (metis assms(3) pathfinish_def pathstart_def)
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   439
  have 1: "continuous_on {0..1/2} (g1 +++ g2)"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   440
    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
   441
    apply (rule continuous_intros | simp add: joinpaths_def assms)+
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   442
    done
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   443
  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
   444
    apply (rule continuous_on_subset [of "{1/2..1}"])
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   445
    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
   446
    done
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   447
  then have 2: "continuous_on {1/2..1} (g1 +++ g2)"
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   448
    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
   449
    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
   450
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   451
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   452
    apply (subst *)
62397
5ae24f33d343 Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents: 62381
diff changeset
   453
    apply (rule continuous_on_closed_Un)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   454
    using 1 2
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   455
    apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   456
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   457
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   458
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   459
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
   460
  by (simp add: path_join)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   461
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   462
lemma simple_path_join_loop:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   463
  assumes "arc g1" "arc g2"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   464
          "pathfinish g1 = pathstart g2"  "pathfinish g2 = pathstart g1"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   465
          "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
   466
  shows "simple_path(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   467
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   468
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   469
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   470
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   471
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   472
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   473
    by (simp add: arc_def)
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   474
  have g12: "g1 1 = g2 0"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   475
   and g21: "g2 1 = g1 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   476
   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
   477
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   478
    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
   479
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   480
    assume xyI: "x = 1 \<longrightarrow> y \<noteq> 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   481
       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
   482
    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
   483
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   484
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   485
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   486
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   487
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   488
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   489
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   490
      apply (drule inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   491
      using g21 [symmetric] xyI
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   492
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   493
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   494
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   495
  { fix x and y::real
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   496
    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
   497
    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
   498
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   499
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   500
      apply (rule_tac x="2 * x" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   501
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   502
    have "x = 0 \<and> y = 1"
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   503
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   504
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   505
      apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   506
      using  g21 [symmetric]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   507
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   508
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   509
   } note ** = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   510
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   511
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   512
    apply (simp add: arc_def simple_path_def path_join, clarify)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   513
    apply (simp add: joinpaths_def split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   514
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   515
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   516
    apply (metis **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   517
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   518
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   519
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   520
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   521
lemma arc_join:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   522
  assumes "arc g1" "arc g2"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   523
          "pathfinish g1 = pathstart g2"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   524
          "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g2}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   525
    shows "arc(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   526
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   527
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   528
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   529
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   530
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   531
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   532
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   533
  have g11: "g1 1 = g2 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   534
   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
   535
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   536
    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
   537
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   538
    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
   539
    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
   540
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   541
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   542
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   543
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   544
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   545
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   546
      by (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   547
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   548
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   549
    apply (simp add: arc_def inj_on_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   550
    apply (clarsimp simp add: arc_imp_path assms path_join)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   551
    apply (simp add: joinpaths_def split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   552
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   553
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   554
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   555
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   556
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   557
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   558
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   559
lemma reversepath_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   560
    "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
   561
  unfolding reversepath_def pathfinish_def pathstart_def joinpaths_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   562
  by (rule ext) (auto simp: mult.commute)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   563
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   564
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   565
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
   566
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   567
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
   568
  fixes g1 :: "real \<Rightarrow> 'a::metric_space"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   569
  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
   570
    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
   571
proof (rule ccontr)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
   572
  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
   573
  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
   574
  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
   575
    by auto
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   576
  then have "e > 0"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   577
    by (metis e_def pathfinish_def pathstart_def)
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   578
  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
   579
       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
   580
    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
   581
    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
   582
    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
   583
  obtain d2 where "d2 > 0"
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   584
       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
   585
                      \<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
   586
    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
   587
    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
   588
    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
   589
    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
   590
    done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   591
  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
   592
    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
   593
  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
   594
    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
   595
  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
   596
    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
   597
  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
   598
    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
   599
  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
   600
    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
   601
  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
   602
       "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
   603
    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
   604
  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
   605
    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
   606
  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
   607
    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
   608
qed
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 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
   611
  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
   612
  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
   613
    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
   614
  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
   615
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   616
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
   617
  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
   618
  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
   619
          "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
   620
proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   621
  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
   622
               \<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
   623
    using assms by (simp add: simple_path_def)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   624
  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
   625
    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
   626
  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
   627
  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
   628
    fix x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   629
    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
   630
    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
   631
      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
   632
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   633
  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
   634
    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
   635
  have [simp]: "g2 0 = g1 1"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   636
    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
   637
  have "path g2"
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   638
    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
   639
  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
   640
  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
   641
    fix x y
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   642
    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
   643
    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
   644
      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
   645
      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
   646
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   647
  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
   648
    using assms  by (simp add: arc_def)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   649
  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
   650
       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
   651
      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
   652
      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
   653
  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
   654
    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
   655
  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
   656
qed
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 simple_path_join_loop_eq:
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   659
  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
   660
    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
   661
             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
   662
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
   663
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   664
lemma arc_join_eq:
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   665
  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
   666
    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
   667
           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
   668
           (is "?lhs = ?rhs")
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   669
proof
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   670
  assume ?lhs
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   671
  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
   672
  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
   673
               \<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
   674
    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
   675
  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
   676
    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
   677
    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
   678
  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
   679
    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
   680
    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
   681
  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
   682
    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
   683
    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
   684
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   685
  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
   686
    using assms
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   687
    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
   688
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   689
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   690
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
   691
        "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
   692
        \<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
   693
             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
   694
             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
   695
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
   696
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   697
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   698
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
   699
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   700
lemma path_assoc:
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   701
    "\<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
   702
     \<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
   703
by simp
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   704
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   705
lemma simple_path_assoc:
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   706
  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
   707
    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
   708
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
   709
  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
   710
  proof
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   711
    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
   712
    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
   713
      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
   714
                    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
   715
  next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   716
    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
   717
    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
   718
      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
   719
      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
   720
    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
   721
      using assms
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   722
      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
   723
              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
   724
    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
   725
      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
   726
               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
   727
  qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   728
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   729
  case False
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   730
  { fix x :: 'a
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   731
    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
   732
              "(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
   733
              "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
   734
    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
   735
      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
   736
    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
   737
      by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   738
  }
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   739
  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
   740
    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
   741
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   742
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
   743
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
   744
     "\<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
   745
      \<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
   746
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
   747
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   748
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
   749
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   750
lemma path_sym:
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   751
    "\<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
   752
  by auto
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   753
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   754
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
   755
    "\<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
   756
     \<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
   757
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
   758
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
   759
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
   760
    "\<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
   761
     \<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
   762
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
   763
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
   764
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   765
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
   766
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   767
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
   768
  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
   769
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
   770
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
   771
  fixes g :: "_ \<Rightarrow> 'a::real_normed_vector"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   772
  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
   773
  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
   774
  apply (subst o_def [of g, symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   775
  apply (simp add: image_comp [symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   776
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   777
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
   778
lemma path_image_subpath:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   779
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   780
  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
   781
  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
   782
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   783
lemma path_subpath [simp]:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   784
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   785
  assumes "path g" "u \<in> {0..1}" "v \<in> {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   786
    shows "path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   787
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   788
  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
   789
    apply (rule continuous_intros | simp)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   790
    apply (simp add: image_affinity_atLeastAtMost [where c=u])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   791
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   792
    apply (auto simp: path_def continuous_on_subset)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   793
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   794
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   795
    by (simp add: path_def subpath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   796
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   797
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   798
lemma pathstart_subpath [simp]: "pathstart(subpath u v g) = g(u)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   799
  by (simp add: pathstart_def 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 pathfinish_subpath [simp]: "pathfinish(subpath u v g) = g(v)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   802
  by (simp add: pathfinish_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 subpath_trivial [simp]: "subpath 0 1 g = g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   805
  by (simp add: subpath_def)
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_reversepath: "subpath 1 0 g = reversepath g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   808
  by (simp add: reversepath_def 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 reversepath_subpath: "reversepath(subpath u v g) = subpath v u g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   811
  by (simp add: reversepath_def subpath_def algebra_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   812
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   813
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
   814
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   815
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   816
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
   817
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   818
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   819
lemma affine_ineq:
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   820
  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
   821
  assumes "x \<le> 1" "v \<le> u"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   822
    shows "v + x * u \<le> u + x * v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   823
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   824
  have "(1-x)*(u-v) \<ge> 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   825
    using assms by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   826
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   827
    by (simp add: algebra_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   828
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   829
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
   830
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
   831
  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
   832
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
   833
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   834
lemma simple_path_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   835
  "simple_path(subpath u v g) \<longleftrightarrow>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   836
     path(subpath u v g) \<and> u\<noteq>v \<and>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   837
     (\<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
   838
                \<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
   839
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   840
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   841
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   842
  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
   843
        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
   844
                  \<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
   845
    by (auto simp: simple_path_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   846
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   847
    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
   848
    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
   849
    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
   850
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost divide_simps
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
   851
       split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   852
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   853
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   854
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   855
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   856
  ultimately show ?rhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   857
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   858
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   859
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   860
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   861
  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
   862
   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
   863
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   864
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   865
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   866
  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
   867
    by algebra
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   868
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   869
    unfolding simple_path_def subpath_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   870
    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
   871
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   872
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   873
lemma arc_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   874
  "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
   875
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   876
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   877
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   878
  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
   879
        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
   880
                  \<Longrightarrow> x = y)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   881
    by (auto simp: arc_def inj_on_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   882
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   883
    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
   884
    then have "x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   885
    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
   886
    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
   887
       split: if_split_asm)
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   888
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   889
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   890
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   891
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   892
  ultimately show ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   893
    unfolding inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   894
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   895
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   896
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   897
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   898
  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
   899
   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
   900
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   901
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   902
    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
   903
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   904
    unfolding arc_def subpath_def inj_on_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   905
    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
   906
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   907
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   908
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   909
lemma simple_path_subpath:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   910
  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
   911
  shows "simple_path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   912
  using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   913
  apply (simp add: simple_path_subpath_eq simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   914
  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
   915
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   916
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   917
lemma arc_simple_path_subpath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   918
    "\<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
   919
  by (force intro: simple_path_subpath simple_path_imp_arc)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   920
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   921
lemma arc_subpath_arc:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   922
    "\<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
   923
  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
   924
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   925
lemma arc_simple_path_subpath_interior:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   926
    "\<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
   927
    apply (rule arc_simple_path_subpath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   928
    apply (force simp: simple_path_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
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   931
lemma path_image_subpath_subset:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   932
    "\<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
   933
  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
   934
  apply (auto simp: path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   935
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   936
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   937
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
   938
  by (rule ext) (simp add: joinpaths_def subpath_def divide_simps)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   939
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   940
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
   941
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   942
lemma subpath_to_frontier_explicit:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   943
    fixes S :: "'a::metric_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   944
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   945
    obtains u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   946
                "\<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
   947
                "(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
   948
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   949
  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
   950
  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
   951
    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
   952
    using compact_eq_bounded_closed apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   953
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   954
  have "1 \<in> {u. g u \<in> closure (- S)}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   955
    using assms by (simp add: pathfinish_def closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   956
  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
   957
    using atLeastAtMost_iff zero_le_one by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   958
  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
   959
                  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
   960
    using compact_attains_inf [OF com dis] by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   961
  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
   962
    using closure_def by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   963
  { assume "u \<noteq> 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   964
    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
   965
    { 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
   966
      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
   967
        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
   968
      have *: "dist (max 0 (u - d / 2)) u \<le> d"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   969
        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
   970
      have "\<exists>y\<in>S. dist y (g u) < e"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   971
        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
   972
        by (force intro: d [OF _ *] umin')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   973
    }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   974
    then have "g u \<in> closure S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   975
      by (simp add: frontier_def closure_approachable)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   976
  }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   977
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   978
    apply (rule_tac u=u in that)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   979
    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
   980
    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
   981
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   982
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   983
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   984
lemma subpath_to_frontier_strong:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   985
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   986
    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
   987
                    "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
   988
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   989
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   990
             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
   991
             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
   992
    using subpath_to_frontier_explicit [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   993
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   994
    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
   995
    apply (simp add: gunot)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   996
    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
   997
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   998
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   999
lemma subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1000
    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
  1001
    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
  1002
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1003
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1004
             and notin: "g u \<notin> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1005
             and disj: "u = 0 \<or>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1006
                        (\<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
  1007
    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
  1008
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1009
    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
  1010
    apply (metis DiffI disj frontier_def g0 notin pathstart_def)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1011
    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
  1012
    apply (simp add: path_image_subpath_gen)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1013
    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
  1014
    apply (rename_tac y)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1015
    apply (drule_tac x="y/u" in spec)
62390
842917225d56 more canonical names
nipkow
parents: 62087
diff changeset
  1016
    apply (auto split: if_split_asm)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1017
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1018
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1019
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1020
lemma exists_path_subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1021
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1022
    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
  1023
    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
  1024
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1025
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1026
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1027
  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
  1028
    using subpath_to_frontier [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1029
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1030
    apply (rule that [of "subpath 0 u g"])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1031
    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
  1032
    apply (simp_all add: path_image_subpath)
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1033
    apply (simp add: pathstart_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1034
    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
  1035
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1036
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1037
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1038
lemma exists_path_subpath_to_frontier_closed:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1039
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1040
    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
  1041
    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
  1042
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1043
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1044
  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
  1045
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1046
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1047
    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
  1048
  show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  1049
    apply (rule that [OF \<open>path h\<close>])
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1050
    using assms h
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1051
    apply auto
62087
44841d07ef1d revisions to limits and derivatives, plus new lemmas
paulson
parents: 61808
diff changeset
  1052
    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
  1053
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1054
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1055
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1056
subsection \<open>shiftpath: 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
  1057
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1058
definition shiftpath :: "real \<Rightarrow> (real \<Rightarrow> 'a::topological_space) \<Rightarrow> real \<Rightarrow> 'a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1059
  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
  1060
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1061
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
  1062
  unfolding pathstart_def shiftpath_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1063
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1064
lemma pathfinish_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1065
  assumes "0 \<le> a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1066
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1067
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1068
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1069
  unfolding pathstart_def pathfinish_def shiftpath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1070
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1071
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1072
lemma endpoints_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1073
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1074
    and "a \<in> {0 .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1075
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1076
    and "pathstart (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1077
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1078
  by (auto intro!: pathfinish_shiftpath pathstart_shiftpath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1079
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1080
lemma closed_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1081
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1082
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1083
  shows "pathfinish (shiftpath a g) = pathstart (shiftpath a g)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1084
  using endpoints_shiftpath[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1085
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1086
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1087
lemma path_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1088
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1089
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1090
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1091
  shows "path (shiftpath a g)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1092
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1093
  have *: "{0 .. 1} = {0 .. 1-a} \<union> {1-a .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1094
    using assms(3) by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1095
  have **: "\<And>x. x + a = 1 \<Longrightarrow> g (x + a - 1) = g (x + a)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1096
    using assms(2)[unfolded pathfinish_def pathstart_def]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1097
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1098
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1099
    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
  1100
    apply (rule continuous_on_closed_Un)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1101
    apply (rule closed_real_atLeastAtMost)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1102
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1103
    prefer 3
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1104
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a - 1 + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1105
    prefer 3
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1106
    apply (rule continuous_intros)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1107
    prefer 2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1108
    apply (rule continuous_intros)+
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1109
    apply (rule_tac[1-2] continuous_on_subset[OF assms(1)[unfolded path_def]])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1110
    using assms(3) and **
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1111
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1112
    apply (auto simp add: field_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1113
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1114
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1115
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1116
lemma shiftpath_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1117
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1118
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1119
    and "x \<in> {0..1}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1120
  shows "shiftpath (1 - a) (shiftpath a g) x = g x"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1121
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1122
  unfolding pathfinish_def pathstart_def shiftpath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1123
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1124
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1125
lemma path_image_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1126
  assumes "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1127
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1128
  shows "path_image (shiftpath a g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1129
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1130
  { fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1131
    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
  1132
    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
  1133
    proof (cases "a \<le> x")
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1134
      case False
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1135
      then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1136
        apply (rule_tac x="1 + x - a" in bexI)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1137
        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
  1138
        apply (auto simp add: field_simps atomize_not)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1139
        done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1140
    next
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1141
      case True
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1142
      then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1143
        using as(1-2) and assms(1)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1144
        apply (rule_tac x="x - a" in bexI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1145
        apply (auto simp add: field_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1146
        done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1147
    qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1148
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1149
  then show ?thesis
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1150
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1151
    unfolding shiftpath_def path_image_def pathfinish_def pathstart_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1152
    by (auto simp add: image_iff)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1153
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1154
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1155
lemma simple_path_shiftpath:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1156
  assumes "simple_path g" "pathfinish g = pathstart g" and a: "0 \<le> a" "a \<le> 1"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1157
    shows "simple_path (shiftpath a g)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1158
  unfolding simple_path_def
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1159
proof (intro conjI impI ballI)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1160
  show "path (shiftpath a g)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1161
    by (simp add: assms path_shiftpath simple_path_imp_path)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1162
  have *: "\<And>x y. \<lbrakk>g x = g y; x \<in> {0..1}; y \<in> {0..1}\<rbrakk> \<Longrightarrow> x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1163
    using assms by (simp add:  simple_path_def)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1164
  show "x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1165
    if "x \<in> {0..1}" "y \<in> {0..1}" "shiftpath a g x = shiftpath a g y" for x y
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1166
    using that a unfolding shiftpath_def
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1167
    apply (simp add: split: if_split_asm)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1168
      apply (drule *; auto)+
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1169
    done
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1170
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1171
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1172
subsection \<open>Special case of straight-line paths\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1173
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1174
definition linepath :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> real \<Rightarrow> 'a"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1175
  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
  1176
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1177
lemma pathstart_linepath[simp]: "pathstart (linepath a b) = a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1178
  unfolding pathstart_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1179
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1180
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1181
lemma pathfinish_linepath[simp]: "pathfinish (linepath a b) = b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1182
  unfolding pathfinish_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1183
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1184
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1185
lemma continuous_linepath_at[intro]: "continuous (at x) (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1186
  unfolding linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1187
  by (intro continuous_intros)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1188
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
  1189
lemma continuous_on_linepath [intro,continuous_intros]: "continuous_on s (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1190
  using continuous_linepath_at
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1191
  by (auto intro!: continuous_at_imp_continuous_on)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1192
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1193
lemma path_linepath[iff]: "path (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1194
  unfolding path_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1195
  by (rule continuous_on_linepath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1196
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1197
lemma path_image_linepath[simp]: "path_image (linepath a b) = closed_segment a b"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1198
  unfolding path_image_def segment linepath_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1199
  by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1200
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1201
lemma reversepath_linepath[simp]: "reversepath (linepath a b) = linepath b a"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1202
  unfolding reversepath_def linepath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1203
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1204
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
  1205
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
  1206
  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
  1207
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1208
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
  1209
  assumes "a \<noteq> b" shows [simp]: "arc (linepath a b)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1210
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1211
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1212
    fix x y :: "real"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1213
    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
  1214
    then have "(x - y) *\<^sub>R a = (x - y) *\<^sub>R b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1215
      by (simp add: algebra_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1216
    with assms have "x = y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1217
      by simp
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1218
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1219
  then show ?thesis
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
  1220
    unfolding arc_def inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1221
    by (simp add:  path_linepath) (force simp: algebra_simps linepath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1222
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1223
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1224
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
  1225
  by (simp add: arc_imp_simple_path arc_linepath)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1226
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1227
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
  1228
  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
  1229
64394
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
  1230
lemma linepath_refl: "linepath a a = (\<lambda>x. a)"
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
  1231
  by auto
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
  1232
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  1233
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
  1234
  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
  1235
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1236
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
  1237
  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
  1238
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1239
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
  1240
  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
  1241
63881
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1242
lemma inj_on_linepath:
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1243
  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
  1244
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
  1245
  fix x y
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1246
  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
  1247
  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
  1248
    by (auto simp: algebra_simps)
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1249
  then show "x=y"
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1250
    using assms by auto
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1251
qed
b746b19197bd lots of new results about topology, affine dimension etc
paulson <lp15@cam.ac.uk>
parents: 63627
diff changeset
  1252
62618
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1253
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1254
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
  1255
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1256
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
  1257
    "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
  1258
    "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
  1259
    "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
  1260
    "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
  1261
    "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
  1262
    "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
  1263
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
  1264
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1265
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
  1266
  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
  1267
    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
  1268
proof -
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1269
  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
  1270
    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
  1271
    using assms
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1272
    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
  1273
    done
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1274
  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
  1275
    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
  1276
qed
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1277
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1278
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
  1279
  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
  1280
  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
  1281
        "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
  1282
        "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
  1283
  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
  1284
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1285
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
  1286
  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
  1287
f7f2467ab854 Refactoring (moving theorems into better locations), plus a bit of new material
paulson <lp15@cam.ac.uk>
parents: 62533
diff changeset
  1288
lemma midpoint_in_open_segment [simp]: "midpoint a b \<in> open_segment a b \<longleftrightarrow> a \<noteq> b"
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1289
  by (simp add: open_segment_def)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1290
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1291
lemma continuous_IVT_local_extremum:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1292
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1293
  assumes contf: "continuous_on (closed_segment a b) f"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1294
      and "a \<noteq> b" "f a = f b"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1295
  obtains z where "z \<in> open_segment a b"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1296
                  "(\<forall>w \<in> closed_segment a b. (f w) \<le> (f z)) \<or>
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1297
                   (\<forall>w \<in> closed_segment a b. (f z) \<le> (f w))"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1298
proof -
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1299
  obtain c where "c \<in> closed_segment a b" and c: "\<And>y. y \<in> closed_segment a b \<Longrightarrow> f y \<le> f c"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1300
    using continuous_attains_sup [of "closed_segment a b" f] contf by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1301
  obtain d where "d \<in> closed_segment a b" and d: "\<And>y. y \<in> closed_segment a b \<Longrightarrow> f d \<le> f y"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1302
    using continuous_attains_inf [of "closed_segment a b" f] contf by auto
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1303
  show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1304
  proof (cases "c \<in> open_segment a b \<or> d \<in> open_segment a b")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1305
    case True
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1306
    then show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1307
      using c d that by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1308
  next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1309
    case False
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1310
    then have "(c = a \<or> c = b) \<and> (d = a \<or> d = b)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1311
      by (simp add: \<open>c \<in> closed_segment a b\<close> \<open>d \<in> closed_segment a b\<close> open_segment_def)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1312
    with \<open>a \<noteq> b\<close> \<open>f a = f b\<close> c d show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1313
      by (rule_tac z = "midpoint a b" in that) (fastforce+)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1314
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1315
qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1316
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1317
text\<open>An injective map into R is also an open map w.r.T. the universe, and conversely. \<close>
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1318
proposition injective_eq_1d_open_map_UNIV:
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1319
  fixes f :: "real \<Rightarrow> real"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1320
  assumes contf: "continuous_on S f" and S: "is_interval S"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1321
    shows "inj_on f S \<longleftrightarrow> (\<forall>T. open T \<and> T \<subseteq> S \<longrightarrow> open(f ` T))"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1322
          (is "?lhs = ?rhs")
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1323
proof safe
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1324
  fix T
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1325
  assume injf: ?lhs and "open T" and "T \<subseteq> S"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1326
  have "\<exists>U. open U \<and> f x \<in> U \<and> U \<subseteq> f ` T" if "x \<in> T" for x
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1327
  proof -
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1328
    obtain \<delta> where "\<delta> > 0" and \<delta>: "cball x \<delta> \<subseteq> T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1329
      using \<open>open T\<close> \<open>x \<in> T\<close> open_contains_cball_eq by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1330
    show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1331
    proof (intro exI conjI)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1332
      have "closed_segment (x-\<delta>) (x+\<delta>) = {x-\<delta>..x+\<delta>}"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1333
        using \<open>0 < \<delta>\<close> by (auto simp: closed_segment_eq_real_ivl)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1334
      also have "... \<subseteq> S"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1335
        using \<delta> \<open>T \<subseteq> S\<close> by (auto simp: dist_norm subset_eq)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1336
      finally have "f ` (open_segment (x-\<delta>) (x+\<delta>)) = open_segment (f (x-\<delta>)) (f (x+\<delta>))"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1337
        using continuous_injective_image_open_segment_1
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1338
        by (metis continuous_on_subset [OF contf] inj_on_subset [OF injf])
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1339
      then show "open (f ` {x-\<delta><..<x+\<delta>})"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1340
        using \<open>0 < \<delta>\<close> by (simp add: open_segment_eq_real_ivl)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1341
      show "f x \<in> f ` {x - \<delta><..<x + \<delta>}"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1342
        by (auto simp: \<open>\<delta> > 0\<close>)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1343
      show "f ` {x - \<delta><..<x + \<delta>} \<subseteq> f ` T"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1344
        using \<delta> by (auto simp: dist_norm subset_iff)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1345
    qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1346
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1347
  with open_subopen show "open (f ` T)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1348
    by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1349
next
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1350
  assume R: ?rhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1351
  have False if xy: "x \<in> S" "y \<in> S" and "f x = f y" "x \<noteq> y" for x y
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1352
  proof -
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1353
    have "open (f ` open_segment x y)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1354
      using R
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1355
      by (metis S convex_contains_open_segment is_interval_convex open_greaterThanLessThan open_segment_eq_real_ivl xy)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1356
    moreover
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1357
    have "continuous_on (closed_segment x y) f"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1358
      by (meson S closed_segment_subset contf continuous_on_subset is_interval_convex that)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1359
    then obtain \<xi> where "\<xi> \<in> open_segment x y"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1360
                    and \<xi>: "(\<forall>w \<in> closed_segment x y. (f w) \<le> (f \<xi>)) \<or>
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1361
                            (\<forall>w \<in> closed_segment x y. (f \<xi>) \<le> (f w))"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1362
      using continuous_IVT_local_extremum [of x y f] \<open>f x = f y\<close> \<open>x \<noteq> y\<close> by blast
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1363
    ultimately obtain e where "e>0" and e: "\<And>u. dist u (f \<xi>) < e \<Longrightarrow> u \<in> f ` open_segment x y"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1364
      using open_dist by (metis image_eqI)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1365
    have fin: "f \<xi> + (e/2) \<in> f ` open_segment x y" "f \<xi> - (e/2) \<in> f ` open_segment x y"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1366
      using e [of "f \<xi> + (e/2)"] e [of "f \<xi> - (e/2)"] \<open>e > 0\<close> by (auto simp: dist_norm)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1367
    show ?thesis
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1368
      using \<xi> \<open>0 < e\<close> fin open_closed_segment by fastforce
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1369
  qed
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1370
  then show ?lhs
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1371
    by (force simp: inj_on_def)
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  1372
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1373
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1374
subsection \<open>Bounding a point away from a path\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1375
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1376
lemma not_on_path_ball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1377
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1378
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1379
    and "z \<notin> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1380
  shows "\<exists>e > 0. ball z e \<inter> path_image g = {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1381
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1382
  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
  1383
    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
  1384
    using compact_path_image[THEN compact_imp_closed, OF assms(1)] by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1385
  then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1386
    apply (rule_tac x="dist z a" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1387
    using assms(2)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1388
    apply (auto intro!: dist_pos_lt)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1389
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1390
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1391
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1392
lemma not_on_path_cball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1393
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1394
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1395
    and "z \<notin> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1396
  shows "\<exists>e>0. cball z e \<inter> (path_image g) = {}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1397
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1398
  obtain e where "ball z e \<inter> path_image g = {}" "e > 0"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1399
    using not_on_path_ball[OF assms] by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1400
  moreover have "cball z (e/2) \<subseteq> ball z e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1401
    using \<open>e > 0\<close> by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1402
  ultimately show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1403
    apply (rule_tac x="e/2" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1404
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1405
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1406
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1407
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1408
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1409
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
  1410
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1411
definition "path_component s x y \<longleftrightarrow>
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1412
  (\<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
  1413
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1414
abbreviation
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1415
   "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
  1416
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1417
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
  1418
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1419
lemma path_component_mem:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1420
  assumes "path_component s x y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1421
  shows "x \<in> s" and "y \<in> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1422
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1423
  unfolding path_defs
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1424
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1425
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1426
lemma path_component_refl:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1427
  assumes "x \<in> s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1428
  shows "path_component s x x"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1429
  unfolding path_defs
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1430
  apply (rule_tac x="\<lambda>u. x" in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1431
  using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1432
  apply (auto intro!: continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1433
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1434
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1435
lemma path_component_refl_eq: "path_component s x x \<longleftrightarrow> x \<in> s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1436
  by (auto intro!: path_component_mem path_component_refl)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1437
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1438
lemma path_component_sym: "path_component s x y \<Longrightarrow> path_component s y x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1439
  unfolding path_component_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1440
  apply (erule exE)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1441
  apply (rule_tac x="reversepath g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1442
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1443
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1444
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1445
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
  1446
  assumes "path_component s x y" and "path_component s y z"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1447
  shows "path_component s x z"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1448
  using assms
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1449
  unfolding path_component_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1450
  apply (elim exE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1451
  apply (rule_tac x="g +++ ga" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1452
  apply (auto simp add: path_image_join)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1453
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1454
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1455
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
  1456
  unfolding path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1457
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1458
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
  1459
    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
  1460
    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
  1461
  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
  1462
  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
  1463
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1464
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1465
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1466
subsubsection \<open>Path components as sets\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1467
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1468
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
  1469
  "path_component_set s x =
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1470
    {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
  1471
  by (auto simp: path_component_def)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1472
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1473
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
  1474
  by (auto simp add: path_component_mem(2))
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1475
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1476
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
  1477
  using path_component_mem path_component_refl_eq
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1478
    by fastforce
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1479
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1480
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
  1481
     "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
  1482
  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
  1483
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1484
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
  1485
   "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
  1486
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
  1487
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1488
subsection \<open>Path connectedness of a space\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1489
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1490
definition "path_connected s \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1491
  (\<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
  1492
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1493
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
  1494
  unfolding path_connected_def path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1495
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1496
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
  1497
  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
  1498
  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
  1499
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1500
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
  1501
     "\<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
  1502
  by (metis path_component_mono path_connected_component_set)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1503
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1504
lemma convex_imp_path_connected:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1505
  fixes s :: "'a::real_normed_vector set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1506
  assumes "convex s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1507
  shows "path_connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1508
  unfolding path_connected_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1509
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1510
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1511
  apply (rule_tac x = "linepath x y" in exI)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1512
  unfolding path_image_linepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1513
  using assms [unfolded convex_contains_segment]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1514
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1515
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1516
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1517
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
  1518
  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
  1519
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1520
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
  1521
  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
  1522
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1523
lemma path_connected_imp_connected:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1524
  assumes "path_connected S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1525
  shows "connected S"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1526
  unfolding connected_def not_ex
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1527
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1528
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1529
  apply (rule ccontr)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1530
  unfolding not_not
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1531
  apply (elim conjE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1532
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1533
  fix e1 e2
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1534
  assume as: "open e1" "open e2" "S \<subseteq> e1 \<union> e2" "e1 \<inter> e2 \<inter> S = {}" "e1 \<inter> S \<noteq> {}" "e2 \<inter> S \<noteq> {}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1535
  then obtain x1 x2 where obt:"x1 \<in> e1 \<inter> S" "x2 \<in> e2 \<inter> S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1536
    by auto
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1537
  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
  1538
    using assms[unfolded path_connected_def,rule_format,of x1 x2] by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1539
  have *: "connected {0..1::real}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1540
    by (auto intro!: convex_connected convex_real_interval)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1541
  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
  1542
    using as(3) g(2)[unfolded path_defs] by blast
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1543
  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
  1544
    using as(4) g(2)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1545
    unfolding subset_eq
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1546
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1547
  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
  1548
    using g(3,4)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1549
    using obt
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1550
    by (simp add: ex_in_conv [symmetric], metis zero_le_one order_refl)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1551
  ultimately show False
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1552
    using *[unfolded connected_local not_ex, rule_format,
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1553
      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
  1554
    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
  1555
    using continuous_openin_preimage_gen[OF g(1)[unfolded path_def] as(2)]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1556
    by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1557
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1558
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1559
lemma open_path_component:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1560
  fixes S :: "'a::real_normed_vector set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1561
  assumes "open S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1562
  shows "open (path_component_set S x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1563
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1564
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1565
  fix y
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1566
  assume as: "y \<in> path_component_set S x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1567
  then have "y \<in> S"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1568
    apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1569
    apply (rule path_component_mem(2))
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1570
    unfolding mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1571
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1572
    done
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1573
  then obtain e where e: "e > 0" "ball y e \<subseteq> S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1574
    using assms[unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1575
    by auto
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1576
  show "\<exists>e > 0. ball y e \<subseteq> path_component_set S x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1577
    apply (rule_tac x=e in exI)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1578
    apply (rule,rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1579
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1580
    unfolding mem_ball mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1581
  proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1582
    fix z
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1583
    assume "dist y z < e"
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1584
    then show "path_component S x z"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1585
      apply (rule_tac path_component_trans[of _ _ y])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1586
      defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1587
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1588
      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
  1589
      using \<open>e > 0\<close> as
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1590
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1591
      done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1592
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1593
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1594
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1595
lemma open_non_path_component:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1596
  fixes S :: "'a::real_normed_vector set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1597
  assumes "open S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1598
  shows "open (S - path_component_set S x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1599
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1600
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1601
  fix y
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1602
  assume as: "y \<in> S - path_component_set S x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1603
  then obtain e where e: "e > 0" "ball y e \<subseteq> S"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1604
    using assms [unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1605
    by auto
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1606
  show "\<exists>e>0. ball y e \<subseteq> S - path_component_set S x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1607
    apply (rule_tac x=e in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1608
    apply rule
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1609
    apply (rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1610
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1611
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1612
    defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1613
  proof (rule ccontr)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1614
    fix z
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1615
    assume "z \<in> ball y e" "\<not> z \<notin> path_component_set S x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1616
    then have "y \<in> path_component_set S x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1617
      unfolding not_not mem_Collect_eq using \<open>e>0\<close>
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1618
      apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1619
      apply (rule path_component_trans, assumption)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1620
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1621
      apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1622
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1623
      done
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1624
    then show False
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1625
      using as by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1626
  qed (insert e(2), auto)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1627
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1628
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1629
lemma connected_open_path_connected:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1630
  fixes S :: "'a::real_normed_vector set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1631
  assumes "open S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1632
    and "connected S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1633
  shows "path_connected S"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1634
  unfolding path_connected_component_set
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1635
proof (rule, rule, rule path_component_subset, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1636
  fix x y
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1637
  assume "x \<in> S" and "y \<in> S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1638
  show "y \<in> path_component_set S x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1639
  proof (rule ccontr)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1640
    assume "\<not> ?thesis"
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1641
    moreover have "path_component_set S x \<inter> S \<noteq> {}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1642
      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
  1643
      by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1644
    ultimately
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1645
    show False
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1646
      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
  1647
      using assms(2)[unfolded connected_def not_ex, rule_format,
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1648
        of "path_component_set S x" "S - path_component_set S x"]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1649
      by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1650
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1651
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1652
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1653
lemma path_connected_continuous_image:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1654
  assumes "continuous_on S f"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1655
    and "path_connected S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1656
  shows "path_connected (f ` S)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1657
  unfolding path_connected_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1658
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1659
  fix x' y'
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1660
  assume "x' \<in> f ` S" "y' \<in> f ` S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1661
  then obtain x y where x: "x \<in> S" and y: "y \<in> S" and x': "x' = f x" and y': "y' = f y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1662
    by auto
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1663
  from x y obtain g where "path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1664
    using assms(2)[unfolded path_connected_def] by fast
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1665
  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
  1666
    unfolding x' y'
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1667
    apply (rule_tac x="f \<circ> g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1668
    unfolding path_defs
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51478
diff changeset
  1669
    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
  1670
    apply auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1671
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1672
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1673
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1674
lemma path_connected_translationI:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1675
  fixes a :: "'a :: topological_group_add"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1676
  assumes "path_connected S" shows "path_connected ((\<lambda>x. a + x) ` S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1677
  by (intro path_connected_continuous_image assms continuous_intros)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1678
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1679
lemma path_connected_translation:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1680
  fixes a :: "'a :: topological_group_add"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1681
  shows "path_connected ((\<lambda>x. a + x) ` S) = path_connected S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1682
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1683
  have "\<forall>x y. op + (x::'a) ` op + (0 - x) ` y = y"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1684
    by (simp add: image_image)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1685
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1686
    by (metis (no_types) path_connected_translationI)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1687
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1688
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1689
lemma path_connected_segment [simp]:
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1690
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1691
    shows "path_connected (closed_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1692
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1693
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1694
lemma path_connected_open_segment [simp]:
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1695
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1696
    shows "path_connected (open_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1697
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1698
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1699
lemma homeomorphic_path_connectedness:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1700
  "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
  1701
  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
  1702
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1703
lemma path_connected_empty [simp]: "path_connected {}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1704
  unfolding path_connected_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1705
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1706
lemma path_connected_singleton [simp]: "path_connected {a}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1707
  unfolding path_connected_def pathstart_def pathfinish_def path_image_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1708
  apply clarify
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1709
  apply (rule_tac x="\<lambda>x. a" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1710
  apply (simp add: image_constant_conv)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1711
  apply (simp add: path_def continuous_on_const)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1712
  done
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1713
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1714
lemma path_connected_Un:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1715
  assumes "path_connected s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1716
    and "path_connected t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1717
    and "s \<inter> t \<noteq> {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1718
  shows "path_connected (s \<union> t)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1719
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1720
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1721
  fix x y
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1722
  assume as: "x \<in> s \<union> t" "y \<in> s \<union> t"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1723
  from assms(3) obtain z where "z \<in> s \<inter> t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1724
    by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1725
  then show "path_component (s \<union> t) x y"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1726
    using as and assms(1-2)[unfolded path_connected_component]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1727
    apply -
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1728
    apply (erule_tac[!] UnE)+
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1729
    apply (rule_tac[2-3] path_component_trans[of _ _ z])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1730
    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
  1731
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1732
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1733
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1734
lemma path_connected_UNION:
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1735
  assumes "\<And>i. i \<in> A \<Longrightarrow> path_connected (S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1736
    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
  1737
  shows "path_connected (\<Union>i\<in>A. S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1738
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1739
proof clarify
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1740
  fix x i y j
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1741
  assume *: "i \<in> A" "x \<in> S i" "j \<in> A" "y \<in> S j"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1742
  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
  1743
    using assms by (simp_all add: path_connected_component)
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1744
  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
  1745
    using *(1,3) by (auto elim!: path_component_of_subset [rotated])
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1746
  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
  1747
    by (rule path_component_trans)
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1748
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1749
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1750
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
  1751
  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
  1752
  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
  1753
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
  1754
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
  1755
  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
  1756
  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
  1757
  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
  1758
  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
  1759
    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
  1760
      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
  1761
  next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1762
    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
  1763
      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
  1764
      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
  1765
      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
  1766
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1767
    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
  1768
      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
  1769
    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
  1770
      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
  1771
      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
  1772
      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
  1773
      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
  1774
      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
  1775
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1776
  qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1777
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1778
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1779
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
  1780
  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
  1781
  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
  1782
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  1783
lemma path_connected_path_component [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
  1784
   "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
  1785
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1786
  { 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
  1787
    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
  1788
    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
  1789
      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
  1790
    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
  1791
      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
  1792
    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
  1793
      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
  1794
      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
  1795
      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
  1796
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1797
  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
  1798
    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
  1799
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1800
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1801
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
  1802
  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
  1803
  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
  1804
  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
  1805
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1806
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
  1807
   "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
  1808
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
  1809
  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
  1810
    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
  1811
    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
  1812
    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
  1813
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1814
  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
  1815
    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
  1816
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1817
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1818
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
  1819
   "(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
  1820
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
  1821
  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
  1822
    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
  1823
    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
  1824
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1825
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1826
  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
  1827
    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
  1828
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1829
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1830
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
  1831
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1832
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
  1833
  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
  1834
  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
  1835
    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
  1836
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
  1837
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1838
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
  1839
  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
  1840
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
  1841
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
  1842
  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
  1843
  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
  1844
    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
  1845
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
  1846
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
  1847
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
  1848
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
  1849
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
  1850
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
  1851
313d3b697c9a Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
paulson <lp15@cam.ac.uk>
parents: 62626
diff changeset
  1852
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
  1853
  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
  1854
  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
  1855
    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
  1856
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
  1857
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1858
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
  1859
  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
  1860
    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
  1861
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
  1862
  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
  1863
  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
  1864
  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
  1865
    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
  1866
  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
  1867
    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
  1868
  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
  1869
    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
  1870
    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
  1871
    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
  1872
    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
  1873
    done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1874
  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
  1875
    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
  1876
    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
  1877
    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
  1878
    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
  1879
    done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1880
  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
  1881
    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
  1882
  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
  1883
    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
  1884
  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
  1885
    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
  1886
  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
  1887
  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
  1888
            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
  1889
    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
  1890
       apply (rule 1)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1891
      apply (rule 2)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1892
     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
  1893
    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
  1894
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1895
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1896
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
  1897
  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
  1898
  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
  1899
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
  1900
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  1901
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1902
lemma Union_path_component [simp]:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1903
   "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
  1904
apply (rule subset_antisym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1905
using path_component_subset apply force
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1906
using path_component_refl by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1907
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1908
lemma path_component_disjoint:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1909
   "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
  1910
    (a \<notin> path_component_set S b)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1911
apply (auto simp: disjnt_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1912
using path_component_eq apply fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1913
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
  1914
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1915
lemma path_component_eq_eq:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1916
   "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
  1917
        (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
  1918
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
  1919
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
  1920
apply (rule ext)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1921
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
  1922
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1923
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1924
lemma path_component_unique:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1925
  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
  1926
          "\<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
  1927
   shows "path_component_set S x = c"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1928
apply (rule subset_antisym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1929
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1930
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
  1931
by (simp add: assms path_component_maximal)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1932
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1933
lemma path_component_intermediate_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1934
   "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
  1935
        \<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
  1936
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
  1937
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1938
lemma complement_path_component_Union:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1939
  fixes x :: "'a :: topological_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1940
  shows "S - path_component_set S x =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1941
         \<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
  1942
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1943
  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
  1944
    for a::"'a set" and S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1945
    by (auto simp: disjnt_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1946
  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
  1947
            \<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
  1948
    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
  1949
  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
  1950
             \<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
  1951
    by (meson *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1952
  then show ?thesis by simp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1953
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1954
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  1955
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1956
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
  1957
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1958
lemma path_connected_punctured_universe:
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1959
  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
  1960
  shows "path_connected (- {a::'a})"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1961
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
  1962
  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
  1963
  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
  1964
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1965
  have A: "path_connected ?A"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1966
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1967
  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
  1968
    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
  1969
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1970
    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
  1971
      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
  1972
    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
  1973
      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
  1974
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1975
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1976
  have B: "path_connected ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1977
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1978
  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
  1979
    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
  1980
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1981
    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
  1982
      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
  1983
    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
  1984
      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
  1985
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1986
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1987
  obtain S :: "'a set" where "S \<subseteq> Basis" and "card S = Suc (Suc 0)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1988
    using ex_card[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1989
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1990
  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
  1991
    unfolding card_Suc_eq by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1992
  then have "a + b0 - b1 \<in> ?A \<inter> ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1993
    by (auto simp: inner_simps inner_Basis)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1994
  then have "?A \<inter> ?B \<noteq> {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1995
    by fast
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1996
  with A B have "path_connected (?A \<union> ?B)"
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1997
    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
  1998
  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
  1999
    unfolding neq_iff bex_disj_distrib Collect_disj_eq ..
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2000
  also have "\<dots> = {x. x \<noteq> a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2001
    unfolding euclidean_eq_iff [where 'a='a]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2002
    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
  2003
  also have "\<dots> = - {a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2004
    by auto
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2005
  finally show ?thesis .
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2006
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  2007
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2008
corollary connected_punctured_universe:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2009
  "2 \<le> DIM('N::euclidean_space) \<Longrightarrow> connected(- {a::'N})"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2010
  by (simp add: path_connected_punctured_universe path_connected_imp_connected)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2011
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2012
lemma path_connected_sphere:
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2013
  fixes a :: "'a :: euclidean_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2014
  assumes "2 \<le> DIM('a)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2015
  shows "path_connected(sphere a r)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2016
proof (cases r "0::real" rule: linorder_cases)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2017
  case less
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2018
  then show ?thesis
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2019
    by (simp add: path_connected_empty)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2020
next
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2021
  case equal
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2022
  then show ?thesis
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2023
    by (simp add: path_connected_singleton)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  2024
next
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2025
  case greater
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2026
  then have eq: "(sphere (0::'a) r) = (\<lambda>x. (r / norm x) *\<^sub>R x) ` (- {0::'a})"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2027
    by (force simp: image_iff split: if_split_asm)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2028
  have "continuous_on (- {0::'a}) (\<lambda>x. (r / norm x) *\<^sub>R x)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2029
    by (intro continuous_intros) auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2030
  then have "path_connected ((\<lambda>x. (r / norm x) *\<^sub>R x) ` (- {0::'a}))"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2031
    by (intro path_connected_continuous_image path_connected_punctured_universe assms)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2032
  with eq have "path_connected (sphere (0::'a) r)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2033
    by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2034
  then have "path_connected(op +a ` (sphere (0::'a) r))"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2035
    by (simp add: path_connected_translation)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  2036
  then show ?thesis
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2037
    by (metis add.right_neutral sphere_translation)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2038
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2039
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2040
lemma connected_sphere:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2041
    fixes a :: "'a :: euclidean_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2042
    assumes "2 \<le> DIM('a)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2043
      shows "connected(sphere a r)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2044
  using path_connected_sphere [OF assms]
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2045
  by (simp add: path_connected_imp_connected)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2046
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  2047
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2048
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
  2049
    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
  2050
    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
  2051
    shows "path_connected (- s)"
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2052
proof (cases "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
  2053
  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
  2054
    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
  2055
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2056
  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
  2057
  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
  2058
  { fix x y assume "x \<notin> s" "y \<notin> s"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2059
    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
  2060
    then have bxy: "bounded(insert x (insert y s))"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2061
      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
  2062
    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
  2063
                          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
  2064
      using bounded_subset_ballD [OF bxy, of a] by (auto simp: dist_norm)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  2065
    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
  2066
    { 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
  2067
      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
  2068
      have CC: "1 \<le> 1 + (C - 1) * u"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2069
        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
  2070
        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
  2071
        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
  2072
      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
  2073
        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
  2074
      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
  2075
            (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
  2076
        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
  2077
      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
  2078
        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
  2079
      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
  2080
        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
  2081
      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
  2082
              ((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
  2083
        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
  2084
      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
  2085
        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
  2086
      have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2087
        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
  2088
        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
  2089
        apply (drule_tac x=a in bspec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2090
         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
  2091
        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
  2092
         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
  2093
        apply (drule_tac x="1 / (1 + (C - 1) * u)" in spec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2094
        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
  2095
        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
  2096
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2097
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2098
    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
  2099
      by (force simp: closed_segment_def intro!: path_connected_linepath)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  2100
    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
  2101
    { 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
  2102
      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
  2103
      have DD: "1 \<le> 1 + (D - 1) * u"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2104
        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
  2105
        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
  2106
        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
  2107
      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
  2108
        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
  2109
      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
  2110
            (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
  2111
        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
  2112
      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
  2113
        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
  2114
      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
  2115
        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
  2116
      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
  2117
              ((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
  2118
        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
  2119
      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
  2120
        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
  2121
      have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2122
        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
  2123
        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
  2124
        apply (drule_tac x=a in bspec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2125
         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
  2126
        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
  2127
         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
  2128
        apply (drule_tac x="1 / (1 + (D - 1) * u)" in spec)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2129
        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
  2130
        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
  2131
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2132
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2133
    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
  2134
      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
  2135
    have pyx: "path_component (- s) (a + D *\<^sub>R (y - a)) (a + C *\<^sub>R (x - a))"
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2136
      apply (rule path_component_of_subset [of "sphere a B"])
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2137
       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
  2138
       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
  2139
      apply (rule path_connected_sphere [OF 2, of a B, simplified path_connected_component, rule_format])
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2140
       using \<open>x \<noteq> a\<close>  using \<open>y \<noteq> a\<close>  B apply (auto simp: dist_norm 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
  2141
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2142
    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
  2143
      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
  2144
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2145
  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
  2146
    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
  2147
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2148
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2149
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2150
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
  2151
    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
  2152
    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
  2153
      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
  2154
  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
  2155
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2156
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
  2157
    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
  2158
    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
  2159
      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
  2160
  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
  2161
  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
  2162
  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
  2163
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2164
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2165
proposition connected_open_delete:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2166
  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
  2167
    shows "connected(S - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2168
proof (cases "a \<in> S")
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2169
  case True
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2170
  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
  2171
    using open_contains_cball_eq by blast
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2172
  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
  2173
    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
  2174
  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
  2175
    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
  2176
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2177
  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
  2178
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2179
  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
  2180
    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
  2181
  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
  2182
    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
  2183
     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
  2184
    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
  2185
    apply auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2186
    done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2187
  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
  2188
    by auto
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2189
  then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2190
    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
  2191
next
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2192
  case False then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2193
    by (simp add: \<open>connected S\<close>)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2194
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2195
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2196
corollary path_connected_open_delete:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2197
  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
  2198
    shows "path_connected(S - {a::'N})"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2199
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
  2200
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2201
corollary path_connected_punctured_ball:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2202
   "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
  2203
by (simp add: path_connected_open_delete)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2204
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2205
corollary connected_punctured_ball:
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2206
   "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
  2207
by (simp add: connected_open_delete)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2208
63151
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2209
corollary connected_open_delete_finite:
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2210
  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
  2211
  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
  2212
  shows "connected(S - T)"
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  2213
  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
  2214
proof (induct T)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2215
  case empty
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2216
  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
  2217
next
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2218
  case (insert x F)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2219
  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
  2220
  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
  2221
  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
  2222
  thus ?case by (metis Diff_insert)
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2223
qed
82df5181d699 updated proof of Residue Theorem (form Wenda Li)
paulson <lp15@cam.ac.uk>
parents: 63126
diff changeset
  2224
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2225
lemma sphere_1D_doubleton_zero:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2226
  assumes 1: "DIM('a) = 1" and "r > 0"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2227
  obtains x y::"'a::euclidean_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2228
    where "sphere 0 r = {x,y} \<and> dist x y = 2*r"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2229
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2230
  obtain b::'a where b: "Basis = {b}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2231
    using 1 card_1_singletonE by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2232
  show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2233
  proof (intro that conjI)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2234
    have "x = norm x *\<^sub>R b \<or> x = - norm x *\<^sub>R b" if "r = norm x" for x
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2235
    proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2236
      have xb: "(x \<bullet> b) *\<^sub>R b = x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2237
        using euclidean_representation [of x, unfolded b] by force
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2238
      then have "norm ((x \<bullet> b) *\<^sub>R b) = norm x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2239
        by simp
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2240
      with b have "\<bar>x \<bullet> b\<bar> = norm x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2241
        using norm_Basis by fastforce
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2242
      with xb show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2243
        apply (simp add: abs_if split: if_split_asm)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2244
        apply (metis add.inverse_inverse real_vector.scale_minus_left xb)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2245
        done
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2246
    qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2247
    with \<open>r > 0\<close> b show "sphere 0 r = {r *\<^sub>R b, - r *\<^sub>R b}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2248
      by (force simp: sphere_def dist_norm)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2249
    have "dist (r *\<^sub>R b) (- r *\<^sub>R b) = norm (r *\<^sub>R b + r *\<^sub>R b)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2250
      by (simp add: dist_norm)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2251
    also have "... = norm ((2*r) *\<^sub>R b)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2252
      by (metis mult_2 scaleR_add_left)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2253
    also have "... = 2*r"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2254
      using \<open>r > 0\<close> b norm_Basis by fastforce
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2255
    finally show "dist (r *\<^sub>R b) (- r *\<^sub>R b) = 2*r" .
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2256
  qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2257
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2258
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2259
lemma sphere_1D_doubleton:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2260
  fixes a :: "'a :: euclidean_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2261
  assumes "DIM('a) = 1" and "r > 0"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2262
  obtains x y where "sphere a r = {x,y} \<and> dist x y = 2*r"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2263
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2264
  have "sphere a r = op +a ` sphere 0 r"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2265
    by (metis add.right_neutral sphere_translation)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2266
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2267
    using sphere_1D_doubleton_zero [OF assms]
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2268
    by (metis (mono_tags, lifting) dist_add_cancel image_empty image_insert that)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2269
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2270
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2271
lemma psubset_sphere_Compl_connected:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2272
  fixes S :: "'a::euclidean_space set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2273
  assumes S: "S \<subset> sphere a r" and "0 < r" and 2: "2 \<le> DIM('a)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2274
  shows "connected(- S)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2275
proof -
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2276
  have "S \<subseteq> sphere a r"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2277
    using S by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2278
  obtain b where "dist a b = r" and "b \<notin> S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2279
    using S mem_sphere by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2280
  have CS: "- S = {x. dist a x \<le> r \<and> (x \<notin> S)} \<union> {x. r \<le> dist a x \<and> (x \<notin> S)}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2281
    by (auto simp: )
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2282
  have "{x. dist a x \<le> r \<and> x \<notin> S} \<inter> {x. r \<le> dist a x \<and> x \<notin> S} \<noteq> {}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2283
    using \<open>b \<notin> S\<close> \<open>dist a b = r\<close> by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2284
  moreover have "connected {x. dist a x \<le> r \<and> x \<notin> S}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2285
    apply (rule connected_intermediate_closure [of "ball a r"])
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2286
    using assms by auto
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2287
  moreover
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2288
  have "connected {x. r \<le> dist a x \<and> x \<notin> S}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2289
    apply (rule connected_intermediate_closure [of "- cball a r"])
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2290
    using assms apply (auto intro: connected_complement_bounded_convex)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2291
    apply (metis ComplI interior_cball interior_closure mem_ball not_less)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2292
    done
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2293
  ultimately show ?thesis
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2294
    by (simp add: CS connected_Un)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2295
qed
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2296
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2297
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
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
  2299
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2300
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
  2301
  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
  2302
  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
  2303
    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
  2304
    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
  2305
    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
  2306
     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
  2307
    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
  2308
    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
  2309
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2310
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
  2311
    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
  2312
    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
  2313
  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
  2314
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2315
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
  2316
  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
  2317
  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
  2318
  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
  2319
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2320
  { 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
  2321
    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
  2322
      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
  2323
    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
  2324
      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
  2325
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2326
  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
  2327
    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
  2328
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2329
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2330
lemma connected_disjoint_Union_open_pick:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2331
  assumes "pairwise disjnt B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2332
          "\<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
  2333
          "\<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
  2334
          "\<Union>A \<subseteq> \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2335
          "S \<in> A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2336
  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
  2337
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2338
  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
  2339
    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
  2340
  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
  2341
    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
  2342
  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
  2343
  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
  2344
  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
  2345
  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
  2346
    by (auto simp: pairwise_def disjnt_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2347
  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
  2348
  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
  2349
  have "S \<inter> \<Union>(B-{T}) = {}"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2350
    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
  2351
  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
  2352
    using "3" by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2353
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2354
    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
  2355
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2356
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2357
lemma connected_disjoint_Union_open_subset:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2358
  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
  2359
      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
  2360
      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
  2361
      and eq [simp]: "\<Union>A = \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2362
    shows "A \<subseteq> B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2363
proof
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2364
  fix S
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2365
  assume "S \<in> A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2366
  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
  2367
      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
  2368
      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
  2369
  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
  2370
      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
  2371
      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
  2372
  ultimately have "S' = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2373
    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
  2374
  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
  2375
  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
  2376
  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
  2377
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2378
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2379
lemma connected_disjoint_Union_open_unique:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2380
  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
  2381
      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
  2382
      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
  2383
      and eq [simp]: "\<Union>A = \<Union>B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2384
    shows "A = B"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2385
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
  2386
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2387
proposition components_open_unique:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2388
 fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2389
  assumes "pairwise disjnt A" "\<Union>A = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2390
          "\<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
  2391
    shows "components S = A"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2392
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2393
  have "open S" using assms by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2394
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2395
    apply (rule connected_disjoint_Union_open_unique)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2396
    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
  2397
    using \<open>open S\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2398
    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
  2399
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2400
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2401
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  2402
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2403
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
  2404
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2405
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
  2406
    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
  2407
    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
  2408
      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
  2409
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2410
  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
  2411
    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
  2412
  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
  2413
    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
  2414
  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
  2415
    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
  2416
  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
  2417
    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
  2418
    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
  2419
    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
  2420
    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
  2421
    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
  2422
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2423
  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
  2424
    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
  2425
    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
  2426
    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
  2427
    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
  2428
    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
  2429
  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
  2430
    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
  2431
  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
  2432
    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
  2433
    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
  2434
    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
  2435
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2436
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2437
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2438
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
  2439
    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
  2440
    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
  2441
        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
  2442
                "~ 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
  2443
      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
  2444
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2445
  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
  2446
    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
  2447
  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
  2448
    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
  2449
  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
  2450
    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
  2451
  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
  2452
    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
  2453
  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
  2454
    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
  2455
    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
  2456
  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
  2457
    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
  2458
    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
  2459
  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
  2460
    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
  2461
    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
  2462
    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
  2463
    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
  2464
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2465
  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
  2466
    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
  2467
    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
  2468
    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
  2469
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2470
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2471
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
  2472
    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
  2473
    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
  2474
  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
  2475
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2476
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
  2477
    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
  2478
    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
  2479
  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
  2480
  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
  2481
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2482
lemma cobounded_has_bounded_component:
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  2483
  fixes S :: "'a :: euclidean_space set"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  2484
  assumes "bounded (- S)" "\<not> connected S" "2 \<le> DIM('a)"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  2485
  obtains C where "C \<in> components S" "bounded C"
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  2486
  by (meson cobounded_unique_unbounded_components connected_eq_connected_components_eq assms)
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2487
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2488
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2489
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
  2490
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2491
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
  2492
  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
  2493
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2494
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
  2495
  "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
  2496
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2497
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
  2498
  "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
  2499
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2500
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
  2501
  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
  2502
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2503
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
  2504
  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
  2505
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2506
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
  2507
   "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
  2508
  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
  2509
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2510
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
  2511
  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
  2512
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2513
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
  2514
  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
  2515
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2516
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
  2517
   "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
  2518
  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
  2519
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2520
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
  2521
  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
  2522
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2523
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
  2524
  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
  2525
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2526
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
  2527
  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
  2528
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2529
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
  2530
  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
  2531
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2532
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
  2533
  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
  2534
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2535
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
  2536
  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
  2537
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2538
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
  2539
  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
  2540
  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
  2541
  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
  2542
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2543
  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
  2544
    using assms by auto (metis add.commute diff_add_cancel)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2545
  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
  2546
    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
  2547
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2548
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2549
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
  2550
  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
  2551
  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
  2552
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2553
  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
  2554
    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
  2555
  { 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
  2556
    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
  2557
    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
  2558
    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
  2559
      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
  2560
    next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2561
      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
  2562
        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
  2563
        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
  2564
        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
  2565
        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
  2566
        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
  2567
         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
  2568
        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
  2569
        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
  2570
        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
  2571
        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
  2572
    qed
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
  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
  2575
    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
  2576
    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
  2577
    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
  2578
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2579
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2580
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2581
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
  2582
    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
  2583
    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
  2584
  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
  2585
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2586
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
  2587
    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
  2588
    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
  2589
  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
  2590
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2591
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
  2592
    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
  2593
    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
  2594
      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
  2595
  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
  2596
  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
  2597
  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
  2598
  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
  2599
  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
  2600
  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
  2601
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2602
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2603
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
  2604
    "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
  2605
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
  2606
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
  2607
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
  2608
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2609
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
  2610
   "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
  2611
            {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
  2612
                         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
  2613
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
  2614
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
  2615
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
  2616
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2617
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
  2618
    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
  2619
    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
  2620
      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
  2621
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2622
  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
  2623
    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
  2624
  { 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
  2625
    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
  2626
    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
  2627
      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
  2628
      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
  2629
      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
  2630
      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
  2631
    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
  2632
      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
  2633
      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
  2634
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2635
  } 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
  2636
  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
  2637
    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
  2638
    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
  2639
    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
  2640
    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
  2641
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2642
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2643
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
  2644
    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
  2645
    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
  2646
      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
  2647
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
  2648
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
  2649
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2650
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
  2651
    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
  2652
    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
  2653
      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
  2654
  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
  2655
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2656
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
  2657
    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
  2658
    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
  2659
      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
  2660
  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
  2661
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2662
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
  2663
  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
  2664
  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
  2665
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
  2666
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
  2667
       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
  2668
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2669
lemma frontier_not_empty:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2670
  fixes S :: "'a :: real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2671
  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
  2672
    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
  2673
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2674
lemma frontier_eq_empty:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2675
  fixes S :: "'a :: real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2676
  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
  2677
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
  2678
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2679
lemma frontier_of_connected_component_subset:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2680
  fixes S :: "'a::real_normed_vector set"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2681
  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
  2682
proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2683
  { fix y
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2684
    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
  2685
       and y2: "y \<notin> interior (connected_component_set S x)"
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2686
    have "y \<in> closure S"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2687
      using y1 closure_mono connected_component_subset by blast
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2688
    moreover have "z \<in> interior (connected_component_set S x)"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2689
          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
  2690
    proof -
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2691
      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
  2692
        apply (rule connected_component_maximal)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2693
        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
  2694
        done
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2695
      then show ?thesis
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2696
        using y1 apply (simp add: closure_approachable open_contains_ball_eq [OF open_interior])
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2697
        by (metis connected_component_eq dist_commute mem_Collect_eq mem_ball mem_interior subsetD \<open>0 < e\<close> y2)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2698
    qed
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2699
    then have "y \<notin> interior S"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2700
      using y2 by (force simp: open_contains_ball_eq [OF open_interior])
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2701
    ultimately have "y \<in> frontier S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2702
      by (auto simp: frontier_def)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2703
  }
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2704
  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
  2705
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62087
diff changeset
  2706
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2707
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
  2708
  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
  2709
  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
  2710
proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2711
  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
  2712
       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
  2713
          "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
  2714
  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
  2715
    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
  2716
      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
  2717
  next
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2718
    case False
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2719
    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
  2720
    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
  2721
      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
  2722
    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
  2723
       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
  2724
    then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2725
    proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2726
      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
  2727
        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
  2728
      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
  2729
        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
  2730
      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
  2731
        by linarith
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2732
      then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2733
        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
  2734
    qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2735
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2736
  then show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2737
    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
  2738
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2739
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  2740
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
  2741
  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
  2742
  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
  2743
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
  2744
   (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
  2745
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2746
lemma frontier_of_components_subset:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2747
  fixes S :: "'a::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2748
  shows "C \<in> components S \<Longrightarrow> frontier C \<subseteq> frontier S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2749
  by (metis Path_Connected.frontier_of_connected_component_subset components_iff)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2750
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2751
lemma frontier_of_components_closed_complement:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2752
  fixes S :: "'a::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2753
  shows "\<lbrakk>closed S; C \<in> components (- S)\<rbrakk> \<Longrightarrow> frontier C \<subseteq> S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2754
  using frontier_complement frontier_of_components_subset frontier_subset_eq by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2755
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2756
lemma frontier_minimal_separating_closed:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2757
  fixes S :: "'a::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2758
  assumes "closed S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2759
      and nconn: "~ connected(- S)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2760
      and C: "C \<in> components (- S)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2761
      and conn: "\<And>T. \<lbrakk>closed T; T \<subset> S\<rbrakk> \<Longrightarrow> connected(- T)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2762
    shows "frontier C = S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2763
proof (rule ccontr)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2764
  assume "frontier C \<noteq> S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2765
  then have "frontier C \<subset> S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2766
    using frontier_of_components_closed_complement [OF \<open>closed S\<close> C] by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2767
  then have "connected(- (frontier C))"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2768
    by (simp add: conn)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2769
  have "\<not> connected(- (frontier C))"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2770
    unfolding connected_def not_not
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2771
  proof (intro exI conjI)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2772
    show "open C"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2773
      using C \<open>closed S\<close> open_components by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2774
    show "open (- closure C)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2775
      by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2776
    show "C \<inter> - closure C \<inter> - frontier C = {}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2777
      using closure_subset by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2778
    show "C \<inter> - frontier C \<noteq> {}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2779
      using C \<open>open C\<close> components_eq frontier_disjoint_eq by fastforce
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2780
    show "- frontier C \<subseteq> C \<union> - closure C"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2781
      by (simp add: \<open>open C\<close> closed_Compl frontier_closures)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2782
    then show "- closure C \<inter> - frontier C \<noteq> {}"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2783
      by (metis (no_types, lifting) C Compl_subset_Compl_iff \<open>frontier C \<subset> S\<close> compl_sup frontier_closures in_components_subset psubsetE sup.absorb_iff2 sup.boundedE sup_bot.right_neutral sup_inf_absorb)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2784
  qed
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2785
  then show False
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2786
    using \<open>connected (- frontier C)\<close> by blast
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2787
qed
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  2788
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
  2789
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
  2790
    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
  2791
    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
  2792
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
  2793
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
  2794
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2795
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
  2796
    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
  2797
    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
  2798
  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
  2799
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2800
lemma components_UNIV [simp]: "components UNIV = {UNIV :: 'a::real_normed_vector 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
  2801
  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
  2802
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2803
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
  2804
    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
  2805
    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
  2806
      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
  2807
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2808
  { 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
  2809
    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
  2810
       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
  2811
    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
  2812
      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
  2813
      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
  2814
      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
  2815
      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
  2816
    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
  2817
      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
  2818
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2819
  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
  2820
    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
  2821
    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
  2822
    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
  2823
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2824
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2825
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2826
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
  2827
  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
  2828
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2829
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
  2830
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
  2831
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2832
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
  2833
   "\<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
  2834
  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
  2835
  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
  2836
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2837
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
  2838
   "\<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
  2839
  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
  2840
  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
  2841
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2842
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
  2843
  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
  2844
  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
  2845
    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
  2846
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
  2847
  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
  2848
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2849
  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
  2850
  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
  2851
  { 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
  2852
    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
  2853
      by (metis mem_Collect_eq)
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  2854
    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
  2855
    have "C > 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2856
      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
  2857
    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
  2858
      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
  2859
    moreover have "norm (C *\<^sub>R (z-a)) > norm z + B"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2860
      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
  2861
    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
  2862
    { 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
  2863
      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
  2864
      then have Cpos: "1 + u * C > 0"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2865
        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
  2866
      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
  2867
        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
  2868
      then have False
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  2869
        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
  2870
        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
  2871
    } 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
  2872
    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
  2873
      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
  2874
      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
  2875
      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
  2876
      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
  2877
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2878
    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
  2879
      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
  2880
      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
  2881
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2882
  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
  2883
    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
  2884
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2885
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2886
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
  2887
  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
  2888
  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
  2889
    shows "outside s = - s"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  2890
  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
  2891
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2892
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
  2893
  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
  2894
  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
  2895
  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
  2896
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2897
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
  2898
  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
  2899
  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
  2900
  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
  2901
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2902
lemma outside_Un_outside_Un:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2903
  fixes S :: "'a::real_normed_vector set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2904
  assumes "S \<inter> outside(T \<union> U) = {}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2905
  shows "outside(T \<union> U) \<subseteq> outside(T \<union> S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2906
proof
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2907
  fix x
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2908
  assume x: "x \<in> outside (T \<union> U)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2909
  have "Y \<subseteq> - S" if "connected Y" "Y \<subseteq> - T" "Y \<subseteq> - U" "x \<in> Y" "u \<in> Y" for u Y
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2910
  proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2911
    have "Y \<subseteq> connected_component_set (- (T \<union> U)) x"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2912
      by (simp add: connected_component_maximal that)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2913
    also have "... \<subseteq> outside(T \<union> U)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2914
      by (metis (mono_tags, lifting) Collect_mono mem_Collect_eq outside outside_same_component x)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2915
    finally have "Y \<subseteq> outside(T \<union> U)" .
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2916
    with assms show ?thesis by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2917
  qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2918
  with x show "x \<in> outside (T \<union> S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2919
    by (simp add: outside_connected_component_lt connected_component_def) meson
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2920
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  2921
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2922
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
  2923
    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
  2924
    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
  2925
    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
  2926
  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
  2927
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2928
  { 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
  2929
    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
  2930
      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
  2931
    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
  2932
      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
  2933
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2934
  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
  2935
    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
  2936
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2937
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2938
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
  2939
  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
  2940
    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
  2941
      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
  2942
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
  2943
          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
  2944
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2945
lemma inside_frontier_eq_interior:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2946
     fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2947
     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
  2948
  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
  2949
  using closure_subset interior_subset
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2950
  apply (auto simp add: frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2951
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2952
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2953
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
  2954
    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
  2955
    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
  2956
      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
  2957
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2958
  { 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
  2959
    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
  2960
      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
  2961
    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
  2962
      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
  2963
      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
  2964
      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
  2965
    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
  2966
      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
  2967
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2968
  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
  2969
    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
  2970
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2971
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2972
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
  2973
    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
  2974
    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
  2975
      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
  2976
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2977
  { 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
  2978
    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
  2979
      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
  2980
    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
  2981
      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
  2982
      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
  2983
      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
  2984
    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
  2985
      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
  2986
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2987
  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
  2988
    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
  2989
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2990
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2991
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
  2992
    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
  2993
    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
  2994
      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
  2995
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
  2996
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2997
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
  2998
    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
  2999
    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
  3000
      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
  3001
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  3002
  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
  3003
    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
  3004
  moreover have "- inside s \<inter> - outside s = s"
63955
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  3005
    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
  3006
  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
  3007
    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
  3008
  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
  3009
    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
  3010
  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
  3011
    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
  3012
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  3013
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3014
lemma closure_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3015
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3016
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3017
      shows "closure(outside s) \<subseteq> s \<union> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3018
  apply (rule closure_minimal, simp)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3019
  by (metis assms closed_open inside_outside open_inside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3020
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3021
lemma frontier_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3022
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3023
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3024
      shows "frontier(outside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3025
  apply (simp add: frontier_def open_outside interior_open)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3026
  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
  3027
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3028
lemma inside_complement_unbounded_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3029
     "\<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
  3030
  apply (simp add: inside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3031
  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
  3032
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3033
lemma inside_bounded_complement_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3034
    fixes s :: "'a::{real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3035
    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
  3036
  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
  3037
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3038
lemma inside_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3039
    assumes "s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3040
    shows "inside s - t \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3041
unfolding inside_def
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3042
proof clarify
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3043
  fix x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3044
  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
  3045
  show "bounded (connected_component_set (- t) x)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3046
  proof (cases "s \<inter> connected_component_set (- t) x = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3047
    case True show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3048
      apply (rule bounded_subset [OF bo])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3049
      apply (rule connected_component_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3050
      using x True apply auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3051
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3052
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3053
    case False then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3054
      using assms [unfolded inside_def] x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3055
      apply (simp add: disjoint_iff_not_equal, clarify)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3056
      apply (drule subsetD, assumption, auto)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3057
      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
  3058
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3059
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3060
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3061
lemma inside_inside_subset: "inside(inside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3062
  using inside_inside union_with_outside by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3063
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3064
lemma inside_outside_intersect_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3065
      "\<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
  3066
  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
  3067
  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
  3068
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3069
lemma outside_bounded_nonempty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3070
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3071
    assumes "bounded s" shows "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3072
  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
  3073
                   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
  3074
                   double_complement order_refl outside_convex outside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3075
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3076
lemma outside_compact_in_open:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3077
    fixes s :: "'a :: {real_normed_vector,perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3078
    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
  3079
      shows "outside s \<inter> t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3080
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3081
  have "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3082
    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
  3083
  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
  3084
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3085
  proof (cases "a \<in> t")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3086
    case True with a show ?thesis by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3087
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3088
    case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3089
      have front: "frontier t \<subseteq> - s"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3090
        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
  3091
      { fix \<gamma>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3092
        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
  3093
           and pf: "pathfinish \<gamma> \<in> frontier t" and ps: "pathstart \<gamma> = a"
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3094
        define c where "c = pathfinish \<gamma>"
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3095
        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
  3096
        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
  3097
        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
  3098
          using open_contains_cball[of "-s"] s by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3099
        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
  3100
          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
  3101
          by (metis Diff_iff frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3102
        then have "d \<in> -s" using \<epsilon>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3103
          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
  3104
        have pimg_sbs_cos: "path_image \<gamma> \<subseteq> -s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3105
          using pimg_sbs apply (auto simp: path_image_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3106
          apply (drule subsetD)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3107
          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
  3108
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3109
        have "closed_segment c d \<le> cball c \<epsilon>"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3110
          apply (simp add: segment_convex_hull)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3111
          apply (rule hull_minimal)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3112
          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
  3113
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3114
        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
  3115
        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
  3116
          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
  3117
        ultimately have "connected_component (- s) a d"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3118
          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
  3119
        then have "outside s \<inter> t \<noteq> {}"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3120
          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
  3121
      } note * = this
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3122
      have pal: "pathstart (linepath a b) \<in> closure (- t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3123
        by (auto simp: False closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3124
      show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3125
        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
  3126
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3127
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3128
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3129
lemma inside_inside_compact_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3130
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3131
    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
  3132
      shows "inside s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3133
proof (cases "inside t = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3134
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3135
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3136
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3137
  consider "DIM('a) = 1" | "DIM('a) \<ge> 2"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3138
    using antisym not_less_eq_eq by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3139
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3140
  proof cases
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3141
    case 1 then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3142
             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
  3143
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3144
    case 2
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3145
    have coms: "compact s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3146
      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
  3147
       by (meson bounded_inside bounded_subset compact_imp_bounded)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3148
    then have bst: "bounded (s \<union> t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3149
      by (simp add: compact_imp_bounded t)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3150
    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
  3151
      using bounded_subset_ballD by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3152
    have outst: "outside s \<inter> outside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3153
    proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3154
      have "- ball 0 r \<subseteq> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3155
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3156
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3157
      moreover have "- ball 0 r \<subseteq> outside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3158
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3159
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3160
      ultimately show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3161
        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
  3162
    qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3163
    have "s \<inter> t = {}" using assms
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3164
      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
  3165
    moreover have "outside s \<inter> inside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3166
      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
  3167
    ultimately have "inside s \<inter> t = {}"
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3168
      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
  3169
      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
  3170
    then show ?thesis
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
  3171
      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
  3172
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3173
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3174
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3175
lemma connected_with_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3176
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3177
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3178
      shows "connected(s \<union> inside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3179
proof (cases "s \<union> inside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3180
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3181
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3182
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3183
  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
  3184
  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
  3185
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3186
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3187
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3188
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3189
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3190
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3191
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3192
    assume a: "a \<in> inside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3193
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3194
      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
  3195
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3196
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3197
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3198
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3199
      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
  3200
      using frontier_inside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3201
      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
  3202
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3203
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3204
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3205
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3206
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3207
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3208
    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
  3209
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3210
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3211
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3212
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3213
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
  3214
lemma connected_with_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3215
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3216
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3217
      shows "connected(s \<union> outside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3218
proof (cases "s \<union> outside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3219
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3220
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3221
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3222
  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
  3223
  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
  3224
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3225
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3226
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3227
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3228
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3229
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3230
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3231
    assume a: "a \<in> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3232
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3233
      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
  3234
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3235
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3236
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3237
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3238
      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
  3239
      using frontier_outside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3240
      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
  3241
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3242
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3243
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3244
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3245
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3246
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3247
    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
  3248
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3249
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3250
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3251
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3252
lemma inside_inside_eq_empty [simp]:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3253
    fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3254
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3255
      shows "inside (inside s) = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3256
  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
  3257
           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
  3258
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3259
lemma inside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3260
     "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
  3261
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3262
  apply (auto intro: inside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3263
  apply (metis IntI empty_iff inside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3264
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3265
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3266
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
  3267
lemma outside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3268
     "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
  3269
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3270
  apply (auto intro: outside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3271
  apply (metis IntI empty_iff outside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3272
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3273
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3274
lemma bounded_unique_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3275
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3276
    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
  3277
  apply (rule iffI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  3278
  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
  3279
  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
  3280
62533
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3281
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
  3282
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3283
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
  3284
  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
  3285
  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
  3286
      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
  3287
      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
  3288
      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
  3289
    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
  3290
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
  3291
  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
  3292
next
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3293
  case False
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3294
    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
  3295
               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
  3296
      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
  3297
      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
  3298
    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
  3299
      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
  3300
    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
  3301
    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
  3302
      by metis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3303
    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
  3304
      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
  3305
      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
  3306
      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
  3307
      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
  3308
      done
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3309
    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
  3310
      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
  3311
    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
  3312
    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
  3313
      using fz by auto
63540
f8652d0534fa tuned proofs -- avoid unstructured calculation;
wenzelm
parents: 63469
diff changeset
  3314
    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
  3315
      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
  3316
    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
  3317
    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
  3318
      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
  3319
      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
  3320
      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
  3321
    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
  3322
              \<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
  3323
              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
  3324
      by blast
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3325
    show ?thesis
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3326
      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
  3327
      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
  3328
      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
  3329
      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
  3330
      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
  3331
qed
bc25f3916a99 new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents: 62398
diff changeset
  3332
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
  3333
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
  3334
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3335
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
  3336
  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
  3337
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
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
  3339
  "[('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
  3340
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
  3341
 "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
  3342
   (\<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
  3343
       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
  3344
       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
  3345
       (\<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
  3346
       (\<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
  3347
       (\<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
  3348
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
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
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
  3351
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
  3352
  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
  3353
  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
  3354
  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
  3355
           (\<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
  3356
              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
  3357
              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
  3358
              (\<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
  3359
              (\<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
  3360
              (\<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
  3361
  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
  3362
  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
  3363
  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
  3364
  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
  3365
  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
  3366
  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
  3367
  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
  3368
  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
  3369
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
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
  3371
   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
  3372
       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
  3373
       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
  3374
       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
  3375
   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
  3376
  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
  3377
  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
  3378
  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
  3379
  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
  3380
  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
  3381
  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
  3382
  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
  3383
  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
  3384
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
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
  3386
   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
  3387
       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
  3388
       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
  3389
   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
  3390
  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
  3391
  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
  3392
  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
  3393
  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
  3394
  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
  3395
  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
  3396
  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
  3397
  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
  3398
  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
  3399
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
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
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
  3402
  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
  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
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
  3405
   "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
  3406
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
  3407
  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
  3408
    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
  3409
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
  3410
  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
  3411
  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
  3412
  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
  3413
  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
  3414
    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
  3415
    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
  3416
        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
  3417
          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
  3418
      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
  3419
    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
  3420
      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
  3421
      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
  3422
      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
  3423
    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
  3424
      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
  3425
      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
  3426
      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
  3427
      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
  3428
      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
  3429
  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
  3430
    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
  3431
    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
  3432
      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
  3433
      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
  3434
      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
  3435
      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
  3436
  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
  3437
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
  3438
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
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
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
  3441
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3442
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
  3443
  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
  3444
  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
  3445
  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
  3446
  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
  3447
  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
  3448
  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
  3449
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
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
  3451
  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
  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
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
  3454
    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
  3455
    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
  3456
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
  3457
  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
  3458
    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
  3459
      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
  3460
    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
  3461
  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
  3462
    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
  3463
  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
  3464
    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
  3465
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
  3466
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
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
  3468
     "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
  3469
  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
  3470
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
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
  3472
     "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
  3473
  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
  3474
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
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
  3476
    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
  3477
        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
  3478
      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
  3479
  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
  3480
  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
  3481
  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
  3482
  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
  3483
  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
  3484
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
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
  3486
     "\<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
  3487
  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
  3488
  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
  3489
  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
  3490
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
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
  3492
     "\<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
  3493
  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
  3494
  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
  3495
  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
  3496
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
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
  3498
    "\<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
  3499
     \<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
  3500
  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
  3501
  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
  3502
  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
  3503
  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
  3504
  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
  3505
  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
  3506
  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
  3507
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
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
  3509
     "\<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
  3510
      \<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
  3511
  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
  3512
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
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
  3514
     "\<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
  3515
      \<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
  3516
  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
  3517
  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
  3518
  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
  3519
  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
  3520
  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
  3521
  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
  3522
  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
  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
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
  3525
   "\<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
  3526
     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
  3527
    \<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
  3528
  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
  3529
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
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
  3531
   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
  3532
       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
  3533
     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
  3534
                  (\<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
  3535
  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
  3536
  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
  3537
  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
  3538
  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
  3539
  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
  3540
  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
  3541
  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
  3542
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
  3543
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
  3544
  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
  3545
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
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
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
  3548
     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
  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
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
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
  3552
   "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
  3553
  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
  3554
  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
  3555
  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
  3556
  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
  3557
  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
  3558
  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
  3559
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3560
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
  3561
  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
  3562
    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
  3563
      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
  3564
  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
  3565
  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
  3566
  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
  3567
  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
  3568
  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
  3569
  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
  3570
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3571
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
  3572
    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
  3573
    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
  3574
  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
  3575
61699
a81dc5c4d6a9 New theorems mostly from Peter Gammie
paulson <lp15@cam.ac.uk>
parents: 61694
diff changeset
  3576
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
  3577
  by force
a81dc5c4d6a9 New theorems mostly from Peter Gammie
paulson <lp15@cam.ac.uk>
parents: 61694
diff changeset
  3578
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
  3579
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
  3580
  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
  3581
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3582
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
  3583
    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
  3584
    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
  3585
      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
  3586
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
  3587
  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
  3588
    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
  3589
    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
  3590
    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
  3591
    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
  3592
  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
  3593
    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
  3594
    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
  3595
    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
  3596
    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
  3597
  { 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
  3598
    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
  3599
       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
  3600
       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
  3601
       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
  3602
       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
  3603
    define k where "k y =
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3604
      (if fst y \<le> 1 / 2
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3605
       then (k1 o (\<lambda>x. (2 *\<^sub>R fst x, snd x))) y
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 63016
diff changeset
  3606
       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
  3607
    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
  3608
      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
  3609
    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
  3610
      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
  3611
      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
  3612
      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
  3613
      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
  3614
      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
  3615
    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
  3616
      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
  3617
    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
  3618
      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
  3619
    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
  3620
      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
  3621
    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
  3622
      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
  3623
      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
  3624
      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
  3625
      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
  3626
      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
  3627
    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
  3628
                       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
  3629
                       (\<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
  3630
      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
  3631
  } 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
  3632
  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
  3633
    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
  3634
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
  3635
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3636
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
  3637
      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
  3638
      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
  3639
             \<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
  3640
  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
  3641
  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
  3642
  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
  3643
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3644
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3645
text\<open>Homotopic triviality implicitly incorporates path-connectedness.\<close>
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3646
lemma homotopic_triviality:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3647
  fixes S :: "'a::real_normed_vector set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3648
  shows  "(\<forall>f g. continuous_on S f \<and> f ` S \<subseteq> T \<and>
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3649
                 continuous_on S g \<and> g ` S \<subseteq> T
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3650
                 \<longrightarrow> homotopic_with (\<lambda>x. True) S T f g) \<longleftrightarrow>
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3651
          (S = {} \<or> path_connected T) \<and>
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3652
          (\<forall>f. continuous_on S f \<and> f ` S \<subseteq> T \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)))"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3653
          (is "?lhs = ?rhs")
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3654
proof (cases "S = {} \<or> T = {}")
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3655
  case True then show ?thesis by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3656
next
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3657
  case False show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3658
  proof
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3659
    assume LHS [rule_format]: ?lhs
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3660
    have pab: "path_component T a b" if "a \<in> T" "b \<in> T" for a b
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3661
    proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3662
      have "homotopic_with (\<lambda>x. True) S T (\<lambda>x. a) (\<lambda>x. b)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3663
        by (simp add: LHS continuous_on_const image_subset_iff that)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3664
      then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3665
        using False homotopic_constant_maps by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3666
    qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3667
      moreover
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3668
    have "\<exists>c. homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)" if "continuous_on S f" "f ` S \<subseteq> T" for f
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3669
      by (metis (full_types) False LHS equals0I homotopic_constant_maps homotopic_with_imp_continuous homotopic_with_imp_subset2 pab that)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3670
    ultimately show ?rhs
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3671
      by (simp add: path_connected_component)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3672
  next
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3673
    assume RHS: ?rhs
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3674
    with False have T: "path_connected T"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3675
      by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3676
    show ?lhs
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3677
    proof clarify
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3678
      fix f g
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3679
      assume "continuous_on S f" "f ` S \<subseteq> T" "continuous_on S g" "g ` S \<subseteq> T"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3680
      obtain c d where c: "homotopic_with (\<lambda>x. True) S T f (\<lambda>x. c)" and d: "homotopic_with (\<lambda>x. True) S T g (\<lambda>x. d)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3681
        using False \<open>continuous_on S f\<close> \<open>f ` S \<subseteq> T\<close>  RHS \<open>continuous_on S g\<close> \<open>g ` S \<subseteq> T\<close> by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3682
      then have "c \<in> T" "d \<in> T"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3683
        using False homotopic_with_imp_subset2 by fastforce+
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3684
      with T have "path_component T c d"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3685
        using path_connected_component by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3686
      then have "homotopic_with (\<lambda>x. True) S T (\<lambda>x. c) (\<lambda>x. d)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3687
        by (simp add: homotopic_constant_maps)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3688
      with c d show "homotopic_with (\<lambda>x. True) S T f g"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3689
        by (meson homotopic_with_symD homotopic_with_trans)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3690
    qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3691
  qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3692
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3693
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  3694
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
  3695
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
  3696
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3697
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3698
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
  3699
  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
  3700
     "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
  3701
       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
  3702
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3703
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
  3704
   "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
  3705
      (\<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
  3706
          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
  3707
          (\<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
  3708
          (\<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
  3709
          (\<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
  3710
                        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
  3711
  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
  3712
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3713
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
  3714
     "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
  3715
  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
  3716
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3717
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
  3718
     "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
  3719
  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
  3720
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3721
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
  3722
     "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
  3723
  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
  3724
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3725
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
  3726
     "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
  3727
  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
  3728
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3729
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
  3730
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
  3731
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
  3732
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
  3733
  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
  3734
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
  3735
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
  3736
  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
  3737
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
  3738
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
  3739
     "\<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
  3740
  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
  3741
  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
  3742
  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
  3743
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3744
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
  3745
     "\<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
  3746
  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
  3747
  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
  3748
  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
  3749
  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
  3750
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3751
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
  3752
  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
  3753
      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
  3754
      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
  3755
      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
  3756
      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
  3757
      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
  3758
    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
  3759
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
  3760
  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
  3761
    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
  3762
  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
  3763
    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
  3764
  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
  3765
    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
  3766
  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
  3767
    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
  3768
  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
  3769
    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
  3770
  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
  3771
    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
  3772
  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
  3773
  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
  3774
    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
  3775
      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
  3776
  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
  3777
    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
  3778
      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
  3779
      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
  3780
      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
  3781
      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
  3782
      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
  3783
      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
  3784
  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
  3785
  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
  3786
    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
  3787
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
  3788
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3789
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
  3790
  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
  3791
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3792
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3793
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
  3794
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
  3795
  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
  3796
  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
  3797
      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
  3798
      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
  3799
    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
  3800
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
  3801
  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
  3802
    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
  3803
  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
  3804
    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
  3805
  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
  3806
    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
  3807
    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
  3808
    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
  3809
    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
  3810
    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
  3811
    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
  3812
    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
  3813
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
  3814
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3815
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
  3816
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3817
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
  3818
      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
  3819
      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
  3820
  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
  3821
  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
  3822
  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
  3823
  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
  3824
  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
  3825
  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
  3826
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3827
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
  3828
     "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
  3829
  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
  3830
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3831
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3832
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
  3833
    "\<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
  3834
  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
  3835
  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
  3836
  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
  3837
  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
  3838
  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
  3839
  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
  3840
6571c78c9667 Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents: 61518
diff changeset
  3841
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
  3842
    "\<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
  3843
  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
  3844
  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
  3845
  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
  3846
  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
  3847
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3848
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
  3849
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3850
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
  3851
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3852
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
  3853
    "\<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
  3854
  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
  3855
  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
  3856
  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
  3857
  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
  3858
  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
  3859
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3860
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3861
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
  3862
   "\<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
  3863
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
  3864
  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
  3865
        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
  3866
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3867
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
  3868
   "\<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
  3869
     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
  3870
    \<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
  3871
  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
  3872
  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
  3873
           [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
  3874
                           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
  3875
                           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
  3876
  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
  3877
  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
  3878
  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
  3879
  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
  3880
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3881
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3882
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
  3883
  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
  3884
    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
  3885
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3886
  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
  3887
    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
  3888
    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
  3889
    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
  3890
    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
  3891
    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
  3892
    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
  3893
    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
  3894
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3895
  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
  3896
    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
  3897
    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
  3898
    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
  3899
    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
  3900
    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
  3901
    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
  3902
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3903
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3904
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3905
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
  3906
  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
  3907
    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
  3908
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
  3909
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3910
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3911
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
  3912
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3913
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
  3914
 "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
  3915
     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
  3916
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3917
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
  3918
   "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
  3919
      (\<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
  3920
          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
  3921
          (\<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
  3922
          (\<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
  3923
          (\<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
  3924
  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
  3925
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3926
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
  3927
     "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
  3928
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
  3929
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3930
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
  3931
     "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
  3932
  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
  3933
  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
  3934
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
  3935
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
  3936
     "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
  3937
  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
  3938
  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
  3939
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3940
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
  3941
     "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
  3942
      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
  3943
  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
  3944
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
  3945
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
  3946
  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
  3947
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
  3948
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
  3949
  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
  3950
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3951
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
  3952
   "\<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
  3953
  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
  3954
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3955
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
  3956
   "\<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
  3957
  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
  3958
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3959
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
  3960
   "\<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
  3961
          \<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
  3962
  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
  3963
  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
  3964
  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
  3965
  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
  3966
  done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3967
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3968
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
  3969
   "\<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
  3970
  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
  3971
  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
  3972
  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
  3973
  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
  3974
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3975
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3976
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
  3977
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3978
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
  3979
    "\<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
  3980
  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
  3981
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3982
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
  3983
  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
  3984
    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
  3985
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  3986
  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
  3987
  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
  3988
  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
  3989
  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
  3990
             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
  3991
             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
  3992
             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
  3993
             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
  3994
    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
  3995
  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
  3996
    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
  3997
    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
  3998
    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
  3999
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4000
  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
  4001
    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
  4002
  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
  4003
    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
  4004
    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
  4005
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4006
  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
  4007
    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
  4008
    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
  4009
    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
  4010
    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
  4011
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4012
  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
  4013
    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
  4014
  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
  4015
  proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4016
    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
  4017
    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
  4018
  qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4019
  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
  4020
                  (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
  4021
                  (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
  4022
                   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
  4023
                  \<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
  4024
    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
  4025
              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
  4026
  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
  4027
    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
  4028
  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
  4029
                                   (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
  4030
    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
  4031
    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
  4032
    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
  4033
  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
  4034
                                   ((\<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
  4035
    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
  4036
    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
  4037
    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
  4038
    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
  4039
    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
  4040
    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
  4041
    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
  4042
    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
  4043
  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
  4044
                                   (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
  4045
    apply (rule *)
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4046
    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
  4047
    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
  4048
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4049
  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
  4050
    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
  4051
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4052
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4053
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
  4054
  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
  4055
  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
  4056
      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
  4057
    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
  4058
proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4059
  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
  4060
  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
  4061
  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
  4062
    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
  4063
    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
  4064
    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
  4065
    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
  4066
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4067
  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
  4068
    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
  4069
    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
  4070
    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
  4071
    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
  4072
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4073
  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
  4074
    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
  4075
    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
  4076
  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
  4077
    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
  4078
    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
  4079
    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
  4080
    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
  4081
              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
  4082
  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
  4083
    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
  4084
  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
  4085
                          (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
  4086
    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
  4087
    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
  4088
    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
  4089
    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
  4090
    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
  4091
    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
  4092
    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
  4093
    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
  4094
    done
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4095
  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
  4096
  proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4097
    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
  4098
      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
  4099
    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
  4100
      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
  4101
    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
  4102
    proof -
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4103
      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
  4104
        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
  4105
      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
  4106
        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
  4107
                  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
  4108
    qed
61711
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4109
    thus ?thesis
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4110
      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
  4111
  qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4112
  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
  4113
    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
  4114
qed
21d7910d6816 Theory of homotopic paths (from HOL Light), plus comments and minor refinements
paulson <lp15@cam.ac.uk>
parents: 61699
diff changeset
  4115
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
  4116
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
  4117
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
  4118
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
  4119
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
  4120
  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
  4121
  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
  4122
      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
  4123
      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
  4124
    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
  4125
  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
  4126
  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
  4127
  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
  4128
  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
  4129
                                            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
  4130
  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
  4131
  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
  4132
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
  4133
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
  4134
  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
  4135
  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
  4136
          "\<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
  4137
    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
  4138
  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
  4139
  unfolding path_def
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4140
  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
  4141
  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
  4142
  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
  4143
  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
  4144
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
  4145
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
  4146
  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
  4147
  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
  4148
          "\<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
  4149
    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
  4150
  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
  4151
  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
  4152
  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
  4153
  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
  4154
  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
  4155
  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
  4156
  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
  4157
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
  4158
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
  4159
  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
  4160
      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
  4161
    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
  4162
  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
  4163
  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
  4164
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
  4165
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
  4166
  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
  4167
      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
  4168
    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
  4169
  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
  4170
  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
  4171
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
  4172
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
  4173
  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
  4174
  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
  4175
    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
  4176
               (\<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
  4177
                    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
  4178
                    (\<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
  4179
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
  4180
  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
  4181
    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
  4182
  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
  4183
    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
  4184
    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
  4185
    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
  4186
    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
  4187
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
  4188
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
  4189
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
  4190
  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
  4191
  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
  4192
    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
  4193
               (\<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
  4194
                    (\<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
  4195
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
  4196
  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
  4197
    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
  4198
  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
  4199
    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
  4200
    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
  4201
    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
  4202
    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
  4203
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
  4204
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
  4205
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
  4206
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
  4207
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
  4208
  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
  4209
      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
  4210
    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
  4211
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
  4212
  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
  4213
    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
  4214
  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
  4215
    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
  4216
  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
  4217
  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
  4218
    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
  4219
    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
  4220
    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
  4221
    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
  4222
    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
  4223
      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
  4224
      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
  4225
             [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
  4226
                             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
  4227
                             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
  4228
      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
  4229
      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
  4230
      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
  4231
      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
  4232
      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
  4233
      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
  4234
      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
  4235
      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
  4236
      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
  4237
      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
  4238
      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
  4239
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
  4240
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
  4241
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
  4242
  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
  4243
    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
  4244
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
  4245
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
  4246
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
  4247
  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
  4248
      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
  4249
      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
  4250
    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
  4251
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
  4252
  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
  4253
    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
  4254
    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
  4255
    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
  4256
    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
  4257
    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
  4258
  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
  4259
    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
  4260
    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
  4261
  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
  4262
                               (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
  4263
    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
  4264
    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
  4265
    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
  4266
    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
  4267
    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
  4268
  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
  4269
    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
  4270
    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
  4271
    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
  4272
    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
  4273
  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
  4274
  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
  4275
    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
  4276
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
  4277
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
  4278
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
  4279
   "\<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
  4280
    \<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
  4281
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
  4282
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
  4283
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4284
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
  4285
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4286
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
  4287
    "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
  4288
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
  4289
                 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
  4290
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
  4291
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
  4292
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
  4293
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4294
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4295
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
  4296
   "\<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
  4297
        \<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
  4298
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
  4299
                 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
  4300
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
  4301
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
  4302
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
  4303
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4304
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4305
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
  4306
   "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
  4307
        path_component S a b"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4308
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
  4309
         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
  4310
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4311
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
  4312
    "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
  4313
      (\<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
  4314
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
  4315
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4316
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4317
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
  4318
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4319
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
  4320
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4321
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
  4322
  "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
  4323
        \<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
  4324
              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
  4325
              \<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
  4326
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4327
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
  4328
  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
  4329
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4330
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
  4331
  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
  4332
  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
  4333
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
  4334
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4335
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
  4336
  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
  4337
  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
  4338
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
  4339
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4340
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
  4341
  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
  4342
  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
  4343
            (\<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
  4344
                  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
  4345
                  \<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
  4346
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
  4347
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
  4348
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
  4349
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
  4350
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
  4351
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4352
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4353
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
  4354
  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
  4355
  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
  4356
                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
  4357
                (\<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
  4358
                    \<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
  4359
apply (rule iffI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4360
 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
  4361
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
  4362
apply (drule_tac x=p in spec)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4363
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
  4364
  apply blast
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4365
done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4366
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4367
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
  4368
  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
  4369
  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
  4370
         S = {} \<or>
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4371
         (\<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
  4372
                \<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
  4373
        (is "?lhs = ?rhs")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4374
proof (cases "S = {}")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4375
  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
  4376
next
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4377
  case False
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4378
  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
  4379
  show ?thesis
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4380
  proof
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4381
    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
  4382
    then show ?rhs
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4383
      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
  4384
      by blast
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4385
  next
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4386
    assume ?rhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4387
    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
  4388
      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
  4389
      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
  4390
             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
  4391
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4392
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4393
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4394
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
  4395
  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
  4396
  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
  4397
           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
  4398
           (\<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
  4399
            \<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
  4400
apply (rule iffI)
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4401
 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
  4402
 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
  4403
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
  4404
         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
  4405
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4406
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
  4407
  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
  4408
  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
  4409
          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
  4410
          (\<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
  4411
                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
  4412
                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
  4413
                \<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
  4414
         (is "?lhs = ?rhs")
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4415
proof
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4416
  assume ?lhs
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4417
  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
  4418
        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
  4419
                       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
  4420
                      \<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
  4421
    by (auto simp: simply_connected_eq_contractible_path)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4422
  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
  4423
        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
  4424
           "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
  4425
           "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
  4426
  proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4427
    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
  4428
      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
  4429
    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
  4430
                                 (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
  4431
      using that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4432
      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
  4433
    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
  4434
                                 ((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
  4435
      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
  4436
    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
  4437
                                 (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
  4438
      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
  4439
      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
  4440
    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
  4441
      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
  4442
    finally show ?thesis .
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4443
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4444
  then show ?rhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4445
    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
  4446
next
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4447
  assume ?rhs
62620
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4448
  then show ?lhs
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4449
    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
  4450
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4451
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4452
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
  4453
  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
  4454
  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
  4455
    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
  4456
proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4457
  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
  4458
       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
  4459
       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
  4460
  proof -
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4461
    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
  4462
      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
  4463
      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
  4464
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4465
    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
  4466
      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
  4467
    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
  4468
      using S that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4469
      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
  4470
      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
  4471
      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
  4472
      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
  4473
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4474
    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
  4475
      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
  4476
      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
  4477
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4478
    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
  4479
      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
  4480
    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
  4481
      using T that
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4482
      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
  4483
      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
  4484
      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
  4485
      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
  4486
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4487
    show ?thesis
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4488
      using p1 p2
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4489
      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
  4490
      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
  4491
      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
  4492
      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
  4493
      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
  4494
      done
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4495
  qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4496
  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
  4497
    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
  4498
qed
d21dab28b3f9 New results about paths, segments, etc. The notion of simply_connected.
paulson <lp15@cam.ac.uk>
parents: 62618
diff changeset
  4499
64394
141e1ed8d5a0 more new material
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
  4500
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4501
subsection\<open>Contractible sets\<close>
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4502
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4503
definition contractible where
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4504
 "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
  4505
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4506
proposition contractible_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4507
  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
  4508
  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
  4509
proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4510
  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
  4511
next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4512
  case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4513
  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
  4514
    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
  4515
  then have "a \<in> S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4516
    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
  4517
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4518
    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
  4519
    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
  4520
    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
  4521
    apply clarify
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4522
    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
  4523
    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
  4524
    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
  4525
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4526
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4527
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4528
corollary contractible_imp_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4529
  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
  4530
  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
  4531
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
  4532
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4533
lemma contractible_imp_path_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4534
  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
  4535
  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
  4536
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
  4537
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4538
lemma nullhomotopic_through_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4539
  fixes S :: "_::topological_space set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4540
  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
  4541
      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
  4542
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4543
    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
  4544
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4545
  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
  4546
    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
  4547
  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
  4548
    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
  4549
  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
  4550
    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
  4551
  then show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4552
    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
  4553
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4554
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4555
lemma nullhomotopic_into_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4556
  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
  4557
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4558
    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
  4559
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
  4560
using assms
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4561
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
  4562
done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4563
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4564
lemma nullhomotopic_from_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4565
  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
  4566
      and S: "contractible S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4567
    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
  4568
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
  4569
using assms
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4570
apply (auto simp: comp_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4571
done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4572
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4573
lemma homotopic_through_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4574
  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
  4575
  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
  4576
          "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
  4577
          "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
  4578
          "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
  4579
          "contractible T" "path_connected U"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4580
   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
  4581
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4582
  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
  4583
    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
  4584
    using assms apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4585
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4586
  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
  4587
    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
  4588
    using assms apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4589
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4590
  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
  4591
  proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4592
    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
  4593
  next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4594
    case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4595
    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
  4596
      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
  4597
    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
  4598
  qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4599
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4600
    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
  4601
    apply (rule homotopic_with_symD)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4602
    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
  4603
    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
  4604
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4605
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4606
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4607
lemma homotopic_into_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4608
  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
  4609
  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
  4610
      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
  4611
      and T: "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4612
    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
  4613
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
  4614
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
  4615
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4616
lemma homotopic_from_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4617
  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
  4618
  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
  4619
      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
  4620
      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
  4621
    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
  4622
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
  4623
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
  4624
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4625
lemma starlike_imp_contractible_gen:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4626
  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
  4627
  assumes S: "starlike S"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4628
      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
  4629
    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
  4630
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4631
  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
  4632
    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
  4633
  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
  4634
    apply clarify
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4635
    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
  4636
    apply (simp add: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4637
    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
  4638
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4639
  then show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4640
    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
  4641
    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
  4642
    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
  4643
    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
  4644
    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
  4645
    apply (simp_all add: P)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4646
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4647
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4648
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4649
lemma starlike_imp_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4650
  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
  4651
  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
  4652
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
  4653
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4654
lemma contractible_UNIV [simp]: "contractible (UNIV :: 'a::real_normed_vector set)"
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4655
  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
  4656
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4657
lemma starlike_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4658
  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
  4659
  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
  4660
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
  4661
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4662
lemma convex_imp_simply_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4663
  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
  4664
  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
  4665
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
  4666
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4667
lemma starlike_imp_path_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4668
  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
  4669
  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
  4670
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
  4671
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4672
lemma starlike_imp_connected:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4673
  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
  4674
  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
  4675
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
  4676
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4677
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
  4678
  fixes S :: "real set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4679
  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
  4680
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
  4681
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4682
lemma contractible_empty [simp]: "contractible {}"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4683
  by (simp add: contractible_def homotopic_with)
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4684
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4685
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
  4686
  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
  4687
  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
  4688
  shows "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4689
proof (cases "S = {}")
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4690
  case True
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4691
  with assms show ?thesis
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4692
    by (simp add: subsetCE)
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4693
next
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4694
  case False
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4695
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4696
    apply (rule starlike_imp_contractible)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4697
    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
  4698
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4699
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4700
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4701
lemma convex_imp_contractible:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4702
  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
  4703
  shows "convex S \<Longrightarrow> contractible S"
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4704
  using contractible_empty convex_imp_starlike starlike_imp_contractible by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4705
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4706
lemma contractible_sing [simp]:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4707
  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
  4708
  shows "contractible {a}"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4709
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
  4710
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4711
lemma is_interval_contractible_1:
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4712
  fixes S :: "real set"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4713
  shows  "is_interval S \<longleftrightarrow> contractible S"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4714
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
  4715
      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
  4716
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  4717
lemma contractible_Times:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4718
  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
  4719
  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
  4720
  shows "contractible (S \<times> T)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4721
proof -
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4722
  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
  4723
             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
  4724
             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
  4725
             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
  4726
    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
  4727
  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
  4728
             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
  4729
             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
  4730
             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
  4731
    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
  4732
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4733
    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
  4734
    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
  4735
    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
  4736
    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
  4737
    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
  4738
    using hsub ksub
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4739
    apply (auto simp: )
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4740
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4741
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4742
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4743
lemma homotopy_dominated_contractibility:
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4744
  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
  4745
  assumes S: "contractible S"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63540
diff changeset
  4746
      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
  4747
      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
  4748
      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
  4749
    shows "contractible T"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4750
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4751
  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
  4752
    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
  4753
  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
  4754
    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
  4755
  show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4756
    apply (simp add: contractible_def)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4757
    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
  4758
    apply (rule homotopic_with_symD)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4759
    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
  4760
    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
  4761
    done
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4762
qed
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 62620
diff changeset
  4763
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4764
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
  4765
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4766
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
  4767
where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4768
 "locally P S \<equiv>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4769
        \<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
  4770
              \<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
  4771
                        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
  4772
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4773
lemma locallyI:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4774
  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
  4775
                  \<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
  4776
                        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
  4777
    shows "locally P S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4778
using assms by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4779
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4780
lemma locallyE:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4781
  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
  4782
  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
  4783
                    "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
  4784
using assms by (force simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4785
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4786
lemma locally_mono:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4787
  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
  4788
    shows "locally Q S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4789
by (metis assms locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4790
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4791
lemma locally_open_subset:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4792
  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
  4793
    shows "locally P t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4794
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4795
apply (simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4796
apply (erule all_forward)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4797
apply (rule impI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4798
apply (erule impCE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4799
 using openin_trans apply blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4800
apply (erule ex_forward)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4801
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
  4802
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4803
lemma locally_diff_closed:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4804
    "\<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
  4805
  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
  4806
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4807
lemma locally_empty [iff]: "locally P {}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4808
  by (simp add: locally_def openin_subtopology)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4809
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4810
lemma locally_singleton [iff]:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4811
  fixes a :: "'a::metric_space"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4812
  shows "locally P {a} \<longleftrightarrow> P {a}"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4813
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
  4814
using zero_less_one by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4815
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4816
lemma locally_iff:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4817
    "locally P S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4818
     (\<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
  4819
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
  4820
apply (metis IntE IntI le_inf_iff)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4821
apply (metis IntI Int_subset_iff)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4822
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4823
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4824
lemma locally_Int:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4825
  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
  4826
      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
  4827
    shows "locally P (S \<inter> t)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4828
using S t unfolding locally_iff
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4829
apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4830
apply (drule_tac x=T in spec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4831
apply (drule_tac x=x in spec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4832
apply clarsimp
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4833
apply (rename_tac U1 U2 V1 V2)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4834
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
  4835
apply (simp add: open_Int)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4836
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
  4837
apply (auto intro: P)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4838
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4839
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4840
lemma locally_Times:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4841
  fixes S :: "('a::metric_space) set" and T :: "('b::metric_space) set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4842
  assumes PS: "locally P S" and QT: "locally Q T" and R: "\<And>S T. P S \<and> Q T \<Longrightarrow> R(S \<times> T)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4843
  shows "locally R (S \<times> T)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4844
    unfolding locally_def
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4845
proof (clarify)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4846
  fix W x y
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4847
  assume W: "openin (subtopology euclidean (S \<times> T)) W" and xy: "(x, y) \<in> W"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4848
  then obtain U V where "openin (subtopology euclidean S) U" "x \<in> U"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4849
                        "openin (subtopology euclidean T) V" "y \<in> V" "U \<times> V \<subseteq> W"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4850
    using Times_in_interior_subtopology by metis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4851
  then obtain U1 U2 V1 V2
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4852
         where opeS: "openin (subtopology euclidean S) U1 \<and> P U2 \<and> x \<in> U1 \<and> U1 \<subseteq> U2 \<and> U2 \<subseteq> U"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4853
           and opeT: "openin (subtopology euclidean T) V1 \<and> Q V2 \<and> y \<in> V1 \<and> V1 \<subseteq> V2 \<and> V2 \<subseteq> V"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4854
    by (meson PS QT locallyE)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4855
  with \<open>U \<times> V \<subseteq> W\<close> show "\<exists>u v. openin (subtopology euclidean (S \<times> T)) u \<and> R v \<and> (x,y) \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> W"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4856
    apply (rule_tac x="U1 \<times> V1" in exI)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4857
    apply (rule_tac x="U2 \<times> V2" in exI)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4858
    apply (auto simp: openin_Times R)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4859
    done
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4860
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  4861
62948
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
proposition homeomorphism_locally_imp:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4864
  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
  4865
  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
  4866
      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
  4867
    shows "locally Q t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4868
proof (clarsimp simp: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4869
  fix w y
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4870
  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
  4871
  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
  4872
    by (force simp: openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4873
  then have "w \<subseteq> t" by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4874
  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
  4875
   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
  4876
    using hom by (auto simp: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4877
  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
  4878
    using \<open>w \<subseteq> t\<close>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4879
    apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4880
    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
  4881
    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
  4882
    by (simp add: f rev_image_eqI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4883
  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
  4884
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4885
    have "continuous_on S f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4886
      using f(3) by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4887
    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
  4888
      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
  4889
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4890
  then obtain u v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4891
    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
  4892
    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
  4893
  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
  4894
  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
  4895
    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
  4896
  have "f ` v \<subseteq> w"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4897
    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
  4898
  have contvf: "continuous_on v f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4899
    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
  4900
  have contvg: "continuous_on (f ` v) g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4901
    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
  4902
  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
  4903
    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
  4904
    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
  4905
    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
  4906
  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
  4907
    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
  4908
    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
  4909
    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
  4910
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4911
  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
  4912
    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
  4913
    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
  4914
    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
  4915
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4916
  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
  4917
            (\<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
  4918
    by (meson 1 2)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4919
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4920
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4921
lemma homeomorphism_locally:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4922
  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
  4923
  assumes hom: "homeomorphism S t f g"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4924
      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
  4925
    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
  4926
apply (rule iffI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4927
apply (erule homeomorphism_locally_imp [OF _ hom])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4928
apply (simp add: eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4929
apply (erule homeomorphism_locally_imp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4930
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
  4931
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4932
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4933
lemma homeomorphic_locally:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4934
  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
  4935
  assumes hom: "S homeomorphic T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4936
          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
  4937
    shows "locally P S \<longleftrightarrow> locally Q T"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4938
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4939
  obtain f g where hom: "homeomorphism S T f g"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4940
    using assms by (force simp: homeomorphic_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4941
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4942
    using homeomorphic_def local.iff
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4943
    by (blast intro!: homeomorphism_locally)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4944
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4945
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4946
lemma homeomorphic_local_compactness:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4947
  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
  4948
  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
  4949
by (simp add: homeomorphic_compactness homeomorphic_locally)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4950
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4951
lemma locally_translation:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4952
  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
  4953
  shows
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4954
   "(\<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
  4955
        \<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
  4956
apply (rule homeomorphism_locally [OF homeomorphism_translation])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4957
apply (simp add: homeomorphism_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4958
by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4959
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4960
lemma locally_injective_linear_image:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4961
  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
  4962
  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
  4963
    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
  4964
apply (rule linear_homeomorphism_image [OF f])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4965
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
  4966
by (metis iff homeomorphism_def)
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_open_map_image:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4969
  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
  4970
  assumes P: "locally P S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4971
      and f: "continuous_on S f"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4972
      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
  4973
                   \<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
  4974
      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
  4975
    shows "locally Q (f ` S)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4976
proof (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4977
  fix w y
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4978
  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
  4979
  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
  4980
  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
  4981
    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
  4982
  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
  4983
    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
  4984
  then obtain u v
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4985
    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
  4986
    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
  4987
    by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4988
  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
  4989
            (\<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
  4990
    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
  4991
    apply (rule conjI, blast intro!: oo)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4992
    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
  4993
    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
  4994
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4995
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  4996
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4997
subsection\<open>Sort of induction principle for connected sets\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4998
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  4999
lemma connected_induction:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5000
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5001
      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
  5002
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5003
             \<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
  5004
                     (\<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
  5005
      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
  5006
    shows "Q b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5007
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5008
  have 1: "openin (subtopology euclidean S)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5009
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5010
                     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
  5011
    apply (subst openin_subopen, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5012
    apply (rule_tac x=T in exI, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5013
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5014
  have 2: "openin (subtopology euclidean S)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5015
             {b. \<exists>T. openin (subtopology euclidean S) T \<and>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5016
                     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
  5017
    apply (subst openin_subopen, clarify)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5018
    apply (rule_tac x=T in exI, auto)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5019
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5020
  show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5021
    using \<open>connected S\<close>
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5022
    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
  5023
    apply (elim disjE allE)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5024
         apply (blast intro: 1)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5025
        apply (blast intro: 2, simp_all)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5026
       apply clarify apply (metis opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5027
      using opD apply (blast intro: etc elim: dest:)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5028
     using opI etc apply meson+
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5029
    done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5030
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5031
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5032
lemma connected_equivalence_relation_gen:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5033
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5034
      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
  5035
      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
  5036
      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
  5037
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5038
             \<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
  5039
                     (\<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
  5040
    shows "R a b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5041
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5042
  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
  5043
    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
  5044
    by (meson trans opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5045
  then show ?thesis by (metis etc opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5046
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5047
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5048
lemma connected_induction_simple:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5049
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5050
      and etc: "a \<in> S" "b \<in> S" "P a"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5051
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5052
             \<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
  5053
                     (\<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
  5054
    shows "P b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5055
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
  5056
apply (frule opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5057
using etc apply simp_all
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5058
done
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5059
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5060
lemma connected_equivalence_relation:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5061
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5062
      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
  5063
      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
  5064
      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
  5065
      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
  5066
    shows "R a b"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5067
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5068
  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
  5069
    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
  5070
    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
  5071
  then show ?thesis by (metis etc opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5072
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5073
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5074
lemma locally_constant_imp_constant:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5075
  assumes "connected S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5076
      and opI: "\<And>a. a \<in> S
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5077
             \<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
  5078
    shows "f constant_on S"
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5079
proof -
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5080
  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
  5081
    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
  5082
    by (metis opI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5083
  then show ?thesis
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5084
    by (metis constant_on_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5085
qed
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5086
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5087
lemma locally_constant:
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5088
     "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
  5089
apply (simp add: locally_def)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5090
apply (rule iffI)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5091
 apply (rule locally_constant_imp_constant, assumption)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5092
 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
  5093
by (meson constant_on_subset openin_imp_subset order_refl)
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5094
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5095
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5096
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
  5097
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5098
lemma locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5099
  fixes s :: "'a :: metric_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5100
  shows
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5101
    "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5102
     (\<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
  5103
                    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
  5104
     (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5105
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5106
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5107
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5108
    apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5109
    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
  5110
    by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5111
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5112
  assume r [rule_format]: ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5113
  have *: "\<exists>u v.
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5114
              openin (subtopology euclidean s) u \<and>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5115
              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
  5116
          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
  5117
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5118
    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
  5119
      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
  5120
    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
  5121
      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
  5122
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5123
      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
  5124
      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
  5125
      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
  5126
      apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5127
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5128
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5129
  show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5130
    apply (rule locallyI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5131
    apply (subst (asm) openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5132
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5133
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5134
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5135
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5136
lemma locally_compactE:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5137
  fixes s :: "'a :: metric_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5138
  assumes "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5139
  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
  5140
                             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
  5141
using assms
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5142
unfolding locally_compact by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5143
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5144
lemma locally_compact_alt:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5145
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5146
  shows "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5147
         (\<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
  5148
                    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
  5149
apply (simp add: locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5150
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
  5151
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
  5152
by (meson closure_subset compact_closure)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5153
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5154
lemma locally_compact_Int_cball:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5155
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5156
  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
  5157
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5158
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5159
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5160
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5161
    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
  5162
    apply (clarify | assumption | drule bspec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5163
    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
  5164
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5165
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5166
  then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5167
    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
  5168
    apply (clarify | assumption | drule bspec)+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5169
    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
  5170
    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
  5171
    using compact_eq_bounded_closed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5172
    apply auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5173
    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
  5174
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5175
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5176
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5177
lemma locally_compact_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5178
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5179
  shows "locally compact s \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5180
         (\<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
  5181
              \<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
  5182
                         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
  5183
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5184
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5185
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5186
  then obtain u v where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5187
    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
  5188
                             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
  5189
    by (metis locally_compactE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5190
  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
  5191
          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
  5192
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5193
    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
  5194
                    \<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
  5195
      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
  5196
    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
  5197
      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
  5198
    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
  5199
      using that by clarsimp (meson subsetCE uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5200
    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
  5201
      by metis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5202
    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
  5203
      by (metis finite_subset_image)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5204
    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
  5205
      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
  5206
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5207
      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
  5208
      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
  5209
      apply (simp add: Tuv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5210
      using T that
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5211
      apply (auto simp: dest!: uv)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5212
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5213
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5214
  show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5215
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5216
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5217
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5218
  then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5219
    apply (clarsimp simp add: locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5220
    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
  5221
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5222
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5223
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5224
lemma open_imp_locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5225
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5226
  assumes "open s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5227
    shows "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5228
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5229
  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
  5230
          if "x \<in> s" for x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5231
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5232
    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
  5233
      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
  5234
    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
  5235
      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
  5236
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5237
      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
  5238
      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
  5239
      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
  5240
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5241
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5242
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5243
    unfolding locally_compact
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5244
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5245
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5246
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5247
lemma closed_imp_locally_compact:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5248
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5249
  assumes "closed s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5250
    shows "locally compact s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5251
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5252
  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
  5253
                 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
  5254
          if "x \<in> s" for x
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5255
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5256
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5257
      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
  5258
      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
  5259
      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
  5260
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5261
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5262
  show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5263
    unfolding locally_compact
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5264
    by (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5265
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5266
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5267
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
  5268
  by (simp add: closed_imp_locally_compact)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5269
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5270
lemma locally_compact_Int:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5271
  fixes s :: "'a :: t2_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5272
  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
  5273
by (simp add: compact_Int locally_Int)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5274
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5275
lemma locally_compact_closedin:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5276
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5277
  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
  5278
        \<Longrightarrow> locally compact t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5279
unfolding closedin_closed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5280
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
  5281
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5282
lemma locally_compact_delete:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5283
     fixes s :: "'a :: t1_space set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5284
     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
  5285
  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
  5286
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5287
lemma locally_closed:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5288
  fixes s :: "'a :: heine_borel set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5289
  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
  5290
        (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5291
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5292
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5293
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5294
    apply (simp only: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5295
    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
  5296
    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
  5297
    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
  5298
    apply (force intro: openin_trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5299
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5300
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5301
  assume ?rhs then show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5302
    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
  5303
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5304
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5305
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
  5306
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5307
lemma locally_connected_1:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5308
  assumes
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5309
    "\<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
  5310
              \<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
  5311
                      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
  5312
   shows "locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5313
apply (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5314
apply (drule assms; blast)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5315
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5316
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5317
lemma locally_connected_2:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5318
  assumes "locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5319
          "openin (subtopology euclidean S) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5320
          "x \<in> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5321
   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
  5322
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5323
  { fix y :: 'a
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5324
    let ?SS = "subtopology euclidean S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5325
    assume 1: "openin ?SS t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5326
              "\<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
  5327
    and "connected_component t x y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5328
    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
  5329
      using connected_component_subset by blast+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5330
    obtain F where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5331
      "\<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
  5332
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5333
    then obtain G where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5334
       "\<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
  5335
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5336
    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
  5337
      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
  5338
    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
  5339
      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
  5340
    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
  5341
      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
  5342
  }
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5343
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5344
    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
  5345
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5346
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5347
lemma locally_connected_3:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5348
  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
  5349
              \<Longrightarrow> openin (subtopology euclidean S)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5350
                          (connected_component_set t x)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5351
          "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
  5352
   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
  5353
using assms connected_component_subset by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5354
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5355
lemma locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5356
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5357
   (\<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
  5358
          \<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
  5359
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
  5360
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5361
lemma locally_connected_open_connected_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5362
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5363
   (\<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
  5364
          \<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
  5365
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
  5366
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5367
lemma locally_path_connected_1:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5368
  assumes
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5369
    "\<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
  5370
              \<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
  5371
   shows "locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5372
apply (clarsimp simp add: locally_def)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5373
apply (drule assms; blast)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5374
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5375
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5376
lemma locally_path_connected_2:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5377
  assumes "locally path_connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5378
          "openin (subtopology euclidean S) t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5379
          "x \<in> t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5380
   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
  5381
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5382
  { fix y :: 'a
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5383
    let ?SS = "subtopology euclidean S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5384
    assume 1: "openin ?SS t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5385
              "\<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
  5386
    and "path_component t x y"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5387
    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
  5388
      using path_component_mem(2) by blast+
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5389
    obtain F where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5390
      "\<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
  5391
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5392
    then obtain G where
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5393
       "\<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
  5394
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5395
    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
  5396
      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
  5397
    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
  5398
      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
  5399
    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
  5400
      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
  5401
  }
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5402
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5403
    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
  5404
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5405
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5406
lemma locally_path_connected_3:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5407
  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
  5408
              \<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
  5409
          "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
  5410
   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
  5411
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5412
  have "path_component v x x"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5413
    by (meson assms(3) path_component_refl)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5414
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5415
    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
  5416
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5417
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5418
proposition locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5419
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5420
   (\<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
  5421
          \<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
  5422
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
  5423
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5424
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
  5425
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5426
   (\<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
  5427
          \<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
  5428
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
  5429
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5430
lemma locally_connected_open_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5431
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5432
   (\<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
  5433
          \<longrightarrow> openin (subtopology euclidean S) c)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5434
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
  5435
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5436
proposition locally_connected_im_kleinen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5437
  "locally connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5438
   (\<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
  5439
       \<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
  5440
                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
  5441
                (\<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
  5442
   (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5443
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5444
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5445
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5446
    by (fastforce simp add: locally_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5447
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5448
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5449
  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
  5450
       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
  5451
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5452
    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
  5453
    obtain u where u:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5454
      "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
  5455
       (\<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
  5456
      by auto (meson subsetD in_components_subset)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5457
    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
  5458
      "\<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
  5459
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5460
    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
  5461
      by (meson components_iff c)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5462
    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
  5463
        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
  5464
      by moura
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5465
     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
  5466
      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
  5467
    then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5468
      using G u by auto
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5469
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5470
  show ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5471
    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
  5472
    apply (subst openin_subopen)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5473
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5474
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5475
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5476
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5477
proposition locally_path_connected_im_kleinen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5478
  "locally path_connected S \<longleftrightarrow>
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5479
   (\<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
  5480
       \<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
  5481
                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
  5482
                (\<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
  5483
                                pathstart p = x \<and> pathfinish p = y))))"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5484
   (is "?lhs = ?rhs")
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5485
proof
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5486
  assume ?lhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5487
  then show ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5488
    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
  5489
    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
  5490
    by (meson dual_order.trans)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5491
next
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5492
  assume ?rhs
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5493
  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
  5494
               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
  5495
       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
  5496
  proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5497
    have "x \<in> u"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5498
      by (meson c path_component_mem(2))
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5499
    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
  5500
    obtain U where U:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5501
      "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
  5502
       (\<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
  5503
       by blast
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5504
    show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5505
      apply (rule_tac x=U in exI)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5506
      apply (auto simp: U)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5507
      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
  5508
      done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5509
  qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5510
  show ?lhs
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5511
    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
  5512
    apply (subst openin_subopen)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5513
    apply (blast intro: *)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5514
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5515
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5516
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5517
lemma locally_path_connected_imp_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5518
  "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
  5519
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
  5520
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5521
lemma locally_connected_components:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5522
  "\<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
  5523
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
  5524
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5525
lemma locally_path_connected_components:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5526
  "\<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
  5527
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
  5528
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5529
lemma locally_path_connected_connected_component:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5530
  "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
  5531
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
  5532
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5533
lemma open_imp_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5534
  fixes S :: "'a :: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5535
  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
  5536
apply (rule locally_mono [of convex])
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5537
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
  5538
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
  5539
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5540
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5541
lemma open_imp_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5542
  fixes S :: "'a :: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5543
  shows "open S \<Longrightarrow> locally connected S"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5544
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
  5545
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5546
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
  5547
  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
  5548
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5549
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
  5550
  by (simp add: open_imp_locally_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5551
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5552
lemma openin_connected_component_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5553
    "locally connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5554
     \<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
  5555
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
  5556
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
  5557
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5558
lemma openin_components_locally_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5559
    "\<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
  5560
  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
  5561
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5562
lemma openin_path_component_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5563
  "locally path_connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5564
        \<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
  5565
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
  5566
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5567
lemma closedin_path_component_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5568
    "locally path_connected S
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5569
        \<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
  5570
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
  5571
apply (rule openin_Union)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5572
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
  5573
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5574
lemma convex_imp_locally_path_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5575
  fixes S :: "'a:: real_normed_vector set"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5576
  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
  5577
apply (clarsimp simp add: locally_path_connected)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5578
apply (subst (asm) openin_open)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5579
apply clarify
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5580
apply (erule (1) Topology_Euclidean_Space.openE)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5581
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
  5582
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
  5583
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  5584
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5585
lemma convex_imp_locally_connected:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5586
  fixes S :: "'a:: real_normed_vector set"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5587
  shows "convex S \<Longrightarrow> locally connected S"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5588
  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
  5589
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  5590
63469
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5591
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
  5592
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5593
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
  5594
  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
  5595
    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
  5596
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
  5597
  case True
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5598
  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
  5599
    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
  5600
    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
  5601
    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
  5602
    done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5603
  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
  5604
    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
  5605
    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
  5606
    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
  5607
    done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5608
  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
  5609
    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
  5610
  then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5611
    by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5612
next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5613
  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
  5614
    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
  5615
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5616
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5617
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
  5618
     "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
  5619
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
  5620
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5621
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
  5622
     "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
  5623
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
  5624
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5625
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
  5626
  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
  5627
  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
  5628
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
  5629
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5630
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
  5631
  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
  5632
  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
  5633
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
  5634
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5635
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
  5636
  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
  5637
      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
  5638
                \<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
  5639
                    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
  5640
    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
  5641
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
  5642
  fix U C
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5643
  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
  5644
  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
  5645
    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
  5646
  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
  5647
             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
  5648
    by (auto simp: oo)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5649
  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
  5650
  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
  5651
    fix x
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5652
    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
  5653
    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
  5654
    proof (intro conjI exI)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5655
      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
  5656
      proof (rule ccontr)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5657
        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
  5658
        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
  5659
          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
  5660
        with ** show False
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5661
          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
  5662
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5663
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5664
      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
  5665
        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
  5666
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5667
      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
  5668
        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
  5669
      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
  5670
        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
  5671
        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
  5672
        done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5673
      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
  5674
        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
  5675
      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
  5676
        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
  5677
      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
  5678
        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
  5679
      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
  5680
        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
  5681
      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
  5682
        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
  5683
      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
  5684
      proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5685
        { 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
  5686
          then have ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5687
            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
  5688
        then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5689
          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
  5690
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5691
      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
  5692
        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
  5693
      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
  5694
    qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5695
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5696
  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
  5697
    by metis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5698
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5699
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5700
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
  5701
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
  5702
  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
  5703
      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
  5704
                \<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
  5705
                    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
  5706
    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
  5707
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
  5708
  fix U y
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5709
  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
  5710
  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
  5711
    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
  5712
  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
  5713
             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
  5714
  proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5715
    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
  5716
      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
  5717
    then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5718
      using oo by blast
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5719
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5720
  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
  5721
  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
  5722
    fix x
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5723
    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
  5724
    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
  5725
      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
  5726
    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
  5727
    proof (intro conjI exI)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5728
      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
  5729
      proof (rule ccontr)
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5730
        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
  5731
        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
  5732
          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
  5733
        then show False
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5734
          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
  5735
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5736
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5737
      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
  5738
        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
  5739
    next
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5740
      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
  5741
        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
  5742
      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
  5743
        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
  5744
        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
  5745
        done
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5746
      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
  5747
        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
  5748
      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
  5749
        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
  5750
      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
  5751
        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
  5752
      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
  5753
        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
  5754
       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
  5755
        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
  5756
      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
  5757
      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
  5758
        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
  5759
      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
  5760
      proof -
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5761
        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
  5762
          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
  5763
        then show ?thesis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5764
          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
  5765
      qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5766
      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
  5767
        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
  5768
      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
  5769
    qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5770
  qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5771
  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
  5772
    by metis
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5773
qed
b6900858dcb9 lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents: 63305
diff changeset
  5774
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5775
subsection\<open>Components, continuity, openin, closedin\<close>
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5776
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5777
lemma continuous_on_components_gen:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5778
 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
  5779
  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
  5780
              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
  5781
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5782
proof (clarsimp simp: continuous_openin_preimage_eq)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5783
  fix t :: "'b set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5784
  assume "open t"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5785
  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
  5786
    apply auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5787
    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
  5788
    using Union_components by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5789
  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
  5790
    using \<open>open t\<close> assms
63301
d3c87eb0bad2 new results about topology
paulson <lp15@cam.ac.uk>
parents: 63151
diff changeset
  5791
    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
  5792
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5793
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5794
lemma continuous_on_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5795
 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
  5796
  assumes "locally connected S "
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5797
          "\<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
  5798
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5799
apply (rule continuous_on_components_gen)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5800
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
  5801
done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5802
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5803
lemma continuous_on_components_eq:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5804
    "locally connected S
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5805
     \<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
  5806
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
  5807
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5808
lemma continuous_on_components_open:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5809
 fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5810
  assumes "open S "
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5811
          "\<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
  5812
    shows "continuous_on S f"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5813
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
  5814
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5815
lemma continuous_on_components_open_eq:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5816
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5817
  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
  5818
using continuous_on_subset in_components_subset
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5819
by (blast intro: continuous_on_components_open)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5820
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5821
lemma closedin_union_complement_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5822
  assumes u: "locally connected u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5823
      and S: "closedin (subtopology euclidean u) S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5824
      and cuS: "c \<subseteq> components(u - S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5825
    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
  5826
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5827
  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
  5828
    by (simp add: disjnt_def) blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5829
  have "S \<subseteq> u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5830
    using S closedin_imp_subset by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5831
  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
  5832
    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
  5833
  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
  5834
    apply (rule di)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5835
    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
  5836
  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
  5837
    by (auto simp: disjnt_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5838
  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
  5839
    apply (rule openin_Union)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5840
    apply (rule openin_trans [of "u - S"])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5841
    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
  5842
    apply (simp add: openin_diff S)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5843
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5844
  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
  5845
    apply (rule openin_diff, simp)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5846
    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
  5847
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5848
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5849
    by (force simp: eq closedin_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5850
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5851
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5852
lemma closed_union_complement_components:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5853
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5854
  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
  5855
    shows "closed(S \<union> \<Union> c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5856
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5857
  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
  5858
    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
  5859
    using S apply (simp add: closed_closedin)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5860
    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
  5861
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5862
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5863
    by (simp add: closed_closedin)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5864
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5865
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5866
lemma closedin_Un_complement_component:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5867
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5868
  assumes u: "locally connected u"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5869
      and S: "closedin (subtopology euclidean u) S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5870
      and c: " c \<in> components(u - S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5871
    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
  5872
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5873
  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
  5874
    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
  5875
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5876
    by simp
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5877
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5878
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5879
lemma closed_Un_complement_component:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5880
  fixes S :: "'a::real_normed_vector set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5881
  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
  5882
    shows "closed (S \<union> c)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5883
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
  5884
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5885
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5886
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
  5887
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5888
lemma isometry_subset_subspace:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5889
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5890
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5891
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5892
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5893
      and d: "dim S \<le> dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5894
  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
  5895
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5896
  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
  5897
             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
  5898
             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
  5899
    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
  5900
  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
  5901
             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
  5902
             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
  5903
    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
  5904
  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
  5905
    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
  5906
  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
  5907
    using Corth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5908
    apply (auto simp: pairwise_def orthogonal_clauses)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5909
    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
  5910
  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
  5911
    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
  5912
  have "f ` S \<subseteq> T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5913
    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
  5914
  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
  5915
    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
  5916
  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
  5917
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5918
    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
  5919
      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
  5920
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5921
      using linear_sum [OF \<open>linear f\<close>] x by auto
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5922
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5923
      using \<open>linear f\<close> by (simp add: linear_sum linear.scaleR)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5924
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5925
      by (simp add: ffb cong: sum.cong)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5926
    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
  5927
    also have "... = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5928
      apply (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5929
      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
  5930
      done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5931
    also have "... = norm x ^2"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5932
      by (simp add: x pairwise_ortho_scaleR Borth norm_sum_Pythagorean [OF \<open>finite B\<close>])
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5933
    finally show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5934
      by (simp add: norm_eq_sqrt_inner)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5935
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5936
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5937
    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
  5938
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5939
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5940
proposition isometries_subspaces:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5941
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5942
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5943
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5944
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5945
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5946
  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
  5947
                    "\<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
  5948
                    "\<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
  5949
                    "\<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
  5950
                    "\<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
  5951
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5952
  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
  5953
             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
  5954
             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
  5955
    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
  5956
  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
  5957
             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
  5958
             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
  5959
    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
  5960
  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
  5961
    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
  5962
  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
  5963
    using Corth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5964
    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
  5965
    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
  5966
  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
  5967
    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
  5968
  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
  5969
  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
  5970
    using Borth
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5971
    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
  5972
    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
  5973
  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
  5974
    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
  5975
  have "f ` S \<subseteq> T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5976
    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
  5977
  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
  5978
    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
  5979
  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
  5980
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5981
    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
  5982
      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
  5983
    have "f x = (\<Sum>v \<in> B. f (a v *\<^sub>R v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5984
      using linear_sum [OF \<open>linear f\<close>] x by auto
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5985
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R f v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5986
      using \<open>linear f\<close> by (simp add: linear_sum linear.scaleR)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5987
    also have "... = (\<Sum>v \<in> B. a v *\<^sub>R fb v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5988
      by (simp add: ffb cong: sum.cong)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5989
    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
  5990
    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
  5991
    also have "... = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5992
      apply (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5993
      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
  5994
      done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5995
    also have "... = (norm x)\<^sup>2"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  5996
      by (simp add: x pairwise_ortho_scaleR Borth norm_sum_Pythagorean [OF \<open>finite B\<close>])
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5997
    finally show "norm (f x) = norm x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5998
      by (simp add: norm_eq_sqrt_inner)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  5999
    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
  6000
    also have "... = (\<Sum>v\<in>B. g (a v *\<^sub>R fb v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6001
      using \<open>linear g\<close> by (simp add: linear_sum linear.scaleR)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6002
    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
  6003
      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
  6004
    also have "... = (\<Sum>v\<in>B. a v *\<^sub>R v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6005
      apply (rule sum.cong [OF refl])
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6006
      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
  6007
    also have "... = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6008
      using x by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6009
    finally show "g (f x) = x" .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6010
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6011
  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
  6012
    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
  6013
  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
  6014
  proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6015
    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
  6016
      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
  6017
    have "g x = (\<Sum>v \<in> C. g (a v *\<^sub>R v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6018
      using linear_sum [OF \<open>linear g\<close>] x by auto
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6019
    also have "... = (\<Sum>v \<in> C. a v *\<^sub>R g v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6020
      using \<open>linear g\<close> by (simp add: linear_sum linear.scaleR)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6021
    also have "... = (\<Sum>v \<in> C. a v *\<^sub>R gb v)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6022
      by (simp add: ggb cong: sum.cong)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6023
    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
  6024
    also have "... = (\<Sum>v\<in>C. f (a v *\<^sub>R gb v))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 64122
diff changeset
  6025
      using \<open>linear f\<close> by (simp add: linear_sum linear.scaleR)
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6026
    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
  6027
      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
  6028
    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
  6029
      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
  6030
      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
  6031
    also have "... = x"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6032
      using x by blast
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6033
    finally show "f (g x) = x" .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6034
  qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6035
  have gim: "g ` T = S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6036
    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
  6037
  have fim: "f ` S = T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6038
    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
  6039
  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
  6040
    using fim that by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6041
  show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6042
    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
  6043
    apply (simp_all add: fim gim)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6044
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6045
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6046
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6047
corollary isometry_subspaces:
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6048
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6049
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6050
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6051
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6052
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6053
  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
  6054
using isometries_subspaces [OF assms]
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6055
by metis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6056
63928
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6057
corollary isomorphisms_UNIV_UNIV:
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6058
  assumes "DIM('M) = DIM('N)"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6059
  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
  6060
  where "linear f" "linear g"
d81fb5b46a5c new material about topological concepts, etc
paulson <lp15@cam.ac.uk>
parents: 63881
diff changeset
  6061
                    "\<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
  6062
                    "\<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
  6063
  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
  6064
63114
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6065
lemma homeomorphic_subspaces:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6066
  fixes S :: "'a::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6067
    and T :: "'b::euclidean_space set"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6068
  assumes S: "subspace S"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6069
      and T: "subspace T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6070
      and d: "dim S = dim T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6071
    shows "S homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6072
proof -
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6073
  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
  6074
                   "\<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
  6075
    by (blast intro: isometries_subspaces [OF assms])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6076
  then show ?thesis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6077
    apply (simp add: homeomorphic_def homeomorphism_def)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6078
    apply (rule_tac x=f in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6079
    apply (rule_tac x=g in exI)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6080
    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
  6081
    done
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6082
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6083
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6084
lemma homeomorphic_affine_sets:
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6085
  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
  6086
    shows "S homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6087
proof (cases "S = {} \<or> T = {}")
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6088
  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
  6089
    by metis
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6090
next
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6091
  case False
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6092
  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
  6093
  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
  6094
    using affine_diffs_subspace assms by blast+
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6095
  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
  6096
    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
  6097
  have "S homeomorphic (op + (- a) ` S)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6098
    by (simp add: homeomorphic_translation)
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6099
  also have "... homeomorphic (op + (- b) ` T)"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6100
    by (rule homeomorphic_subspaces [OF ss dd])
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6101
  also have "... homeomorphic T"
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6102
    using homeomorphic_sym homeomorphic_translation by auto
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6103
  finally show ?thesis .
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6104
qed
27afe7af7379 Lots of new material for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 63092
diff changeset
  6105
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6106
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
  6107
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6108
locale Retracts =
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6109
  fixes s h t k
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6110
  assumes conth: "continuous_on s h"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6111
      and imh: "h ` s = t"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6112
      and contk: "continuous_on t k"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6113
      and imk: "k ` t \<subseteq> s"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6114
      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
  6115
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6116
begin
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6117
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6118
lemma homotopically_trivial_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6119
  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
  6120
      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
  6121
      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
  6122
      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
  6123
                       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
  6124
                       \<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
  6125
      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
  6126
      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
  6127
    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
  6128
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6129
  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
  6130
  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
  6131
  have "continuous_on u (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6132
    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
  6133
  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
  6134
    using imf imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6135
  moreover have "P (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6136
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6137
  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
  6138
    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
  6139
  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
  6140
    using img imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6141
  moreover have "P (k \<circ> g)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6142
    by (simp add: P Qg contg img)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6143
  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
  6144
    by (rule hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6145
  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
  6146
    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
  6147
    using Q by (auto simp: conth imh)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6148
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6149
    apply (rule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6150
    apply (metis feq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6151
    apply (metis geq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6152
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6153
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6154
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6155
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6156
lemma homotopically_trivial_retraction_null_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6157
  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
  6158
      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
  6159
      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
  6160
      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
  6161
                     \<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
  6162
      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
  6163
  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
  6164
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6165
  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
  6166
  have "continuous_on u (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6167
    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
  6168
  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
  6169
    using imf imk by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6170
  moreover have "P (k \<circ> f)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6171
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6172
  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
  6173
    by (metis hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6174
  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
  6175
    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
  6176
    using Q by (auto simp: conth imh)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6177
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6178
    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
  6179
    apply (erule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6180
    apply (metis feq, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6181
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6182
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6183
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6184
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6185
lemma cohomotopically_trivial_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6186
  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
  6187
      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
  6188
      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
  6189
      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
  6190
                       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
  6191
                       \<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
  6192
      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
  6193
      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
  6194
    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
  6195
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6196
  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
  6197
  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
  6198
  have "continuous_on s (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6199
    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
  6200
  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
  6201
    using imf imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6202
  moreover have "P (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6203
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6204
  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
  6205
    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
  6206
  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
  6207
    using img imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6208
  moreover have "P (g \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6209
    by (simp add: P Qg contg img)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6210
  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
  6211
    by (rule hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6212
  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
  6213
    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
  6214
    using Q by (auto simp: contk imk)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6215
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6216
    apply (rule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6217
    apply (metis feq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6218
    apply (metis geq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6219
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6220
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6221
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6222
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6223
lemma cohomotopically_trivial_retraction_null_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6224
  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
  6225
      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
  6226
      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
  6227
      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
  6228
                       \<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
  6229
      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
  6230
  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
  6231
proof -
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6232
  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
  6233
  have "continuous_on s (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6234
    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
  6235
  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
  6236
    using imf imh by fastforce
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6237
  moreover have "P (f \<circ> h)"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6238
    by (simp add: P Qf contf imf)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6239
  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
  6240
    by (metis hom)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6241
  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
  6242
    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
  6243
    using Q by (auto simp: contk imk)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6244
  then show ?thesis
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6245
    apply (rule_tac c = c in that)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6246
    apply (erule homotopic_with_eq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6247
    apply (metis feq, simp)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6248
    apply (metis Qeq)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6249
    done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6250
qed
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6251
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  6252
end
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6253
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6254
lemma simply_connected_retraction_gen:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6255
  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
  6256
          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
  6257
        \<Longrightarrow> simply_connected T"
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6258
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
  6259
apply (rule Retracts.homotopically_trivial_retraction_gen
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6260
        [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
  6261
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
  6262
done
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6263
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6264
lemma homeomorphic_simply_connected:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6265
    "\<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
  6266
  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
  6267
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6268
lemma homeomorphic_simply_connected_eq:
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6269
    "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
  6270
  by (metis homeomorphic_simply_connected homeomorphic_sym)
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  6271
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6272
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
  6273
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6274
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
  6275
             (infix "homotopy'_eqv" 50)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6276
  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
  6277
        \<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
  6278
              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
  6279
              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
  6280
              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
  6281
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6282
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
  6283
  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
  6284
  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
  6285
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6286
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
  6287
  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
  6288
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6289
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
  6290
  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
  6291
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6292
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
  6293
    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
  6294
  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
  6295
    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
  6296
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6297
  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
  6298
                 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
  6299
                 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
  6300
                           "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
  6301
    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
  6302
  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
  6303
                 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
  6304
                 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
  6305
                           "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
  6306
    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
  6307
  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
  6308
    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
  6309
  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
  6310
    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
  6311
  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
  6312
         (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
  6313
    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
  6314
  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
  6315
    using hom1 by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6316
  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
  6317
    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
  6318
    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
  6319
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6320
  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
  6321
    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
  6322
  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
  6323
    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
  6324
  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
  6325
         (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
  6326
    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
  6327
  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
  6328
    using hom2 by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6329
  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
  6330
    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
  6331
    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
  6332
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6333
  show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6334
    unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6335
    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
  6336
    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
  6337
    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
  6338
    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
  6339
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6340
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6341
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6342
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
  6343
  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
  6344
  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
  6345
    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
  6346
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
  6347
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
  6348
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6349
lemma homotopy_eqv_translation:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6350
    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
  6351
    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
  6352
  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
  6353
  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
  6354
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6355
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
  6356
  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
  6357
    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
  6358
    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
  6359
  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
  6360
      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
  6361
      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
  6362
      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
  6363
                         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
  6364
                         \<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
  6365
    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
  6366
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6367
  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
  6368
               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
  6369
               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
  6370
                        "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
  6371
    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
  6372
  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
  6373
    apply (rule homUS)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6374
    using f g k
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6375
    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
  6376
    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
  6377
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6378
  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
  6379
    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
  6380
    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
  6381
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6382
  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
  6383
    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
  6384
    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
  6385
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6386
  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
  6387
    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
  6388
    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
  6389
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6390
  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
  6391
    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
  6392
    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
  6393
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6394
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6395
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
  6396
  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
  6397
    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
  6398
    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
  6399
  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
  6400
    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
  6401
                   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
  6402
                   \<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
  6403
           (\<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
  6404
                  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
  6405
                  \<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
  6406
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6407
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
  6408
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
  6409
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6410
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
  6411
  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
  6412
    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
  6413
    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
  6414
  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
  6415
      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
  6416
      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
  6417
                      \<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
  6418
  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
  6419
proof -
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6420
  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
  6421
               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
  6422
               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
  6423
                        "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
  6424
    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
  6425
  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
  6426
    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
  6427
    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
  6428
    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
  6429
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6430
  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
  6431
    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
  6432
    using k by auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6433
  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
  6434
    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
  6435
      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
  6436
     using f apply auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6437
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6438
  ultimately show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6439
    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
  6440
    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
  6441
    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
  6442
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6443
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6444
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
  6445
  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
  6446
    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
  6447
    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
  6448
  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
  6449
    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
  6450
                \<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
  6451
           (\<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
  6452
                \<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
  6453
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6454
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
  6455
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
  6456
64006
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6457
lemma homotopy_eqv_homotopic_triviality_null_imp:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6458
  fixes S :: "'a::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6459
    and T :: "'b::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6460
    and U :: "'c::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6461
  assumes "S homotopy_eqv T"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6462
      and f: "continuous_on U f" "f ` U \<subseteq> T"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6463
      and homSU: "\<And>f. \<lbrakk>continuous_on U f; f ` U \<subseteq> S\<rbrakk>
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6464
                      \<Longrightarrow> \<exists>c. homotopic_with (\<lambda>x. True) U S f (\<lambda>x. c)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6465
    shows "\<exists>c. homotopic_with (\<lambda>x. True) U T f (\<lambda>x. c)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6466
proof -
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6467
  obtain h k where h: "continuous_on S h" "h ` S \<subseteq> T"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6468
               and k: "continuous_on T k" "k ` T \<subseteq> S"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6469
               and hom: "homotopic_with (\<lambda>x. True) S S (k \<circ> h) id"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6470
                        "homotopic_with (\<lambda>x. True) T T (h \<circ> k) id"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6471
    using assms by (auto simp: homotopy_eqv_def)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6472
  obtain c::'a where "homotopic_with (\<lambda>x. True) U S (k \<circ> f) (\<lambda>x. c)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6473
    apply (rule exE [OF homSU [of "k \<circ> f"]])
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6474
    apply (intro continuous_on_compose h)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6475
    using k f  apply (force elim!: continuous_on_subset)+
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6476
    done
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6477
  then have "homotopic_with (\<lambda>x. True) U T (h \<circ> (k \<circ> f)) (h \<circ> (\<lambda>x. c))"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6478
    apply (rule homotopic_with_compose_continuous_left [where Y=S])
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6479
    using h by auto
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6480
  moreover have "homotopic_with (\<lambda>x. True) U T (id \<circ> f) ((h \<circ> k) \<circ> f)"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6481
    apply (rule homotopic_with_compose_continuous_right [where X=T])
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6482
      apply (simp add: hom homotopic_with_symD)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6483
     using f apply auto
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6484
    done
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6485
  ultimately show ?thesis
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6486
    using homotopic_with_trans by (fastforce simp add: o_def)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6487
qed
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6488
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6489
lemma homotopy_eqv_homotopic_triviality_null:
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6490
  fixes S :: "'a::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6491
    and T :: "'b::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6492
    and U :: "'c::real_normed_vector set"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6493
  assumes "S homotopy_eqv T"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6494
    shows "(\<forall>f. continuous_on U f \<and> f ` U \<subseteq> S
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6495
                  \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) U S f (\<lambda>x. c))) \<longleftrightarrow>
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6496
           (\<forall>f. continuous_on U f \<and> f ` U \<subseteq> T
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6497
                  \<longrightarrow> (\<exists>c. homotopic_with (\<lambda>x. True) U T f (\<lambda>x. c)))"
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6498
apply (rule iffI)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6499
apply (metis assms homotopy_eqv_homotopic_triviality_null_imp)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6500
by (metis assms homotopy_eqv_homotopic_triviality_null_imp homotopy_eqv_sym)
0de4736dad8b new theorems including the theory FurtherTopology
paulson <lp15@cam.ac.uk>
parents: 63978
diff changeset
  6501
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6502
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
  6503
  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
  6504
    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
  6505
  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
  6506
    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
  6507
proof (cases "S = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6508
  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
  6509
    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
  6510
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6511
  case False
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6512
  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
  6513
    by auto
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6514
  then show ?thesis
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6515
    unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6516
    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
  6517
    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
  6518
    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
  6519
    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
  6520
    done
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6521
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6522
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6523
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
  6524
  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
  6525
  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
  6526
apply (rule iffI)
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6527
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
  6528
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
  6529
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6530
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
  6531
  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
  6532
  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
  6533
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
  6534
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6535
lemma homotopy_eqv_contractibility:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6536
  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
  6537
  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
  6538
unfolding homotopy_eqv_def
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6539
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
  6540
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6541
lemma homotopy_eqv_sing:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6542
  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
  6543
  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
  6544
proof (cases "S = {}")
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6545
  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
  6546
    by simp
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6547
next
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6548
  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
  6549
    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
  6550
qed
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6551
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6552
lemma homeomorphic_contractible_eq:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6553
  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
  6554
  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
  6555
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
  6556
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6557
lemma homeomorphic_contractible:
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6558
  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
  6559
  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
  6560
  by (metis homeomorphic_contractible_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6561
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6562
subsection\<open>Misc other results\<close>
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6563
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6564
lemma bounded_connected_Compl_real:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6565
  fixes S :: "real set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6566
  assumes "bounded S" and conn: "connected(- S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6567
    shows "S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6568
proof -
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6569
  obtain a b where "S \<subseteq> box a b"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6570
    by (meson assms bounded_subset_open_interval)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6571
  then have "a \<notin> S" "b \<notin> S"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6572
    by auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6573
  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
  6574
    by (meson Compl_iff conn connected_iff_interval)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6575
  then show ?thesis
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6576
    using \<open>S \<subseteq> box a b\<close> by auto
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6577
qed
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6578
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6579
lemma bounded_connected_Compl_1:
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6580
  fixes S :: "'a::{euclidean_space} set"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6581
  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
  6582
    shows "S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6583
proof -
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6584
  have "DIM('a) = DIM(real)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6585
    by (simp add: "1")
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6586
  then obtain f::"'a \<Rightarrow> real" and g
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6587
  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
  6588
    by (rule isomorphisms_UNIV_UNIV) blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6589
  with \<open>bounded S\<close> have "bounded (f ` S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6590
    using bounded_linear_image linear_linear by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6591
  have "connected (f ` (-S))"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6592
    using connected_linear_image assms \<open>linear f\<close> by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6593
  moreover have "f ` (-S) = - (f ` S)"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6594
    apply (rule bij_image_Compl_eq)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6595
    apply (auto simp: bij_def)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6596
     apply (metis \<open>\<And>x. g (f x) = x\<close> injI)
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6597
    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
  6598
  finally have "connected (- (f ` S))"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6599
    by simp
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6600
  then have "f ` S = {}"
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6601
    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
  6602
  then show ?thesis
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6603
    by blast
51a3d38d2281 more new material
paulson <lp15@cam.ac.uk>
parents: 63928
diff changeset
  6604
qed
63305
3b6975875633 Urysohn's lemma, Dugundji extension theorem and many other proofs
paulson <lp15@cam.ac.uk>
parents: 63301
diff changeset
  6605
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6606
subsection\<open>Some Uncountable Sets\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6607
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6608
lemma uncountable_closed_segment:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6609
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6610
  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
  6611
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
  6612
  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
  6613
        countable_image_inj_on by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6614
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6615
lemma uncountable_open_segment:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6616
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6617
  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
  6618
  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
  6619
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6620
lemma uncountable_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6621
  fixes a :: "'a::real_normed_vector"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6622
  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
  6623
    shows "uncountable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6624
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6625
  have "uncountable (closed_segment a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6626
    by (simp add: uncountable_closed_segment assms)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6627
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6628
    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
  6629
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6630
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6631
lemma uncountable_ball:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6632
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6633
  assumes "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6634
    shows "uncountable (ball a r)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6635
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6636
  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
  6637
    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
  6638
  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
  6639
    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
  6640
  ultimately show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6641
    by (metis countable_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6642
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6643
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6644
lemma uncountable_cball:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6645
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6646
  assumes "r > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6647
  shows "uncountable (cball a r)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6648
  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
  6649
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6650
lemma pairwise_disjnt_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6651
  fixes \<N> :: "nat set set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6652
  assumes "pairwise disjnt \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6653
    shows "countable \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6654
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6655
  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
  6656
    apply (clarsimp simp add: inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6657
    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
  6658
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6659
    by (metis countable_Diff_eq countable_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6660
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6661
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6662
lemma pairwise_disjnt_countable_Union:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6663
    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
  6664
    shows "countable \<N>"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6665
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6666
  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
  6667
    using assms by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6668
  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
  6669
    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
  6670
  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
  6671
    using pairwise_disjnt_countable by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6672
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6673
    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
  6674
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6675
64788
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6676
lemma connected_uncountable:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6677
  fixes S :: "'a::metric_space set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6678
  assumes "connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6679
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6680
  have "continuous_on S (dist a)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6681
    by (intro continuous_intros)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6682
  then have "connected (dist a ` S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6683
    by (metis connected_continuous_image \<open>connected S\<close>)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6684
  then have "closed_segment 0 (dist a b) \<subseteq> (dist a ` S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6685
    by (simp add: assms closed_segment_subset is_interval_connected_1 is_interval_convex)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6686
  then have "uncountable (dist a ` S)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6687
    by (metis \<open>a \<noteq> b\<close> countable_subset dist_eq_0_iff uncountable_closed_segment)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6688
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6689
    by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6690
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6691
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6692
lemma path_connected_uncountable:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6693
  fixes S :: "'a::metric_space set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6694
  assumes "path_connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6695
  using path_connected_imp_connected assms connected_uncountable by metis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6696
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6697
lemma connected_finite_iff_sing:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6698
  fixes S :: "'a::metric_space set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6699
  assumes "connected S"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6700
  shows "finite S \<longleftrightarrow> S = {} \<or> (\<exists>a. S = {a})"  (is "_ = ?rhs")
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6701
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6702
  have "uncountable S" if "\<not> ?rhs"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6703
    using connected_uncountable assms that by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6704
  then show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6705
    using uncountable_infinite by auto
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6706
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6707
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6708
lemma connected_card_eq_iff_nontrivial:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6709
  fixes S :: "'a::metric_space set"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6710
  shows "connected S \<Longrightarrow> uncountable S \<longleftrightarrow> ~(\<exists>a. S \<subseteq> {a})"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6711
  apply (auto simp: countable_finite finite_subset)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6712
  by (metis connected_uncountable is_singletonI' is_singleton_the_elem subset_singleton_iff)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6713
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6714
lemma simple_path_image_uncountable:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6715
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6716
  assumes "simple_path g"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6717
  shows "uncountable (path_image g)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6718
proof -
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6719
  have "g 0 \<in> path_image g" "g (1/2) \<in> path_image g"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6720
    by (simp_all add: path_defs)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6721
  moreover have "g 0 \<noteq> g (1/2)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6722
    using assms by (fastforce simp add: simple_path_def)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6723
  ultimately show ?thesis
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6724
    apply (simp add: assms connected_card_eq_iff_nontrivial connected_simple_path_image)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6725
    by blast
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6726
qed
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6727
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6728
lemma arc_image_uncountable:
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6729
  fixes g :: "real \<Rightarrow> 'a::metric_space"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6730
  assumes "arc g"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6731
  shows "uncountable (path_image g)"
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6732
  by (simp add: arc_imp_simple_path assms simple_path_image_uncountable)
19f3d4af7a7d New material about path connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 64394
diff changeset
  6733
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6734
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6735
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
  6736
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6737
proposition path_connected_convex_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6738
  fixes U :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6739
  assumes "convex U" "~ collinear U" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6740
    shows "path_connected(U - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6741
proof (clarsimp simp add: path_connected_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6742
  fix a b
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6743
  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
  6744
  let ?m = "midpoint a b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6745
  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
  6746
  proof (cases "a = b")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6747
    case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6748
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6749
      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
  6750
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6751
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6752
    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
  6753
      using midpoint_eq_endpoint by fastforce+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6754
    have "?m \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6755
      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
  6756
    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
  6757
      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
  6758
    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
  6759
      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
  6760
    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
  6761
      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
  6762
    have "c \<noteq> ?m"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6763
      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
  6764
    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
  6765
      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
  6766
    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
  6767
                    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
  6768
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6769
      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
  6770
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6771
        have closb: "closed_segment ?m c \<subseteq>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6772
                 {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
  6773
          using that by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6774
        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
  6775
          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
  6776
        proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6777
          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
  6778
                            and "x1 \<noteq> x2" "x1 \<noteq> u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6779
                            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
  6780
                            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
  6781
          proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6782
            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
  6783
              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
  6784
            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
  6785
              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
  6786
            have "\<not> collinear {x1, u, x2}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6787
            proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6788
              assume "collinear {x1, u, x2}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6789
              then have "collinear {?m, c, u}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6790
                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
  6791
              with ncoll show False ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6792
            qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6793
            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
  6794
              by (blast intro!: Int_closed_segment)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6795
            then have "w = u"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6796
              using closed_segment_commute w by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6797
            show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6798
              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
  6799
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6800
          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
  6801
            by (fastforce simp: pairwise_def disjnt_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6802
          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
  6803
            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
  6804
             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
  6805
            done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6806
          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
  6807
          show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6808
          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
  6809
            fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6810
            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
  6811
            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
  6812
            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
  6813
              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
  6814
                unfolding f_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6815
                apply (rule the_equality [symmetric])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6816
                using x  apply (auto simp: dest: **)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6817
                done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6818
            qed (use x in auto)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6819
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6820
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6821
        have "uncountable (closed_segment ?m c)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6822
          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
  6823
        then show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6824
          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
  6825
          apply (simp add: closed_segment_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6826
          by (simp add: countable_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6827
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6828
      then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6829
        by (force intro: that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6830
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6831
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6832
    proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6833
      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
  6834
        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
  6835
      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
  6836
        by (force simp: path_image_join)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6837
    qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6838
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6839
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6840
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6841
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6842
corollary connected_convex_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6843
  fixes U :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6844
  assumes "convex U" "~ collinear U" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6845
  shows "connected(U - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6846
  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
  6847
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6848
lemma path_connected_punctured_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6849
  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
  6850
    shows "path_connected(S - {a})"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6851
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6852
  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
  6853
    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
  6854
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6855
  proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6856
    assume "aff_dim S = -1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6857
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6858
      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
  6859
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6860
    assume "aff_dim S = 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6861
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6862
      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
  6863
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6864
    assume ge2: "aff_dim S \<ge> 2"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6865
    then have "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6866
    proof (clarsimp simp add: collinear_affine_hull)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6867
      fix u v
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6868
      assume "S \<subseteq> affine hull {u, v}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6869
      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
  6870
        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
  6871
      with ge2 show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6872
        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
  6873
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6874
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6875
      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
  6876
      by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6877
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6878
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6879
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6880
lemma connected_punctured_convex:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6881
  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
  6882
  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
  6883
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6884
lemma path_connected_complement_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6885
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6886
  assumes "2 \<le> DIM('a)" "countable S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6887
  shows "path_connected(- S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6888
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6889
  have "path_connected(UNIV - S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6890
    apply (rule path_connected_convex_diff_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6891
    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
  6892
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6893
    by (simp add: Compl_eq_Diff_UNIV)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6894
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6895
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6896
proposition path_connected_openin_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6897
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6898
  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
  6899
      and "~ collinear S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6900
    shows "path_connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6901
proof (clarsimp simp add: path_connected_component)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6902
  fix x y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6903
  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
  6904
  show "path_component (S - T) x y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6905
  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
  6906
    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
  6907
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6908
      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
  6909
        using opeU ope openin_trans by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6910
      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
  6911
                              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
  6912
        by (auto simp: openin_contains_ball)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6913
      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
  6914
        by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6915
      have "~ S \<subseteq> {x}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6916
        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
  6917
      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
  6918
        by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6919
      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
  6920
      proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6921
        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
  6922
          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
  6923
        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
  6924
          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
  6925
          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
  6926
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6927
      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
  6928
        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
  6929
      with x y subU have "uncountable U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6930
        by (meson countable_subset uncountable_convex)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6931
      then have "\<not> U \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6932
        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
  6933
      then show ?thesis by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6934
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6935
    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
  6936
              (\<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
  6937
          if "x \<in> S" for x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6938
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6939
      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
  6940
                 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
  6941
        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
  6942
      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
  6943
        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
  6944
      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
  6945
        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
  6946
      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
  6947
        apply (simp add: collinear_aff_dim)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6948
        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
  6949
      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
  6950
        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
  6951
      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
  6952
        using subS by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6953
      show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6954
      proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6955
        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
  6956
          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
  6957
        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
  6958
          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
  6959
        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
  6960
          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
  6961
      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
  6962
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6963
  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
  6964
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6965
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6966
corollary connected_openin_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6967
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6968
  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
  6969
      and "~ collinear S" "countable T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6970
    shows "connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6971
  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
  6972
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6973
corollary path_connected_open_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6974
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6975
  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
  6976
  shows "path_connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6977
proof (cases "S = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6978
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6979
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6980
    by (simp add: path_connected_empty)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6981
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6982
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6983
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6984
  proof (rule path_connected_openin_diff_countable)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6985
    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
  6986
      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
  6987
    show "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6988
      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
  6989
  qed (simp_all add: assms)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6990
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6991
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6992
corollary connected_open_diff_countable:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6993
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6994
  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
  6995
  shows "connected(S - T)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6996
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
  6997
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6998
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  6999
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7000
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
  7001
63974
721810140424 HOL-Analysis: fix latex generation
hoelzl
parents: 63970
diff changeset
  7002
subsubsection\<open>The theorem @{text homeomorphism_moving_points_exists}\<close>
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7003
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7004
lemma homeomorphism_moving_point_1:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7005
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7006
  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
  7007
  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
  7008
                    "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
  7009
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7010
  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
  7011
    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
  7012
  then have "0 < r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7013
    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
  7014
  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
  7015
  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
  7016
                  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
  7017
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7018
    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
  7019
      using eq by (simp add: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7020
    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
  7021
      by (metis diff_divide_distrib)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7022
    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
  7023
      using norm_triangle_ineq by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7024
    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
  7025
      using yx \<open>r > 0\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7026
      by (simp add: divide_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7027
    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
  7028
      apply (subst add_less_cancel_left)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7029
      apply (rule mult_strict_left_mono)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7030
      using nou \<open>0 < r\<close> yx
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7031
       apply (simp_all add: field_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7032
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7033
    also have "... = norm x"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7034
      by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7035
    finally show False by simp
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
  have "inj f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7038
    unfolding f_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7039
  proof (clarsimp simp: inj_on_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7040
    fix x y
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7041
    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
  7042
            (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
  7043
    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
  7044
      by (auto simp: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7045
    show "x=y"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7046
    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
  7047
      case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7048
      then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7049
        using eq by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7050
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7051
      case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7052
      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
  7053
        by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7054
      then have "False"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7055
      proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7056
        case 1 show False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7057
          using * [OF _ nou 1] eq by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7058
      next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7059
        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
  7060
          by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7061
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7062
      then show "x=y" ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7063
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7064
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7065
  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
  7066
    using inj_on_Int by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7067
  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
  7068
    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
  7069
  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
  7070
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7071
    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
  7072
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7073
      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
  7074
        using norm_triangle_ineq by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7075
      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
  7076
        by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7077
      also have "... \<le> r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7078
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7079
        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
  7080
          using that by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7081
        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
  7082
          by (simp add: algebra_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7083
        then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7084
        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
  7085
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7086
      finally show ?thesis .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7087
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7088
    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
  7089
      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
  7090
      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
  7091
    moreover have "f ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7092
      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
  7093
      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
  7094
    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
  7095
      by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7096
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7097
    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
  7098
    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
  7099
      fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7100
      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
  7101
      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
  7102
        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
  7103
      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
  7104
        by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7105
      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
  7106
      proof (rule image_eqI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7107
        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
  7108
          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
  7109
        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
  7110
          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
  7111
          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
  7112
          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
  7113
        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
  7114
          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
  7115
        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
  7116
          by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7117
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7118
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7119
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7120
  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
  7121
    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
  7122
    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
  7123
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7124
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7125
    apply (rule exE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7126
    apply (erule_tac f=f in that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7127
    using \<open>r > 0\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7128
     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
  7129
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7130
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7131
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7132
corollary homeomorphism_moving_point_2:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7133
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7134
  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
  7135
  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
  7136
                    "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
  7137
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7138
  have "0 < r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7139
    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
  7140
  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
  7141
                 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
  7142
    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
  7143
  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
  7144
                 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
  7145
    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
  7146
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7147
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7148
    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
  7149
      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
  7150
    have "g1 u = a"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7151
      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
  7152
    then show "(f2 \<circ> g1) u = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7153
      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
  7154
    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
  7155
      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
  7156
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7157
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7158
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7159
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7160
corollary homeomorphism_moving_point_3:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7161
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7162
  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
  7163
      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
  7164
  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
  7165
                    "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
  7166
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7167
  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
  7168
               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
  7169
    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
  7170
  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
  7171
    using fid hom homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7172
  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
  7173
  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
  7174
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7175
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7176
    show "homeomorphism S S ff gg"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7177
    proof (rule homeomorphismI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7178
      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
  7179
        apply (simp add: ff_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7180
        apply (rule continuous_on_cases)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7181
        using homeomorphism_cont1 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7182
            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
  7183
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7184
      then show "continuous_on S ff"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7185
        apply (rule continuous_on_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7186
        using ST by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7187
      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
  7188
        apply (simp add: gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7189
        apply (rule continuous_on_cases)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7190
        using homeomorphism_cont2 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7191
            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
  7192
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7193
      then show "continuous_on S gg"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7194
        apply (rule continuous_on_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7195
        using ST by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7196
      show "ff ` S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7197
      proof (clarsimp simp add: ff_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7198
        fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7199
        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
  7200
        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
  7201
          using homeomorphism_image1 [OF hom] by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7202
        then show "f x \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7203
          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
  7204
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7205
      show "gg ` S \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7206
      proof (clarsimp simp add: gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7207
        fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7208
        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
  7209
        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
  7210
          using homeomorphism_image2 [OF hom] by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7211
        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
  7212
          using homeomorphism_apply2 [OF hom]
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7213
            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
  7214
        then show "g x \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7215
          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
  7216
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7217
      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
  7218
        apply (simp add: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7219
        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
  7220
        apply auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7221
        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
  7222
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7223
      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
  7224
        apply (simp add: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7225
        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
  7226
        apply auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7227
        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
  7228
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7229
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7230
    show "ff u = v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7231
      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
  7232
    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
  7233
      by (auto simp: ff_def gg_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7234
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7235
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7236
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7237
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7238
proposition homeomorphism_moving_point:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7239
  fixes a :: "'a::euclidean_space"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7240
  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
  7241
      and "S \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7242
      and TS: "T \<subseteq> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7243
      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
  7244
  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
  7245
                    "{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
  7246
                    "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
  7247
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7248
  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
  7249
              {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
  7250
        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
  7251
        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
  7252
        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
  7253
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7254
    show homgf: "homeomorphism T T g f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7255
      by (metis homeomorphism_symD homfg)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7256
    then show "g (f d) = d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7257
      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
  7258
    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
  7259
      using S by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7260
    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
  7261
      using bo by (simp add: conj_commute)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7262
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7263
  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
  7264
                 {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
  7265
             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
  7266
                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
  7267
                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
  7268
                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
  7269
             for x f1 f2 g1 g2
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7270
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7271
    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
  7272
      by (metis homeomorphism_compose hom)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7273
    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
  7274
      by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7275
    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
  7276
      using sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7277
    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
  7278
      using bo by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7279
    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
  7280
      by (rule bounded_subset) auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7281
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7282
  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
  7283
              d \<in> U \<and>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7284
              (\<forall>x\<in>U.
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7285
                  \<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
  7286
                        {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
  7287
                        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
  7288
           if "d \<in> S" for d
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7289
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7290
    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
  7291
      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
  7292
    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
  7293
                   {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
  7294
                   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
  7295
      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
  7296
      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
  7297
            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
  7298
      using bounded_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7299
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7300
      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
  7301
      apply (intro conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7302
        apply (simp add: openin_open_Int)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7303
       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
  7304
      apply (blast intro: *)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7305
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7306
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7307
  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
  7308
              {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
  7309
    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
  7310
      apply (blast intro: 1 2 3)+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7311
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7312
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7313
    using that by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7314
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7315
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7316
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7317
lemma homeomorphism_moving_points_exists_gen:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7318
  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
  7319
             "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
  7320
      and "2 \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7321
      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
  7322
      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
  7323
  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
  7324
               {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
  7325
  using assms
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7326
proof (induction K)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7327
  case empty
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7328
  then show ?case
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7329
    by (force simp: homeomorphism_ident)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7330
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7331
  case (insert i K)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7332
  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
  7333
       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
  7334
       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
  7335
       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
  7336
    by (simp_all add: pairwise_insert)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7337
  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
  7338
               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
  7339
               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
  7340
    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
  7341
  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
  7342
                   {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
  7343
    using insert by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7344
  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
  7345
    apply (rule affine_hull_Diff)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7346
    apply (auto simp: insert)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7347
    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
  7348
  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
  7349
    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
  7350
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7351
    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
  7352
      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
  7353
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7354
      using fg_sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7355
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7356
  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
  7357
               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
  7358
               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
  7359
  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
  7360
    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
  7361
      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
  7362
    show "S - y ` K \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7363
      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
  7364
    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
  7365
      using insert by (simp add: aff_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7366
    show "connected (S - y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7367
    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
  7368
      show "\<not> collinear S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7369
        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
  7370
      show "countable (y ` K)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7371
        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
  7372
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7373
    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
  7374
      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
  7375
        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
  7376
    show "y i \<in> S - y ` K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7377
      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
  7378
  qed blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7379
  show ?case
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7380
  proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7381
    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
  7382
      using homfg homhk homeomorphism_compose by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7383
    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
  7384
      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
  7385
    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
  7386
      using fg_sub hk_sub by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7387
    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
  7388
      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
  7389
    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
  7390
      by (rule bounded_subset) auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7391
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7392
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7393
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7394
proposition homeomorphism_moving_points_exists:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7395
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7396
  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
  7397
      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
  7398
      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
  7399
      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
  7400
  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
  7401
                    "{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
  7402
proof (cases "S = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7403
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7404
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7405
    using KS homeomorphism_ident that by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7406
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7407
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7408
  then have affS: "affine hull S = UNIV"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7409
    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
  7410
  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
  7411
    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
  7412
  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
  7413
  also have "... = aff_dim (UNIV :: 'a set)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7414
    by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7415
  also have "... \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7416
    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
  7417
  finally have "2 \<le> aff_dim S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7418
    by linarith
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7419
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7420
    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
  7421
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7422
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7423
63974
721810140424 HOL-Analysis: fix latex generation
hoelzl
parents: 63970
diff changeset
  7424
subsubsection\<open>The theorem @{text homeomorphism_grouping_points_exists}\<close>
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7425
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7426
lemma homeomorphism_grouping_point_1:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7427
  fixes a::real and c::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7428
  assumes "a < b" "c < d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7429
  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
  7430
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7431
  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
  7432
  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
  7433
  proof (rule homeomorphism_compact)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7434
    show "continuous_on (cbox a b) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7435
      apply (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7436
      apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7437
      using assms by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7438
    have "f ` {a..b} = {c..d}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7439
      unfolding f_def image_affinity_atLeastAtMost
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7440
      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
  7441
    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
  7442
      by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7443
    show "inj_on f (cbox a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7444
      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
  7445
  qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7446
  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
  7447
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7448
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7449
    show "f a = c"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7450
      by (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7451
    show "f b = d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7452
      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
  7453
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7454
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7455
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7456
lemma homeomorphism_grouping_point_2:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7457
  fixes a::real and w::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7458
  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
  7459
      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
  7460
      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
  7461
      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
  7462
 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
  7463
                   "\<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
  7464
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7465
  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
  7466
    using assms by simp_all
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7467
  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
  7468
    by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7469
  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
  7470
  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
  7471
  proof (rule homeomorphism_compact)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7472
    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
  7473
      using hom_ab homeomorphism_cont1 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7474
    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
  7475
      using hom_bc homeomorphism_cont1 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7476
    show "continuous_on (cbox a c) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7477
      apply (simp add: f_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7478
      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
  7479
      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
  7480
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7481
    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
  7482
      unfolding f_def using eq by force+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7483
    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
  7484
      apply (simp only: ac uw image_Un)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7485
      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
  7486
    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
  7487
    proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7488
      have "f1 x \<in> cbox u v"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7489
        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
  7490
      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
  7491
        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
  7492
      moreover have "f2 y \<noteq> f2 b"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7493
        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
  7494
      ultimately show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7495
        using le eq by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7496
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7497
    have "inj_on f1 (cbox a b)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7498
      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
  7499
    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
  7500
      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
  7501
    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
  7502
      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
  7503
      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
  7504
      using neq12  apply force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7505
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7506
  qed auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7507
  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
  7508
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7509
    apply (rule that)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7510
    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
  7511
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7512
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7513
lemma homeomorphism_grouping_point_3:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7514
  fixes a::real
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7515
  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
  7516
      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
  7517
  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
  7518
                    "\<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
  7519
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7520
  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
  7521
    using assms
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7522
    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
  7523
  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
  7524
                   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
  7525
    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
  7526
  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
  7527
                   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
  7528
    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
  7529
  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
  7530
                   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
  7531
    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
  7532
  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
  7533
                 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
  7534
    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
  7535
  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
  7536
               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
  7537
    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
  7538
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7539
    apply (rule that [OF fg])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7540
    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
  7541
    apply simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7542
    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
  7543
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7544
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7545
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7546
lemma homeomorphism_grouping_point_4:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7547
  fixes T :: "real set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7548
  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
  7549
  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
  7550
                    "\<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
  7551
                    "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
  7552
proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7553
  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
  7554
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7555
    obtain u where "u \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7556
      using \<open>U \<noteq> {}\<close> by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7557
    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
  7558
      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
  7559
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7560
      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
  7561
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7562
  have "compact K"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7563
    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
  7564
  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
  7565
  proof (cases "K = {}")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7566
    case True then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7567
      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
  7568
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7569
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7570
    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
  7571
            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
  7572
      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
  7573
    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
  7574
      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
  7575
      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
  7576
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7577
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7578
      show "box a (b + e) \<noteq> {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7579
        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
  7580
      show "K \<subseteq> cbox a (b + e)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7581
        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
  7582
      have "a \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7583
        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
  7584
      have "b + e \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7585
        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
  7586
      show "cbox a (b + e) \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7587
        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
  7588
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7589
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7590
  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
  7591
  proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7592
    have "a \<in> S" "b \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7593
      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
  7594
    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
  7595
      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
  7596
    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
  7597
      by linarith+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7598
    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
  7599
      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
  7600
    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
  7601
      by (auto simp: dist_norm)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7602
    show ?thesis
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
      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
  7605
        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
  7606
      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
  7607
        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
  7608
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7609
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7610
  then
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7611
  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
  7612
               and "f w = w" "f z = z"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7613
               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
  7614
    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
  7615
    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
  7616
  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
  7617
    using hom homeomorphism_def by blast+
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7618
  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
  7619
  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
  7620
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7621
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7622
    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
  7623
      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
  7624
    show "homeomorphism T T f' g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7625
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7626
      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
  7627
        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
  7628
      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
  7629
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7630
         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
  7631
         apply (simp_all add: closed_subset)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7632
        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
  7633
        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
  7634
      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
  7635
        by (simp_all only: T)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7636
      show "f' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7637
        unfolding f'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7638
        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
  7639
      show "g' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7640
        unfolding g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7641
        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
  7642
      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
  7643
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7644
        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
  7645
      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
  7646
        unfolding f'_def g'_def
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7647
        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
  7648
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7649
    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
  7650
      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
  7651
    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
  7652
      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
  7653
    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
  7654
      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
  7655
      using bounded_cbox apply blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7656
      apply (auto simp: f'_def g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7657
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7658
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7659
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7660
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7661
proposition homeomorphism_grouping_points_exists:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7662
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7663
  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
  7664
  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
  7665
                    "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
  7666
proof (cases "2 \<le> DIM('a)")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7667
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7668
  have TS: "T \<subseteq> affine hull S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7669
    using affine_hull_open assms by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7670
  have "infinite U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7671
    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
  7672
  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
  7673
    using infinite_arbitrarily_large by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7674
  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
  7675
    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
  7676
  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
  7677
  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
  7678
    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
  7679
      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
  7680
    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
  7681
      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
  7682
  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
  7683
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7684
    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
  7685
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7686
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7687
  with DIM_positive have "DIM('a) = 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7688
    by (simp add: dual_order.antisym)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7689
  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
  7690
  where "linear h" "linear j"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7691
    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
  7692
    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
  7693
    and ranh: "surj h"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7694
    using isomorphisms_UNIV_UNIV
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7695
    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
  7696
  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
  7697
               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
  7698
               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
  7699
               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
  7700
    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
  7701
    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
  7702
  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
  7703
    by (metis hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7704
  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
  7705
    by (metis hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7706
  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
  7707
    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
  7708
  show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7709
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7710
    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
  7711
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7712
      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
  7713
        apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7714
        using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7715
      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
  7716
        apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7717
        using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7718
      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
  7719
        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
  7720
      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
  7721
        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
  7722
      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
  7723
        using hj hom homeomorphism_apply1 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7724
      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
  7725
        using hj hom homeomorphism_apply2 by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7726
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7727
    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
  7728
      apply (clarsimp simp: jf jg hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7729
      using sub hj
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7730
      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
  7731
      by (metis imageE)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7732
    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
  7733
      apply (rule bounded_linear_image [OF bou])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7734
      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
  7735
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7736
    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
  7737
      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
  7738
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7739
    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
  7740
      by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7741
    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
  7742
      using f hj by fastforce
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7743
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7744
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7745
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7746
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7747
proposition homeomorphism_grouping_points_exists_gen:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7748
  fixes S :: "'a::euclidean_space set"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7749
  assumes opeU: "openin (subtopology euclidean S) U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7750
      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
  7751
      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
  7752
  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
  7753
                    "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
  7754
proof (cases "2 \<le> aff_dim S")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7755
  case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7756
  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
  7757
    using opeS opeU openin_trans by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7758
  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
  7759
    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
  7760
  have "infinite U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7761
    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
  7762
    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
  7763
    using True apply simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7764
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7765
  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
  7766
    using infinite_arbitrarily_large by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7767
  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
  7768
    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
  7769
  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
  7770
               {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
  7771
  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
  7772
    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
  7773
      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
  7774
    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
  7775
      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
  7776
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7777
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7778
    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
  7779
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7780
  case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7781
  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
  7782
  then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7783
  proof cases
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7784
    assume "aff_dim S = -1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7785
    then have "S = {}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7786
      using aff_dim_empty by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7787
    then have "False"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7788
      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
  7789
    then show ?thesis ..
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7790
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7791
    assume "aff_dim S = 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7792
    then obtain a where "S = {a}"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7793
      using aff_dim_eq_0 by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7794
    then have "K \<subseteq> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7795
      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
  7796
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7797
      apply (rule that [of id id])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7798
      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
  7799
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7800
    assume "aff_dim S = 1"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7801
    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
  7802
      by (auto simp: homeomorphic_affine_sets)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7803
    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
  7804
      using homeomorphic_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7805
    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
  7806
      by (auto simp: homeomorphism_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7807
    have connh: "connected (h ` S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7808
      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
  7809
    have hUS: "h ` U \<subseteq> h ` S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7810
      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
  7811
    have op: "openin (subtopology euclidean (affine hull S)) U \<Longrightarrow> open (h ` U)" for U
64122
74fde524799e invariance of domain
paulson <lp15@cam.ac.uk>
parents: 64006
diff changeset
  7812
      using homeomorphism_imp_open_map [OF homhj]  by simp
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7813
    have "open (h ` U)" "open (h ` S)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7814
      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
  7815
    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
  7816
                 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
  7817
                 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
  7818
                 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
  7819
      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
  7820
      using assms by (auto simp: connh hUS)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7821
    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
  7822
      by (metis h j)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7823
    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
  7824
      by (metis h j)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7825
    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
  7826
      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
  7827
      using homeomorphism_def homhj apply blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7828
      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
  7829
    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
  7830
    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
  7831
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7832
    proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7833
      show "homeomorphism T T f' g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7834
      proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7835
        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
  7836
          apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7837
          using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7838
        then show "continuous_on T f'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7839
          apply (rule continuous_on_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7840
          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
  7841
        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
  7842
          apply (intro continuous_on_compose cont_hj)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7843
          using hom homeomorphism_def by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7844
        then show "continuous_on T g'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7845
          apply (rule continuous_on_eq)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7846
          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
  7847
        show "f' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7848
        proof (clarsimp simp: f'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7849
          fix x assume "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7850
          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
  7851
            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
  7852
          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
  7853
            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
  7854
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7855
        show "g' ` T \<subseteq> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7856
        proof (clarsimp simp: g'_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7857
          fix x assume "x \<in> T"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7858
          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
  7859
            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
  7860
          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
  7861
            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
  7862
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7863
        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
  7864
          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
  7865
        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
  7866
          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
  7867
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7868
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7869
      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
  7870
        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
  7871
        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
  7872
        by (metis h hull_inc)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7873
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7874
      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
  7875
        apply (rule bounded_closure_image)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7876
        apply (rule compact_imp_bounded)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7877
        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
  7878
      moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7879
      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
  7880
        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
  7881
      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
  7882
        by metis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7883
      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
  7884
        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
  7885
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7886
      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
  7887
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7888
        have "U \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7889
          using opeU openin_imp_subset by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7890
        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
  7891
          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
  7892
        then show "f' x \<in> U"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7893
          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
  7894
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7895
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7896
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7897
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7898
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7899
subsection\<open>nullhomotopic mappings\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7900
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7901
text\<open> A mapping out of a sphere is nullhomotopic iff it extends to the ball.
63978
efc958d2fe00 repair LaTeX
Lars Hupel <lars.hupel@mytum.de>
parents: 63974
diff changeset
  7902
This even works out in the degenerate cases when the radius is \<open>\<le>\<close> 0, and
63967
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7903
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
  7904
in both sides of the equivalence.\<close>
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7905
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7906
lemma nullhomotopic_from_lemma:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7907
  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
  7908
      and fa: "\<And>e. 0 < e
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7909
               \<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
  7910
      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
  7911
    shows "continuous_on (cball a r) f"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7912
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
  7913
  fix x
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7914
  assume x: "dist a x \<le> r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7915
  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
  7916
  proof (cases "x=a")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7917
    case True
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7918
    then show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7919
      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
  7920
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7921
    case False
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7922
    show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7923
    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
  7924
      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
  7925
                      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
  7926
      proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7927
        obtain d where "d > 0"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7928
           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
  7929
                                 dist (g x') (g x) < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7930
          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
  7931
          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
  7932
        show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7933
          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
  7934
          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
  7935
             (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
  7936
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7937
      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
  7938
        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
  7939
      show "0 < norm (x - a)"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7940
        using False by force
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7941
      show "x \<in> cball a r"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7942
        by (simp add: x)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7943
      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
  7944
        \<Longrightarrow> g x' = f x'"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7945
        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
  7946
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7947
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7948
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7949
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7950
proposition nullhomotopic_from_sphere_extension:
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7951
  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
  7952
  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
  7953
          (\<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
  7954
               (\<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
  7955
         (is "?lhs = ?rhs")
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7956
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
  7957
  case less
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7958
  then show ?thesis by simp
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7959
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7960
  case equal
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7961
  with continuous_on_const show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7962
    apply (auto simp: homotopic_with)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7963
    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
  7964
    apply (fastforce simp add:)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7965
    done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7966
next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7967
  case greater
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7968
  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
  7969
  have ?P if ?lhs using that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7970
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7971
    fix c
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7972
    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
  7973
    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
  7974
      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
  7975
    show ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7976
      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
  7977
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7978
  moreover have ?P if ?rhs using that
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7979
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7980
    fix g
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7981
    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
  7982
    then
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7983
    show ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7984
      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
  7985
      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
  7986
      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
  7987
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7988
  moreover have ?thesis if ?P
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7989
  proof
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7990
    assume ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7991
    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
  7992
      using homotopic_with_sym by blast
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7993
    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
  7994
                    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
  7995
                    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
  7996
      by (auto simp: homotopic_with_def)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7997
    obtain b1::'M where "b1 \<in> Basis"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7998
      using SOME_Basis by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  7999
    have "c \<in> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8000
      apply (rule him [THEN subsetD])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8001
      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
  8002
      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
  8003
       apply (auto simp: dist_norm)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8004
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8005
    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
  8006
      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
  8007
    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
  8008
                     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
  8009
    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
  8010
    show ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8011
    proof (intro exI conjI)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8012
      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
  8013
        apply (rule continuous_on_compose2 [OF conth])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8014
         apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8015
        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
  8016
        done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8017
      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
  8018
      proof (rule nullhomotopic_from_lemma)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8019
        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
  8020
        proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8021
          obtain d where "0 < d"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8022
             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
  8023
                        \<Longrightarrow> dist (h x') (h x) < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8024
            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
  8025
          have *: "norm (h (norm (x - a) / r,
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8026
                         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
  8027
                   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
  8028
          proof -
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8029
            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
  8030
                  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
  8031
              by (simp add: h)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8032
            also have "... < e"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8033
              apply (rule d [unfolded dist_norm])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8034
              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
  8035
                by (auto simp: dist_norm divide_simps)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8036
            finally show ?thesis .
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8037
          qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8038
          show ?thesis
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8039
            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
  8040
            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
  8041
        qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8042
        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
  8043
          by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8044
      qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8045
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8046
      show "?g ` cball a r \<subseteq> S"
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8047
        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
  8048
        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
  8049
    next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8050
      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
  8051
        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
  8052
    qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8053
  next
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8054
    assume ?rhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8055
    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
  8056
                    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
  8057
                    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
  8058
      by auto
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8059
    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
  8060
    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
  8061
      apply (rule continuous_on_compose2 [OF contg])
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8062
       apply (intro continuous_intros)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8063
      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
  8064
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8065
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8066
    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
  8067
      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
  8068
    moreover
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8069
    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
  8070
      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
  8071
    ultimately
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8072
    show ?lhs
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8073
      apply (subst homotopic_with_sym)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8074
      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
  8075
      apply (auto simp: homotopic_with)
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8076
      done
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8077
  qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8078
  ultimately
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8079
  show ?thesis by meson
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8080
qed
2aa42596edc3 new material on paths, etc. Also rationalisation
paulson <lp15@cam.ac.uk>
parents: 63955
diff changeset
  8081
62948
7700f467892b lots of new theorems for multivariate analysis
paulson <lp15@cam.ac.uk>
parents: 62843
diff changeset
  8082
end